@wakastellar/ui 4.0.1 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/_shared/identity/InviteUserPanel.cjs.js +1 -1
- package/dist/blocks/_shared/identity/RoleSelect.cjs.js +1 -1
- package/dist/blocks/_shared/identity/SidePushLayout.cjs.js +1 -1
- package/dist/blocks/activity-timeline/index.cjs.js +1 -1
- package/dist/blocks/activity-timeline/index.es.js +1 -1
- package/dist/blocks/antivirus-dashboard/index.cjs.js +1 -1
- package/dist/blocks/antivirus-dashboard/index.es.js +1 -1
- package/dist/blocks/api-keys-manager/index.cjs.js +1 -1
- package/dist/blocks/apm-overview/index.cjs.js +1 -1
- package/dist/blocks/auth-2fa/index.cjs.js +2 -2
- package/dist/blocks/auth-2fa/index.es.js +1 -1
- package/dist/blocks/avatar-upload/index.cjs.js +1 -1
- package/dist/blocks/avatar-upload/index.es.js +13 -13
- package/dist/blocks/calendar-view/index.cjs.js +1 -1
- package/dist/blocks/calendar-view/index.es.js +1 -1
- package/dist/blocks/chat/index.cjs.js +1 -1
- package/dist/blocks/chat/index.es.js +162 -162
- package/dist/blocks/chat/widget.cjs.js +1 -1
- package/dist/blocks/chat/widget.es.js +19 -13
- package/dist/blocks/chat-interface/index.cjs.js +1 -1
- package/dist/blocks/chat-interface/index.es.js +1 -1
- package/dist/blocks/checkout-flow/index.cjs.js +1 -1
- package/dist/blocks/checkout-flow/index.es.js +1 -1
- package/dist/blocks/cicd-builder/index.cjs.js +1 -1
- package/dist/blocks/clamav-service-status/index.cjs.js +1 -1
- package/dist/blocks/cloud-cost-dashboard/index.cjs.js +1 -1
- package/dist/blocks/container-orchestrator/index.cjs.js +1 -1
- package/dist/blocks/container-orchestrator/index.es.js +2 -1
- package/dist/blocks/dashboard/index.cjs.js +1 -1
- package/dist/blocks/dashboard/index.es.js +2 -2
- package/dist/blocks/dashboard-kpi/index.cjs.js +1 -1
- package/dist/blocks/dashboard-kpi/index.es.js +1 -1
- package/dist/blocks/database-admin/index.cjs.js +1 -1
- package/dist/blocks/deployment-dashboard/index.cjs.js +1 -1
- package/dist/blocks/deployment-dashboard/index.es.js +1 -1
- package/dist/blocks/empty-states/index.cjs.js +1 -1
- package/dist/blocks/empty-states/index.es.js +1 -1
- package/dist/blocks/error-pages/index.cjs.js +1 -1
- package/dist/blocks/error-pages/index.es.js +1 -1
- package/dist/blocks/faq/index.cjs.js +1 -1
- package/dist/blocks/faq/index.es.js +1 -1
- package/dist/blocks/file-manager/index.cjs.js +1 -1
- package/dist/blocks/file-manager/index.es.js +1 -1
- package/dist/blocks/file-scan-uploader/index.cjs.js +1 -1
- package/dist/blocks/file-scan-uploader/index.es.js +2 -2
- package/dist/blocks/footer/index.cjs.js +1 -1
- package/dist/blocks/gitops-sync-status/index.cjs.js +1 -1
- package/dist/blocks/header/index.cjs.js +1 -1
- package/dist/blocks/header/index.es.js +1 -1
- package/dist/blocks/headtab/index.cjs.js +1 -1
- package/dist/blocks/i18n-editor/index.cjs.js +1 -1
- package/dist/blocks/i18n-editor/index.es.js +127 -127
- package/dist/blocks/incident-manager/index.cjs.js +1 -1
- package/dist/blocks/infrastructure-map/index.cjs.js +1 -1
- package/dist/blocks/kanban-board/index.cjs.js +1 -1
- package/dist/blocks/kanban-board/index.es.js +1 -1
- package/dist/blocks/landing/index.cjs.js +1 -1
- package/dist/blocks/landing/index.es.js +1 -1
- package/dist/blocks/language-selector/index.cjs.js +1 -1
- package/dist/blocks/layout/index.cjs.js +1 -1
- package/dist/blocks/login/index.cjs.js +1 -1
- package/dist/blocks/on-call-schedule/index.cjs.js +1 -1
- package/dist/blocks/player-profile/index.cjs.js +1 -1
- package/dist/blocks/player-profile/index.es.js +1 -1
- package/dist/blocks/pricing/index.cjs.js +1 -1
- package/dist/blocks/pricing/index.es.js +1 -1
- package/dist/blocks/profile/index.cjs.js +1 -1
- package/dist/blocks/profile/index.es.js +1 -1
- package/dist/blocks/profile-list/index.cjs.js +1 -1
- package/dist/blocks/quarantine-manager/index.cjs.js +1 -1
- package/dist/blocks/quarantine-manager/index.es.js +1 -1
- package/dist/blocks/release-notes/index.cjs.js +1 -1
- package/dist/blocks/scan-history-log/index.cjs.js +1 -1
- package/dist/blocks/scan-history-log/index.es.js +1 -1
- package/dist/blocks/scan-policy-editor/index.cjs.js +1 -1
- package/dist/blocks/scan-report-generator/index.cjs.js +1 -1
- package/dist/blocks/settings/index.cjs.js +1 -1
- package/dist/blocks/settings/index.es.js +1 -1
- package/dist/blocks/sidebar/index.cjs.js +1 -1
- package/dist/blocks/sidebar/index.es.js +1 -1
- package/dist/blocks/signature-database-manager/index.cjs.js +1 -1
- package/dist/blocks/team-form/index.cjs.js +1 -1
- package/dist/blocks/threat-alert-banner/index.cjs.js +1 -1
- package/dist/blocks/user-management/index.cjs.js +1 -1
- package/dist/blocks/waka-doc-shell/index.cjs.js +1 -1
- package/dist/blocks/wizard/index.cjs.js +1 -1
- package/dist/blocks/wizard/index.es.js +37 -37
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.es.js +8 -8
- package/dist/cli/index.cjs +5 -1
- package/dist/components/DataTable/DataTable.cjs.js +1 -1
- package/dist/components/DataTable/DataTable.es.js +68 -66
- package/dist/components/DataTable/DataTableAdvanced.cjs.js +1 -1
- package/dist/components/DataTable/DataTableColumnResizer.cjs.js +1 -1
- package/dist/components/DataTable/DataTableContextMenu.cjs.js +1 -1
- package/dist/components/DataTable/DataTableEditCell.cjs.js +1 -1
- package/dist/components/DataTable/DataTableFilters.cjs.js +1 -1
- package/dist/components/DataTable/DataTableGrouping.cjs.js +1 -1
- package/dist/components/DataTable/DataTablePagination.cjs.js +1 -1
- package/dist/components/DataTable/DataTablePagination.d.ts +3 -1
- package/dist/components/DataTable/DataTablePagination.es.js +38 -27
- package/dist/components/DataTable/DataTableSelection.cjs.js +1 -1
- package/dist/components/DataTable/DataTableToolbar.cjs.js +1 -1
- package/dist/components/DataTable/hooks/useDataTable.cjs.js +1 -1
- package/dist/components/DataTable/hooks/useDataTable.es.js +5 -1
- package/dist/components/DataTable/hooks/useDataTableAdvanced.cjs.js +1 -1
- package/dist/components/DataTable/hooks/useDataTableEdit.cjs.js +1 -1
- package/dist/components/DataTable/hooks/useDataTableExport.cjs.js +2 -2
- package/dist/components/DataTable/hooks/useDataTableImport.cjs.js +2 -2
- package/dist/components/DataTable/hooks/useDataTableImport.es.js +2 -1
- package/dist/components/DataTable/hooks/useDataTableTheme.cjs.js +1 -1
- package/dist/components/DataTable/hooks/useDataTableVirtualization.cjs.js +1 -1
- package/dist/components/DataTable/hooks/useTableLayout.cjs.js +1 -1
- package/dist/components/DataTable/utils.cjs.js +1 -1
- package/dist/components/accordion/index.cjs.js +1 -1
- package/dist/components/alert/index.cjs.js +1 -1
- package/dist/components/alert-dialog/index.cjs.js +1 -1
- package/dist/components/aspect-ratio/index.cjs.js +1 -1
- package/dist/components/avatar/index.cjs.js +1 -1
- package/dist/components/badge/index.cjs.js +1 -1
- package/dist/components/button/index.cjs.js +1 -1
- package/dist/components/calendar/index.cjs.js +1 -1
- package/dist/components/card/index.cjs.js +1 -1
- package/dist/components/checkbox/index.cjs.js +1 -1
- package/dist/components/code/index.cjs.js +2 -2
- package/dist/components/code/index.es.js +3 -2
- package/dist/components/collapsible/index.cjs.js +1 -1
- package/dist/components/command/index.cjs.js +1 -1
- package/dist/components/context-menu/index.cjs.js +1 -1
- package/dist/components/dialog/index.cjs.js +1 -1
- package/dist/components/dropdown-menu/index.cjs.js +1 -1
- package/dist/components/editor/blocks/index.cjs.js +1 -1
- package/dist/components/editor/blocks/index.es.js +12 -12
- package/dist/components/editor/blocks/waka-acceptance-criteria-block.cjs.js +1 -1
- package/dist/components/editor/blocks/waka-ai-assist-block.cjs.js +1 -1
- package/dist/components/editor/blocks/waka-api-endpoint-block.cjs.js +1 -1
- package/dist/components/editor/blocks/waka-code-playground-block.cjs.js +1 -1
- package/dist/components/editor/blocks/waka-comment-thread-block.cjs.js +1 -1
- package/dist/components/editor/blocks/waka-diagram-block.cjs.js +3 -3
- package/dist/components/editor/blocks/waka-diagram-block.es.js +21 -40
- package/dist/components/editor/blocks/waka-embed-block.cjs.js +1 -1
- package/dist/components/editor/blocks/waka-slash-menu-block.cjs.js +1 -1
- package/dist/components/editor/blocks/waka-user-story-block.cjs.js +1 -1
- package/dist/components/editor/blocks/waka-version-diff-block.cjs.js +1 -1
- package/dist/components/editor/waka-ai-writer.cjs.js +1 -1
- package/dist/components/editor/waka-collaborative-editor.cjs.js +1 -1
- package/dist/components/editor/waka-diff-viewer.cjs.js +1 -1
- package/dist/components/editor/waka-dnd-editor.cjs.js +1 -1
- package/dist/components/editor/waka-document-editor.cjs.js +1 -1
- package/dist/components/editor/waka-document-editor.es.js +1 -1
- package/dist/components/editor/waka-editor-elements.cjs.js +1 -1
- package/dist/components/editor/waka-editor-leaves.cjs.js +1 -1
- package/dist/components/editor/waka-editor-toolbar.cjs.js +1 -1
- package/dist/components/editor/waka-editor.cjs.js +1 -1
- package/dist/components/editor/waka-floating-toolbar.cjs.js +1 -1
- package/dist/components/editor/waka-markdown-editor.cjs.js +1 -1
- package/dist/components/editor/waka-mention-editor.cjs.js +1 -1
- package/dist/components/editor/waka-mention-editor.es.js +2 -2
- package/dist/components/editor/waka-slash-menu.cjs.js +1 -1
- package/dist/components/editor/waka-spec-editor.cjs.js +1 -1
- package/dist/components/form/index.cjs.js +1 -1
- package/dist/components/hover-card/index.cjs.js +1 -1
- package/dist/components/input/index.cjs.js +1 -1
- package/dist/components/input-otp/index.cjs.js +1 -1
- package/dist/components/input-otp/index.es.js +2 -1
- package/dist/components/label/index.cjs.js +1 -1
- package/dist/components/language-selector/index.cjs.js +1 -1
- package/dist/components/menubar/index.cjs.js +1 -1
- package/dist/components/navigation-menu/index.cjs.js +1 -1
- package/dist/components/popover/index.cjs.js +1 -1
- package/dist/components/progress/index.cjs.js +1 -1
- package/dist/components/radio-group/index.cjs.js +1 -1
- package/dist/components/resizable/index.cjs.js +1 -1
- package/dist/components/resizable/index.es.js +9 -9
- package/dist/components/scroll-area/index.cjs.js +1 -1
- package/dist/components/select/index.cjs.js +1 -1
- package/dist/components/separator/index.cjs.js +1 -1
- package/dist/components/sheet/index.cjs.js +1 -1
- package/dist/components/skeleton/index.cjs.js +1 -1
- package/dist/components/slider/index.cjs.js +1 -1
- package/dist/components/switch/index.cjs.js +1 -1
- package/dist/components/table/index.cjs.js +1 -1
- package/dist/components/tabs/index.cjs.js +1 -1
- package/dist/components/textarea/index.cjs.js +1 -1
- package/dist/components/theme-selector/index.cjs.js +1 -1
- package/dist/components/toast/index.cjs.js +1 -1
- package/dist/components/toaster/index.cjs.js +1 -1
- package/dist/components/toggle/index.cjs.js +1 -1
- package/dist/components/toggle-group/index.cjs.js +1 -1
- package/dist/components/tooltip/index.cjs.js +1 -1
- package/dist/components/typography/index.cjs.js +1 -1
- package/dist/components/waka-3d-pie-chart/index.cjs.js +1 -1
- package/dist/components/waka-3d-pie-chart/index.es.js +1 -1
- package/dist/components/waka-achievement-unlock/index.cjs.js +1 -1
- package/dist/components/waka-achievement-unlock/index.es.js +1 -1
- package/dist/components/waka-activity-feed/index.cjs.js +2 -2
- package/dist/components/waka-activity-feed/index.es.js +1 -1
- package/dist/components/waka-ad-banner/index.cjs.js +1 -1
- package/dist/components/waka-ad-banner/index.es.js +18 -15
- package/dist/components/waka-ad-fallback/index.cjs.js +1 -1
- package/dist/components/waka-ad-fallback/index.es.js +1 -1
- package/dist/components/waka-ad-inline/index.cjs.js +1 -1
- package/dist/components/waka-ad-inline/index.es.js +2 -2
- package/dist/components/waka-ad-interstitial/index.cjs.js +1 -1
- package/dist/components/waka-ad-interstitial/index.es.js +3 -3
- package/dist/components/waka-ad-placeholder/index.cjs.js +2 -2
- package/dist/components/waka-ad-placeholder/index.es.js +1 -1
- package/dist/components/waka-ad-provider/index.cjs.js +1 -1
- package/dist/components/waka-ad-provider/index.es.js +1 -1
- package/dist/components/waka-ad-sidebar/index.cjs.js +1 -1
- package/dist/components/waka-ad-sidebar/index.es.js +2 -2
- package/dist/components/waka-ad-sticky-footer/index.cjs.js +1 -1
- package/dist/components/waka-ad-sticky-footer/index.es.js +2 -2
- package/dist/components/waka-address-autocomplete/index.cjs.js +2 -2
- package/dist/components/waka-address-autocomplete/index.es.js +10 -6
- package/dist/components/waka-admincrumb/index.cjs.js +1 -1
- package/dist/components/waka-alert-panel/index.cjs.js +1 -1
- package/dist/components/waka-alert-stack/index.cjs.js +1 -1
- package/dist/components/waka-alert-stack/index.es.js +1 -1
- package/dist/components/waka-allocation-matrix/index.cjs.js +2 -2
- package/dist/components/waka-allocation-matrix/index.es.js +1 -1
- package/dist/components/waka-approval-chain/index.cjs.js +1 -1
- package/dist/components/waka-approval-chain/index.es.js +1 -1
- package/dist/components/waka-artifact-list/index.cjs.js +1 -1
- package/dist/components/waka-artifact-list/index.es.js +1 -1
- package/dist/components/waka-audit-log/index.cjs.js +2 -2
- package/dist/components/waka-audit-log/index.es.js +1 -1
- package/dist/components/waka-autocomplete/index.cjs.js +1 -1
- package/dist/components/waka-autocomplete/index.es.js +3 -2
- package/dist/components/waka-badge-showcase/index.cjs.js +1 -1
- package/dist/components/waka-barcode/index.cjs.js +1 -1
- package/dist/components/waka-barcode/index.es.js +1 -1
- package/dist/components/waka-biometric-prompt/index.cjs.js +2 -2
- package/dist/components/waka-biometric-prompt/index.es.js +1 -1
- package/dist/components/waka-bottom-sheet/index.cjs.js +1 -1
- package/dist/components/waka-bottom-sheet/index.es.js +12 -7
- package/dist/components/waka-breadcrumb/index.cjs.js +1 -1
- package/dist/components/waka-breadcrumb/index.es.js +1 -1
- package/dist/components/waka-breadcrumb-path/index.cjs.js +1 -1
- package/dist/components/waka-breadcrumb-path/index.es.js +1 -1
- package/dist/components/waka-budget-burn/index.cjs.js +2 -2
- package/dist/components/waka-budget-burn/index.es.js +3 -3
- package/dist/components/waka-build-matrix/index.cjs.js +1 -1
- package/dist/components/waka-capacity-planner/index.cjs.js +2 -2
- package/dist/components/waka-capacity-planner/index.es.js +1 -1
- package/dist/components/waka-carousel/index.cjs.js +1 -1
- package/dist/components/waka-carousel/index.es.js +2 -2
- package/dist/components/waka-cart-summary/index.cjs.js +1 -1
- package/dist/components/waka-cart-summary/index.es.js +2 -2
- package/dist/components/waka-challenge-timer/index.cjs.js +1 -1
- package/dist/components/waka-charts/WakaAreaChart.cjs.js +1 -1
- package/dist/components/waka-charts/WakaAreaChart.es.js +2 -2
- package/dist/components/waka-charts/WakaBarChart.cjs.js +1 -1
- package/dist/components/waka-charts/WakaBarChart.es.js +2 -2
- package/dist/components/waka-charts/WakaChart.cjs.js +1 -1
- package/dist/components/waka-charts/WakaChart.es.js +1 -1
- package/dist/components/waka-charts/WakaLineChart.cjs.js +1 -1
- package/dist/components/waka-charts/WakaLineChart.es.js +2 -2
- package/dist/components/waka-charts/WakaMiniChart.cjs.js +1 -1
- package/dist/components/waka-charts/WakaMiniChart.es.js +2 -2
- package/dist/components/waka-charts/WakaPieChart.cjs.js +1 -1
- package/dist/components/waka-charts/WakaPieChart.es.js +2 -2
- package/dist/components/waka-charts/WakaSparkline.cjs.js +1 -1
- package/dist/components/waka-charts/WakaSparkline.es.js +1 -1
- package/dist/components/waka-charts/dataTableHelpers.cjs.js +1 -1
- package/dist/components/waka-charts/dataTableHelpers.es.js +1 -1
- package/dist/components/waka-charts/hooks/useChartTheme.cjs.js +1 -1
- package/dist/components/waka-charts/hooks/useChartTheme.es.js +1 -1
- package/dist/components/waka-charts/hooks/useRechartsLoader.cjs.js +1 -1
- package/dist/components/waka-charts/hooks/useRechartsLoader.es.js +1 -1
- package/dist/components/waka-chat-bubble/index.cjs.js +1 -1
- package/dist/components/waka-checklist/index.cjs.js +2 -2
- package/dist/components/waka-checklist/index.es.js +1 -1
- package/dist/components/waka-checkout-stepper/index.cjs.js +1 -1
- package/dist/components/waka-checkout-stepper/index.es.js +1 -1
- package/dist/components/waka-cohort-table/index.cjs.js +2 -2
- package/dist/components/waka-cohort-table/index.es.js +1 -1
- package/dist/components/waka-color-picker/index.cjs.js +2 -2
- package/dist/components/waka-color-picker/index.es.js +1 -1
- package/dist/components/waka-combo-counter/index.cjs.js +1 -1
- package/dist/components/waka-combobox/index.cjs.js +1 -1
- package/dist/components/waka-combobox/index.es.js +3 -2
- package/dist/components/waka-command-bar/index.cjs.js +1 -1
- package/dist/components/waka-compare-period/index.cjs.js +2 -2
- package/dist/components/waka-compare-period/index.es.js +7 -5
- package/dist/components/waka-config-comparator/index.cjs.js +1 -1
- package/dist/components/waka-config-comparator/index.es.js +1 -1
- package/dist/components/waka-connection-matrix/index.cjs.js +1 -1
- package/dist/components/waka-connection-matrix/index.es.js +1 -1
- package/dist/components/waka-container-list/index.cjs.js +1 -1
- package/dist/components/waka-container-list/index.es.js +1 -1
- package/dist/components/waka-content-recommendation/index.cjs.js +1 -1
- package/dist/components/waka-content-recommendation/index.es.js +2 -2
- package/dist/components/waka-contribution-graph/index.cjs.js +1 -1
- package/dist/components/waka-contribution-graph/index.es.js +4 -4
- package/dist/components/waka-cost-breakdown/index.cjs.js +1 -1
- package/dist/components/waka-cost-breakdown/index.es.js +7 -7
- package/dist/components/waka-coupon-input/index.cjs.js +2 -2
- package/dist/components/waka-coupon-input/index.es.js +1 -1
- package/dist/components/waka-credit-activity-feed/index.cjs.js +2 -2
- package/dist/components/waka-credit-activity-feed/index.es.js +1 -1
- package/dist/components/waka-credit-alert/index.cjs.js +1 -1
- package/dist/components/waka-credit-alert/index.es.js +1 -1
- package/dist/components/waka-credit-balance/index.cjs.js +1 -1
- package/dist/components/waka-credit-balance/index.es.js +3 -3
- package/dist/components/waka-credit-breakdown/index.cjs.js +1 -1
- package/dist/components/waka-credit-breakdown/index.es.js +1 -1
- package/dist/components/waka-credit-burn-rate/index.cjs.js +1 -1
- package/dist/components/waka-credit-burn-rate/index.es.js +1 -1
- package/dist/components/waka-credit-card-input/index.cjs.js +1 -1
- package/dist/components/waka-credit-card-input/index.es.js +1 -1
- package/dist/components/waka-credit-history/index.cjs.js +1 -1
- package/dist/components/waka-credit-history/index.es.js +1 -1
- package/dist/components/waka-credit-meter/index.cjs.js +2 -2
- package/dist/components/waka-credit-meter/index.es.js +3 -3
- package/dist/components/waka-credit-pricing-pack/index.cjs.js +1 -1
- package/dist/components/waka-credit-pricing-pack/index.es.js +1 -1
- package/dist/components/waka-credit-projection/index.cjs.js +1 -1
- package/dist/components/waka-credit-projection/index.es.js +1 -1
- package/dist/components/waka-credit-quota/index.cjs.js +1 -1
- package/dist/components/waka-credit-quota/index.es.js +3 -3
- package/dist/components/waka-credit-receipt/index.cjs.js +1 -1
- package/dist/components/waka-credit-receipt/index.es.js +1 -1
- package/dist/components/waka-credit-top-up/index.cjs.js +1 -1
- package/dist/components/waka-credit-top-up/index.es.js +1 -1
- package/dist/components/waka-credit-transaction/index.cjs.js +1 -1
- package/dist/components/waka-credit-transaction/index.es.js +1 -1
- package/dist/components/waka-credit-transfer-form/index.cjs.js +1 -1
- package/dist/components/waka-credit-transfer-form/index.es.js +1 -1
- package/dist/components/waka-credit-usage-chart/index.cjs.js +1 -1
- package/dist/components/waka-credit-usage-chart/index.es.js +1 -1
- package/dist/components/waka-daily-reward/index.cjs.js +1 -1
- package/dist/components/waka-database-card/index.cjs.js +1 -1
- package/dist/components/waka-database-card/index.es.js +1 -1
- package/dist/components/waka-date-range-picker/index.cjs.js +1 -1
- package/dist/components/waka-date-range-picker/index.es.js +3 -2
- package/dist/components/waka-datetime-picker/index.cjs.js +1 -1
- package/dist/components/waka-datetime-picker/index.es.js +4 -1
- package/dist/components/waka-datetime-picker.form-integration/index.cjs.js +1 -1
- package/dist/components/waka-dependency-tree/index.cjs.js +1 -1
- package/dist/components/waka-dependency-tree/index.es.js +1 -1
- package/dist/components/waka-deployment-lane/index.cjs.js +1 -1
- package/dist/components/waka-deployment-lane/index.es.js +1 -1
- package/dist/components/waka-device-trust/index.cjs.js +2 -2
- package/dist/components/waka-device-trust/index.es.js +1 -1
- package/dist/components/waka-doc-breadcrumb/index.cjs.js +1 -1
- package/dist/components/waka-doc-callout/index.cjs.js +1 -1
- package/dist/components/waka-doc-code-block/index.cjs.js +1 -1
- package/dist/components/waka-doc-nav/index.cjs.js +1 -1
- package/dist/components/waka-doc-renderer/index.cjs.js +1 -1
- package/dist/components/waka-doc-search/index.cjs.js +1 -1
- package/dist/components/waka-doc-table/index.cjs.js +1 -1
- package/dist/components/waka-doc-toc/index.cjs.js +1 -1
- package/dist/components/waka-doc-toolbar/index.cjs.js +1 -1
- package/dist/components/waka-doc-version/index.cjs.js +1 -1
- package/dist/components/waka-dock/index.cjs.js +1 -1
- package/dist/components/waka-dock/index.es.js +2 -2
- package/dist/components/waka-drawer/index.cjs.js +1 -1
- package/dist/components/waka-drawer/index.es.js +1 -1
- package/dist/components/waka-empty-state/index.cjs.js +1 -1
- package/dist/components/waka-env-var-editor/index.cjs.js +1 -1
- package/dist/components/waka-error-shake/index.cjs.js +1 -1
- package/dist/components/waka-feature-announcement/index.cjs.js +2 -2
- package/dist/components/waka-feature-announcement/index.es.js +1 -1
- package/dist/components/waka-feature-flag-row/index.cjs.js +1 -1
- package/dist/components/waka-file-upload/index.cjs.js +1 -1
- package/dist/components/waka-file-upload/index.es.js +2 -2
- package/dist/components/waka-floating-nav/index.cjs.js +1 -1
- package/dist/components/waka-floating-nav/index.es.js +1 -1
- package/dist/components/waka-flow-diagram/index.cjs.js +1 -1
- package/dist/components/waka-funnel-chart/index.cjs.js +2 -2
- package/dist/components/waka-funnel-chart/index.es.js +1 -1
- package/dist/components/waka-glow-card/index.cjs.js +1 -1
- package/dist/components/waka-glow-card/index.es.js +3 -3
- package/dist/components/waka-goal-progress/index.cjs.js +3 -3
- package/dist/components/waka-goal-progress/index.es.js +3 -3
- package/dist/components/waka-haptic-button/index.cjs.js +1 -1
- package/dist/components/waka-health-pulse/index.cjs.js +2 -2
- package/dist/components/waka-health-pulse/index.es.js +1 -1
- package/dist/components/waka-heatmap/index.cjs.js +1 -1
- package/dist/components/waka-heatmap/index.es.js +3 -3
- package/dist/components/waka-hotspot/index.cjs.js +1 -1
- package/dist/components/waka-image/index.cjs.js +1 -1
- package/dist/components/waka-image/index.es.js +1 -1
- package/dist/components/waka-incident-timeline/index.cjs.js +1 -1
- package/dist/components/waka-incident-timeline/index.es.js +3 -2
- package/dist/components/waka-invoice-preview/index.cjs.js +1 -1
- package/dist/components/waka-invoice-preview/index.es.js +1 -1
- package/dist/components/waka-kanban/index.cjs.js +1 -1
- package/dist/components/waka-kanban/index.es.js +1 -1
- package/dist/components/waka-kpi-dashboard/index.cjs.js +1 -1
- package/dist/components/waka-kpi-dashboard/index.es.js +6 -4
- package/dist/components/waka-kubernetes-overview/index.cjs.js +1 -1
- package/dist/components/waka-kubernetes-overview/index.es.js +1 -1
- package/dist/components/waka-leaderboard/index.cjs.js +1 -1
- package/dist/components/waka-level-progress/index.cjs.js +2 -2
- package/dist/components/waka-level-progress/index.es.js +2 -2
- package/dist/components/waka-liquid-button/index.cjs.js +1 -1
- package/dist/components/waka-loading-orbit/index.cjs.js +1 -1
- package/dist/components/waka-log-viewer/index.cjs.js +1 -1
- package/dist/components/waka-loot-box/index.cjs.js +2 -2
- package/dist/components/waka-loot-box/index.es.js +1 -1
- package/dist/components/waka-magic-link/index.cjs.js +2 -2
- package/dist/components/waka-magnetic-button/index.cjs.js +1 -1
- package/dist/components/waka-mention-input/index.cjs.js +1 -1
- package/dist/components/waka-mention-input/index.es.js +52 -40
- package/dist/components/waka-metric-sparkline/index.cjs.js +1 -1
- package/dist/components/waka-metric-sparkline/index.es.js +1 -1
- package/dist/components/waka-migration-list/index.cjs.js +1 -1
- package/dist/components/waka-milestone-road/index.cjs.js +2 -2
- package/dist/components/waka-milestone-road/index.es.js +5 -5
- package/dist/components/waka-modal/index.cjs.js +1 -1
- package/dist/components/waka-modal/index.es.js +1 -1
- package/dist/components/waka-morph-button/index.cjs.js +2 -2
- package/dist/components/waka-morph-button/index.es.js +6 -2
- package/dist/components/waka-network-topology/index.cjs.js +1 -1
- package/dist/components/waka-network-topology/index.es.js +4 -2
- package/dist/components/waka-notifications/index.cjs.js +1 -1
- package/dist/components/waka-number-input/index.cjs.js +1 -1
- package/dist/components/waka-number-input/index.es.js +1 -1
- package/dist/components/waka-orbital-menu/index.cjs.js +1 -1
- package/dist/components/waka-orbital-menu/index.es.js +1 -1
- package/dist/components/waka-order-tracker/index.cjs.js +1 -1
- package/dist/components/waka-order-tracker/index.es.js +3 -2
- package/dist/components/waka-outstream-video/index.cjs.js +1 -1
- package/dist/components/waka-outstream-video/index.es.js +2 -2
- package/dist/components/waka-pagination/index.cjs.js +1 -1
- package/dist/components/waka-pagination/index.es.js +1 -1
- package/dist/components/waka-password-strength/index.cjs.js +2 -2
- package/dist/components/waka-password-strength/index.es.js +3 -3
- package/dist/components/waka-payment-method-picker/index.cjs.js +1 -1
- package/dist/components/waka-payment-method-picker/index.es.js +1 -1
- package/dist/components/waka-permission-matrix/index.cjs.js +2 -2
- package/dist/components/waka-permission-matrix/index.es.js +3 -2
- package/dist/components/waka-phone-input/index.cjs.js +1 -1
- package/dist/components/waka-phone-input/index.es.js +5 -3
- package/dist/components/waka-pipeline-view/index.cjs.js +2 -2
- package/dist/components/waka-pipeline-view/index.es.js +1 -1
- package/dist/components/waka-player-card/index.cjs.js +2 -2
- package/dist/components/waka-player-card/index.es.js +4 -4
- package/dist/components/waka-pod-card/index.cjs.js +1 -1
- package/dist/components/waka-pod-card/index.es.js +1 -1
- package/dist/components/waka-points-popup/index.cjs.js +1 -1
- package/dist/components/waka-points-popup/index.es.js +5 -1
- package/dist/components/waka-power-up/index.cjs.js +1 -1
- package/dist/components/waka-presence-indicator/index.cjs.js +2 -2
- package/dist/components/waka-presence-indicator/index.es.js +1 -1
- package/dist/components/waka-pricing-table/index.cjs.js +2 -2
- package/dist/components/waka-pricing-table/index.es.js +1 -1
- package/dist/components/waka-product-card/index.cjs.js +1 -1
- package/dist/components/waka-progress-onboarding/index.cjs.js +3 -3
- package/dist/components/waka-progress-onboarding/index.es.js +1 -1
- package/dist/components/waka-pull-to-refresh/index.cjs.js +1 -1
- package/dist/components/waka-qrcode/index.cjs.js +1 -1
- package/dist/components/waka-qrcode/index.es.js +1 -1
- package/dist/components/waka-query-explain/index.cjs.js +1 -1
- package/dist/components/waka-quest-card/index.cjs.js +2 -2
- package/dist/components/waka-quest-card/index.es.js +4 -1
- package/dist/components/waka-quota-bar/index.cjs.js +2 -2
- package/dist/components/waka-quota-bar/index.es.js +11 -4
- package/dist/components/waka-radar-score/index.cjs.js +1 -1
- package/dist/components/waka-radar-score/index.es.js +6 -6
- package/dist/components/waka-rank-badge/index.cjs.js +2 -2
- package/dist/components/waka-rank-badge/index.es.js +1 -1
- package/dist/components/waka-rating-input/index.cjs.js +2 -2
- package/dist/components/waka-rating-input/index.es.js +1 -1
- package/dist/components/waka-reaction-picker/index.cjs.js +1 -1
- package/dist/components/waka-reaction-picker/index.es.js +7 -4
- package/dist/components/waka-region-map/index.cjs.js +1 -1
- package/dist/components/waka-region-map/index.es.js +1 -1
- package/dist/components/waka-resource-gauge/index.cjs.js +2 -2
- package/dist/components/waka-resource-gauge/index.es.js +3 -3
- package/dist/components/waka-resource-pool/index.cjs.js +2 -2
- package/dist/components/waka-resource-pool/index.es.js +1 -1
- package/dist/components/waka-rich-text-editor/index.cjs.js +1 -1
- package/dist/components/waka-rich-text-editor/index.es.js +1 -1
- package/dist/components/waka-rollback-slider/index.cjs.js +2 -2
- package/dist/components/waka-rollback-slider/index.es.js +5 -3
- package/dist/components/waka-sankey-diagram/index.cjs.js +2 -2
- package/dist/components/waka-sankey-diagram/index.es.js +5 -5
- package/dist/components/waka-schedule-picker/index.cjs.js +1 -1
- package/dist/components/waka-schedule-picker/index.es.js +3 -2
- package/dist/components/waka-scratch-card/index.cjs.js +2 -2
- package/dist/components/waka-scratch-card/index.es.js +1 -1
- package/dist/components/waka-season-pass/index.cjs.js +1 -1
- package/dist/components/waka-secret-card/index.cjs.js +1 -1
- package/dist/components/waka-security-scan-result/index.cjs.js +1 -1
- package/dist/components/waka-security-score/index.cjs.js +2 -2
- package/dist/components/waka-security-score/index.es.js +5 -5
- package/dist/components/waka-segmented-control/index.cjs.js +1 -1
- package/dist/components/waka-segmented-control/index.es.js +1 -1
- package/dist/components/waka-server-rack/index.cjs.js +1 -1
- package/dist/components/waka-service-graph/index.cjs.js +1 -1
- package/dist/components/waka-session-manager/index.cjs.js +1 -1
- package/dist/components/waka-session-manager/index.es.js +3 -2
- package/dist/components/waka-signature-pad/index.cjs.js +1 -1
- package/dist/components/waka-signature-pad/index.es.js +1 -1
- package/dist/components/waka-skeleton-wave/index.cjs.js +1 -1
- package/dist/components/waka-skill-tree/index.cjs.js +2 -2
- package/dist/components/waka-skill-tree/index.es.js +32 -32
- package/dist/components/waka-sla-tracker/index.cjs.js +1 -1
- package/dist/components/waka-sla-tracker/index.es.js +1 -1
- package/dist/components/waka-slider-range/index.cjs.js +1 -1
- package/dist/components/waka-slider-range/index.es.js +3 -3
- package/dist/components/waka-spin-wheel/index.cjs.js +2 -2
- package/dist/components/waka-spin-wheel/index.es.js +6 -6
- package/dist/components/waka-spinner/index.cjs.js +1 -1
- package/dist/components/waka-sponsored-badge/index.cjs.js +1 -1
- package/dist/components/waka-sponsored-badge/index.es.js +1 -1
- package/dist/components/waka-sponsored-card/index.cjs.js +1 -1
- package/dist/components/waka-sponsored-card/index.es.js +2 -2
- package/dist/components/waka-sponsored-feed/index.cjs.js +1 -1
- package/dist/components/waka-sponsored-feed/index.es.js +2 -2
- package/dist/components/waka-spotlight/index.cjs.js +1 -1
- package/dist/components/waka-spotlight/index.es.js +2 -1
- package/dist/components/waka-stat/index.cjs.js +1 -1
- package/dist/components/waka-stat/index.es.js +1 -1
- package/dist/components/waka-stats-hexagon/index.cjs.js +1 -1
- package/dist/components/waka-stats-hexagon/index.es.js +9 -9
- package/dist/components/waka-status-matrix/index.cjs.js +1 -1
- package/dist/components/waka-status-matrix/index.es.js +1 -1
- package/dist/components/waka-stepper/index.cjs.js +1 -1
- package/dist/components/waka-stepper/index.es.js +1 -1
- package/dist/components/waka-streak-counter/index.cjs.js +1 -1
- package/dist/components/waka-success-explosion/index.cjs.js +1 -1
- package/dist/components/waka-swipe-card/index.cjs.js +1 -1
- package/dist/components/waka-swipe-card/index.es.js +2 -2
- package/dist/components/waka-tabs-morph/index.cjs.js +1 -1
- package/dist/components/waka-tabs-morph/index.es.js +1 -1
- package/dist/components/waka-tag-input/index.cjs.js +1 -1
- package/dist/components/waka-tag-input/index.es.js +3 -2
- package/dist/components/waka-team-banner/index.cjs.js +2 -2
- package/dist/components/waka-team-banner/index.es.js +1 -1
- package/dist/components/waka-terminal-output/index.cjs.js +2 -2
- package/dist/components/waka-terminal-output/index.es.js +5 -3
- package/dist/components/waka-test-report/index.cjs.js +1 -1
- package/dist/components/waka-theme-creator/index.cjs.js +1 -1
- package/dist/components/waka-theme-manager/index.cjs.js +1 -1
- package/dist/components/waka-theme-manager/index.es.js +5 -2
- package/dist/components/waka-thread-view/index.cjs.js +2 -2
- package/dist/components/waka-thread-view/index.es.js +1 -1
- package/dist/components/waka-tilt-card/index.cjs.js +1 -1
- package/dist/components/waka-tilt-card/index.es.js +8 -6
- package/dist/components/waka-time-picker/index.cjs.js +1 -1
- package/dist/components/waka-time-picker/index.es.js +10 -6
- package/dist/components/waka-timeline/index.cjs.js +1 -1
- package/dist/components/waka-timeline/index.es.js +1 -1
- package/dist/components/waka-tooltip-tour/index.cjs.js +3 -3
- package/dist/components/waka-tooltip-tour/index.es.js +53 -51
- package/dist/components/waka-tour-guide/index.cjs.js +2 -2
- package/dist/components/waka-tour-guide/index.es.js +1 -1
- package/dist/components/waka-tournament-bracket/index.cjs.js +2 -2
- package/dist/components/waka-tournament-bracket/index.es.js +1 -1
- package/dist/components/waka-trace-viewer/index.cjs.js +1 -1
- package/dist/components/waka-tree/index.cjs.js +1 -1
- package/dist/components/waka-tree/index.es.js +1 -1
- package/dist/components/waka-treemap-chart/index.cjs.js +1 -1
- package/dist/components/waka-treemap-chart/index.es.js +1 -1
- package/dist/components/waka-two-factor-setup/index.cjs.js +2 -2
- package/dist/components/waka-two-factor-setup/index.es.js +5 -4
- package/dist/components/waka-typewriter/index.cjs.js +1 -1
- package/dist/components/waka-typewriter/index.es.js +7 -2
- package/dist/components/waka-typing-indicator/index.cjs.js +2 -2
- package/dist/components/waka-typing-indicator/index.es.js +1 -1
- package/dist/components/waka-versus-card/index.cjs.js +3 -3
- package/dist/components/waka-versus-card/index.es.js +5 -4
- package/dist/components/waka-video/index.cjs.js +1 -1
- package/dist/components/waka-video/index.es.js +1 -1
- package/dist/components/waka-video-ad/index.cjs.js +1 -1
- package/dist/components/waka-video-ad/index.es.js +3 -3
- package/dist/components/waka-video-call/index.cjs.js +2 -2
- package/dist/components/waka-video-call/index.es.js +1 -1
- package/dist/components/waka-video-overlay/index.cjs.js +1 -1
- package/dist/components/waka-video-overlay/index.es.js +2 -2
- package/dist/components/waka-virtual-list/index.cjs.js +1 -1
- package/dist/components/waka-virtual-list/index.es.js +1 -1
- package/dist/components/waka-voice-message/index.cjs.js +1 -1
- package/dist/components/waka-voice-message/index.es.js +6 -5
- package/dist/components/waka-welcome-modal/index.cjs.js +2 -2
- package/dist/components/waka-welcome-modal/index.es.js +1 -1
- package/dist/components/waka-xp-bar/index.cjs.js +1 -1
- package/dist/components/waka-xp-bar/index.es.js +2 -2
- package/dist/context/admincrumb-context.cjs.js +1 -1
- package/dist/context/language-context.cjs.js +1 -1
- package/dist/context/language-context.es.js +2 -2
- package/dist/context/theme-context.cjs.js +1 -1
- package/dist/context/theme-provider.cjs.js +1 -1
- package/dist/context/theme-provider.es.js +9 -6
- package/dist/context/waka-provider.cjs.js +1 -1
- package/dist/context/waka-provider.es.js +57 -53
- package/dist/doc.cjs.js +1 -1
- package/dist/editor.cjs.js +1 -1
- package/dist/export.cjs.js +1 -1
- package/dist/hooks/use-toast.cjs.js +1 -1
- package/dist/hooks/use-translation.cjs.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +279 -278
- package/dist/lib/i18n.cjs.js +1 -1
- package/dist/lib/i18n.es.js +11 -9
- package/dist/locales/default-resources.cjs.js +1 -0
- package/dist/locales/default-resources.d.ts +155 -0
- package/dist/locales/default-resources.es.js +150 -0
- package/dist/node_modules/.pnpm/exceljs@4.4.0/node_modules/exceljs/dist/exceljs.min.cjs.js +13 -13
- package/dist/node_modules/.pnpm/exceljs@4.4.0/node_modules/exceljs/dist/exceljs.min.es.js +13 -13
- package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-docker.cjs.js +1 -1
- package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-docker.es.js +19 -19
- package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-markdown.cjs.js +1 -1
- package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-markdown.es.js +24 -25
- package/dist/node_modules/.pnpm/react-resizable-panels@4.11.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-resizable-panels/dist/react-resizable-panels.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-resizable-panels@4.11.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-resizable-panels/dist/react-resizable-panels.es.js +26 -23
- package/dist/rich-text.cjs.js +1 -1
- package/dist/ui.css +1 -1
- package/dist/utils/cn.cjs.js +1 -1
- package/dist/utils/datetime-helpers.cjs.js +1 -1
- package/dist/utils/theme-loader.cjs.js +1 -1
- package/dist/utils/tweak.cjs.js +1 -1
- package/package.json +28 -27
- package/src/components/DataTable/DataTable.tsx +2 -0
- package/src/components/DataTable/DataTablePagination.tsx +28 -8
- package/src/components/DataTable/hooks/useDataTable.ts +13 -0
- package/src/components/editor/blocks/waka-diagram-block.tsx +7 -36
|
@@ -72,7 +72,7 @@ function p(e = {}) {
|
|
|
72
72
|
function m(e) {
|
|
73
73
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function ee(e, t) {
|
|
76
76
|
let n = document.createElement("div"), r = getComputedStyle(e);
|
|
77
77
|
for (let e of Array.from(r)) n.style.setProperty(e, r.getPropertyValue(e));
|
|
78
78
|
n.style.position = "absolute", n.style.visibility = "hidden", n.style.whiteSpace = "pre-wrap", n.style.wordWrap = "break-word", n.style.overflow = "hidden", n.style.width = `${e.offsetWidth}px`, n.style.height = "auto", n.textContent = e.value.substring(0, t);
|
|
@@ -84,7 +84,7 @@ function h(e, t) {
|
|
|
84
84
|
};
|
|
85
85
|
return document.body.removeChild(n), s;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function te({ items: n, highlightedIndex: r, onSelect: a, onHighlight: s, trigger: c, loading: l, position: f, visible: p }) {
|
|
88
88
|
let m = t.useRef(null);
|
|
89
89
|
return t.useEffect(() => {
|
|
90
90
|
if (m.current && r >= 0) {
|
|
@@ -142,7 +142,7 @@ function ee({ items: n, highlightedIndex: r, onSelect: a, onHighlight: s, trigge
|
|
|
142
142
|
})
|
|
143
143
|
}) : null;
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function h({ text: t, mentions: i, triggers: a }) {
|
|
146
146
|
let o = [], s = 0, c = [...i].sort((e, t) => e.startIndex - t.startIndex);
|
|
147
147
|
for (let i of c) {
|
|
148
148
|
i.startIndex > s && o.push(/* @__PURE__ */ u("span", { children: t.substring(s, i.startIndex) }, `text-${s}`));
|
|
@@ -154,7 +154,7 @@ function g({ text: t, mentions: i, triggers: a }) {
|
|
|
154
154
|
}
|
|
155
155
|
return s < t.length && o.push(/* @__PURE__ */ u("span", { children: t.substring(s) }, `text-${s}`)), /* @__PURE__ */ u(l, { children: o });
|
|
156
156
|
}
|
|
157
|
-
var
|
|
157
|
+
var g = t.forwardRef(({ value: i, onChange: o, triggers: l = f, placeholder: p = "Type @ to mention someone...", disabled: g = !1, error: _, maxLength: v, maxMentions: y, showCharacterCount: b = !1, showMentionCount: x = !1, minHeight: ne = 80, maxHeight: re = 300, showPreview: ie = !1, className: ae, label: S, description: C, searchDebounce: w = 300, autoFocus: T = !1, onFocus: E, onBlur: oe, onSubmit: D }, se) => {
|
|
158
158
|
let O = t.useRef(null), k = t.useRef(null), [A, j] = t.useState(i || ""), [M, N] = t.useState([]), [ce, P] = t.useState(!1), [F, I] = t.useState(!1), [le, ue] = t.useState({
|
|
159
159
|
top: 0,
|
|
160
160
|
left: 0
|
|
@@ -192,18 +192,22 @@ var _ = t.forwardRef(({ value: i, onChange: o, triggers: l = f, placeholder: p =
|
|
|
192
192
|
if (t.onSearch) {
|
|
193
193
|
W(!0);
|
|
194
194
|
try {
|
|
195
|
-
|
|
195
|
+
let n = await t.onSearch(e);
|
|
196
|
+
R(n);
|
|
196
197
|
} catch {
|
|
197
198
|
R([]);
|
|
198
199
|
} finally {
|
|
199
200
|
W(!1);
|
|
200
201
|
}
|
|
201
|
-
} else
|
|
202
|
+
} else if (t.data) {
|
|
203
|
+
let n = t.data.filter((t) => t.display.toLowerCase().includes(e.toLowerCase()) || t.value.toLowerCase().includes(e.toLowerCase()));
|
|
204
|
+
R(n);
|
|
205
|
+
}
|
|
202
206
|
}, []);
|
|
203
207
|
t.useEffect(() => {
|
|
204
208
|
if (!(!V || !F)) return G.current && clearTimeout(G.current), V.onSearch ? G.current = setTimeout(() => {
|
|
205
209
|
Y(U, V);
|
|
206
|
-
},
|
|
210
|
+
}, w) : Y(U, V), () => {
|
|
207
211
|
G.current && clearTimeout(G.current);
|
|
208
212
|
};
|
|
209
213
|
}, [
|
|
@@ -211,7 +215,7 @@ var _ = t.forwardRef(({ value: i, onChange: o, triggers: l = f, placeholder: p =
|
|
|
211
215
|
V,
|
|
212
216
|
F,
|
|
213
217
|
Y,
|
|
214
|
-
|
|
218
|
+
w
|
|
215
219
|
]);
|
|
216
220
|
let pe = (e) => {
|
|
217
221
|
let t = e.target.value, n = e.target.selectionStart, r = null, i = -1;
|
|
@@ -228,7 +232,15 @@ var _ = t.forwardRef(({ value: i, onChange: o, triggers: l = f, placeholder: p =
|
|
|
228
232
|
}
|
|
229
233
|
if (r) break;
|
|
230
234
|
}
|
|
231
|
-
|
|
235
|
+
if (r && i >= 0) {
|
|
236
|
+
let e = t.substring(i + 1, n);
|
|
237
|
+
if (de(e), H(r), K.current = i, O.current) {
|
|
238
|
+
let e = ee(O.current, i);
|
|
239
|
+
ue(e);
|
|
240
|
+
}
|
|
241
|
+
I(!0), B(0);
|
|
242
|
+
} else I(!1), H(null), K.current = -1;
|
|
243
|
+
j(t), q(t);
|
|
232
244
|
let a = [];
|
|
233
245
|
for (let e of l) {
|
|
234
246
|
let n = RegExp(`${m(e.trigger)}\\[([^\\]]+)\\]\\(([^)]+)\\)`, "g"), r;
|
|
@@ -249,7 +261,7 @@ var _ = t.forwardRef(({ value: i, onChange: o, triggers: l = f, placeholder: p =
|
|
|
249
261
|
}
|
|
250
262
|
o?.(t, s, a);
|
|
251
263
|
}, X = (e) => {
|
|
252
|
-
if (!V || K.current < 0 ||
|
|
264
|
+
if (!V || K.current < 0 || y && M.length >= y) return;
|
|
253
265
|
let t = O.current;
|
|
254
266
|
if (!t) return;
|
|
255
267
|
let n = t.selectionStart, r = A.substring(0, K.current), i = A.substring(n), a = `${V.trigger}[${e.display}](${e.id})`, s = `${r}${a} ${i}`;
|
|
@@ -278,9 +290,9 @@ var _ = t.forwardRef(({ value: i, onChange: o, triggers: l = f, placeholder: p =
|
|
|
278
290
|
d = d.replace(t, `${e.trigger}${e.display}`);
|
|
279
291
|
}
|
|
280
292
|
o?.(s, d, u);
|
|
281
|
-
},
|
|
293
|
+
}, me = (e) => {
|
|
282
294
|
if ((e.ctrlKey || e.metaKey) && e.key === "Enter") {
|
|
283
|
-
e.preventDefault(),
|
|
295
|
+
e.preventDefault(), D?.(A, J, M);
|
|
284
296
|
return;
|
|
285
297
|
}
|
|
286
298
|
if (F) switch (e.key) {
|
|
@@ -298,12 +310,12 @@ var _ = t.forwardRef(({ value: i, onChange: o, triggers: l = f, placeholder: p =
|
|
|
298
310
|
e.preventDefault(), I(!1), H(null);
|
|
299
311
|
break;
|
|
300
312
|
}
|
|
301
|
-
},
|
|
302
|
-
P(!0),
|
|
313
|
+
}, Z = () => {
|
|
314
|
+
P(!0), E?.();
|
|
303
315
|
}, he = (e) => {
|
|
304
316
|
k.current?.contains(e.relatedTarget) || (P(!1), setTimeout(() => {
|
|
305
317
|
I(!1);
|
|
306
|
-
}, 150),
|
|
318
|
+
}, 150), oe?.());
|
|
307
319
|
}, ge = (e) => {
|
|
308
320
|
let t = M.find((t) => t.id === e);
|
|
309
321
|
if (!t) return;
|
|
@@ -317,41 +329,41 @@ var _ = t.forwardRef(({ value: i, onChange: o, triggers: l = f, placeholder: p =
|
|
|
317
329
|
o?.(r, i, a);
|
|
318
330
|
};
|
|
319
331
|
t.useImperativeHandle(se, () => O.current, []);
|
|
320
|
-
let Q = J.length, $ = M.length, _e =
|
|
332
|
+
let Q = J.length, $ = M.length, _e = v ? Q > v : !1, ve = y ? $ > y : !1;
|
|
321
333
|
return /* @__PURE__ */ d("div", {
|
|
322
334
|
ref: k,
|
|
323
|
-
className: e("space-y-1.5",
|
|
335
|
+
className: e("space-y-1.5", ae),
|
|
324
336
|
children: [
|
|
325
|
-
|
|
337
|
+
S && /* @__PURE__ */ u("label", {
|
|
326
338
|
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
327
|
-
children:
|
|
339
|
+
children: S
|
|
328
340
|
}),
|
|
329
|
-
|
|
341
|
+
C && /* @__PURE__ */ u("p", {
|
|
330
342
|
className: "text-sm text-muted-foreground",
|
|
331
|
-
children:
|
|
343
|
+
children: C
|
|
332
344
|
}),
|
|
333
345
|
/* @__PURE__ */ d("div", {
|
|
334
346
|
className: "relative",
|
|
335
347
|
children: [/* @__PURE__ */ d("div", {
|
|
336
|
-
className: e("relative rounded-lg border bg-background transition-colors", ce && "ring-2 ring-ring ring-offset-2 ring-offset-background",
|
|
348
|
+
className: e("relative rounded-lg border bg-background transition-colors", ce && "ring-2 ring-ring ring-offset-2 ring-offset-background", _ && "border-destructive", g && "opacity-50 cursor-not-allowed"),
|
|
337
349
|
children: [
|
|
338
350
|
/* @__PURE__ */ u("textarea", {
|
|
339
351
|
ref: O,
|
|
340
352
|
value: A,
|
|
341
353
|
onChange: pe,
|
|
342
|
-
onKeyDown:
|
|
343
|
-
onFocus:
|
|
354
|
+
onKeyDown: me,
|
|
355
|
+
onFocus: Z,
|
|
344
356
|
onBlur: he,
|
|
345
357
|
placeholder: p,
|
|
346
|
-
disabled:
|
|
347
|
-
autoFocus:
|
|
358
|
+
disabled: g,
|
|
359
|
+
autoFocus: T,
|
|
348
360
|
className: e("w-full resize-none bg-transparent px-3 py-2 text-sm", "placeholder:text-muted-foreground", "focus:outline-none", "disabled:cursor-not-allowed"),
|
|
349
361
|
style: {
|
|
350
|
-
minHeight:
|
|
351
|
-
maxHeight:
|
|
362
|
+
minHeight: ne,
|
|
363
|
+
maxHeight: re
|
|
352
364
|
}
|
|
353
365
|
}),
|
|
354
|
-
V && /* @__PURE__ */ u(
|
|
366
|
+
V && /* @__PURE__ */ u(te, {
|
|
355
367
|
items: L,
|
|
356
368
|
highlightedIndex: z,
|
|
357
369
|
onSelect: X,
|
|
@@ -361,21 +373,21 @@ var _ = t.forwardRef(({ value: i, onChange: o, triggers: l = f, placeholder: p =
|
|
|
361
373
|
position: le,
|
|
362
374
|
visible: F
|
|
363
375
|
}),
|
|
364
|
-
(
|
|
376
|
+
(b || x) && /* @__PURE__ */ d("div", {
|
|
365
377
|
className: "flex items-center justify-between px-3 py-1.5 border-t bg-muted/30 text-xs text-muted-foreground",
|
|
366
378
|
children: [/* @__PURE__ */ u("div", {
|
|
367
379
|
className: "flex items-center gap-3",
|
|
368
|
-
children:
|
|
380
|
+
children: x && /* @__PURE__ */ d("span", {
|
|
369
381
|
className: e(ve && "text-destructive"),
|
|
370
382
|
children: [
|
|
371
383
|
/* @__PURE__ */ u(s, { className: "h-3 w-3 inline mr-1" }),
|
|
372
384
|
$,
|
|
373
|
-
|
|
385
|
+
y && ` / ${y}`
|
|
374
386
|
]
|
|
375
387
|
})
|
|
376
|
-
}),
|
|
388
|
+
}), b && /* @__PURE__ */ d("span", {
|
|
377
389
|
className: e(_e && "text-destructive"),
|
|
378
|
-
children: [Q,
|
|
390
|
+
children: [Q, v && ` / ${v}`]
|
|
379
391
|
})]
|
|
380
392
|
})
|
|
381
393
|
]
|
|
@@ -391,18 +403,18 @@ var _ = t.forwardRef(({ value: i, onChange: o, triggers: l = f, placeholder: p =
|
|
|
391
403
|
}, e.trigger))
|
|
392
404
|
})]
|
|
393
405
|
}),
|
|
394
|
-
|
|
406
|
+
_ && /* @__PURE__ */ u("p", {
|
|
395
407
|
className: "text-sm text-destructive",
|
|
396
|
-
children:
|
|
408
|
+
children: _
|
|
397
409
|
}),
|
|
398
|
-
|
|
410
|
+
ie && A && /* @__PURE__ */ d("div", {
|
|
399
411
|
className: "p-3 rounded-lg border bg-muted/30",
|
|
400
412
|
children: [/* @__PURE__ */ u("div", {
|
|
401
413
|
className: "text-xs text-muted-foreground mb-1.5",
|
|
402
414
|
children: "Preview"
|
|
403
415
|
}), /* @__PURE__ */ u("div", {
|
|
404
416
|
className: "text-sm whitespace-pre-wrap",
|
|
405
|
-
children: /* @__PURE__ */ u(
|
|
417
|
+
children: /* @__PURE__ */ u(h, {
|
|
406
418
|
text: A,
|
|
407
419
|
mentions: M,
|
|
408
420
|
triggers: l
|
|
@@ -431,6 +443,6 @@ var _ = t.forwardRef(({ value: i, onChange: o, triggers: l = f, placeholder: p =
|
|
|
431
443
|
]
|
|
432
444
|
});
|
|
433
445
|
});
|
|
434
|
-
|
|
446
|
+
g.displayName = "WakaMentionInput";
|
|
435
447
|
//#endregion
|
|
436
|
-
export {
|
|
448
|
+
export { g as WakaMentionInput, g as default, p as useMentionInput };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use client";const e=require(
|
|
1
|
+
"use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("react/jsx-runtime");function i(e,t){if(e===void 0||t===void 0||t===0)return{direction:`neutral`,percentage:0};let n=e-t,r=n/Math.abs(t)*100;return n>0?{direction:`up`,percentage:r}:n<0?{direction:`down`,percentage:Math.abs(r)}:{direction:`neutral`,percentage:0}}function a(e){let t=1/0,n=-1/0,r=0,i=0;return e.forEach((e,a)=>{e<t&&(t=e,r=a),e>n&&(n=e,i=a)}),{min:t,max:n,minIndex:r,maxIndex:i}}function o({direction:e,percentage:n,color:i}){let a=i||(e===`up`?`text-green-600`:e===`down`?`text-red-600`:`text-muted-foreground`),o=e===`up`?`↑`:e===`down`?`↓`:``;return e===`neutral`?null:(0,r.jsxs)(`span`,{className:t.cn(`inline-flex items-center text-xs font-medium`,a),style:i?{color:i}:void 0,children:[(0,r.jsx)(`span`,{className:`mr-0.5`,children:o}),(0,r.jsxs)(`span`,{children:[n.toFixed(1),`%`]})]})}function s({visible:e,x:n,y:i,value:a,index:o,formatValue:s,containerRef:c}){return e?(0,r.jsxs)(`div`,{className:t.cn(`absolute z-10 px-2 py-1 text-xs font-medium rounded-md shadow-lg`,`bg-foreground text-background`,`animate-in fade-in-0 zoom-in-95 duration-100`,`pointer-events-none whitespace-nowrap`),style:{left:n,top:i-30,transform:`translateX(-50%)`},children:[(0,r.jsx)(`div`,{children:s(a)}),(0,r.jsxs)(`div`,{className:`text-[10px] opacity-70`,children:[`Point `,o+1]}),(0,r.jsx)(`div`,{className:`absolute left-1/2 -translate-x-1/2 -bottom-1 w-2 h-2 rotate-45 bg-foreground`})]}):null}function c({data:e,width:t,height:i,color:o,animated:s,showMinMax:c,onHover:l}){let[u,d]=n.useState(0),[f,p]=n.useState(!s),m=n.useRef(null),h=t-4,g=i-4,{min:_,max:v,minIndex:y,maxIndex:b}=a(e),x=v-_||1,S=e.map((t,n)=>({x:2+n/(e.length-1)*h,y:2+g-(t-_)/x*g,value:t})),C=S.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `);return n.useEffect(()=>{m.current&&d(m.current.getTotalLength())},[e]),n.useEffect(()=>{if(s&&u>0){let e=setTimeout(()=>p(!0),50);return()=>clearTimeout(e)}},[s,u]),(0,r.jsxs)(`svg`,{width:t,height:i,className:`overflow-visible`,"aria-hidden":`true`,focusable:`false`,children:[(0,r.jsx)(`path`,{ref:m,d:C,fill:`none`,stroke:o,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:s&&u>0?{strokeDasharray:u,strokeDashoffset:f?0:u,transition:`stroke-dashoffset 1s ease-out`}:void 0}),c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`circle`,{cx:S[y].x,cy:S[y].y,r:`3`,fill:`white`,stroke:o,strokeWidth:`1.5`,className:`opacity-80`}),(0,r.jsx)(`circle`,{cx:S[b].x,cy:S[b].y,r:`3`,fill:o,stroke:`white`,strokeWidth:`1`})]}),S.map((e,t)=>(0,r.jsx)(`circle`,{cx:e.x,cy:e.y,r:`6`,fill:`transparent`,className:`cursor-pointer`,onMouseEnter:()=>l(t,e.x,e.y),onMouseLeave:()=>l(null,0,0)},t))]})}function l({data:e,width:i,height:o,color:s,animated:c,showMinMax:l,onHover:u}){let[d,f]=n.useState(!c),p=i-4,m=o-4,{min:h,max:g,minIndex:_,maxIndex:v}=a(e),y=g-h||1,b=e.map((t,n)=>({x:2+n/(e.length-1)*p,y:2+m-(t-h)/y*m,value:t})),x=b.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `),S=x+` L ${b[b.length-1].x} ${o-2} L ${b[0].x} ${o-2} Z`;return n.useEffect(()=>{if(c){let e=setTimeout(()=>f(!0),50);return()=>clearTimeout(e)}},[c]),(0,r.jsxs)(`svg`,{width:i,height:o,className:`overflow-visible`,"aria-hidden":`true`,focusable:`false`,children:[(0,r.jsx)(`defs`,{children:(0,r.jsxs)(`linearGradient`,{id:`area-gradient-${s.replace(`#`,``)}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,r.jsx)(`stop`,{offset:`0%`,stopColor:s,stopOpacity:`0.3`}),(0,r.jsx)(`stop`,{offset:`100%`,stopColor:s,stopOpacity:`0.05`})]})}),(0,r.jsx)(`path`,{d:S,fill:`url(#area-gradient-${s.replace(`#`,``)})`,className:t.cn(`transition-opacity duration-500`,d?`opacity-100`:`opacity-0`)}),(0,r.jsx)(`path`,{d:x,fill:`none`,stroke:s,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t.cn(`transition-opacity duration-500`,d?`opacity-100`:`opacity-0`)}),l&&d&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`circle`,{cx:b[_].x,cy:b[_].y,r:`3`,fill:`white`,stroke:s,strokeWidth:`1.5`,className:`opacity-80`}),(0,r.jsx)(`circle`,{cx:b[v].x,cy:b[v].y,r:`3`,fill:s,stroke:`white`,strokeWidth:`1`})]}),b.map((e,t)=>(0,r.jsx)(`circle`,{cx:e.x,cy:e.y,r:`6`,fill:`transparent`,className:`cursor-pointer`,onMouseEnter:()=>u(t,e.x,e.y),onMouseLeave:()=>u(null,0,0)},t))]})}function u({data:e,width:i,height:o,color:s,animated:c,showMinMax:l,onHover:u}){let[d,f]=n.useState(!c),p=i-4,m=o-4,{min:h,max:g,minIndex:_,maxIndex:v}=a(e),y=g-h||1,b=Math.max(2,p/e.length*.7),x=(p-b*e.length)/(e.length-1||1),S=e.map((e,t)=>{let n=(e-h)/y*m;return{x:2+t*(b+x),y:2+m-n,width:b,height:n,value:e}});return n.useEffect(()=>{if(c){let e=setTimeout(()=>f(!0),50);return()=>clearTimeout(e)}},[c]),(0,r.jsx)(`svg`,{width:i,height:o,className:`overflow-visible`,"aria-hidden":`true`,focusable:`false`,children:S.map((e,n)=>(0,r.jsxs)(`g`,{children:[(0,r.jsx)(`rect`,{x:e.x,y:d?e.y:o-2,width:e.width,height:d?e.height:0,fill:s,rx:`1`,className:t.cn(`transition-all duration-500 ease-out cursor-pointer`,l&&n===_&&`opacity-50`,l&&n===v&&`opacity-100`),style:c?{transitionDelay:`${n*30}ms`}:void 0,onMouseEnter:()=>u(n,e.x+e.width/2,e.y),onMouseLeave:()=>u(null,0,0)}),l&&d&&(n===_||n===v)&&(0,r.jsx)(`circle`,{cx:e.x+e.width/2,cy:n===v?e.y-4:e.y+e.height+4,r:`2`,fill:n===v?s:`white`,stroke:s,strokeWidth:`1`})]},n))})}function d({data:e,value:a,previousValue:d,variant:f=`line`,width:p=80,height:m=24,color:h,showTrend:g=!0,showValue:_=!0,showMinMax:v=!1,animated:y=!0,formatValue:b=e=>e.toLocaleString(),className:x}){let S=n.useRef(null),[C,w]=n.useState({visible:!1,index:0,x:0,y:0,value:0});if(!e||e.length===0)return(0,r.jsx)(`div`,{className:t.cn(`inline-flex items-center gap-2 text-muted-foreground text-sm`,x),children:`No data`});let T=a??e[e.length-1],E=i(T,d??(e.length>1?e[e.length-2]:void 0)),D=h||(E.direction===`up`?`#22c55e`:E.direction===`down`?`#ef4444`:`#6b7280`),O=(t,n,r)=>{w(t===null?e=>({...e,visible:!1}):{visible:!0,index:t,x:n,y:r,value:e[t]})},k=f===`bar`?u:f===`area`?l:c;return(0,r.jsxs)(`div`,{ref:S,className:t.cn(`inline-flex items-center gap-2`,x),children:[_&&(0,r.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:b(T)}),(0,r.jsxs)(`div`,{className:`relative`,children:[(0,r.jsx)(k,{data:e,width:p,height:m,color:D,animated:y,showMinMax:v,onHover:O}),(0,r.jsx)(s,{visible:C.visible,x:C.x,y:C.y,value:C.value,index:C.index,formatValue:b,containerRef:S})]}),g&&E.direction!==`neutral`&&(0,r.jsx)(o,{direction:E.direction,percentage:E.percentage,color:h})]})}function f(e={}){let{initialData:t=[],maxPoints:r=20}=e,[i,a]=n.useState(t);return{data:i,setData:a,addPoint:n.useCallback(e=>{a(t=>{let n=[...t,e];return n.length>r?n.slice(-r):n})},[r]),reset:n.useCallback(()=>{a(t)},[t]),clear:n.useCallback(()=>{a([])},[]),currentValue:i[i.length-1],previousValue:i.length>1?i[i.length-2]:void 0}}exports.WakaMetricSparkline=d,exports.default=d,exports.useSparklineData=f;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use client";const e=require(
|
|
1
|
+
"use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../badge/index.cjs.js"),r=require("../button/index.cjs.js"),i=require("../dropdown-menu/index.cjs.js"),a=require("../scroll-area/index.cjs.js");let o=require("react");o=e.__toESM(o);let s=require("lucide-react"),c=require("react/jsx-runtime");var l={pending:{label:`Pending`,icon:s.Clock,color:`text-muted-foreground`,bgColor:`bg-muted`},applied:{label:`Applied`,icon:s.CheckCircle2,color:`text-green-500`,bgColor:`bg-green-500/10`},failed:{label:`Failed`,icon:s.XCircle,color:`text-red-500`,bgColor:`bg-red-500/10`},rolled_back:{label:`Rolled Back`,icon:s.RotateCcw,color:`text-yellow-500`,bgColor:`bg-yellow-500/10`},running:{label:`Running`,icon:s.Play,color:`text-blue-500`,bgColor:`bg-blue-500/10`}};function u(e){return e.toLocaleDateString(`fr-FR`,{day:`2-digit`,month:`short`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})}function d(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.floor(e%6e4/1e3)}s`}function f({migration:e,isCurrentVersion:a,onApply:f,onRollback:p,onViewDetails:m,showScripts:h}){let[g,_]=o.useState(!1),v=l[e.status],y=v.icon,b=e.status===`pending`||e.status===`rolled_back`,x=e.status===`applied`;return(0,c.jsxs)(`div`,{className:t.cn(`border-b last:border-b-0`,a&&`bg-primary/5 border-primary/30`,e.status===`failed`&&`bg-red-500/5`),children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-3 p-3`,children:[h&&(e.upScript||e.downScript)&&(0,c.jsx)(`button`,{className:`text-muted-foreground hover:text-foreground transition-colors`,onClick:()=>_(!g),children:g?(0,c.jsx)(s.ChevronDown,{className:`h-4 w-4`}):(0,c.jsx)(s.ChevronRight,{className:`h-4 w-4`})}),(0,c.jsx)(`div`,{className:t.cn(`p-1.5 rounded`,v.bgColor),children:(0,c.jsx)(y,{className:t.cn(`h-4 w-4`,v.color)})}),(0,c.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,c.jsx)(`code`,{className:`font-semibold text-sm`,children:e.version}),a&&(0,c.jsx)(n.Badge,{className:`bg-primary text-xs`,children:`Current`}),(0,c.jsx)(`span`,{className:`font-medium truncate`,children:e.name})]}),e.description&&(0,c.jsx)(`p`,{className:`text-sm text-muted-foreground truncate mt-0.5`,children:e.description})]}),(0,c.jsxs)(`div`,{className:`flex items-center gap-4 text-xs text-muted-foreground shrink-0`,children:[e.author&&(0,c.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,c.jsx)(s.User,{className:`h-3 w-3`}),e.author]}),e.appliedAt&&(0,c.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,c.jsx)(s.Calendar,{className:`h-3 w-3`}),u(e.appliedAt)]}),e.duration!==void 0&&(0,c.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,c.jsx)(s.Timer,{className:`h-3 w-3`}),d(e.duration)]})]}),(0,c.jsx)(n.Badge,{variant:`outline`,className:t.cn(`shrink-0`,v.color),children:v.label}),(0,c.jsxs)(i.DropdownMenu,{children:[(0,c.jsx)(i.DropdownMenuTrigger,{asChild:!0,children:(0,c.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,children:(0,c.jsx)(s.MoreVertical,{className:`h-4 w-4`})})}),(0,c.jsxs)(i.DropdownMenuContent,{align:`end`,children:[m&&(0,c.jsxs)(i.DropdownMenuItem,{onClick:()=>m(e),children:[(0,c.jsx)(s.FileCode,{className:`h-4 w-4 mr-2`}),`View Details`]}),f&&b&&(0,c.jsxs)(i.DropdownMenuItem,{onClick:()=>f(e),children:[(0,c.jsx)(s.ArrowUp,{className:`h-4 w-4 mr-2`}),`Apply Migration`]}),p&&x&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(i.DropdownMenuSeparator,{}),(0,c.jsxs)(i.DropdownMenuItem,{onClick:()=>p(e),className:`text-destructive`,children:[(0,c.jsx)(s.ArrowDown,{className:`h-4 w-4 mr-2`}),`Rollback`]})]})]})]})]}),e.status===`failed`&&e.error&&(0,c.jsx)(`div`,{className:`px-3 pb-3`,children:(0,c.jsxs)(`div`,{className:`flex items-start gap-2 p-2 bg-red-500/10 rounded text-sm text-red-500`,children:[(0,c.jsx)(s.AlertTriangle,{className:`h-4 w-4 shrink-0 mt-0.5`}),(0,c.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs`,children:e.error})]})}),h&&g&&(0,c.jsxs)(`div`,{className:`px-3 pb-3 space-y-3`,children:[e.upScript&&(0,c.jsxs)(`div`,{children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground mb-1`,children:[(0,c.jsx)(s.ArrowUp,{className:`h-3 w-3`}),`Up Migration`]}),(0,c.jsx)(`pre`,{className:`p-2 bg-muted rounded text-xs font-mono overflow-x-auto`,children:e.upScript})]}),e.downScript&&(0,c.jsxs)(`div`,{children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground mb-1`,children:[(0,c.jsx)(s.ArrowDown,{className:`h-3 w-3`}),`Down Migration (Rollback)`]}),(0,c.jsx)(`pre`,{className:`p-2 bg-muted rounded text-xs font-mono overflow-x-auto`,children:e.downScript})]})]})]})}function p({migrations:e,onApply:i,onRollback:u,onViewDetails:d,currentVersion:p,showScripts:m=!1,title:h=`Migrations`,className:g}){let[_,v]=o.useState(`all`),y=o.useMemo(()=>({total:e.length,pending:e.filter(e=>e.status===`pending`).length,applied:e.filter(e=>e.status===`applied`).length,failed:e.filter(e=>e.status===`failed`).length}),[e]),b=o.useMemo(()=>_===`all`?e:e.filter(e=>e.status===_),[e,_]),x=o.useMemo(()=>[...b].sort((e,t)=>t.version.localeCompare(e.version)),[b]);return(0,c.jsxs)(`div`,{className:t.cn(`flex flex-col border rounded-lg bg-background`,g),children:[(0,c.jsxs)(`div`,{className:`flex items-center justify-between gap-4 p-3 border-b`,children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,c.jsx)(s.Database,{className:`h-5 w-5`}),(0,c.jsx)(`h3`,{className:`font-semibold`,children:h}),(0,c.jsx)(n.Badge,{variant:`secondary`,children:y.total}),p&&(0,c.jsxs)(n.Badge,{variant:`outline`,className:`text-xs`,children:[`v`,p]})]}),(0,c.jsxs)(`div`,{className:`flex items-center gap-2`,children:[y.pending>0&&(0,c.jsxs)(n.Badge,{variant:`outline`,children:[y.pending,` pending`]}),y.failed>0&&(0,c.jsxs)(n.Badge,{className:`bg-red-500`,children:[y.failed,` failed`]})]})]}),(0,c.jsxs)(`div`,{className:`flex items-center gap-2 p-2 border-b bg-muted/30`,children:[(0,c.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Filter:`}),[`all`,`pending`,`applied`,`failed`,`rolled_back`].map(e=>(0,c.jsx)(r.Button,{variant:_===e?`default`:`ghost`,size:`sm`,className:`h-7 text-xs`,onClick:()=>v(e),children:e===`all`?`All`:l[e].label},e))]}),(0,c.jsx)(a.ScrollArea,{className:`flex-1 max-h-[500px]`,children:x.length===0?(0,c.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-32 text-muted-foreground`,children:[(0,c.jsx)(s.Database,{className:`h-8 w-8 mb-2`}),(0,c.jsx)(`span`,{children:`No migrations found`})]}):x.map(e=>(0,c.jsx)(f,{migration:e,isCurrentVersion:e.version===p,onApply:i,onRollback:u,onViewDetails:d,showScripts:m},e.id))}),y.pending>0&&i&&(0,c.jsx)(`div`,{className:`p-3 border-t bg-muted/30`,children:(0,c.jsxs)(r.Button,{size:`sm`,onClick:()=>{e.filter(e=>e.status===`pending`).forEach(e=>i(e))},children:[(0,c.jsx)(s.ArrowUp,{className:`h-4 w-4 mr-1`}),`Apply All Pending (`,y.pending,`)`]})})]})}var m=[{id:`1`,version:`20240115_001`,name:`create_users_table`,description:`Create users table with basic fields`,status:`applied`,appliedAt:new Date(Date.now()-720*36e5),duration:125,author:`john.doe`,upScript:`CREATE TABLE users (
|
|
2
2
|
id SERIAL PRIMARY KEY,
|
|
3
3
|
email VARCHAR(255) UNIQUE NOT NULL,
|
|
4
4
|
name VARCHAR(255),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use client";const e=require(
|
|
1
|
+
"use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("lucide-react"),i=require("react/jsx-runtime");var a={default:{roadColor:`#6b7280`,progressColor:`#3b82f6`,completedColor:`#22c55e`,currentColor:`#f59e0b`,lockedColor:`#9ca3af`,gradient:`from-blue-500 to-purple-600`,glow:`#3b82f6`},gold:{roadColor:`#78716c`,progressColor:`#f59e0b`,completedColor:`#22c55e`,currentColor:`#eab308`,lockedColor:`#a8a29e`,gradient:`from-yellow-400 to-orange-500`,glow:`#f59e0b`},purple:{roadColor:`#6b7280`,progressColor:`#a855f7`,completedColor:`#22c55e`,currentColor:`#c084fc`,lockedColor:`#9ca3af`,gradient:`from-purple-500 to-pink-600`,glow:`#a855f7`},green:{roadColor:`#6b7280`,progressColor:`#22c55e`,completedColor:`#10b981`,currentColor:`#4ade80`,lockedColor:`#9ca3af`,gradient:`from-green-500 to-emerald-600`,glow:`#22c55e`},blue:{roadColor:`#6b7280`,progressColor:`#06b6d4`,completedColor:`#22c55e`,currentColor:`#22d3ee`,lockedColor:`#9ca3af`,gradient:`from-cyan-500 to-blue-600`,glow:`#06b6d4`}},o={xp:r.Zap,badge:r.Award,item:r.Gift,currency:r.Gem,unlock:r.Lock};function s({active:e,onComplete:t}){let[a,o]=n.useState(!1);if(n.useEffect(()=>{if(e){o(!0);let e=setTimeout(()=>{o(!1),t?.()},1500);return()=>clearTimeout(e)}},[e,t]),!a)return null;let s=[`#fbbf24`,`#f59e0b`,`#22c55e`,`#3b82f6`,`#a855f7`,`#ec4899`];return(0,i.jsxs)(`div`,{className:`pointer-events-none absolute inset-0 overflow-hidden`,children:[[...Array(24)].map((e,t)=>{let n=t/24*360,r=60+Math.random()*40,a=4+Math.random()*6;return(0,i.jsx)(`div`,{className:`absolute left-1/2 top-1/2 animate-milestone-confetti`,style:{width:a,height:a,backgroundColor:s[Math.floor(Math.random()*s.length)],borderRadius:Math.random()>.5?`50%`:`2px`,"--angle":`${n}deg`,"--distance":`${r}px`,animationDelay:`${Math.random()*.2}s`}},t)}),[...Array(8)].map((e,t)=>(0,i.jsx)(r.Sparkles,{className:`absolute animate-milestone-sparkle text-yellow-400`,style:{left:`${20+Math.random()*60}%`,top:`${20+Math.random()*60}%`,animationDelay:`${t*.1}s`,width:16,height:16}},`sparkle-${t}`)),(0,i.jsx)(`style`,{children:`
|
|
2
2
|
@keyframes milestone-confetti {
|
|
3
3
|
0% {
|
|
4
4
|
transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) scale(1);
|
|
@@ -42,4 +42,4 @@
|
|
|
42
42
|
.animate-character-bounce {
|
|
43
43
|
animation: character-bounce 1s ease-in-out infinite;
|
|
44
44
|
}
|
|
45
|
-
`})]})}function d(e,t,n=5){let r=[],i=[],a=e*.25,o=t/n,s=e/2,c=t-40;i.push(`M ${s} ${c}`),r.push({x:s,y:c,t:0});for(let t=0;t<n;t++){let l=t%2==0?1:-1,u=c-o,d=s+a*l,f=e/2+a*.5*l*(t%2==0?-1:1),p=s,m=c-o*.3,h=d,g=u+o*.3;i.push(`C ${p} ${m}, ${h} ${g}, ${f} ${u}`);let _=(t+1)/n,v=(c+u)/2,y=s+(d-s)*.5;r.push({x:y,y:v,t:_-.5/n}),r.push({x:f,y:u,t:_}),s=f,c=u}return i.push(`L ${s} 40`),r.push({x:s,y:40,t:1}),{path:i.join(` `),points:r}}function f(e,t){let n=t/2,r=e-60,i=`M 60 ${n} L ${r} ${n}`,a=[];for(let e=0;e<=10;e++){let t=e/10;a.push({x:60+(r-60)*t,y:n,t})}return{path:i,points:a}}function p(e,t){let n=e/2,r=t-60,i=`M ${n} ${r} L ${n} 60`,a=[];for(let e=0;e<=10;e++){let t=e/10;a.push({x:n,y:r+(60-r)*t,t})}return{path:i,points:a}}function m({progress:e,theme:n}){let o=a[n];return(0,i.jsxs)(`div`,{className:`absolute top-4 right-4 flex items-center gap-2 rounded-full border bg-background/90 backdrop-blur-sm px-4 py-2 shadow-lg`,children:[(0,i.jsx)(`div`,{className:t.cn(`flex h-8 w-8 items-center justify-center rounded-full bg-gradient-to-br`,o.gradient),children:(0,i.jsx)(r.Flag,{className:`h-4 w-4 text-white`})}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Journey Progress`}),(0,i.jsxs)(`div`,{className:`text-lg font-bold tabular-nums`,children:[Math.round(e),`%`]})]})]})}function h({milestones:e,progress:o,onMilestoneClick:s,onClaimRewards:c,variant:h=`winding`,theme:g=`default`,animated:_=!0,showCharacter:v=!0,character:y,showProgressLabel:b=!0,className:x}){let[S,C]=n.useState(0),w=n.useRef(null),[T,E]=n.useState({width:600,height:500}),D=a[g];n.useEffect(()=>{if(!_){C(o);return}let e=S,t=o-e,n=Date.now(),r=()=>{let i=Date.now()-n,a=Math.min(i/1e3,1)
|
|
45
|
+
`})]})}function d(e,t,n=5){let r=[],i=[],a=e*.25,o=t/n,s=e/2,c=t-40;i.push(`M ${s} ${c}`),r.push({x:s,y:c,t:0});for(let t=0;t<n;t++){let l=t%2==0?1:-1,u=c-o,d=s+a*l,f=e/2+a*.5*l*(t%2==0?-1:1),p=s,m=c-o*.3,h=d,g=u+o*.3;i.push(`C ${p} ${m}, ${h} ${g}, ${f} ${u}`);let _=(t+1)/n,v=(c+u)/2,y=s+(d-s)*.5;r.push({x:y,y:v,t:_-.5/n}),r.push({x:f,y:u,t:_}),s=f,c=u}return i.push(`L ${s} 40`),r.push({x:s,y:40,t:1}),{path:i.join(` `),points:r}}function f(e,t){let n=t/2,r=e-60,i=`M 60 ${n} L ${r} ${n}`,a=[];for(let e=0;e<=10;e++){let t=e/10;a.push({x:60+(r-60)*t,y:n,t})}return{path:i,points:a}}function p(e,t){let n=e/2,r=t-60,i=`M ${n} ${r} L ${n} 60`,a=[];for(let e=0;e<=10;e++){let t=e/10;a.push({x:n,y:r+(60-r)*t,t})}return{path:i,points:a}}function m({progress:e,theme:n}){let o=a[n];return(0,i.jsxs)(`div`,{className:`absolute top-4 right-4 flex items-center gap-2 rounded-full border bg-background/90 backdrop-blur-sm px-4 py-2 shadow-lg`,children:[(0,i.jsx)(`div`,{className:t.cn(`flex h-8 w-8 items-center justify-center rounded-full bg-gradient-to-br`,o.gradient),children:(0,i.jsx)(r.Flag,{className:`h-4 w-4 text-white`})}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Journey Progress`}),(0,i.jsxs)(`div`,{className:`text-lg font-bold tabular-nums`,children:[Math.round(e),`%`]})]})]})}function h({milestones:e,progress:o,onMilestoneClick:s,onClaimRewards:c,variant:h=`winding`,theme:g=`default`,animated:_=!0,showCharacter:v=!0,character:y,showProgressLabel:b=!0,className:x}){let[S,C]=n.useState(0),w=n.useRef(null),[T,E]=n.useState({width:600,height:500}),D=a[g];n.useEffect(()=>{if(!_){C(o);return}let e=S,t=o-e,n=Date.now(),r=()=>{let i=Date.now()-n,a=Math.min(i/1e3,1),o=1-(1-a)**3;C(e+t*o),a<1&&requestAnimationFrame(r)};requestAnimationFrame(r)},[o,_]),n.useEffect(()=>{let e=()=>{if(w.current){let e=w.current.getBoundingClientRect();E({width:Math.max(e.width,400),height:Math.max(e.height,400)})}};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let{path:O,points:k}=n.useMemo(()=>{switch(h){case`horizontal`:return f(T.width,T.height);case`vertical`:return p(T.width,T.height);default:return d(T.width,T.height)}},[h,T]),A=n.useMemo(()=>e.map((t,n)=>{let r=t.position===void 0?n/Math.max(e.length-1,1):t.position/100,i=k[0],a=1/0;for(let e of k){let t=Math.abs(e.t-r);t<a&&(a=t,i=e)}return{milestone:t,position:i}}),[e,k]),j=n.useMemo(()=>{let e=S/100,t=k[0],n=1/0;for(let r of k){let i=Math.abs(r.t-e);i<n&&(n=i,t=r)}for(let t=0;t<k.length-1;t++){let n=k[t],r=k[t+1];if(e>=n.t&&e<=r.t){let t=(e-n.t)/(r.t-n.t);return{x:n.x+(r.x-n.x)*t,y:n.y+(r.y-n.y)*t}}}return t},[S,k]),M=1e3;return(0,i.jsxs)(`div`,{ref:w,className:t.cn(`relative overflow-hidden rounded-xl border bg-card`,x),style:{minHeight:400},children:[b&&(0,i.jsx)(m,{progress:S,theme:g}),(0,i.jsxs)(`svg`,{width:T.width,height:T.height,className:`absolute inset-0`,"aria-hidden":`true`,focusable:`false`,children:[(0,i.jsxs)(`defs`,{children:[Object.entries(a).map(([e,t])=>(0,i.jsxs)(`linearGradient`,{id:`milestone-gradient-${e}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`100%`,children:[(0,i.jsx)(`stop`,{offset:`0%`,stopColor:t.progressColor}),(0,i.jsx)(`stop`,{offset:`100%`,stopColor:t.completedColor})]},`milestone-gradient-${e}`)),(0,i.jsx)(`filter`,{id:`road-shadow`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:(0,i.jsx)(`feDropShadow`,{dx:`0`,dy:`2`,stdDeviation:`3`,floodOpacity:`0.3`})}),(0,i.jsxs)(`filter`,{id:`glow`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:[(0,i.jsx)(`feGaussianBlur`,{stdDeviation:`4`,result:`coloredBlur`}),(0,i.jsxs)(`feMerge`,{children:[(0,i.jsx)(`feMergeNode`,{in:`coloredBlur`}),(0,i.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]})]}),(0,i.jsx)(`path`,{d:O,fill:`none`,stroke:D.roadColor,strokeWidth:30,strokeLinecap:`round`,strokeLinejoin:`round`,opacity:.2,filter:`url(#road-shadow)`}),(0,i.jsx)(`path`,{d:O,fill:`none`,stroke:D.roadColor,strokeWidth:24,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,i.jsx)(`path`,{d:O,fill:`none`,stroke:`rgba(255,255,255,0.3)`,strokeWidth:2,strokeLinecap:`round`,strokeDasharray:`12 8`}),(0,i.jsx)(`path`,{d:O,fill:`none`,stroke:D.progressColor,strokeWidth:24,strokeLinecap:`round`,strokeLinejoin:`round`,strokeDasharray:M,strokeDashoffset:M*(1-S/100),filter:`url(#glow)`,opacity:.8,className:`transition-all duration-300`}),A.map(({milestone:e,position:t})=>(0,i.jsx)(l,{milestone:e,position:t,theme:g,animated:_,onClick:()=>s?.(e),onClaimRewards:()=>c?.(e.id)},e.id)),v&&(0,i.jsx)(u,{position:j,theme:g,animated:_,children:y}),(0,i.jsxs)(`g`,{transform:`translate(${k[0].x}, ${k[0].y})`,children:[(0,i.jsx)(`circle`,{r:16,fill:D.roadColor,opacity:.3}),(0,i.jsx)(`g`,{transform:`translate(-8, -8)`,children:(0,i.jsx)(r.Flag,{className:`h-4 w-4 text-muted-foreground`})})]}),(0,i.jsxs)(`g`,{transform:`translate(${k[k.length-1].x}, ${k[k.length-1].y})`,children:[(0,i.jsx)(`circle`,{r:20,fill:D.currentColor,opacity:.3}),(0,i.jsx)(`circle`,{r:16,fill:D.currentColor,opacity:.6}),(0,i.jsx)(`g`,{transform:`translate(-10, -10)`,children:(0,i.jsx)(r.Trophy,{className:`h-5 w-5 text-white`})})]})]}),(0,i.jsxs)(`div`,{className:`absolute bottom-4 left-4 flex flex-wrap items-center gap-3 rounded-lg border bg-background/90 backdrop-blur-sm px-3 py-2 text-xs`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,i.jsx)(`div`,{className:`h-3 w-3 rounded-full`,style:{backgroundColor:D.completedColor}}),(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Completed`})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,i.jsx)(`div`,{className:`h-3 w-3 rounded-full border-2`,style:{borderColor:D.currentColor,backgroundColor:`${D.currentColor}30`}}),(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Current`})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,i.jsx)(`div`,{className:`h-3 w-3 rounded-full border-2 border-muted-foreground/30`}),(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Locked`})]})]}),(0,i.jsx)(`div`,{className:`absolute top-4 left-4 flex items-center gap-4`,children:(0,i.jsxs)(`div`,{className:`flex items-center gap-2 rounded-full border bg-background/90 backdrop-blur-sm px-3 py-1.5`,children:[(0,i.jsx)(r.Star,{className:`h-4 w-4 text-yellow-500`,fill:`currentColor`}),(0,i.jsxs)(`span`,{className:`text-sm font-medium`,children:[e.filter(e=>e.completed).length,`/`,e.length]})]})})]})}function g({initialMilestones:e,onMilestoneComplete:t,onRewardsClaimed:r,autoCalculateProgress:i=!0}){let[a,o]=n.useState(e),[s,c]=n.useState(0),[l,u]=n.useState(new Set),d=n.useRef(new Map);n.useEffect(()=>{if(i){let e=a.filter(e=>e.completed).length,t=a.length>0?e/a.length*100:0;c(t)}},[a,i]),n.useEffect(()=>{a.forEach(e=>{let n=d.current.get(e.id);e.completed&&!n&&t?.(e),d.current.set(e.id,e.completed)})},[a,t]);let f=n.useMemo(()=>a.find(e=>!e.completed)||a[a.length-1],[a]),p=n.useMemo(()=>a.map(e=>({...e,isCurrent:e.id===f?.id})),[a,f]),m=n.useCallback(e=>{o(t=>t.map(t=>t.id===e?{...t,completed:!0}:t))},[]),h=n.useCallback(e=>{let t=a.find(t=>t.id===e);t&&t.rewards&&!l.has(e)&&(u(t=>new Set([...t,e])),r?.(e,t.rewards))},[a,l,r]),g=n.useCallback(e=>{i||c(Math.max(0,Math.min(100,e)))},[i]),_=n.useCallback(()=>{o(e.map(e=>({...e,completed:!1}))),u(new Set),c(0),d.current.clear()},[e]),v=n.useMemo(()=>a.filter(e=>e.completed&&e.rewards&&!l.has(e.id)).flatMap(e=>e.rewards||[]),[a,l]);return{milestones:p,progress:s,currentMilestone:f,completeMilestone:m,claimRewards:h,setProgress:g,reset:_,completedCount:a.filter(e=>e.completed).length,totalCount:a.length,unclaimedRewards:v,hasUnclaimedRewards:v.length>0}}exports.WakaMilestoneRoad=h,exports.useMilestoneRoad=g;
|
|
@@ -346,8 +346,8 @@ function D({ milestones: n, progress: r, onMilestoneClick: a, onClaimRewards: o,
|
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
348
|
let e = y, t = r - e, n = Date.now(), i = () => {
|
|
349
|
-
let r = Date.now() - n, a = Math.min(r / 1e3, 1);
|
|
350
|
-
b(e + t *
|
|
349
|
+
let r = Date.now() - n, a = Math.min(r / 1e3, 1), o = 1 - (1 - a) ** 3;
|
|
350
|
+
b(e + t * o), a < 1 && requestAnimationFrame(i);
|
|
351
351
|
};
|
|
352
352
|
requestAnimationFrame(i);
|
|
353
353
|
}, [r, l]), t.useEffect(() => {
|
|
@@ -596,8 +596,8 @@ function O({ initialMilestones: e, onMilestoneComplete: n, onRewardsClaimed: r,
|
|
|
596
596
|
let [a, o] = t.useState(e), [s, c] = t.useState(0), [l, u] = t.useState(/* @__PURE__ */ new Set()), d = t.useRef(/* @__PURE__ */ new Map());
|
|
597
597
|
t.useEffect(() => {
|
|
598
598
|
if (i) {
|
|
599
|
-
let e = a.filter((e) => e.completed).length;
|
|
600
|
-
c(
|
|
599
|
+
let e = a.filter((e) => e.completed).length, t = a.length > 0 ? e / a.length * 100 : 0;
|
|
600
|
+
c(t);
|
|
601
601
|
}
|
|
602
602
|
}, [a, i]), t.useEffect(() => {
|
|
603
603
|
a.forEach((e) => {
|
|
@@ -615,7 +615,7 @@ function O({ initialMilestones: e, onMilestoneComplete: n, onRewardsClaimed: r,
|
|
|
615
615
|
} : t));
|
|
616
616
|
}, []), h = t.useCallback((e) => {
|
|
617
617
|
let t = a.find((t) => t.id === e);
|
|
618
|
-
t && t.rewards && !l.has(e) && (u((t) => new Set([...t, e])), r?.(e, t.rewards));
|
|
618
|
+
t && t.rewards && !l.has(e) && (u((t) => /* @__PURE__ */ new Set([...t, e])), r?.(e, t.rewards));
|
|
619
619
|
}, [
|
|
620
620
|
a,
|
|
621
621
|
l,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use client";const e=require(
|
|
1
|
+
"use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("lucide-react"),i=require("react/jsx-runtime"),a=require("@radix-ui/react-dialog");a=e.__toESM(a);var o={sm:`max-w-sm`,md:`max-w-md`,lg:`max-w-lg`,xl:`max-w-xl`,full:`max-w-[calc(100vw-2rem)] max-h-[calc(100vh-2rem)]`},s={fade:`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,slide:`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,scale:`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,none:``},c={fade:`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,slide:`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:slide-out-to-top-[2%] data-[state=open]:slide-in-from-top-[2%]`,scale:`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,none:``},l=n.forwardRef(({className:e,animation:n=`fade`,...r},o)=>(0,i.jsx)(a.Overlay,{ref:o,className:t.cn(`fixed inset-0 z-50 bg-black/80`,s[n],e),...r}));l.displayName=`ModalOverlay`;var u=n.forwardRef(({className:e,children:n,size:s=`md`,animation:l=`fade`,centered:u=!0,showCloseButton:d=!0,...f},p)=>(0,i.jsxs)(a.Content,{ref:p,className:t.cn(`fixed z-50 w-full bg-background shadow-lg sm:rounded-lg`,`left-1/2 -translate-x-1/2`,u?`top-1/2 -translate-y-1/2`:`top-[10%]`,o[s],c[l],`duration-200`,e),...f,children:[n,d&&(0,i.jsxs)(a.Close,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,i.jsx)(r.X,{className:`h-4 w-4`}),(0,i.jsx)(`span`,{className:`sr-only`,children:`Fermer`})]})]}));u.displayName=`ModalContent`;var d=n.forwardRef(({className:e,sticky:n,...r},a)=>(0,i.jsx)(`div`,{ref:a,className:t.cn(`flex flex-col space-y-1.5 p-6 pb-4`,n&&`sticky top-0 bg-background z-10 border-b`,e),...r}));d.displayName=`ModalHeader`;var f=n.forwardRef(({className:e,...n},r)=>(0,i.jsx)(a.Title,{ref:r,className:t.cn(`text-lg font-semibold leading-none tracking-tight`,e),...n}));f.displayName=`ModalTitle`;var p=n.forwardRef(({className:e,...n},r)=>(0,i.jsx)(a.Description,{ref:r,className:t.cn(`text-sm text-muted-foreground`,e),...n}));p.displayName=`ModalDescription`;var m=n.forwardRef(({className:e,...n},r)=>(0,i.jsx)(`div`,{ref:r,className:t.cn(`px-6 py-4 overflow-auto`,e),...n}));m.displayName=`ModalBody`;var h=n.forwardRef(({className:e,sticky:n,...r},a)=>(0,i.jsx)(`div`,{ref:a,className:t.cn(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 p-6 pt-4`,n&&`sticky bottom-0 bg-background z-10 border-t`,e),...r}));h.displayName=`ModalFooter`;function g({open:e,onOpenChange:t,title:n,description:r,children:o,size:s=`md`,showCloseButton:c=!0,closeOnOverlayClick:g=!0,closeOnEscape:_=!0,animation:v=`scale`,centered:y=!0,stickyHeader:b=!1,stickyFooter:x=!1,footer:S,className:C,overlayClassName:w}){return(0,i.jsx)(a.Root,{open:e,onOpenChange:t,children:(0,i.jsxs)(a.Portal,{children:[(0,i.jsx)(l,{animation:v,className:w}),(0,i.jsxs)(u,{size:s,animation:v,centered:y,showCloseButton:c,className:C,onInteractOutside:e=>{g||e.preventDefault()},onEscapeKeyDown:e=>{_||e.preventDefault()},"aria-describedby":r?void 0:`modal-description`,children:[!n&&(0,i.jsx)(f,{className:`sr-only`,children:`Fenêtre modale`}),!r&&(0,i.jsx)(p,{id:`modal-description`,className:`sr-only`,children:`Contenu de la fenêtre modale`}),(n||r)&&(0,i.jsxs)(d,{sticky:b,children:[n&&(0,i.jsx)(f,{children:n}),r&&(0,i.jsx)(p,{children:r})]}),(0,i.jsx)(m,{children:o}),S&&(0,i.jsx)(h,{sticky:x,children:S})]})]})})}function _({children:e,onOpen:t,className:n,disabled:r}){return(0,i.jsx)(a.Trigger,{className:n,disabled:r,onClick:t,asChild:!0,children:e})}function v(e){let{defaultOpen:t=!1,onOpenChange:r}=e||{},[i,a]=n.useState(t);return{isOpen:i,open:n.useCallback(()=>{a(!0),r?.(!0)},[r]),close:n.useCallback(()=>{a(!1),r?.(!1)},[r]),toggle:n.useCallback(()=>{a(e=>{let t=!e;return r?.(t),t})},[r]),onOpenChange:n.useCallback(e=>{a(e),r?.(e)},[r])}}exports.ModalBody=m,exports.ModalContent=u,exports.ModalDescription=p,exports.ModalFooter=h,exports.ModalHeader=d,exports.ModalOverlay=l,exports.ModalTitle=f,exports.WakaModal=g,exports.default=g,exports.WakaModalTrigger=_,exports.useModal=v;
|
|
@@ -145,4 +145,4 @@ function v(e) {
|
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
147
|
//#endregion
|
|
148
|
-
export { m as ModalBody, u as ModalContent, p as ModalDescription, h as ModalFooter, d as ModalHeader, l as ModalOverlay, f as ModalTitle,
|
|
148
|
+
export { m as ModalBody, u as ModalContent, p as ModalDescription, h as ModalFooter, d as ModalHeader, l as ModalOverlay, f as ModalTitle, g as WakaModal, g as default, _ as WakaModalTrigger, v as useModal };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use client";const e=require(
|
|
1
|
+
"use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("class-variance-authority"),i=require("react/jsx-runtime");var a=(0,r.cva)(`relative inline-flex items-center justify-center overflow-hidden font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none`,{variants:{variant:{default:``,outline:`border-2`,ghost:``},size:{sm:`h-9 text-sm`,default:`h-11 text-base`,lg:`h-14 text-lg`},rounded:{default:`rounded-xl`,sm:`rounded-lg`,lg:`rounded-2xl`,full:`rounded-full`}},defaultVariants:{variant:`default`,size:`default`,rounded:`default`}}),o={idle:`bg-primary text-primary-foreground shadow-md hover:shadow-lg active:shadow-sm`,loading:`bg-primary/80 text-primary-foreground shadow-md cursor-wait`,success:`bg-green-500 text-white shadow-md`,error:`bg-destructive text-destructive-foreground shadow-md`},s={idle:`border-primary text-primary bg-transparent hover:bg-primary/10`,loading:`border-primary/50 text-primary/70 bg-transparent cursor-wait`,success:`border-green-500 text-green-500 bg-green-500/10`,error:`border-destructive text-destructive bg-destructive/10`},c={idle:`text-primary hover:bg-primary/10`,loading:`text-primary/70 cursor-wait`,success:`text-green-500 bg-green-500/10`,error:`text-destructive bg-destructive/10`};function l(e){typeof window>`u`||!(`vibrate`in navigator)||navigator.vibrate({light:[10],medium:[20],success:[10,50,10],error:[30,50,30,50,30]}[e])}function u({className:e}){return(0,i.jsxs)(`svg`,{className:t.cn(`animate-spin`,e),width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,i.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`3`}),(0,i.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]})}function d({className:e}){return(0,i.jsx)(`svg`,{className:t.cn(``,e),width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,i.jsx)(`polyline`,{points:`20 6 9 17 4 12`,className:`animate-draw-check`})})}function f({className:e}){return(0,i.jsxs)(`svg`,{className:t.cn(``,e),width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,i.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`,className:`animate-draw-x-1`}),(0,i.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`,className:`animate-draw-x-2`})]})}var p=n.forwardRef(({className:e,variant:r=`default`,size:p,rounded:m,state:h=`idle`,idleText:g,loadingText:_=`Loading...`,successText:v=`Success!`,errorText:y=`Error`,resetDelay:b=2e3,onReset:x,idleIcon:S,loadingIcon:C,successIcon:w,errorIcon:T,hapticFeedback:E=!0,animationDuration:D=300,disabled:O,onClick:k,...A},j)=>{let[M,N]=n.useState(h),[P,F]=n.useState(`auto`),I=n.useRef(null),L=n.useRef(null);n.useImperativeHandle(j,()=>I.current),n.useEffect(()=>{N(h)},[h]),n.useEffect(()=>{E&&(M===`success`?l(`success`):M===`error`?l(`error`):M===`loading`&&l(`light`))},[M,E]),n.useEffect(()=>{if((M===`success`||M===`error`)&&b>0){let e=setTimeout(()=>{N(`idle`),x?.()},b);return()=>clearTimeout(e)}},[M,b,x]),n.useEffect(()=>{if(I.current&&L.current){let e=L.current.scrollWidth+48+(M===`idle`?S?28:0:28);F(e)}},[M,g,_,v,y,S]);let R=()=>{switch(M){case`loading`:return _;case`success`:return v;case`error`:return y;default:return g}},z=()=>{switch(M){case`loading`:return C??(0,i.jsx)(u,{});case`success`:return w??(0,i.jsx)(d,{});case`error`:return T??(0,i.jsx)(f,{});default:return S}},B=()=>r===`outline`?s[M]:r===`ghost`?c[M]:o[M],V=e=>{M===`loading`||O||k?.(e)},H=z(),U=R();return(0,i.jsxs)(`button`,{ref:I,className:t.cn(a({variant:r,size:p,rounded:m}),B(),e),style:{width:typeof P==`number`?`${P}px`:P,transition:`all ${D}ms ease-out`},disabled:O||M===`loading`,onClick:V,...A,children:[(0,i.jsx)(`span`,{className:t.cn(`flex items-center justify-center transition-all`,H?`w-5 mr-2`:`w-0 mr-0`),style:{transition:`all ${D}ms ease-out`,opacity:+!!H},children:H}),(0,i.jsx)(`span`,{ref:L,className:`whitespace-nowrap transition-opacity`,style:{transition:`opacity ${D/2}ms ease-out`},children:U})]})});if(p.displayName=`WakaMorphButton`,typeof document<`u`){let e=`waka-morph-button-styles`;if(!document.getElementById(e)){let t=document.createElement(`style`);t.id=e,t.textContent=`
|
|
2
2
|
@keyframes draw-check {
|
|
3
3
|
0% {
|
|
4
4
|
stroke-dasharray: 0 100;
|
|
@@ -39,4 +39,4 @@
|
|
|
39
39
|
stroke-dashoffset: 100;
|
|
40
40
|
animation: draw-x-2 0.3s ease-out 0.1s forwards;
|
|
41
41
|
}
|
|
42
|
-
`,document.head.appendChild(t)}}function m(e,t={}){let{onSuccess:r,onError:i,resetDelay:a=2e3}=t,[o,s]=n.useState(`idle`),[c,l]=n.useState(null),[u,d]=n.useState(null);return{state:o,result:c,error:u,execute:n.useCallback(async()=>{if(o!==`loading`){s(`loading`),d(null);try{
|
|
42
|
+
`,document.head.appendChild(t)}}function m(e,t={}){let{onSuccess:r,onError:i,resetDelay:a=2e3}=t,[o,s]=n.useState(`idle`),[c,l]=n.useState(null),[u,d]=n.useState(null);return{state:o,result:c,error:u,execute:n.useCallback(async()=>{if(o!==`loading`){s(`loading`),d(null);try{let t=await e();l(t),s(`success`),r?.(),setTimeout(()=>{s(`idle`)},a)}catch(e){d(e),s(`error`),i?.(e),setTimeout(()=>{s(`idle`)},a)}}},[o,e,r,i,a]),reset:n.useCallback(()=>{s(`idle`),l(null),d(null)},[]),isLoading:o===`loading`,isSuccess:o===`success`,isError:o===`error`}}var h=n.forwardRef(({onClick:e,onSuccess:t,onError:n,resetDelay:r=2e3,...a},o)=>{let{state:s,execute:c}=m(e,{onSuccess:t,onError:n,resetDelay:r});return(0,i.jsx)(p,{ref:o,state:s,onClick:c,resetDelay:0,...a})});h.displayName=`WakaAsyncButton`,exports.WakaAsyncButton=h,exports.WakaMorphButton=p,exports.useMorphButton=m;
|
|
@@ -145,7 +145,10 @@ var p = t.forwardRef(({ className: n, variant: p = "default", size: m, rounded:
|
|
|
145
145
|
x,
|
|
146
146
|
S
|
|
147
147
|
]), t.useEffect(() => {
|
|
148
|
-
L.current && R.current
|
|
148
|
+
if (L.current && R.current) {
|
|
149
|
+
let e = R.current.scrollWidth + 48 + (N === "idle" ? C ? 28 : 0 : 28);
|
|
150
|
+
I(e);
|
|
151
|
+
}
|
|
149
152
|
}, [
|
|
150
153
|
N,
|
|
151
154
|
_,
|
|
@@ -217,7 +220,8 @@ function m(e, n = {}) {
|
|
|
217
220
|
if (o !== "loading") {
|
|
218
221
|
s("loading"), d(null);
|
|
219
222
|
try {
|
|
220
|
-
|
|
223
|
+
let t = await e();
|
|
224
|
+
l(t), s("success"), r?.(), setTimeout(() => {
|
|
221
225
|
s("idle");
|
|
222
226
|
}, a);
|
|
223
227
|
} catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`);let n=require(`react`);n=e.__toESM(n);let r=require(`lucide-react`),i=require(`react/jsx-runtime`);var a={server:r.Server,database:r.Database,loadbalancer:r.Scale,firewall:r.Shield,cloud:r.Cloud,client:r.Monitor,router:r.Router},o={healthy:`#22c55e`,warning:`#eab308`,error:`#ef4444`,offline:`#6b7280`},s={low:{color:`#22c55e`,width:2,dashOffset:20},medium:{color:`#eab308`,width:3,dashOffset:15},high:{color:`#ef4444`,width:4,dashOffset:10}},c={active:`#3b82f6`,degraded:`#eab308`,down:`#ef4444`},l=({node:e,isSelected:n,onClick:r,scale:s})=>{let c=a[e.type],l=o[e.status];return(0,i.jsxs)(`g`,{transform:`translate(${e.x}, ${e.y})`,onClick:r,style:{cursor:`pointer`},role:`button`,"aria-label":`${e.label} - ${e.type} - ${e.status}`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&r()},children:[n&&(0,i.jsx)(`circle`,{r:32,fill:`none`,stroke:`#3b82f6`,strokeWidth:2,strokeDasharray:`4 2`,className:`animate-spin`,style:{animationDuration:`8s`}}),(0,i.jsx)(`circle`,{r:48/2,fill:`white`,stroke:n?`#3b82f6`:`#e5e7eb`,strokeWidth:n?2:1,className:`drop-shadow-md`}),(0,i.jsx)(`circle`,{cx:48/2-8,cy:-16,r:6,fill:l,stroke:`white`,strokeWidth:2,children:e.status===`healthy`&&(0,i.jsx)(`animate`,{attributeName:`opacity`,values:`1;0.5;1`,dur:`2s`,repeatCount:`indefinite`})}),(0,i.jsx)(`foreignObject`,{x:-16,y:-16,width:32,height:32,style:{overflow:`visible`},children:(0,i.jsx)(`div`,{className:`flex h-full w-full items-center justify-center`,children:(0,i.jsx)(c,{size:24,className:t.cn(`text-gray-600`,e.status===`error`&&`text-red-500`,e.status===`warning`&&`text-yellow-500`,e.status===`offline`&&`text-gray-400`)})})}),(0,i.jsx)(`text`,{y:40,textAnchor:`middle`,className:`fill-gray-700 text-xs font-medium`,style:{fontSize:`${12/s}px`},children:e.label}),e.metrics&&(0,i.jsxs)(`g`,{className:`opacity-0 transition-opacity hover:opacity-100`,children:[(0,i.jsx)(`rect`,{x:-60,y:-98,width:120,height:45,rx:4,fill:`rgba(0,0,0,0.8)`}),(0,i.jsx)(`text`,{x:0,y:-83,textAnchor:`middle`,className:`fill-white text-xs`,style:{fontSize:`10px`},children:e.metrics.cpu!==void 0&&`CPU: ${e.metrics.cpu}%`}),(0,i.jsx)(`text`,{x:0,y:-70,textAnchor:`middle`,className:`fill-white text-xs`,style:{fontSize:`10px`},children:e.metrics.memory!==void 0&&`Mem: ${e.metrics.memory}%`}),(0,i.jsx)(`text`,{x:0,y:-57,textAnchor:`middle`,className:`fill-white text-xs`,style:{fontSize:`10px`},children:e.metrics.connections!==void 0&&`Conn: ${e.metrics.connections}`})]})]})},u=({edge:e,sourceNode:n,targetNode:r,showLatency:a,showTraffic:o,animated:l,isHighlighted:u,onClick:d})=>{let f=e.traffic||`low`,p=s[f],m=e.status?c[e.status]:p.color,h=r.x-n.x,g=r.y-n.y,_=Math.sqrt(h*h+g*g),v=h/_*24,y=g/_*24,b=n.x+v,x=n.y+y,S=r.x-v,C=r.y-y,w=(b+S)/2,T=(x+C)/2,E=180/Math.PI*Math.atan2(g,h);return(E>90||E<-90)&&E+180,`${e.source}${e.target}`,(0,i.jsxs)(`g`,{onClick:d,style:{cursor:`pointer`},role:`button`,"aria-label":`Connection from ${n.label} to ${r.label}${e.latency?`, latency ${e.latency}ms`:``}`,children:[(0,i.jsx)(`line`,{x1:b,y1:x,x2:S,y2:C,stroke:`transparent`,strokeWidth:20}),(0,i.jsx)(`line`,{x1:b,y1:x,x2:S,y2:C,stroke:u?`#3b82f6`:m,strokeWidth:o?p.width:2,strokeOpacity:e.status===`down`?.3:u?1:.6,strokeDasharray:e.status===`down`?`5 5`:void 0}),l&&o&&e.status!==`down`&&(0,i.jsx)(`line`,{x1:b,y1:x,x2:S,y2:C,stroke:u?`#60a5fa`:m,strokeWidth:p.width,strokeDasharray:`8 12`,strokeLinecap:`round`,children:(0,i.jsx)(`animate`,{attributeName:`stroke-dashoffset`,from:`0`,to:-p.dashOffset*2,dur:`${p.dashOffset/10}s`,repeatCount:`indefinite`})}),l&&o&&f===`high`&&e.status!==`down`&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`circle`,{r:3,fill:m,children:(0,i.jsx)(`animateMotion`,{dur:`1s`,repeatCount:`indefinite`,path:`M${b},${x} L${S},${C}`})}),(0,i.jsx)(`circle`,{r:3,fill:m,children:(0,i.jsx)(`animateMotion`,{dur:`1s`,repeatCount:`indefinite`,begin:`0.5s`,path:`M${b},${x} L${S},${C}`})})]}),a&&e.latency!==void 0&&(0,i.jsxs)(`g`,{transform:`translate(${w}, ${T})`,children:[(0,i.jsx)(`rect`,{x:-20,y:-10,width:40,height:20,rx:4,fill:`white`,stroke:`#e5e7eb`,strokeWidth:1}),(0,i.jsxs)(`text`,{textAnchor:`middle`,dominantBaseline:`middle`,className:t.cn(`text-xs font-medium`,e.latency>100?`fill-red-500`:e.latency>50?`fill-yellow-500`:`fill-green-500`),style:{fontSize:`10px`},children:[e.latency,`ms`]})]})]})},d=({nodes:e,edges:t,viewBox:n,bounds:r,onViewChange:a})=>{let s=r.maxX-r.minX+20,c=r.maxY-r.minY+20,l=Math.min(150/s,150/c);return(0,i.jsx)(`div`,{className:`absolute bottom-4 right-4 rounded-lg border border-gray-200 bg-white p-2 shadow-lg`,children:(0,i.jsxs)(`svg`,{width:150,height:150,onClick:e=>{let t=e.currentTarget.getBoundingClientRect(),i=e.clientX-t.left,o=e.clientY-t.top,s=i/l+r.minX-10,c=o/l+r.minY-10;a(s-n.width/2,c-n.height/2)},style:{cursor:`crosshair`},"aria-label":`Network mini-map`,children:[(0,i.jsx)(`rect`,{width:150,height:150,fill:`#f9fafb`,rx:4}),t.map(t=>{let n=e.find(e=>e.id===t.source),a=e.find(e=>e.id===t.target);return!n||!a?null:(0,i.jsx)(`line`,{x1:(n.x-r.minX+10)*l,y1:(n.y-r.minY+10)*l,x2:(a.x-r.minX+10)*l,y2:(a.y-r.minY+10)*l,stroke:`#cbd5e1`,strokeWidth:1},`mini-${t.source}-${t.target}`)}),e.map(e=>(0,i.jsx)(`circle`,{cx:(e.x-r.minX+10)*l,cy:(e.y-r.minY+10)*l,r:4,fill:o[e.status]},`mini-${e.id}`)),(0,i.jsx)(`rect`,{x:(n.x-r.minX+10)*l,y:(n.y-r.minY+10)*l,width:n.width*l,height:n.height*l,fill:`rgba(59, 130, 246, 0.1)`,stroke:`#3b82f6`,strokeWidth:1,rx:2})]})})},f=({nodes:e,edges:a,onNodeClick:c,onEdgeClick:f,selectedNode:p,showLatency:m=!0,showTraffic:h=!0,animated:g=!0,className:_})=>{let v=n.useRef(null),y=n.useRef(null),[b,x]=n.useState({x:0,y:0,width:800,height:600}),[S,C]=n.useState(1),[w,T]=n.useState(!1),[E,D]=n.useState({x:0,y:0}),[O,k]=n.useState(new Set),A=n.useMemo(()=>{if(e.length===0)return{minX:0,minY:0,maxX:800,maxY:600};let t=e.map(e=>e.x),n=e.map(e=>e.y);return{minX:Math.min(...t)-100,minY:Math.min(...n)-100,maxX:Math.max(...t)+100,maxY:Math.max(...n)+100}},[e]);n.useEffect(()=>{if(y.current){let{width:e,height:t}=y.current.getBoundingClientRect();x({x:A.minX,y:A.minY,width:e||800,height:t||600})}},[A]),n.useEffect(()=>{if(p){let e=new Set;a.forEach(t=>{(t.source===p||t.target===p)&&e.add(`${t.source}-${t.target}`)}),k(e)}else k(new Set)},[p,a]);let j=e=>{let t=Math.max(.25,Math.min(4,S+e)),n=S/t;x(e=>({x:e.x+e.width*(1-n)/2,y:e.y+e.height*(1-n)/2,width:e.width*n,height:e.height*n})),C(t)},M=e=>{e.preventDefault(),j(e.deltaY>0?-.1:.1)},N=e=>{e.button===0&&(T(!0),D({x:e.clientX,y:e.clientY}))},P=e=>{if(w){let t=(e.clientX-E.x)/S,n=(e.clientY-E.y)/S;x(e=>({...e,x:e.x-t,y:e.y-n})),D({x:e.clientX,y:e.clientY})}},F=()=>{T(!1)};return(0,i.jsxs)(`div`,{ref:y,className:t.cn(`relative h-full w-full overflow-hidden rounded-lg border border-gray-200 bg-gray-50`,_),children:[(0,i.jsxs)(`div`,{className:`absolute left-4 top-4 z-10 flex flex-col gap-2`,children:[(0,i.jsx)(`button`,{onClick:()=>j(.2),className:`rounded-lg border border-gray-200 bg-white p-2 shadow-sm transition-colors hover:bg-gray-50`,"aria-label":`Zoom in`,children:(0,i.jsx)(r.ZoomIn,{size:18,className:`text-gray-600`})}),(0,i.jsx)(`button`,{onClick:()=>j(-.2),className:`rounded-lg border border-gray-200 bg-white p-2 shadow-sm transition-colors hover:bg-gray-50`,"aria-label":`Zoom out`,children:(0,i.jsx)(r.ZoomOut,{size:18,className:`text-gray-600`})}),(0,i.jsx)(`button`,{onClick:()=>{if(y.current){let{width:e,height:t}=y.current.getBoundingClientRect(),n=A.maxX-A.minX,r=A.maxY-A.minY,i=Math.min(e/n,t/r);x({x:A.minX-(e/i-n)/2,y:A.minY-(t/i-r)/2,width:e/i,height:t/i}),C(i)}},className:`rounded-lg border border-gray-200 bg-white p-2 shadow-sm transition-colors hover:bg-gray-50`,"aria-label":`Fit to view`,children:(0,i.jsx)(r.Maximize2,{size:18,className:`text-gray-600`})}),(0,i.jsxs)(`div`,{className:`mt-2 rounded-lg border border-gray-200 bg-white px-2 py-1 text-center text-xs text-gray-500 shadow-sm`,children:[Math.round(S*100),`%`]})]}),w&&(0,i.jsxs)(`div`,{className:`absolute left-1/2 top-4 z-10 -translate-x-1/2 rounded-full bg-blue-500 px-3 py-1 text-xs text-white shadow-md`,children:[(0,i.jsx)(r.Move,{size:12,className:`mr-1 inline`}),`Panning`]}),(0,i.jsxs)(`svg`,{ref:v,className:t.cn(`h-full w-full`,w?`cursor-grabbing`:`cursor-grab`),viewBox:`${b.x} ${b.y} ${b.width} ${b.height}`,onWheel:M,onMouseDown:N,onMouseMove:P,onMouseUp:F,onMouseLeave:F,"aria-label":`Network topology diagram`,role:`img`,children:[(0,i.jsxs)(`defs`,{children:[(0,i.jsx)(`pattern`,{id:`grid`,width:50,height:50,patternUnits:`userSpaceOnUse`,children:(0,i.jsx)(`path`,{d:`M 50 0 L 0 0 0 50`,fill:`none`,stroke:`#e5e7eb`,strokeWidth:.5})}),(0,i.jsx)(`marker`,{id:`arrowhead`,markerWidth:10,markerHeight:7,refX:9,refY:3.5,orient:`auto`,children:(0,i.jsx)(`polygon`,{points:`0 0, 10 3.5, 0 7`,fill:`#94a3b8`})}),(0,i.jsxs)(`filter`,{id:`glow`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:[(0,i.jsx)(`feGaussianBlur`,{stdDeviation:`3`,result:`coloredBlur`}),(0,i.jsxs)(`feMerge`,{children:[(0,i.jsx)(`feMergeNode`,{in:`coloredBlur`}),(0,i.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]})]}),(0,i.jsx)(`rect`,{x:A.minX-1e3,y:A.minY-1e3,width:A.maxX-A.minX+2e3,height:A.maxY-A.minY+2e3,fill:`url(#grid)`}),(0,i.jsx)(`g`,{className:`edges`,children:a.map(t=>{let n=e.find(e=>e.id===t.source),r=e.find(e=>e.id===t.target);if(!n||!r)return null;let a=`${t.source}-${t.target}`;return(0,i.jsx)(u,{edge:t,sourceNode:n,targetNode:r,showLatency:m,showTraffic:h,animated:g,isHighlighted:O.has(a),onClick:()=>f?.(t.source,t.target)},a)})}),(0,i.jsx)(`g`,{className:`nodes`,children:e.map(e=>(0,i.jsx)(l,{node:e,isSelected:p===e.id,onClick:()=>c?.(e.id),scale:S},e.id))})]}),(0,i.jsx)(d,{nodes:e,edges:a,viewBox:b,bounds:A,onViewChange:(e,t)=>{x(n=>({...n,x:e,y:t}))}}),(0,i.jsxs)(`div`,{className:`absolute bottom-4 left-4 rounded-lg border border-gray-200 bg-white p-3 shadow-lg`,children:[(0,i.jsx)(`div`,{className:`mb-2 text-xs font-medium text-gray-700`,children:`Status`}),(0,i.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:Object.entries(o).map(([e,t])=>(0,i.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,i.jsx)(`div`,{className:`h-3 w-3 rounded-full`,style:{backgroundColor:t}}),(0,i.jsx)(`span`,{className:`text-xs capitalize text-gray-600`,children:e})]},e))}),h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{className:`mb-2 mt-3 text-xs font-medium text-gray-700`,children:`Traffic`}),(0,i.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:Object.entries(s).map(([e,t])=>(0,i.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,i.jsx)(`div`,{className:`h-0.5 w-4`,style:{backgroundColor:t.color,height:t.width}}),(0,i.jsx)(`span`,{className:`text-xs capitalize text-gray-600`,children:e})]},e))})]})]})]})};exports.default=f;
|
|
1
|
+
"use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("lucide-react"),i=require("react/jsx-runtime");var a={server:r.Server,database:r.Database,loadbalancer:r.Scale,firewall:r.Shield,cloud:r.Cloud,client:r.Monitor,router:r.Router},o={healthy:`#22c55e`,warning:`#eab308`,error:`#ef4444`,offline:`#6b7280`},s={low:{color:`#22c55e`,width:2,dashOffset:20},medium:{color:`#eab308`,width:3,dashOffset:15},high:{color:`#ef4444`,width:4,dashOffset:10}},c={active:`#3b82f6`,degraded:`#eab308`,down:`#ef4444`},l=({node:e,isSelected:n,onClick:r,scale:s})=>{let c=a[e.type],l=o[e.status];return(0,i.jsxs)(`g`,{transform:`translate(${e.x}, ${e.y})`,onClick:r,style:{cursor:`pointer`},role:`button`,"aria-label":`${e.label} - ${e.type} - ${e.status}`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&r()},children:[n&&(0,i.jsx)(`circle`,{r:32,fill:`none`,stroke:`#3b82f6`,strokeWidth:2,strokeDasharray:`4 2`,className:`animate-spin`,style:{animationDuration:`8s`}}),(0,i.jsx)(`circle`,{r:48/2,fill:`white`,stroke:n?`#3b82f6`:`#e5e7eb`,strokeWidth:n?2:1,className:`drop-shadow-md`}),(0,i.jsx)(`circle`,{cx:48/2-8,cy:-16,r:6,fill:l,stroke:`white`,strokeWidth:2,children:e.status===`healthy`&&(0,i.jsx)(`animate`,{attributeName:`opacity`,values:`1;0.5;1`,dur:`2s`,repeatCount:`indefinite`})}),(0,i.jsx)(`foreignObject`,{x:-16,y:-16,width:32,height:32,style:{overflow:`visible`},children:(0,i.jsx)(`div`,{className:`flex h-full w-full items-center justify-center`,children:(0,i.jsx)(c,{size:24,className:t.cn(`text-gray-600`,e.status===`error`&&`text-red-500`,e.status===`warning`&&`text-yellow-500`,e.status===`offline`&&`text-gray-400`)})})}),(0,i.jsx)(`text`,{y:40,textAnchor:`middle`,className:`fill-gray-700 text-xs font-medium`,style:{fontSize:`${12/s}px`},children:e.label}),e.metrics&&(0,i.jsxs)(`g`,{className:`opacity-0 transition-opacity hover:opacity-100`,children:[(0,i.jsx)(`rect`,{x:-60,y:-98,width:120,height:45,rx:4,fill:`rgba(0,0,0,0.8)`}),(0,i.jsx)(`text`,{x:0,y:-83,textAnchor:`middle`,className:`fill-white text-xs`,style:{fontSize:`10px`},children:e.metrics.cpu!==void 0&&`CPU: ${e.metrics.cpu}%`}),(0,i.jsx)(`text`,{x:0,y:-70,textAnchor:`middle`,className:`fill-white text-xs`,style:{fontSize:`10px`},children:e.metrics.memory!==void 0&&`Mem: ${e.metrics.memory}%`}),(0,i.jsx)(`text`,{x:0,y:-57,textAnchor:`middle`,className:`fill-white text-xs`,style:{fontSize:`10px`},children:e.metrics.connections!==void 0&&`Conn: ${e.metrics.connections}`})]})]})},u=({edge:e,sourceNode:n,targetNode:r,showLatency:a,showTraffic:o,animated:l,isHighlighted:u,onClick:d})=>{let f=e.traffic||`low`,p=s[f],m=e.status?c[e.status]:p.color,h=r.x-n.x,g=r.y-n.y,_=Math.sqrt(h*h+g*g),v=h/_*24,y=g/_*24,b=n.x+v,x=n.y+y,S=r.x-v,C=r.y-y,w=(b+S)/2,T=(x+C)/2,E=180/Math.PI*Math.atan2(g,h);return(E>90||E<-90)&&E+180,`${e.source}${e.target}`,(0,i.jsxs)(`g`,{onClick:d,style:{cursor:`pointer`},role:`button`,"aria-label":`Connection from ${n.label} to ${r.label}${e.latency?`, latency ${e.latency}ms`:``}`,children:[(0,i.jsx)(`line`,{x1:b,y1:x,x2:S,y2:C,stroke:`transparent`,strokeWidth:20}),(0,i.jsx)(`line`,{x1:b,y1:x,x2:S,y2:C,stroke:u?`#3b82f6`:m,strokeWidth:o?p.width:2,strokeOpacity:e.status===`down`?.3:u?1:.6,strokeDasharray:e.status===`down`?`5 5`:void 0}),l&&o&&e.status!==`down`&&(0,i.jsx)(`line`,{x1:b,y1:x,x2:S,y2:C,stroke:u?`#60a5fa`:m,strokeWidth:p.width,strokeDasharray:`8 12`,strokeLinecap:`round`,children:(0,i.jsx)(`animate`,{attributeName:`stroke-dashoffset`,from:`0`,to:-p.dashOffset*2,dur:`${p.dashOffset/10}s`,repeatCount:`indefinite`})}),l&&o&&f===`high`&&e.status!==`down`&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`circle`,{r:3,fill:m,children:(0,i.jsx)(`animateMotion`,{dur:`1s`,repeatCount:`indefinite`,path:`M${b},${x} L${S},${C}`})}),(0,i.jsx)(`circle`,{r:3,fill:m,children:(0,i.jsx)(`animateMotion`,{dur:`1s`,repeatCount:`indefinite`,begin:`0.5s`,path:`M${b},${x} L${S},${C}`})})]}),a&&e.latency!==void 0&&(0,i.jsxs)(`g`,{transform:`translate(${w}, ${T})`,children:[(0,i.jsx)(`rect`,{x:-20,y:-10,width:40,height:20,rx:4,fill:`white`,stroke:`#e5e7eb`,strokeWidth:1}),(0,i.jsxs)(`text`,{textAnchor:`middle`,dominantBaseline:`middle`,className:t.cn(`text-xs font-medium`,e.latency>100?`fill-red-500`:e.latency>50?`fill-yellow-500`:`fill-green-500`),style:{fontSize:`10px`},children:[e.latency,`ms`]})]})]})},d=({nodes:e,edges:t,viewBox:n,bounds:r,onViewChange:a})=>{let s=r.maxX-r.minX+20,c=r.maxY-r.minY+20,l=Math.min(150/s,150/c);return(0,i.jsx)(`div`,{className:`absolute bottom-4 right-4 rounded-lg border border-gray-200 bg-white p-2 shadow-lg`,children:(0,i.jsxs)(`svg`,{width:150,height:150,onClick:e=>{let t=e.currentTarget.getBoundingClientRect(),i=e.clientX-t.left,o=e.clientY-t.top,s=i/l+r.minX-10,c=o/l+r.minY-10;a(s-n.width/2,c-n.height/2)},style:{cursor:`crosshair`},"aria-label":`Network mini-map`,children:[(0,i.jsx)(`rect`,{width:150,height:150,fill:`#f9fafb`,rx:4}),t.map(t=>{let n=e.find(e=>e.id===t.source),a=e.find(e=>e.id===t.target);return!n||!a?null:(0,i.jsx)(`line`,{x1:(n.x-r.minX+10)*l,y1:(n.y-r.minY+10)*l,x2:(a.x-r.minX+10)*l,y2:(a.y-r.minY+10)*l,stroke:`#cbd5e1`,strokeWidth:1},`mini-${t.source}-${t.target}`)}),e.map(e=>(0,i.jsx)(`circle`,{cx:(e.x-r.minX+10)*l,cy:(e.y-r.minY+10)*l,r:4,fill:o[e.status]},`mini-${e.id}`)),(0,i.jsx)(`rect`,{x:(n.x-r.minX+10)*l,y:(n.y-r.minY+10)*l,width:n.width*l,height:n.height*l,fill:`rgba(59, 130, 246, 0.1)`,stroke:`#3b82f6`,strokeWidth:1,rx:2})]})})},f=({nodes:e,edges:a,onNodeClick:c,onEdgeClick:f,selectedNode:p,showLatency:m=!0,showTraffic:h=!0,animated:g=!0,className:_})=>{let v=n.useRef(null),y=n.useRef(null),[b,x]=n.useState({x:0,y:0,width:800,height:600}),[S,C]=n.useState(1),[w,T]=n.useState(!1),[E,D]=n.useState({x:0,y:0}),[O,k]=n.useState(new Set),A=n.useMemo(()=>{if(e.length===0)return{minX:0,minY:0,maxX:800,maxY:600};let t=e.map(e=>e.x),n=e.map(e=>e.y);return{minX:Math.min(...t)-100,minY:Math.min(...n)-100,maxX:Math.max(...t)+100,maxY:Math.max(...n)+100}},[e]);n.useEffect(()=>{if(y.current){let{width:e,height:t}=y.current.getBoundingClientRect();x({x:A.minX,y:A.minY,width:e||800,height:t||600})}},[A]),n.useEffect(()=>{if(p){let e=new Set;a.forEach(t=>{(t.source===p||t.target===p)&&e.add(`${t.source}-${t.target}`)}),k(e)}else k(new Set)},[p,a]);let j=e=>{let t=Math.max(.25,Math.min(4,S+e)),n=S/t;x(e=>({x:e.x+e.width*(1-n)/2,y:e.y+e.height*(1-n)/2,width:e.width*n,height:e.height*n})),C(t)},M=e=>{e.preventDefault();let t=e.deltaY>0?-.1:.1;j(t)},N=e=>{e.button===0&&(T(!0),D({x:e.clientX,y:e.clientY}))},P=e=>{if(w){let t=(e.clientX-E.x)/S,n=(e.clientY-E.y)/S;x(e=>({...e,x:e.x-t,y:e.y-n})),D({x:e.clientX,y:e.clientY})}},F=()=>{T(!1)};return(0,i.jsxs)(`div`,{ref:y,className:t.cn(`relative h-full w-full overflow-hidden rounded-lg border border-gray-200 bg-gray-50`,_),children:[(0,i.jsxs)(`div`,{className:`absolute left-4 top-4 z-10 flex flex-col gap-2`,children:[(0,i.jsx)(`button`,{onClick:()=>j(.2),className:`rounded-lg border border-gray-200 bg-white p-2 shadow-sm transition-colors hover:bg-gray-50`,"aria-label":`Zoom in`,children:(0,i.jsx)(r.ZoomIn,{size:18,className:`text-gray-600`})}),(0,i.jsx)(`button`,{onClick:()=>j(-.2),className:`rounded-lg border border-gray-200 bg-white p-2 shadow-sm transition-colors hover:bg-gray-50`,"aria-label":`Zoom out`,children:(0,i.jsx)(r.ZoomOut,{size:18,className:`text-gray-600`})}),(0,i.jsx)(`button`,{onClick:()=>{if(y.current){let{width:e,height:t}=y.current.getBoundingClientRect(),n=A.maxX-A.minX,r=A.maxY-A.minY,i=Math.min(e/n,t/r);x({x:A.minX-(e/i-n)/2,y:A.minY-(t/i-r)/2,width:e/i,height:t/i}),C(i)}},className:`rounded-lg border border-gray-200 bg-white p-2 shadow-sm transition-colors hover:bg-gray-50`,"aria-label":`Fit to view`,children:(0,i.jsx)(r.Maximize2,{size:18,className:`text-gray-600`})}),(0,i.jsxs)(`div`,{className:`mt-2 rounded-lg border border-gray-200 bg-white px-2 py-1 text-center text-xs text-gray-500 shadow-sm`,children:[Math.round(S*100),`%`]})]}),w&&(0,i.jsxs)(`div`,{className:`absolute left-1/2 top-4 z-10 -translate-x-1/2 rounded-full bg-blue-500 px-3 py-1 text-xs text-white shadow-md`,children:[(0,i.jsx)(r.Move,{size:12,className:`mr-1 inline`}),`Panning`]}),(0,i.jsxs)(`svg`,{ref:v,className:t.cn(`h-full w-full`,w?`cursor-grabbing`:`cursor-grab`),viewBox:`${b.x} ${b.y} ${b.width} ${b.height}`,onWheel:M,onMouseDown:N,onMouseMove:P,onMouseUp:F,onMouseLeave:F,"aria-label":`Network topology diagram`,role:`img`,children:[(0,i.jsxs)(`defs`,{children:[(0,i.jsx)(`pattern`,{id:`grid`,width:50,height:50,patternUnits:`userSpaceOnUse`,children:(0,i.jsx)(`path`,{d:`M 50 0 L 0 0 0 50`,fill:`none`,stroke:`#e5e7eb`,strokeWidth:.5})}),(0,i.jsx)(`marker`,{id:`arrowhead`,markerWidth:10,markerHeight:7,refX:9,refY:3.5,orient:`auto`,children:(0,i.jsx)(`polygon`,{points:`0 0, 10 3.5, 0 7`,fill:`#94a3b8`})}),(0,i.jsxs)(`filter`,{id:`glow`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:[(0,i.jsx)(`feGaussianBlur`,{stdDeviation:`3`,result:`coloredBlur`}),(0,i.jsxs)(`feMerge`,{children:[(0,i.jsx)(`feMergeNode`,{in:`coloredBlur`}),(0,i.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]})]}),(0,i.jsx)(`rect`,{x:A.minX-1e3,y:A.minY-1e3,width:A.maxX-A.minX+2e3,height:A.maxY-A.minY+2e3,fill:`url(#grid)`}),(0,i.jsx)(`g`,{className:`edges`,children:a.map(t=>{let n=e.find(e=>e.id===t.source),r=e.find(e=>e.id===t.target);if(!n||!r)return null;let a=`${t.source}-${t.target}`,o=O.has(a);return(0,i.jsx)(u,{edge:t,sourceNode:n,targetNode:r,showLatency:m,showTraffic:h,animated:g,isHighlighted:o,onClick:()=>f?.(t.source,t.target)},a)})}),(0,i.jsx)(`g`,{className:`nodes`,children:e.map(e=>(0,i.jsx)(l,{node:e,isSelected:p===e.id,onClick:()=>c?.(e.id),scale:S},e.id))})]}),(0,i.jsx)(d,{nodes:e,edges:a,viewBox:b,bounds:A,onViewChange:(e,t)=>{x(n=>({...n,x:e,y:t}))}}),(0,i.jsxs)(`div`,{className:`absolute bottom-4 left-4 rounded-lg border border-gray-200 bg-white p-3 shadow-lg`,children:[(0,i.jsx)(`div`,{className:`mb-2 text-xs font-medium text-gray-700`,children:`Status`}),(0,i.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:Object.entries(o).map(([e,t])=>(0,i.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,i.jsx)(`div`,{className:`h-3 w-3 rounded-full`,style:{backgroundColor:t}}),(0,i.jsx)(`span`,{className:`text-xs capitalize text-gray-600`,children:e})]},e))}),h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{className:`mb-2 mt-3 text-xs font-medium text-gray-700`,children:`Traffic`}),(0,i.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:Object.entries(s).map(([e,t])=>(0,i.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,i.jsx)(`div`,{className:`h-0.5 w-4`,style:{backgroundColor:t.color,height:t.width}}),(0,i.jsx)(`span`,{className:`text-xs capitalize text-gray-600`,children:e})]},e))})]})]})]})};exports.WakaNetworkTopology=f,exports.default=f;
|
|
@@ -324,7 +324,9 @@ var g = {
|
|
|
324
324
|
height: e.height * n
|
|
325
325
|
})), O(t);
|
|
326
326
|
}, L = (e) => {
|
|
327
|
-
e.preventDefault()
|
|
327
|
+
e.preventDefault();
|
|
328
|
+
let t = e.deltaY > 0 ? -.1 : .1;
|
|
329
|
+
I(t);
|
|
328
330
|
}, R = (e) => {
|
|
329
331
|
e.button === 0 && (A(!0), M({
|
|
330
332
|
x: e.clientX,
|
|
@@ -545,4 +547,4 @@ var g = {
|
|
|
545
547
|
});
|
|
546
548
|
};
|
|
547
549
|
//#endregion
|
|
548
|
-
export { C as default };
|
|
550
|
+
export { C as WakaNetworkTopology, C as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require(
|
|
1
|
+
"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../badge/index.cjs.js"),r=require("../button/index.cjs.js"),i=require("../popover/index.cjs.js"),a=require("../scroll-area/index.cjs.js"),o=require("../separator/index.cjs.js"),s=require("../tabs/index.cjs.js");let c=require("react");c=e.__toESM(c);let l=require("lucide-react"),u=require("react/jsx-runtime");var d={info:`bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200`,success:`bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200`,warning:`bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200`,error:`bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200`},f=c.forwardRef(({notification:e,onMarkAsRead:n,onDelete:i},a)=>(0,u.jsxs)(`div`,{ref:a,className:t.cn(`flex gap-3 p-4 hover:bg-muted/50 transition-colors border-l-4`,e.read?`border-l-transparent opacity-60`:`border-l-primary`,`relative group`),children:[(0,u.jsx)(`div`,{className:t.cn(`flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center`,d[e.type]),children:e.icon||(0,u.jsx)(l.Bell,{className:`h-5 w-5`})}),(0,u.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-1`,children:[(0,u.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,u.jsx)(`h4`,{className:t.cn(`text-sm font-semibold`,e.read&&`font-normal`),children:e.title}),(0,u.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:(e=>{let t=new Date().getTime()-e.getTime(),n=Math.floor(t/6e4),r=Math.floor(t/36e5),i=Math.floor(t/864e5);return n<1?`À l'instant`:n<60?`Il y a ${n} min`:r<24?`Il y a ${r}h`:i<7?`Il y a ${i}j`:e.toLocaleDateString(`fr-FR`)})(e.timestamp)})]}),(0,u.jsx)(`p`,{className:`text-sm text-muted-foreground line-clamp-2`,children:e.message}),e.action&&(0,u.jsx)(r.Button,{variant:`link`,size:`sm`,className:`h-auto p-0 text-primary`,onClick:e.action.onClick,children:e.action.label})]}),(0,u.jsxs)(`div`,{className:`flex-shrink-0 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity`,children:[!e.read&&n&&(0,u.jsxs)(r.Button,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>n(e.id),children:[(0,u.jsx)(l.Check,{className:`h-4 w-4`}),(0,u.jsx)(`span`,{className:`sr-only`,children:`Marquer comme lu`})]}),i&&(0,u.jsxs)(r.Button,{variant:`ghost`,size:`icon`,className:`h-8 w-8 text-destructive hover:text-destructive`,onClick:()=>i(e.id),children:[(0,u.jsx)(l.Trash2,{className:`h-4 w-4`}),(0,u.jsx)(`span`,{className:`sr-only`,children:`Supprimer`})]})]})]}));f.displayName=`NotificationItem`;var p=c.forwardRef(({notifications:e,onMarkAsRead:d,onMarkAllAsRead:p,onDelete:m,onDeleteAll:h,onSettingsClick:g,maxHeight:_=`400px`,className:v,iconClassName:y,badgeClassName:b,showBadge:x=!0,showTabs:S=!0,emptyMessage:C=`Aucune notification`,emptyIcon:w},T)=>{let[E,D]=c.useState(!1),[O,k]=c.useState(`all`),A=e.filter(e=>!e.read).length,j=c.useMemo(()=>O===`all`?e:O===`unread`?e.filter(e=>!e.read):e,[e,O]),M=()=>(0,u.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 px-4 text-center`,children:[w||(0,u.jsx)(l.Bell,{className:`h-12 w-12 text-muted-foreground/50 mb-4`}),(0,u.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:C})]});return(0,u.jsxs)(i.Popover,{open:E,onOpenChange:D,children:[(0,u.jsx)(i.PopoverTrigger,{asChild:!0,children:(0,u.jsxs)(r.Button,{ref:T,variant:`ghost`,size:`icon`,className:t.cn(`relative`,v),children:[(0,u.jsx)(l.Bell,{className:t.cn(`h-5 w-5`,y)}),x&&A>0&&(0,u.jsx)(n.Badge,{variant:`destructive`,className:t.cn(`absolute -top-1 -right-1 h-5 min-w-[20px] flex items-center justify-center p-0 text-xs`,b),children:A>99?`99+`:A}),(0,u.jsxs)(`span`,{className:`sr-only`,children:[`Notifications (`,A,` non lues)`]})]})}),(0,u.jsxs)(i.PopoverContent,{className:`w-[380px] p-0`,align:`end`,sideOffset:8,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between p-4 border-b`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{className:`font-semibold text-base`,children:`Notifications`}),A>0&&(0,u.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[A,` non `,A>1?`lues`:`lue`]})]}),(0,u.jsxs)(`div`,{className:`flex gap-1`,children:[p&&A>0&&(0,u.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-8 text-xs`,onClick:p,children:[(0,u.jsx)(l.Check,{className:`h-3 w-3 mr-1`}),`Tout marquer`]}),g&&(0,u.jsxs)(r.Button,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:g,children:[(0,u.jsx)(l.Settings,{className:`h-4 w-4`}),(0,u.jsx)(`span`,{className:`sr-only`,children:`Paramètres`})]})]})]}),S&&e.length>0&&(0,u.jsxs)(s.Tabs,{value:O,onValueChange:k,className:`w-full`,children:[(0,u.jsxs)(s.TabsList,{className:`w-full rounded-none border-b bg-transparent p-0`,children:[(0,u.jsxs)(s.TabsTrigger,{value:`all`,className:`flex-1 rounded-none data-[state=active]:border-b-2 data-[state=active]:border-primary`,children:[`Toutes (`,e.length,`)`]}),(0,u.jsxs)(s.TabsTrigger,{value:`unread`,className:`flex-1 rounded-none data-[state=active]:border-b-2 data-[state=active]:border-primary`,children:[`Non lues (`,A,`)`]})]}),(0,u.jsx)(s.TabsContent,{value:`all`,className:`m-0`,children:(0,u.jsx)(a.ScrollArea,{className:`h-[400px]`,style:{maxHeight:_},children:(0,u.jsx)(`div`,{className:`p-0`,children:j.length===0?(0,u.jsx)(M,{}):(0,u.jsx)(`div`,{className:`divide-y`,children:j.map(e=>(0,u.jsx)(f,{notification:e,onMarkAsRead:d,onDelete:m},e.id))})})})}),(0,u.jsx)(s.TabsContent,{value:`unread`,className:`m-0`,children:(0,u.jsx)(a.ScrollArea,{className:`h-[400px]`,style:{maxHeight:_},children:(0,u.jsx)(`div`,{className:`p-0`,children:j.length===0?(0,u.jsx)(M,{}):(0,u.jsx)(`div`,{className:`divide-y`,children:j.map(e=>(0,u.jsx)(f,{notification:e,onMarkAsRead:d,onDelete:m},e.id))})})})})]}),!S&&(0,u.jsx)(a.ScrollArea,{className:`h-[400px]`,style:{maxHeight:_},children:(0,u.jsx)(`div`,{className:`p-0`,children:e.length===0?(0,u.jsx)(M,{}):(0,u.jsx)(`div`,{className:`divide-y`,children:e.map(e=>(0,u.jsx)(f,{notification:e,onMarkAsRead:d,onDelete:m},e.id))})})}),e.length>0&&h&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(o.Separator,{}),(0,u.jsx)(`div`,{className:`p-2`,children:(0,u.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`w-full text-destructive hover:text-destructive`,onClick:h,children:[(0,u.jsx)(l.Trash2,{className:`h-3 w-3 mr-2`}),`Tout supprimer`]})})]})]})]})});p.displayName=`WakaNotifications`;function m(e=[]){let[t,n]=c.useState(e);return{notifications:t,addNotification:c.useCallback(e=>{let t={...e,id:`notification-${Date.now()}-${Math.random()}`,timestamp:new Date,read:!1};n(e=>[t,...e])},[]),markAsRead:c.useCallback(e=>{n(t=>t.map(t=>t.id===e?{...t,read:!0}:t))},[]),markAllAsRead:c.useCallback(()=>{n(e=>e.map(e=>({...e,read:!0})))},[]),deleteNotification:c.useCallback(e=>{n(t=>t.filter(t=>t.id!==e))},[]),deleteAllNotifications:c.useCallback(()=>{n([])},[]),unreadCount:c.useMemo(()=>t.filter(e=>!e.read).length,[t])}}exports.WakaNotifications=p,exports.useNotifications=m;
|