tycho-components 0.31.6 → 0.32.0

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.
@@ -24,7 +24,6 @@ const PARAMETERS = [
24
24
  'useSound',
25
25
  'useTranslation',
26
26
  'useLexicon',
27
- 'useUD',
28
27
  'defaultUD',
29
28
  ];
30
29
  const PARAMETERS_CATALOG = ['useGrid', 'useCategory'];
@@ -40,4 +39,5 @@ const PARAMETERS_TOOLS = [
40
39
  'useTranslations',
41
40
  'useDesigner',
42
41
  'useTranscriber',
42
+ 'useUD',
43
43
  ];
@@ -1,5 +1,5 @@
1
1
  import { Corpus } from "../configs/types/Corpus";
2
- export type PlatformTools = "EDICTOR" | "TRANSLATION" | "DESIGN" | "TRANSCRIBER" | "SYNTREES";
2
+ export type PlatformTools = "EDICTOR" | "TRANSLATION" | "DESIGN" | "TRANSCRIBER" | "UD" | "SYNTREES";
3
3
  export type OpenDocumentParams = {
4
4
  page: string;
5
5
  corpus: Corpus | undefined;
@@ -31,6 +31,14 @@ export const EDITION_TOOLS = [
31
31
  icon: "music_cast",
32
32
  path: "/transcriber",
33
33
  },
34
+ {
35
+ parameter: "useUD",
36
+ name: "UD",
37
+ action: "actions:actions.label.ud",
38
+ title: "actions:actions.name.ud",
39
+ icon: "account_tree",
40
+ path: "/ud",
41
+ },
34
42
  ];
35
43
  const getTitle = (defaultTool) => {
36
44
  const tool = defaultTool || "EDICTOR";
@@ -67,6 +75,9 @@ const openEdictor = (uid, ctxPath, sameWindow) => {
67
75
  const openDesign = (uid, ctxPath, sameWindow) => {
68
76
  navigateTo(`/design/${uid}`, ctxPath, sameWindow);
69
77
  };
78
+ const openUd = (uid, ctxPath, sameWindow) => {
79
+ navigateTo(`/ud/${uid}`, ctxPath, sameWindow);
80
+ };
70
81
  const getDocumentUrl = ({ page, corpus, hasParameter, defaultTool, ctxPath, }) => {
71
82
  if (defaultTool) {
72
83
  return withCtxPath(`${EDITION_TOOLS.find((t) => t.name === defaultTool)?.path}/${page}`, ctxPath);
@@ -85,6 +96,9 @@ const getDocumentUrl = ({ page, corpus, hasParameter, defaultTool, ctxPath, }) =
85
96
  else if (hasParameter(corpus, "useTranscriber")) {
86
97
  return withCtxPath(`/transcriber/${page}`, ctxPath);
87
98
  }
99
+ else if (hasParameter(corpus, "useUD")) {
100
+ return withCtxPath(`/ud/${page}`, ctxPath);
101
+ }
88
102
  return undefined;
89
103
  };
90
104
  const redirectPage = ({ corpus, uid, hasParameter, tool, ctxPath, sameWindow, }) => {
@@ -104,6 +118,9 @@ const redirectPage = ({ corpus, uid, hasParameter, tool, ctxPath, sameWindow, })
104
118
  else if (hasParameter(corpus, "useTranscriber")) {
105
119
  openTranscriber(uid, ctxPath, sameWindow);
106
120
  }
121
+ else if (hasParameter(corpus, "useUD")) {
122
+ openUd(uid, ctxPath, sameWindow);
123
+ }
107
124
  };
108
125
  const openDocument = ({ page, corpus, hasParameter, defaultTool, ctxPath, }) => {
109
126
  const documentUrl = getDocumentUrl({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.31.6",
4
+ "version": "0.32.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {