@framework-m/desk 0.4.2
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/LICENSE +202 -0
- package/README.md +153 -0
- package/dist/auth.d.ts +11 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/authConfig.d.ts +42 -0
- package/dist/authConfig.d.ts.map +1 -0
- package/dist/components/CommandPalette.d.ts +49 -0
- package/dist/components/CommandPalette.d.ts.map +1 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/breadcrumb/index.d.ts.map +1 -0
- package/dist/components/feedback/AlertBanner.d.ts +8 -0
- package/dist/components/feedback/AlertBanner.d.ts.map +1 -0
- package/dist/components/feedback/ConfirmDialog.d.ts +13 -0
- package/dist/components/feedback/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/feedback/index.d.ts +5 -0
- package/dist/components/feedback/index.d.ts.map +1 -0
- package/dist/components/form/AutoForm.d.ts +61 -0
- package/dist/components/form/AutoForm.d.ts.map +1 -0
- package/dist/components/form/LinkWidget.d.ts +20 -0
- package/dist/components/form/LinkWidget.d.ts.map +1 -0
- package/dist/components/form/index.d.ts +10 -0
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/form/templates.d.ts +58 -0
- package/dist/components/form/templates.d.ts.map +1 -0
- package/dist/components/layout/index.d.ts +3 -0
- package/dist/components/layout/index.d.ts.map +1 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/index.d.ts.map +1 -0
- package/dist/components/table/AutoTable.d.ts +47 -0
- package/dist/components/table/AutoTable.d.ts.map +1 -0
- package/dist/components/table/BulkActionsBar.d.ts +40 -0
- package/dist/components/table/BulkActionsBar.d.ts.map +1 -0
- package/dist/components/table/EditableCell.d.ts +54 -0
- package/dist/components/table/EditableCell.d.ts.map +1 -0
- package/dist/components/table/index.d.ts +12 -0
- package/dist/components/table/index.d.ts.map +1 -0
- package/dist/components/workflow/StateBadge.d.ts +29 -0
- package/dist/components/workflow/StateBadge.d.ts.map +1 -0
- package/dist/components/workflow/WorkflowActions.d.ts +37 -0
- package/dist/components/workflow/WorkflowActions.d.ts.map +1 -0
- package/dist/components/workflow/index.d.ts +10 -0
- package/dist/components/workflow/index.d.ts.map +1 -0
- package/dist/config/i18n.d.ts +3 -0
- package/dist/config/i18n.d.ts.map +1 -0
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/registry.d.ts +75 -0
- package/dist/config/registry.d.ts.map +1 -0
- package/dist/config/types.d.ts +130 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/useConfig.d.ts +18 -0
- package/dist/config/useConfig.d.ts.map +1 -0
- package/dist/constants.d.ts +35 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/data.d.ts +6 -0
- package/dist/data.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +21 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/types.d.ts +113 -0
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/hooks/useBulkActions.d.ts +82 -0
- package/dist/hooks/useBulkActions.d.ts.map +1 -0
- package/dist/hooks/useCommandPalette.d.ts +33 -0
- package/dist/hooks/useCommandPalette.d.ts.map +1 -0
- package/dist/hooks/useDocTypeMeta.d.ts +48 -0
- package/dist/hooks/useDocTypeMeta.d.ts.map +1 -0
- package/dist/hooks/useDocTypes.d.ts +66 -0
- package/dist/hooks/useDocTypes.d.ts.map +1 -0
- package/dist/hooks/useInlineEdit.d.ts +64 -0
- package/dist/hooks/useInlineEdit.d.ts.map +1 -0
- package/dist/hooks/useTranslation.d.ts +36 -0
- package/dist/hooks/useTranslation.d.ts.map +1 -0
- package/dist/hooks/useUIMeta.d.ts +111 -0
- package/dist/hooks/useUIMeta.d.ts.map +1 -0
- package/dist/hooks/useWorkflowActions.d.ts +75 -0
- package/dist/hooks/useWorkflowActions.d.ts.map +1 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5302 -0
- package/dist/index.js.map +1 -0
- package/dist/live.d.ts +21 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/pages/FormView.d.ts +40 -0
- package/dist/pages/FormView.d.ts.map +1 -0
- package/dist/pages/ListView.d.ts +39 -0
- package/dist/pages/ListView.d.ts.map +1 -0
- package/dist/pages/LoginPage.d.ts +32 -0
- package/dist/pages/LoginPage.d.ts.map +1 -0
- package/dist/plugins/Slot.d.ts +27 -0
- package/dist/plugins/Slot.d.ts.map +1 -0
- package/dist/plugins/index.d.ts +14 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/registry.d.ts +104 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/types.d.ts +130 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/types.d.ts +51 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/views/CalendarView.d.ts +14 -0
- package/dist/views/CalendarView.d.ts.map +1 -0
- package/dist/views/GanttView.d.ts +14 -0
- package/dist/views/GanttView.d.ts.map +1 -0
- package/dist/views/KanbanView.d.ts +16 -0
- package/dist/views/KanbanView.d.ts.map +1 -0
- package/dist/views/TreeView.d.ts +15 -0
- package/dist/views/TreeView.d.ts.map +1 -0
- package/dist/views/index.d.ts +17 -0
- package/dist/views/index.d.ts.map +1 -0
- package/dist/views/registry.d.ts +32 -0
- package/dist/views/registry.d.ts.map +1 -0
- package/dist/views/types.d.ts +97 -0
- package/dist/views/types.d.ts.map +1 -0
- package/dist/workspace/WorkspaceSection.d.ts +16 -0
- package/dist/workspace/WorkspaceSection.d.ts.map +1 -0
- package/dist/workspace/index.d.ts +12 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/dist/workspace/types.d.ts +95 -0
- package/dist/workspace/types.d.ts.map +1 -0
- package/dist/workspace/useWorkspaces.d.ts +38 -0
- package/dist/workspace/useWorkspaces.d.ts.map +1 -0
- package/package.json +89 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Supported view types
|
|
4
|
+
*/
|
|
5
|
+
export type ViewType = "list" | "kanban" | "calendar" | "gantt" | "tree";
|
|
6
|
+
/**
|
|
7
|
+
* Common view props
|
|
8
|
+
*/
|
|
9
|
+
export interface ViewProps {
|
|
10
|
+
/** DocType/resource name */
|
|
11
|
+
resource: string;
|
|
12
|
+
/** JSON Schema for the DocType */
|
|
13
|
+
schema?: Record<string, unknown>;
|
|
14
|
+
/** Optional extra props */
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* View registration
|
|
19
|
+
*/
|
|
20
|
+
export interface ViewRegistration {
|
|
21
|
+
/** View type identifier */
|
|
22
|
+
type: ViewType;
|
|
23
|
+
/** Display label */
|
|
24
|
+
label: string;
|
|
25
|
+
/** View component */
|
|
26
|
+
component: ComponentType<ViewProps>;
|
|
27
|
+
/** Icon (emoji or component) */
|
|
28
|
+
icon?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Kanban config
|
|
32
|
+
*/
|
|
33
|
+
export interface KanbanConfig {
|
|
34
|
+
/** Field to group by (status field) */
|
|
35
|
+
groupField: string;
|
|
36
|
+
/** Column definitions */
|
|
37
|
+
columns: KanbanColumn[];
|
|
38
|
+
/** Card title field */
|
|
39
|
+
titleField?: string;
|
|
40
|
+
/** Card description field */
|
|
41
|
+
descriptionField?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface KanbanColumn {
|
|
44
|
+
/** Column ID (status value) */
|
|
45
|
+
id: string;
|
|
46
|
+
/** Display title */
|
|
47
|
+
title: string;
|
|
48
|
+
/** Column color */
|
|
49
|
+
color?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Calendar config
|
|
53
|
+
*/
|
|
54
|
+
export interface CalendarConfig {
|
|
55
|
+
/** Start date field */
|
|
56
|
+
startField: string;
|
|
57
|
+
/** End date field (optional) */
|
|
58
|
+
endField?: string;
|
|
59
|
+
/** Event title field */
|
|
60
|
+
titleField: string;
|
|
61
|
+
/** Color field (optional) */
|
|
62
|
+
colorField?: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Tree view config
|
|
66
|
+
* Used by DocTypes with a parent_field (e.g., Territory, Account chart)
|
|
67
|
+
*/
|
|
68
|
+
export interface TreeConfig {
|
|
69
|
+
/** Backend field that links to parent node ID */
|
|
70
|
+
parentField: string;
|
|
71
|
+
/** Field used as the display label */
|
|
72
|
+
labelField: string;
|
|
73
|
+
/** Optional sort order field (e.g., lft for nested sets) */
|
|
74
|
+
orderField?: string;
|
|
75
|
+
/** Whether to allow drag-and-drop reparenting */
|
|
76
|
+
allowReparent?: boolean;
|
|
77
|
+
/** Whether to allow inline Add Child */
|
|
78
|
+
allowAddChild?: boolean;
|
|
79
|
+
/** Whether to allow inline Rename */
|
|
80
|
+
allowRename?: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Gantt config
|
|
84
|
+
*/
|
|
85
|
+
export interface GanttConfig {
|
|
86
|
+
/** Task name field */
|
|
87
|
+
nameField: string;
|
|
88
|
+
/** Start date field */
|
|
89
|
+
startField: string;
|
|
90
|
+
/** End date field */
|
|
91
|
+
endField: string;
|
|
92
|
+
/** Progress field (0-100) */
|
|
93
|
+
progressField?: string;
|
|
94
|
+
/** Parent task field for hierarchy */
|
|
95
|
+
parentField?: string;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/views/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzE;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MAAM,CAAC;IACnB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wCAAwC;IACxC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qCAAqC;IACrC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,sBAAsB;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,6BAA6B;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DeskWorkspace } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* WorkspaceSection props
|
|
4
|
+
*/
|
|
5
|
+
export interface WorkspaceSectionProps {
|
|
6
|
+
/** Workspace to render */
|
|
7
|
+
workspace: DeskWorkspace;
|
|
8
|
+
/** Whether collapsed */
|
|
9
|
+
collapsed?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* WorkspaceSection Component
|
|
13
|
+
*/
|
|
14
|
+
export declare function WorkspaceSection({ workspace, collapsed }: WorkspaceSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default WorkspaceSection;
|
|
16
|
+
//# sourceMappingURL=WorkspaceSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspaceSection.d.ts","sourceRoot":"","sources":["../../src/workspace/WorkspaceSection.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,SAAS,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,0BAA0B;IAC1B,SAAS,EAAE,aAAa,CAAC;IACzB,wBAAwB;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,SAAiB,EAAE,EAAE,qBAAqB,2CAmFvF;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace Module
|
|
3
|
+
*
|
|
4
|
+
* Desk Workspace navigation configuration.
|
|
5
|
+
* Per checklist 6.4: Desk Workspace Configuration.
|
|
6
|
+
*/
|
|
7
|
+
export type { DeskWorkspace, WorkspaceItem, Shortcut, Link, Chart, WorkspaceResponse, } from './types';
|
|
8
|
+
export { useWorkspaces } from './useWorkspaces';
|
|
9
|
+
export type { UseWorkspacesOptions, UseWorkspacesResult } from './useWorkspaces';
|
|
10
|
+
export { WorkspaceSection } from './WorkspaceSection';
|
|
11
|
+
export type { WorkspaceSectionProps } from './WorkspaceSection';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EACV,aAAa,EACb,aAAa,EACb,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Desk Workspace Types
|
|
3
|
+
*
|
|
4
|
+
* Types for Desk Workspace navigation configuration.
|
|
5
|
+
* Per checklist 6.4: Desk Workspace Configuration.
|
|
6
|
+
*
|
|
7
|
+
* Terminology:
|
|
8
|
+
* - Desk Workspace = End-user navigation groupings in sidebar
|
|
9
|
+
* - NOT Studio Workspace (which is the Git monorepo)
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Shortcut item - quick link to a DocType
|
|
13
|
+
*/
|
|
14
|
+
export interface Shortcut {
|
|
15
|
+
type: "shortcut";
|
|
16
|
+
/** Display label */
|
|
17
|
+
label: string;
|
|
18
|
+
/** DocType/resource name */
|
|
19
|
+
doctype: string;
|
|
20
|
+
/** Icon (emoji or component name) */
|
|
21
|
+
icon?: string;
|
|
22
|
+
/** Optional color */
|
|
23
|
+
color?: string;
|
|
24
|
+
/** Open in new tab */
|
|
25
|
+
newTab?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Link item - external or custom URL
|
|
29
|
+
*/
|
|
30
|
+
export interface Link {
|
|
31
|
+
type: "link";
|
|
32
|
+
/** Display label */
|
|
33
|
+
label: string;
|
|
34
|
+
/** URL to navigate to */
|
|
35
|
+
url: string;
|
|
36
|
+
/** Icon (emoji or component name) */
|
|
37
|
+
icon?: string;
|
|
38
|
+
/** Open in new tab */
|
|
39
|
+
newTab?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Chart item - dashboard widget
|
|
43
|
+
*/
|
|
44
|
+
export interface Chart {
|
|
45
|
+
type: "chart";
|
|
46
|
+
/** Display label */
|
|
47
|
+
label: string;
|
|
48
|
+
/** Chart type */
|
|
49
|
+
chartType: "number" | "line" | "bar" | "pie" | "donut";
|
|
50
|
+
/** Data source (resource name or report) */
|
|
51
|
+
source: string;
|
|
52
|
+
/** Field to aggregate */
|
|
53
|
+
field?: string;
|
|
54
|
+
/** Aggregation method */
|
|
55
|
+
aggregate?: "count" | "sum" | "avg";
|
|
56
|
+
/** Filter conditions */
|
|
57
|
+
filters?: Record<string, unknown>;
|
|
58
|
+
/** Chart color */
|
|
59
|
+
color?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Workspace item - union of all item types
|
|
63
|
+
*/
|
|
64
|
+
export type WorkspaceItem = Shortcut | Link | Chart;
|
|
65
|
+
/**
|
|
66
|
+
* Desk Workspace definition
|
|
67
|
+
*/
|
|
68
|
+
export interface DeskWorkspace {
|
|
69
|
+
/** Unique identifier */
|
|
70
|
+
name: string;
|
|
71
|
+
/** Display name in sidebar */
|
|
72
|
+
label: string;
|
|
73
|
+
/** Sidebar icon (emoji or component name) */
|
|
74
|
+
icon: string;
|
|
75
|
+
/** Workspace contents */
|
|
76
|
+
items: WorkspaceItem[];
|
|
77
|
+
/** Roles that can see this workspace (empty = all) */
|
|
78
|
+
roles: string[];
|
|
79
|
+
/** Sort order in sidebar */
|
|
80
|
+
sequence?: number;
|
|
81
|
+
/** Custom color */
|
|
82
|
+
color?: string;
|
|
83
|
+
/** Whether workspace is hidden */
|
|
84
|
+
hidden?: boolean;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Workspace API response
|
|
88
|
+
*/
|
|
89
|
+
export interface WorkspaceResponse {
|
|
90
|
+
/** List of workspaces */
|
|
91
|
+
workspaces: DeskWorkspace[];
|
|
92
|
+
/** User's roles (for client-side filtering) */
|
|
93
|
+
userRoles?: string[];
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/workspace/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,UAAU,CAAC;IACjB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,KAAK,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E,MAAM,CAAC;IAClB,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,yBAAyB;IACzB,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DeskWorkspace } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook options
|
|
4
|
+
*/
|
|
5
|
+
export interface UseWorkspacesOptions {
|
|
6
|
+
/** Whether to filter by user roles (default: true) */
|
|
7
|
+
filterByRoles?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Hook return type
|
|
11
|
+
*/
|
|
12
|
+
export interface UseWorkspacesResult {
|
|
13
|
+
/** List of workspaces */
|
|
14
|
+
workspaces: DeskWorkspace[];
|
|
15
|
+
/** Whether loading */
|
|
16
|
+
isLoading: boolean;
|
|
17
|
+
/** Error message */
|
|
18
|
+
error: string | null;
|
|
19
|
+
/** Refetch workspaces */
|
|
20
|
+
refetch: () => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* useWorkspaces Hook
|
|
24
|
+
*
|
|
25
|
+
* Fetches workspaces from /api/meta/workspaces and filters by user roles.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* const { workspaces, isLoading } = useWorkspaces();
|
|
30
|
+
*
|
|
31
|
+
* // In sidebar
|
|
32
|
+
* {workspaces.map(ws => (
|
|
33
|
+
* <WorkspaceSection key={ws.name} workspace={ws} />
|
|
34
|
+
* ))}
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function useWorkspaces({ filterByRoles }?: UseWorkspacesOptions): UseWorkspacesResult;
|
|
38
|
+
//# sourceMappingURL=useWorkspaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWorkspaces.d.ts","sourceRoot":"","sources":["../../src/workspace/useWorkspaces.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAqB,MAAM,SAAS,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,sDAAsD;IACtD,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,yBAAyB;IACzB,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,sBAAsB;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,oBAAoB;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,yBAAyB;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAUD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,EAAE,aAAoB,EAAE,GAAE,oBAAyB,GAAG,mBAAmB,CA4EtG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@framework-m/desk",
|
|
3
|
+
"version": "0.4.2",
|
|
4
|
+
"description": "Business components, hooks, views, and providers for Framework M applications",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"keywords": [
|
|
20
|
+
"framework-m",
|
|
21
|
+
"refine",
|
|
22
|
+
"data-provider",
|
|
23
|
+
"auth-provider",
|
|
24
|
+
"live-provider",
|
|
25
|
+
"desk",
|
|
26
|
+
"erp"
|
|
27
|
+
],
|
|
28
|
+
"author": "Framework M Team",
|
|
29
|
+
"license": "Apache-2.0",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://gitlab.com/framework-m/framework-m.git",
|
|
33
|
+
"directory": "libs/framework-m-desk"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@framework-m/ui": "^0.1.0"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@refinedev/core": "^5.0.0",
|
|
40
|
+
"@refinedev/react-table": "^6.0.0",
|
|
41
|
+
"@rjsf/core": "^6.0.0",
|
|
42
|
+
"@rjsf/utils": "^6.0.0",
|
|
43
|
+
"@rjsf/validator-ajv8": "^6.0.0",
|
|
44
|
+
"@tanstack/react-table": "^8.0.0",
|
|
45
|
+
"i18next": "^25.0.0",
|
|
46
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
47
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
48
|
+
"react-i18next": "^16.0.0",
|
|
49
|
+
"react-router": "^7.0.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@refinedev/core": "^5.0.10",
|
|
53
|
+
"@refinedev/react-table": "^6.0.1",
|
|
54
|
+
"@rjsf/core": "^6.4.1",
|
|
55
|
+
"@rjsf/utils": "^6.4.1",
|
|
56
|
+
"@rjsf/validator-ajv8": "^6.4.1",
|
|
57
|
+
"@tanstack/react-query": "^5.90.21",
|
|
58
|
+
"@tanstack/react-table": "^8.21.3",
|
|
59
|
+
"@testing-library/react": "^16.3.2",
|
|
60
|
+
"@types/node": "^20.19.37",
|
|
61
|
+
"@types/react": "^19.2.14",
|
|
62
|
+
"@types/react-dom": "^19.1.0",
|
|
63
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
64
|
+
"happy-dom": "^20.8.4",
|
|
65
|
+
"i18next": "^25.8.18",
|
|
66
|
+
"i18next-browser-languagedetector": "^8.2.1",
|
|
67
|
+
"i18next-http-backend": "^3.0.2",
|
|
68
|
+
"react": "^19.2.4",
|
|
69
|
+
"react-dom": "^19.2.4",
|
|
70
|
+
"react-i18next": "^16.5.8",
|
|
71
|
+
"react-router": "^7.13.1",
|
|
72
|
+
"typescript": "^5.9.3",
|
|
73
|
+
"vite": "^6.4.1",
|
|
74
|
+
"vite-plugin-dts": "^4.5.1",
|
|
75
|
+
"vitest": "^4.1.0",
|
|
76
|
+
"@framework-m/ui": "0.2.1"
|
|
77
|
+
},
|
|
78
|
+
"publishConfig": {
|
|
79
|
+
"access": "public"
|
|
80
|
+
},
|
|
81
|
+
"scripts": {
|
|
82
|
+
"build": "tsc && vite build",
|
|
83
|
+
"dev": "vite build --watch",
|
|
84
|
+
"type-check": "tsc --noEmit",
|
|
85
|
+
"test": "vitest run",
|
|
86
|
+
"test:watch": "vitest",
|
|
87
|
+
"test:coverage": "vitest run --coverage"
|
|
88
|
+
}
|
|
89
|
+
}
|