indas-ui 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/auth/ProtectedRoute.js +48 -0
- package/dist/cjs/components/auth/UnauthorizedPage.js +19 -0
- package/dist/cjs/components/auth/index.js +9 -0
- package/dist/cjs/components/chat/ai-messages.js +271 -0
- package/dist/cjs/components/chat/chat-prompt-navigator.js +110 -0
- package/dist/cjs/components/chat/chat.js +1032 -0
- package/dist/cjs/components/chat/multimodal-input.js +117 -0
- package/dist/cjs/components/dashboard/DrillDownModal.js +36 -0
- package/dist/cjs/components/dashboard/FilterBar.js +434 -0
- package/dist/cjs/components/dashboard/Tooltip.js +86 -0
- package/dist/cjs/components/dashboard/charts/Area.js +127 -0
- package/dist/cjs/components/dashboard/charts/Bar.js +111 -0
- package/dist/cjs/components/dashboard/charts/BoxPlot.js +118 -0
- package/dist/cjs/components/dashboard/charts/Bubble.js +102 -0
- package/dist/cjs/components/dashboard/charts/DashboardCard.js +12 -0
- package/dist/cjs/components/dashboard/charts/Donut.js +130 -0
- package/dist/cjs/components/dashboard/charts/FlowMap.js +238 -0
- package/dist/cjs/components/dashboard/charts/Funnel.js +38 -0
- package/dist/cjs/components/dashboard/charts/Gantt.js +271 -0
- package/dist/cjs/components/dashboard/charts/Gauge.js +143 -0
- package/dist/cjs/components/dashboard/charts/GeoMap.js +164 -0
- package/dist/cjs/components/dashboard/charts/Heatmap.js +116 -0
- package/dist/cjs/components/dashboard/charts/Line.js +75 -0
- package/dist/cjs/components/dashboard/charts/Pareto.js +110 -0
- package/dist/cjs/components/dashboard/charts/Radar.js +94 -0
- package/dist/cjs/components/dashboard/charts/Sankey.js +92 -0
- package/dist/cjs/components/dashboard/charts/Scatter.js +128 -0
- package/dist/cjs/components/dashboard/charts/Sparkline.js +134 -0
- package/dist/cjs/components/dashboard/charts/Treemap.js +104 -0
- package/dist/cjs/components/dashboard/charts/index.js +45 -0
- package/dist/cjs/components/dashboard/charts/india-map.js +464 -0
- package/dist/cjs/components/dashboard/charts/theme.js +132 -0
- package/dist/cjs/components/dashboard/config.js +118 -0
- package/dist/cjs/components/dashboard/index.js +39 -0
- package/dist/cjs/components/dashboard/kpi/KpiBeforeAfter.js +16 -0
- package/dist/cjs/components/dashboard/kpi/KpiBreakdown.js +42 -0
- package/dist/cjs/components/dashboard/kpi/KpiComparison.js +41 -0
- package/dist/cjs/components/dashboard/kpi/KpiQuickStats.js +41 -0
- package/dist/cjs/components/dashboard/kpi/KpiRating.js +38 -0
- package/dist/cjs/components/dashboard/kpi/KpiScroll.js +83 -0
- package/dist/cjs/components/dashboard/kpi/KpiTrend.js +37 -0
- package/dist/cjs/components/dashboard/kpi/index.js +22 -0
- package/dist/cjs/components/dashboard/kpi/kpi-shell.js +113 -0
- package/dist/cjs/components/dashboard/time-range.js +126 -0
- package/dist/cjs/components/datagrid/DataGrid.js +1613 -0
- package/dist/cjs/components/datagrid/cells/BooleanCell.js +42 -0
- package/dist/cjs/components/datagrid/cells/CellRenderer.js +142 -0
- package/dist/cjs/components/datagrid/cells/EditableCell.js +217 -0
- package/dist/cjs/components/datagrid/cells/SelectionCell.js +60 -0
- package/dist/cjs/components/datagrid/cells/index.js +6 -0
- package/dist/cjs/components/datagrid/columns/ActionsColumn.js +485 -0
- package/dist/cjs/components/datagrid/columns/ColumnContextMenu.js +341 -0
- package/dist/cjs/components/datagrid/columns/DraggableColumnHeader.js +150 -0
- package/dist/cjs/components/datagrid/controls/AutoResizeButton.js +10 -0
- package/dist/cjs/components/datagrid/controls/PaginationControls.js +38 -0
- package/dist/cjs/components/datagrid/controls/SummaryControls.js +30 -0
- package/dist/cjs/components/datagrid/controls/menu/ActionsMenu.js +16 -0
- package/dist/cjs/components/datagrid/controls/menu/column/ColumnChooserModal.js +25 -0
- package/dist/cjs/components/datagrid/controls/menu/column/ColumnSection.js +10 -0
- package/dist/cjs/components/datagrid/controls/menu/export/ExportSection.js +19 -0
- package/dist/cjs/components/datagrid/controls/menu/export/export.js +227 -0
- package/dist/cjs/components/datagrid/controls/menu/filter/AdvancedFilterModal.js +405 -0
- package/dist/cjs/components/datagrid/controls/menu/filter/FilterSection.js +9 -0
- package/dist/cjs/components/datagrid/controls/menu/grouping/GroupingSection.js +23 -0
- package/dist/cjs/components/datagrid/controls/menu/grouping/index.js +6 -0
- package/dist/cjs/components/datagrid/controls/menu/import/ImportSection.js +75 -0
- package/dist/cjs/components/datagrid/controls/menu/import/import.js +232 -0
- package/dist/cjs/components/datagrid/controls/menu/index.js +24 -0
- package/dist/cjs/components/datagrid/controls/menu/view/CardView.js +176 -0
- package/dist/cjs/components/datagrid/controls/menu/view/ChartView.js +401 -0
- package/dist/cjs/components/datagrid/controls/menu/view/ViewSection.js +12 -0
- package/dist/cjs/components/datagrid/hooks/useCellRangeSelection.js +127 -0
- package/dist/cjs/components/datagrid/hooks/useClipboard.js +154 -0
- package/dist/cjs/components/datagrid/hooks/useDataGridState.js +115 -0
- package/dist/cjs/components/datagrid/hooks/useKeyboardNavigation.js +120 -0
- package/dist/cjs/components/datagrid/index.js +90 -0
- package/dist/cjs/components/datagrid/rows/DraggableRow.js +34 -0
- package/dist/cjs/components/datagrid/rows/ExpandableRow.js +184 -0
- package/dist/cjs/components/datagrid/rows/FilterRow.js +188 -0
- package/dist/cjs/components/datagrid/rows/SelectColumn.js +34 -0
- package/dist/cjs/components/datagrid/rows/SummaryRow.js +34 -0
- package/dist/cjs/components/datagrid/rows/summary.js +67 -0
- package/dist/cjs/components/datagrid/search/InlineSearchCell.js +99 -0
- package/dist/cjs/components/datagrid/search/SearchHighlighter.js +133 -0
- package/dist/cjs/components/datagrid/search/SearchNavigator.js +185 -0
- package/dist/cjs/components/datagrid/search/SearchNewModal.js +238 -0
- package/dist/cjs/components/datagrid/search/advancedSearch.js +112 -0
- package/dist/cjs/components/datagrid/utils/grid-helpers.js +102 -0
- package/dist/cjs/components/datagrid/utils/grid-types.js +3 -0
- package/dist/cjs/components/draft/AutoSaveIndicator.js +70 -0
- package/dist/cjs/components/draft/DraftModal.js +220 -0
- package/dist/cjs/components/forms/date-picker/CalendarView.js +82 -0
- package/dist/cjs/components/forms/date-picker/DatePicker.js +748 -0
- package/dist/cjs/components/forms/date-picker/DateTimePicker.js +174 -0
- package/dist/cjs/components/forms/date-picker/index.js +21 -0
- package/dist/cjs/components/forms/date-picker/shared-utils.js +24 -0
- package/dist/cjs/components/forms/dropdown/Dropdown.js +427 -0
- package/dist/cjs/components/forms/dropdown/MultiSelect.js +136 -0
- package/dist/cjs/components/forms/dropdown/SingleSelect.js +254 -0
- package/dist/cjs/components/forms/dropdown/hooks/useDropdownCreate.js +88 -0
- package/dist/cjs/components/forms/dropdown/hooks/useDropdownFiltering.js +87 -0
- package/dist/cjs/components/forms/dropdown/hooks/useDropdownState.js +63 -0
- package/dist/cjs/components/forms/dropdown/index.js +6 -0
- package/dist/cjs/components/forms/dropdown/types.js +3 -0
- package/dist/cjs/components/forms/file-attachment/EmailPreview.js +419 -0
- package/dist/cjs/components/forms/file-attachment/FileAttachment.js +966 -0
- package/dist/cjs/components/forms/file-attachment/index.js +6 -0
- package/dist/cjs/components/forms/index.js +16 -0
- package/dist/cjs/components/forms/quantity-input-popup.js +135 -0
- package/dist/cjs/components/forms/remark-input/RemarkInput.js +263 -0
- package/dist/cjs/components/forms/remark-input/index.js +8 -0
- package/dist/cjs/components/forms/unified-currency-dropdown.js +202 -0
- package/dist/cjs/components/index.js +41 -0
- package/dist/cjs/components/layout/SidebarContextMenu.js +179 -0
- package/dist/cjs/components/layout/app-shell.js +81 -0
- package/dist/cjs/components/layout/bottom-nav.js +262 -0
- package/dist/cjs/components/layout/floating-action-button.js +77 -0
- package/dist/cjs/components/layout/footer.js +60 -0
- package/dist/cjs/components/layout/index.js +16 -0
- package/dist/cjs/components/layout/mobile-menu-sheet.js +195 -0
- package/dist/cjs/components/layout/side-panel.js +118 -0
- package/dist/cjs/components/layout/sidebar.js +581 -0
- package/dist/cjs/components/layout/top-header.js +270 -0
- package/dist/cjs/components/layout/userprofile-dropdown.js +100 -0
- package/dist/cjs/components/master/editable-cells/EditableCell.js +106 -0
- package/dist/cjs/components/master/editable-cells/index.js +17 -0
- package/dist/cjs/components/master/index.js +9 -0
- package/dist/cjs/components/messaging/conversation-list.js +109 -0
- package/dist/cjs/components/messaging/create-conversation-modal.js +112 -0
- package/dist/cjs/components/messaging/message-bubble.js +69 -0
- package/dist/cjs/components/messaging/message-input.js +154 -0
- package/dist/cjs/components/messaging/message-thread.js +124 -0
- package/dist/cjs/components/messaging/messaging-panel-content.js +69 -0
- package/dist/cjs/components/messaging/thread-panel.js +50 -0
- package/dist/cjs/components/modals/3DModal.js +35 -0
- package/dist/cjs/components/modals/ImageModal.js +587 -0
- package/dist/cjs/components/modals/Modal.js +311 -0
- package/dist/cjs/components/modals/StandardModal.js +28 -0
- package/dist/cjs/components/modals/api-config-modal.js +120 -0
- package/dist/cjs/components/modals/global-api-config-modal.js +127 -0
- package/dist/cjs/components/modals/index.js +17 -0
- package/dist/cjs/components/modals/logout-modal.js +45 -0
- package/dist/cjs/components/modals/modal-alert.js +295 -0
- package/dist/cjs/components/modals/password-reset-modal.js +112 -0
- package/dist/cjs/components/modals/session-expiry-warning.js +18 -0
- package/dist/cjs/components/providers/api-provider.js +19 -0
- package/dist/cjs/components/providers/query-provider.js +29 -0
- package/dist/cjs/components/providers/session-provider.js +119 -0
- package/dist/cjs/components/theme/ThemeCustomizer.js +184 -0
- package/dist/cjs/components/ui/buttons/button.js +264 -0
- package/dist/cjs/components/ui/card.js +58 -0
- package/dist/cjs/components/ui/chart.js +160 -0
- package/dist/cjs/components/ui/display/boolean-badge.js +29 -0
- package/dist/cjs/components/ui/display/card.js +20 -0
- package/dist/cjs/components/ui/display/collapsible.js +44 -0
- package/dist/cjs/components/ui/display/separator.js +44 -0
- package/dist/cjs/components/ui/display/stats-card.js +29 -0
- package/dist/cjs/components/ui/display/text.js +94 -0
- package/dist/cjs/components/ui/feedback/alert.js +61 -0
- package/dist/cjs/components/ui/feedback/badge.js +93 -0
- package/dist/cjs/components/ui/feedback/progress.js +44 -0
- package/dist/cjs/components/ui/feedback/reminder-button.js +111 -0
- package/dist/cjs/components/ui/feedback/skeleton-table.js +20 -0
- package/dist/cjs/components/ui/feedback/skeleton.js +53 -0
- package/dist/cjs/components/ui/feedback/tooltip.js +54 -0
- package/dist/cjs/components/ui/form-toggle.js +47 -0
- package/dist/cjs/components/ui/forms/checkbox.js +24 -0
- package/dist/cjs/components/ui/forms/input.js +111 -0
- package/dist/cjs/components/ui/forms/label.js +10 -0
- package/dist/cjs/components/ui/forms/switch.js +58 -0
- package/dist/cjs/components/ui/forms/textarea.js +49 -0
- package/dist/cjs/components/ui/index.js +157 -0
- package/dist/cjs/components/ui/navigation/dropdown-menu.js +84 -0
- package/dist/cjs/components/ui/navigation/header-steps.js +51 -0
- package/dist/cjs/components/ui/navigation/tabs.js +97 -0
- package/dist/cjs/components/ui/overlays/loading.js +169 -0
- package/dist/cjs/components/ui/select.js +72 -0
- package/dist/cjs/config/api.js +65 -0
- package/dist/cjs/contexts/AppConfigContext.js +37 -0
- package/dist/cjs/contexts/CurrencyContext.js +336 -0
- package/dist/cjs/contexts/DeviceContext.js +106 -0
- package/dist/cjs/contexts/EmailContext.js +727 -0
- package/dist/cjs/contexts/GlobalAlertContext.js +232 -0
- package/dist/cjs/contexts/ImpactAnalysisContext.js +60 -0
- package/dist/cjs/contexts/LanguageContext.js +104 -0
- package/dist/cjs/contexts/MessagingContext.js +726 -0
- package/dist/cjs/contexts/ModuleAuthContext.js +316 -0
- package/dist/cjs/contexts/NavigationContext.js +182 -0
- package/dist/cjs/contexts/NetworkStatusContext.js +95 -0
- package/dist/cjs/contexts/NotificationContext.js +169 -0
- package/dist/cjs/contexts/PageTitleContext.js +28 -0
- package/dist/cjs/contexts/SearchPreferencesContext.js +42 -0
- package/dist/cjs/contexts/SessionAdapterContext.js +24 -0
- package/dist/cjs/contexts/SidebarPreferencesContext.js +116 -0
- package/dist/cjs/contexts/ThemeContext.js +193 -0
- package/dist/cjs/hooks/index.js +50 -0
- package/dist/cjs/hooks/useApproval.js +250 -0
- package/dist/cjs/hooks/useBacchaSearch.js +257 -0
- package/dist/cjs/hooks/useBusinessAudit.js +54 -0
- package/dist/cjs/hooks/useColumnFreezing.js +204 -0
- package/dist/cjs/hooks/useColumnMetadata.js +48 -0
- package/dist/cjs/hooks/useConditionalFormatting.js +197 -0
- package/dist/cjs/hooks/useDebounce.js +49 -0
- package/dist/cjs/hooks/useDraft.js +181 -0
- package/dist/cjs/hooks/useFormValidation.js +68 -0
- package/dist/cjs/hooks/useGridSettings.js +85 -0
- package/dist/cjs/hooks/useGridTheme.js +204 -0
- package/dist/cjs/hooks/useId.js +21 -0
- package/dist/cjs/hooks/useIntelligentColumnSizing.js +315 -0
- package/dist/cjs/hooks/useKeyboardNavigation.js +192 -0
- package/dist/cjs/hooks/useNotifications.js +63 -0
- package/dist/cjs/hooks/usePrevious.js +20 -0
- package/dist/cjs/hooks/useRowSelection.js +150 -0
- package/dist/cjs/hooks/useSignalR.js +53 -0
- package/dist/cjs/hooks/useTheme.js +268 -0
- package/dist/cjs/hooks/useTranslation.js +20 -0
- package/dist/cjs/hooks/useUnsavedChanges.js +88 -0
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/lib/api/activity/audit/audit.js +51 -0
- package/dist/cjs/lib/api/activity/audit/index.js +29 -0
- package/dist/cjs/lib/api/activity/audit/send.js +434 -0
- package/dist/cjs/lib/api/activity/email/client.js +467 -0
- package/dist/cjs/lib/api/activity/email/index.js +31 -0
- package/dist/cjs/lib/api/activity/email/password-reset.js +58 -0
- package/dist/cjs/lib/api/activity/email/templates.js +537 -0
- package/dist/cjs/lib/api/activity/email/types.js +24 -0
- package/dist/cjs/lib/api/activity/index.js +48 -0
- package/dist/cjs/lib/api/activity/messaging/messaging.js +254 -0
- package/dist/cjs/lib/api/activity/notifications/index.js +43 -0
- package/dist/cjs/lib/api/activity/notifications/notifications.js +224 -0
- package/dist/cjs/lib/api/activity/notifications/reminders.js +30 -0
- package/dist/cjs/lib/api/activity/notifications/send.js +267 -0
- package/dist/cjs/lib/api/activity/notifications/types.js +66 -0
- package/dist/cjs/lib/api/activity/notify-and-log.js +63 -0
- package/dist/cjs/lib/api/activity/remarks/index.js +6 -0
- package/dist/cjs/lib/api/activity/remarks/remarks.js +186 -0
- package/dist/cjs/lib/api/activity/storage.js +83 -0
- package/dist/cjs/lib/api/ai/chat.js +227 -0
- package/dist/cjs/lib/api/ai/types.js +6 -0
- package/dist/cjs/lib/api/approval/approvals.js +210 -0
- package/dist/cjs/lib/api/approval/index.js +13 -0
- package/dist/cjs/lib/api/auth/auth.js +154 -0
- package/dist/cjs/lib/api/auth/index.js +11 -0
- package/dist/cjs/lib/api/auth/password-reset-otp.js +192 -0
- package/dist/cjs/lib/api/auth/two-factor-auth.js +94 -0
- package/dist/cjs/lib/api/auth/two-factor.js +186 -0
- package/dist/cjs/lib/api/core/auth-helpers.js +141 -0
- package/dist/cjs/lib/api/core/client.js +305 -0
- package/dist/cjs/lib/api/core/config.js +248 -0
- package/dist/cjs/lib/api/core/index.js +43 -0
- package/dist/cjs/lib/api/core/session-validator.js +98 -0
- package/dist/cjs/lib/api/core/types.js +4 -0
- package/dist/cjs/lib/api/core/utils.js +70 -0
- package/dist/cjs/lib/api/dashboard/costing.js +15 -0
- package/dist/cjs/lib/api/dashboard/management.js +11 -0
- package/dist/cjs/lib/api/dashboard/sales.js +11 -0
- package/dist/cjs/lib/api/draft/drafts.js +279 -0
- package/dist/cjs/lib/api/draft/index.js +13 -0
- package/dist/cjs/lib/api/enquiry/enquiry.js +624 -0
- package/dist/cjs/lib/api/enquiry/index.js +20 -0
- package/dist/cjs/lib/api/enquiry/rate-enquiry.js +78 -0
- package/dist/cjs/lib/api/estimation/categories.js +113 -0
- package/dist/cjs/lib/api/estimation/category-defaults.js +47 -0
- package/dist/cjs/lib/api/estimation/company-config.js +26 -0
- package/dist/cjs/lib/api/estimation/content.js +210 -0
- package/dist/cjs/lib/api/estimation/freight.js +25 -0
- package/dist/cjs/lib/api/estimation/grid-costing-drafts.js +30 -0
- package/dist/cjs/lib/api/estimation/grid-costing.js +176 -0
- package/dist/cjs/lib/api/estimation/index.js +58 -0
- package/dist/cjs/lib/api/estimation/legacy-costing.js +51 -0
- package/dist/cjs/lib/api/estimation/machines.js +74 -0
- package/dist/cjs/lib/api/estimation/planning.js +403 -0
- package/dist/cjs/lib/api/estimation/qualities.js +245 -0
- package/dist/cjs/lib/api/estimation/quotation-load.js +52 -0
- package/dist/cjs/lib/api/estimation/quotation-save.js +109 -0
- package/dist/cjs/lib/api/estimation/quote-check.js +34 -0
- package/dist/cjs/lib/api/estimation/quotepanel.js +496 -0
- package/dist/cjs/lib/api/estimation/shipper-planning.js +220 -0
- package/dist/cjs/lib/api/estimation/wastage.js +47 -0
- package/dist/cjs/lib/api/index.js +33 -0
- package/dist/cjs/lib/api/integration/proxy.js +40 -0
- package/dist/cjs/lib/api/master/category.js +215 -0
- package/dist/cjs/lib/api/master/company.js +389 -0
- package/dist/cjs/lib/api/master/hsn.js +61 -0
- package/dist/cjs/lib/api/master/index.js +47 -0
- package/dist/cjs/lib/api/master/item.js +142 -0
- package/dist/cjs/lib/api/master/ledger.js +398 -0
- package/dist/cjs/lib/api/master/logistics.js +119 -0
- package/dist/cjs/lib/api/master/machine.js +579 -0
- package/dist/cjs/lib/api/master/material-group.js +103 -0
- package/dist/cjs/lib/api/master/other.js +63 -0
- package/dist/cjs/lib/api/master/process-types.js +5 -0
- package/dist/cjs/lib/api/master/process.js +131 -0
- package/dist/cjs/lib/api/master/production-units.js +22 -0
- package/dist/cjs/lib/api/master/rate.js +203 -0
- package/dist/cjs/lib/api/master/tool.js +88 -0
- package/dist/cjs/lib/api/master/user.js +154 -0
- package/dist/cjs/lib/api/settings/erp-parameters.js +69 -0
- package/dist/cjs/lib/api/utility/index.js +11 -0
- package/dist/cjs/lib/api/utility/menu.js +136 -0
- package/dist/cjs/lib/auth.js +10 -0
- package/dist/cjs/lib/pwa.js +59 -0
- package/dist/cjs/lib/react-query-config.js +134 -0
- package/dist/cjs/lib/security/audit-logger.js +177 -0
- package/dist/cjs/lib/security/rate-limiter.js +122 -0
- package/dist/cjs/lib/server-url.js +76 -0
- package/dist/cjs/lib/svg-utils.js +213 -0
- package/dist/cjs/lib/theme/types.js +235 -0
- package/dist/cjs/lib/theme/utils.js +363 -0
- package/dist/cjs/lib/types/index.js +3 -0
- package/dist/cjs/lib/utils/attachment-loader.js +82 -0
- package/dist/cjs/lib/utils/client-lead-utils.js +61 -0
- package/dist/cjs/lib/utils/device-detection.js +110 -0
- package/dist/cjs/lib/utils/logout-cleanup.js +312 -0
- package/dist/cjs/lib/utils/planning-prefs.js +31 -0
- package/dist/cjs/lib/utils.js +70 -0
- package/dist/cjs/lib/vision/dieline-extractor.js +321 -0
- package/dist/cjs/lib/vision/reference-grid.js +245 -0
- package/dist/cjs/locales/de.json +79 -0
- package/dist/cjs/locales/en.json +2217 -0
- package/dist/cjs/locales/es.json +79 -0
- package/dist/cjs/locales/fr.json +78 -0
- package/dist/cjs/locales/hi.json +1599 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/providers.js +43 -0
- package/dist/cjs/services/GlobalLoadingService.js +220 -0
- package/{src → dist/cjs}/styles/grid-themes.css +345 -345
- package/{src → dist/cjs}/styles/sidebar-scrollbar.css +45 -45
- package/{src → dist/cjs}/styles/tokens.css +712 -711
- package/dist/cjs/types/approval.js +22 -0
- package/dist/cjs/types/audit.js +50 -0
- package/dist/cjs/types/draft.js +22 -0
- package/dist/cjs/types/master.js +4 -0
- package/dist/cjs/types/shipper-planning.js +7 -0
- package/dist/components/auth/ProtectedRoute.d.ts +6 -0
- package/dist/components/auth/ProtectedRoute.js +45 -0
- package/dist/components/auth/UnauthorizedPage.d.ts +6 -0
- package/dist/components/auth/UnauthorizedPage.js +15 -0
- package/dist/components/auth/index.d.ts +2 -0
- package/dist/components/auth/index.js +3 -0
- package/dist/components/chat/ai-messages.d.ts +32 -0
- package/dist/components/chat/ai-messages.js +265 -0
- package/dist/components/chat/chat-prompt-navigator.d.ts +9 -0
- package/dist/components/chat/chat-prompt-navigator.js +107 -0
- package/dist/components/chat/chat.d.ts +46 -0
- package/dist/components/chat/chat.js +1029 -0
- package/dist/components/chat/multimodal-input.d.ts +12 -0
- package/dist/components/chat/multimodal-input.js +114 -0
- package/dist/components/dashboard/DrillDownModal.d.ts +15 -0
- package/dist/components/dashboard/DrillDownModal.js +33 -0
- package/dist/components/dashboard/FilterBar.d.ts +108 -0
- package/dist/components/dashboard/FilterBar.js +428 -0
- package/dist/components/dashboard/Tooltip.d.ts +24 -0
- package/dist/components/dashboard/Tooltip.js +50 -0
- package/dist/components/dashboard/charts/Area.d.ts +28 -0
- package/dist/components/dashboard/charts/Area.js +121 -0
- package/dist/components/dashboard/charts/Bar.d.ts +27 -0
- package/dist/components/dashboard/charts/Bar.js +105 -0
- package/dist/components/dashboard/charts/BoxPlot.d.ts +23 -0
- package/dist/components/dashboard/charts/BoxPlot.js +112 -0
- package/dist/components/dashboard/charts/Bubble.d.ts +36 -0
- package/dist/components/dashboard/charts/Bubble.js +96 -0
- package/dist/components/dashboard/charts/DashboardCard.d.ts +12 -0
- package/dist/components/dashboard/charts/DashboardCard.js +9 -0
- package/dist/components/dashboard/charts/Donut.d.ts +23 -0
- package/dist/components/dashboard/charts/Donut.js +124 -0
- package/dist/components/dashboard/charts/FlowMap.d.ts +38 -0
- package/dist/components/dashboard/charts/FlowMap.js +199 -0
- package/dist/components/dashboard/charts/Funnel.d.ts +30 -0
- package/dist/components/dashboard/charts/Funnel.js +35 -0
- package/dist/components/dashboard/charts/Gantt.d.ts +26 -0
- package/dist/components/dashboard/charts/Gantt.js +265 -0
- package/dist/components/dashboard/charts/Gauge.d.ts +25 -0
- package/dist/components/dashboard/charts/Gauge.js +137 -0
- package/dist/components/dashboard/charts/GeoMap.d.ts +38 -0
- package/dist/components/dashboard/charts/GeoMap.js +125 -0
- package/dist/components/dashboard/charts/Heatmap.d.ts +31 -0
- package/dist/components/dashboard/charts/Heatmap.js +110 -0
- package/dist/components/dashboard/charts/Line.d.ts +33 -0
- package/dist/components/dashboard/charts/Line.js +69 -0
- package/dist/components/dashboard/charts/Pareto.d.ts +21 -0
- package/dist/components/dashboard/charts/Pareto.js +104 -0
- package/dist/components/dashboard/charts/Radar.d.ts +32 -0
- package/dist/components/dashboard/charts/Radar.js +88 -0
- package/dist/components/dashboard/charts/Sankey.d.ts +43 -0
- package/dist/components/dashboard/charts/Sankey.js +86 -0
- package/dist/components/dashboard/charts/Scatter.d.ts +38 -0
- package/dist/components/dashboard/charts/Scatter.js +122 -0
- package/dist/components/dashboard/charts/Sparkline.d.ts +37 -0
- package/dist/components/dashboard/charts/Sparkline.js +128 -0
- package/dist/components/dashboard/charts/Treemap.d.ts +30 -0
- package/dist/components/dashboard/charts/Treemap.js +98 -0
- package/dist/components/dashboard/charts/index.d.ts +38 -0
- package/dist/components/dashboard/charts/index.js +23 -0
- package/dist/components/dashboard/charts/india-map.d.ts +22 -0
- package/dist/components/dashboard/charts/india-map.js +461 -0
- package/dist/components/dashboard/charts/theme.d.ts +107 -0
- package/dist/components/dashboard/charts/theme.js +124 -0
- package/dist/components/dashboard/config.d.ts +96 -0
- package/dist/components/dashboard/config.js +113 -0
- package/dist/components/dashboard/index.d.ts +10 -0
- package/dist/components/dashboard/index.js +13 -0
- package/dist/components/dashboard/kpi/KpiBeforeAfter.d.ts +31 -0
- package/dist/components/dashboard/kpi/KpiBeforeAfter.js +13 -0
- package/dist/components/dashboard/kpi/KpiBreakdown.d.ts +31 -0
- package/dist/components/dashboard/kpi/KpiBreakdown.js +39 -0
- package/dist/components/dashboard/kpi/KpiComparison.d.ts +36 -0
- package/dist/components/dashboard/kpi/KpiComparison.js +38 -0
- package/dist/components/dashboard/kpi/KpiQuickStats.d.ts +30 -0
- package/dist/components/dashboard/kpi/KpiQuickStats.js +38 -0
- package/dist/components/dashboard/kpi/KpiRating.d.ts +46 -0
- package/dist/components/dashboard/kpi/KpiRating.js +35 -0
- package/dist/components/dashboard/kpi/KpiScroll.d.ts +63 -0
- package/dist/components/dashboard/kpi/KpiScroll.js +80 -0
- package/dist/components/dashboard/kpi/KpiTrend.d.ts +28 -0
- package/dist/components/dashboard/kpi/KpiTrend.js +34 -0
- package/dist/components/dashboard/kpi/index.d.ts +16 -0
- package/dist/components/dashboard/kpi/index.js +10 -0
- package/dist/components/dashboard/kpi/kpi-shell.d.ts +44 -0
- package/dist/components/dashboard/kpi/kpi-shell.js +108 -0
- package/dist/components/dashboard/time-range.d.ts +12 -0
- package/dist/components/dashboard/time-range.js +118 -0
- package/dist/components/datagrid/DataGrid.d.ts +126 -0
- package/dist/components/datagrid/DataGrid.js +1577 -0
- package/dist/components/datagrid/cells/BooleanCell.d.ts +15 -0
- package/dist/components/datagrid/cells/BooleanCell.js +39 -0
- package/dist/components/datagrid/cells/CellRenderer.d.ts +25 -0
- package/dist/components/datagrid/cells/CellRenderer.js +139 -0
- package/dist/components/datagrid/cells/EditableCell.d.ts +35 -0
- package/dist/components/datagrid/cells/EditableCell.js +179 -0
- package/dist/components/datagrid/cells/SelectionCell.d.ts +11 -0
- package/dist/components/datagrid/cells/SelectionCell.js +58 -0
- package/dist/components/datagrid/cells/index.d.ts +1 -0
- package/dist/components/datagrid/cells/index.js +2 -0
- package/dist/components/datagrid/columns/ActionsColumn.d.ts +174 -0
- package/dist/components/datagrid/columns/ActionsColumn.js +448 -0
- package/dist/components/datagrid/columns/ColumnContextMenu.d.ts +16 -0
- package/dist/components/datagrid/columns/ColumnContextMenu.js +338 -0
- package/dist/components/datagrid/columns/DraggableColumnHeader.d.ts +19 -0
- package/dist/components/datagrid/columns/DraggableColumnHeader.js +147 -0
- package/dist/components/datagrid/controls/AutoResizeButton.d.ts +8 -0
- package/dist/components/datagrid/controls/AutoResizeButton.js +7 -0
- package/dist/components/datagrid/controls/PaginationControls.d.ts +13 -0
- package/dist/components/datagrid/controls/PaginationControls.js +34 -0
- package/dist/components/datagrid/controls/SummaryControls.d.ts +10 -0
- package/dist/components/datagrid/controls/SummaryControls.js +27 -0
- package/dist/components/datagrid/controls/menu/ActionsMenu.d.ts +31 -0
- package/dist/components/datagrid/controls/menu/ActionsMenu.js +13 -0
- package/dist/components/datagrid/controls/menu/column/ColumnChooserModal.d.ts +13 -0
- package/dist/components/datagrid/controls/menu/column/ColumnChooserModal.js +22 -0
- package/dist/components/datagrid/controls/menu/column/ColumnSection.d.ts +9 -0
- package/dist/components/datagrid/controls/menu/column/ColumnSection.js +7 -0
- package/dist/components/datagrid/controls/menu/export/ExportSection.d.ts +7 -0
- package/dist/components/datagrid/controls/menu/export/ExportSection.js +16 -0
- package/dist/components/datagrid/controls/menu/export/export.d.ts +21 -0
- package/dist/components/datagrid/controls/menu/export/export.js +187 -0
- package/dist/components/datagrid/controls/menu/filter/AdvancedFilterModal.d.ts +29 -0
- package/dist/components/datagrid/controls/menu/filter/AdvancedFilterModal.js +369 -0
- package/dist/components/datagrid/controls/menu/filter/FilterSection.d.ts +12 -0
- package/dist/components/datagrid/controls/menu/filter/FilterSection.js +6 -0
- package/dist/components/datagrid/controls/menu/grouping/GroupingSection.d.ts +10 -0
- package/dist/components/datagrid/controls/menu/grouping/GroupingSection.js +20 -0
- package/dist/components/datagrid/controls/menu/grouping/index.d.ts +1 -0
- package/dist/components/datagrid/controls/menu/grouping/index.js +2 -0
- package/dist/components/datagrid/controls/menu/import/ImportSection.d.ts +6 -0
- package/dist/components/datagrid/controls/menu/import/ImportSection.js +72 -0
- package/dist/components/datagrid/controls/menu/import/import.d.ts +27 -0
- package/dist/components/datagrid/controls/menu/import/import.js +193 -0
- package/dist/components/datagrid/controls/menu/index.d.ts +10 -0
- package/dist/components/datagrid/controls/menu/index.js +11 -0
- package/dist/components/datagrid/controls/menu/view/CardView.d.ts +17 -0
- package/dist/components/datagrid/controls/menu/view/CardView.js +173 -0
- package/dist/components/datagrid/controls/menu/view/ChartView.d.ts +9 -0
- package/dist/components/datagrid/controls/menu/view/ChartView.js +363 -0
- package/dist/components/datagrid/controls/menu/view/ViewSection.d.ts +7 -0
- package/dist/components/datagrid/controls/menu/view/ViewSection.js +9 -0
- package/dist/components/datagrid/hooks/useCellRangeSelection.d.ts +20 -0
- package/dist/components/datagrid/hooks/useCellRangeSelection.js +124 -0
- package/dist/components/datagrid/hooks/useClipboard.d.ts +15 -0
- package/dist/components/datagrid/hooks/useClipboard.js +151 -0
- package/dist/components/datagrid/hooks/useDataGridState.d.ts +46 -0
- package/dist/components/datagrid/hooks/useDataGridState.js +112 -0
- package/dist/components/datagrid/hooks/useKeyboardNavigation.d.ts +18 -0
- package/dist/components/datagrid/hooks/useKeyboardNavigation.js +117 -0
- package/dist/components/datagrid/index.d.ts +34 -0
- package/dist/components/datagrid/index.js +41 -0
- package/dist/components/datagrid/rows/DraggableRow.d.ts +33 -0
- package/dist/components/datagrid/rows/DraggableRow.js +31 -0
- package/dist/components/datagrid/rows/ExpandableRow.d.ts +48 -0
- package/dist/components/datagrid/rows/ExpandableRow.js +178 -0
- package/dist/components/datagrid/rows/FilterRow.d.ts +10 -0
- package/dist/components/datagrid/rows/FilterRow.js +185 -0
- package/dist/components/datagrid/rows/SelectColumn.d.ts +2 -0
- package/dist/components/datagrid/rows/SelectColumn.js +31 -0
- package/dist/components/datagrid/rows/SummaryRow.d.ts +12 -0
- package/dist/components/datagrid/rows/SummaryRow.js +31 -0
- package/dist/components/datagrid/rows/summary.d.ts +9 -0
- package/dist/components/datagrid/rows/summary.js +63 -0
- package/dist/components/datagrid/search/InlineSearchCell.d.ts +13 -0
- package/dist/components/datagrid/search/InlineSearchCell.js +96 -0
- package/dist/components/datagrid/search/SearchHighlighter.d.ts +16 -0
- package/dist/components/datagrid/search/SearchHighlighter.js +124 -0
- package/dist/components/datagrid/search/SearchNavigator.d.ts +24 -0
- package/dist/components/datagrid/search/SearchNavigator.js +148 -0
- package/dist/components/datagrid/search/SearchNewModal.d.ts +12 -0
- package/dist/components/datagrid/search/SearchNewModal.js +202 -0
- package/dist/components/datagrid/search/advancedSearch.d.ts +23 -0
- package/dist/components/datagrid/search/advancedSearch.js +109 -0
- package/dist/components/datagrid/utils/grid-helpers.d.ts +34 -0
- package/dist/components/datagrid/utils/grid-helpers.js +94 -0
- package/dist/components/datagrid/utils/grid-types.d.ts +157 -0
- package/dist/components/datagrid/utils/grid-types.js +2 -0
- package/dist/components/draft/AutoSaveIndicator.d.ts +28 -0
- package/dist/components/draft/AutoSaveIndicator.js +67 -0
- package/dist/components/draft/DraftModal.d.ts +27 -0
- package/dist/components/draft/DraftModal.js +184 -0
- package/dist/components/forms/date-picker/CalendarView.d.ts +17 -0
- package/dist/components/forms/date-picker/CalendarView.js +46 -0
- package/dist/components/forms/date-picker/DatePicker.d.ts +31 -0
- package/dist/components/forms/date-picker/DatePicker.js +712 -0
- package/dist/components/forms/date-picker/DateTimePicker.d.ts +15 -0
- package/dist/components/forms/date-picker/DateTimePicker.js +138 -0
- package/dist/components/forms/date-picker/index.d.ts +7 -0
- package/dist/components/forms/date-picker/index.js +9 -0
- package/dist/components/forms/date-picker/shared-utils.d.ts +6 -0
- package/dist/components/forms/date-picker/shared-utils.js +19 -0
- package/dist/components/forms/dropdown/Dropdown.d.ts +144 -0
- package/dist/components/forms/dropdown/Dropdown.js +384 -0
- package/dist/components/forms/dropdown/MultiSelect.d.ts +29 -0
- package/dist/components/forms/dropdown/MultiSelect.js +100 -0
- package/dist/components/forms/dropdown/SingleSelect.d.ts +39 -0
- package/dist/components/forms/dropdown/SingleSelect.js +218 -0
- package/dist/components/forms/dropdown/hooks/useDropdownCreate.d.ts +8 -0
- package/dist/components/forms/dropdown/hooks/useDropdownCreate.js +52 -0
- package/dist/components/forms/dropdown/hooks/useDropdownFiltering.d.ts +5 -0
- package/dist/components/forms/dropdown/hooks/useDropdownFiltering.js +51 -0
- package/dist/components/forms/dropdown/hooks/useDropdownState.d.ts +7 -0
- package/dist/components/forms/dropdown/hooks/useDropdownState.js +27 -0
- package/dist/components/forms/dropdown/index.d.ts +2 -0
- package/dist/components/forms/dropdown/index.js +2 -0
- package/dist/components/forms/dropdown/types.d.ts +67 -0
- package/dist/components/forms/dropdown/types.js +2 -0
- package/dist/components/forms/file-attachment/EmailPreview.d.ts +5 -0
- package/dist/components/forms/file-attachment/EmailPreview.js +383 -0
- package/dist/components/forms/file-attachment/FileAttachment.d.ts +30 -0
- package/dist/components/forms/file-attachment/FileAttachment.js +930 -0
- package/dist/components/forms/file-attachment/index.d.ts +2 -0
- package/dist/components/forms/file-attachment/index.js +2 -0
- package/dist/components/forms/index.d.ts +9 -0
- package/dist/components/forms/index.js +7 -0
- package/dist/components/forms/quantity-input-popup.d.ts +10 -0
- package/dist/components/forms/quantity-input-popup.js +99 -0
- package/dist/components/forms/remark-input/RemarkInput.d.ts +58 -0
- package/dist/components/forms/remark-input/RemarkInput.js +258 -0
- package/dist/components/forms/remark-input/index.d.ts +1 -0
- package/dist/components/forms/remark-input/index.js +2 -0
- package/dist/components/forms/unified-currency-dropdown.d.ts +26 -0
- package/dist/components/forms/unified-currency-dropdown.js +166 -0
- package/dist/components/index.d.ts +14 -0
- package/dist/components/index.js +15 -0
- package/dist/components/layout/SidebarContextMenu.d.ts +18 -0
- package/dist/components/layout/SidebarContextMenu.js +142 -0
- package/dist/components/layout/app-shell.d.ts +32 -0
- package/dist/components/layout/app-shell.js +43 -0
- package/dist/components/layout/bottom-nav.d.ts +28 -0
- package/dist/components/layout/bottom-nav.js +219 -0
- package/dist/components/layout/floating-action-button.d.ts +10 -0
- package/dist/components/layout/floating-action-button.js +74 -0
- package/dist/components/layout/footer.d.ts +37 -0
- package/dist/components/layout/footer.js +56 -0
- package/dist/components/layout/index.d.ts +8 -0
- package/dist/components/layout/index.js +6 -0
- package/dist/components/layout/mobile-menu-sheet.d.ts +7 -0
- package/dist/components/layout/mobile-menu-sheet.js +159 -0
- package/dist/components/layout/side-panel.d.ts +50 -0
- package/dist/components/layout/side-panel.js +115 -0
- package/dist/components/layout/sidebar.d.ts +12 -0
- package/dist/components/layout/sidebar.js +542 -0
- package/dist/components/layout/top-header.d.ts +8 -0
- package/dist/components/layout/top-header.js +234 -0
- package/dist/components/layout/userprofile-dropdown.d.ts +1 -0
- package/dist/components/layout/userprofile-dropdown.js +97 -0
- package/dist/components/master/editable-cells/EditableCell.d.ts +43 -0
- package/dist/components/master/editable-cells/EditableCell.js +66 -0
- package/dist/components/master/editable-cells/index.d.ts +9 -0
- package/dist/components/master/editable-cells/index.js +10 -0
- package/dist/components/master/index.d.ts +1 -0
- package/dist/components/master/index.js +3 -0
- package/dist/components/messaging/conversation-list.d.ts +13 -0
- package/dist/components/messaging/conversation-list.js +103 -0
- package/dist/components/messaging/create-conversation-modal.d.ts +9 -0
- package/dist/components/messaging/create-conversation-modal.js +109 -0
- package/dist/components/messaging/message-bubble.d.ts +15 -0
- package/dist/components/messaging/message-bubble.js +66 -0
- package/dist/components/messaging/message-input.d.ts +17 -0
- package/dist/components/messaging/message-input.js +151 -0
- package/dist/components/messaging/message-thread.d.ts +10 -0
- package/dist/components/messaging/message-thread.js +121 -0
- package/dist/components/messaging/messaging-panel-content.d.ts +5 -0
- package/dist/components/messaging/messaging-panel-content.js +66 -0
- package/dist/components/messaging/thread-panel.d.ts +10 -0
- package/dist/components/messaging/thread-panel.js +47 -0
- package/dist/components/modals/3DModal.d.ts +39 -0
- package/dist/components/modals/3DModal.js +32 -0
- package/dist/components/modals/ImageModal.d.ts +28 -0
- package/dist/components/modals/ImageModal.js +551 -0
- package/dist/components/modals/Modal.d.ts +92 -0
- package/dist/components/modals/Modal.js +264 -0
- package/dist/components/modals/StandardModal.d.ts +27 -0
- package/dist/components/modals/StandardModal.js +25 -0
- package/dist/components/modals/api-config-modal.d.ts +7 -0
- package/dist/components/modals/api-config-modal.js +117 -0
- package/dist/components/modals/global-api-config-modal.d.ts +7 -0
- package/dist/components/modals/global-api-config-modal.js +124 -0
- package/dist/components/modals/index.d.ts +7 -0
- package/dist/components/modals/index.js +8 -0
- package/dist/components/modals/logout-modal.d.ts +32 -0
- package/dist/components/modals/logout-modal.js +42 -0
- package/dist/components/modals/modal-alert.d.ts +139 -0
- package/dist/components/modals/modal-alert.js +250 -0
- package/dist/components/modals/password-reset-modal.d.ts +11 -0
- package/dist/components/modals/password-reset-modal.js +109 -0
- package/dist/components/modals/session-expiry-warning.d.ts +12 -0
- package/dist/components/modals/session-expiry-warning.js +15 -0
- package/dist/components/providers/api-provider.d.ts +10 -0
- package/dist/components/providers/api-provider.js +15 -0
- package/dist/components/providers/query-provider.d.ts +3 -0
- package/dist/components/providers/query-provider.js +26 -0
- package/dist/components/providers/session-provider.d.ts +7 -0
- package/dist/components/providers/session-provider.js +116 -0
- package/dist/components/theme/ThemeCustomizer.d.ts +37 -0
- package/dist/components/theme/ThemeCustomizer.js +178 -0
- package/dist/components/ui/buttons/button.d.ts +59 -0
- package/dist/components/ui/buttons/button.js +228 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/card.js +17 -0
- package/dist/components/ui/chart.d.ts +83 -0
- package/dist/components/ui/chart.js +113 -0
- package/dist/components/ui/display/boolean-badge.d.ts +7 -0
- package/dist/components/ui/display/boolean-badge.js +23 -0
- package/dist/components/ui/display/card.d.ts +10 -0
- package/dist/components/ui/display/card.js +11 -0
- package/dist/components/ui/display/collapsible.d.ts +6 -0
- package/dist/components/ui/display/collapsible.js +6 -0
- package/dist/components/ui/display/separator.d.ts +4 -0
- package/dist/components/ui/display/separator.js +8 -0
- package/dist/components/ui/display/stats-card.d.ts +22 -0
- package/dist/components/ui/display/stats-card.js +25 -0
- package/dist/components/ui/display/text.d.ts +14 -0
- package/dist/components/ui/display/text.js +57 -0
- package/dist/components/ui/feedback/alert.d.ts +8 -0
- package/dist/components/ui/feedback/alert.js +23 -0
- package/dist/components/ui/feedback/badge.d.ts +49 -0
- package/dist/components/ui/feedback/badge.js +87 -0
- package/dist/components/ui/feedback/progress.d.ts +4 -0
- package/dist/components/ui/feedback/progress.js +8 -0
- package/dist/components/ui/feedback/reminder-button.d.ts +22 -0
- package/dist/components/ui/feedback/reminder-button.js +75 -0
- package/dist/components/ui/feedback/skeleton-table.d.ts +18 -0
- package/dist/components/ui/feedback/skeleton-table.js +17 -0
- package/dist/components/ui/feedback/skeleton.d.ts +53 -0
- package/dist/components/ui/feedback/skeleton.js +48 -0
- package/dist/components/ui/feedback/tooltip.d.ts +15 -0
- package/dist/components/ui/feedback/tooltip.js +14 -0
- package/dist/components/ui/form-toggle.d.ts +57 -0
- package/dist/components/ui/form-toggle.js +44 -0
- package/dist/components/ui/forms/checkbox.d.ts +6 -0
- package/dist/components/ui/forms/checkbox.js +17 -0
- package/dist/components/ui/forms/input.d.ts +18 -0
- package/dist/components/ui/forms/input.js +75 -0
- package/dist/components/ui/forms/label.d.ts +5 -0
- package/dist/components/ui/forms/label.js +6 -0
- package/dist/components/ui/forms/switch.d.ts +10 -0
- package/dist/components/ui/forms/switch.js +22 -0
- package/dist/components/ui/forms/textarea.d.ts +8 -0
- package/dist/components/ui/forms/textarea.js +13 -0
- package/dist/components/ui/index.d.ts +49 -0
- package/dist/components/ui/index.js +62 -0
- package/dist/components/ui/navigation/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/navigation/dropdown-menu.js +34 -0
- package/dist/components/ui/navigation/header-steps.d.ts +16 -0
- package/dist/components/ui/navigation/header-steps.js +15 -0
- package/dist/components/ui/navigation/tabs.d.ts +40 -0
- package/dist/components/ui/navigation/tabs.js +59 -0
- package/dist/components/ui/overlays/loading.d.ts +47 -0
- package/dist/components/ui/overlays/loading.js +131 -0
- package/dist/components/ui/select.d.ts +13 -0
- package/dist/components/ui/select.js +27 -0
- package/dist/config/api.d.ts +30 -0
- package/dist/config/api.js +58 -0
- package/dist/contexts/AppConfigContext.d.ts +13 -0
- package/dist/contexts/AppConfigContext.js +33 -0
- package/dist/contexts/CurrencyContext.d.ts +43 -0
- package/dist/contexts/CurrencyContext.js +331 -0
- package/dist/contexts/DeviceContext.d.ts +12 -0
- package/dist/contexts/DeviceContext.js +69 -0
- package/dist/contexts/EmailContext.d.ts +112 -0
- package/dist/contexts/EmailContext.js +720 -0
- package/dist/contexts/GlobalAlertContext.d.ts +67 -0
- package/dist/contexts/GlobalAlertContext.js +192 -0
- package/dist/contexts/ImpactAnalysisContext.d.ts +11 -0
- package/dist/contexts/ImpactAnalysisContext.js +23 -0
- package/dist/contexts/LanguageContext.d.ts +21 -0
- package/dist/contexts/LanguageContext.js +66 -0
- package/dist/contexts/MessagingContext.d.ts +70 -0
- package/dist/contexts/MessagingContext.js +722 -0
- package/dist/contexts/ModuleAuthContext.d.ts +42 -0
- package/dist/contexts/ModuleAuthContext.js +278 -0
- package/dist/contexts/NavigationContext.d.ts +26 -0
- package/dist/contexts/NavigationContext.js +143 -0
- package/dist/contexts/NetworkStatusContext.d.ts +18 -0
- package/dist/contexts/NetworkStatusContext.js +87 -0
- package/dist/contexts/NotificationContext.d.ts +47 -0
- package/dist/contexts/NotificationContext.js +165 -0
- package/dist/contexts/PageTitleContext.d.ts +11 -0
- package/dist/contexts/PageTitleContext.js +23 -0
- package/dist/contexts/SearchPreferencesContext.d.ts +11 -0
- package/dist/contexts/SearchPreferencesContext.js +38 -0
- package/dist/contexts/SessionAdapterContext.d.ts +39 -0
- package/dist/contexts/SessionAdapterContext.js +20 -0
- package/dist/contexts/SidebarPreferencesContext.d.ts +19 -0
- package/dist/contexts/SidebarPreferencesContext.js +112 -0
- package/dist/contexts/ThemeContext.d.ts +63 -0
- package/dist/contexts/ThemeContext.js +153 -0
- package/dist/hooks/index.d.ts +23 -0
- package/dist/hooks/index.js +18 -0
- package/dist/hooks/useApproval.d.ts +47 -0
- package/dist/hooks/useApproval.js +247 -0
- package/dist/hooks/useBacchaSearch.d.ts +57 -0
- package/dist/hooks/useBacchaSearch.js +254 -0
- package/dist/hooks/useBusinessAudit.d.ts +24 -0
- package/dist/hooks/useBusinessAudit.js +51 -0
- package/dist/hooks/useColumnFreezing.d.ts +85 -0
- package/dist/hooks/useColumnFreezing.js +201 -0
- package/dist/hooks/useColumnMetadata.d.ts +20 -0
- package/dist/hooks/useColumnMetadata.js +44 -0
- package/dist/hooks/useConditionalFormatting.d.ts +43 -0
- package/dist/hooks/useConditionalFormatting.js +193 -0
- package/dist/hooks/useDebounce.d.ts +14 -0
- package/dist/hooks/useDebounce.js +45 -0
- package/dist/hooks/useDraft.d.ts +46 -0
- package/dist/hooks/useDraft.js +178 -0
- package/dist/hooks/useFormValidation.d.ts +37 -0
- package/dist/hooks/useFormValidation.js +65 -0
- package/dist/hooks/useGridSettings.d.ts +26 -0
- package/dist/hooks/useGridSettings.js +82 -0
- package/dist/hooks/useGridTheme.d.ts +59 -0
- package/dist/hooks/useGridTheme.js +199 -0
- package/dist/hooks/useId.d.ts +2 -0
- package/dist/hooks/useId.js +17 -0
- package/dist/hooks/useIntelligentColumnSizing.d.ts +71 -0
- package/dist/hooks/useIntelligentColumnSizing.js +310 -0
- package/dist/hooks/useKeyboardNavigation.d.ts +33 -0
- package/dist/hooks/useKeyboardNavigation.js +189 -0
- package/dist/hooks/useNotifications.d.ts +7 -0
- package/dist/hooks/useNotifications.js +56 -0
- package/dist/hooks/usePrevious.d.ts +9 -0
- package/dist/hooks/usePrevious.js +17 -0
- package/dist/hooks/useRowSelection.d.ts +45 -0
- package/dist/hooks/useRowSelection.js +147 -0
- package/dist/hooks/useSignalR.d.ts +13 -0
- package/dist/hooks/useSignalR.js +50 -0
- package/dist/hooks/useTheme.d.ts +59 -0
- package/dist/hooks/useTheme.js +261 -0
- package/dist/hooks/useTranslation.d.ts +5 -0
- package/dist/hooks/useTranslation.js +17 -0
- package/dist/hooks/useUnsavedChanges.d.ts +40 -0
- package/dist/hooks/useUnsavedChanges.js +83 -0
- package/dist/index.d.ts +2 -3173
- package/dist/index.js +4 -25937
- package/dist/lib/api/activity/audit/audit.d.ts +34 -0
- package/dist/lib/api/activity/audit/audit.js +44 -0
- package/dist/lib/api/activity/audit/index.d.ts +6 -0
- package/dist/lib/api/activity/audit/index.js +7 -0
- package/dist/lib/api/activity/audit/send.d.ts +152 -0
- package/dist/lib/api/activity/audit/send.js +403 -0
- package/dist/lib/api/activity/email/client.d.ts +167 -0
- package/dist/lib/api/activity/email/client.js +455 -0
- package/dist/lib/api/activity/email/index.d.ts +7 -0
- package/dist/lib/api/activity/email/index.js +10 -0
- package/dist/lib/api/activity/email/password-reset.d.ts +8 -0
- package/dist/lib/api/activity/email/password-reset.js +55 -0
- package/dist/lib/api/activity/email/templates.d.ts +10 -0
- package/dist/lib/api/activity/email/templates.js +531 -0
- package/dist/lib/api/activity/email/types.d.ts +237 -0
- package/dist/lib/api/activity/email/types.js +21 -0
- package/dist/lib/api/activity/index.d.ts +12 -0
- package/dist/lib/api/activity/index.js +15 -0
- package/dist/lib/api/activity/messaging/messaging.d.ts +149 -0
- package/dist/lib/api/activity/messaging/messaging.js +245 -0
- package/dist/lib/api/activity/notifications/index.d.ts +9 -0
- package/dist/lib/api/activity/notifications/index.js +9 -0
- package/dist/lib/api/activity/notifications/notifications.d.ts +59 -0
- package/dist/lib/api/activity/notifications/notifications.js +218 -0
- package/dist/lib/api/activity/notifications/reminders.d.ts +35 -0
- package/dist/lib/api/activity/notifications/reminders.js +25 -0
- package/dist/lib/api/activity/notifications/send.d.ts +122 -0
- package/dist/lib/api/activity/notifications/send.js +252 -0
- package/dist/lib/api/activity/notifications/types.d.ts +119 -0
- package/dist/lib/api/activity/notifications/types.js +62 -0
- package/dist/lib/api/activity/notify-and-log.d.ts +50 -0
- package/dist/lib/api/activity/notify-and-log.js +60 -0
- package/dist/lib/api/activity/remarks/index.d.ts +2 -0
- package/dist/lib/api/activity/remarks/index.js +2 -0
- package/dist/lib/api/activity/remarks/remarks.d.ts +83 -0
- package/dist/lib/api/activity/remarks/remarks.js +179 -0
- package/dist/lib/api/activity/storage.d.ts +28 -0
- package/dist/lib/api/activity/storage.js +79 -0
- package/dist/lib/api/ai/chat.d.ts +67 -0
- package/dist/lib/api/ai/chat.js +212 -0
- package/dist/lib/api/ai/types.d.ts +69 -0
- package/dist/lib/api/ai/types.js +5 -0
- package/dist/lib/api/approval/approvals.d.ts +66 -0
- package/dist/lib/api/approval/approvals.js +205 -0
- package/dist/lib/api/approval/index.d.ts +5 -0
- package/dist/lib/api/approval/index.js +6 -0
- package/dist/lib/api/auth/auth.d.ts +12 -0
- package/dist/lib/api/auth/auth.js +148 -0
- package/dist/lib/api/auth/index.d.ts +1 -0
- package/dist/lib/api/auth/index.js +4 -0
- package/dist/lib/api/auth/password-reset-otp.d.ts +49 -0
- package/dist/lib/api/auth/password-reset-otp.js +185 -0
- package/dist/lib/api/auth/two-factor-auth.d.ts +55 -0
- package/dist/lib/api/auth/two-factor-auth.js +84 -0
- package/dist/lib/api/auth/two-factor.d.ts +41 -0
- package/dist/lib/api/auth/two-factor.js +180 -0
- package/dist/lib/api/core/auth-helpers.d.ts +13 -0
- package/dist/lib/api/core/auth-helpers.js +137 -0
- package/dist/lib/api/core/client.d.ts +37 -0
- package/dist/lib/api/core/client.js +301 -0
- package/dist/lib/api/core/config.d.ts +46 -0
- package/dist/lib/api/core/config.js +238 -0
- package/dist/lib/api/core/index.d.ts +6 -0
- package/dist/lib/api/core/index.js +11 -0
- package/dist/lib/api/core/session-validator.d.ts +55 -0
- package/dist/lib/api/core/session-validator.js +94 -0
- package/dist/lib/api/core/types.d.ts +192 -0
- package/dist/lib/api/core/types.js +3 -0
- package/dist/lib/api/core/utils.d.ts +15 -0
- package/dist/lib/api/core/utils.js +64 -0
- package/dist/lib/api/dashboard/costing.d.ts +129 -0
- package/dist/lib/api/dashboard/costing.js +8 -0
- package/dist/lib/api/dashboard/management.d.ts +91 -0
- package/dist/lib/api/dashboard/management.js +5 -0
- package/dist/lib/api/dashboard/sales.d.ts +87 -0
- package/dist/lib/api/dashboard/sales.js +5 -0
- package/dist/lib/api/draft/drafts.d.ts +49 -0
- package/dist/lib/api/draft/drafts.js +274 -0
- package/dist/lib/api/draft/index.d.ts +5 -0
- package/dist/lib/api/draft/index.js +6 -0
- package/dist/lib/api/enquiry/enquiry.d.ts +324 -0
- package/dist/lib/api/enquiry/enquiry.js +617 -0
- package/dist/lib/api/enquiry/index.d.ts +2 -0
- package/dist/lib/api/enquiry/index.js +4 -0
- package/dist/lib/api/enquiry/rate-enquiry.d.ts +97 -0
- package/dist/lib/api/enquiry/rate-enquiry.js +69 -0
- package/dist/lib/api/estimation/categories.d.ts +28 -0
- package/dist/lib/api/estimation/categories.js +104 -0
- package/dist/lib/api/estimation/category-defaults.d.ts +56 -0
- package/dist/lib/api/estimation/category-defaults.js +41 -0
- package/dist/lib/api/estimation/company-config.d.ts +59 -0
- package/dist/lib/api/estimation/company-config.js +19 -0
- package/dist/lib/api/estimation/content.d.ts +103 -0
- package/dist/lib/api/estimation/content.js +203 -0
- package/dist/lib/api/estimation/freight.d.ts +34 -0
- package/dist/lib/api/estimation/freight.js +18 -0
- package/dist/lib/api/estimation/grid-costing-drafts.d.ts +38 -0
- package/dist/lib/api/estimation/grid-costing-drafts.js +21 -0
- package/dist/lib/api/estimation/grid-costing.d.ts +353 -0
- package/dist/lib/api/estimation/grid-costing.js +126 -0
- package/dist/lib/api/estimation/index.d.ts +10 -0
- package/dist/lib/api/estimation/index.js +22 -0
- package/dist/lib/api/estimation/legacy-costing.d.ts +42 -0
- package/dist/lib/api/estimation/legacy-costing.js +46 -0
- package/dist/lib/api/estimation/machines.d.ts +32 -0
- package/dist/lib/api/estimation/machines.js +67 -0
- package/dist/lib/api/estimation/planning.d.ts +479 -0
- package/dist/lib/api/estimation/planning.js +385 -0
- package/dist/lib/api/estimation/qualities.d.ts +128 -0
- package/dist/lib/api/estimation/qualities.js +229 -0
- package/dist/lib/api/estimation/quotation-load.d.ts +30 -0
- package/dist/lib/api/estimation/quotation-load.js +46 -0
- package/dist/lib/api/estimation/quotation-save.d.ts +88 -0
- package/dist/lib/api/estimation/quotation-save.js +101 -0
- package/dist/lib/api/estimation/quote-check.d.ts +19 -0
- package/dist/lib/api/estimation/quote-check.js +28 -0
- package/dist/lib/api/estimation/quotepanel.d.ts +304 -0
- package/dist/lib/api/estimation/quotepanel.js +489 -0
- package/dist/lib/api/estimation/shipper-planning.d.ts +71 -0
- package/dist/lib/api/estimation/shipper-planning.js +208 -0
- package/dist/lib/api/estimation/wastage.d.ts +40 -0
- package/dist/lib/api/estimation/wastage.js +40 -0
- package/dist/lib/api/index.d.ts +7 -0
- package/dist/lib/api/index.js +17 -0
- package/dist/lib/api/integration/proxy.d.ts +7 -0
- package/dist/lib/api/integration/proxy.js +34 -0
- package/dist/lib/api/master/category.d.ts +126 -0
- package/dist/lib/api/master/category.js +208 -0
- package/dist/lib/api/master/company.d.ts +167 -0
- package/dist/lib/api/master/company.js +368 -0
- package/dist/lib/api/master/hsn.d.ts +36 -0
- package/dist/lib/api/master/hsn.js +54 -0
- package/dist/lib/api/master/index.d.ts +12 -0
- package/dist/lib/api/master/index.js +27 -0
- package/dist/lib/api/master/item.d.ts +158 -0
- package/dist/lib/api/master/item.js +135 -0
- package/dist/lib/api/master/ledger.d.ts +173 -0
- package/dist/lib/api/master/ledger.js +391 -0
- package/dist/lib/api/master/logistics.d.ts +117 -0
- package/dist/lib/api/master/logistics.js +107 -0
- package/dist/lib/api/master/machine.d.ts +406 -0
- package/dist/lib/api/master/machine.js +570 -0
- package/dist/lib/api/master/material-group.d.ts +97 -0
- package/dist/lib/api/master/material-group.js +96 -0
- package/dist/lib/api/master/other.d.ts +65 -0
- package/dist/lib/api/master/other.js +56 -0
- package/dist/lib/api/master/process-types.d.ts +178 -0
- package/dist/lib/api/master/process-types.js +4 -0
- package/dist/lib/api/master/process.d.ts +94 -0
- package/dist/lib/api/master/process.js +124 -0
- package/dist/lib/api/master/production-units.d.ts +10 -0
- package/dist/lib/api/master/production-units.js +15 -0
- package/dist/lib/api/master/rate.d.ts +174 -0
- package/dist/lib/api/master/rate.js +196 -0
- package/dist/lib/api/master/tool.d.ts +48 -0
- package/dist/lib/api/master/tool.js +80 -0
- package/dist/lib/api/master/user.d.ts +473 -0
- package/dist/lib/api/master/user.js +147 -0
- package/dist/lib/api/settings/erp-parameters.d.ts +33 -0
- package/dist/lib/api/settings/erp-parameters.js +61 -0
- package/dist/lib/api/utility/index.d.ts +1 -0
- package/dist/lib/api/utility/index.js +5 -0
- package/dist/lib/api/utility/menu.d.ts +32 -0
- package/dist/lib/api/utility/menu.js +128 -0
- package/dist/lib/auth.d.ts +3 -0
- package/dist/lib/auth.js +7 -0
- package/dist/lib/pwa.d.ts +8 -0
- package/dist/lib/pwa.js +53 -0
- package/dist/lib/react-query-config.d.ts +140 -0
- package/dist/lib/react-query-config.js +131 -0
- package/dist/lib/security/audit-logger.d.ts +71 -0
- package/dist/lib/security/audit-logger.js +173 -0
- package/dist/lib/security/rate-limiter.d.ts +28 -0
- package/dist/lib/security/rate-limiter.js +118 -0
- package/dist/lib/server-url.d.ts +18 -0
- package/dist/lib/server-url.js +70 -0
- package/dist/lib/svg-utils.d.ts +62 -0
- package/dist/lib/svg-utils.js +206 -0
- package/dist/lib/theme/types.d.ts +109 -0
- package/dist/lib/theme/types.js +231 -0
- package/dist/lib/theme/utils.d.ts +73 -0
- package/dist/lib/theme/utils.js +343 -0
- package/dist/lib/types/index.d.ts +58 -0
- package/dist/lib/types/index.js +2 -0
- package/dist/lib/utils/attachment-loader.d.ts +27 -0
- package/dist/lib/utils/attachment-loader.js +79 -0
- package/dist/lib/utils/client-lead-utils.d.ts +24 -0
- package/dist/lib/utils/client-lead-utils.js +56 -0
- package/dist/lib/utils/device-detection.d.ts +19 -0
- package/dist/lib/utils/device-detection.js +105 -0
- package/dist/lib/utils/logout-cleanup.d.ts +63 -0
- package/dist/lib/utils/logout-cleanup.js +297 -0
- package/dist/lib/utils/planning-prefs.d.ts +10 -0
- package/dist/lib/utils/planning-prefs.js +27 -0
- package/dist/lib/utils.d.ts +20 -0
- package/dist/lib/utils.js +60 -0
- package/dist/lib/vision/dieline-extractor.d.ts +38 -0
- package/dist/lib/vision/dieline-extractor.js +313 -0
- package/dist/lib/vision/reference-grid.d.ts +52 -0
- package/dist/lib/vision/reference-grid.js +241 -0
- package/dist/locales/de.json +79 -0
- package/dist/locales/en.json +2217 -0
- package/dist/locales/es.json +79 -0
- package/dist/locales/fr.json +78 -0
- package/dist/locales/hi.json +1599 -0
- package/dist/providers.d.ts +14 -0
- package/dist/providers.js +15 -0
- package/dist/services/GlobalLoadingService.d.ts +216 -0
- package/dist/services/GlobalLoadingService.js +216 -0
- package/dist/styles/grid-themes.css +346 -0
- package/dist/styles/index.css +5 -0
- package/dist/{sidebar-scrollbar-NBCB2OO2.css → styles/sidebar-scrollbar.css} +45 -45
- package/dist/styles/tokens.css +713 -0
- package/dist/types/approval.d.ts +201 -0
- package/dist/types/approval.js +19 -0
- package/dist/types/audit.d.ts +87 -0
- package/dist/types/audit.js +47 -0
- package/dist/types/draft.d.ts +142 -0
- package/dist/types/draft.js +19 -0
- package/dist/types/master.d.ts +154 -0
- package/dist/types/master.js +3 -0
- package/dist/types/shipper-planning.d.ts +277 -0
- package/dist/types/shipper-planning.js +6 -0
- package/package.json +182 -119
- package/dist/chunk-4PEFU7N7.js +0 -16
- package/dist/chunk-4PEFU7N7.js.map +0 -1
- package/dist/de-EKT7SUK5.js +0 -106
- package/dist/de-EKT7SUK5.js.map +0 -1
- package/dist/en-QRFSIEHD.js +0 -1685
- package/dist/en-QRFSIEHD.js.map +0 -1
- package/dist/es-KHZMWGUI.js +0 -106
- package/dist/es-KHZMWGUI.js.map +0 -1
- package/dist/fr-X2XUXSHK.js +0 -105
- package/dist/fr-X2XUXSHK.js.map +0 -1
- package/dist/hi-YRATOE5Q.js +0 -415
- package/dist/hi-YRATOE5Q.js.map +0 -1
- package/dist/index.cjs +0 -28216
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -3173
- package/dist/index.js.map +0 -1
- /package/{src → dist/cjs}/styles/index.css +0 -0
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Vision LLM dieline extractor — reads L/W/H + content type from a dieline image.
|
|
5
|
+
*
|
|
6
|
+
* Two-pass extraction grounded in real keyline geometry:
|
|
7
|
+
* Pass 1 (triage): user image + composite reference grid of all known
|
|
8
|
+
* content-type keylines → model returns top-5 candidates
|
|
9
|
+
* + L/W/H read from the user's labels.
|
|
10
|
+
* Pass 2 (refine): user image + only the top-5 individual thumbnails →
|
|
11
|
+
* model picks the single best match with confidence.
|
|
12
|
+
*
|
|
13
|
+
* The reference grid is built once client-side from real DB keyline data
|
|
14
|
+
* (see reference-grid.ts), cached in IndexedDB. Per-type rendered thumbnails
|
|
15
|
+
* come from that same grid build, so pass 2 reuses already-rendered images.
|
|
16
|
+
*/
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.clearReferenceGridCache = void 0;
|
|
22
|
+
exports.extractDielineSpecs = extractDielineSpecs;
|
|
23
|
+
const client_1 = __importDefault(require("../api/core/client.js"));
|
|
24
|
+
const reference_grid_1 = require("./reference-grid.js");
|
|
25
|
+
/* ───────────────────── Prompts ───────────────────── */
|
|
26
|
+
const TRIAGE_SYSTEM_PROMPT = `You are a packaging-carton expert helping extract specifications from a dieline (keyline) image.
|
|
27
|
+
|
|
28
|
+
You will receive TWO images:
|
|
29
|
+
1. USER IMAGE — a dieline the user uploaded. It shows the flat unfolded carton with dimension labels in mm.
|
|
30
|
+
2. REFERENCE GRID — a labeled grid of all known carton TYPES, each drawn as a 2D keyline using identical reference dimensions. Treat this as ground truth for what each named type looks like.
|
|
31
|
+
|
|
32
|
+
## Dimension extraction approach
|
|
33
|
+
|
|
34
|
+
DO NOT try to figure out which label is L, W, or H based on the panel structure — visual judgment of which panel has a tuck flap vs dust ear is unreliable at small image scales.
|
|
35
|
+
|
|
36
|
+
Instead, read the dimension labels and report:
|
|
37
|
+
- The VERTICAL label (the one with a vertical double-headed arrow, measuring the central strip's height) → this is H.
|
|
38
|
+
- The two HORIZONTAL labels → report them BOTH, in order from LEFT TO RIGHT as they appear in the image. Call them horizontalLeft and horizontalRight.
|
|
39
|
+
|
|
40
|
+
The downstream pipeline will assign L vs W based on the matched content type's geometry. You only need to do accurate OCR of label values and their positions.
|
|
41
|
+
|
|
42
|
+
## Your job (pass 1 — triage)
|
|
43
|
+
1. Read every visible dimension label on the USER IMAGE.
|
|
44
|
+
2. Identify the vertical label (vertical arrow on the central strip) → H.
|
|
45
|
+
3. Identify the two horizontal labels → record their values AND their left/right order in the image.
|
|
46
|
+
4. Compare the USER IMAGE's overall shape (flap layout, dust ears, glue tab position, lock features) against EVERY tile in the REFERENCE GRID.
|
|
47
|
+
5. Return the FIVE most visually-similar reference types in ranked order.
|
|
48
|
+
|
|
49
|
+
## Output
|
|
50
|
+
Return STRICT JSON only, no prose, no markdown fences:
|
|
51
|
+
{
|
|
52
|
+
"H": number | null,
|
|
53
|
+
"horizontalLeft": number | null,
|
|
54
|
+
"horizontalRight": number | null,
|
|
55
|
+
"candidates": [string, string, string, string, string],
|
|
56
|
+
"notes": "short note on label readings and why these candidates"
|
|
57
|
+
}
|
|
58
|
+
Every value in candidates MUST be an exact label visible in the REFERENCE GRID.
|
|
59
|
+
horizontalLeft is the horizontal label nearest the LEFT side of the image (closer to the glue tab). horizontalRight is the one further right.`;
|
|
60
|
+
const REFINE_SYSTEM_PROMPT = `You are picking the SINGLE best matching carton type for a dieline image.
|
|
61
|
+
|
|
62
|
+
You will receive:
|
|
63
|
+
1. USER IMAGE — the dieline the user uploaded.
|
|
64
|
+
2. CANDIDATE THUMBNAILS — N labeled 2D keyline thumbnails of candidate types drawn with identical reference dimensions.
|
|
65
|
+
|
|
66
|
+
## How to compare (work through each step IN ORDER, do not skip)
|
|
67
|
+
|
|
68
|
+
Step 1 — TUCK FLAP DIRECTION (most discriminating feature)
|
|
69
|
+
Look at the top and bottom of the central panel strip in the USER IMAGE. Find the small rectangular tuck flaps.
|
|
70
|
+
• REVERSE TUCK (ReverseTuckIn, ReverseTuckAndTongue): the TOP tuck flap is on the OPPOSITE SIDE of the panel strip from the BOTTOM tuck flap. They point in opposite directions (one extends up from the left half of the strip, the other extends down from the right half — or vice versa).
|
|
71
|
+
• STRAIGHT TUCK (StandardStraightTuckIn, StandardStraightTuckInNested, StandardStraightTuckInHang, etc.): the TOP and BOTTOM tuck flaps are on the SAME SIDE — both extend from the same panels (both above the front panel, or both above the back panel).
|
|
72
|
+
Eliminate any candidate whose tuck direction disagrees with the USER IMAGE.
|
|
73
|
+
|
|
74
|
+
Step 2 — HANGING / SLOT FEATURES
|
|
75
|
+
Check for hanging-tab cutouts (small rectangular or shaped slots) at the top of the dieline:
|
|
76
|
+
• If the USER IMAGE has a hanging tab/slot → prefer types with "Hang" in the name.
|
|
77
|
+
• If the USER IMAGE has NO hanging tab → eliminate candidates with "Hang" in the name.
|
|
78
|
+
|
|
79
|
+
Step 3 — BOTTOM CONSTRUCTION
|
|
80
|
+
• Crash-lock cartons (CrashLockWithPasting, CrashLockWithoutPasting, CrashLockBottomTuckEndFoldingCarton): the bottom flaps are large interlocking trapezoidal shapes, not simple rectangles.
|
|
81
|
+
• Auto-bottom / web-locking: distinctive angled cuts.
|
|
82
|
+
• Plain tuck-in: simple rectangular bottom flap.
|
|
83
|
+
|
|
84
|
+
Step 4 — GLUE TAB & SPECIAL FEATURES
|
|
85
|
+
• Glue/pasting tab (PF) is the narrow strip on the FAR LEFT of every flat layout. Its presence is universal — not discriminating.
|
|
86
|
+
• Pizza / Cake / Gadget / FourCorner / SixCorner box types have distinctive non-rectangular outer shapes — only pick these if the USER IMAGE has clearly unusual geometry.
|
|
87
|
+
|
|
88
|
+
## After working through the steps
|
|
89
|
+
Pick the SINGLE candidate that survives all eliminations. If two candidates tie, prefer the simpler one (e.g. ReverseTuckIn over a "Nested" or "Tongue" variant unless those features are clearly present).
|
|
90
|
+
|
|
91
|
+
Return STRICT JSON only:
|
|
92
|
+
{
|
|
93
|
+
"contentType": string,
|
|
94
|
+
"confidence": "high" | "medium" | "low",
|
|
95
|
+
"reason": "one short sentence citing the tuck direction + any other discriminating feature you used"
|
|
96
|
+
}
|
|
97
|
+
contentType MUST be one of the candidate labels exactly.`;
|
|
98
|
+
function triageUserPrompt(types) {
|
|
99
|
+
return `The REFERENCE GRID contains these types (read the labels under each tile):
|
|
100
|
+
${types.map(t => `- ${t}`).join('\n')}
|
|
101
|
+
|
|
102
|
+
Extract L, W, H from the USER IMAGE labels, then return the 5 most visually-similar reference types.`;
|
|
103
|
+
}
|
|
104
|
+
function refineUserPrompt(candidates) {
|
|
105
|
+
return `Candidate types to choose from (in the thumbnails, in order):
|
|
106
|
+
${candidates.map((t, i) => `${i + 1}. ${t}`).join('\n')}
|
|
107
|
+
|
|
108
|
+
Pick the single best visual match for the USER IMAGE.`;
|
|
109
|
+
}
|
|
110
|
+
/* ───────────────────── File helpers ───────────────────── */
|
|
111
|
+
async function fileToBase64(file) {
|
|
112
|
+
const buf = await file.arrayBuffer();
|
|
113
|
+
const bytes = new Uint8Array(buf);
|
|
114
|
+
let binary = '';
|
|
115
|
+
const chunk = 0x8000;
|
|
116
|
+
for (let i = 0; i < bytes.length; i += chunk) {
|
|
117
|
+
binary += String.fromCharCode.apply(null, Array.from(bytes.subarray(i, i + chunk)));
|
|
118
|
+
}
|
|
119
|
+
return { data: btoa(binary), mediaType: file.type || 'image/png' };
|
|
120
|
+
}
|
|
121
|
+
function dataUrlToBase64(dataUrl) {
|
|
122
|
+
const m = dataUrl.match(/^data:([^;]+);base64,(.+)$/);
|
|
123
|
+
if (!m)
|
|
124
|
+
throw new Error('Invalid data URL');
|
|
125
|
+
return { mediaType: m[1], data: m[2] };
|
|
126
|
+
}
|
|
127
|
+
function parseJsonLoose(text) {
|
|
128
|
+
const trimmed = (text || '').trim();
|
|
129
|
+
try {
|
|
130
|
+
return JSON.parse(trimmed);
|
|
131
|
+
}
|
|
132
|
+
catch { }
|
|
133
|
+
const fence = trimmed.match(/```(?:json)?\s*([\s\S]*?)```/i);
|
|
134
|
+
if (fence) {
|
|
135
|
+
try {
|
|
136
|
+
return JSON.parse(fence[1].trim());
|
|
137
|
+
}
|
|
138
|
+
catch { }
|
|
139
|
+
}
|
|
140
|
+
const match = trimmed.match(/\{[\s\S]*\}/);
|
|
141
|
+
if (match) {
|
|
142
|
+
try {
|
|
143
|
+
return JSON.parse(match[0]);
|
|
144
|
+
}
|
|
145
|
+
catch { }
|
|
146
|
+
}
|
|
147
|
+
throw new Error(`Model did not return valid JSON. Raw: ${trimmed.slice(0, 200)}`);
|
|
148
|
+
}
|
|
149
|
+
function fuzzyMatchType(raw, allowed) {
|
|
150
|
+
if (!raw)
|
|
151
|
+
return null;
|
|
152
|
+
const exact = allowed.find(a => a === raw);
|
|
153
|
+
if (exact)
|
|
154
|
+
return exact;
|
|
155
|
+
const norm = (s) => s.toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
156
|
+
const target = norm(raw);
|
|
157
|
+
return allowed.find(a => norm(a) === target) || null;
|
|
158
|
+
}
|
|
159
|
+
async function callBackendVision(p) {
|
|
160
|
+
const resp = await client_1.default.post('/api/vision/extract-dieline', {
|
|
161
|
+
images: p.images,
|
|
162
|
+
systemPrompt: p.systemPrompt,
|
|
163
|
+
userPrompt: p.userPrompt,
|
|
164
|
+
}, p.session);
|
|
165
|
+
if (!resp.success)
|
|
166
|
+
throw new Error(resp.error || 'Backend vision call failed');
|
|
167
|
+
// Backend returns the model's raw text in resp.data.rawText so we can parse JSON ourselves.
|
|
168
|
+
const rawText = (resp.data && (resp.data.rawText || resp.data.RawText)) || '';
|
|
169
|
+
if (!rawText)
|
|
170
|
+
throw new Error('Backend returned no model text');
|
|
171
|
+
return parseJsonLoose(rawText);
|
|
172
|
+
}
|
|
173
|
+
/* ───────────────────── Claude direct dispatch (browser-direct) ───────────────────── */
|
|
174
|
+
async function callClaudeVision(p) {
|
|
175
|
+
const content = [];
|
|
176
|
+
for (const img of p.images) {
|
|
177
|
+
if (img.caption)
|
|
178
|
+
content.push({ type: 'text', text: img.caption });
|
|
179
|
+
content.push({ type: 'image', source: { type: 'base64', media_type: img.mediaType, data: img.base64 } });
|
|
180
|
+
}
|
|
181
|
+
content.push({ type: 'text', text: p.userPrompt });
|
|
182
|
+
const resp = await fetch('https://api.anthropic.com/v1/messages', {
|
|
183
|
+
method: 'POST',
|
|
184
|
+
headers: {
|
|
185
|
+
'Content-Type': 'application/json',
|
|
186
|
+
'x-api-key': p.apiKey,
|
|
187
|
+
'anthropic-version': '2023-06-01',
|
|
188
|
+
'anthropic-dangerous-direct-browser-access': 'true',
|
|
189
|
+
},
|
|
190
|
+
body: JSON.stringify({
|
|
191
|
+
model: 'claude-sonnet-4-6',
|
|
192
|
+
max_tokens: 2048,
|
|
193
|
+
system: p.systemPrompt,
|
|
194
|
+
messages: [{ role: 'user', content }],
|
|
195
|
+
}),
|
|
196
|
+
});
|
|
197
|
+
if (!resp.ok) {
|
|
198
|
+
const errText = await resp.text();
|
|
199
|
+
throw new Error(`Claude API ${resp.status}: ${errText.slice(0, 300)}`);
|
|
200
|
+
}
|
|
201
|
+
const json = await resp.json();
|
|
202
|
+
const text = json?.content?.[0]?.text;
|
|
203
|
+
if (!text)
|
|
204
|
+
throw new Error('Claude returned no text content');
|
|
205
|
+
return parseJsonLoose(text);
|
|
206
|
+
}
|
|
207
|
+
async function callVision(p, req) {
|
|
208
|
+
if (req.provider === 'claude') {
|
|
209
|
+
if (!req.apiKey)
|
|
210
|
+
throw new Error('Claude API key required for browser-direct mode');
|
|
211
|
+
return callClaudeVision({ ...p, apiKey: req.apiKey });
|
|
212
|
+
}
|
|
213
|
+
return callBackendVision(p);
|
|
214
|
+
}
|
|
215
|
+
/* ───────────────────── Two-pass orchestration ───────────────────── */
|
|
216
|
+
async function extractTwoPass(req, grid) {
|
|
217
|
+
const userImgRaw = await fileToBase64(req.file);
|
|
218
|
+
const gridImgRaw = dataUrlToBase64(grid.dataUrl);
|
|
219
|
+
const userImg = { base64: userImgRaw.data, mediaType: userImgRaw.mediaType };
|
|
220
|
+
const gridImg = { base64: gridImgRaw.data, mediaType: gridImgRaw.mediaType };
|
|
221
|
+
// Pass 1 — triage: user image + reference grid → top-5 candidates + L/W/H
|
|
222
|
+
const triage = await callVision({
|
|
223
|
+
images: [
|
|
224
|
+
{ ...userImg, caption: 'USER IMAGE — the dieline to extract specs from:' },
|
|
225
|
+
{ ...gridImg, caption: 'REFERENCE GRID — all known types, labeled. Match against these:' },
|
|
226
|
+
],
|
|
227
|
+
systemPrompt: TRIAGE_SYSTEM_PROMPT,
|
|
228
|
+
userPrompt: triageUserPrompt(req.contentTypes),
|
|
229
|
+
session: req.session,
|
|
230
|
+
}, req);
|
|
231
|
+
const rawCandidates = Array.isArray(triage.candidates) ? triage.candidates : [];
|
|
232
|
+
// Snap each candidate string to a real allow-list entry; drop anything we can't match.
|
|
233
|
+
const candidates = rawCandidates
|
|
234
|
+
.map(c => fuzzyMatchType(typeof c === 'string' ? c : null, req.contentTypes))
|
|
235
|
+
.filter((c) => !!c);
|
|
236
|
+
// Assign L/W from the horizontal labels by position. Convention from the
|
|
237
|
+
// keyline formulas (PF → L → W → L → W): the leftmost horizontal panel
|
|
238
|
+
// after the glue tab is L (front face); the next one is W (side wall).
|
|
239
|
+
// If the model returns horizontalLeft/horizontalRight, use them; otherwise
|
|
240
|
+
// fall back to legacy L/W keys for backwards compat with old prompts.
|
|
241
|
+
const horizontalLeft = numOrNull(triage.horizontalLeft);
|
|
242
|
+
const horizontalRight = numOrNull(triage.horizontalRight);
|
|
243
|
+
const L = horizontalLeft != null ? horizontalLeft : numOrNull(triage.L);
|
|
244
|
+
const W = horizontalRight != null ? horizontalRight : numOrNull(triage.W);
|
|
245
|
+
// If triage gave us nothing usable, return what we have without a final type.
|
|
246
|
+
if (candidates.length === 0) {
|
|
247
|
+
return {
|
|
248
|
+
L,
|
|
249
|
+
W,
|
|
250
|
+
H: numOrNull(triage.H),
|
|
251
|
+
contentType: null,
|
|
252
|
+
notes: (triage.notes || '') + ' [no usable candidates from triage]',
|
|
253
|
+
candidates: [],
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
// Pass 2 — refine: user image + only the candidate thumbnails
|
|
257
|
+
const candidateThumbs = candidates.map((c, i) => {
|
|
258
|
+
const dataUrl = grid.thumbs[c];
|
|
259
|
+
if (!dataUrl)
|
|
260
|
+
return null;
|
|
261
|
+
const { data, mediaType } = dataUrlToBase64(dataUrl);
|
|
262
|
+
return { base64: data, mediaType, caption: `Candidate ${i + 1}: ${c}` };
|
|
263
|
+
}).filter((x) => !!x);
|
|
264
|
+
let finalType = candidates[0]; // fallback if pass 2 fails
|
|
265
|
+
let confidence = 'low';
|
|
266
|
+
let reason = '';
|
|
267
|
+
try {
|
|
268
|
+
const refine = await callVision({
|
|
269
|
+
images: [
|
|
270
|
+
{ ...userImg, caption: 'USER IMAGE — pick which candidate visually matches:' },
|
|
271
|
+
...candidateThumbs,
|
|
272
|
+
],
|
|
273
|
+
systemPrompt: REFINE_SYSTEM_PROMPT,
|
|
274
|
+
userPrompt: refineUserPrompt(candidates),
|
|
275
|
+
session: req.session,
|
|
276
|
+
}, req);
|
|
277
|
+
const picked = fuzzyMatchType(typeof refine.contentType === 'string' ? refine.contentType : null, candidates);
|
|
278
|
+
if (picked)
|
|
279
|
+
finalType = picked;
|
|
280
|
+
if (typeof refine.confidence === 'string')
|
|
281
|
+
confidence = refine.confidence;
|
|
282
|
+
if (typeof refine.reason === 'string')
|
|
283
|
+
reason = refine.reason;
|
|
284
|
+
}
|
|
285
|
+
catch (e) {
|
|
286
|
+
// Pass 2 failure shouldn't kill the whole extraction — fall back to triage's #1.
|
|
287
|
+
reason = `Pass 2 failed: ${e?.message || e}. Using triage top candidate.`;
|
|
288
|
+
}
|
|
289
|
+
const triageNotes = typeof triage.notes === 'string' ? triage.notes : '';
|
|
290
|
+
const combinedNotes = [triageNotes, reason && `[match ${confidence}] ${reason}`]
|
|
291
|
+
.filter(Boolean).join(' · ');
|
|
292
|
+
return {
|
|
293
|
+
L,
|
|
294
|
+
W,
|
|
295
|
+
H: numOrNull(triage.H),
|
|
296
|
+
contentType: finalType,
|
|
297
|
+
notes: combinedNotes || undefined,
|
|
298
|
+
candidates,
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
function numOrNull(v) {
|
|
302
|
+
if (v === null || v === undefined)
|
|
303
|
+
return null;
|
|
304
|
+
const n = typeof v === 'string' ? parseFloat(v) : Number(v);
|
|
305
|
+
return Number.isFinite(n) ? n : null;
|
|
306
|
+
}
|
|
307
|
+
/* ───────────────────── Public entry ───────────────────── */
|
|
308
|
+
async function extractDielineSpecs(req) {
|
|
309
|
+
if (!req.file)
|
|
310
|
+
throw new Error('No image provided');
|
|
311
|
+
if (!req.contentTypes?.length)
|
|
312
|
+
throw new Error('contentTypes allow-list is empty');
|
|
313
|
+
if (!req.session)
|
|
314
|
+
throw new Error('Session is required (used for keyline fetch and backend call)');
|
|
315
|
+
// Build (or hit cache for) the reference grid. This is the slow path on first run.
|
|
316
|
+
const grid = await (0, reference_grid_1.getReferenceGrid)(req.contentTypes, req.grain || 'With Grain', req.session);
|
|
317
|
+
return extractTwoPass(req, grid);
|
|
318
|
+
}
|
|
319
|
+
/** Re-export so the UI can offer a "rebuild reference grid" button. */
|
|
320
|
+
var reference_grid_2 = require("./reference-grid.js");
|
|
321
|
+
Object.defineProperty(exports, "clearReferenceGridCache", { enumerable: true, get: function () { return reference_grid_2.clearReferenceGridCache; } });
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Builds a composite "reference grid" image of all content-type keylines so
|
|
5
|
+
* the LLM can pick by visual match against ground truth rather than guessing
|
|
6
|
+
* from training-data memory.
|
|
7
|
+
*
|
|
8
|
+
* Strategy:
|
|
9
|
+
* 1. Fetch keyline-coordinate rows for every content type in parallel
|
|
10
|
+
* 2. Evaluate each row's formulas with a fixed reference Dims so panel
|
|
11
|
+
* proportions are comparable across types
|
|
12
|
+
* 3. Render each type's segments to an offscreen canvas tile
|
|
13
|
+
* 4. Pack the tiles into one labeled grid PNG
|
|
14
|
+
*
|
|
15
|
+
* Caching:
|
|
16
|
+
* - The grid is deterministic given (types[], referenceDims). We hash those
|
|
17
|
+
* and store the resulting PNG (+ tile metadata) in IndexedDB.
|
|
18
|
+
* - Stale entries are auto-evicted when the hash changes (e.g. user adds a
|
|
19
|
+
* new content type).
|
|
20
|
+
*
|
|
21
|
+
* The cached grid is reused across every Extract call — generated once per
|
|
22
|
+
* type-list change, never recomputed unnecessarily.
|
|
23
|
+
*/
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.getReferenceGrid = getReferenceGrid;
|
|
26
|
+
exports.clearReferenceGridCache = clearReferenceGridCache;
|
|
27
|
+
const keyline3D_1 = require("@/app/(main)/costing/estimation/components/keyline3D");
|
|
28
|
+
const planning_1 = require("../api/estimation/planning.js");
|
|
29
|
+
// Reference dimensions chosen so L, W, H are all visually distinct on every
|
|
30
|
+
// type's panel layout. Don't change these without bumping the cache key.
|
|
31
|
+
const REFERENCE_DIMS = {
|
|
32
|
+
L: 200, W: 100, H: 150,
|
|
33
|
+
OF: 30, PF: 12, BF: 30, FH: 25, TH: 20,
|
|
34
|
+
};
|
|
35
|
+
const TILE_SIZE = 400; // each thumbnail is TILE_SIZE × TILE_SIZE px — bigger so flap-tuck direction is visible
|
|
36
|
+
const LABEL_HEIGHT = 28; // pixels for the type name underneath
|
|
37
|
+
const GRID_COLS = 6; // columns in the composite
|
|
38
|
+
const TILE_PADDING = 8; // pixels between tiles
|
|
39
|
+
const IDB_NAME = 'vision-reference-cache';
|
|
40
|
+
const IDB_STORE = 'grids';
|
|
41
|
+
/* ───────────────────────── IndexedDB helpers ───────────────────────── */
|
|
42
|
+
function openDb() {
|
|
43
|
+
return new Promise((resolve, reject) => {
|
|
44
|
+
const req = indexedDB.open(IDB_NAME, 1);
|
|
45
|
+
req.onupgradeneeded = () => {
|
|
46
|
+
const db = req.result;
|
|
47
|
+
if (!db.objectStoreNames.contains(IDB_STORE))
|
|
48
|
+
db.createObjectStore(IDB_STORE);
|
|
49
|
+
};
|
|
50
|
+
req.onsuccess = () => resolve(req.result);
|
|
51
|
+
req.onerror = () => reject(req.error);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
async function idbGet(key) {
|
|
55
|
+
try {
|
|
56
|
+
const db = await openDb();
|
|
57
|
+
return await new Promise((resolve, reject) => {
|
|
58
|
+
const tx = db.transaction(IDB_STORE, 'readonly');
|
|
59
|
+
const req = tx.objectStore(IDB_STORE).get(key);
|
|
60
|
+
req.onsuccess = () => resolve(req.result || null);
|
|
61
|
+
req.onerror = () => reject(req.error);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
async function idbSet(key, value) {
|
|
69
|
+
try {
|
|
70
|
+
const db = await openDb();
|
|
71
|
+
await new Promise((resolve, reject) => {
|
|
72
|
+
const tx = db.transaction(IDB_STORE, 'readwrite');
|
|
73
|
+
tx.objectStore(IDB_STORE).put(value, key);
|
|
74
|
+
tx.oncomplete = () => resolve();
|
|
75
|
+
tx.onerror = () => reject(tx.error);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// Best-effort caching — if IndexedDB fails (private mode etc.) we just regenerate next time.
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/* ───────────────────────── Hash (cache key) ───────────────────────── */
|
|
83
|
+
async function hashInputs(types, dims) {
|
|
84
|
+
// Tile config is part of the cache key so changes invalidate stale grids
|
|
85
|
+
// automatically without needing a manual "clear cache" action.
|
|
86
|
+
const payload = JSON.stringify({
|
|
87
|
+
types: [...types].sort(),
|
|
88
|
+
dims,
|
|
89
|
+
tile: { size: TILE_SIZE, label: LABEL_HEIGHT, cols: GRID_COLS, pad: TILE_PADDING },
|
|
90
|
+
});
|
|
91
|
+
const buf = new TextEncoder().encode(payload);
|
|
92
|
+
const digest = await crypto.subtle.digest('SHA-256', buf);
|
|
93
|
+
return Array.from(new Uint8Array(digest)).map(b => b.toString(16).padStart(2, '0')).join('').slice(0, 16);
|
|
94
|
+
}
|
|
95
|
+
/* ───────────────────────── Tile renderer ───────────────────────── */
|
|
96
|
+
function renderTileToCanvas(segments, label) {
|
|
97
|
+
const canvas = document.createElement('canvas');
|
|
98
|
+
canvas.width = TILE_SIZE;
|
|
99
|
+
canvas.height = TILE_SIZE + LABEL_HEIGHT;
|
|
100
|
+
const ctx = canvas.getContext('2d');
|
|
101
|
+
// White background so the LLM sees high contrast.
|
|
102
|
+
ctx.fillStyle = '#ffffff';
|
|
103
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
104
|
+
// Label at the bottom — type name, monospace, dark.
|
|
105
|
+
ctx.fillStyle = '#111111';
|
|
106
|
+
ctx.font = 'bold 11px monospace';
|
|
107
|
+
ctx.textAlign = 'center';
|
|
108
|
+
ctx.textBaseline = 'middle';
|
|
109
|
+
ctx.fillText(label, TILE_SIZE / 2, TILE_SIZE + LABEL_HEIGHT / 2, TILE_SIZE - 4);
|
|
110
|
+
if (segments.length === 0) {
|
|
111
|
+
ctx.fillStyle = '#999999';
|
|
112
|
+
ctx.font = '12px sans-serif';
|
|
113
|
+
ctx.fillText('(no keyline)', TILE_SIZE / 2, TILE_SIZE / 2);
|
|
114
|
+
return canvas;
|
|
115
|
+
}
|
|
116
|
+
// Compute bbox of all segment endpoints so we can scale-to-fit.
|
|
117
|
+
let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
|
|
118
|
+
for (const s of segments) {
|
|
119
|
+
minX = Math.min(minX, s.x1, s.x2);
|
|
120
|
+
minY = Math.min(minY, s.y1, s.y2);
|
|
121
|
+
maxX = Math.max(maxX, s.x1, s.x2);
|
|
122
|
+
maxY = Math.max(maxY, s.y1, s.y2);
|
|
123
|
+
}
|
|
124
|
+
const w = maxX - minX, h = maxY - minY;
|
|
125
|
+
if (w <= 0 || h <= 0)
|
|
126
|
+
return canvas;
|
|
127
|
+
const pad = 8;
|
|
128
|
+
const scale = Math.min((TILE_SIZE - 2 * pad) / w, (TILE_SIZE - 2 * pad) / h);
|
|
129
|
+
const offsetX = (TILE_SIZE - w * scale) / 2 - minX * scale;
|
|
130
|
+
const offsetY = (TILE_SIZE - h * scale) / 2 - minY * scale;
|
|
131
|
+
const tx = (x) => x * scale + offsetX;
|
|
132
|
+
const ty = (y) => y * scale + offsetY;
|
|
133
|
+
ctx.lineWidth = 1.2;
|
|
134
|
+
for (const s of segments) {
|
|
135
|
+
const isCurve = s.shape === 'Curve';
|
|
136
|
+
const isCircle = s.shape === 'Circle';
|
|
137
|
+
ctx.strokeStyle = isCurve || isCircle ? '#dc2626' : (s.isDashed ? '#2563eb' : '#111111');
|
|
138
|
+
ctx.setLineDash(s.isDashed ? [4, 3] : []);
|
|
139
|
+
ctx.beginPath();
|
|
140
|
+
if (isCurve) {
|
|
141
|
+
ctx.moveTo(tx(s.x1), ty(s.y1));
|
|
142
|
+
ctx.quadraticCurveTo(tx(s.x1), ty(s.y2), tx(s.x2), ty(s.y2));
|
|
143
|
+
}
|
|
144
|
+
else if (isCircle) {
|
|
145
|
+
const r = Math.sqrt((s.x2 - s.x1) ** 2 + (s.y2 - s.y1) ** 2) / 2 * scale;
|
|
146
|
+
ctx.moveTo(tx(s.x1), ty(s.y1));
|
|
147
|
+
ctx.arc(tx((s.x1 + s.x2) / 2), ty((s.y1 + s.y2) / 2), r, 0, Math.PI * 2);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
ctx.moveTo(tx(s.x1), ty(s.y1));
|
|
151
|
+
ctx.lineTo(tx(s.x2), ty(s.y2));
|
|
152
|
+
}
|
|
153
|
+
ctx.stroke();
|
|
154
|
+
}
|
|
155
|
+
return canvas;
|
|
156
|
+
}
|
|
157
|
+
/* ───────────────────────── Composite assembler ───────────────────────── */
|
|
158
|
+
function compositeTiles(tiles) {
|
|
159
|
+
const rows = Math.ceil(tiles.length / GRID_COLS);
|
|
160
|
+
const tileTotalH = TILE_SIZE + LABEL_HEIGHT;
|
|
161
|
+
const compW = GRID_COLS * TILE_SIZE + (GRID_COLS + 1) * TILE_PADDING;
|
|
162
|
+
const compH = rows * tileTotalH + (rows + 1) * TILE_PADDING;
|
|
163
|
+
const canvas = document.createElement('canvas');
|
|
164
|
+
canvas.width = compW;
|
|
165
|
+
canvas.height = compH;
|
|
166
|
+
const ctx = canvas.getContext('2d');
|
|
167
|
+
// Light background so cell boundaries don't visually merge.
|
|
168
|
+
ctx.fillStyle = '#f3f4f6';
|
|
169
|
+
ctx.fillRect(0, 0, compW, compH);
|
|
170
|
+
const meta = [];
|
|
171
|
+
tiles.forEach((t, i) => {
|
|
172
|
+
const col = i % GRID_COLS;
|
|
173
|
+
const row = Math.floor(i / GRID_COLS);
|
|
174
|
+
const x = TILE_PADDING + col * (TILE_SIZE + TILE_PADDING);
|
|
175
|
+
const y = TILE_PADDING + row * (tileTotalH + TILE_PADDING);
|
|
176
|
+
// White card under each tile so the label area has contrast.
|
|
177
|
+
ctx.fillStyle = '#ffffff';
|
|
178
|
+
ctx.fillRect(x, y, TILE_SIZE, tileTotalH);
|
|
179
|
+
ctx.drawImage(t.canvas, x, y);
|
|
180
|
+
meta.push({ type: t.type, col, row, x, y });
|
|
181
|
+
});
|
|
182
|
+
return { canvas, meta };
|
|
183
|
+
}
|
|
184
|
+
/* ───────────────────────── Public API ───────────────────────── */
|
|
185
|
+
/**
|
|
186
|
+
* Get a reference grid for the given content types, building it if necessary.
|
|
187
|
+
* Fetches all keyline rows in parallel and renders the composite client-side.
|
|
188
|
+
*
|
|
189
|
+
* @param types Content type names (from the page's CONTENT_TYPE_OPTIONS)
|
|
190
|
+
* @param grain Grain orientation for the keyline fetch (usually 'With Grain')
|
|
191
|
+
* @param session NextAuth session for the keyline API calls
|
|
192
|
+
*/
|
|
193
|
+
async function getReferenceGrid(types, grain, session) {
|
|
194
|
+
const hash = await hashInputs(types, REFERENCE_DIMS);
|
|
195
|
+
const cached = await idbGet(hash);
|
|
196
|
+
if (cached)
|
|
197
|
+
return cached;
|
|
198
|
+
// Fetch all types in parallel — individual failures don't abort the build.
|
|
199
|
+
const fetched = await Promise.all(types.map(async (type) => {
|
|
200
|
+
try {
|
|
201
|
+
const resp = await planning_1.PlanWindowAPI.getKeylineCoordinates(type, grain, session);
|
|
202
|
+
if (resp.success && Array.isArray(resp.data) && resp.data.length > 0) {
|
|
203
|
+
return { type, rows: resp.data };
|
|
204
|
+
}
|
|
205
|
+
return { type, rows: [] };
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
return { type, rows: [] };
|
|
209
|
+
}
|
|
210
|
+
}));
|
|
211
|
+
// Render every type's tile; capture individual thumbs for pass-2 use.
|
|
212
|
+
const tileCanvases = [];
|
|
213
|
+
const thumbs = {};
|
|
214
|
+
for (const { type, rows } of fetched) {
|
|
215
|
+
let segments = [];
|
|
216
|
+
try {
|
|
217
|
+
segments = (0, keyline3D_1.rowsToSegments)(rows, REFERENCE_DIMS);
|
|
218
|
+
}
|
|
219
|
+
catch { /* leave empty */ }
|
|
220
|
+
const tile = renderTileToCanvas(segments, type);
|
|
221
|
+
tileCanvases.push({ type, canvas: tile });
|
|
222
|
+
thumbs[type] = tile.toDataURL('image/png');
|
|
223
|
+
}
|
|
224
|
+
const { canvas: comp, meta } = compositeTiles(tileCanvases);
|
|
225
|
+
const dataUrl = comp.toDataURL('image/png');
|
|
226
|
+
const base64 = dataUrl.split(',', 2)[1] || '';
|
|
227
|
+
const grid = { dataUrl, base64, tiles: meta, thumbs, hash };
|
|
228
|
+
await idbSet(hash, grid);
|
|
229
|
+
return grid;
|
|
230
|
+
}
|
|
231
|
+
/** Invalidate any cached grids — useful for a manual "rebuild reference" UI button. */
|
|
232
|
+
async function clearReferenceGridCache() {
|
|
233
|
+
try {
|
|
234
|
+
const db = await openDb();
|
|
235
|
+
await new Promise((resolve, reject) => {
|
|
236
|
+
const tx = db.transaction(IDB_STORE, 'readwrite');
|
|
237
|
+
tx.objectStore(IDB_STORE).clear();
|
|
238
|
+
tx.oncomplete = () => resolve();
|
|
239
|
+
tx.onerror = () => reject(tx.error);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
catch {
|
|
243
|
+
/* ignore */
|
|
244
|
+
}
|
|
245
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Sign in to your account": "Melden Sie sich bei Ihrem Konto an",
|
|
3
|
+
"Last login:": "Letzte Anmeldung:",
|
|
4
|
+
"Financial Year": "Geschäftsjahr",
|
|
5
|
+
"Company Code": "Firmencode",
|
|
6
|
+
"Enter your company code": "Geben Sie Ihren Firmencode ein",
|
|
7
|
+
"Username": "Benutzername",
|
|
8
|
+
"Enter your username": "Geben Sie Ihren Benutzernamen ein",
|
|
9
|
+
"Password": "Passwort",
|
|
10
|
+
"Enter your password": "Geben Sie Ihr Passwort ein",
|
|
11
|
+
"Remember me": "Angemeldet bleiben",
|
|
12
|
+
"or": "oder",
|
|
13
|
+
"Signing in...": "Anmelden...",
|
|
14
|
+
"Sign In": "Anmelden",
|
|
15
|
+
"Biometric Login": "Biometrische Anmeldung",
|
|
16
|
+
"Forgot Password?": "Passwort vergessen?",
|
|
17
|
+
"Password Recovery": "Passwortwiederherstellung",
|
|
18
|
+
"Password recovery functionality will be implemented in the next version. Please contact your system administrator for assistance.": "Die Funktion zur Passwortwiederherstellung wird in der nächsten Version implementiert. Bitte wenden Sie sich an Ihren Systemadministrator.",
|
|
19
|
+
"Invalid username or password": "Ungültiger Benutzername oder Passwort",
|
|
20
|
+
"An error occurred. Please try again.": "Ein Fehler ist aufgetreten. Bitte versuchen Sie es erneut.",
|
|
21
|
+
"Settings": "Einstellungen",
|
|
22
|
+
"Back": "Zurück",
|
|
23
|
+
"Profile": "Profil",
|
|
24
|
+
"Notifications": "Benachrichtigungen",
|
|
25
|
+
"Preferences": "Einstellungen",
|
|
26
|
+
"Profile Information": "Profilinformationen",
|
|
27
|
+
"Full Name": "Vollständiger Name",
|
|
28
|
+
"Enter your full name": "Geben Sie Ihren vollständigen Namen ein",
|
|
29
|
+
"Email Address": "E-Mail-Adresse",
|
|
30
|
+
"Enter your email": "Geben Sie Ihre E-Mail ein",
|
|
31
|
+
"Company": "Firma",
|
|
32
|
+
"Company name": "Firmenname",
|
|
33
|
+
"Role": "Rolle",
|
|
34
|
+
"Save Changes": "Änderungen speichern",
|
|
35
|
+
"Security Settings": "Sicherheitseinstellungen",
|
|
36
|
+
"Change Password": "Passwort ändern",
|
|
37
|
+
"Current password": "Aktuelles Passwort",
|
|
38
|
+
"New password": "Neues Passwort",
|
|
39
|
+
"Confirm new password": "Neues Passwort bestätigen",
|
|
40
|
+
"Two-Factor Authentication": "Zwei-Faktor-Authentifizierung",
|
|
41
|
+
"Add an extra layer of security to your account": "Fügen Sie Ihrem Konto eine zusätzliche Sicherheitsebene hinzu",
|
|
42
|
+
"Enable 2FA": "2FA aktivieren",
|
|
43
|
+
"Choose Profile Picture": "Profilbild wählen",
|
|
44
|
+
"Notification Preferences": "Benachrichtigungseinstellungen",
|
|
45
|
+
"Email Notifications": "E-Mail-Benachrichtigungen",
|
|
46
|
+
"Receive email updates about your account": "Erhalten Sie E-Mail-Updates zu Ihrem Konto",
|
|
47
|
+
"Push Notifications": "Push-Benachrichtigungen",
|
|
48
|
+
"Get push notifications in your browser": "Erhalten Sie Push-Benachrichtigungen in Ihrem Browser",
|
|
49
|
+
"System Updates": "Systemupdates",
|
|
50
|
+
"Notifications about system maintenance and updates": "Benachrichtigungen über Systemwartung und Updates",
|
|
51
|
+
"Search Style": "Suchstil",
|
|
52
|
+
"Choose your preferred search interface": "Wählen Sie Ihre bevorzugte Suchoberfläche",
|
|
53
|
+
"Advanced": "Erweitert",
|
|
54
|
+
"Full panel": "Vollständiges Panel",
|
|
55
|
+
"Modal": "Modal",
|
|
56
|
+
"Quick search": "Schnellsuche",
|
|
57
|
+
"No navigation items available": "Keine Navigationselemente verfügbar",
|
|
58
|
+
"Retry": "Erneut versuchen",
|
|
59
|
+
"Expand sidebar": "Seitenleiste erweitern",
|
|
60
|
+
"Collapse sidebar": "Seitenleiste einklappen",
|
|
61
|
+
"Estimo v3.0": "Estimo v3.0",
|
|
62
|
+
"Active": "Aktiv",
|
|
63
|
+
"Default Unit": "Standardeinheit",
|
|
64
|
+
"Select Unit": "Einheit wählen",
|
|
65
|
+
"Loading...": "Laden...",
|
|
66
|
+
"Hello": "Hallo",
|
|
67
|
+
"(Units unavailable)": "(Einheiten nicht verfügbar)",
|
|
68
|
+
"Search everything...": "Alles durchsuchen...",
|
|
69
|
+
"Search Modules": "Module suchen",
|
|
70
|
+
"No modules found for": "Keine Module gefunden für",
|
|
71
|
+
"Mark all as read": "Alle als gelesen markieren",
|
|
72
|
+
"View All Notifications": "Alle Benachrichtigungen anzeigen",
|
|
73
|
+
"No notifications in this category": "Keine Benachrichtigungen in dieser Kategorie",
|
|
74
|
+
"Pending": "Ausstehend",
|
|
75
|
+
"Escalations": "Eskalationen",
|
|
76
|
+
"Updates": "Updates",
|
|
77
|
+
"All": "Alle",
|
|
78
|
+
"Failed to load navigation menu": "Laden des Navigationsmenüs fehlgeschlagen"
|
|
79
|
+
}
|