@eintrek/erp-shell 0.1.74 → 0.1.76

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/index.d.ts CHANGED
@@ -33,9 +33,11 @@ export { HelpDialogHost, type HelpDialogHostProps } from "./help/help-dialog";
33
33
  export { openHelp, closeHelp, type HelpAppId } from "./help/help-store";
34
34
  export { describeBrowser, describeAttached, detectHelpApp, type HelpContext, } from "./help/help-context";
35
35
  export { SHELL_VERSION } from "./version";
36
- export type { GuideAbortAction, GuideAnchorKey, GuideApiFailure, GuideApiMatch, GuideAppId, GuideCaptureEvent, GuideConfig, GuideContext, GuideFacts, GuideGate, GuideMission, GuideNothingToSave, GuideOnMissing, GuidePage, GuideStep, GuideStepKind, GuideSuite, GuideText, GuideTrigger, } from "./guide/types";
36
+ export type { GuideAbortAction, GuideAnchorKey, GuideApiFailure, GuideApiMatch, GuideAppId, GuideCaptureEvent, GuideConfig, GuideContext, GuideFacts, GuideFlow, GuideGate, GuideMission, GuideNothingToSave, GuideOnMissing, GuidePage, GuideSection, GuideStep, GuideStepKind, GuideSuite, GuideText, GuideTrigger, } from "./guide/types";
37
37
  export { API_EVENT as GUIDE_API_EVENT, GUIDE_EVENT_PREFIX, GUIDE_LAYER_ATTRIBUTE, emitGuideEvent, guideAnchor, reportApiCall, reportApiEvent, type ApiCallReport, type ApiEventDetail, type GuideAnchorProps, } from "./guide/events";
38
- export { guideMenuItems, guideMenuShown, openGuidePanel, openPageGuide, openPagesPanel, useGuideEntry, usePageGuideEntry, usePageGuides, type GuideEntry, type GuideMenuItem, type PageGuidesEntry, } from "./guide/guide-store";
38
+ export { guideMenuItems, guideMenuShown, openGuidePanel, openPageGuide, openPagesPanel, openSectionGuide, openFlow, openFlowsPanel, setSectionGuideValues, useGuideEntry, usePageGuideEntry, usePageGuides, useSectionGuideValues, type GuideEntry, type GuideMenuItem, type PageGuidesEntry, } from "./guide/guide-store";
39
+ export { SectionGuideButton, type SectionGuideButtonProps } from "./guide/section-button";
40
+ export { THAI_MONTHS_SHORT, formatBaht, thaiMonth, thaiMonthYear } from "./guide/format";
39
41
  export { GuideHost, type GuideHostProps } from "./guide/guide-host";
40
42
  export { GuideRuntime, type GuideMenu, type GuideRouting, type GuideRuntimeProps, } from "./guide/guide-runtime";
41
43
  export { GuideProgressConflict, type GuideProgressAdapter, type GuideProgressRequest, type GuideProgressResponse, } from "./guide/progress-sync";
package/dist/index.esm.js CHANGED
@@ -5,7 +5,7 @@ import { useSession, signOut } from 'next-auth/react';
5
5
  import { useQueryClient, useQuery, QueryClientContext, QueryClient, hashKey, MutationCache, QueryCache, QueryClientProvider } from '@tanstack/react-query';
6
6
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
7
7
  import { cn, Button, Tooltip, TooltipTrigger, TooltipContent, Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbSeparator, BreadcrumbPage, Avatar, AvatarImage, AvatarFallback, Collapsible, CollapsibleTrigger, CollapsibleContent, Badge, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuLabel, DropdownMenuItem, DropdownMenuSeparator, Skeleton, Dialog, DialogContent, DialogHeader, DialogTitle, Label, Textarea, DialogFooter, Card, CardHeader, CardContent } from '@eintrek/erp-theme';
