@lokalise/harmony 1.15.0 → 1.16.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.
- package/dist/harmony.cjs +1 -1
- package/dist/harmony.css +1 -1
- package/dist/harmony.mjs +1267 -796
- package/dist/types/src/components/Sidebar/Sidebar.d.ts +3 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskLanguage/TaskLanguage.d.ts +6 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskLanguageCompleted/TaskLanguageCompleted.d.ts +7 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskOverview/TaskOverview.d.ts +5 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/Tasks.d.ts +3 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/Tasks.test.d.ts +1 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksContext.d.ts +3 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksPopover/TasksPopover.d.ts +1 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksProvider.d.ts +10 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/index.d.ts +2 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/types.d.ts +86 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/content.d.ts +16 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/taskEvents.d.ts +24 -0
- package/dist/types/src/features/publicApi/node.d.ts +1 -0
- package/dist/types/src/node.d.ts +1 -0
- package/dist/types/tests/mocks/sidebar/tasks.d.ts +2 -0
- package/package.json +1 -1
@@ -46,5 +46,8 @@ declare const Sidebar: {
|
|
46
46
|
onClick?: () => void;
|
47
47
|
hideBottomDivider?: boolean;
|
48
48
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
49
|
+
Tasks: (props: {
|
50
|
+
config: import('./Widgets/Tasks/types').SidebarTasksConfig;
|
51
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
49
52
|
};
|
50
53
|
export { Sidebar };
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { SidebarTask, SidebarTaskLanguage } from '../types';
|
2
|
+
export type TaskLanguageProps = {
|
3
|
+
task: SidebarTask;
|
4
|
+
language: SidebarTaskLanguage;
|
5
|
+
};
|
6
|
+
export declare const TaskLanguage: ({ language, task }: TaskLanguageProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { SidebarTask, SidebarTaskLanguage } from '../types';
|
2
|
+
type TaskLanguageCompletedProps = {
|
3
|
+
task: SidebarTask;
|
4
|
+
language: SidebarTaskLanguage;
|
5
|
+
};
|
6
|
+
export declare const TaskLanguageCompleted: ({ task, language }: TaskLanguageCompletedProps) => import("react/jsx-runtime").JSX.Element;
|
7
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const TasksPopover: () => import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
2
|
+
import { SidebarTasksConfig } from './types';
|
3
|
+
type TasksProviderProps = PropsWithChildren<{
|
4
|
+
config: SidebarTasksConfig;
|
5
|
+
}>;
|
6
|
+
export declare const TasksProvider: ({ children, config }: TasksProviderProps) => import("react/jsx-runtime").JSX.Element;
|
7
|
+
export declare const withTasksContext: <P extends {
|
8
|
+
config: SidebarTasksConfig;
|
9
|
+
}>(WrappedComponent: FC<Omit<P, "config">>) => (props: P) => import("react/jsx-runtime").JSX.Element;
|
10
|
+
export {};
|
@@ -0,0 +1,86 @@
|
|
1
|
+
import { TypesFromMap } from '../../../../utils/typeUtils';
|
2
|
+
export declare const SidebarTaskStatuses: {
|
3
|
+
readonly Completed: "completed";
|
4
|
+
readonly InProgress: "in_progress";
|
5
|
+
readonly Created: "created";
|
6
|
+
readonly Queued: "queued";
|
7
|
+
};
|
8
|
+
export type SidebarTaskStatus = TypesFromMap<typeof SidebarTaskStatuses>;
|
9
|
+
export declare const SidebarTaskLanguageStatuses: {
|
10
|
+
readonly NotStarted: "not_started";
|
11
|
+
readonly Completed: "completed";
|
12
|
+
readonly InProgress: "in_progress";
|
13
|
+
readonly Created: "created";
|
14
|
+
readonly Queued: "queued";
|
15
|
+
};
|
16
|
+
export type SidebarTaskLanguageStatus = TypesFromMap<typeof SidebarTaskLanguageStatuses>;
|
17
|
+
export declare const SidebarTaskTypeOptions: {
|
18
|
+
readonly translation: "translation";
|
19
|
+
readonly review: "review";
|
20
|
+
readonly lqa_by_ai: "lqa_by_ai";
|
21
|
+
readonly automatic_translation: "automatic_translation";
|
22
|
+
};
|
23
|
+
export type SidebarTaskTypeOption = TypesFromMap<typeof SidebarTaskTypeOptions>;
|
24
|
+
export type SidebarTaskStyleGuide = {
|
25
|
+
id: string;
|
26
|
+
name: string;
|
27
|
+
};
|
28
|
+
export type SidebarTaskLanguage = {
|
29
|
+
lang_id: string;
|
30
|
+
name: string;
|
31
|
+
progress?: number;
|
32
|
+
status: SidebarTaskLanguageStatus;
|
33
|
+
base_words_total: number;
|
34
|
+
base_words_done: number;
|
35
|
+
};
|
36
|
+
export type SidebarTask = {
|
37
|
+
id: string;
|
38
|
+
title: string;
|
39
|
+
status: SidebarTaskStatus;
|
40
|
+
langs: SidebarTaskLanguage[];
|
41
|
+
team_id: number;
|
42
|
+
created_by_fullname: string;
|
43
|
+
source_lang_name: string;
|
44
|
+
task_type: SidebarTaskTypeOption;
|
45
|
+
style_guides: SidebarTaskStyleGuide[];
|
46
|
+
description?: string;
|
47
|
+
project_name: string;
|
48
|
+
master_branching_enabled: '0' | '1';
|
49
|
+
branch_name: string | null;
|
50
|
+
due_date: string | null;
|
51
|
+
};
|
52
|
+
export type SidebarDefaultFnArgs = {
|
53
|
+
task: SidebarTask;
|
54
|
+
language: SidebarTaskLanguage;
|
55
|
+
};
|
56
|
+
export type SidebarDefaultFn = (props: SidebarDefaultFnArgs) => void;
|
57
|
+
export type SidebarTasksGetProjectUrlFnArgs = {
|
58
|
+
task: SidebarTask;
|
59
|
+
language?: SidebarTaskLanguage;
|
60
|
+
view?: 'single' | 'multi';
|
61
|
+
taskUncompleted?: boolean;
|
62
|
+
};
|
63
|
+
export type SidebarTasksGetProjectUrlFn = (props: SidebarTasksGetProjectUrlFnArgs) => string;
|
64
|
+
export type SidebarTaskTitleOnClickFn = (props: Pick<SidebarDefaultFnArgs, 'task'>) => void;
|
65
|
+
export type SidebarOnLanguageCompleteConfirmFnArgs = SidebarDefaultFnArgs & {
|
66
|
+
closePrompt: () => void;
|
67
|
+
};
|
68
|
+
export type SidebarOnLanguageCompleteConfirmFn = (props: SidebarOnLanguageCompleteConfirmFnArgs) => Promise<void>;
|
69
|
+
export type SidebarTasksConfig = {
|
70
|
+
getTasksCount: () => Promise<number>;
|
71
|
+
getTasks: () => Promise<SidebarTask[]>;
|
72
|
+
getProjectUrl: SidebarTasksGetProjectUrlFn;
|
73
|
+
onLanguageCompleteConfirm: SidebarOnLanguageCompleteConfirmFn;
|
74
|
+
onTasksWidgetOpen?: ({ tasks }: {
|
75
|
+
tasks: SidebarTask[];
|
76
|
+
}) => void;
|
77
|
+
taskTitleOnClick?: SidebarTaskTitleOnClickFn;
|
78
|
+
langNameOnClick?: SidebarDefaultFn;
|
79
|
+
langProgressOnClick?: SidebarDefaultFn;
|
80
|
+
};
|
81
|
+
export type SidebarTasksContextProps = Pick<SidebarTasksConfig, 'onTasksWidgetOpen' | 'getProjectUrl' | 'taskTitleOnClick' | 'langNameOnClick' | 'langProgressOnClick' | 'onLanguageCompleteConfirm'> & {
|
82
|
+
fetchTasks: () => Promise<void>;
|
83
|
+
tasks: SidebarTask[];
|
84
|
+
tasksCount: number;
|
85
|
+
loadingTasks: boolean;
|
86
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { SidebarTask, SidebarTaskLanguage, SidebarTaskLanguageStatus, SidebarTaskTypeOption } from '../types';
|
2
|
+
export declare const getStatusText: (status: SidebarTaskLanguageStatus, progressValue: number) => "Closed" | "Completed" | "In progress" | "Not started" | "Queued" | "-";
|
3
|
+
export declare const resolveStatus: (language: SidebarTaskLanguage) => SidebarTaskLanguageStatus;
|
4
|
+
/**
|
5
|
+
* TODO - these should be taken from louis
|
6
|
+
*/
|
7
|
+
export declare const tagColor: Record<SidebarTaskTypeOption, string>;
|
8
|
+
export declare const getTaskLanguages: (langs: SidebarTaskLanguage[]) => {
|
9
|
+
status: SidebarTaskLanguageStatus;
|
10
|
+
lang_id: string;
|
11
|
+
name: string;
|
12
|
+
progress?: number;
|
13
|
+
base_words_total: number;
|
14
|
+
base_words_done: number;
|
15
|
+
}[];
|
16
|
+
export declare const isLanguageProgressCompleted: (task: SidebarTask, language: SidebarTaskLanguage) => boolean;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { TypesFromMap } from '../../../../../utils/node.ts';
|
2
|
+
export declare const TaskEvents: {
|
3
|
+
readonly TaskCompleted: "task_completed";
|
4
|
+
readonly TaskClosed: "task_closed";
|
5
|
+
readonly Refresh: "refresh";
|
6
|
+
readonly ShowDialog: "show_dialog";
|
7
|
+
};
|
8
|
+
export type TaskEvent = TypesFromMap<typeof TaskEvents>;
|
9
|
+
type SingleTaskPayload = {
|
10
|
+
taskId: string | number;
|
11
|
+
};
|
12
|
+
type DispatchTaskEventPayload = {
|
13
|
+
name: typeof TaskEvents.TaskCompleted;
|
14
|
+
detail: SingleTaskPayload;
|
15
|
+
} | {
|
16
|
+
name: typeof TaskEvents.TaskClosed;
|
17
|
+
detail: SingleTaskPayload;
|
18
|
+
} | {
|
19
|
+
name: typeof TaskEvents.Refresh;
|
20
|
+
} | {
|
21
|
+
name: typeof TaskEvents.ShowDialog;
|
22
|
+
};
|
23
|
+
export declare const dispatchTaskEvent: (props: DispatchTaskEventPayload) => void;
|
24
|
+
export {};
|
package/dist/types/src/node.d.ts
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
* COMPONENTS EXPORTS
|
3
3
|
*/
|
4
4
|
export * from './components/Sidebar/Widgets/ProfileMenu/types';
|
5
|
+
export * from './components/Sidebar/Widgets/Tasks/types';
|
5
6
|
export { NavigationPanel } from './components/NavigationPanel/NavigationPanel';
|
6
7
|
export { Sidebar } from './components/Sidebar/Sidebar';
|
7
8
|
export { Breadcrumbs } from './components/NavigationPanel/components/Breadcrumbs/Breadcrumbs';
|