@multiplatform.one/backoffice 6.3.0 → 6.4.1
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/shell/WorkspaceSidebar.cjs +4 -0
- package/dist/cjs/shell/WorkspaceSidebar.native.js +4 -0
- package/dist/cjs/shell/WorkspaceSidebar.native.js.map +1 -1
- 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/shell/WorkspaceSidebar.mjs +4 -0
- package/dist/esm/shell/WorkspaceSidebar.mjs.map +1 -1
- package/dist/esm/shell/WorkspaceSidebar.native.js +4 -0
- package/dist/esm/shell/WorkspaceSidebar.native.js.map +1 -1
- 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/shell/WorkspaceSidebar.mjs +4 -0
- package/dist/jsx/shell/WorkspaceSidebar.mjs.map +1 -1
- package/dist/jsx/shell/WorkspaceSidebar.native.js +4 -0
- package/dist/jsx/shell/WorkspaceSidebar.native.js.map +1 -1
- 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/shell/WorkspaceSidebar.tsx +3 -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/shell/WorkspaceSidebar.d.ts.map +1 -1
- 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,185 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: true
|
|
22
|
+
}), mod);
|
|
23
|
+
var WorkspaceShortcut_exports = {};
|
|
24
|
+
__export(WorkspaceShortcut_exports, {
|
|
25
|
+
WorkspaceShortcut: () => WorkspaceShortcut,
|
|
26
|
+
resolveShortcutTarget: () => resolveShortcutTarget
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(WorkspaceShortcut_exports);
|
|
29
|
+
var import_react = require("@phosphor-icons/react");
|
|
30
|
+
var import_components = require("@multiplatform.one/components");
|
|
31
|
+
var import_frappe_ui = require("@multiplatform.one/frappe-ui");
|
|
32
|
+
var import_platform = require("@multiplatform.one/platform");
|
|
33
|
+
var import_theme = require("@multiplatform.one/theme");
|
|
34
|
+
var import_react2 = require("react");
|
|
35
|
+
var import_react_i18next = require("react-i18next");
|
|
36
|
+
var import_BackofficeProvider = require("../config/BackofficeProvider.cjs");
|
|
37
|
+
var import_i18n = require("../i18n/index.cjs");
|
|
38
|
+
var import_paths = require("../navigation/paths.cjs");
|
|
39
|
+
var import_parseContent = require("./parseContent.cjs");
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
const defaultPaths = (0, import_paths.createBackofficePaths)();
|
|
42
|
+
function resolveShortcutTarget(row, paths = defaultPaths) {
|
|
43
|
+
const target = row.link_to || row.url || "";
|
|
44
|
+
const prefix = paths.base === "/" ? "" : paths.base;
|
|
45
|
+
switch (row.type) {
|
|
46
|
+
case "DocType":
|
|
47
|
+
return {
|
|
48
|
+
path: paths.list(target)
|
|
49
|
+
};
|
|
50
|
+
case "Report":
|
|
51
|
+
return {
|
|
52
|
+
path: paths.list(target)
|
|
53
|
+
};
|
|
54
|
+
case "Page":
|
|
55
|
+
return {
|
|
56
|
+
path: `${prefix}/${target}`
|
|
57
|
+
};
|
|
58
|
+
case "URL":
|
|
59
|
+
return {
|
|
60
|
+
externalUrl: row.url || row.link_to
|
|
61
|
+
};
|
|
62
|
+
default:
|
|
63
|
+
return {
|
|
64
|
+
disabled: true
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const TYPE_ICONS = {
|
|
69
|
+
DocType: import_react.ListBulletsIcon,
|
|
70
|
+
Report: import_react.ChartBarIcon,
|
|
71
|
+
Page: import_react.BrowserIcon,
|
|
72
|
+
Dashboard: import_react.GaugeIcon,
|
|
73
|
+
URL: import_react.ArrowSquareOutIcon
|
|
74
|
+
};
|
|
75
|
+
function WorkspaceShortcut({
|
|
76
|
+
row,
|
|
77
|
+
onPress
|
|
78
|
+
}) {
|
|
79
|
+
const navigator = (0, import_BackofficeProvider.useBackofficeNavigator)();
|
|
80
|
+
const paths = (0, import_BackofficeProvider.useBackofficePaths)();
|
|
81
|
+
const config = (0, import_frappe_ui.useFrappeConfig)();
|
|
82
|
+
const {
|
|
83
|
+
knobProps
|
|
84
|
+
} = (0, import_theme.useResolvedKnobs)();
|
|
85
|
+
const {
|
|
86
|
+
t
|
|
87
|
+
} = (0, import_react_i18next.useTranslation)(import_i18n.BACKOFFICE_I18N_NAMESPACE);
|
|
88
|
+
const theme = (0, import_components.useTheme)();
|
|
89
|
+
const {
|
|
90
|
+
views
|
|
91
|
+
} = (0, import_BackofficeProvider.useBackofficeCapabilities)();
|
|
92
|
+
const isDoctypeAllowed = (0, import_BackofficeProvider.useIsDoctypeAllowed)();
|
|
93
|
+
const iconColor = typeof theme.color11?.val === "string" ? theme.color11.val : void 0;
|
|
94
|
+
const isDoctype = row.type === "DocType" && !!row.link_to;
|
|
95
|
+
const filters = (0, import_react2.useMemo)(() => (0, import_parseContent.parseFrappeFilters)(row.stats_filter), [row.stats_filter]);
|
|
96
|
+
const connection = (0, import_react2.useMemo)(() => config?.baseURL || config?.fixtures ? {
|
|
97
|
+
baseURL: config.baseURL,
|
|
98
|
+
socketPort: config.socketPort,
|
|
99
|
+
auth: config.auth,
|
|
100
|
+
syncOptions: config.syncOptions,
|
|
101
|
+
fixtures: config.fixtures
|
|
102
|
+
} : void 0, [config]);
|
|
103
|
+
const hiddenByScope = isDoctype && row.link_to ? !isDoctypeAllowed(row.link_to) : false;
|
|
104
|
+
const hiddenByViews = (row.type === "DocType" || row.type === "Report") && !views.enabled;
|
|
105
|
+
const {
|
|
106
|
+
value: count,
|
|
107
|
+
isLoading: countLoading,
|
|
108
|
+
error: countError
|
|
109
|
+
} = (0, import_frappe_ui.useFrappeAggregate)(connection, {
|
|
110
|
+
doctype: row.link_to ?? "",
|
|
111
|
+
filters,
|
|
112
|
+
enabled: isDoctype && !!connection && !hiddenByScope && !hiddenByViews
|
|
113
|
+
});
|
|
114
|
+
if (hiddenByScope || hiddenByViews) return null;
|
|
115
|
+
const target = resolveShortcutTarget(row, paths);
|
|
116
|
+
const handlePress = () => {
|
|
117
|
+
if (onPress) {
|
|
118
|
+
onPress(row);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (target.path) {
|
|
122
|
+
navigator.navigate(target.path);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (target.externalUrl) {
|
|
126
|
+
(0, import_platform.openUrl)(target.externalUrl);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
const countLabel = count === void 0 ? void 0 : row.format ? row.format.replace("{}", String(count)) : String(count);
|
|
130
|
+
const TypeIcon = TYPE_ICONS[row.type] ?? import_react.SquaresFourIcon;
|
|
131
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.Card, {
|
|
132
|
+
padding: 0,
|
|
133
|
+
onPress: target.disabled && !onPress ? void 0 : handlePress,
|
|
134
|
+
disabled: target.disabled && !onPress,
|
|
135
|
+
opacity: target.disabled && !onPress ? 0.5 : 1,
|
|
136
|
+
cursor: target.disabled && !onPress ? "default" : "pointer",
|
|
137
|
+
hoverStyle: target.disabled && !onPress ? void 0 : {
|
|
138
|
+
borderColor: "$accentBackground"
|
|
139
|
+
},
|
|
140
|
+
pressStyle: target.disabled && !onPress ? void 0 : {
|
|
141
|
+
scale: 0.98
|
|
142
|
+
},
|
|
143
|
+
role: "button",
|
|
144
|
+
"aria-label": row.label,
|
|
145
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_components.XStack, {
|
|
146
|
+
paddingHorizontal: "$3",
|
|
147
|
+
minHeight: 44,
|
|
148
|
+
alignItems: "center",
|
|
149
|
+
...knobProps.gap,
|
|
150
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(TypeIcon, {
|
|
151
|
+
size: 16,
|
|
152
|
+
color: iconColor,
|
|
153
|
+
"aria-hidden": true
|
|
154
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.SizableText, {
|
|
155
|
+
size: "$3",
|
|
156
|
+
fontWeight: "600",
|
|
157
|
+
numberOfLines: 1,
|
|
158
|
+
flexShrink: 1,
|
|
159
|
+
children: row.label
|
|
160
|
+
}), isDoctype ? countLoading ?
|
|
161
|
+
// Pill-shaped like the real count pill (LC-20 radius class).
|
|
162
|
+
/* @__PURE__ */
|
|
163
|
+
(0, import_jsx_runtime.jsx)(import_components.Skeleton, {
|
|
164
|
+
width: 28,
|
|
165
|
+
height: 16,
|
|
166
|
+
borderRadius: 1e3
|
|
167
|
+
}) : countError ? null : countLabel !== void 0 ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.YStack, {
|
|
168
|
+
backgroundColor: "$color4",
|
|
169
|
+
borderRadius: 1e3,
|
|
170
|
+
paddingHorizontal: "$2.5",
|
|
171
|
+
paddingVertical: "$1",
|
|
172
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.SizableText, {
|
|
173
|
+
size: "$1",
|
|
174
|
+
color: "$color11",
|
|
175
|
+
fontWeight: "600",
|
|
176
|
+
children: countLabel
|
|
177
|
+
})
|
|
178
|
+
}) : null : target.disabled && !onPress ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.SizableText, {
|
|
179
|
+
size: "$1",
|
|
180
|
+
color: "$color10",
|
|
181
|
+
children: t("workspaceShortcutUnavailable", "Not available")
|
|
182
|
+
}) : null]
|
|
183
|
+
})
|
|
184
|
+
});
|
|
185
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var WorkspaceShortcut_exports = {};
|
|
26
|
+
__export(WorkspaceShortcut_exports, {
|
|
27
|
+
WorkspaceShortcut: () => WorkspaceShortcut,
|
|
28
|
+
resolveShortcutTarget: () => resolveShortcutTarget
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(WorkspaceShortcut_exports);
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
+
var import_react = require("@phosphor-icons/react");
|
|
33
|
+
var import_components = require("@multiplatform.one/components");
|
|
34
|
+
var import_frappe_ui = require("@multiplatform.one/frappe-ui");
|
|
35
|
+
var import_platform = require("@multiplatform.one/platform");
|
|
36
|
+
var import_theme = require("@multiplatform.one/theme");
|
|
37
|
+
var import_react2 = require("react");
|
|
38
|
+
var import_react_i18next = require("react-i18next");
|
|
39
|
+
var import_BackofficeProvider = require("../config/BackofficeProvider.native.js");
|
|
40
|
+
var import_i18n = require("../i18n/index.native.js");
|
|
41
|
+
var import_paths = require("../navigation/paths.native.js");
|
|
42
|
+
var import_parseContent = require("./parseContent.native.js");
|
|
43
|
+
var defaultPaths = (0, import_paths.createBackofficePaths)();
|
|
44
|
+
function resolveShortcutTarget(row) {
|
|
45
|
+
var paths = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultPaths;
|
|
46
|
+
var target = row.link_to || row.url || "";
|
|
47
|
+
var prefix = paths.base === "/" ? "" : paths.base;
|
|
48
|
+
switch (row.type) {
|
|
49
|
+
case "DocType":
|
|
50
|
+
return {
|
|
51
|
+
path: paths.list(target)
|
|
52
|
+
};
|
|
53
|
+
case "Report":
|
|
54
|
+
return {
|
|
55
|
+
path: paths.list(target)
|
|
56
|
+
};
|
|
57
|
+
case "Page":
|
|
58
|
+
return {
|
|
59
|
+
path: `${prefix}/${target}`
|
|
60
|
+
};
|
|
61
|
+
case "URL":
|
|
62
|
+
return {
|
|
63
|
+
externalUrl: row.url || row.link_to
|
|
64
|
+
};
|
|
65
|
+
default:
|
|
66
|
+
return {
|
|
67
|
+
disabled: true
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
var TYPE_ICONS = {
|
|
72
|
+
DocType: import_react.ListBulletsIcon,
|
|
73
|
+
Report: import_react.ChartBarIcon,
|
|
74
|
+
Page: import_react.BrowserIcon,
|
|
75
|
+
Dashboard: import_react.GaugeIcon,
|
|
76
|
+
URL: import_react.ArrowSquareOutIcon
|
|
77
|
+
};
|
|
78
|
+
function WorkspaceShortcut(param) {
|
|
79
|
+
var {
|
|
80
|
+
row,
|
|
81
|
+
onPress
|
|
82
|
+
} = param;
|
|
83
|
+
var _row_link_to, _TYPE_ICONS_row_type;
|
|
84
|
+
var _theme_color11;
|
|
85
|
+
var navigator = (0, import_BackofficeProvider.useBackofficeNavigator)();
|
|
86
|
+
var paths = (0, import_BackofficeProvider.useBackofficePaths)();
|
|
87
|
+
var config = (0, import_frappe_ui.useFrappeConfig)();
|
|
88
|
+
var {
|
|
89
|
+
knobProps
|
|
90
|
+
} = (0, import_theme.useResolvedKnobs)();
|
|
91
|
+
var {
|
|
92
|
+
t
|
|
93
|
+
} = (0, import_react_i18next.useTranslation)(import_i18n.BACKOFFICE_I18N_NAMESPACE);
|
|
94
|
+
var theme = (0, import_components.useTheme)();
|
|
95
|
+
var {
|
|
96
|
+
views
|
|
97
|
+
} = (0, import_BackofficeProvider.useBackofficeCapabilities)();
|
|
98
|
+
var isDoctypeAllowed = (0, import_BackofficeProvider.useIsDoctypeAllowed)();
|
|
99
|
+
var iconColor = typeof ((_theme_color11 = theme.color11) === null || _theme_color11 === void 0 ? void 0 : _theme_color11.val) === "string" ? theme.color11.val : void 0;
|
|
100
|
+
var isDoctype = row.type === "DocType" && !!row.link_to;
|
|
101
|
+
var filters = (0, import_react2.useMemo)(function () {
|
|
102
|
+
return (0, import_parseContent.parseFrappeFilters)(row.stats_filter);
|
|
103
|
+
}, [row.stats_filter]);
|
|
104
|
+
var connection = (0, import_react2.useMemo)(function () {
|
|
105
|
+
return (config === null || config === void 0 ? void 0 : config.baseURL) || (config === null || config === void 0 ? void 0 : config.fixtures) ? {
|
|
106
|
+
baseURL: config.baseURL,
|
|
107
|
+
socketPort: config.socketPort,
|
|
108
|
+
auth: config.auth,
|
|
109
|
+
syncOptions: config.syncOptions,
|
|
110
|
+
fixtures: config.fixtures
|
|
111
|
+
} : void 0;
|
|
112
|
+
}, [config]);
|
|
113
|
+
var hiddenByScope = isDoctype && row.link_to ? !isDoctypeAllowed(row.link_to) : false;
|
|
114
|
+
var hiddenByViews = (row.type === "DocType" || row.type === "Report") && !views.enabled;
|
|
115
|
+
var {
|
|
116
|
+
value: count,
|
|
117
|
+
isLoading: countLoading,
|
|
118
|
+
error: countError
|
|
119
|
+
} = (0, import_frappe_ui.useFrappeAggregate)(connection, {
|
|
120
|
+
doctype: (_row_link_to = row.link_to) !== null && _row_link_to !== void 0 ? _row_link_to : "",
|
|
121
|
+
filters,
|
|
122
|
+
enabled: isDoctype && !!connection && !hiddenByScope && !hiddenByViews
|
|
123
|
+
});
|
|
124
|
+
if (hiddenByScope || hiddenByViews) return null;
|
|
125
|
+
var target = resolveShortcutTarget(row, paths);
|
|
126
|
+
var handlePress = function handlePress2() {
|
|
127
|
+
if (onPress) {
|
|
128
|
+
onPress(row);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (target.path) {
|
|
132
|
+
navigator.navigate(target.path);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (target.externalUrl) {
|
|
136
|
+
(0, import_platform.openUrl)(target.externalUrl);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
var countLabel = count === void 0 ? void 0 : row.format ? row.format.replace("{}", String(count)) : String(count);
|
|
140
|
+
var TypeIcon = (_TYPE_ICONS_row_type = TYPE_ICONS[row.type]) !== null && _TYPE_ICONS_row_type !== void 0 ? _TYPE_ICONS_row_type : import_react.SquaresFourIcon;
|
|
141
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.Card, {
|
|
142
|
+
// Chip-scale surface: eject the Card's default panelPadding — the
|
|
143
|
+
// inner row owns the compact inset (LC-18 eject-last contract).
|
|
144
|
+
padding: 0,
|
|
145
|
+
onPress: target.disabled && !onPress ? void 0 : handlePress,
|
|
146
|
+
disabled: target.disabled && !onPress,
|
|
147
|
+
opacity: target.disabled && !onPress ? 0.5 : 1,
|
|
148
|
+
cursor: target.disabled && !onPress ? "default" : "pointer",
|
|
149
|
+
hoverStyle: target.disabled && !onPress ? void 0 : {
|
|
150
|
+
borderColor: "$accentBackground"
|
|
151
|
+
},
|
|
152
|
+
pressStyle: target.disabled && !onPress ? void 0 : {
|
|
153
|
+
scale: 0.98
|
|
154
|
+
},
|
|
155
|
+
role: "button",
|
|
156
|
+
"aria-label": row.label,
|
|
157
|
+
children: (
|
|
158
|
+
/* Compact chip anatomy: icon + label + count, ≥44px press target
|
|
159
|
+
(DG-LAY-04), self-sized so the band wraps instead of stretching. */
|
|
160
|
+
/* @__PURE__ */
|
|
161
|
+
(0, import_jsx_runtime.jsxs)(import_components.XStack, {
|
|
162
|
+
paddingHorizontal: "$3",
|
|
163
|
+
minHeight: 44,
|
|
164
|
+
alignItems: "center",
|
|
165
|
+
...knobProps.gap,
|
|
166
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(TypeIcon, {
|
|
167
|
+
size: 16,
|
|
168
|
+
color: iconColor,
|
|
169
|
+
"aria-hidden": true
|
|
170
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.SizableText, {
|
|
171
|
+
size: "$3",
|
|
172
|
+
fontWeight: "600",
|
|
173
|
+
numberOfLines: 1,
|
|
174
|
+
flexShrink: 1,
|
|
175
|
+
children: row.label
|
|
176
|
+
}), isDoctype ? countLoading ?
|
|
177
|
+
// Pill-shaped like the real count pill (LC-20 radius class).
|
|
178
|
+
/* @__PURE__ */
|
|
179
|
+
(0, import_jsx_runtime.jsx)(import_components.Skeleton, {
|
|
180
|
+
width: 28,
|
|
181
|
+
height: 16,
|
|
182
|
+
borderRadius: 1e3
|
|
183
|
+
}) : countError ? null : countLabel !== void 0 ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.YStack, {
|
|
184
|
+
backgroundColor: "$color4",
|
|
185
|
+
borderRadius: 1e3,
|
|
186
|
+
paddingHorizontal: "$2.5",
|
|
187
|
+
paddingVertical: "$1",
|
|
188
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.SizableText, {
|
|
189
|
+
size: "$1",
|
|
190
|
+
color: "$color11",
|
|
191
|
+
fontWeight: "600",
|
|
192
|
+
children: countLabel
|
|
193
|
+
})
|
|
194
|
+
}) : null : target.disabled && !onPress ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.SizableText, {
|
|
195
|
+
size: "$1",
|
|
196
|
+
color: "$color10",
|
|
197
|
+
children: t("workspaceShortcutUnavailable", "Not available")
|
|
198
|
+
}) : null]
|
|
199
|
+
}))
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=WorkspaceShortcut.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","WorkspaceShortcut_exports","__export","WorkspaceShortcut","resolveShortcutTarget","module","exports","import_jsx_runtime","require","import_react","import_components","import_frappe_ui","import_platform","import_theme","import_react2","import_react_i18next","import_BackofficeProvider","import_i18n","import_paths","import_parseContent","defaultPaths","createBackofficePaths","row","paths","arguments","length","target","link_to","url","prefix","base","type","path","list","externalUrl","disabled","TYPE_ICONS","DocType","ListBulletsIcon","Report","ChartBarIcon","Page","BrowserIcon","Dashboard","GaugeIcon","URL","ArrowSquareOutIcon","param","onPress","_row_link_to","_TYPE_ICONS_row_type","_theme_color11","navigator","useBackofficeNavigator","useBackofficePaths","config","useFrappeConfig","knobProps","useResolvedKnobs","t","useTranslation","BACKOFFICE_I18N_NAMESPACE","theme","useTheme","views","useBackofficeCapabilities","isDoctypeAllowed","useIsDoctypeAllowed","iconColor","color11","val","isDoctype","filters","useMemo","parseFrappeFilters","stats_filter","connection","baseURL","fixtures","socketPort","auth","syncOptions","hiddenByScope","hiddenByViews","enabled","count","isLoading","countLoading","error","countError","useFrappeAggregate","doctype","handlePress","handlePress2","navigate","openUrl","countLabel","format","replace","String","TypeIcon","SquaresFourIcon","jsx","Card","padding","opacity","cursor","hoverStyle","borderColor","pressStyle","scale","role","label"],"sources":["../../../src/workspace/WorkspaceShortcut.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,yBAAA;AAAAC,QAAA,CAAAD,yBAAA;EAAAE,iBAAA,EAAAA,CAAA,KAAAA,iBAAA;EAAAC,qBAAA,EAAAA,CAAA,KAAAA;AAAA;AAgBAC,MAAA,CAAAC,OAAA,GAAAV,YAQO,CAAAK,yBAAA;AACP,IAAAM,kBAAA,GAOOC,OAAA;AACP,IAAAC,YAAA,GAAAD,OAAoD;AACpD,IAAAE,iBAAA,GAAwBF,OAAA;AACxB,IAAAG,gBAAiC,GAAAH,OAAA;AACjC,IAAAI,eAAA,GAAwBJ,OAAA;AACxB,IAAAK,YAAA,GAAAL,OAAA,CAA+B;AAC/B,IAAAM,aAAA,GAAA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A,CAAAS,IAAA,eAAAmB,oBAAA,cAAAA,oBAAA,GAAAzC,YAAA,CAAA4F,eAAA;EAAA,0BAAA9F,kBAAA,CAAA+F,GAAA,EAAA5F,iBAAA,CAAA6F,IAAA;IAAA;IAEuD;IAErDC,OAAC;IAAAxD,OAAA,EAAAtB,MAAA,CAAAS,QAAA,KAAAa,OAAA,YAAA4C,WAAA;IAAAzD,QACC,EAAAT,MAAA,CAAAS,QAAgB,KAAAa,OAAA;IAAAyD,OAAA,EAChB/E,MAAA,CAAAS,QAAc,KAAAa,OAAA;IAAA0D,MAAA,EACdhF,MAAA,CAAAS,QAAA,IAAkB,CAAAa,OAAA;IAAA2D,UAClB,EAAAjF,MAAA,CAAAS,QAAgB,KAAAa,OAAA;MAAA4D,WAEhB;IAEA;IAAAC,UAEA,EAAAnF,MACF,CAAAS,QAAO,KAAAa,OAAa,QACtB;MAGE8D,KACN;IAAA;IACFC,IAAA;IAEJ,cAAAzF,GAAA,CAAA0F,KAAA","ignoreList":[]}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: true
|
|
22
|
+
}), mod);
|
|
23
|
+
var parseContent_exports = {};
|
|
24
|
+
__export(parseContent_exports, {
|
|
25
|
+
composeWorkspaceBlocks: () => composeWorkspaceBlocks,
|
|
26
|
+
findLinkGroup: () => findLinkGroup,
|
|
27
|
+
findShortcut: () => findShortcut,
|
|
28
|
+
groupLinks: () => groupLinks,
|
|
29
|
+
headerLevel: () => headerLevel,
|
|
30
|
+
parseFrappeFilters: () => parseFrappeFilters,
|
|
31
|
+
parseWorkspaceContent: () => parseWorkspaceContent,
|
|
32
|
+
stripHtml: () => stripHtml
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(parseContent_exports);
|
|
35
|
+
function parseWorkspaceContent(content) {
|
|
36
|
+
if (!content) return [];
|
|
37
|
+
try {
|
|
38
|
+
const parsed = JSON.parse(content);
|
|
39
|
+
if (!Array.isArray(parsed)) return [];
|
|
40
|
+
return parsed.filter(block => !!block && typeof block === "object" && typeof block.type === "string");
|
|
41
|
+
} catch {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const NAMED_ENTITIES = {
|
|
46
|
+
amp: "&",
|
|
47
|
+
lt: "<",
|
|
48
|
+
gt: ">",
|
|
49
|
+
quot: '"',
|
|
50
|
+
apos: "'",
|
|
51
|
+
nbsp: " "
|
|
52
|
+
};
|
|
53
|
+
function stripHtml(html) {
|
|
54
|
+
if (!html) return "";
|
|
55
|
+
const withoutTags = html.replace(/<br\s*\/?>/gi, "\n").replace(/<[^>]*>/g, "");
|
|
56
|
+
return withoutTags.replace(/&(#[xX]?[0-9a-fA-F]+|[a-zA-Z]+);/g, (match, entity) => {
|
|
57
|
+
if (entity.startsWith("#x") || entity.startsWith("#X")) {
|
|
58
|
+
const code = Number.parseInt(entity.slice(2), 16);
|
|
59
|
+
return Number.isNaN(code) ? match : String.fromCodePoint(code);
|
|
60
|
+
}
|
|
61
|
+
if (entity.startsWith("#")) {
|
|
62
|
+
const code = Number.parseInt(entity.slice(1), 10);
|
|
63
|
+
return Number.isNaN(code) ? match : String.fromCodePoint(code);
|
|
64
|
+
}
|
|
65
|
+
return NAMED_ENTITIES[entity.toLowerCase()] ?? match;
|
|
66
|
+
}).trim();
|
|
67
|
+
}
|
|
68
|
+
function headerLevel(html) {
|
|
69
|
+
const match = (html ?? "").match(/class="[^"]*\bh([1-6])\b[^"]*"/);
|
|
70
|
+
if (match) return Number(match[1]);
|
|
71
|
+
return 4;
|
|
72
|
+
}
|
|
73
|
+
function groupLinks(links) {
|
|
74
|
+
const groups = [];
|
|
75
|
+
let current;
|
|
76
|
+
for (const row of links ?? []) {
|
|
77
|
+
if (row.type === "Card Break") {
|
|
78
|
+
if (row.hidden) {
|
|
79
|
+
current = void 0;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
current = {
|
|
83
|
+
label: row.label,
|
|
84
|
+
breakRow: row,
|
|
85
|
+
links: []
|
|
86
|
+
};
|
|
87
|
+
groups.push(current);
|
|
88
|
+
} else if (row.type === "Link" && current && !row.hidden) {
|
|
89
|
+
current.links.push(row);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return groups;
|
|
93
|
+
}
|
|
94
|
+
function parseFrappeFilters(raw) {
|
|
95
|
+
if (!raw) return void 0;
|
|
96
|
+
let parsed;
|
|
97
|
+
try {
|
|
98
|
+
parsed = JSON.parse(raw);
|
|
99
|
+
} catch {
|
|
100
|
+
return void 0;
|
|
101
|
+
}
|
|
102
|
+
if (Array.isArray(parsed)) {
|
|
103
|
+
const tuples = [];
|
|
104
|
+
for (const entry of parsed) {
|
|
105
|
+
if (!Array.isArray(entry)) continue;
|
|
106
|
+
if (entry.length >= 4) {
|
|
107
|
+
tuples.push([String(entry[1]), String(entry[2]), entry[3]]);
|
|
108
|
+
} else if (entry.length === 3) {
|
|
109
|
+
tuples.push([String(entry[0]), String(entry[1]), entry[2]]);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return tuples.length > 0 ? tuples : void 0;
|
|
113
|
+
}
|
|
114
|
+
if (parsed && typeof parsed === "object") {
|
|
115
|
+
const tuples = [];
|
|
116
|
+
for (const [field, value] of Object.entries(parsed)) {
|
|
117
|
+
if (Array.isArray(value) && value.length === 2 && typeof value[0] === "string") {
|
|
118
|
+
tuples.push([field, value[0], value[1]]);
|
|
119
|
+
} else {
|
|
120
|
+
tuples.push([field, "=", value]);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return tuples.length > 0 ? tuples : void 0;
|
|
124
|
+
}
|
|
125
|
+
return void 0;
|
|
126
|
+
}
|
|
127
|
+
const DATA_BLOCK_RANK = {
|
|
128
|
+
number_card: 0,
|
|
129
|
+
chart: 1,
|
|
130
|
+
quick_list: 2
|
|
131
|
+
};
|
|
132
|
+
function isDataBlock(block) {
|
|
133
|
+
return block.type in DATA_BLOCK_RANK;
|
|
134
|
+
}
|
|
135
|
+
function composeWorkspaceBlocks(blocks) {
|
|
136
|
+
const shortcuts = [];
|
|
137
|
+
const cards = [];
|
|
138
|
+
const text = [];
|
|
139
|
+
const dataBlocks = [];
|
|
140
|
+
for (const [index, block] of blocks.entries()) {
|
|
141
|
+
if (isDataBlock(block)) {
|
|
142
|
+
dataBlocks.push(block);
|
|
143
|
+
} else if (block.type === "shortcut") {
|
|
144
|
+
shortcuts.push(block);
|
|
145
|
+
} else if (block.type === "card") {
|
|
146
|
+
cards.push(block);
|
|
147
|
+
} else if (block.type === "paragraph") {
|
|
148
|
+
text.push(block);
|
|
149
|
+
} else if (block.type === "header") {
|
|
150
|
+
let labelsWidgets = false;
|
|
151
|
+
for (const following of blocks.slice(index + 1)) {
|
|
152
|
+
if (following.type === "header") break;
|
|
153
|
+
if (following.type === "paragraph" || following.type === "spacer") continue;
|
|
154
|
+
labelsWidgets = true;
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
if (!labelsWidgets) text.push(block);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const data = dataBlocks.map((block, index) => ({
|
|
161
|
+
block,
|
|
162
|
+
index
|
|
163
|
+
})).sort((a, b) => (DATA_BLOCK_RANK[a.block.type] ?? 0) - (DATA_BLOCK_RANK[b.block.type] ?? 0) || a.index - b.index).map(({
|
|
164
|
+
block
|
|
165
|
+
}) => block);
|
|
166
|
+
return {
|
|
167
|
+
data,
|
|
168
|
+
shortcuts,
|
|
169
|
+
cards,
|
|
170
|
+
text
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
function findShortcut(doc, shortcutName) {
|
|
174
|
+
if (!shortcutName) return void 0;
|
|
175
|
+
return doc.shortcuts?.find(row => row.label === shortcutName);
|
|
176
|
+
}
|
|
177
|
+
function findLinkGroup(groups, cardName) {
|
|
178
|
+
if (!cardName) return void 0;
|
|
179
|
+
return groups.find(group => group.label === cardName);
|
|
180
|
+
}
|