8
- import { PanelLeftClose, Menu, ChevronRight, Building2, Palette, ChevronUp, Sun, Moon, Monitor, Globe, UserCog, LayoutGrid, ExternalLink, CircleHelp, Loader2, LogOut, Calculator, Warehouse, FolderKanban, Users, Store, Headset, ChevronDown, Plus, ChevronsUpDown, BookOpen, Flag, Library, MessageCircle, ImagePlus, X, CircleCheck, ArrowLeft, Ban, Home, ContactRound, UserPlus, ArrowRight, Compass, ArrowUpRight } from 'lucide-react';
8
+ import { PanelLeftClose, Menu, ChevronRight, Building2, Palette, ChevronUp, Sun, Moon, Monitor, Globe, UserCog, LayoutGrid, ExternalLink, CircleHelp, Loader2, LogOut, Calculator, Warehouse, FolderKanban, Users, Store, Headset, ChevronDown, Plus, ChevronsUpDown, BookOpen, Info, Route, Flag, Library, MessageCircle, ImagePlus, X, CircleCheck, ArrowLeft, Ban, Home, ContactRound, UserPlus, ArrowRight, Compass, ArrowUpRight } from 'lucide-react';
9
9
  import { create } from 'zustand';
10
10
  import { persist, createJSONStorage } from 'zustand/middleware';
11
11
  import { useRouter, usePathname, useParams, useSearchParams } from 'next/navigation';
@@ -14,8 +14,8 @@ import { createPortal } from 'react-dom';
14
14
  import { useTheme, ThemeProvider as ThemeProvider$1 } from 'next-themes';
15
15
  import axios, { isAxiosError, AxiosHeaders } from 'axios';
16
16
  export { isAxiosError } from 'axios';
17
- import { q as reportApiEvent, h as guideAnchor, u as useGuideEntry, v as usePageGuides, i as guideMenuItems, n as openPageGuide, o as openGuidePanel, p as openPagesPanel, b as GuideErrorBoundary, d as GuideRuntime } from './chunks/guide-runtime-Dl8V1iy9.esm.js';
18
- export { A as GUIDE_API_EVENT, G as GUIDE_EVENT_PREFIX, a as GUIDE_LAYER_ATTRIBUTE, c as GuideProgressConflict, f as emitGuideEvent, j as guideMenuShown, r as reportApiCall, t as usePageGuideEntry } from './chunks/guide-runtime-Dl8V1iy9.esm.js';
17
+ import { v as reportApiEvent, i as guideAnchor, B as useGuideEntry, D as usePageGuides, j as guideMenuItems, r as openPageGuide, t as openSectionGuide, o as openFlow, q as openGuidePanel, s as openPagesPanel, p as openFlowsPanel, b as GuideErrorBoundary, d as GuideRuntime } from './chunks/format-BWUKNKxg.esm.js';
18
+ export { A as GUIDE_API_EVENT, G as GUIDE_EVENT_PREFIX, a as GUIDE_LAYER_ATTRIBUTE, c as GuideProgressConflict, S as SectionGuideButton, T as THAI_MONTHS_SHORT, f as emitGuideEvent, h as formatBaht, k as guideMenuShown, u as reportApiCall, w as setSectionGuideValues, y as thaiMonth, z as thaiMonthYear, C as usePageGuideEntry, E as useSectionGuideValues } from './chunks/format-BWUKNKxg.esm.js';
19
19
  import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
20
20
  import '@floating-ui/dom';
21
21
 
