tycho-components 0.25.7 → 0.25.9

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.
@@ -20,18 +20,14 @@ export default function DocumentDrawer({ uid, setOpenFile, setFilter, handleChan
20
20
  const { getCorpus, hasParameter } = useCorpusUtils();
21
21
  const [document, setDocument] = useState();
22
22
  const [activeKey, setActiveKey] = useState("actions");
23
- const hasParticipants = (document?.participants?.length ?? 0) > 0;
24
23
  const fileItems = useMemo(() => {
25
24
  if (!document)
26
25
  return [];
27
- let items = hasParticipants
28
- ? baseFileItems
29
- : baseFileItems.filter((item) => item.eventKey !== "participants");
30
26
  if (document.github) {
31
- items = [...items, githubFileItem];
27
+ return [...baseFileItems, githubFileItem];
32
28
  }
33
- return items;
34
- }, [document, hasParticipants]);
29
+ return baseFileItems;
30
+ }, [document]);
35
31
  const handleTabChange = (_event, newValue) => {
36
32
  setActiveKey(newValue);
37
33
  };
@@ -47,11 +43,6 @@ export default function DocumentDrawer({ uid, setOpenFile, setFilter, handleChan
47
43
  setDocument(response.data);
48
44
  });
49
45
  }, [uid]);
50
- useEffect(() => {
51
- if (!hasParticipants && activeKey === "participants") {
52
- setActiveKey("actions");
53
- }
54
- }, [activeKey, hasParticipants]);
55
46
  if (!document)
56
47
  return null;
57
48
  return (_jsx(Drawer, { anchor: "left", open: true, onClose: () => setOpenFile(false), className: "offcanvas-file", children: _jsxs("div", { className: "drawer-container", children: [_jsxs("div", { className: "tabs-col", children: [_jsxs("div", { className: "nav-item-close", onClick: () => setOpenFile(false), children: [_jsx("span", { className: "nav-link-icon", children: _jsx(Icon, { name: "arrow_circle_left" }) }), _jsx("span", { className: "title", children: t("menu.label.close") })] }), _jsx(Tabs, { orientation: "vertical", value: activeKey, onChange: handleTabChange, className: "nav", children: fileItems.map((item, idx) => (_jsx(Tab, { value: item.eventKey, label: _jsxs(_Fragment, { children: [_jsx("span", { className: "nav-link-icon", children: _jsx(Icon, { name: item.icon }) }), _jsx("span", { className: "title", children: t(item.title) })] }) }, idx.valueOf()))) })] }), _jsxs("div", { className: "info-col", children: [activeKey === "home" && (_jsx(Info, { document: document, categoriesHierarchy: categoriesHierarchy, handleChange: (updated) => {
@@ -7,10 +7,10 @@ function page(document, index, size) {
7
7
  return api.post(`${platformApi.catalog}/page/document/${document.uid}`, data);
8
8
  }
9
9
  function create(uid) {
10
- return api.post(`${platformApi.editor}/page/${uid}`);
10
+ return api.post(`${platformApi.catalog}/page/${uid}`);
11
11
  }
12
12
  function remove(thisPage) {
13
- return api.delete(`${platformApi.editor}/page/${thisPage.uid}`);
13
+ return api.delete(`${platformApi.catalog}/page/${thisPage.uid}`);
14
14
  }
15
15
  function removeSentences(uid) {
16
16
  return api.delete(`${platformApi.editor}/page/sentences/${uid}`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.25.7",
4
+ "version": "0.25.9",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -82,7 +82,7 @@
82
82
  "react-i18next": "^13.0.2",
83
83
  "react-router-dom": "^6.14.2",
84
84
  "react-toastify": "^9.1.3",
85
- "tycho-storybook": "0.9.4",
85
+ "tycho-storybook": "0.9.5",
86
86
  "wavesurfer-react": "^2.2.2",
87
87
  "wavesurfer.js": "^6.6.3"
88
88
  },