@ynput/ayon-frontend-shared 0.3.28 → 0.3.29
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.cjs14.js +1 -1
- package/dist/_virtual/index.cjs15.js +1 -1
- package/dist/_virtual/index.cjs19.js +1 -1
- package/dist/_virtual/index.cjs4.js +1 -1
- package/dist/_virtual/index.cjs5.js +1 -1
- package/dist/_virtual/index.cjs6.js +1 -1
- package/dist/_virtual/index.cjs8.js +1 -1
- package/dist/_virtual/index.cjs9.js +1 -1
- package/dist/_virtual/index.es10.js +2 -2
- package/dist/_virtual/index.es11.js +2 -2
- package/dist/_virtual/index.es13.js +2 -2
- package/dist/_virtual/index.es14.js +2 -5
- package/dist/_virtual/index.es14.js.map +1 -1
- 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 +5 -2
- package/dist/_virtual/index.es4.js.map +1 -1
- package/dist/_virtual/index.es5.js +2 -5
- package/dist/_virtual/index.es5.js.map +1 -1
- package/dist/_virtual/index.es6.js +2 -2
- package/dist/_virtual/index.es8.js +2 -2
- package/dist/_virtual/index.es9.js +5 -2
- package/dist/_virtual/index.es9.js.map +1 -1
- package/dist/components.cjs.js +1 -1
- package/dist/components.es.js +34 -33
- package/dist/node_modules/match-sorter/dist/match-sorter.esm.cjs.js +1 -1
- package/dist/node_modules/match-sorter/dist/match-sorter.esm.es.js +1 -1
- package/dist/node_modules/remove-accents/index.cjs.js +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.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.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/runtime-core/dist/utils/semver/utils.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/semver/utils.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/@module-federation/sdk/dist/utils.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/sdk/dist/utils.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-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/components/EntityPanelUploader/EntityPanelUploader.cjs.js +1 -1
- package/dist/shared/src/components/EntityPanelUploader/EntityPanelUploader.cjs.js.map +1 -1
- package/dist/shared/src/components/EntityPanelUploader/EntityPanelUploader.es.js +155 -133
- package/dist/shared/src/components/EntityPanelUploader/EntityPanelUploader.es.js.map +1 -1
- package/dist/shared/src/components/Powerpack/PricingLink.cjs.js +1 -1
- package/dist/shared/src/components/Powerpack/PricingLink.cjs.js.map +1 -1
- package/dist/shared/src/components/Powerpack/PricingLink.es.js +5 -5
- package/dist/shared/src/components/Powerpack/PricingLink.es.js.map +1 -1
- package/dist/shared/src/components/ReviewablesSelector/ReviewablesSelector.cjs.js +1 -1
- package/dist/shared/src/components/ReviewablesSelector/ReviewablesSelector.cjs.js.map +1 -1
- package/dist/shared/src/components/ReviewablesSelector/ReviewablesSelector.es.js +29 -29
- package/dist/shared/src/components/ReviewablesSelector/ReviewablesSelector.es.js.map +1 -1
- package/dist/shared/src/components/VersionUploader/context/VersionUploadContext.cjs.js +1 -1
- package/dist/shared/src/components/VersionUploader/context/VersionUploadContext.cjs.js.map +1 -1
- package/dist/shared/src/components/VersionUploader/context/VersionUploadContext.es.js +100 -99
- package/dist/shared/src/components/VersionUploader/context/VersionUploadContext.es.js.map +1 -1
- package/dist/shared/src/containers/EntityPickerDialog/components/EntityTypeTable.cjs.js +1 -1
- package/dist/shared/src/containers/EntityPickerDialog/components/EntityTypeTable.cjs.js.map +1 -1
- package/dist/shared/src/containers/EntityPickerDialog/components/EntityTypeTable.es.js +23 -23
- package/dist/shared/src/containers/EntityPickerDialog/components/EntityTypeTable.es.js.map +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 +1 -1
- package/dist/shared/src/containers/Feed/Feed.es.js.map +1 -1
- package/dist/types/components/Powerpack/PricingLink.d.ts +1 -1
- package/dist/types/components/VersionUploader/context/VersionUploadContext.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as r } from "../../../../../_virtual/jsx-runtime.es.js";
|
|
2
|
-
import
|
|
2
|
+
import j from "../../SimpleTable/SimpleTable.es.js";
|
|
3
3
|
import "../../SimpleTable/context/SimpleTableContext.es.js";
|
|
4
|
-
import { Container as
|
|
4
|
+
import { Container as b } from "../../SimpleTable/SimpleTable.styled.es.js";
|
|
5
5
|
import "../../SimpleTable/SimpleTableRowTemplate.es.js";
|
|
6
|
-
import
|
|
7
|
-
import { upperFirst as
|
|
6
|
+
import h from "./EntityTypeTableHeader.es.js";
|
|
7
|
+
import { upperFirst as E } from "lodash";
|
|
8
8
|
import "../../../components/AddonLoadingScreen/AddonLoadingScreen.es.js";
|
|
9
9
|
import "react";
|
|
10
10
|
import "../../../../../node_modules/match-sorter/dist/match-sorter.esm.es.js";
|
|
@@ -129,7 +129,7 @@ import "../../../components/DetailsPanelDetails/DetailsSection.es.js";
|
|
|
129
129
|
import "../../../components/DetailsPanelDetails/FieldLabel.es.js";
|
|
130
130
|
import "../../../components/DoneCheckbox/DoneCheckbox.es.js";
|
|
131
131
|
import "../../../components/EarlyPreview/EarlyPreview.es.js";
|
|
132
|
-
import { EmptyPlaceholder as
|
|
132
|
+
import { EmptyPlaceholder as T } from "../../../components/EmptyPlaceholder/EmptyPlaceholder.es.js";
|
|
133
133
|
import "../../../components/EmptyPlaceholder/EmptyPlaceholderFlex.styled.es.js";
|
|
134
134
|
import "../../ContextMenu/ContextMenuContext.es.js";
|
|
135
135
|
/* empty css */
|
|
@@ -275,45 +275,45 @@ import "../../../components/Watchers/Watchers.es.js";
|
|
|
275
275
|
import "../../../components/Menu/Menu.styled.es.js";
|
|
276
276
|
import "../../../components/Menu/MenuItem.es.js";
|
|
277
277
|
import "../../../components/ReviewablesSelector/ReviewablesSelector.es.js";
|
|
278
|
-
const
|
|
279
|
-
entityType:
|
|
278
|
+
const Fm = ({
|
|
279
|
+
entityType: i,
|
|
280
280
|
tableData: o,
|
|
281
|
-
isLoading:
|
|
281
|
+
isLoading: m = !1,
|
|
282
282
|
error: e,
|
|
283
283
|
search: s,
|
|
284
284
|
onSearch: l,
|
|
285
285
|
isFolderHierarchy: n,
|
|
286
286
|
isMultiSelect: a,
|
|
287
|
-
onRowSubmit:
|
|
288
|
-
onScrollBottom:
|
|
287
|
+
onRowSubmit: d,
|
|
288
|
+
onScrollBottom: f
|
|
289
289
|
}) => {
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
const
|
|
293
|
-
|
|
290
|
+
const c = (p) => {
|
|
291
|
+
p.preventDefault();
|
|
292
|
+
const t = p.currentTarget.id, u = o.find((x) => x.id === t);
|
|
293
|
+
t && !u?.isDisabled && d?.(t);
|
|
294
294
|
};
|
|
295
|
-
return /* @__PURE__ */ r.jsxs(
|
|
295
|
+
return /* @__PURE__ */ r.jsxs(b, { children: [
|
|
296
296
|
/* @__PURE__ */ r.jsx(
|
|
297
|
-
|
|
297
|
+
h,
|
|
298
298
|
{
|
|
299
299
|
search: s,
|
|
300
300
|
onSearch: l,
|
|
301
|
-
title:
|
|
301
|
+
title: E(i) + "s"
|
|
302
302
|
}
|
|
303
303
|
),
|
|
304
|
-
!
|
|
304
|
+
!m && !o?.length && /* @__PURE__ */ r.jsx(T, { message: `No ${i}s found.`, error: e }),
|
|
305
305
|
/* @__PURE__ */ r.jsx(
|
|
306
|
-
|
|
306
|
+
j,
|
|
307
307
|
{
|
|
308
308
|
data: o,
|
|
309
|
-
isLoading:
|
|
309
|
+
isLoading: m,
|
|
310
310
|
isExpandable: n,
|
|
311
311
|
rowHeight: 34,
|
|
312
312
|
isMultiSelect: a,
|
|
313
|
-
onScrollBottom:
|
|
313
|
+
onScrollBottom: f,
|
|
314
314
|
pt: {
|
|
315
315
|
row: {
|
|
316
|
-
onDoubleClick:
|
|
316
|
+
onDoubleClick: c
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
}
|
|
@@ -321,6 +321,6 @@ const Hm = ({
|
|
|
321
321
|
] });
|
|
322
322
|
};
|
|
323
323
|
export {
|
|
324
|
-
|
|
324
|
+
Fm as default
|
|
325
325
|
};
|
|
326
326
|
//# sourceMappingURL=EntityTypeTable.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTypeTable.es.js","sources":["../../../../../../src/containers/EntityPickerDialog/components/EntityTypeTable.tsx"],"sourcesContent":["// Show's all data for a specific entity type with parent ids and optional search\n// When entity type is folder, the data defaults to a tree table when not searching and a flat table when searching\n\nimport { FC, useMemo } from 'react'\nimport { PickerEntityType } from '../EntityPickerDialog'\nimport SimpleTable, { Container, SimpleTableRow } from '@shared/containers/SimpleTable'\nimport EntityTypeTableHeader from './EntityTypeTableHeader'\nimport { upperFirst } from 'lodash'\nimport { useGetSearchedEntitiesLinksInfiniteQuery } from '@shared/api'\nimport { buildEntityPickerTableData } from '../util'\nimport { EmptyPlaceholder } from '@shared/components'\n\ninterface EntityTypeTableProps {\n entityType: PickerEntityType\n tableData: SimpleTableRow[] // Folder data if this is a folder table\n isLoading?: boolean // Whether folders are loading\n error?: string // Error message if any\n search?: string // The search term to filter the entities\n onSearch: (search: string | undefined) => void // Callback to handle search changes\n isFolderHierarchy?: boolean // Whether this is a folder hierarchy table\n isMultiSelect?: boolean // Whether to allow multiple selection\n onRowSubmit?: (id: string) => void // Callback when a row is submitted (e.g., double-clicked)\n onScrollBottom?: () => void // Callback when scrolled to the bottom of the table\n}\n\nconst EntityTypeTable: FC<EntityTypeTableProps> = ({\n entityType,\n tableData,\n isLoading = false,\n error,\n search,\n onSearch,\n isFolderHierarchy,\n isMultiSelect,\n onRowSubmit,\n onScrollBottom,\n}) => {\n const handleDoubleClick = (e: React.MouseEvent<HTMLTableRowElement>) => {\n e.preventDefault()\n const id = e.currentTarget.id\n if (id) {\n onRowSubmit?.(id)\n }\n }\n\n return (\n <Container>\n <EntityTypeTableHeader\n search={search}\n onSearch={onSearch}\n title={upperFirst(entityType) + 's'}\n />\n {!isLoading && !tableData?.length && (\n <EmptyPlaceholder message={`No ${entityType}s found.`} error={error} />\n )}\n <SimpleTable\n data={tableData}\n isLoading={isLoading}\n isExpandable={isFolderHierarchy}\n rowHeight={34}\n isMultiSelect={isMultiSelect}\n onScrollBottom={onScrollBottom}\n pt={{\n row: {\n onDoubleClick: handleDoubleClick,\n },\n }}\n />\n </Container>\n )\n}\n\nexport default EntityTypeTable\n"],"names":["EntityTypeTable","entityType","tableData","isLoading","error","search","onSearch","isFolderHierarchy","isMultiSelect","onRowSubmit","onScrollBottom","handleDoubleClick","e","id","Container","jsx","EntityTypeTableHeader","upperFirst","EmptyPlaceholder","SimpleTable"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAMA,KAA4C,CAAC;AAAA,EACjD,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AACF,MAAM;AACJ,QAAMC,IAAoB,CAACC,MAA6C;AACtE,IAAAA,EAAE,eAAA;AACF,UAAMC,IAAKD,EAAE,cAAc;
|
|
1
|
+
{"version":3,"file":"EntityTypeTable.es.js","sources":["../../../../../../src/containers/EntityPickerDialog/components/EntityTypeTable.tsx"],"sourcesContent":["// Show's all data for a specific entity type with parent ids and optional search\n// When entity type is folder, the data defaults to a tree table when not searching and a flat table when searching\n\nimport { FC, useMemo } from 'react'\nimport { PickerEntityType } from '../EntityPickerDialog'\nimport SimpleTable, { Container, SimpleTableRow } from '@shared/containers/SimpleTable'\nimport EntityTypeTableHeader from './EntityTypeTableHeader'\nimport { upperFirst } from 'lodash'\nimport { useGetSearchedEntitiesLinksInfiniteQuery } from '@shared/api'\nimport { buildEntityPickerTableData } from '../util'\nimport { EmptyPlaceholder } from '@shared/components'\n\ninterface EntityTypeTableProps {\n entityType: PickerEntityType\n tableData: SimpleTableRow[] // Folder data if this is a folder table\n isLoading?: boolean // Whether folders are loading\n error?: string // Error message if any\n search?: string // The search term to filter the entities\n onSearch: (search: string | undefined) => void // Callback to handle search changes\n isFolderHierarchy?: boolean // Whether this is a folder hierarchy table\n isMultiSelect?: boolean // Whether to allow multiple selection\n onRowSubmit?: (id: string) => void // Callback when a row is submitted (e.g., double-clicked)\n onScrollBottom?: () => void // Callback when scrolled to the bottom of the table\n}\n\nconst EntityTypeTable: FC<EntityTypeTableProps> = ({\n entityType,\n tableData,\n isLoading = false,\n error,\n search,\n onSearch,\n isFolderHierarchy,\n isMultiSelect,\n onRowSubmit,\n onScrollBottom,\n}) => {\n const handleDoubleClick = (e: React.MouseEvent<HTMLTableRowElement>) => {\n e.preventDefault()\n const id = e.currentTarget.id\n const row = tableData.find((r) => r.id === id)\n if (id && !row?.isDisabled) {\n onRowSubmit?.(id)\n }\n }\n\n return (\n <Container>\n <EntityTypeTableHeader\n search={search}\n onSearch={onSearch}\n title={upperFirst(entityType) + 's'}\n />\n {!isLoading && !tableData?.length && (\n <EmptyPlaceholder message={`No ${entityType}s found.`} error={error} />\n )}\n <SimpleTable\n data={tableData}\n isLoading={isLoading}\n isExpandable={isFolderHierarchy}\n rowHeight={34}\n isMultiSelect={isMultiSelect}\n onScrollBottom={onScrollBottom}\n pt={{\n row: {\n onDoubleClick: handleDoubleClick,\n },\n }}\n />\n </Container>\n )\n}\n\nexport default EntityTypeTable\n"],"names":["EntityTypeTable","entityType","tableData","isLoading","error","search","onSearch","isFolderHierarchy","isMultiSelect","onRowSubmit","onScrollBottom","handleDoubleClick","e","id","row","r","Container","jsx","EntityTypeTableHeader","upperFirst","EmptyPlaceholder","SimpleTable"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAMA,KAA4C,CAAC;AAAA,EACjD,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AACF,MAAM;AACJ,QAAMC,IAAoB,CAACC,MAA6C;AACtE,IAAAA,EAAE,eAAA;AACF,UAAMC,IAAKD,EAAE,cAAc,IACrBE,IAAMZ,EAAU,KAAK,CAACa,MAAMA,EAAE,OAAOF,CAAE;AAC7C,IAAIA,KAAM,CAACC,GAAK,cACdL,IAAcI,CAAE;AAAA,EAEpB;AAEA,gCACGG,GAAA,EACC,UAAA;AAAA,IAAAC,gBAAAA,EAAAA;AAAAA,MAACC;AAAA,MAAA;AAAA,QACC,QAAAb;AAAA,QACA,UAAAC;AAAA,QACA,OAAOa,EAAWlB,CAAU,IAAI;AAAA,MAAA;AAAA,IAAA;AAAA,IAEjC,CAACE,KAAa,CAACD,GAAW,UACzBe,gBAAAA,EAAAA,IAACG,GAAA,EAAiB,SAAS,MAAMnB,CAAU,YAAY,OAAAG,EAAA,CAAc;AAAA,IAEvEa,gBAAAA,EAAAA;AAAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAMnB;AAAA,QACN,WAAAC;AAAA,QACA,cAAcI;AAAA,QACd,WAAW;AAAA,QACX,eAAAC;AAAA,QACA,gBAAAE;AAAA,QACA,IAAI;AAAA,UACF,KAAK;AAAA,YACH,eAAeC;AAAA,UAAA;AAAA,QACjB;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../../../_virtual/jsx-runtime.cjs.js"),q=require("react"),le=require("./components/ActivityItem.cjs.js"),de=require("./components/CommentInput/CommentInput.cjs.js"),E=require("./Feed.styled.cjs.js"),qe=require("./hooks/useCommentMutations.cjs.js"),me=require("./hooks/useTransformActivities.cjs.js"),pe=require("../../../../node_modules/react-intersection-observer/dist/index.cjs.js"),ge=require("./hooks/useSaveScrollPos.cjs.js"),he=require("./hooks/useScrollOnInputOpen.cjs.js"),xe=require("./feedHelpers.cjs.js");require("@ynput/ayon-react-components");const ye=require("clsx"),fe=require("./hooks/useScrollToHighlighted.cjs.js"),ve=require("./components/FileUploadPreview/FileUploadPreview.cjs.js"),Ce=require("../../components/EmptyPlaceholder/EmptyPlaceholder.cjs.js");require("../../components/EmptyPlaceholder/EmptyPlaceholderFlex.styled.cjs.js");const h=require("./context/FeedContext.cjs.js");require("../../context/RemoteModulesContext.cjs.js");const ke=require("../../context/DetailsPanelContext.cjs.js");require("../../context/SubtasksModulesContext.cjs.js");require("../../context/ThumbnailUploaderContext.cjs.js");require("../../context/SettingsPanelContext.cjs.js");require("../../context/pip/PiPProvider.cjs.js");require("react-dom");require("../../context/pip/PiPWrapper.cjs.js");require("../../context/AddonProjectContext.cjs.js");require("../../context/AddonContext.cjs.js");require("../../context/PowerpackContext.cjs.js");require("../../context/MoveEntityContext.cjs.js");require("../../context/MenuContext.cjs.js");require("../../context/WebsocketContext.cjs.js");require("../../context/GlobalContext.cjs.js");require("../../context/ProjectContext.cjs.js");require("../../context/ProjectFoldersContext.cjs.js");require("../../context/UriContext.cjs.js");require("../../api/base/client.cjs.js");require("../../api/generated/graphql.cjs.js");require("../../api/generated/graphqlLinks.cjs.js");require("../../api/generated/access.cjs.js");require("../../api/generated/actions.cjs.js");require("../../api/generated/activityFeed.cjs.js");require("../../api/generated/addons.cjs.js");require("../../api/generated/anatomy.cjs.js");require("../../api/generated/attributes.cjs.js");require("../../api/generated/authentication.cjs.js");require("../../api/generated/bundles.cjs.js");require("../../api/generated/configuration.cjs.js");require("../../api/generated/dataImport.cjs.js");require("../../api/generated/desktop.cjs.js");require("../../api/generated/entityLists.cjs.js");require("../../api/generated/events.cjs.js");require("../../api/generated/files.cjs.js");require("../../api/generated/folders.cjs.js");require("../../api/generated/inbox.cjs.js");require("../../api/generated/links.cjs.js");require("../../api/generated/market.cjs.js");require("../../api/generated/onboarding.cjs.js");require("../../api/generated/operations.cjs.js");require("../../api/generated/products.cjs.js");require("../../api/generated/projectDashboard.cjs.js");require("../../api/generated/projects.cjs.js");require("../../api/generated/projectFolders.cjs.js");require("../../api/generated/reviewables.cjs.js");require("../../api/generated/services.cjs.js");require("../../api/generated/system.cjs.js");require("../../api/generated/tasks.cjs.js");require("../../api/generated/teams.cjs.js");require("../../api/generated/thumbnails.cjs.js");require("../../api/generated/uRIs.cjs.js");require("../../api/generated/users.cjs.js");require("../../api/generated/versions.cjs.js");require("../../api/generated/workfiles.cjs.js");require("../../api/generated/ynputCloud.cjs.js");require("../../api/generated/grouping.cjs.js");require("../../api/generated/views.cjs.js");require("../../api/queries/actions/getActions.cjs.js");require("../../api/queries/activities/getActivities.cjs.js");require("../../api/queries/activities/updateActivities.cjs.js");require("../../api/queries/activities/updateReaction.cjs.js");require("../../api/queries/activities/getMentions.cjs.js");require("../../api/queries/activities/getCategories.cjs.js");require("../../api/queries/addons/getAddons.cjs.js");require("../../api/queries/addons/updateAddons.cjs.js");require("../../api/queries/attributes/getAttributes.cjs.js");require("../../api/queries/attributes/updateAttributes.cjs.js");require("../../api/queries/authentication/getAuthentication.cjs.js");require("../../api/queries/cloud/cloud.cjs.js");require("../../api/queries/config/getConfig.cjs.js");require("../../api/queries/config/updateConfig.cjs.js");require("../../api/queries/entities/getEntity.cjs.js");require("../../api/queries/entities/getEntityPanel.cjs.js");require("../../api/queries/entities/updateEntity.cjs.js");require("../../api/queries/entityLists/getLists.cjs.js");require("../../api/queries/entityLists/updateLists.cjs.js");require("../../api/queries/entityLists/getListsAttributes.cjs.js");require("../../api/queries/entityLists/updateListsAttributes.cjs.js");require("../../api/queries/entityLists/listFolders.cjs.js");require("../../api/queries/folders/getFolders.cjs.js");require("../../api/queries/folders/getFolderDeleteInfo.cjs.js");require("../../api/queries/grouping/getGrouping.cjs.js");require("../../api/queries/links/updateLinks.cjs.js");require("../../api/queries/links/getLinks.cjs.js");require("../../api/queries/links/getEntityLinks.cjs.js");require("../../api/queries/overview/getOverview.cjs.js");require("../../api/queries/overview/updateOverview.cjs.js");require("../../api/queries/versions/getVersionsProducts.cjs.js");const Ee=require("../../api/queries/permissions/getPermissions.cjs.js");require("../../api/queries/products/createProduct.cjs.js");require("../../api/queries/products/getFolderProducts.cjs.js");require("../../api/queries/project/getProject.cjs.js");require("../../api/queries/project/updateProject.cjs.js");require("../../api/queries/projectFolders/projectFolders.cjs.js");require("../../api/queries/review/getReview.cjs.js");require("../../api/queries/review/updateReview.cjs.js");require("../../api/queries/share/share.cjs.js");require("../../api/queries/system/getSystem.cjs.js");require("../../api/queries/tasks/getTasks.cjs.js");require("../../api/queries/tasks/updateTasks.cjs.js");require("../../api/queries/teams/getTeams.cjs.js");require("../../api/queries/userDashboard/getUserDashboard.cjs.js");require("../../api/queries/users/getUsers.cjs.js");require("../../api/queries/users/updateUsers.cjs.js");require("../../api/queries/users/guests.cjs.js");require("../../api/queries/versions/updateVersions.cjs.js");require("../../api/queries/views/getViews.cjs.js");require("../../api/queries/views/updateViews.cjs.js");require("../../api/queries/watchers/getWatchers.cjs.js");require("../../api/queries/uris/getUris.cjs.js");const Fe=require("./helpers/mergeAnnotationAttachments.cjs.js"),je=require("../DetailsPanel/components/TabHeaderAndFilters/TabHeaderAndFilters.cjs.js"),Ie=30,Me=[{id:"comments",tooltip:"Comments",icon:"chat"},{id:"checklists",tooltip:"Checklists",icon:"checklist"},{id:"versions",tooltip:"Published versions",icon:"layers"},{id:"updates",tooltip:"Entity updates",icon:"arrow_circle_right"}],Pe=({disabled:_,readOnly:D,statuses:H=[],entityListId:B,isSlideOut:W})=>{const{projectName:o,entities:l,entityType:m,editingId:F,projectInfo:j,setEditingId:I,userName:V,activitiesData:x,isLoadingNew:a,isLoadingNextPage:M,loadNextPage:d,hasNextPage:U,users:G,feedFilter:u,setFeedFilter:Q}=h.useFeedContext(),{openSlideOut:z,highlightedActivities:y,setHighlightedActivities:J,onOpenImage:K,setFeedAnnotations:P,user:R}=ke.useDetailsPanelContext(),X=u.conditions?.some(e=>"key"in e&&e.key==="versions"&&e.value===!0),Y=u.conditions?.some(e=>"key"in e&&["comments","checklists","versions","updates"].includes(e.key)&&e.value===!0),w=u.conditions?.some(e=>"key"in e&&(e.key==="comments"||e.key==="checklists")&&e.value===!0),{data:b,isLoading:Z}=Ee.useGetMyProjectPermissionsQuery({projectName:o},{skip:!o}),$=!R.data?.isManager&&!R.data?.isAdmin&&!Z&&b?.activities?.enabled&&!b?.activities?.activities?.includes("comment")||Y&&!w,p=q.useMemo(()=>Fe(x),[x]);q.useEffect(()=>{p.length||P([]);const e=p.map(r=>r.activityData?.annotations?.map(i=>({...i,activityId:r.activityId}))).filter(Boolean).flat();P(e)},[p]);const f=me.default(p,G,j,m,V,u),c=q.useRef(null);he({feedRef:c,isInputOpen:F===h.FEED_NEW_COMMENT,height:93}),ge({entities:l,feedRef:c,filter:u,disabled:!!y.length,isLoading:a}),fe({feedRef:c,highlighted:y,isLoading:a||M,loadNextPage:d,hasNextPage:!!d,activities:x});const{submitComment:A,updateComment:N,deleteComment:ee,isSaving:re}=qe({projectName:o,entityType:m,entities:l,filter:u,entityListId:B}),ie=q.useCallback(async(e,r=[],i={})=>{await A(e,r,i),c.current&&c.current.scrollTo({top:0})},[A,c]),te=(e,r)=>{const i=e?.target;if(!i||!r)return console.log("no target or activity");const t=i.checked,n=t?"[ ]":"[x]",ue=t?"[x]":"[ ]",{body:g}=r,T=Array.from(i.closest(".comment-body")?.querySelectorAll(".task-list-item")||[]).findIndex(k=>k===i.closest("li"));let O=T;(g.match(/\[.\]/g)||[]).forEach((k,ae)=>{k!==n&&ae<T&&O--});const L=[];let v=-1;for(;(v=g.indexOf(n,v+1))>-1;)L.push(v);const C=L[O];if(C===void 0)return;const ce=C+n.length,S=g.slice(0,C)+ue+g.slice(ce);S&&N(r,S,r.files)},se=e=>{const{entityId:r,entityType:i,activityId:t}=e;if(!i||!["version","task","folder"].includes(i))return console.log("Entity type not supported yet");if(!r||!i||!o)return console.log("No entity id or type found");z({entityId:r,entityType:i,projectName:o}),J([t])},ne=({index:e,activityId:r})=>{const i=Object.values(f).reverse().filter(t=>t.activityType=="comment").map(t=>({id:t.activityId,files:t.files.filter(n=>ve.isFilePreviewable(n.mime,n.ext))})).filter(t=>t.files.length>0);K?.({files:i,activityId:r,index:e,projectName:o})},oe=q.useMemo(()=>xe.getLoadingPlaceholders(10),[]);return s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:s.jsxRuntimeExports.jsxs(E.FeedContainer,{className:"feed",children:[void 0,s.jsxRuntimeExports.jsx(je,{label:"Activity Feed",filters:Me,currentFilter:u,onFilterChange:Q,isLoading:a}),s.jsxRuntimeExports.jsxs(E.FeedContent,{ref:c,className:ye({loading:a},"no-shimmer"),children:[a?oe:f.map(e=>s.jsxRuntimeExports.jsx(le,{activity:e,onCheckChange:te,onDelete:ee,onUpdate:async(r,i,t,n)=>await N(e,r,i,n),projectInfo:j,projectName:o,entityType:m,onReferenceClick:se,createdAts:l.map(r=>r.createdAt),onFileExpand:ne,showOrigin:l.length>1,filter:u,editProps:{projectName:o,entities:l,entityType:m},isHighlighted:y.includes(e.activityId),readOnly:D,statuses:H,isSlideOut:W},e.activityId)),f.length===1&&X&&!w&&!a&&s.jsxRuntimeExports.jsx(Ce.EmptyPlaceholder,{message:"No versions published yet",icon:"layers"}),U&&d&&s.jsxRuntimeExports.jsx(pe.InView,{root:c.current,onChange:e=>e&&d(),rootMargin:"400px 0px 0px 0px",children:s.jsxRuntimeExports.jsx(E.LoadMore,{style:{height:0},onClick:()=>d(),children:M?"Loading more...":"Click to load more"})})]}),!$&&s.jsxRuntimeExports.jsx(de.default,{initValue:null,onSubmit:ie,isOpen:F===h.FEED_NEW_COMMENT,onClose:()=>I(null),onOpen:()=>I(h.FEED_NEW_COMMENT),disabled:_,isLoading:a||!l.length||re})]})})};exports.Feed=Pe;exports.activitiesLast=Ie;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../../../_virtual/jsx-runtime.cjs.js"),q=require("react"),le=require("./components/ActivityItem.cjs.js"),de=require("./components/CommentInput/CommentInput.cjs.js"),E=require("./Feed.styled.cjs.js"),qe=require("./hooks/useCommentMutations.cjs.js"),me=require("./hooks/useTransformActivities.cjs.js"),pe=require("../../../../node_modules/react-intersection-observer/dist/index.cjs.js"),ge=require("./hooks/useSaveScrollPos.cjs.js"),he=require("./hooks/useScrollOnInputOpen.cjs.js"),xe=require("./feedHelpers.cjs.js");require("@ynput/ayon-react-components");const ye=require("clsx"),fe=require("./hooks/useScrollToHighlighted.cjs.js"),ve=require("./components/FileUploadPreview/FileUploadPreview.cjs.js"),Ce=require("../../components/EmptyPlaceholder/EmptyPlaceholder.cjs.js");require("../../components/EmptyPlaceholder/EmptyPlaceholderFlex.styled.cjs.js");const h=require("./context/FeedContext.cjs.js");require("../../context/RemoteModulesContext.cjs.js");const ke=require("../../context/DetailsPanelContext.cjs.js");require("../../context/SubtasksModulesContext.cjs.js");require("../../context/ThumbnailUploaderContext.cjs.js");require("../../context/SettingsPanelContext.cjs.js");require("../../context/pip/PiPProvider.cjs.js");require("react-dom");require("../../context/pip/PiPWrapper.cjs.js");require("../../context/AddonProjectContext.cjs.js");require("../../context/AddonContext.cjs.js");require("../../context/PowerpackContext.cjs.js");require("../../context/MoveEntityContext.cjs.js");require("../../context/MenuContext.cjs.js");require("../../context/WebsocketContext.cjs.js");require("../../context/GlobalContext.cjs.js");require("../../context/ProjectContext.cjs.js");require("../../context/ProjectFoldersContext.cjs.js");require("../../context/UriContext.cjs.js");require("../../api/base/client.cjs.js");require("../../api/generated/graphql.cjs.js");require("../../api/generated/graphqlLinks.cjs.js");require("../../api/generated/access.cjs.js");require("../../api/generated/actions.cjs.js");require("../../api/generated/activityFeed.cjs.js");require("../../api/generated/addons.cjs.js");require("../../api/generated/anatomy.cjs.js");require("../../api/generated/attributes.cjs.js");require("../../api/generated/authentication.cjs.js");require("../../api/generated/bundles.cjs.js");require("../../api/generated/configuration.cjs.js");require("../../api/generated/dataImport.cjs.js");require("../../api/generated/desktop.cjs.js");require("../../api/generated/entityLists.cjs.js");require("../../api/generated/events.cjs.js");require("../../api/generated/files.cjs.js");require("../../api/generated/folders.cjs.js");require("../../api/generated/inbox.cjs.js");require("../../api/generated/links.cjs.js");require("../../api/generated/market.cjs.js");require("../../api/generated/onboarding.cjs.js");require("../../api/generated/operations.cjs.js");require("../../api/generated/products.cjs.js");require("../../api/generated/projectDashboard.cjs.js");require("../../api/generated/projects.cjs.js");require("../../api/generated/projectFolders.cjs.js");require("../../api/generated/reviewables.cjs.js");require("../../api/generated/services.cjs.js");require("../../api/generated/system.cjs.js");require("../../api/generated/tasks.cjs.js");require("../../api/generated/teams.cjs.js");require("../../api/generated/thumbnails.cjs.js");require("../../api/generated/uRIs.cjs.js");require("../../api/generated/users.cjs.js");require("../../api/generated/versions.cjs.js");require("../../api/generated/workfiles.cjs.js");require("../../api/generated/ynputCloud.cjs.js");require("../../api/generated/grouping.cjs.js");require("../../api/generated/views.cjs.js");require("../../api/queries/actions/getActions.cjs.js");require("../../api/queries/activities/getActivities.cjs.js");require("../../api/queries/activities/updateActivities.cjs.js");require("../../api/queries/activities/updateReaction.cjs.js");require("../../api/queries/activities/getMentions.cjs.js");require("../../api/queries/activities/getCategories.cjs.js");require("../../api/queries/addons/getAddons.cjs.js");require("../../api/queries/addons/updateAddons.cjs.js");require("../../api/queries/attributes/getAttributes.cjs.js");require("../../api/queries/attributes/updateAttributes.cjs.js");require("../../api/queries/authentication/getAuthentication.cjs.js");require("../../api/queries/cloud/cloud.cjs.js");require("../../api/queries/config/getConfig.cjs.js");require("../../api/queries/config/updateConfig.cjs.js");require("../../api/queries/entities/getEntity.cjs.js");require("../../api/queries/entities/getEntityPanel.cjs.js");require("../../api/queries/entities/updateEntity.cjs.js");require("../../api/queries/entityLists/getLists.cjs.js");require("../../api/queries/entityLists/updateLists.cjs.js");require("../../api/queries/entityLists/getListsAttributes.cjs.js");require("../../api/queries/entityLists/updateListsAttributes.cjs.js");require("../../api/queries/entityLists/listFolders.cjs.js");require("../../api/queries/folders/getFolders.cjs.js");require("../../api/queries/folders/getFolderDeleteInfo.cjs.js");require("../../api/queries/grouping/getGrouping.cjs.js");require("../../api/queries/links/updateLinks.cjs.js");require("../../api/queries/links/getLinks.cjs.js");require("../../api/queries/links/getEntityLinks.cjs.js");require("../../api/queries/overview/getOverview.cjs.js");require("../../api/queries/overview/updateOverview.cjs.js");require("../../api/queries/versions/getVersionsProducts.cjs.js");const Ee=require("../../api/queries/permissions/getPermissions.cjs.js");require("../../api/queries/products/createProduct.cjs.js");require("../../api/queries/products/getFolderProducts.cjs.js");require("../../api/queries/project/getProject.cjs.js");require("../../api/queries/project/updateProject.cjs.js");require("../../api/queries/projectFolders/projectFolders.cjs.js");require("../../api/queries/review/getReview.cjs.js");require("../../api/queries/review/updateReview.cjs.js");require("../../api/queries/share/share.cjs.js");require("../../api/queries/system/getSystem.cjs.js");require("../../api/queries/tasks/getTasks.cjs.js");require("../../api/queries/tasks/updateTasks.cjs.js");require("../../api/queries/teams/getTeams.cjs.js");require("../../api/queries/userDashboard/getUserDashboard.cjs.js");require("../../api/queries/users/getUsers.cjs.js");require("../../api/queries/users/updateUsers.cjs.js");require("../../api/queries/users/guests.cjs.js");require("../../api/queries/versions/updateVersions.cjs.js");require("../../api/queries/views/getViews.cjs.js");require("../../api/queries/views/updateViews.cjs.js");require("../../api/queries/watchers/getWatchers.cjs.js");require("../../api/queries/uris/getUris.cjs.js");const Fe=require("./helpers/mergeAnnotationAttachments.cjs.js"),je=require("../DetailsPanel/components/TabHeaderAndFilters/TabHeaderAndFilters.cjs.js"),Ie=30,Me=[{id:"comments",tooltip:"Comments",icon:"chat"},{id:"checklists",tooltip:"Checklists",icon:"checklist"},{id:"versions",tooltip:"Published versions",icon:"layers"},{id:"updates",tooltip:"Entity updates",icon:"arrow_circle_right"}],Pe=({disabled:_,readOnly:D,statuses:H=[],entityListId:B,isSlideOut:W})=>{const{projectName:o,entities:l,entityType:m,editingId:F,projectInfo:j,setEditingId:I,userName:V,activitiesData:x,isLoadingNew:a,isLoadingNextPage:M,loadNextPage:d,hasNextPage:U,users:G,feedFilter:u,setFeedFilter:Q}=h.useFeedContext(),{openSlideOut:z,highlightedActivities:y,setHighlightedActivities:J,onOpenImage:K,setFeedAnnotations:P,user:R}=ke.useDetailsPanelContext(),X=u.conditions?.some(e=>"key"in e&&e.key==="versions"&&e.value===!0),Y=u.conditions?.some(e=>"key"in e&&["comments","checklists","versions","updates"].includes(e.key)&&e.value===!0),w=u.conditions?.some(e=>"key"in e&&(e.key==="comments"||e.key==="checklists")&&e.value===!0),{data:b,isLoading:Z}=Ee.useGetMyProjectPermissionsQuery({projectName:o},{skip:!o}),$=!R.data?.isManager&&!R.data?.isAdmin&&!Z&&b?.activities?.enabled&&!b?.activities?.activities?.includes("comment")||Y&&!w,p=q.useMemo(()=>Fe(x),[x]);q.useEffect(()=>{p.length||P([]);const e=p.map(r=>r.activityData?.annotations?.map(i=>({...i,activityId:r.activityId}))).filter(Boolean).flat();P(e)},[p]);const f=me.default(p,G,j,m,V,u),c=q.useRef(null);he({feedRef:c,isInputOpen:F===h.FEED_NEW_COMMENT,height:93}),ge({entities:l,feedRef:c,filter:u,disabled:!!y.length,isLoading:a}),fe({feedRef:c,highlighted:y,isLoading:a||M,loadNextPage:d,hasNextPage:!!d,activities:x});const{submitComment:A,updateComment:N,deleteComment:ee,isSaving:re}=qe({projectName:o,entityType:m,entities:l,filter:u,entityListId:B}),ie=q.useCallback(async(e,r=[],i={})=>{await A(e,r,i),c.current&&c.current.scrollTo({top:0})},[A,c]),te=(e,r)=>{const i=e?.target;if(!i||!r)return console.log("no target or activity");const t=i.checked,n=t?"[ ]":"[x]",ue=t?"[x]":"[ ]",{body:g}=r,T=Array.from(i.closest(".comment-body")?.querySelectorAll(".task-list-item")||[]).findIndex(k=>k===i.closest("li"));let O=T;(g.match(/\[.\]/g)||[]).forEach((k,ae)=>{k!==n&&ae<T&&O--});const L=[];let v=-1;for(;(v=g.indexOf(n,v+1))>-1;)L.push(v);const C=L[O];if(C===void 0)return;const ce=C+n.length,S=g.slice(0,C)+ue+g.slice(ce);S&&N(r,S,r.files)},se=e=>{const{entityId:r,entityType:i,activityId:t}=e;if(!i||!["version","task","folder"].includes(i))return console.log("Entity type not supported yet");if(!r||!i||!o)return console.log("No entity id or type found");z({entityId:r,entityType:i,projectName:o}),J([t])},ne=({index:e,activityId:r})=>{const i=Object.values(f).reverse().filter(t=>t.activityType=="comment").map(t=>({id:t.activityId,files:t.files.filter(n=>ve.isFilePreviewable(n.mime,n.ext))})).filter(t=>t.files.length>0);K?.({files:i,activityId:r,index:e,projectName:o})},oe=q.useMemo(()=>xe.getLoadingPlaceholders(10),[]);return s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:s.jsxRuntimeExports.jsxs(E.FeedContainer,{className:"feed",children:[void 0,s.jsxRuntimeExports.jsx(je,{label:"Activity Feed",filters:Me,currentFilter:u,onFilterChange:Q,isLoading:a}),s.jsxRuntimeExports.jsxs(E.FeedContent,{ref:c,className:ye({loading:a},"no-shimmer"),children:[a?oe:f.map(e=>s.jsxRuntimeExports.jsx(le,{activity:e,onCheckChange:te,onDelete:ee,onUpdate:async(r,i,t,n)=>await N(e,r,i,n),projectInfo:j,projectName:o,entityType:m,onReferenceClick:se,createdAts:l.map(r=>r.createdAt),onFileExpand:ne,showOrigin:l.length>1,filter:u,editProps:{projectName:o,entities:l,entityType:m},isHighlighted:y.includes(e.activityId),readOnly:D,statuses:H,isSlideOut:W},e.activityId)),f.length===0&&X&&!w&&!a&&s.jsxRuntimeExports.jsx(Ce.EmptyPlaceholder,{message:"No versions published yet",icon:"layers"}),U&&d&&s.jsxRuntimeExports.jsx(pe.InView,{root:c.current,onChange:e=>e&&d(),rootMargin:"400px 0px 0px 0px",children:s.jsxRuntimeExports.jsx(E.LoadMore,{style:{height:0},onClick:()=>d(),children:M?"Loading more...":"Click to load more"})})]}),!$&&s.jsxRuntimeExports.jsx(de.default,{initValue:null,onSubmit:ie,isOpen:F===h.FEED_NEW_COMMENT,onClose:()=>I(null),onOpen:()=>I(h.FEED_NEW_COMMENT),disabled:_,isLoading:a||!l.length||re})]})})};exports.Feed=Pe;exports.activitiesLast=Ie;
|
|
2
2
|
//# sourceMappingURL=Feed.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Feed.cjs.js","sources":["../../../../../src/containers/Feed/Feed.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react'\nimport ActivityItem from './components/ActivityItem'\nimport CommentInput from './components/CommentInput/CommentInput'\nimport * as Styled from './Feed.styled'\nimport useCommentMutations, { Activity } from './hooks/useCommentMutations'\nimport useTransformActivities from './hooks/useTransformActivities'\nimport { InView } from 'react-intersection-observer'\nimport useSaveScrollPos from './hooks/useSaveScrollPos'\nimport useScrollOnInputOpen from './hooks/useScrollOnInputOpen'\nimport { getLoadingPlaceholders } from './feedHelpers'\nimport { Icon } from '@ynput/ayon-react-components'\nimport clsx from 'clsx'\nimport useScrollToHighlighted from './hooks/useScrollToHighlighted'\nimport { isFilePreviewable } from './components/FileUploadPreview/FileUploadPreview'\nimport EmptyPlaceholder from '@shared/components/EmptyPlaceholder'\nimport { useFeedContext, FEED_NEW_COMMENT } from './context/FeedContext'\nimport { Status } from '../ProjectTreeTable/types/project'\nimport { useDetailsPanelContext, FeedFilter } from '@shared/context'\nimport { DetailsPanelEntityType, useGetMyProjectPermissionsQuery } from '@shared/api'\nimport mergeAnnotationAttachments from './helpers/mergeAnnotationAttachments'\nimport { SavedAnnotationMetadata } from '.'\nimport TabHeaderAndFilters, {\n FilterItem,\n} from '../DetailsPanel/components/TabHeaderAndFilters/TabHeaderAndFilters'\n\n// number of activities to get\nexport const activitiesLast = 30\n\nconst feedFilters: FilterItem<string>[] = [\n {\n id: 'comments',\n tooltip: 'Comments',\n icon: 'chat',\n },\n {\n id: 'checklists',\n tooltip: 'Checklists',\n icon: 'checklist',\n },\n {\n id: 'versions',\n tooltip: 'Published versions',\n icon: 'layers',\n },\n {\n id: 'updates',\n tooltip: 'Entity updates',\n icon: 'arrow_circle_right',\n },\n]\n\nexport type FeedProps = {\n disabled?: boolean\n readOnly: boolean\n statuses: Status[]\n entityListId?: string | undefined\n isSlideOut?: boolean\n}\n\nexport const Feed = ({\n disabled,\n readOnly,\n statuses = [],\n entityListId,\n isSlideOut,\n}: FeedProps) => {\n const {\n projectName,\n entities,\n entityType,\n editingId,\n projectInfo,\n setEditingId,\n userName,\n activitiesData,\n isLoadingNew,\n isLoadingNextPage,\n loadNextPage,\n hasNextPage,\n users,\n feedFilter,\n setFeedFilter,\n } = useFeedContext()\n\n const {\n openSlideOut,\n highlightedActivities,\n setHighlightedActivities,\n onOpenImage,\n setFeedAnnotations,\n user,\n } = useDetailsPanelContext()\n\n const isVersionsFilter = feedFilter.conditions?.some(\n (c) => 'key' in c && c.key === 'versions' && c.value === true,\n )\n const hasActiveFilters = feedFilter.conditions?.some(\n (c) => 'key' in c && ['comments', 'checklists', 'versions', 'updates'].includes(c.key) && c.value === true,\n )\n const hasCommentLikeFilter = feedFilter.conditions?.some(\n (c) => 'key' in c && (c.key === 'comments' || c.key === 'checklists') && c.value === true,\n )\n\n // check activities permission for commenting\n const {\n data: projectPermissions,\n isLoading: isLoadingPermissions,\n } = useGetMyProjectPermissionsQuery(\n { projectName },\n { skip: !projectName },\n )\n const isCommentRestricted =\n !user.data?.isManager &&\n !user.data?.isAdmin &&\n !isLoadingPermissions &&\n projectPermissions?.activities?.enabled &&\n !projectPermissions?.activities?.activities?.includes('comment')\n\n // hide comment input for specific filters or when restricted by permissions\n const hideCommentInput = isCommentRestricted || (hasActiveFilters && !hasCommentLikeFilter)\n\n const activitiesWithMergedAnnotations = useMemo(\n () => mergeAnnotationAttachments(activitiesData),\n [activitiesData],\n )\n\n useEffect(() => {\n if (!activitiesWithMergedAnnotations.length) {\n setFeedAnnotations([])\n }\n\n const annotations = activitiesWithMergedAnnotations\n .map((activity) =>\n activity.activityData?.annotations?.map((a: SavedAnnotationMetadata) => ({\n ...a,\n activityId: activity.activityId,\n })),\n )\n .filter(Boolean)\n .flat()\n\n setFeedAnnotations(annotations)\n }, [activitiesWithMergedAnnotations])\n\n // do any transformation on activities data\n // 1. status change activities, attach status data based on projectName\n // 2. reverse the order\n // 3. is this activity from the current user?\n const transformedActivitiesData = useTransformActivities(\n // @ts-ignore\n activitiesWithMergedAnnotations,\n users,\n projectInfo,\n entityType,\n userName,\n feedFilter,\n ) as any[]\n\n // REFS\n const feedRef = useRef(null)\n // const commentInputRef = useRef(null)\n\n // scroll by height of comment input when it opens or closes\n useScrollOnInputOpen({ feedRef, isInputOpen: editingId === FEED_NEW_COMMENT, height: 93 })\n\n // save scroll position of a feed\n useSaveScrollPos({\n entities,\n feedRef,\n filter: feedFilter,\n disabled: !!highlightedActivities.length,\n isLoading: isLoadingNew,\n })\n // try and scroll to highlightedActivities activity\n useScrollToHighlighted({\n feedRef,\n highlighted: highlightedActivities,\n isLoading: isLoadingNew || isLoadingNextPage,\n loadNextPage,\n hasNextPage: !!loadNextPage,\n activities: activitiesData,\n })\n\n // comment mutations here!\n const {\n submitComment: submitCommentMutation,\n updateComment,\n deleteComment,\n isSaving,\n } = useCommentMutations({\n projectName,\n entityType: entityType,\n entities,\n filter: feedFilter,\n entityListId,\n })\n\n // wrap submitComment to scroll to bottom\n const submitComment = useCallback(\n async (value: string, files: any[] = [], data: any = {}) => {\n await submitCommentMutation(value, files, data)\n // scroll to bottom (scrollTop 0 is bottom because of column-reverse)\n if (feedRef.current) {\n ;(feedRef.current as any).scrollTo({ top: 0 })\n }\n },\n [submitCommentMutation, feedRef],\n )\n\n // When a checkbox is clicked, update the body to add/remove \"x\" in [ ] markdown\n // Then update comment with new body\n const handleCommentChecked = (e: React.ChangeEvent<HTMLInputElement>, activity: Activity) => {\n const target = e?.target\n if (!target || !activity) return console.log('no target or activity')\n\n // the value that it's changing to\n const checked: boolean = target.checked\n const currentMarkdown: string = checked ? '[ ]' : '[x]'\n const newMarkdown: string = checked ? '[x]' : '[ ]'\n\n const { body } = activity\n\n // based on all li elements in the whole className 'comment-body' with className 'task-list-item'\n // find the index of the task that was checked\n const taskIndex: number = Array.from(\n target.closest('.comment-body')?.querySelectorAll('.task-list-item') || [],\n ).findIndex((li: Element) => li === target.closest('li'))\n\n let replaceIndex: number = taskIndex\n\n // count the number of current markdowns in the body\n const allMarkdowns: string[] = body.match(/\\[.\\]/g) || []\n\n allMarkdowns.forEach((markdown: string, index: number) => {\n // does it match the current markdown?\n if (markdown !== currentMarkdown && index < taskIndex) replaceIndex--\n })\n\n // now find the indexes of the current markdown to replace\n const indexesOfCurrentMarkdownInBody: number[] = []\n let index: number = -1\n while ((index = body.indexOf(currentMarkdown, index + 1)) > -1) {\n indexesOfCurrentMarkdownInBody.push(index)\n }\n\n const indexToReplaceInBody: number | undefined = indexesOfCurrentMarkdownInBody[replaceIndex]\n if (indexToReplaceInBody === undefined) return\n\n const endReplaceIndex: number = indexToReplaceInBody + currentMarkdown.length\n\n // replace the current markdown with the new markdown\n const newBody: string =\n body.slice(0, indexToReplaceInBody) + newMarkdown + body.slice(endReplaceIndex)\n\n if (!newBody) return\n\n updateComment(activity, newBody, activity.files)\n }\n\n const handleRefClick = (ref: {\n entityId: string\n entityType: DetailsPanelEntityType\n activityId: string\n }) => {\n const { entityId, entityType, activityId } = ref\n const supportedTypes = ['version', 'task', 'folder']\n\n if (!entityType || !supportedTypes.includes(entityType))\n return console.log('Entity type not supported yet')\n\n if (!entityId || !entityType || !projectName) return console.log('No entity id or type found')\n\n // open the slide out\n openSlideOut({ entityId, entityType, projectName })\n // set highlighted activity\n setHighlightedActivities([activityId])\n }\n\n const handleFileExpand = ({ index, activityId }: { index: number; activityId: string }) => {\n const previewableFiles = Object.values(transformedActivitiesData)\n .reverse()\n .filter((a) => a.activityType == 'comment')\n .map((a) => ({\n id: a.activityId,\n files: a.files.filter((file: any) => isFilePreviewable(file.mime, file.ext)),\n }))\n .filter((a) => a.files.length > 0)\n\n // open image callback\n onOpenImage?.({ files: previewableFiles, activityId, index, projectName })\n }\n\n const loadingPlaceholders = useMemo(() => getLoadingPlaceholders(10), [])\n\n let warningMessage\n\n return (\n <>\n <Styled.FeedContainer className=\"feed\">\n {warningMessage && (\n <Styled.Warning>\n <Icon icon=\"info\" />\n {warningMessage}\n </Styled.Warning>\n )}\n <TabHeaderAndFilters\n label=\"Activity Feed\"\n filters={feedFilters}\n currentFilter={feedFilter}\n onFilterChange={setFeedFilter}\n isLoading={isLoadingNew}\n />\n <Styled.FeedContent ref={feedRef} className={clsx({ loading: isLoadingNew }, 'no-shimmer')}>\n {isLoadingNew\n ? loadingPlaceholders\n : transformedActivitiesData.map((activity) => (\n <ActivityItem\n key={activity.activityId}\n activity={activity}\n onCheckChange={handleCommentChecked}\n onDelete={deleteComment}\n onUpdate={async (value, files, _refs, data) =>\n await updateComment(activity, value, files, data)\n }\n projectInfo={projectInfo}\n projectName={projectName}\n entityType={entityType}\n onReferenceClick={handleRefClick}\n createdAts={entities.map((e) => e.createdAt)}\n onFileExpand={handleFileExpand}\n showOrigin={entities.length > 1}\n filter={feedFilter}\n editProps={{\n projectName,\n entities: entities,\n entityType,\n }}\n isHighlighted={highlightedActivities.includes(activity.activityId)}\n readOnly={readOnly}\n statuses={statuses}\n isSlideOut={isSlideOut}\n />\n ))}\n {/* message when no versions published */}\n {transformedActivitiesData.length === 1 &&\n isVersionsFilter &&\n !hasCommentLikeFilter &&\n !isLoadingNew && (\n <EmptyPlaceholder message=\"No versions published yet\" icon=\"layers\" />\n )}\n {hasNextPage && loadNextPage && (\n <InView\n root={feedRef.current}\n onChange={(inView) => inView && loadNextPage()}\n rootMargin={'400px 0px 0px 0px'}\n >\n <Styled.LoadMore style={{ height: 0 }} onClick={() => loadNextPage()}>\n {isLoadingNextPage ? 'Loading more...' : 'Click to load more'}\n </Styled.LoadMore>\n </InView>\n )}\n </Styled.FeedContent>\n {!hideCommentInput && (\n <CommentInput\n initValue={null}\n onSubmit={submitComment}\n isOpen={editingId === FEED_NEW_COMMENT}\n onClose={() => setEditingId(null)}\n onOpen={() => setEditingId(FEED_NEW_COMMENT)}\n disabled={disabled}\n isLoading={isLoadingNew || !entities.length || isSaving}\n />\n )}\n </Styled.FeedContainer>\n </>\n )\n}\n"],"names":["activitiesLast","feedFilters","Feed","disabled","readOnly","statuses","entityListId","isSlideOut","projectName","entities","entityType","editingId","projectInfo","setEditingId","userName","activitiesData","isLoadingNew","isLoadingNextPage","loadNextPage","hasNextPage","users","feedFilter","setFeedFilter","useFeedContext","openSlideOut","highlightedActivities","setHighlightedActivities","onOpenImage","setFeedAnnotations","user","useDetailsPanelContext","isVersionsFilter","c","hasActiveFilters","hasCommentLikeFilter","projectPermissions","isLoadingPermissions","useGetMyProjectPermissionsQuery","hideCommentInput","activitiesWithMergedAnnotations","useMemo","mergeAnnotationAttachments","useEffect","annotations","activity","a","transformedActivitiesData","useTransformActivities","feedRef","useRef","useScrollOnInputOpen","FEED_NEW_COMMENT","useSaveScrollPos","useScrollToHighlighted","submitCommentMutation","updateComment","deleteComment","isSaving","useCommentMutations","submitComment","useCallback","value","files","data","handleCommentChecked","target","checked","currentMarkdown","newMarkdown","body","taskIndex","li","replaceIndex","markdown","index","indexesOfCurrentMarkdownInBody","indexToReplaceInBody","endReplaceIndex","newBody","handleRefClick","ref","entityId","activityId","handleFileExpand","previewableFiles","file","isFilePreviewable","loadingPlaceholders","getLoadingPlaceholders","jsxs","Styled.FeedContainer","jsx","TabHeaderAndFilters","Styled.FeedContent","clsx","ActivityItem","_refs","e","EmptyPlaceholder","InView","inView","Styled.LoadMore","CommentInput"],"mappings":"6zNA0BaA,GAAiB,GAExBC,GAAoC,CACxC,CACE,GAAI,WACJ,QAA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AAE,CAAA,EAvBKqC,EAAS,UAAA,CAyBjB,EAEJE,EAA0B,SAAW,GACpCf,GACA,CAACG,GACD,CAAClB,GACD2E,EAAAA,kBAAAA,IAACO,GAAAA,iBAAA,CAAiB,QAAQ,4BAA4B,KAAK,QAAA,CAAS,EAErE/E,GAAeD,GACdyE,EAAAA,kBAAAA,IAACQ,GAAAA,OAAA,CACC,KAAMnD,EAAQ,QACd,SAAWoD,GAAWA,GAAUlF,EAAA,EAChC,WAAY,oBAEZ,SAAAyE,EAAAA,kBAAAA,IAACU,EAAAA,SAAA,CAAgB,MAAO,CAAE,OAAQ,CAAA,EAAK,QAAS,IAAMnF,EAAA,EACnD,SAAAD,EAAoB,kBAAoB,oBAAA,CAC3C,CAAA,CAAA,CACF,EAEJ,EACC,CAACqB,GACAqD,EAAAA,kBAAAA,IAACW,GAAAA,QAAA,CACC,UAAW,KACX,SAAU3C,GACV,OAAQhD,IAAcwC,EAAAA,iBACtB,QAAS,IAAMtC,EAAa,IAAI,EAChC,OAAQ,IAAMA,EAAasC,kBAAgB,EAC3C,SAAAhD,EACA,UAAWa,GAAgB,CAACP,EAAS,QAAUgD,EAAA,CAAA,CACjD,CAAA,CAEJ,CAAA,CACF,CAEJ"}
|
|
1
|
+
{"version":3,"file":"Feed.cjs.js","sources":["../../../../../src/containers/Feed/Feed.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react'\nimport ActivityItem from './components/ActivityItem'\nimport CommentInput from './components/CommentInput/CommentInput'\nimport * as Styled from './Feed.styled'\nimport useCommentMutations, { Activity } from './hooks/useCommentMutations'\nimport useTransformActivities from './hooks/useTransformActivities'\nimport { InView } from 'react-intersection-observer'\nimport useSaveScrollPos from './hooks/useSaveScrollPos'\nimport useScrollOnInputOpen from './hooks/useScrollOnInputOpen'\nimport { getLoadingPlaceholders } from './feedHelpers'\nimport { Icon } from '@ynput/ayon-react-components'\nimport clsx from 'clsx'\nimport useScrollToHighlighted from './hooks/useScrollToHighlighted'\nimport { isFilePreviewable } from './components/FileUploadPreview/FileUploadPreview'\nimport EmptyPlaceholder from '@shared/components/EmptyPlaceholder'\nimport { useFeedContext, FEED_NEW_COMMENT } from './context/FeedContext'\nimport { Status } from '../ProjectTreeTable/types/project'\nimport { useDetailsPanelContext, FeedFilter } from '@shared/context'\nimport { DetailsPanelEntityType, useGetMyProjectPermissionsQuery } from '@shared/api'\nimport mergeAnnotationAttachments from './helpers/mergeAnnotationAttachments'\nimport { SavedAnnotationMetadata } from '.'\nimport TabHeaderAndFilters, {\n FilterItem,\n} from '../DetailsPanel/components/TabHeaderAndFilters/TabHeaderAndFilters'\n\n// number of activities to get\nexport const activitiesLast = 30\n\nconst feedFilters: FilterItem<string>[] = [\n {\n id: 'comments',\n tooltip: 'Comments',\n icon: 'chat',\n },\n {\n id: 'checklists',\n tooltip: 'Checklists',\n icon: 'checklist',\n },\n {\n id: 'versions',\n tooltip: 'Published versions',\n icon: 'layers',\n },\n {\n id: 'updates',\n tooltip: 'Entity updates',\n icon: 'arrow_circle_right',\n },\n]\n\nexport type FeedProps = {\n disabled?: boolean\n readOnly: boolean\n statuses: Status[]\n entityListId?: string | undefined\n isSlideOut?: boolean\n}\n\nexport const Feed = ({\n disabled,\n readOnly,\n statuses = [],\n entityListId,\n isSlideOut,\n}: FeedProps) => {\n const {\n projectName,\n entities,\n entityType,\n editingId,\n projectInfo,\n setEditingId,\n userName,\n activitiesData,\n isLoadingNew,\n isLoadingNextPage,\n loadNextPage,\n hasNextPage,\n users,\n feedFilter,\n setFeedFilter,\n } = useFeedContext()\n\n const {\n openSlideOut,\n highlightedActivities,\n setHighlightedActivities,\n onOpenImage,\n setFeedAnnotations,\n user,\n } = useDetailsPanelContext()\n\n const isVersionsFilter = feedFilter.conditions?.some(\n (c) => 'key' in c && c.key === 'versions' && c.value === true,\n )\n const hasActiveFilters = feedFilter.conditions?.some(\n (c) => 'key' in c && ['comments', 'checklists', 'versions', 'updates'].includes(c.key) && c.value === true,\n )\n const hasCommentLikeFilter = feedFilter.conditions?.some(\n (c) => 'key' in c && (c.key === 'comments' || c.key === 'checklists') && c.value === true,\n )\n\n // check activities permission for commenting\n const {\n data: projectPermissions,\n isLoading: isLoadingPermissions,\n } = useGetMyProjectPermissionsQuery(\n { projectName },\n { skip: !projectName },\n )\n const isCommentRestricted =\n !user.data?.isManager &&\n !user.data?.isAdmin &&\n !isLoadingPermissions &&\n projectPermissions?.activities?.enabled &&\n !projectPermissions?.activities?.activities?.includes('comment')\n\n // hide comment input for specific filters or when restricted by permissions\n const hideCommentInput = isCommentRestricted || (hasActiveFilters && !hasCommentLikeFilter)\n\n const activitiesWithMergedAnnotations = useMemo(\n () => mergeAnnotationAttachments(activitiesData),\n [activitiesData],\n )\n\n useEffect(() => {\n if (!activitiesWithMergedAnnotations.length) {\n setFeedAnnotations([])\n }\n\n const annotations = activitiesWithMergedAnnotations\n .map((activity) =>\n activity.activityData?.annotations?.map((a: SavedAnnotationMetadata) => ({\n ...a,\n activityId: activity.activityId,\n })),\n )\n .filter(Boolean)\n .flat()\n\n setFeedAnnotations(annotations)\n }, [activitiesWithMergedAnnotations])\n\n // do any transformation on activities data\n // 1. status change activities, attach status data based on projectName\n // 2. reverse the order\n // 3. is this activity from the current user?\n const transformedActivitiesData = useTransformActivities(\n // @ts-ignore\n activitiesWithMergedAnnotations,\n users,\n projectInfo,\n entityType,\n userName,\n feedFilter,\n ) as any[]\n\n // REFS\n const feedRef = useRef(null)\n // const commentInputRef = useRef(null)\n\n // scroll by height of comment input when it opens or closes\n useScrollOnInputOpen({ feedRef, isInputOpen: editingId === FEED_NEW_COMMENT, height: 93 })\n\n // save scroll position of a feed\n useSaveScrollPos({\n entities,\n feedRef,\n filter: feedFilter,\n disabled: !!highlightedActivities.length,\n isLoading: isLoadingNew,\n })\n // try and scroll to highlightedActivities activity\n useScrollToHighlighted({\n feedRef,\n highlighted: highlightedActivities,\n isLoading: isLoadingNew || isLoadingNextPage,\n loadNextPage,\n hasNextPage: !!loadNextPage,\n activities: activitiesData,\n })\n\n // comment mutations here!\n const {\n submitComment: submitCommentMutation,\n updateComment,\n deleteComment,\n isSaving,\n } = useCommentMutations({\n projectName,\n entityType: entityType,\n entities,\n filter: feedFilter,\n entityListId,\n })\n\n // wrap submitComment to scroll to bottom\n const submitComment = useCallback(\n async (value: string, files: any[] = [], data: any = {}) => {\n await submitCommentMutation(value, files, data)\n // scroll to bottom (scrollTop 0 is bottom because of column-reverse)\n if (feedRef.current) {\n ;(feedRef.current as any).scrollTo({ top: 0 })\n }\n },\n [submitCommentMutation, feedRef],\n )\n\n // When a checkbox is clicked, update the body to add/remove \"x\" in [ ] markdown\n // Then update comment with new body\n const handleCommentChecked = (e: React.ChangeEvent<HTMLInputElement>, activity: Activity) => {\n const target = e?.target\n if (!target || !activity) return console.log('no target or activity')\n\n // the value that it's changing to\n const checked: boolean = target.checked\n const currentMarkdown: string = checked ? '[ ]' : '[x]'\n const newMarkdown: string = checked ? '[x]' : '[ ]'\n\n const { body } = activity\n\n // based on all li elements in the whole className 'comment-body' with className 'task-list-item'\n // find the index of the task that was checked\n const taskIndex: number = Array.from(\n target.closest('.comment-body')?.querySelectorAll('.task-list-item') || [],\n ).findIndex((li: Element) => li === target.closest('li'))\n\n let replaceIndex: number = taskIndex\n\n // count the number of current markdowns in the body\n const allMarkdowns: string[] = body.match(/\\[.\\]/g) || []\n\n allMarkdowns.forEach((markdown: string, index: number) => {\n // does it match the current markdown?\n if (markdown !== currentMarkdown && index < taskIndex) replaceIndex--\n })\n\n // now find the indexes of the current markdown to replace\n const indexesOfCurrentMarkdownInBody: number[] = []\n let index: number = -1\n while ((index = body.indexOf(currentMarkdown, index + 1)) > -1) {\n indexesOfCurrentMarkdownInBody.push(index)\n }\n\n const indexToReplaceInBody: number | undefined = indexesOfCurrentMarkdownInBody[replaceIndex]\n if (indexToReplaceInBody === undefined) return\n\n const endReplaceIndex: number = indexToReplaceInBody + currentMarkdown.length\n\n // replace the current markdown with the new markdown\n const newBody: string =\n body.slice(0, indexToReplaceInBody) + newMarkdown + body.slice(endReplaceIndex)\n\n if (!newBody) return\n\n updateComment(activity, newBody, activity.files)\n }\n\n const handleRefClick = (ref: {\n entityId: string\n entityType: DetailsPanelEntityType\n activityId: string\n }) => {\n const { entityId, entityType, activityId } = ref\n const supportedTypes = ['version', 'task', 'folder']\n\n if (!entityType || !supportedTypes.includes(entityType))\n return console.log('Entity type not supported yet')\n\n if (!entityId || !entityType || !projectName) return console.log('No entity id or type found')\n\n // open the slide out\n openSlideOut({ entityId, entityType, projectName })\n // set highlighted activity\n setHighlightedActivities([activityId])\n }\n\n const handleFileExpand = ({ index, activityId }: { index: number; activityId: string }) => {\n const previewableFiles = Object.values(transformedActivitiesData)\n .reverse()\n .filter((a) => a.activityType == 'comment')\n .map((a) => ({\n id: a.activityId,\n files: a.files.filter((file: any) => isFilePreviewable(file.mime, file.ext)),\n }))\n .filter((a) => a.files.length > 0)\n\n // open image callback\n onOpenImage?.({ files: previewableFiles, activityId, index, projectName })\n }\n\n const loadingPlaceholders = useMemo(() => getLoadingPlaceholders(10), [])\n\n let warningMessage\n\n return (\n <>\n <Styled.FeedContainer className=\"feed\">\n {warningMessage && (\n <Styled.Warning>\n <Icon icon=\"info\" />\n {warningMessage}\n </Styled.Warning>\n )}\n <TabHeaderAndFilters\n label=\"Activity Feed\"\n filters={feedFilters}\n currentFilter={feedFilter}\n onFilterChange={setFeedFilter}\n isLoading={isLoadingNew}\n />\n <Styled.FeedContent ref={feedRef} className={clsx({ loading: isLoadingNew }, 'no-shimmer')}>\n {isLoadingNew\n ? loadingPlaceholders\n : transformedActivitiesData.map((activity) => (\n <ActivityItem\n key={activity.activityId}\n activity={activity}\n onCheckChange={handleCommentChecked}\n onDelete={deleteComment}\n onUpdate={async (value, files, _refs, data) =>\n await updateComment(activity, value, files, data)\n }\n projectInfo={projectInfo}\n projectName={projectName}\n entityType={entityType}\n onReferenceClick={handleRefClick}\n createdAts={entities.map((e) => e.createdAt)}\n onFileExpand={handleFileExpand}\n showOrigin={entities.length > 1}\n filter={feedFilter}\n editProps={{\n projectName,\n entities: entities,\n entityType,\n }}\n isHighlighted={highlightedActivities.includes(activity.activityId)}\n readOnly={readOnly}\n statuses={statuses}\n isSlideOut={isSlideOut}\n />\n ))}\n {/* message when no versions published */}\n {transformedActivitiesData.length === 0 &&\n isVersionsFilter &&\n !hasCommentLikeFilter &&\n !isLoadingNew && (\n <EmptyPlaceholder message=\"No versions published yet\" icon=\"layers\" />\n )}\n {hasNextPage && loadNextPage && (\n <InView\n root={feedRef.current}\n onChange={(inView) => inView && loadNextPage()}\n rootMargin={'400px 0px 0px 0px'}\n >\n <Styled.LoadMore style={{ height: 0 }} onClick={() => loadNextPage()}>\n {isLoadingNextPage ? 'Loading more...' : 'Click to load more'}\n </Styled.LoadMore>\n </InView>\n )}\n </Styled.FeedContent>\n {!hideCommentInput && (\n <CommentInput\n initValue={null}\n onSubmit={submitComment}\n isOpen={editingId === FEED_NEW_COMMENT}\n onClose={() => setEditingId(null)}\n onOpen={() => setEditingId(FEED_NEW_COMMENT)}\n disabled={disabled}\n isLoading={isLoadingNew || !entities.length || isSaving}\n />\n )}\n </Styled.FeedContainer>\n </>\n )\n}\n"],"names":["activitiesLast","feedFilters","Feed","disabled","readOnly","statuses","entityListId","isSlideOut","projectName","entities","entityType","editingId","projectInfo","setEditingId","userName","activitiesData","isLoadingNew","isLoadingNextPage","loadNextPage","hasNextPage","users","feedFilter","setFeedFilter","useFeedContext","openSlideOut","highlightedActivities","setHighlightedActivities","onOpenImage","setFeedAnnotations","user","useDetailsPanelContext","isVersionsFilter","c","hasActiveFilters","hasCommentLikeFilter","projectPermissions","isLoadingPermissions","useGetMyProjectPermissionsQuery","hideCommentInput","activitiesWithMergedAnnotations","useMemo","mergeAnnotationAttachments","useEffect","annotations","activity","a","transformedActivitiesData","useTransformActivities","feedRef","useRef","useScrollOnInputOpen","FEED_NEW_COMMENT","useSaveScrollPos","useScrollToHighlighted","submitCommentMutation","updateComment","deleteComment","isSaving","useCommentMutations","submitComment","useCallback","value","files","data","handleCommentChecked","target","checked","currentMarkdown","newMarkdown","body","taskIndex","li","replaceIndex","markdown","index","indexesOfCurrentMarkdownInBody","indexToReplaceInBody","endReplaceIndex","newBody","handleRefClick","ref","entityId","activityId","handleFileExpand","previewableFiles","file","isFilePreviewable","loadingPlaceholders","getLoadingPlaceholders","jsxs","Styled.FeedContainer","jsx","TabHeaderAndFilters","Styled.FeedContent","clsx","ActivityItem","_refs","e","EmptyPlaceholder","InView","inView","Styled.LoadMore","CommentInput"],"mappings":"6zNA0BaA,GAAiB,GAExBC,GAAoC,CACxC,CACE,GAAI,WACJ,QAAS,WACT,KAAM,MAAA,EAER,CACE,GAAI,aACJ,QAAS,aACT,KAAM,WAAA,EAER,CACE,GAAI,WACJ,QAAS,qBACT,KAAM,QAAA,EAER,CACE,GAAI,UACJ,QAAS,iBACT,KAAM,oBAAA,CAEV,EAUaC,GAAO,CAAC,CACnB,SAAAC,EACA,SAAAC,EACA,SAAAC,EAAW,CAAA,EACX,aAAAC,EACA,WAAAC,CACF,IAAiB,CACf,KAAM,CACJ,YAAAC,EACA,SAAAC,EACA,WAAAC,EACA,UAAAC,EACA,YAAAC,EACA,aAAAC,EACA,SAAAC,EACA,eAAAC,EACA,aAAAC,EACA,kBAAAC,EACA,aAAAC,EACA,YAAAC,EACA,MAAAC,EACA,WAAAC,EACA,cAAAC,CAAA,EACEC,iBAAA,EAEE,CACJ,aAAAC,EACA,sBAAAC,EACA,yBAAAC,EACA,YAAAC,EACA,mBAAAC,EACA,KAAAC,CAAA,EACEC,0BAAA,EAEEC,EAAmBV,EAAW,YAAY,KAC7CW,GAAM,QAASA,GAAKA,EAAE,MAAQ,YAAcA,EAAE,QAAU,EAAA,EAErDC,EAAmBZ,EAAW,YAAY,KAC7CW,GAAM,QAASA,GAAK,CAAC,WAAY,aAAc,WAAY,SAAS,EAAE,SAASA,EAAE,GAAG,GAAKA,EAAE,QAAU,EAAA,EAElGE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},
|
|
317
317
|
t.activityId
|
|
318
318
|
)),
|
|
319
|
-
y.length ===
|
|
319
|
+
y.length === 0 && K && !j && !a && /* @__PURE__ */ r.jsx(Mt, { message: "No versions published yet", icon: "layers" }),
|
|
320
320
|
q && c && /* @__PURE__ */ r.jsx(
|
|
321
321
|
vt,
|
|
322
322
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Feed.es.js","sources":["../../../../../src/containers/Feed/Feed.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react'\nimport ActivityItem from './components/ActivityItem'\nimport CommentInput from './components/CommentInput/CommentInput'\nimport * as Styled from './Feed.styled'\nimport useCommentMutations, { Activity } from './hooks/useCommentMutations'\nimport useTransformActivities from './hooks/useTransformActivities'\nimport { InView } from 'react-intersection-observer'\nimport useSaveScrollPos from './hooks/useSaveScrollPos'\nimport useScrollOnInputOpen from './hooks/useScrollOnInputOpen'\nimport { getLoadingPlaceholders } from './feedHelpers'\nimport { Icon } from '@ynput/ayon-react-components'\nimport clsx from 'clsx'\nimport useScrollToHighlighted from './hooks/useScrollToHighlighted'\nimport { isFilePreviewable } from './components/FileUploadPreview/FileUploadPreview'\nimport EmptyPlaceholder from '@shared/components/EmptyPlaceholder'\nimport { useFeedContext, FEED_NEW_COMMENT } from './context/FeedContext'\nimport { Status } from '../ProjectTreeTable/types/project'\nimport { useDetailsPanelContext, FeedFilter } from '@shared/context'\nimport { DetailsPanelEntityType, useGetMyProjectPermissionsQuery } from '@shared/api'\nimport mergeAnnotationAttachments from './helpers/mergeAnnotationAttachments'\nimport { SavedAnnotationMetadata } from '.'\nimport TabHeaderAndFilters, {\n FilterItem,\n} from '../DetailsPanel/components/TabHeaderAndFilters/TabHeaderAndFilters'\n\n// number of activities to get\nexport const activitiesLast = 30\n\nconst feedFilters: FilterItem<string>[] = [\n {\n id: 'comments',\n tooltip: 'Comments',\n icon: 'chat',\n },\n {\n id: 'checklists',\n tooltip: 'Checklists',\n icon: 'checklist',\n },\n {\n id: 'versions',\n tooltip: 'Published versions',\n icon: 'layers',\n },\n {\n id: 'updates',\n tooltip: 'Entity updates',\n icon: 'arrow_circle_right',\n },\n]\n\nexport type FeedProps = {\n disabled?: boolean\n readOnly: boolean\n statuses: Status[]\n entityListId?: string | undefined\n isSlideOut?: boolean\n}\n\nexport const Feed = ({\n disabled,\n readOnly,\n statuses = [],\n entityListId,\n isSlideOut,\n}: FeedProps) => {\n const {\n projectName,\n entities,\n entityType,\n editingId,\n projectInfo,\n setEditingId,\n userName,\n activitiesData,\n isLoadingNew,\n isLoadingNextPage,\n loadNextPage,\n hasNextPage,\n users,\n feedFilter,\n setFeedFilter,\n } = useFeedContext()\n\n const {\n openSlideOut,\n highlightedActivities,\n setHighlightedActivities,\n onOpenImage,\n setFeedAnnotations,\n user,\n } = useDetailsPanelContext()\n\n const isVersionsFilter = feedFilter.conditions?.some(\n (c) => 'key' in c && c.key === 'versions' && c.value === true,\n )\n const hasActiveFilters = feedFilter.conditions?.some(\n (c) => 'key' in c && ['comments', 'checklists', 'versions', 'updates'].includes(c.key) && c.value === true,\n )\n const hasCommentLikeFilter = feedFilter.conditions?.some(\n (c) => 'key' in c && (c.key === 'comments' || c.key === 'checklists') && c.value === true,\n )\n\n // check activities permission for commenting\n const {\n data: projectPermissions,\n isLoading: isLoadingPermissions,\n } = useGetMyProjectPermissionsQuery(\n { projectName },\n { skip: !projectName },\n )\n const isCommentRestricted =\n !user.data?.isManager &&\n !user.data?.isAdmin &&\n !isLoadingPermissions &&\n projectPermissions?.activities?.enabled &&\n !projectPermissions?.activities?.activities?.includes('comment')\n\n // hide comment input for specific filters or when restricted by permissions\n const hideCommentInput = isCommentRestricted || (hasActiveFilters && !hasCommentLikeFilter)\n\n const activitiesWithMergedAnnotations = useMemo(\n () => mergeAnnotationAttachments(activitiesData),\n [activitiesData],\n )\n\n useEffect(() => {\n if (!activitiesWithMergedAnnotations.length) {\n setFeedAnnotations([])\n }\n\n const annotations = activitiesWithMergedAnnotations\n .map((activity) =>\n activity.activityData?.annotations?.map((a: SavedAnnotationMetadata) => ({\n ...a,\n activityId: activity.activityId,\n })),\n )\n .filter(Boolean)\n .flat()\n\n setFeedAnnotations(annotations)\n }, [activitiesWithMergedAnnotations])\n\n // do any transformation on activities data\n // 1. status change activities, attach status data based on projectName\n // 2. reverse the order\n // 3. is this activity from the current user?\n const transformedActivitiesData = useTransformActivities(\n // @ts-ignore\n activitiesWithMergedAnnotations,\n users,\n projectInfo,\n entityType,\n userName,\n feedFilter,\n ) as any[]\n\n // REFS\n const feedRef = useRef(null)\n // const commentInputRef = useRef(null)\n\n // scroll by height of comment input when it opens or closes\n useScrollOnInputOpen({ feedRef, isInputOpen: editingId === FEED_NEW_COMMENT, height: 93 })\n\n // save scroll position of a feed\n useSaveScrollPos({\n entities,\n feedRef,\n filter: feedFilter,\n disabled: !!highlightedActivities.length,\n isLoading: isLoadingNew,\n })\n // try and scroll to highlightedActivities activity\n useScrollToHighlighted({\n feedRef,\n highlighted: highlightedActivities,\n isLoading: isLoadingNew || isLoadingNextPage,\n loadNextPage,\n hasNextPage: !!loadNextPage,\n activities: activitiesData,\n })\n\n // comment mutations here!\n const {\n submitComment: submitCommentMutation,\n updateComment,\n deleteComment,\n isSaving,\n } = useCommentMutations({\n projectName,\n entityType: entityType,\n entities,\n filter: feedFilter,\n entityListId,\n })\n\n // wrap submitComment to scroll to bottom\n const submitComment = useCallback(\n async (value: string, files: any[] = [], data: any = {}) => {\n await submitCommentMutation(value, files, data)\n // scroll to bottom (scrollTop 0 is bottom because of column-reverse)\n if (feedRef.current) {\n ;(feedRef.current as any).scrollTo({ top: 0 })\n }\n },\n [submitCommentMutation, feedRef],\n )\n\n // When a checkbox is clicked, update the body to add/remove \"x\" in [ ] markdown\n // Then update comment with new body\n const handleCommentChecked = (e: React.ChangeEvent<HTMLInputElement>, activity: Activity) => {\n const target = e?.target\n if (!target || !activity) return console.log('no target or activity')\n\n // the value that it's changing to\n const checked: boolean = target.checked\n const currentMarkdown: string = checked ? '[ ]' : '[x]'\n const newMarkdown: string = checked ? '[x]' : '[ ]'\n\n const { body } = activity\n\n // based on all li elements in the whole className 'comment-body' with className 'task-list-item'\n // find the index of the task that was checked\n const taskIndex: number = Array.from(\n target.closest('.comment-body')?.querySelectorAll('.task-list-item') || [],\n ).findIndex((li: Element) => li === target.closest('li'))\n\n let replaceIndex: number = taskIndex\n\n // count the number of current markdowns in the body\n const allMarkdowns: string[] = body.match(/\\[.\\]/g) || []\n\n allMarkdowns.forEach((markdown: string, index: number) => {\n // does it match the current markdown?\n if (markdown !== currentMarkdown && index < taskIndex) replaceIndex--\n })\n\n // now find the indexes of the current markdown to replace\n const indexesOfCurrentMarkdownInBody: number[] = []\n let index: number = -1\n while ((index = body.indexOf(currentMarkdown, index + 1)) > -1) {\n indexesOfCurrentMarkdownInBody.push(index)\n }\n\n const indexToReplaceInBody: number | undefined = indexesOfCurrentMarkdownInBody[replaceIndex]\n if (indexToReplaceInBody === undefined) return\n\n const endReplaceIndex: number = indexToReplaceInBody + currentMarkdown.length\n\n // replace the current markdown with the new markdown\n const newBody: string =\n body.slice(0, indexToReplaceInBody) + newMarkdown + body.slice(endReplaceIndex)\n\n if (!newBody) return\n\n updateComment(activity, newBody, activity.files)\n }\n\n const handleRefClick = (ref: {\n entityId: string\n entityType: DetailsPanelEntityType\n activityId: string\n }) => {\n const { entityId, entityType, activityId } = ref\n const supportedTypes = ['version', 'task', 'folder']\n\n if (!entityType || !supportedTypes.includes(entityType))\n return console.log('Entity type not supported yet')\n\n if (!entityId || !entityType || !projectName) return console.log('No entity id or type found')\n\n // open the slide out\n openSlideOut({ entityId, entityType, projectName })\n // set highlighted activity\n setHighlightedActivities([activityId])\n }\n\n const handleFileExpand = ({ index, activityId }: { index: number; activityId: string }) => {\n const previewableFiles = Object.values(transformedActivitiesData)\n .reverse()\n .filter((a) => a.activityType == 'comment')\n .map((a) => ({\n id: a.activityId,\n files: a.files.filter((file: any) => isFilePreviewable(file.mime, file.ext)),\n }))\n .filter((a) => a.files.length > 0)\n\n // open image callback\n onOpenImage?.({ files: previewableFiles, activityId, index, projectName })\n }\n\n const loadingPlaceholders = useMemo(() => getLoadingPlaceholders(10), [])\n\n let warningMessage\n\n return (\n <>\n <Styled.FeedContainer className=\"feed\">\n {warningMessage && (\n <Styled.Warning>\n <Icon icon=\"info\" />\n {warningMessage}\n </Styled.Warning>\n )}\n <TabHeaderAndFilters\n label=\"Activity Feed\"\n filters={feedFilters}\n currentFilter={feedFilter}\n onFilterChange={setFeedFilter}\n isLoading={isLoadingNew}\n />\n <Styled.FeedContent ref={feedRef} className={clsx({ loading: isLoadingNew }, 'no-shimmer')}>\n {isLoadingNew\n ? loadingPlaceholders\n : transformedActivitiesData.map((activity) => (\n <ActivityItem\n key={activity.activityId}\n activity={activity}\n onCheckChange={handleCommentChecked}\n onDelete={deleteComment}\n onUpdate={async (value, files, _refs, data) =>\n await updateComment(activity, value, files, data)\n }\n projectInfo={projectInfo}\n projectName={projectName}\n entityType={entityType}\n onReferenceClick={handleRefClick}\n createdAts={entities.map((e) => e.createdAt)}\n onFileExpand={handleFileExpand}\n showOrigin={entities.length > 1}\n filter={feedFilter}\n editProps={{\n projectName,\n entities: entities,\n entityType,\n }}\n isHighlighted={highlightedActivities.includes(activity.activityId)}\n readOnly={readOnly}\n statuses={statuses}\n isSlideOut={isSlideOut}\n />\n ))}\n {/* message when no versions published */}\n {transformedActivitiesData.length === 1 &&\n isVersionsFilter &&\n !hasCommentLikeFilter &&\n !isLoadingNew && (\n <EmptyPlaceholder message=\"No versions published yet\" icon=\"layers\" />\n )}\n {hasNextPage && loadNextPage && (\n <InView\n root={feedRef.current}\n onChange={(inView) => inView && loadNextPage()}\n rootMargin={'400px 0px 0px 0px'}\n >\n <Styled.LoadMore style={{ height: 0 }} onClick={() => loadNextPage()}>\n {isLoadingNextPage ? 'Loading more...' : 'Click to load more'}\n </Styled.LoadMore>\n </InView>\n )}\n </Styled.FeedContent>\n {!hideCommentInput && (\n <CommentInput\n initValue={null}\n onSubmit={submitComment}\n isOpen={editingId === FEED_NEW_COMMENT}\n onClose={() => setEditingId(null)}\n onOpen={() => setEditingId(FEED_NEW_COMMENT)}\n disabled={disabled}\n isLoading={isLoadingNew || !entities.length || isSaving}\n />\n )}\n </Styled.FeedContainer>\n </>\n )\n}\n"],"names":["activitiesLast","feedFilters","Feed","disabled","readOnly","statuses","entityListId","isSlideOut","projectName","entities","entityType","editingId","projectInfo","setEditingId","userName","activitiesData","isLoadingNew","isLoadingNextPage","loadNextPage","hasNextPage","users","feedFilter","setFeedFilter","useFeedContext","openSlideOut","highlightedActivities","setHighlightedActivities","onOpenImage","setFeedAnnotations","user","useDetailsPanelContext","isVersionsFilter","c","hasActiveFilters","hasCommentLikeFilter","projectPermissions","isLoadingPermissions","useGetMyProjectPermissionsQuery","hideCommentInput","activitiesWithMergedAnnotations","useMemo","mergeAnnotationAttachments","useEffect","annotations","activity","a","transformedActivitiesData","useTransformActivities","feedRef","useRef","useScrollOnInputOpen","FEED_NEW_COMMENT","useSaveScrollPos","useScrollToHighlighted","submitCommentMutation","updateComment","deleteComment","isSaving","useCommentMutations","submitComment","useCallback","value","files","data","handleCommentChecked","e","target","checked","currentMarkdown","newMarkdown","body","taskIndex","li","replaceIndex","markdown","index","indexesOfCurrentMarkdownInBody","indexToReplaceInBody","endReplaceIndex","newBody","handleRefClick","ref","entityId","activityId","handleFileExpand","previewableFiles","file","isFilePreviewable","loadingPlaceholders","getLoadingPlaceholders","jsxs","Styled.FeedContainer","jsx","TabHeaderAndFilters","Styled.FeedContent","clsx","ActivityItem","_refs","EmptyPlaceholder","InView","inView","Styled.LoadMore","CommentInput"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,MAAMA,KAAiB,IA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AAAA,QAAA;AAAA,UACC,MAAMnD,EAAQ;AAAA,UACd,UAAU,CAACoD,MAAWA,KAAUlF,EAAA;AAAA,UAChC,YAAY;AAAA,UAEZ,UAAA0E,gBAAAA,EAAAA,IAACS,IAAA,EAAgB,OAAO,EAAE,QAAQ,EAAA,GAAK,SAAS,MAAMnF,EAAA,GACnD,UAAAD,IAAoB,oBAAoB,qBAAA,CAC3C;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,GAEJ;AAAA,IACC,CAACqB,KACAsD,gBAAAA,EAAAA;AAAAA,MAACU;AAAA,MAAA;AAAA,QACC,WAAW;AAAA,QACX,UAAU3C;AAAA,QACV,QAAQhD,MAAcwC;AAAA,QACtB,SAAS,MAAMtC,EAAa,IAAI;AAAA,QAChC,QAAQ,MAAMA,EAAasC,CAAgB;AAAA,QAC3C,UAAAhD;AAAA,QACA,WAAWa,KAAgB,CAACP,EAAS,UAAUgD;AAAA,MAAA;AAAA,IAAA;AAAA,EACjD,EAAA,CAEJ,EAAA,CACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"Feed.es.js","sources":["../../../../../src/containers/Feed/Feed.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react'\nimport ActivityItem from './components/ActivityItem'\nimport CommentInput from './components/CommentInput/CommentInput'\nimport * as Styled from './Feed.styled'\nimport useCommentMutations, { Activity } from './hooks/useCommentMutations'\nimport useTransformActivities from './hooks/useTransformActivities'\nimport { InView } from 'react-intersection-observer'\nimport useSaveScrollPos from './hooks/useSaveScrollPos'\nimport useScrollOnInputOpen from './hooks/useScrollOnInputOpen'\nimport { getLoadingPlaceholders } from './feedHelpers'\nimport { Icon } from '@ynput/ayon-react-components'\nimport clsx from 'clsx'\nimport useScrollToHighlighted from './hooks/useScrollToHighlighted'\nimport { isFilePreviewable } from './components/FileUploadPreview/FileUploadPreview'\nimport EmptyPlaceholder from '@shared/components/EmptyPlaceholder'\nimport { useFeedContext, FEED_NEW_COMMENT } from './context/FeedContext'\nimport { Status } from '../ProjectTreeTable/types/project'\nimport { useDetailsPanelContext, FeedFilter } from '@shared/context'\nimport { DetailsPanelEntityType, useGetMyProjectPermissionsQuery } from '@shared/api'\nimport mergeAnnotationAttachments from './helpers/mergeAnnotationAttachments'\nimport { SavedAnnotationMetadata } from '.'\nimport TabHeaderAndFilters, {\n FilterItem,\n} from '../DetailsPanel/components/TabHeaderAndFilters/TabHeaderAndFilters'\n\n// number of activities to get\nexport const activitiesLast = 30\n\nconst feedFilters: FilterItem<string>[] = [\n {\n id: 'comments',\n tooltip: 'Comments',\n icon: 'chat',\n },\n {\n id: 'checklists',\n tooltip: 'Checklists',\n icon: 'checklist',\n },\n {\n id: 'versions',\n tooltip: 'Published versions',\n icon: 'layers',\n },\n {\n id: 'updates',\n tooltip: 'Entity updates',\n icon: 'arrow_circle_right',\n },\n]\n\nexport type FeedProps = {\n disabled?: boolean\n readOnly: boolean\n statuses: Status[]\n entityListId?: string | undefined\n isSlideOut?: boolean\n}\n\nexport const Feed = ({\n disabled,\n readOnly,\n statuses = [],\n entityListId,\n isSlideOut,\n}: FeedProps) => {\n const {\n projectName,\n entities,\n entityType,\n editingId,\n projectInfo,\n setEditingId,\n userName,\n activitiesData,\n isLoadingNew,\n isLoadingNextPage,\n loadNextPage,\n hasNextPage,\n users,\n feedFilter,\n setFeedFilter,\n } = useFeedContext()\n\n const {\n openSlideOut,\n highlightedActivities,\n setHighlightedActivities,\n onOpenImage,\n setFeedAnnotations,\n user,\n } = useDetailsPanelContext()\n\n const isVersionsFilter = feedFilter.conditions?.some(\n (c) => 'key' in c && c.key === 'versions' && c.value === true,\n )\n const hasActiveFilters = feedFilter.conditions?.some(\n (c) => 'key' in c && ['comments', 'checklists', 'versions', 'updates'].includes(c.key) && c.value === true,\n )\n const hasCommentLikeFilter = feedFilter.conditions?.some(\n (c) => 'key' in c && (c.key === 'comments' || c.key === 'checklists') && c.value === true,\n )\n\n // check activities permission for commenting\n const {\n data: projectPermissions,\n isLoading: isLoadingPermissions,\n } = useGetMyProjectPermissionsQuery(\n { projectName },\n { skip: !projectName },\n )\n const isCommentRestricted =\n !user.data?.isManager &&\n !user.data?.isAdmin &&\n !isLoadingPermissions &&\n projectPermissions?.activities?.enabled &&\n !projectPermissions?.activities?.activities?.includes('comment')\n\n // hide comment input for specific filters or when restricted by permissions\n const hideCommentInput = isCommentRestricted || (hasActiveFilters && !hasCommentLikeFilter)\n\n const activitiesWithMergedAnnotations = useMemo(\n () => mergeAnnotationAttachments(activitiesData),\n [activitiesData],\n )\n\n useEffect(() => {\n if (!activitiesWithMergedAnnotations.length) {\n setFeedAnnotations([])\n }\n\n const annotations = activitiesWithMergedAnnotations\n .map((activity) =>\n activity.activityData?.annotations?.map((a: SavedAnnotationMetadata) => ({\n ...a,\n activityId: activity.activityId,\n })),\n )\n .filter(Boolean)\n .flat()\n\n setFeedAnnotations(annotations)\n }, [activitiesWithMergedAnnotations])\n\n // do any transformation on activities data\n // 1. status change activities, attach status data based on projectName\n // 2. reverse the order\n // 3. is this activity from the current user?\n const transformedActivitiesData = useTransformActivities(\n // @ts-ignore\n activitiesWithMergedAnnotations,\n users,\n projectInfo,\n entityType,\n userName,\n feedFilter,\n ) as any[]\n\n // REFS\n const feedRef = useRef(null)\n // const commentInputRef = useRef(null)\n\n // scroll by height of comment input when it opens or closes\n useScrollOnInputOpen({ feedRef, isInputOpen: editingId === FEED_NEW_COMMENT, height: 93 })\n\n // save scroll position of a feed\n useSaveScrollPos({\n entities,\n feedRef,\n filter: feedFilter,\n disabled: !!highlightedActivities.length,\n isLoading: isLoadingNew,\n })\n // try and scroll to highlightedActivities activity\n useScrollToHighlighted({\n feedRef,\n highlighted: highlightedActivities,\n isLoading: isLoadingNew || isLoadingNextPage,\n loadNextPage,\n hasNextPage: !!loadNextPage,\n activities: activitiesData,\n })\n\n // comment mutations here!\n const {\n submitComment: submitCommentMutation,\n updateComment,\n deleteComment,\n isSaving,\n } = useCommentMutations({\n projectName,\n entityType: entityType,\n entities,\n filter: feedFilter,\n entityListId,\n })\n\n // wrap submitComment to scroll to bottom\n const submitComment = useCallback(\n async (value: string, files: any[] = [], data: any = {}) => {\n await submitCommentMutation(value, files, data)\n // scroll to bottom (scrollTop 0 is bottom because of column-reverse)\n if (feedRef.current) {\n ;(feedRef.current as any).scrollTo({ top: 0 })\n }\n },\n [submitCommentMutation, feedRef],\n )\n\n // When a checkbox is clicked, update the body to add/remove \"x\" in [ ] markdown\n // Then update comment with new body\n const handleCommentChecked = (e: React.ChangeEvent<HTMLInputElement>, activity: Activity) => {\n const target = e?.target\n if (!target || !activity) return console.log('no target or activity')\n\n // the value that it's changing to\n const checked: boolean = target.checked\n const currentMarkdown: string = checked ? '[ ]' : '[x]'\n const newMarkdown: string = checked ? '[x]' : '[ ]'\n\n const { body } = activity\n\n // based on all li elements in the whole className 'comment-body' with className 'task-list-item'\n // find the index of the task that was checked\n const taskIndex: number = Array.from(\n target.closest('.comment-body')?.querySelectorAll('.task-list-item') || [],\n ).findIndex((li: Element) => li === target.closest('li'))\n\n let replaceIndex: number = taskIndex\n\n // count the number of current markdowns in the body\n const allMarkdowns: string[] = body.match(/\\[.\\]/g) || []\n\n allMarkdowns.forEach((markdown: string, index: number) => {\n // does it match the current markdown?\n if (markdown !== currentMarkdown && index < taskIndex) replaceIndex--\n })\n\n // now find the indexes of the current markdown to replace\n const indexesOfCurrentMarkdownInBody: number[] = []\n let index: number = -1\n while ((index = body.indexOf(currentMarkdown, index + 1)) > -1) {\n indexesOfCurrentMarkdownInBody.push(index)\n }\n\n const indexToReplaceInBody: number | undefined = indexesOfCurrentMarkdownInBody[replaceIndex]\n if (indexToReplaceInBody === undefined) return\n\n const endReplaceIndex: number = indexToReplaceInBody + currentMarkdown.length\n\n // replace the current markdown with the new markdown\n const newBody: string =\n body.slice(0, indexToReplaceInBody) + newMarkdown + body.slice(endReplaceIndex)\n\n if (!newBody) return\n\n updateComment(activity, newBody, activity.files)\n }\n\n const handleRefClick = (ref: {\n entityId: string\n entityType: DetailsPanelEntityType\n activityId: string\n }) => {\n const { entityId, entityType, activityId } = ref\n const supportedTypes = ['version', 'task', 'folder']\n\n if (!entityType || !supportedTypes.includes(entityType))\n return console.log('Entity type not supported yet')\n\n if (!entityId || !entityType || !projectName) return console.log('No entity id or type found')\n\n // open the slide out\n openSlideOut({ entityId, entityType, projectName })\n // set highlighted activity\n setHighlightedActivities([activityId])\n }\n\n const handleFileExpand = ({ index, activityId }: { index: number; activityId: string }) => {\n const previewableFiles = Object.values(transformedActivitiesData)\n .reverse()\n .filter((a) => a.activityType == 'comment')\n .map((a) => ({\n id: a.activityId,\n files: a.files.filter((file: any) => isFilePreviewable(file.mime, file.ext)),\n }))\n .filter((a) => a.files.length > 0)\n\n // open image callback\n onOpenImage?.({ files: previewableFiles, activityId, index, projectName })\n }\n\n const loadingPlaceholders = useMemo(() => getLoadingPlaceholders(10), [])\n\n let warningMessage\n\n return (\n <>\n <Styled.FeedContainer className=\"feed\">\n {warningMessage && (\n <Styled.Warning>\n <Icon icon=\"info\" />\n {warningMessage}\n </Styled.Warning>\n )}\n <TabHeaderAndFilters\n label=\"Activity Feed\"\n filters={feedFilters}\n currentFilter={feedFilter}\n onFilterChange={setFeedFilter}\n isLoading={isLoadingNew}\n />\n <Styled.FeedContent ref={feedRef} className={clsx({ loading: isLoadingNew }, 'no-shimmer')}>\n {isLoadingNew\n ? loadingPlaceholders\n : transformedActivitiesData.map((activity) => (\n <ActivityItem\n key={activity.activityId}\n activity={activity}\n onCheckChange={handleCommentChecked}\n onDelete={deleteComment}\n onUpdate={async (value, files, _refs, data) =>\n await updateComment(activity, value, files, data)\n }\n projectInfo={projectInfo}\n projectName={projectName}\n entityType={entityType}\n onReferenceClick={handleRefClick}\n createdAts={entities.map((e) => e.createdAt)}\n onFileExpand={handleFileExpand}\n showOrigin={entities.length > 1}\n filter={feedFilter}\n editProps={{\n projectName,\n entities: entities,\n entityType,\n }}\n isHighlighted={highlightedActivities.includes(activity.activityId)}\n readOnly={readOnly}\n statuses={statuses}\n isSlideOut={isSlideOut}\n />\n ))}\n {/* message when no versions published */}\n {transformedActivitiesData.length === 0 &&\n isVersionsFilter &&\n !hasCommentLikeFilter &&\n !isLoadingNew && (\n <EmptyPlaceholder message=\"No versions published yet\" icon=\"layers\" />\n )}\n {hasNextPage && loadNextPage && (\n <InView\n root={feedRef.current}\n onChange={(inView) => inView && loadNextPage()}\n rootMargin={'400px 0px 0px 0px'}\n >\n <Styled.LoadMore style={{ height: 0 }} onClick={() => loadNextPage()}>\n {isLoadingNextPage ? 'Loading more...' : 'Click to load more'}\n </Styled.LoadMore>\n </InView>\n )}\n </Styled.FeedContent>\n {!hideCommentInput && (\n <CommentInput\n initValue={null}\n onSubmit={submitComment}\n isOpen={editingId === FEED_NEW_COMMENT}\n onClose={() => setEditingId(null)}\n onOpen={() => setEditingId(FEED_NEW_COMMENT)}\n disabled={disabled}\n isLoading={isLoadingNew || !entities.length || isSaving}\n />\n )}\n </Styled.FeedContainer>\n </>\n )\n}\n"],"names":["activitiesLast","feedFilters","Feed","disabled","readOnly","statuses","entityListId","isSlideOut","projectName","entities","entityType","editingId","projectInfo","setEditingId","userName","activitiesData","isLoadingNew","isLoadingNextPage","loadNextPage","hasNextPage","users","feedFilter","setFeedFilter","useFeedContext","openSlideOut","highlightedActivities","setHighlightedActivities","onOpenImage","setFeedAnnotations","user","useDetailsPanelContext","isVersionsFilter","c","hasActiveFilters","hasCommentLikeFilter","projectPermissions","isLoadingPermissions","useGetMyProjectPermissionsQuery","hideCommentInput","activitiesWithMergedAnnotations","useMemo","mergeAnnotationAttachments","useEffect","annotations","activity","a","transformedActivitiesData","useTransformActivities","feedRef","useRef","useScrollOnInputOpen","FEED_NEW_COMMENT","useSaveScrollPos","useScrollToHighlighted","submitCommentMutation","updateComment","deleteComment","isSaving","useCommentMutations","submitComment","useCallback","value","files","data","handleCommentChecked","e","target","checked","currentMarkdown","newMarkdown","body","taskIndex","li","replaceIndex","markdown","index","indexesOfCurrentMarkdownInBody","indexToReplaceInBody","endReplaceIndex","newBody","handleRefClick","ref","entityId","activityId","handleFileExpand","previewableFiles","file","isFilePreviewable","loadingPlaceholders","getLoadingPlaceholders","jsxs","Styled.FeedContainer","jsx","TabHeaderAndFilters","Styled.FeedContent","clsx","ActivityItem","_refs","EmptyPlaceholder","InView","inView","Styled.LoadMore","CommentInput"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,MAAMA,KAAiB,IAExBC,KAAoC;AAAA,EACxC;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAAA,EAER;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAAA,EAER;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAAA,EAER;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAEV,GAUaC,KAAO,CAAC;AAAA,EACnB,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAW,CAAA;AAAA,EACX,cAAAC;AAAA,EACA,YAAAC;AACF,MAAiB;AACf,QAAM;AAAA,IACJ,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,EAAA,IACEC,GAAA,GAEE;AAAA,IACJ,cAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,0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W;AAAA,YACT,aAAAb;AAAA,YACA,UAAAC;AAAA,YACA,YAAAC;AAAA,UAAA;AAAA,UAEF,eAAee,EAAsB,SAASmB,EAAS,UAAU;AAAA,UACjE,UAAAxC;AAAA,UACA,UAAAC;AAAA,UACA,YAAAE;AAAA,QAAA;AAAA,QAvBKqC,EAAS;AAAA,MAAA,CAyBjB;AAAA,MAEJE,EAA0B,WAAW,KACpCf,KACA,CAACG,KACD,CAAClB,KACD4E,gBAAAA,EAAAA,IAACM,IAAA,EAAiB,SAAQ,6BAA4B,MAAK,SAAA,CAAS;AAAA,MAErE/E,KAAeD,KACd0E,gBAAAA,EAAAA;AAAAA,QAACO;AAAA,QAAA;AAAA,UACC,MAAMnD,EAAQ;AAAA,UACd,UAAU,CAACoD,MAAWA,KAAUlF,EAAA;AAAA,UAChC,YAAY;AAAA,UAEZ,UAAA0E,gBAAAA,EAAAA,IAACS,IAAA,EAAgB,OAAO,EAAE,QAAQ,EAAA,GAAK,SAAS,MAAMnF,EAAA,GACnD,UAAAD,IAAoB,oBAAoB,qBAAA,CAC3C;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,GAEJ;AAAA,IACC,CAACqB,KACAsD,gBAAAA,EAAAA;AAAAA,MAACU;AAAA,MAAA;AAAA,QACC,WAAW;AAAA,QACX,UAAU3C;AAAA,QACV,QAAQhD,MAAcwC;AAAA,QACtB,SAAS,MAAMtC,EAAa,IAAI;AAAA,QAChC,QAAQ,MAAMA,EAAasC,CAAgB;AAAA,QAC3C,UAAAhD;AAAA,QACA,WAAWa,KAAgB,CAACP,EAAS,UAAUgD;AAAA,MAAA;AAAA,IAAA;AAAA,EACjD,EAAA,CAEJ,EAAA,CACF;AAEJ;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const pricingUrl = "https://ynput.
|
|
1
|
+
export declare const pricingUrl = "https://ynput.cloud/free-trial";
|
|
2
2
|
export interface PricingLinkProps extends React.HTMLAttributes<HTMLAnchorElement> {
|
|
3
3
|
}
|
|
4
4
|
export declare const PricingLink: import('react').ForwardRefExoticComponent<PricingLinkProps & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
@@ -67,4 +67,5 @@ interface VersionUploadProviderProps {
|
|
|
67
67
|
}
|
|
68
68
|
export declare const VersionUploadProvider: React.FC<VersionUploadProviderProps>;
|
|
69
69
|
export declare const useVersionUploadContext: () => VersionUploadContextType;
|
|
70
|
+
export declare const useOptionalVersionUploadContext: () => VersionUploadContextType | null;
|
|
70
71
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ynput/ayon-frontend-shared",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.29",
|
|
4
4
|
"description": "Shared React components for AYON frontend",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -148,6 +148,6 @@
|
|
|
148
148
|
"remark-gfm": "4.0.1",
|
|
149
149
|
"short-uuid": "4.2.2",
|
|
150
150
|
"turndown": "7.2.4",
|
|
151
|
-
"uuid": "
|
|
151
|
+
"uuid": "14.0.0"
|
|
152
152
|
}
|
|
153
153
|
}
|