@@ -1722,7 +1722,7 @@ function platformApiBase(app) {
1722
1722
  * This package's version, attached to help messages so the back office can
1723
1723
  * tell which shell a report came from. Keep in step with package.json.
1724
1724
  */
1725
- const SHELL_VERSION = "0.1.74";
1725
+ const SHELL_VERSION = "0.1.76";
1726
1726
 
1727
1727
  const HELP_APP_LABEL = {
1728
1728
  platform: "แพลตฟอร์ม",
@@ -2555,8 +2555,11 @@ const BUTTON_CLASS = "grid size-[34px] shrink-0 place-items-center rounded-lg te
2555
2555
  * --header-* variables of the workspace chrome, white on the brand chrome).
2556
2556
  *
2557
2557
  * When this user has something to open here, it opens a small menu:
2558
- * "คู่มือหน้านี้" (this page's guide), "ไกด์เริ่มต้น n/N" (the quest
2559
- * panel), "คู่มือทุกหน้า" (the panel's page guides) and "ติดต่อทีมช่วยเหลือ"
2558
+ * "คู่มือหน้านี้" (this page's guide), "อธิบายส่วนนี้ · <title>" for each
2559
+ * section guide on screen, "พาทำ · <title>" for each flow starting here,
2560
+ * "ไกด์เริ่มต้น n/N" (the quest
2561
+ * panel), "คู่มือทุกหน้า" (the panel's page guides), "พาทำงาน" (the panel's
2562
+ * flows) and "ติดต่อทีมช่วยเหลือ"
2560
2563
  * (the help dialog), each only when it has something. Otherwise one press
2561
2564
  * opens the help dialog, as before.
2562
2565
  */
@@ -2580,7 +2583,11 @@ function HelpButton({ className }) {
2580
2583
  e.preventDefault();
2581
2584
  toGuide.current = false;
2582
2585
  }
2583
- }, children: [items.includes("page") ? (jsxs(DropdownMenuItem, { onSelect: toTour(openPageGuide), className: "gap-2.5", children: [jsx(BookOpen, { className: "size-4" }), jsx("span", { className: "flex-1", children: "\u0E04\u0E39\u0E48\u0E21\u0E37\u0E2D\u0E2B\u0E19\u0E49\u0E32\u0E19\u0E35\u0E49" })] })) : null, items.includes("missions") && guide ? (jsxs(DropdownMenuItem, { onSelect: toTour(openGuidePanel), className: "gap-2.5", children: [jsx(Flag, { className: "size-4" }), jsx("span", { className: "flex-1", children: "\u0E44\u0E01\u0E14\u0E4C\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19" }), jsxs("span", { className: "text-xs font-semibold text-primary tabular-nums", children: [guide.done, "/", guide.total] })] })) : null, items.includes("pages") ? (jsxs(DropdownMenuItem, { onSelect: toTour(openPagesPanel), className: "gap-2.5", children: [jsx(Library, { className: "size-4" }), jsx("span", { className: "flex-1", children: "\u0E04\u0E39\u0E48\u0E21\u0E37\u0E2D\u0E17\u0E38\u0E01\u0E2B\u0E19\u0E49\u0E32" })] })) : null, jsxs(DropdownMenuItem, { onSelect: () => setTimeout(openHelp, 0), className: "gap-2.5", children: [jsx(MessageCircle, { className: "size-4" }), jsx("span", { className: "flex-1", children: "\u0E15\u0E34\u0E14\u0E15\u0E48\u0E2D\u0E17\u0E35\u0E21\u0E0A\u0E48\u0E27\u0E22\u0E40\u0E2B\u0E25\u0E37\u0E2D" })] })] })] }));
2586
+ }, children: [items.includes("page") ? (jsxs(DropdownMenuItem, { onSelect: toTour(openPageGuide), className: "gap-2.5", children: [jsx(BookOpen, { className: "size-4" }), jsx("span", { className: "flex-1", children: "\u0E04\u0E39\u0E48\u0E21\u0E37\u0E2D\u0E2B\u0E19\u0E49\u0E32\u0E19\u0E35\u0E49" })] })) : null, items.includes("sections")
2587
+ ? (pages.sections ?? []).map(sec => (jsxs(DropdownMenuItem, { onSelect: toTour(() => openSectionGuide(sec.key)), className: "gap-2.5", children: [jsx(Info, { className: "size-4" }), jsxs("span", { className: "flex-1", children: ["\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E2A\u0E48\u0E27\u0E19\u0E19\u0E35\u0E49 \u00B7 ", sec.title] })] }, sec.key)))
2588
+ : null, items.includes("flowsHere")
2589
+ ? (pages.flows ?? []).map(f => (jsxs(DropdownMenuItem, { onSelect: toTour(() => openFlow(f.key)), className: "gap-2.5", children: [jsx(Route, { className: "size-4" }), jsxs("span", { className: "flex-1", children: ["\u0E1E\u0E32\u0E17\u0E33 \u00B7 ", f.title] })] }, f.key)))
2590
+ : null, items.includes("missions") && guide ? (jsxs(DropdownMenuItem, { onSelect: toTour(openGuidePanel), className: "gap-2.5", children: [jsx(Flag, { className: "size-4" }), jsx("span", { className: "flex-1", children: "\u0E44\u0E01\u0E14\u0E4C\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19" }), jsxs("span", { className: "text-xs font-semibold text-primary tabular-nums", children: [guide.done, "/", guide.total] })] })) : null, items.includes("pages") ? (jsxs(DropdownMenuItem, { onSelect: toTour(openPagesPanel), className: "gap-2.5", children: [jsx(Library, { className: "size-4" }), jsx("span", { className: "flex-1", children: "\u0E04\u0E39\u0E48\u0E21\u0E37\u0E2D\u0E17\u0E38\u0E01\u0E2B\u0E19\u0E49\u0E32" })] })) : null, items.includes("flows") ? (jsxs(DropdownMenuItem, { onSelect: toTour(openFlowsPanel), className: "gap-2.5", children: [jsx(Route, { className: "size-4" }), jsx("span", { className: "flex-1", children: "\u0E1E\u0E32\u0E17\u0E33\u0E07\u0E32\u0E19" })] })) : null, jsxs(DropdownMenuItem, { onSelect: () => setTimeout(openHelp, 0), className: "gap-2.5", children: [jsx(MessageCircle, { className: "size-4" }), jsx("span", { className: "flex-1", children: "\u0E15\u0E34\u0E14\u0E15\u0E48\u0E2D\u0E17\u0E35\u0E21\u0E0A\u0E48\u0E27\u0E22\u0E40\u0E2B\u0E25\u0E37\u0E2D" })] })] })] }));
2584
2591
  }
