@multiplatform.one/backoffice 6.4.0 → 6.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/dist/cjs/chrome/CommandPalette.cjs +20 -9
- package/dist/cjs/chrome/CommandPalette.native.js +18 -10
- package/dist/cjs/chrome/CommandPalette.native.js.map +1 -1
- package/dist/cjs/i18n/en.cjs +21 -0
- package/dist/cjs/i18n/en.native.js +21 -0
- package/dist/cjs/i18n/en.native.js.map +1 -1
- package/dist/cjs/index.cjs +49 -1
- package/dist/cjs/index.native.js +48 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/shared/types.cjs +18 -0
- package/dist/cjs/shared/types.native.js +21 -0
- package/dist/cjs/shared/types.native.js.map +1 -0
- package/dist/cjs/shared/useDocinfo.cjs +116 -0
- package/dist/cjs/shared/useDocinfo.native.js +167 -0
- package/dist/cjs/shared/useDocinfo.native.js.map +1 -0
- package/dist/cjs/shared/useDoctypeMeta.cjs +124 -0
- package/dist/cjs/shared/useDoctypeMeta.native.js +158 -0
- package/dist/cjs/shared/useDoctypeMeta.native.js.map +1 -0
- package/dist/cjs/shared/useRecentVisit.cjs +40 -0
- package/dist/cjs/shared/useRecentVisit.native.js +43 -0
- package/dist/cjs/shared/useRecentVisit.native.js.map +1 -0
- package/dist/cjs/shared/useSessionUserId.cjs +54 -0
- package/dist/cjs/shared/useSessionUserId.native.js +59 -0
- package/dist/cjs/shared/useSessionUserId.native.js.map +1 -0
- package/dist/cjs/shared/useSlugTarget.cjs +138 -0
- package/dist/cjs/shared/useSlugTarget.native.js +166 -0
- package/dist/cjs/shared/useSlugTarget.native.js.map +1 -0
- package/dist/cjs/shared/useUserRoles.cjs +72 -0
- package/dist/cjs/shared/useUserRoles.native.js +79 -0
- package/dist/cjs/shared/useUserRoles.native.js.map +1 -0
- package/dist/cjs/workspace/WorkspaceChartBlock.cjs +136 -0
- package/dist/cjs/workspace/WorkspaceChartBlock.native.js +144 -0
- package/dist/cjs/workspace/WorkspaceChartBlock.native.js.map +1 -0
- package/dist/cjs/workspace/WorkspaceGrid.cjs +91 -0
- package/dist/cjs/workspace/WorkspaceGrid.native.js +126 -0
- package/dist/cjs/workspace/WorkspaceGrid.native.js.map +1 -0
- package/dist/cjs/workspace/WorkspaceLinkCard.cjs +139 -0
- package/dist/cjs/workspace/WorkspaceLinkCard.native.js +155 -0
- package/dist/cjs/workspace/WorkspaceLinkCard.native.js.map +1 -0
- package/dist/cjs/workspace/WorkspaceLinkDirectory.cjs +110 -0
- package/dist/cjs/workspace/WorkspaceLinkDirectory.native.js +127 -0
- package/dist/cjs/workspace/WorkspaceLinkDirectory.native.js.map +1 -0
- package/dist/cjs/workspace/WorkspaceNumberCard.cjs +133 -0
- package/dist/cjs/workspace/WorkspaceNumberCard.native.js +138 -0
- package/dist/cjs/workspace/WorkspaceNumberCard.native.js.map +1 -0
- package/dist/cjs/workspace/WorkspaceQuickList.cjs +112 -0
- package/dist/cjs/workspace/WorkspaceQuickList.native.js +130 -0
- package/dist/cjs/workspace/WorkspaceQuickList.native.js.map +1 -0
- package/dist/cjs/workspace/WorkspaceRecents.cjs +116 -0
- package/dist/cjs/workspace/WorkspaceRecents.native.js +132 -0
- package/dist/cjs/workspace/WorkspaceRecents.native.js.map +1 -0
- package/dist/cjs/workspace/WorkspaceScreen.cjs +291 -0
- package/dist/cjs/workspace/WorkspaceScreen.native.js +323 -0
- package/dist/cjs/workspace/WorkspaceScreen.native.js.map +1 -0
- package/dist/cjs/workspace/WorkspaceShortcut.cjs +185 -0
- package/dist/cjs/workspace/WorkspaceShortcut.native.js +202 -0
- package/dist/cjs/workspace/WorkspaceShortcut.native.js.map +1 -0
- package/dist/cjs/workspace/parseContent.cjs +180 -0
- package/dist/cjs/workspace/parseContent.native.js +299 -0
- package/dist/cjs/workspace/parseContent.native.js.map +1 -0
- package/dist/cjs/workspace/types.cjs +18 -0
- package/dist/cjs/workspace/types.native.js +21 -0
- package/dist/cjs/workspace/types.native.js.map +1 -0
- package/dist/cjs/workspace/useDashboardChart.cjs +96 -0
- package/dist/cjs/workspace/useDashboardChart.native.js +110 -0
- package/dist/cjs/workspace/useDashboardChart.native.js.map +1 -0
- package/dist/cjs/workspace/useWorkspaceDoc.cjs +103 -0
- package/dist/cjs/workspace/useWorkspaceDoc.native.js +120 -0
- package/dist/cjs/workspace/useWorkspaceDoc.native.js.map +1 -0
- package/dist/esm/chrome/CommandPalette.mjs +20 -9
- package/dist/esm/chrome/CommandPalette.mjs.map +1 -1
- package/dist/esm/chrome/CommandPalette.native.js +18 -10
- package/dist/esm/chrome/CommandPalette.native.js.map +1 -1
- package/dist/esm/i18n/en.mjs +21 -0
- package/dist/esm/i18n/en.mjs.map +1 -1
- package/dist/esm/i18n/en.native.js +21 -0
- package/dist/esm/i18n/en.native.js.map +1 -1
- package/dist/esm/index.mjs +19 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +19 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/shared/types.mjs +2 -0
- package/dist/esm/shared/types.mjs.map +1 -0
- package/dist/esm/shared/types.native.js +2 -0
- package/dist/esm/shared/types.native.js.map +1 -0
- package/dist/esm/shared/useDocinfo.mjs +90 -0
- package/dist/esm/shared/useDocinfo.mjs.map +1 -0
- package/dist/esm/shared/useDocinfo.native.js +138 -0
- package/dist/esm/shared/useDocinfo.native.js.map +1 -0
- package/dist/esm/shared/useDoctypeMeta.mjs +99 -0
- package/dist/esm/shared/useDoctypeMeta.mjs.map +1 -0
- package/dist/esm/shared/useDoctypeMeta.native.js +130 -0
- package/dist/esm/shared/useDoctypeMeta.native.js.map +1 -0
- package/dist/esm/shared/useRecentVisit.mjs +15 -0
- package/dist/esm/shared/useRecentVisit.mjs.map +1 -0
- package/dist/esm/shared/useRecentVisit.native.js +15 -0
- package/dist/esm/shared/useRecentVisit.native.js.map +1 -0
- package/dist/esm/shared/useSessionUserId.mjs +29 -0
- package/dist/esm/shared/useSessionUserId.mjs.map +1 -0
- package/dist/esm/shared/useSessionUserId.native.js +31 -0
- package/dist/esm/shared/useSessionUserId.native.js.map +1 -0
- package/dist/esm/shared/useSlugTarget.mjs +113 -0
- package/dist/esm/shared/useSlugTarget.mjs.map +1 -0
- package/dist/esm/shared/useSlugTarget.native.js +138 -0
- package/dist/esm/shared/useSlugTarget.native.js.map +1 -0
- package/dist/esm/shared/useUserRoles.mjs +47 -0
- package/dist/esm/shared/useUserRoles.mjs.map +1 -0
- package/dist/esm/shared/useUserRoles.native.js +51 -0
- package/dist/esm/shared/useUserRoles.native.js.map +1 -0
- package/dist/esm/workspace/WorkspaceChartBlock.mjs +111 -0
- package/dist/esm/workspace/WorkspaceChartBlock.mjs.map +1 -0
- package/dist/esm/workspace/WorkspaceChartBlock.native.js +116 -0
- package/dist/esm/workspace/WorkspaceChartBlock.native.js.map +1 -0
- package/dist/esm/workspace/WorkspaceGrid.mjs +66 -0
- package/dist/esm/workspace/WorkspaceGrid.mjs.map +1 -0
- package/dist/esm/workspace/WorkspaceGrid.native.js +98 -0
- package/dist/esm/workspace/WorkspaceGrid.native.js.map +1 -0
- package/dist/esm/workspace/WorkspaceLinkCard.mjs +113 -0
- package/dist/esm/workspace/WorkspaceLinkCard.mjs.map +1 -0
- package/dist/esm/workspace/WorkspaceLinkCard.native.js +126 -0
- package/dist/esm/workspace/WorkspaceLinkCard.native.js.map +1 -0
- package/dist/esm/workspace/WorkspaceLinkDirectory.mjs +84 -0
- package/dist/esm/workspace/WorkspaceLinkDirectory.mjs.map +1 -0
- package/dist/esm/workspace/WorkspaceLinkDirectory.native.js +98 -0
- package/dist/esm/workspace/WorkspaceLinkDirectory.native.js.map +1 -0
- package/dist/esm/workspace/WorkspaceNumberCard.mjs +108 -0
- package/dist/esm/workspace/WorkspaceNumberCard.mjs.map +1 -0
- package/dist/esm/workspace/WorkspaceNumberCard.native.js +110 -0
- package/dist/esm/workspace/WorkspaceNumberCard.native.js.map +1 -0
- package/dist/esm/workspace/WorkspaceQuickList.mjs +87 -0
- package/dist/esm/workspace/WorkspaceQuickList.mjs.map +1 -0
- package/dist/esm/workspace/WorkspaceQuickList.native.js +102 -0
- package/dist/esm/workspace/WorkspaceQuickList.native.js.map +1 -0
- package/dist/esm/workspace/WorkspaceRecents.mjs +91 -0
- package/dist/esm/workspace/WorkspaceRecents.mjs.map +1 -0
- package/dist/esm/workspace/WorkspaceRecents.native.js +104 -0
- package/dist/esm/workspace/WorkspaceRecents.native.js.map +1 -0
- package/dist/esm/workspace/WorkspaceScreen.mjs +266 -0
- package/dist/esm/workspace/WorkspaceScreen.mjs.map +1 -0
- package/dist/esm/workspace/WorkspaceScreen.native.js +295 -0
- package/dist/esm/workspace/WorkspaceScreen.native.js.map +1 -0
- package/dist/esm/workspace/WorkspaceShortcut.mjs +159 -0
- package/dist/esm/workspace/WorkspaceShortcut.mjs.map +1 -0
- package/dist/esm/workspace/WorkspaceShortcut.native.js +173 -0
- package/dist/esm/workspace/WorkspaceShortcut.native.js.map +1 -0
- package/dist/esm/workspace/parseContent.mjs +148 -0
- package/dist/esm/workspace/parseContent.mjs.map +1 -0
- package/dist/esm/workspace/parseContent.native.js +264 -0
- package/dist/esm/workspace/parseContent.native.js.map +1 -0
- package/dist/esm/workspace/types.mjs +2 -0
- package/dist/esm/workspace/types.mjs.map +1 -0
- package/dist/esm/workspace/types.native.js +2 -0
- package/dist/esm/workspace/types.native.js.map +1 -0
- package/dist/esm/workspace/useDashboardChart.mjs +71 -0
- package/dist/esm/workspace/useDashboardChart.mjs.map +1 -0
- package/dist/esm/workspace/useDashboardChart.native.js +82 -0
- package/dist/esm/workspace/useDashboardChart.native.js.map +1 -0
- package/dist/esm/workspace/useWorkspaceDoc.mjs +77 -0
- package/dist/esm/workspace/useWorkspaceDoc.mjs.map +1 -0
- package/dist/esm/workspace/useWorkspaceDoc.native.js +91 -0
- package/dist/esm/workspace/useWorkspaceDoc.native.js.map +1 -0
- package/dist/jsx/chrome/CommandPalette.mjs +20 -9
- package/dist/jsx/chrome/CommandPalette.mjs.map +1 -1
- package/dist/jsx/chrome/CommandPalette.native.js +18 -10
- package/dist/jsx/chrome/CommandPalette.native.js.map +1 -1
- package/dist/jsx/i18n/en.mjs +21 -0
- package/dist/jsx/i18n/en.mjs.map +1 -1
- package/dist/jsx/i18n/en.native.js +21 -0
- package/dist/jsx/i18n/en.native.js.map +1 -1
- package/dist/jsx/index.js +19 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +19 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +48 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/shared/types.mjs +2 -0
- package/dist/jsx/shared/types.mjs.map +1 -0
- package/dist/jsx/shared/types.native.js +21 -0
- package/dist/jsx/shared/types.native.js.map +1 -0
- package/dist/jsx/shared/useDocinfo.mjs +90 -0
- package/dist/jsx/shared/useDocinfo.mjs.map +1 -0
- package/dist/jsx/shared/useDocinfo.native.js +167 -0
- package/dist/jsx/shared/useDocinfo.native.js.map +1 -0
- package/dist/jsx/shared/useDoctypeMeta.mjs +99 -0
- package/dist/jsx/shared/useDoctypeMeta.mjs.map +1 -0
- package/dist/jsx/shared/useDoctypeMeta.native.js +158 -0
- package/dist/jsx/shared/useDoctypeMeta.native.js.map +1 -0
- package/dist/jsx/shared/useRecentVisit.mjs +15 -0
- package/dist/jsx/shared/useRecentVisit.mjs.map +1 -0
- package/dist/jsx/shared/useRecentVisit.native.js +43 -0
- package/dist/jsx/shared/useRecentVisit.native.js.map +1 -0
- package/dist/jsx/shared/useSessionUserId.mjs +29 -0
- package/dist/jsx/shared/useSessionUserId.mjs.map +1 -0
- package/dist/jsx/shared/useSessionUserId.native.js +59 -0
- package/dist/jsx/shared/useSessionUserId.native.js.map +1 -0
- package/dist/jsx/shared/useSlugTarget.mjs +113 -0
- package/dist/jsx/shared/useSlugTarget.mjs.map +1 -0
- package/dist/jsx/shared/useSlugTarget.native.js +166 -0
- package/dist/jsx/shared/useSlugTarget.native.js.map +1 -0
- package/dist/jsx/shared/useUserRoles.mjs +47 -0
- package/dist/jsx/shared/useUserRoles.mjs.map +1 -0
- package/dist/jsx/shared/useUserRoles.native.js +79 -0
- package/dist/jsx/shared/useUserRoles.native.js.map +1 -0
- package/dist/jsx/workspace/WorkspaceChartBlock.mjs +111 -0
- package/dist/jsx/workspace/WorkspaceChartBlock.mjs.map +1 -0
- package/dist/jsx/workspace/WorkspaceChartBlock.native.js +144 -0
- package/dist/jsx/workspace/WorkspaceChartBlock.native.js.map +1 -0
- package/dist/jsx/workspace/WorkspaceGrid.mjs +66 -0
- package/dist/jsx/workspace/WorkspaceGrid.mjs.map +1 -0
- package/dist/jsx/workspace/WorkspaceGrid.native.js +126 -0
- package/dist/jsx/workspace/WorkspaceGrid.native.js.map +1 -0
- package/dist/jsx/workspace/WorkspaceLinkCard.mjs +113 -0
- package/dist/jsx/workspace/WorkspaceLinkCard.mjs.map +1 -0
- package/dist/jsx/workspace/WorkspaceLinkCard.native.js +155 -0
- package/dist/jsx/workspace/WorkspaceLinkCard.native.js.map +1 -0
- package/dist/jsx/workspace/WorkspaceLinkDirectory.mjs +84 -0
- package/dist/jsx/workspace/WorkspaceLinkDirectory.mjs.map +1 -0
- package/dist/jsx/workspace/WorkspaceLinkDirectory.native.js +127 -0
- package/dist/jsx/workspace/WorkspaceLinkDirectory.native.js.map +1 -0
- package/dist/jsx/workspace/WorkspaceNumberCard.mjs +108 -0
- package/dist/jsx/workspace/WorkspaceNumberCard.mjs.map +1 -0
- package/dist/jsx/workspace/WorkspaceNumberCard.native.js +138 -0
- package/dist/jsx/workspace/WorkspaceNumberCard.native.js.map +1 -0
- package/dist/jsx/workspace/WorkspaceQuickList.mjs +87 -0
- package/dist/jsx/workspace/WorkspaceQuickList.mjs.map +1 -0
- package/dist/jsx/workspace/WorkspaceQuickList.native.js +130 -0
- package/dist/jsx/workspace/WorkspaceQuickList.native.js.map +1 -0
- package/dist/jsx/workspace/WorkspaceRecents.mjs +91 -0
- package/dist/jsx/workspace/WorkspaceRecents.mjs.map +1 -0
- package/dist/jsx/workspace/WorkspaceRecents.native.js +132 -0
- package/dist/jsx/workspace/WorkspaceRecents.native.js.map +1 -0
- package/dist/jsx/workspace/WorkspaceScreen.mjs +266 -0
- package/dist/jsx/workspace/WorkspaceScreen.mjs.map +1 -0
- package/dist/jsx/workspace/WorkspaceScreen.native.js +323 -0
- package/dist/jsx/workspace/WorkspaceScreen.native.js.map +1 -0
- package/dist/jsx/workspace/WorkspaceShortcut.mjs +159 -0
- package/dist/jsx/workspace/WorkspaceShortcut.mjs.map +1 -0
- package/dist/jsx/workspace/WorkspaceShortcut.native.js +202 -0
- package/dist/jsx/workspace/WorkspaceShortcut.native.js.map +1 -0
- package/dist/jsx/workspace/parseContent.mjs +148 -0
- package/dist/jsx/workspace/parseContent.mjs.map +1 -0
- package/dist/jsx/workspace/parseContent.native.js +299 -0
- package/dist/jsx/workspace/parseContent.native.js.map +1 -0
- package/dist/jsx/workspace/types.mjs +2 -0
- package/dist/jsx/workspace/types.mjs.map +1 -0
- package/dist/jsx/workspace/types.native.js +21 -0
- package/dist/jsx/workspace/types.native.js.map +1 -0
- package/dist/jsx/workspace/useDashboardChart.mjs +71 -0
- package/dist/jsx/workspace/useDashboardChart.mjs.map +1 -0
- package/dist/jsx/workspace/useDashboardChart.native.js +110 -0
- package/dist/jsx/workspace/useDashboardChart.native.js.map +1 -0
- package/dist/jsx/workspace/useWorkspaceDoc.mjs +77 -0
- package/dist/jsx/workspace/useWorkspaceDoc.mjs.map +1 -0
- package/dist/jsx/workspace/useWorkspaceDoc.native.js +120 -0
- package/dist/jsx/workspace/useWorkspaceDoc.native.js.map +1 -0
- package/package.json +12 -12
- package/src/chrome/CommandPalette.tsx +35 -15
- package/src/i18n/en.ts +21 -0
- package/src/index.ts +69 -0
- package/src/shared/types.ts +14 -0
- package/src/shared/useDocinfo.ts +163 -0
- package/src/shared/useDoctypeMeta.ts +243 -0
- package/src/shared/useRecentVisit.ts +33 -0
- package/src/shared/useSessionUserId.ts +42 -0
- package/src/shared/useSlugTarget.ts +143 -0
- package/src/shared/useUserRoles.ts +66 -0
- package/src/workspace/WorkspaceChartBlock.tsx +115 -0
- package/src/workspace/WorkspaceGrid.tsx +82 -0
- package/src/workspace/WorkspaceLinkCard.tsx +134 -0
- package/src/workspace/WorkspaceLinkDirectory.tsx +126 -0
- package/src/workspace/WorkspaceNumberCard.tsx +126 -0
- package/src/workspace/WorkspaceQuickList.tsx +100 -0
- package/src/workspace/WorkspaceRecents.tsx +100 -0
- package/src/workspace/WorkspaceScreen.tsx +322 -0
- package/src/workspace/WorkspaceShortcut.tsx +223 -0
- package/src/workspace/parseContent.spec.ts +327 -0
- package/src/workspace/parseContent.ts +240 -0
- package/src/workspace/types.ts +135 -0
- package/src/workspace/useDashboardChart.ts +115 -0
- package/src/workspace/useWorkspaceDoc.ts +111 -0
- package/types/chrome/CommandPalette.d.ts.map +1 -1
- package/types/i18n/en.d.ts +19 -0
- package/types/i18n/en.d.ts.map +1 -1
- package/types/index.d.ts +34 -0
- package/types/index.d.ts.map +1 -1
- package/types/shared/types.d.ts +21 -0
- package/types/shared/types.d.ts.map +1 -0
- package/types/shared/useDocinfo.d.ts +61 -0
- package/types/shared/useDocinfo.d.ts.map +1 -0
- package/types/shared/useDoctypeMeta.d.ts +118 -0
- package/types/shared/useDoctypeMeta.d.ts.map +1 -0
- package/types/shared/useRecentVisit.d.ts +10 -0
- package/types/shared/useRecentVisit.d.ts.map +1 -0
- package/types/shared/useSessionUserId.d.ts +6 -0
- package/types/shared/useSessionUserId.d.ts.map +1 -0
- package/types/shared/useSlugTarget.d.ts +18 -0
- package/types/shared/useSlugTarget.d.ts.map +1 -0
- package/types/shared/useUserRoles.d.ts +15 -0
- package/types/shared/useUserRoles.d.ts.map +1 -0
- package/types/workspace/WorkspaceChartBlock.d.ts +6 -0
- package/types/workspace/WorkspaceChartBlock.d.ts.map +1 -0
- package/types/workspace/WorkspaceGrid.d.ts +23 -0
- package/types/workspace/WorkspaceGrid.d.ts.map +1 -0
- package/types/workspace/WorkspaceLinkCard.d.ts +20 -0
- package/types/workspace/WorkspaceLinkCard.d.ts.map +1 -0
- package/types/workspace/WorkspaceLinkDirectory.d.ts +19 -0
- package/types/workspace/WorkspaceLinkDirectory.d.ts.map +1 -0
- package/types/workspace/WorkspaceNumberCard.d.ts +19 -0
- package/types/workspace/WorkspaceNumberCard.d.ts.map +1 -0
- package/types/workspace/WorkspaceQuickList.d.ts +6 -0
- package/types/workspace/WorkspaceQuickList.d.ts.map +1 -0
- package/types/workspace/WorkspaceRecents.d.ts +2 -0
- package/types/workspace/WorkspaceRecents.d.ts.map +1 -0
- package/types/workspace/WorkspaceScreen.d.ts +24 -0
- package/types/workspace/WorkspaceScreen.d.ts.map +1 -0
- package/types/workspace/WorkspaceShortcut.d.ts +27 -0
- package/types/workspace/WorkspaceShortcut.d.ts.map +1 -0
- package/types/workspace/parseContent.d.ts +77 -0
- package/types/workspace/parseContent.d.ts.map +1 -0
- package/types/workspace/types.d.ts +112 -0
- package/types/workspace/types.d.ts.map +1 -0
- package/types/workspace/useDashboardChart.d.ts +29 -0
- package/types/workspace/useDashboardChart.d.ts.map +1 -0
- package/types/workspace/useWorkspaceDoc.d.ts +18 -0
- package/types/workspace/useWorkspaceDoc.d.ts.map +1 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frappe Workspace doc shapes — verified against a real bench
|
|
3
|
+
* (`GET /api/resource/Workspace/<name>`; see WorkspaceScreen for the
|
|
4
|
+
* rendering contract). `content` is an editorjs-style JSON string of
|
|
5
|
+
* blocks; the child tables hold the referenced widget definitions.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** One row of the `shortcuts` child table (doctype "Workspace Shortcut"). */
|
|
9
|
+
export interface WorkspaceShortcutRow {
|
|
10
|
+
name: string;
|
|
11
|
+
/** "DocType" | "Report" | "Page" | "Dashboard" | "URL" */
|
|
12
|
+
type: string;
|
|
13
|
+
link_to?: string;
|
|
14
|
+
/** URL shortcuts put the target here. */
|
|
15
|
+
url?: string;
|
|
16
|
+
label: string;
|
|
17
|
+
/** Optional list-view variant, e.g. "List" | "Tree" | "Report Builder". */
|
|
18
|
+
doc_view?: string;
|
|
19
|
+
/** Frappe color name for the count pill, e.g. "Grey", "Blue". */
|
|
20
|
+
color?: string;
|
|
21
|
+
/** JSON filters for the live count, e.g. `{"status":"Open"}`. */
|
|
22
|
+
stats_filter?: string;
|
|
23
|
+
/** Count display template, `{}` is the count, e.g. `"{} Open"`. */
|
|
24
|
+
format?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** One row of the `links` child table (doctype "Workspace Link"). */
|
|
28
|
+
export interface WorkspaceLinkRow {
|
|
29
|
+
name: string;
|
|
30
|
+
/** "Card Break" starts a link group; "Link" is a member of the group. */
|
|
31
|
+
type: "Card Break" | "Link" | string;
|
|
32
|
+
label: string;
|
|
33
|
+
/** "DocType" | "Report" | "Page" — only on type "Link". */
|
|
34
|
+
link_type?: string;
|
|
35
|
+
link_to?: string;
|
|
36
|
+
hidden?: number;
|
|
37
|
+
onboard?: number;
|
|
38
|
+
is_query_report?: number;
|
|
39
|
+
/** On Card Break rows: number of links desk shows before "+ N more". */
|
|
40
|
+
link_count?: number;
|
|
41
|
+
dependencies?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** One row of the `charts` child table (doctype "Workspace Chart"). */
|
|
45
|
+
export interface WorkspaceChartRow {
|
|
46
|
+
name: string;
|
|
47
|
+
/** Dashboard Chart doc name. */
|
|
48
|
+
chart_name: string;
|
|
49
|
+
label?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** One row of the `number_cards` child table (doctype "Workspace Number Card"). */
|
|
53
|
+
export interface WorkspaceNumberCardRow {
|
|
54
|
+
name: string;
|
|
55
|
+
/** Number Card doc name. */
|
|
56
|
+
number_card_name: string;
|
|
57
|
+
label?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** One row of the `quick_lists` child table (doctype "Workspace Quick List"). */
|
|
61
|
+
export interface WorkspaceQuickListRow {
|
|
62
|
+
name: string;
|
|
63
|
+
document_type: string;
|
|
64
|
+
label?: string;
|
|
65
|
+
/** JSON filters, e.g. `{"status":["=","Open"]}`. */
|
|
66
|
+
quick_list_filter?: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** The Workspace document (fields the workspace page renders). */
|
|
70
|
+
export interface WorkspaceDoc {
|
|
71
|
+
name: string;
|
|
72
|
+
doctype: string;
|
|
73
|
+
title?: string;
|
|
74
|
+
label?: string;
|
|
75
|
+
icon?: string;
|
|
76
|
+
module?: string;
|
|
77
|
+
public?: number;
|
|
78
|
+
is_hidden?: number;
|
|
79
|
+
/** JSON string of editorjs-style blocks. */
|
|
80
|
+
content?: string;
|
|
81
|
+
shortcuts?: WorkspaceShortcutRow[];
|
|
82
|
+
links?: WorkspaceLinkRow[];
|
|
83
|
+
charts?: WorkspaceChartRow[];
|
|
84
|
+
number_cards?: WorkspaceNumberCardRow[];
|
|
85
|
+
quick_lists?: WorkspaceQuickListRow[];
|
|
86
|
+
[key: string]: unknown;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ---------------------------------------------------------------------------
|
|
90
|
+
// Parsed `content` blocks
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
|
|
93
|
+
export type WorkspaceBlockType =
|
|
94
|
+
| "header"
|
|
95
|
+
| "paragraph"
|
|
96
|
+
| "shortcut"
|
|
97
|
+
| "card"
|
|
98
|
+
| "chart"
|
|
99
|
+
| "number_card"
|
|
100
|
+
| "quick_list"
|
|
101
|
+
| "spacer"
|
|
102
|
+
| "onboarding"
|
|
103
|
+
| (string & {});
|
|
104
|
+
|
|
105
|
+
export interface WorkspaceBlock {
|
|
106
|
+
id: string;
|
|
107
|
+
type: WorkspaceBlockType;
|
|
108
|
+
data: {
|
|
109
|
+
/** header / paragraph: HTML-ish rich text. */
|
|
110
|
+
text?: string;
|
|
111
|
+
/** shortcut: matches `shortcuts[].label`. */
|
|
112
|
+
shortcut_name?: string;
|
|
113
|
+
/** card: matches a Card Break `links[].label`. */
|
|
114
|
+
card_name?: string;
|
|
115
|
+
/** chart: matches `charts[].chart_name`. */
|
|
116
|
+
chart_name?: string;
|
|
117
|
+
/** number_card: matches `number_cards[].number_card_name`. */
|
|
118
|
+
number_card_name?: string;
|
|
119
|
+
/** quick_list: matches `quick_lists[].document_type`. */
|
|
120
|
+
quick_list_name?: string;
|
|
121
|
+
/** 12-column grid span (3 = shortcut pill, 4 = card, 12 = full row). */
|
|
122
|
+
col?: number;
|
|
123
|
+
[key: string]: unknown;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** A Card Break row grouped together with its following Link rows. */
|
|
128
|
+
export interface WorkspaceLinkGroup {
|
|
129
|
+
label: string;
|
|
130
|
+
breakRow: WorkspaceLinkRow;
|
|
131
|
+
links: WorkspaceLinkRow[];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** Frappe filter triple, ready for the frappe client (`[field, op, value]`). */
|
|
135
|
+
export type FrappeFilterTuple = [string, string, unknown];
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dashboard Chart data for workspace chart blocks.
|
|
3
|
+
*
|
|
4
|
+
* Desk fetches chart data through the whitelisted RPC
|
|
5
|
+
* `frappe.desk.doctype.dashboard_chart.dashboard_chart.get` (POST with
|
|
6
|
+
* `chart_name`), which returns `{message: {labels: string[], datasets:
|
|
7
|
+
* [{name, values: number[]}]}}` — verified against the control bench.
|
|
8
|
+
* The chart *type* (Line/Bar/Pie/…) lives on the Dashboard Chart doc,
|
|
9
|
+
* which the block reads separately via `useFrappeDoc`.
|
|
10
|
+
*
|
|
11
|
+
* Fixture mode has no RPC surface — the hook reports `unsupported` and
|
|
12
|
+
* the block renders an informational card instead (documented gap).
|
|
13
|
+
*/
|
|
14
|
+
import { CallModule, HttpClient, type AuthConfig } from "@multiplatform.one/frappe";
|
|
15
|
+
import { useFrappeConfig, type FrappeConfig } from "@multiplatform.one/frappe-ui";
|
|
16
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
17
|
+
|
|
18
|
+
export interface DashboardChartSeries {
|
|
19
|
+
labels: string[];
|
|
20
|
+
datasets: Array<{ name?: string; values: number[] }>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface DashboardChartDoc {
|
|
24
|
+
name: string;
|
|
25
|
+
doctype: string;
|
|
26
|
+
chart_name?: string;
|
|
27
|
+
/** Render style: "Line" | "Bar" | "Percentage" | "Pie" | "Donut" | "Heatmap" */
|
|
28
|
+
type?: string;
|
|
29
|
+
/** Data source kind: "Count" | "Sum" | "Average" | "Group By" | "Report" | "Custom" */
|
|
30
|
+
chart_type?: string;
|
|
31
|
+
document_type?: string;
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface UseDashboardChartDataResult {
|
|
36
|
+
series: DashboardChartSeries | undefined;
|
|
37
|
+
isLoading: boolean;
|
|
38
|
+
error: Error | undefined;
|
|
39
|
+
/** Fixture mode (stories/tests) — no RPC available for chart data. */
|
|
40
|
+
unsupported: boolean;
|
|
41
|
+
refresh: () => void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const callCache = new Map<string, CallModule>();
|
|
45
|
+
|
|
46
|
+
function getCall(config: FrappeConfig): CallModule {
|
|
47
|
+
const key = `${config.baseURL}:${config.auth?.token ?? ""}:${config.auth?.type ?? ""}`;
|
|
48
|
+
let call = callCache.get(key);
|
|
49
|
+
if (!call) {
|
|
50
|
+
const authConfig: AuthConfig | undefined = config.auth
|
|
51
|
+
? {
|
|
52
|
+
useToken: config.auth.useToken,
|
|
53
|
+
token: config.auth.token,
|
|
54
|
+
type: config.auth.type as AuthConfig["type"],
|
|
55
|
+
}
|
|
56
|
+
: undefined;
|
|
57
|
+
call = new CallModule(new HttpClient(config.baseURL, authConfig));
|
|
58
|
+
callCache.set(key, call);
|
|
59
|
+
}
|
|
60
|
+
return call;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const CHART_GET_METHOD = "frappe.desk.doctype.dashboard_chart.dashboard_chart.get";
|
|
64
|
+
|
|
65
|
+
/** Fetch a Dashboard Chart's series via the desk RPC (live mode only). */
|
|
66
|
+
export function useDashboardChartData(chartName: string | undefined): UseDashboardChartDataResult {
|
|
67
|
+
const config = useFrappeConfig();
|
|
68
|
+
const [series, setSeries] = useState<DashboardChartSeries | undefined>(undefined);
|
|
69
|
+
const [isLoading, setIsLoading] = useState(!!chartName && !config?.fixtures);
|
|
70
|
+
const [error, setError] = useState<Error | undefined>(undefined);
|
|
71
|
+
const fetchSeq = useRef(0);
|
|
72
|
+
|
|
73
|
+
const configRef = useRef(config);
|
|
74
|
+
configRef.current = config;
|
|
75
|
+
|
|
76
|
+
const unsupported = !!config?.fixtures;
|
|
77
|
+
|
|
78
|
+
const runFetch = useCallback(async (name: string) => {
|
|
79
|
+
const conn = configRef.current;
|
|
80
|
+
if (conn?.fixtures) return;
|
|
81
|
+
const seq = ++fetchSeq.current;
|
|
82
|
+
setIsLoading(true);
|
|
83
|
+
setError(undefined);
|
|
84
|
+
try {
|
|
85
|
+
if (!conn?.baseURL) {
|
|
86
|
+
throw new Error("useDashboardChartData requires a FrappeProvider with baseURL");
|
|
87
|
+
}
|
|
88
|
+
const res = await getCall(conn).post<{ message: DashboardChartSeries }>(CHART_GET_METHOD, {
|
|
89
|
+
chart_name: name,
|
|
90
|
+
refresh: 1,
|
|
91
|
+
});
|
|
92
|
+
if (seq !== fetchSeq.current) return;
|
|
93
|
+
setSeries(res.payload.message);
|
|
94
|
+
} catch (err) {
|
|
95
|
+
if (seq !== fetchSeq.current) return;
|
|
96
|
+
setError(err instanceof Error ? err : new Error(String(err)));
|
|
97
|
+
} finally {
|
|
98
|
+
if (seq === fetchSeq.current) setIsLoading(false);
|
|
99
|
+
}
|
|
100
|
+
}, []);
|
|
101
|
+
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (!chartName || unsupported) {
|
|
104
|
+
setIsLoading(false);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
void runFetch(chartName);
|
|
108
|
+
}, [chartName, unsupported, runFetch, config?.baseURL]);
|
|
109
|
+
|
|
110
|
+
const refresh = useCallback(() => {
|
|
111
|
+
if (chartName) void runFetch(chartName);
|
|
112
|
+
}, [chartName, runFetch]);
|
|
113
|
+
|
|
114
|
+
return { series, isLoading, error, unsupported, refresh };
|
|
115
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single-doc fetch for the workspace page.
|
|
3
|
+
*
|
|
4
|
+
* A Workspace doc is read-mostly chrome (its child tables define the page
|
|
5
|
+
* layout), so a plain REST `getDoc` through the frappe client is a better
|
|
6
|
+
* fit than spinning up a live collection for one document. Honors the
|
|
7
|
+
* FrappeProvider's fixture provider so stories/tests run offline.
|
|
8
|
+
*/
|
|
9
|
+
import { DbModule, HttpClient, type AuthConfig } from "@multiplatform.one/frappe";
|
|
10
|
+
import { useFrappeConfig, type FrappeConfig } from "@multiplatform.one/frappe-ui";
|
|
11
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
12
|
+
import type { WorkspaceDoc } from "./types";
|
|
13
|
+
|
|
14
|
+
// One REST client per connection — screens sharing a bench share it.
|
|
15
|
+
const dbCache = new Map<string, DbModule>();
|
|
16
|
+
|
|
17
|
+
function getDb(config: FrappeConfig): DbModule {
|
|
18
|
+
const key = `${config.baseURL}:${config.auth?.token ?? ""}:${config.auth?.type ?? ""}`;
|
|
19
|
+
let db = dbCache.get(key);
|
|
20
|
+
if (!db) {
|
|
21
|
+
const authConfig: AuthConfig | undefined = config.auth
|
|
22
|
+
? {
|
|
23
|
+
useToken: config.auth.useToken,
|
|
24
|
+
token: config.auth.token,
|
|
25
|
+
type: config.auth.type as AuthConfig["type"],
|
|
26
|
+
}
|
|
27
|
+
: undefined;
|
|
28
|
+
db = new DbModule(new HttpClient(config.baseURL, authConfig));
|
|
29
|
+
dbCache.set(key, db);
|
|
30
|
+
}
|
|
31
|
+
return db;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface UseFrappeDocResult<TDoc> {
|
|
35
|
+
doc: TDoc | undefined;
|
|
36
|
+
/** First load in flight — render a skeleton. */
|
|
37
|
+
isLoading: boolean;
|
|
38
|
+
error: Error | undefined;
|
|
39
|
+
/** True when the server rejected the read (HTTP 403). */
|
|
40
|
+
isPermissionError: boolean;
|
|
41
|
+
refresh: () => void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Fetch one document via REST (or the provider's fixtures when present). */
|
|
45
|
+
export function useFrappeDoc<TDoc extends { name: string; doctype: string }>(
|
|
46
|
+
doctype: string,
|
|
47
|
+
name: string | undefined,
|
|
48
|
+
): UseFrappeDocResult<TDoc> {
|
|
49
|
+
const config = useFrappeConfig();
|
|
50
|
+
const [doc, setDoc] = useState<TDoc | undefined>(undefined);
|
|
51
|
+
const [isLoading, setIsLoading] = useState(!!name);
|
|
52
|
+
const [error, setError] = useState<Error | undefined>(undefined);
|
|
53
|
+
const fetchSeq = useRef(0);
|
|
54
|
+
|
|
55
|
+
const configRef = useRef(config);
|
|
56
|
+
configRef.current = config;
|
|
57
|
+
|
|
58
|
+
const runFetch = useCallback(
|
|
59
|
+
async (docName: string) => {
|
|
60
|
+
const conn = configRef.current;
|
|
61
|
+
const seq = ++fetchSeq.current;
|
|
62
|
+
setIsLoading(true);
|
|
63
|
+
setError(undefined);
|
|
64
|
+
try {
|
|
65
|
+
let result: TDoc | undefined;
|
|
66
|
+
if (conn?.fixtures) {
|
|
67
|
+
const fixtureDoc = await conn.fixtures.getDoc(doctype, docName);
|
|
68
|
+
if (!fixtureDoc) throw new Error(`${doctype} ${docName} not found`);
|
|
69
|
+
result = fixtureDoc as unknown as TDoc;
|
|
70
|
+
} else if (conn?.baseURL) {
|
|
71
|
+
result = (await getDb(conn).getDoc(doctype, docName)) as unknown as TDoc;
|
|
72
|
+
} else {
|
|
73
|
+
throw new Error("useFrappeDoc requires a FrappeProvider with baseURL or fixtures");
|
|
74
|
+
}
|
|
75
|
+
if (seq !== fetchSeq.current) return;
|
|
76
|
+
setDoc(result);
|
|
77
|
+
} catch (err) {
|
|
78
|
+
if (seq !== fetchSeq.current) return;
|
|
79
|
+
setDoc(undefined);
|
|
80
|
+
setError(err instanceof Error ? err : new Error(String(err)));
|
|
81
|
+
} finally {
|
|
82
|
+
if (seq === fetchSeq.current) setIsLoading(false);
|
|
83
|
+
}
|
|
84
|
+
// doctype is stable per hook usage; config flows through configRef.
|
|
85
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
86
|
+
},
|
|
87
|
+
[doctype],
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (!name) {
|
|
92
|
+
setDoc(undefined);
|
|
93
|
+
setIsLoading(false);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
void runFetch(name);
|
|
97
|
+
}, [name, runFetch, config?.baseURL, config?.fixtures]);
|
|
98
|
+
|
|
99
|
+
const refresh = useCallback(() => {
|
|
100
|
+
if (name) void runFetch(name);
|
|
101
|
+
}, [name, runFetch]);
|
|
102
|
+
|
|
103
|
+
const isPermissionError = (error as { status?: number } | undefined)?.status === 403;
|
|
104
|
+
|
|
105
|
+
return { doc, isLoading, error, isPermissionError, refresh };
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** Fetch a Workspace doc by proper-cased name (e.g. "Home", "Users"). */
|
|
109
|
+
export function useWorkspaceDoc(workspace: string): UseFrappeDocResult<WorkspaceDoc> {
|
|
110
|
+
return useFrappeDoc<WorkspaceDoc>("Workspace", workspace);
|
|
111
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPalette.d.ts","sourceRoot":"","sources":["../../src/chrome/CommandPalette.tsx"],"names":[],"mappings":"AAwDA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAED,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"CommandPalette.d.ts","sourceRoot":"","sources":["../../src/chrome/CommandPalette.tsx"],"names":[],"mappings":"AAwDA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAED,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,mBAAmB,2CA6QzE"}
|
package/types/i18n/en.d.ts
CHANGED
|
@@ -61,6 +61,25 @@ export declare const en: {
|
|
|
61
61
|
readonly exitToSite: "← multiplatform.one";
|
|
62
62
|
readonly logOut: "Log Out";
|
|
63
63
|
};
|
|
64
|
+
readonly loading: "Loading";
|
|
65
|
+
readonly workspaceCardEmpty: "No links in this section";
|
|
66
|
+
readonly workspaceShortcutUnavailable: "Not available";
|
|
67
|
+
readonly workspaceQuickListViewAll: "View All";
|
|
68
|
+
readonly workspaceNumberCardError: "Couldn't load number card";
|
|
69
|
+
readonly workspaceNumberCardUnsupported: "This card type is only available in desk";
|
|
70
|
+
readonly workspaceChartFixture: "Chart data is only available on a live bench";
|
|
71
|
+
readonly workspaceChartError: "Couldn't load chart {{title}}";
|
|
72
|
+
readonly workspaceBrowseAll: "Browse all";
|
|
73
|
+
readonly workspaceBrowseAllCount_one: "{{count}} link";
|
|
74
|
+
readonly workspaceBrowseAllCount_other: "{{count}} links";
|
|
75
|
+
readonly workspaceFilterLinks: "Filter links...";
|
|
76
|
+
readonly workspaceFilterNoMatch: "No links match \"{{query}}\"";
|
|
77
|
+
readonly workspaceRecents: "Continue where you left off";
|
|
78
|
+
readonly workspacePermissionError: "You do not have permission to view {{workspace}}";
|
|
79
|
+
readonly workspaceError: "Couldn't load workspace {{workspace}}";
|
|
80
|
+
readonly workspaceEmpty: "This workspace is empty";
|
|
81
|
+
readonly workspaceEmptyDescription: "No blocks have been added to {{workspace}} yet";
|
|
82
|
+
readonly workspaceShortcuts: "Shortcuts";
|
|
64
83
|
readonly help: {
|
|
65
84
|
readonly label: "Help";
|
|
66
85
|
readonly documentation: "Documentation";
|
package/types/i18n/en.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+FL,CAAC"}
|
package/types/index.d.ts
CHANGED
|
@@ -52,4 +52,38 @@ export type { SessionUserInfo } from "./chrome/user-session";
|
|
|
52
52
|
export { useBackofficeShortcuts } from "./chrome/shortcuts";
|
|
53
53
|
export type { BackofficeShortcutHandlers } from "./chrome/shortcuts";
|
|
54
54
|
export { useFrappeApp } from "./shared/useFrappeApp";
|
|
55
|
+
export type { FrappeFilter, FrappeFilters, SlugTarget } from "./shared/types";
|
|
56
|
+
export { useDoctypeMeta } from "./shared/useDoctypeMeta";
|
|
57
|
+
export type { DocFieldMeta, DocLinkMeta, DocPermissionRule, DoctypeMeta, DoctypeMetaBundle, } from "./shared/useDoctypeMeta";
|
|
58
|
+
export { invalidateDocinfo, useDocinfo } from "./shared/useDocinfo";
|
|
59
|
+
export type { DocInfo, DocInfoComment } from "./shared/useDocinfo";
|
|
60
|
+
export { useSlugTarget } from "./shared/useSlugTarget";
|
|
61
|
+
export { useUserRoles } from "./shared/useUserRoles";
|
|
62
|
+
export { useRecentVisit } from "./shared/useRecentVisit";
|
|
63
|
+
export type { RecentVisit } from "./shared/useRecentVisit";
|
|
64
|
+
export { useSessionUserId } from "./shared/useSessionUserId";
|
|
65
|
+
export type { FrappeFilterTuple, WorkspaceBlock, WorkspaceBlockType, WorkspaceChartRow, WorkspaceLinkGroup, WorkspaceLinkRow, WorkspaceNumberCardRow, WorkspaceDoc as WorkspacePageDoc, WorkspaceQuickListRow, WorkspaceShortcutRow, } from "./workspace/types";
|
|
66
|
+
export { composeWorkspaceBlocks, findLinkGroup, findShortcut, groupLinks, headerLevel, parseFrappeFilters, parseWorkspaceContent, stripHtml, } from "./workspace/parseContent";
|
|
67
|
+
export type { WorkspaceComposition } from "./workspace/parseContent";
|
|
68
|
+
export { useFrappeDoc, useWorkspaceDoc } from "./workspace/useWorkspaceDoc";
|
|
69
|
+
export type { UseFrappeDocResult } from "./workspace/useWorkspaceDoc";
|
|
70
|
+
export { useDashboardChartData } from "./workspace/useDashboardChart";
|
|
71
|
+
export type { DashboardChartDoc, DashboardChartSeries, UseDashboardChartDataResult, } from "./workspace/useDashboardChart";
|
|
72
|
+
export { WorkspaceGrid } from "./workspace/WorkspaceGrid";
|
|
73
|
+
export type { WorkspaceGridItem, WorkspaceGridProps } from "./workspace/WorkspaceGrid";
|
|
74
|
+
export { WorkspaceLinkCard, resolveLinkTarget } from "./workspace/WorkspaceLinkCard";
|
|
75
|
+
export type { WorkspaceLinkCardProps } from "./workspace/WorkspaceLinkCard";
|
|
76
|
+
export { WorkspaceShortcut, resolveShortcutTarget } from "./workspace/WorkspaceShortcut";
|
|
77
|
+
export type { WorkspaceShortcutProps } from "./workspace/WorkspaceShortcut";
|
|
78
|
+
export { WorkspaceQuickList } from "./workspace/WorkspaceQuickList";
|
|
79
|
+
export type { WorkspaceQuickListProps } from "./workspace/WorkspaceQuickList";
|
|
80
|
+
export { WorkspaceNumberCard } from "./workspace/WorkspaceNumberCard";
|
|
81
|
+
export type { NumberCardDoc, WorkspaceNumberCardProps } from "./workspace/WorkspaceNumberCard";
|
|
82
|
+
export { WorkspaceChartBlock } from "./workspace/WorkspaceChartBlock";
|
|
83
|
+
export type { WorkspaceChartBlockProps } from "./workspace/WorkspaceChartBlock";
|
|
84
|
+
export { WorkspaceLinkDirectory, filterLinkGroup } from "./workspace/WorkspaceLinkDirectory";
|
|
85
|
+
export type { WorkspaceLinkDirectoryItem, WorkspaceLinkDirectoryProps, } from "./workspace/WorkspaceLinkDirectory";
|
|
86
|
+
export { WorkspaceRecents } from "./workspace/WorkspaceRecents";
|
|
87
|
+
export { WorkspaceScreen } from "./workspace/WorkspaceScreen";
|
|
88
|
+
export type { WorkspaceBlockKind, WorkspaceScreenProps } from "./workspace/WorkspaceScreen";
|
|
55
89
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,8BAA8B,EAC9B,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/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,2BAA2B,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACrF,YAAY,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACzF,YAAY,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,YAAY,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,YAAY,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC7F,YAAY,EACV,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Shared backoffice types — contracts between the backoffice surfaces. */
|
|
2
|
+
/** Result of resolving a URL slug to a navigable target. */
|
|
3
|
+
export type SlugTarget = {
|
|
4
|
+
status: "loading";
|
|
5
|
+
} | {
|
|
6
|
+
status: "resolved";
|
|
7
|
+
kind: "workspace";
|
|
8
|
+
workspace: string;
|
|
9
|
+
} | {
|
|
10
|
+
status: "resolved";
|
|
11
|
+
kind: "doctype";
|
|
12
|
+
doctype: string;
|
|
13
|
+
} | {
|
|
14
|
+
status: "not-found";
|
|
15
|
+
slug: string;
|
|
16
|
+
};
|
|
17
|
+
/** A frappe filter tuple: [fieldname, operator, value]. */
|
|
18
|
+
export type FrappeFilter = [string, string, unknown];
|
|
19
|
+
/** Filters exchanged between the list surface components. */
|
|
20
|
+
export type FrappeFilters = FrappeFilter[];
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAE3E,4DAA4D;AAC5D,MAAM,MAAM,UAAU,GAClB;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAC5D;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACxD;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1C,2DAA2D;AAC3D,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAErD,6DAA6D;AAC7D,MAAM,MAAM,aAAa,GAAG,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export interface DocInfoComment {
|
|
2
|
+
name: string;
|
|
3
|
+
comment_type?: string;
|
|
4
|
+
content?: string;
|
|
5
|
+
owner?: string;
|
|
6
|
+
creation?: string;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
export interface DocInfo {
|
|
10
|
+
doctype?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
user_info?: Record<string, {
|
|
13
|
+
fullname?: string;
|
|
14
|
+
image?: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
} & Record<string, unknown>>;
|
|
17
|
+
comments?: DocInfoComment[];
|
|
18
|
+
communications?: Array<Record<string, unknown>>;
|
|
19
|
+
automated_messages?: Array<Record<string, unknown>>;
|
|
20
|
+
versions?: Array<Record<string, unknown>>;
|
|
21
|
+
assignments?: Array<{
|
|
22
|
+
name?: string;
|
|
23
|
+
owner?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
} & Record<string, unknown>>;
|
|
26
|
+
assignment_logs?: Array<Record<string, unknown>>;
|
|
27
|
+
attachments?: Array<{
|
|
28
|
+
name?: string;
|
|
29
|
+
file_name?: string;
|
|
30
|
+
file_url?: string;
|
|
31
|
+
is_private?: 0 | 1;
|
|
32
|
+
} & Record<string, unknown>>;
|
|
33
|
+
attachment_logs?: Array<Record<string, unknown>>;
|
|
34
|
+
info_logs?: Array<Record<string, unknown>>;
|
|
35
|
+
like_logs?: Array<Record<string, unknown>>;
|
|
36
|
+
workflow_logs?: Array<Record<string, unknown>>;
|
|
37
|
+
shared?: Array<Record<string, unknown>>;
|
|
38
|
+
permissions?: Record<string, unknown>;
|
|
39
|
+
views?: Array<Record<string, unknown>>;
|
|
40
|
+
additional_timeline_content?: Array<Record<string, unknown>>;
|
|
41
|
+
milestones?: Array<Record<string, unknown>>;
|
|
42
|
+
is_document_followed?: number;
|
|
43
|
+
/** JSON string of tag list, e.g. "[]" or comma string — parse defensively */
|
|
44
|
+
tags?: string;
|
|
45
|
+
document_email?: unknown;
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Shared, deduped fetch of frappe's docinfo for a document. Multiple panels
|
|
50
|
+
* (sidebar, timeline, connections) share one fetch; `reload()` from any of
|
|
51
|
+
* them refreshes all subscribers.
|
|
52
|
+
*/
|
|
53
|
+
export declare function useDocinfo(doctype?: string, name?: string): {
|
|
54
|
+
docinfo?: DocInfo;
|
|
55
|
+
loading: boolean;
|
|
56
|
+
error?: Error;
|
|
57
|
+
reload: () => void;
|
|
58
|
+
};
|
|
59
|
+
/** Invalidate the docinfo cache for a document (after mutations). */
|
|
60
|
+
export declare function invalidateDocinfo(doctype: string, name: string): void;
|
|
61
|
+
//# sourceMappingURL=useDocinfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDocinfo.d.ts","sourceRoot":"","sources":["../../src/shared/useDocinfo.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,OAAO;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAChB,MAAM,EACN;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAC/E,CAAC;IACF,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAChD,kBAAkB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1C,WAAW,CAAC,EAAE,KAAK,CACjB;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAA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EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAcD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,OAAO,CAAC,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,MAAM,GACZ;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CAgF5E;AAED,qEAAqE;AACrE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAE9D"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/** A single DocField row from a DocType meta (loose — server is source of truth). */
|
|
2
|
+
export interface DocFieldMeta {
|
|
3
|
+
fieldname: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
fieldtype: string;
|
|
6
|
+
options?: string;
|
|
7
|
+
reqd?: 0 | 1;
|
|
8
|
+
hidden?: 0 | 1;
|
|
9
|
+
read_only?: 0 | 1;
|
|
10
|
+
bold?: 0 | 1;
|
|
11
|
+
in_list_view?: 0 | 1;
|
|
12
|
+
in_standard_filter?: 0 | 1;
|
|
13
|
+
in_global_search?: 0 | 1;
|
|
14
|
+
allow_in_quick_entry?: 0 | 1;
|
|
15
|
+
allow_on_submit?: 0 | 1;
|
|
16
|
+
no_copy?: 0 | 1;
|
|
17
|
+
collapsible?: 0 | 1;
|
|
18
|
+
collapsible_depends_on?: string;
|
|
19
|
+
depends_on?: string;
|
|
20
|
+
mandatory_depends_on?: string;
|
|
21
|
+
read_only_depends_on?: string;
|
|
22
|
+
fetch_from?: string;
|
|
23
|
+
permlevel?: number;
|
|
24
|
+
length?: number;
|
|
25
|
+
default?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
precision?: string | number;
|
|
28
|
+
idx?: number;
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
}
|
|
31
|
+
/** DocType Link child row (Connections tab). Probed: `group` arrives null when unset. */
|
|
32
|
+
export interface DocLinkMeta {
|
|
33
|
+
name?: string;
|
|
34
|
+
link_doctype: string;
|
|
35
|
+
link_fieldname: string;
|
|
36
|
+
group?: string | null;
|
|
37
|
+
hidden?: 0 | 1;
|
|
38
|
+
is_child_table?: 0 | 1;
|
|
39
|
+
parent_doctype?: string;
|
|
40
|
+
table_fieldname?: string;
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
}
|
|
43
|
+
/** Role permission row from the DocType meta. */
|
|
44
|
+
export interface DocPermissionRule {
|
|
45
|
+
role?: string;
|
|
46
|
+
permlevel?: number;
|
|
47
|
+
read?: 0 | 1;
|
|
48
|
+
write?: 0 | 1;
|
|
49
|
+
create?: 0 | 1;
|
|
50
|
+
delete?: 0 | 1;
|
|
51
|
+
submit?: 0 | 1;
|
|
52
|
+
cancel?: 0 | 1;
|
|
53
|
+
amend?: 0 | 1;
|
|
54
|
+
print?: 0 | 1;
|
|
55
|
+
email?: 0 | 1;
|
|
56
|
+
share?: 0 | 1;
|
|
57
|
+
if_owner?: 0 | 1;
|
|
58
|
+
[key: string]: unknown;
|
|
59
|
+
}
|
|
60
|
+
/** DocType meta as returned by frappe.desk.form.load.getdoctype (loose). */
|
|
61
|
+
export interface DoctypeMeta {
|
|
62
|
+
doctype?: string;
|
|
63
|
+
name: string;
|
|
64
|
+
module?: string;
|
|
65
|
+
issingle?: 0 | 1;
|
|
66
|
+
istable?: 0 | 1;
|
|
67
|
+
is_submittable?: 0 | 1;
|
|
68
|
+
is_tree?: 0 | 1;
|
|
69
|
+
is_virtual?: 0 | 1;
|
|
70
|
+
editable_grid?: 0 | 1;
|
|
71
|
+
track_changes?: 0 | 1;
|
|
72
|
+
quick_entry?: 0 | 1;
|
|
73
|
+
autoname?: string;
|
|
74
|
+
naming_rule?: string;
|
|
75
|
+
allow_rename?: 0 | 1;
|
|
76
|
+
allow_copy?: 0 | 1;
|
|
77
|
+
read_only?: 0 | 1;
|
|
78
|
+
in_create?: 0 | 1;
|
|
79
|
+
hide_toolbar?: 0 | 1;
|
|
80
|
+
max_attachments?: number;
|
|
81
|
+
title_field?: string;
|
|
82
|
+
image_field?: string;
|
|
83
|
+
search_fields?: string;
|
|
84
|
+
sort_field?: string;
|
|
85
|
+
sort_order?: string;
|
|
86
|
+
icon?: string;
|
|
87
|
+
document_type?: string;
|
|
88
|
+
fields: DocFieldMeta[];
|
|
89
|
+
permissions?: DocPermissionRule[];
|
|
90
|
+
links?: DocLinkMeta[];
|
|
91
|
+
states?: Array<{
|
|
92
|
+
title?: string;
|
|
93
|
+
color?: string;
|
|
94
|
+
} & Record<string, unknown>>;
|
|
95
|
+
[key: string]: unknown;
|
|
96
|
+
}
|
|
97
|
+
export interface DoctypeMetaBundle {
|
|
98
|
+
/** Parent doctype meta (docs[0]) */
|
|
99
|
+
meta: DoctypeMeta;
|
|
100
|
+
/** Child table doctype metas keyed by doctype name (docs[1..]) */
|
|
101
|
+
childMetas: Record<string, DoctypeMeta>;
|
|
102
|
+
/** Parsed user_settings (list view settings etc.), when present */
|
|
103
|
+
userSettings?: Record<string, unknown>;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Load (and cache, module-wide) the meta bundle for a doctype via
|
|
107
|
+
* `frappe.desk.form.load.getdoctype` — or, when the ambient FrappeProvider
|
|
108
|
+
* carries a fixture provider, from its "DocType" collection. All backoffice
|
|
109
|
+
* surfaces share this cache, so meta is fetched once per doctype per session.
|
|
110
|
+
*/
|
|
111
|
+
export declare function useDoctypeMeta(doctype?: string): {
|
|
112
|
+
bundle?: DoctypeMetaBundle;
|
|
113
|
+
meta?: DoctypeMeta;
|
|
114
|
+
loading: boolean;
|
|
115
|
+
error?: Error;
|
|
116
|
+
reload: () => void;
|
|
117
|
+
};
|
|
118
|
+
//# sourceMappingURL=useDoctypeMeta.d.ts.map
|