2585
2592
 
2586
2593
  const hasPaginationShape = (payload) => {
@@ -4420,5 +4427,5 @@ const getAxiosErrorMessage = (error) => {
4420
4427
  return String(error);
4421
4428
  };
4422
4429
 
4423
- export { AccessDenied, ApiError, AppBreadcrumb, AppLayoutShell, AppSidebar, EMPLOYEE_RECORD_OK_EVENT, EMPLOYEE_RECORD_REQUIRED, EMPLOYEE_RECORD_REQUIRED_EVENT, EmployeeRequiredGate, FOR_ORGANIZATION_FIELD, FeatureFlagsProvider, GuideHost, GuideRuntime, HeaderBackground, HelpButton, HelpDialogHost, NavMain, NavTools, NavUser, OWNER_CHIP, OrganizationSwitcher, PLAN_FEATURES, PermissionGateShell, PermissionProvider, PermissionRulesProvider, ReactQueryProvider, SHELL_VERSION, SessionBackedProfileCacheSeeder, SessionRefreshTrigger, SidebarContent, SidebarFooter, SidebarHeader, SidebarHelpCard, SidebarHelpLink, SidebarProvider, SidebarTrigger, TapMenu, ThemeProvider, WITHOUT_ORGANIZATION_FLAG, WORKSPACE_HEADER_VARS, WORKSPACE_LIGHT_HEADER_VARS, WorkspaceBrand, accountSettingsHref, instance as axiosInstance, buildSystemLinks, buildUrlWithCode, canAccessNavPermissionRoute, clearAccessTokenCache, clearOrganizationId, clearStoredOrganization, closeHelp, decodeJWT, describeAttached, describeBrowser, detectHelpApp, filterNavigationModulesByPermission, filterNavigationToolsByPermission, findOrganizationForCode, getAccessToken, getActiveModule, getActiveSubModule, getAxiosErrorMessage, getOrganizationId, getQueryClientConfig, getRequestOrganizationId, getRequiredChildGroups, getStoredOrganizationIds, getTabOrganizationId, guideAnchor, guideMenuItems, hasPlanFeature, isKnownStaleOrganizationId, isLikelyTransientNetworkError, isPathActive, myRolesQueryKey, normalizePathnameForPermissionRules, openGuidePanel, openHelp, openPageGuide, openPagesPanel, organizationScopedQueryHash, parseMyRoles, platformBaseUrl, reportApiEvent, resolveActiveNav, resolveSidebarNav, resolveStaleOrganization, resolveUiRoutePermission, resolveUrlOrgGate, retryWithStoredOrganizations, roleSummary, runGlobalRequestPrecheck, runWithTransientRetry, setKnownOrganizationIds, setOrganizationId, setTabOrganizationId, shouldRetryQuery, toApiError, unwrapApiResponse, updateOrganizationId, useClearOrgOnUserChange, useFeatureFlag, useFeatureFlags, useGuideEntry, useInvalidateQueriesOnOrgChange, useKeycloakRoles, useMyRoles, useOrganizationIdState, usePageGuides, usePermissionRules, useSessionRefresh, useSidebar, useSidebarToggle, withoutOrganization };
4430
+ export { AccessDenied, ApiError, AppBreadcrumb, AppLayoutShell, AppSidebar, EMPLOYEE_RECORD_OK_EVENT, EMPLOYEE_RECORD_REQUIRED, EMPLOYEE_RECORD_REQUIRED_EVENT, EmployeeRequiredGate, FOR_ORGANIZATION_FIELD, FeatureFlagsProvider, GuideHost, GuideRuntime, HeaderBackground, HelpButton, HelpDialogHost, NavMain, NavTools, NavUser, OWNER_CHIP, OrganizationSwitcher, PLAN_FEATURES, PermissionGateShell, PermissionProvider, PermissionRulesProvider, ReactQueryProvider, SHELL_VERSION, SessionBackedProfileCacheSeeder, SessionRefreshTrigger, SidebarContent, SidebarFooter, SidebarHeader, SidebarHelpCard, SidebarHelpLink, SidebarProvider, SidebarTrigger, TapMenu, ThemeProvider, WITHOUT_ORGANIZATION_FLAG, WORKSPACE_HEADER_VARS, WORKSPACE_LIGHT_HEADER_VARS, WorkspaceBrand, accountSettingsHref, instance as axiosInstance, buildSystemLinks, buildUrlWithCode, canAccessNavPermissionRoute, clearAccessTokenCache, clearOrganizationId, clearStoredOrganization, closeHelp, decodeJWT, describeAttached, describeBrowser, detectHelpApp, filterNavigationModulesByPermission, filterNavigationToolsByPermission, findOrganizationForCode, getAccessToken, getActiveModule, getActiveSubModule, getAxiosErrorMessage, getOrganizationId, getQueryClientConfig, getRequestOrganizationId, getRequiredChildGroups, getStoredOrganizationIds, getTabOrganizationId, guideAnchor, guideMenuItems, hasPlanFeature, isKnownStaleOrganizationId, isLikelyTransientNetworkError, isPathActive, myRolesQueryKey, normalizePathnameForPermissionRules, openFlow, openFlowsPanel, openGuidePanel, openHelp, openPageGuide, openPagesPanel, openSectionGuide, organizationScopedQueryHash, parseMyRoles, platformBaseUrl, reportApiEvent, resolveActiveNav, resolveSidebarNav, resolveStaleOrganization, resolveUiRoutePermission, resolveUrlOrgGate, retryWithStoredOrganizations, roleSummary, runGlobalRequestPrecheck, runWithTransientRetry, setKnownOrganizationIds, setOrganizationId, setTabOrganizationId, shouldRetryQuery, toApiError, unwrapApiResponse, updateOrganizationId, useClearOrgOnUserChange, useFeatureFlag, useFeatureFlags, useGuideEntry, useInvalidateQueriesOnOrgChange, useKeycloakRoles, useMyRoles, useOrganizationIdState, usePageGuides, usePermissionRules, useSessionRefresh, useSidebar, useSidebarToggle, withoutOrganization };
4424
4431
  //# sourceMappingURL=index.esm.js.map