@aithe/aithe-ui 26.2.3 → 26.3.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/README.md +16 -11
- package/dist/apps/admin/app.js +12 -0
- package/dist/apps/admin/components/admin-app.js +83 -0
- package/dist/apps/admin/components/admin-layout.d.ts +0 -1
- package/dist/apps/admin/components/admin-layout.d.ts.map +1 -1
- package/dist/apps/admin/components/admin-layout.js +250 -0
- package/dist/apps/admin/datahub/auth.js +24 -0
- package/dist/apps/admin/datahub/dashboard.js +16 -0
- package/dist/apps/admin/datahub/index.js +42 -0
- package/dist/apps/admin/datahub/menu.js +16 -0
- package/dist/apps/admin/datahub/mock/auth.js +11 -0
- package/dist/apps/admin/datahub/mock/dashboard.js +10 -0
- package/dist/apps/admin/datahub/mock/menu.js +42 -0
- package/dist/apps/admin/i18n/de-DE.js +37 -0
- package/dist/apps/admin/i18n/en-US.js +37 -0
- package/dist/apps/admin/i18n/es-ES.js +38 -0
- package/dist/apps/admin/i18n/fr-FR.js +37 -0
- package/dist/apps/admin/i18n/index.js +27 -0
- package/dist/apps/admin/i18n/ja-JP.js +38 -0
- package/dist/apps/admin/i18n/ko-KR.js +37 -0
- package/dist/apps/admin/i18n/pt-BR.js +37 -0
- package/dist/apps/admin/i18n/zh-CN.js +37 -0
- package/dist/apps/admin/i18n/zh-HK.js +37 -0
- package/dist/apps/admin/i18n/zh-TW.js +37 -0
- package/dist/apps/admin/pages/dashboard-page.d.ts +1 -0
- package/dist/apps/admin/pages/dashboard-page.d.ts.map +1 -1
- package/dist/apps/admin/pages/dashboard-page.js +199 -0
- package/dist/apps/admin/pages/login-page.js +278 -0
- package/dist/apps/admin/pages/not-found-page.js +57 -0
- package/dist/apps/admin/pages/role-page.js +76 -0
- package/dist/apps/admin/pages/settings-page.js +95 -0
- package/dist/apps/admin/pages/user-page.js +76 -0
- package/dist/apps/admin/router/index.js +43 -0
- package/dist/apps/admin/standalone.js +1 -0
- package/dist/apps/admin/store/auth.js +42 -0
- package/dist/apps/api/app.js +82 -0
- package/dist/apps/api/demo-data.d.ts.map +1 -1
- package/dist/apps/api/demo-data.js +965 -0
- package/dist/apps/api/docs-viewer.js +684 -0
- package/dist/apps/api/i18n/de-DE.d.ts.map +1 -1
- package/dist/apps/api/i18n/de-DE.js +130 -0
- package/dist/apps/api/i18n/en-US.d.ts.map +1 -1
- package/dist/apps/api/i18n/en-US.js +140 -0
- package/dist/apps/api/i18n/es-ES.d.ts.map +1 -1
- package/dist/apps/api/i18n/es-ES.js +130 -0
- package/dist/apps/api/i18n/fr-FR.d.ts.map +1 -1
- package/dist/apps/api/i18n/fr-FR.js +130 -0
- package/dist/apps/api/i18n/index.js +27 -0
- package/dist/apps/api/i18n/ja-JP.d.ts.map +1 -1
- package/dist/apps/api/i18n/ja-JP.js +130 -0
- package/dist/apps/api/i18n/ko-KR.d.ts.map +1 -1
- package/dist/apps/api/i18n/ko-KR.js +130 -0
- package/dist/apps/api/i18n/pt-BR.d.ts.map +1 -1
- package/dist/apps/api/i18n/pt-BR.js +130 -0
- package/dist/apps/api/i18n/zh-CN.d.ts.map +1 -1
- package/dist/apps/api/i18n/zh-CN.js +140 -0
- package/dist/apps/api/i18n/zh-HK.d.ts.map +1 -1
- package/dist/apps/api/i18n/zh-HK.js +130 -0
- package/dist/apps/api/i18n/zh-TW.d.ts.map +1 -1
- package/dist/apps/api/i18n/zh-TW.js +130 -0
- package/dist/apps/api/pages/docs.d.ts.map +1 -1
- package/dist/apps/api/pages/docs.js +367 -0
- package/dist/apps/api/standalone.js +1 -0
- package/dist/apps/demo/app.js +273 -0
- package/dist/apps/demo/editor.d.ts.map +1 -1
- package/dist/apps/demo/editor.js +270 -0
- package/dist/apps/demo/helpers.js +7 -0
- package/dist/apps/demo/i18n/de-DE.d.ts.map +1 -1
- package/dist/apps/demo/i18n/de-DE.js +269 -0
- package/dist/apps/demo/i18n/en-US.d.ts.map +1 -1
- package/dist/apps/demo/i18n/en-US.js +281 -0
- package/dist/apps/demo/i18n/es-ES.d.ts.map +1 -1
- package/dist/apps/demo/i18n/es-ES.js +269 -0
- package/dist/apps/demo/i18n/fr-FR.d.ts.map +1 -1
- package/dist/apps/demo/i18n/fr-FR.js +269 -0
- package/dist/apps/demo/i18n/index.js +27 -0
- package/dist/apps/demo/i18n/ja-JP.d.ts.map +1 -1
- package/dist/apps/demo/i18n/ja-JP.js +269 -0
- package/dist/apps/demo/i18n/ko-KR.d.ts.map +1 -1
- package/dist/apps/demo/i18n/ko-KR.js +269 -0
- package/dist/apps/demo/i18n/pt-BR.d.ts.map +1 -1
- package/dist/apps/demo/i18n/pt-BR.js +269 -0
- package/dist/apps/demo/i18n/zh-CN.d.ts.map +1 -1
- package/dist/apps/demo/i18n/zh-CN.js +281 -0
- package/dist/apps/demo/i18n/zh-HK.d.ts.map +1 -1
- package/dist/apps/demo/i18n/zh-HK.js +269 -0
- package/dist/apps/demo/i18n/zh-TW.d.ts.map +1 -1
- package/dist/apps/demo/i18n/zh-TW.js +269 -0
- package/dist/apps/demo/pages/autoform.js +412 -0
- package/dist/apps/demo/pages/basic.js +157 -0
- package/dist/apps/demo/pages/code.js +1088 -0
- package/dist/apps/demo/pages/container.js +42 -0
- package/dist/apps/demo/pages/dashboard.js +159 -0
- package/dist/apps/demo/pages/data.d.ts.map +1 -1
- package/dist/apps/demo/pages/data.js +327 -0
- package/dist/apps/demo/pages/display.d.ts.map +1 -1
- package/dist/apps/demo/pages/display.js +295 -0
- package/dist/apps/demo/pages/feedback.js +94 -0
- package/dist/apps/demo/pages/form.js +99 -0
- package/dist/apps/demo/pages/layout.js +74 -0
- package/dist/apps/demo/pages/navigation.js +54 -0
- package/dist/apps/demo/pages/progress.js +42 -0
- package/dist/apps/demo/pages/theme.js +126 -0
- package/dist/apps/demo/standalone.js +1 -0
- package/dist/components/basic/AGENTS.md +1 -0
- package/dist/components/basic/avatar.js +168 -0
- package/dist/components/basic/badge.js +157 -0
- package/dist/components/basic/button-group.js +70 -0
- package/dist/components/basic/button.d.ts +2 -4
- package/dist/components/basic/button.d.ts.map +1 -1
- package/dist/components/basic/button.js +315 -0
- package/dist/components/basic/card.js +186 -0
- package/dist/components/basic/chip.js +103 -0
- package/dist/components/basic/divider.js +127 -0
- package/dist/components/basic/empty.js +72 -0
- package/dist/components/basic/icon.js +129 -0
- package/dist/components/basic/input.d.ts.map +1 -1
- package/dist/components/basic/input.js +314 -0
- package/dist/components/basic/tag.d.ts +7 -2
- package/dist/components/basic/tag.d.ts.map +1 -1
- package/dist/components/basic/tag.js +248 -0
- package/dist/components/basic/textarea.d.ts +0 -1
- package/dist/components/basic/textarea.d.ts.map +1 -1
- package/dist/components/basic/textarea.js +130 -0
- package/dist/components/container/callout.js +108 -0
- package/dist/components/container/details.js +117 -0
- package/dist/components/container/scroller.js +144 -0
- package/dist/components/container/split-panel.js +150 -0
- package/dist/components/data/AGENTS.md +1 -1
- package/dist/components/data/box-table.d.ts +53 -0
- package/dist/components/data/box-table.d.ts.map +1 -0
- package/dist/components/data/box-table.js +220 -0
- package/dist/components/data/dropdown.d.ts +8 -5
- package/dist/components/data/dropdown.d.ts.map +1 -1
- package/dist/components/data/dropdown.js +219 -0
- package/dist/components/data/metrics-group.js +180 -0
- package/dist/components/data/metrics.d.ts +11 -0
- package/dist/components/data/metrics.d.ts.map +1 -1
- package/dist/components/data/metrics.js +309 -0
- package/dist/components/data/pagination.js +119 -0
- package/dist/components/data/tab-pane.d.ts +58 -12
- package/dist/components/data/tab-pane.d.ts.map +1 -1
- package/dist/components/data/tab-pane.js +130 -0
- package/dist/components/data/table-column.d.ts +29 -5
- package/dist/components/data/table-column.d.ts.map +1 -1
- package/dist/components/data/table-column.js +123 -0
- package/dist/components/data/table.d.ts +134 -54
- package/dist/components/data/table.d.ts.map +1 -1
- package/dist/components/data/table.js +1210 -0
- package/dist/components/data/tabs.d.ts +60 -3
- package/dist/components/data/tabs.d.ts.map +1 -1
- package/dist/components/data/tabs.js +416 -0
- package/dist/components/data/timeline-item.js +127 -0
- package/dist/components/data/timeline.js +204 -0
- package/dist/components/data/tree-menu.d.ts +12 -2
- package/dist/components/data/tree-menu.d.ts.map +1 -1
- package/dist/components/data/tree-menu.js +482 -0
- package/dist/components/data/tree.js +269 -0
- package/dist/components/display/AGENTS.md +5 -2
- package/dist/components/display/animated-image.js +98 -0
- package/dist/components/display/brief-box.d.ts +42 -0
- package/dist/components/display/brief-box.d.ts.map +1 -0
- package/dist/components/display/brief-box.js +117 -0
- package/dist/components/display/carousel.js +223 -0
- package/dist/components/display/code-editor.d.ts.map +1 -1
- package/dist/components/display/code-editor.js +976 -0
- package/dist/components/display/comparison.js +132 -0
- package/dist/components/display/desc-item.d.ts +48 -0
- package/dist/components/display/desc-item.d.ts.map +1 -0
- package/dist/components/display/desc-item.js +150 -0
- package/dist/components/display/desc.d.ts +64 -0
- package/dist/components/display/desc.d.ts.map +1 -0
- package/dist/components/display/desc.js +363 -0
- package/dist/components/display/detail-box.d.ts +51 -0
- package/dist/components/display/detail-box.d.ts.map +1 -0
- package/dist/components/display/detail-box.js +157 -0
- package/dist/components/display/label.js +166 -0
- package/dist/components/display/markdown-editor.js +319 -0
- package/dist/components/display/markdown.d.ts.map +1 -1
- package/dist/components/display/markdown.js +193 -0
- package/dist/components/display/mini-box.d.ts +31 -0
- package/dist/components/display/mini-box.d.ts.map +1 -0
- package/dist/components/display/mini-box.js +137 -0
- package/dist/components/display/profile.d.ts +18 -0
- package/dist/components/display/profile.d.ts.map +1 -0
- package/dist/components/display/profile.js +164 -0
- package/dist/components/feedback/AGENTS.md +1 -0
- package/dist/components/feedback/alert.js +150 -0
- package/dist/components/feedback/dialog.js +228 -0
- package/dist/components/feedback/drawer.d.ts.map +1 -1
- package/dist/components/feedback/drawer.js +338 -0
- package/dist/components/feedback/loading.js +130 -0
- package/dist/components/feedback/modal.d.ts.map +1 -1
- package/dist/components/feedback/modal.js +303 -0
- package/dist/components/feedback/notification.js +170 -0
- package/dist/components/feedback/popover.d.ts +1 -1
- package/dist/components/feedback/popover.js +124 -0
- package/dist/components/feedback/toast.js +142 -0
- package/dist/components/feedback/tooltip.d.ts +1 -1
- package/dist/components/feedback/tooltip.js +153 -0
- package/dist/components/form/AGENTS.md +4 -0
- package/dist/components/form/autoform-item.js +761 -0
- package/dist/components/form/autoform.d.ts +15 -5
- package/dist/components/form/autoform.d.ts.map +1 -1
- package/dist/components/form/autoform.js +303 -0
- package/dist/components/form/checkbox-group.js +118 -0
- package/dist/components/form/checkbox.js +123 -0
- package/dist/components/form/color-picker.js +148 -0
- package/dist/components/form/combobox.d.ts.map +1 -1
- package/dist/components/form/combobox.js +282 -0
- package/dist/components/form/date-picker.js +123 -0
- package/dist/components/form/form-item.d.ts.map +1 -1
- package/dist/components/form/form-item.js +141 -0
- package/dist/components/form/form.js +94 -0
- package/dist/components/form/radio-group.js +106 -0
- package/dist/components/form/radio.js +110 -0
- package/dist/components/form/rate.js +116 -0
- package/dist/components/form/select.d.ts +1 -1
- package/dist/components/form/select.js +495 -0
- package/dist/components/form/slider.js +134 -0
- package/dist/components/form/switch.js +146 -0
- package/dist/components/form/time-picker.js +92 -0
- package/dist/components/form/transfer.js +273 -0
- package/dist/components/form/upload.js +138 -0
- package/dist/components/framework/body.js +333 -0
- package/dist/components/framework/dashboard-panel.js +519 -0
- package/dist/components/framework/dashboard.d.ts.map +1 -1
- package/dist/components/framework/dashboard.js +1084 -0
- package/dist/components/framework/header.js +237 -0
- package/dist/components/framework/log-panel.js +637 -0
- package/dist/components/framework/page.js +151 -0
- package/dist/components/framework/sidebar.d.ts +4 -10
- package/dist/components/framework/sidebar.d.ts.map +1 -1
- package/dist/components/framework/sidebar.js +477 -0
- package/dist/components/layout/affix.js +137 -0
- package/dist/components/layout/col.js +103 -0
- package/dist/components/layout/collapse-item.js +165 -0
- package/dist/components/layout/collapse.js +108 -0
- package/dist/components/layout/container.js +92 -0
- package/dist/components/layout/flex.js +100 -0
- package/dist/components/layout/row.js +103 -0
- package/dist/components/layout/space.js +85 -0
- package/dist/components/navigation/back-top.js +127 -0
- package/dist/components/navigation/breadcrumb-item.js +108 -0
- package/dist/components/navigation/breadcrumb.js +70 -0
- package/dist/components/navigation/menu-item.js +181 -0
- package/dist/components/navigation/menu.js +126 -0
- package/dist/components/navigation/steps.js +183 -0
- package/dist/components/navigation/sub-menu.js +253 -0
- package/dist/components/progress/progress-bar.js +97 -0
- package/dist/components/progress/progress-ring.js +111 -0
- package/dist/components/progress/skeleton.js +108 -0
- package/dist/components/progress/spinner.js +129 -0
- package/dist/components/theme/locale-switch.js +241 -0
- package/dist/components/theme/shadow-picker.js +233 -0
- package/dist/components/theme/shape-picker.js +232 -0
- package/dist/components/theme/theme-picker.js +236 -0
- package/dist/components/theme/theme-preview.d.ts +1 -2
- package/dist/components/theme/theme-preview.d.ts.map +1 -1
- package/dist/components/theme/theme-preview.js +376 -0
- package/dist/components/theme/theme-switch.d.ts.map +1 -1
- package/dist/components/theme/theme-switch.js +318 -0
- package/dist/components/theme/typo-picker.js +219 -0
- package/dist/core/AGENTS.md +6 -1
- package/dist/core/aithe-element.d.ts +2 -2
- package/dist/core/aithe-element.js +135 -0
- package/dist/core/aithe-widget.js +30 -0
- package/dist/core/anchored-overlay.d.ts +3 -0
- package/dist/core/anchored-overlay.d.ts.map +1 -1
- package/dist/core/anchored-overlay.js +111 -0
- package/dist/core/autoform/autoform.js +79 -0
- package/dist/core/autoform/condition.js +170 -0
- package/dist/core/autoform/index.js +8 -0
- package/dist/core/autoform/types.js +7 -0
- package/dist/core/datahub/config/strategy.d.ts +1 -1
- package/dist/core/datahub/config/strategy.d.ts.map +1 -1
- package/dist/core/datahub/config/strategy.js +50 -0
- package/dist/core/datahub/core/adapter/fetch-adapter.d.ts +1 -1
- package/dist/core/datahub/core/adapter/fetch-adapter.d.ts.map +1 -1
- package/dist/core/datahub/core/adapter/fetch-adapter.js +118 -0
- package/dist/core/datahub/core/adapter/index.js +7 -0
- package/dist/core/datahub/core/adapter/mock-adapter.d.ts +1 -1
- package/dist/core/datahub/core/adapter/mock-adapter.d.ts.map +1 -1
- package/dist/core/datahub/core/adapter/mock-adapter.js +58 -0
- package/dist/core/datahub/core/api-styles.d.ts +1 -1
- package/dist/core/datahub/core/api-styles.d.ts.map +1 -1
- package/dist/core/datahub/core/api-styles.js +131 -0
- package/dist/core/datahub/core/datahub-core.d.ts +3 -3
- package/dist/core/datahub/core/datahub-core.d.ts.map +1 -1
- package/dist/core/datahub/core/datahub-core.js +441 -0
- package/dist/core/datahub/core/index.js +7 -0
- package/dist/core/datahub/index.js +50 -0
- package/dist/core/datahub/types.d.ts +6 -0
- package/dist/core/datahub/types.d.ts.map +1 -1
- package/dist/core/datahub/types.js +31 -0
- package/dist/core/datahub/utils/cache.js +55 -0
- package/dist/core/datahub/utils/common.js +23 -0
- package/dist/core/datahub/utils/dedup.d.ts +1 -1
- package/dist/core/datahub/utils/dedup.d.ts.map +1 -1
- package/dist/core/datahub/utils/dedup.js +52 -0
- package/dist/core/datahub/utils/idempotent.js +61 -0
- package/dist/core/datahub/utils/is-query.js +53 -0
- package/dist/core/datahub/utils/loading.js +78 -0
- package/dist/core/filter/__tests__/index.test.d.ts +2 -0
- package/dist/core/filter/__tests__/index.test.d.ts.map +1 -0
- package/dist/core/filter/__tests__/index.test.js +230 -0
- package/dist/core/filter/builtins.d.ts +60 -0
- package/dist/core/filter/builtins.d.ts.map +1 -0
- package/dist/core/filter/builtins.js +172 -0
- package/dist/core/filter/factory.d.ts +54 -0
- package/dist/core/filter/factory.d.ts.map +1 -0
- package/dist/core/filter/factory.js +96 -0
- package/dist/core/filter/index.d.ts +11 -0
- package/dist/core/filter/index.d.ts.map +1 -0
- package/dist/core/filter/index.js +9 -0
- package/dist/core/filter/types.d.ts +12 -0
- package/dist/core/filter/types.d.ts.map +1 -0
- package/dist/core/filter/types.js +1 -0
- package/dist/core/floating.js +132 -0
- package/dist/core/highlight/index.js +43 -0
- package/dist/core/highlight/lang-bash.js +27 -0
- package/dist/core/highlight/lang-c.js +27 -0
- package/dist/core/highlight/lang-cmake.js +27 -0
- package/dist/core/highlight/lang-cpp.js +27 -0
- package/dist/core/highlight/lang-css.js +24 -0
- package/dist/core/highlight/lang-dart.js +27 -0
- package/dist/core/highlight/lang-dockerfile.js +16 -0
- package/dist/core/highlight/lang-fsharp.js +23 -0
- package/dist/core/highlight/lang-go.js +22 -0
- package/dist/core/highlight/lang-html.js +12 -0
- package/dist/core/highlight/lang-java.js +22 -0
- package/dist/core/highlight/lang-javascript.js +26 -0
- package/dist/core/highlight/lang-json.js +13 -0
- package/dist/core/highlight/lang-jsonline.js +13 -0
- package/dist/core/highlight/lang-jsx.js +30 -0
- package/dist/core/highlight/lang-kotlin.js +27 -0
- package/dist/core/highlight/lang-latex.js +22 -0
- package/dist/core/highlight/lang-lua.js +26 -0
- package/dist/core/highlight/lang-makefile.js +22 -0
- package/dist/core/highlight/lang-markdown.js +18 -0
- package/dist/core/highlight/lang-objectivec.js +24 -0
- package/dist/core/highlight/lang-perl.js +30 -0
- package/dist/core/highlight/lang-powershell.js +23 -0
- package/dist/core/highlight/lang-python.js +27 -0
- package/dist/core/highlight/lang-r.js +21 -0
- package/dist/core/highlight/lang-ruby.js +29 -0
- package/dist/core/highlight/lang-rust.js +24 -0
- package/dist/core/highlight/lang-scala.js +26 -0
- package/dist/core/highlight/lang-sql.js +21 -0
- package/dist/core/highlight/lang-svelte.js +27 -0
- package/dist/core/highlight/lang-swift.js +28 -0
- package/dist/core/highlight/lang-tsx.js +35 -0
- package/dist/core/highlight/lang-typescript.js +31 -0
- package/dist/core/highlight/lang-vue.js +29 -0
- package/dist/core/highlight/lang-wasm.js +22 -0
- package/dist/core/highlight/lang-xml.js +12 -0
- package/dist/core/highlight/lang-yaml.js +14 -0
- package/dist/core/highlight/registry.js +99 -0
- package/dist/core/logger/LoggerCore.js +626 -0
- package/dist/core/logger/index.js +10 -0
- package/dist/core/logger/types.js +29 -0
- package/dist/core/markdown/index.js +20 -0
- package/dist/core/markdown/parser.d.ts +2 -0
- package/dist/core/markdown/parser.d.ts.map +1 -1
- package/dist/core/markdown/parser.js +376 -0
- package/dist/core/markdown/plugins.js +608 -0
- package/dist/core/markdown/types.d.ts +5 -0
- package/dist/core/markdown/types.d.ts.map +1 -1
- package/dist/core/markdown/types.js +7 -0
- package/dist/core/router/index.js +244 -0
- package/dist/core/styles.js +44 -0
- package/dist/core/types.d.ts +50 -3
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2812 -1253
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1670 -728
- package/dist/index.umd.js.map +1 -1
- package/dist/styles/aithe-ui.d.ts +23 -0
- package/dist/styles/aithe-ui.d.ts.map +1 -1
- package/dist/styles/aithe-ui.js +185 -0
- package/dist/styles/global.css.d.ts +1 -1
- package/dist/styles/global.css.d.ts.map +1 -1
- package/dist/styles/global.css.js +119 -0
- package/dist/styles/i18n/index.js +206 -0
- package/dist/styles/i18n/locales/de-DE.d.ts.map +1 -1
- package/dist/styles/i18n/locales/de-DE.js +148 -0
- package/dist/styles/i18n/locales/en-US.d.ts.map +1 -1
- package/dist/styles/i18n/locales/en-US.js +157 -0
- package/dist/styles/i18n/locales/es-ES.d.ts.map +1 -1
- package/dist/styles/i18n/locales/es-ES.js +148 -0
- package/dist/styles/i18n/locales/fr-FR.d.ts.map +1 -1
- package/dist/styles/i18n/locales/fr-FR.js +148 -0
- package/dist/styles/i18n/locales/index.js +14 -0
- package/dist/styles/i18n/locales/ja-JP.d.ts.map +1 -1
- package/dist/styles/i18n/locales/ja-JP.js +148 -0
- package/dist/styles/i18n/locales/ko-KR.d.ts.map +1 -1
- package/dist/styles/i18n/locales/ko-KR.js +148 -0
- package/dist/styles/i18n/locales/pt-BR.d.ts.map +1 -1
- package/dist/styles/i18n/locales/pt-BR.js +148 -0
- package/dist/styles/i18n/locales/zh-CN.d.ts.map +1 -1
- package/dist/styles/i18n/locales/zh-CN.js +157 -0
- package/dist/styles/i18n/locales/zh-HK.d.ts.map +1 -1
- package/dist/styles/i18n/locales/zh-HK.js +148 -0
- package/dist/styles/i18n/locales/zh-TW.d.ts.map +1 -1
- package/dist/styles/i18n/locales/zh-TW.js +148 -0
- package/dist/styles/layout/index.js +88 -0
- package/dist/styles/mixins.js +43 -0
- package/dist/styles/shadow/cyber.js +19 -0
- package/dist/styles/shadow/deep.js +19 -0
- package/dist/styles/shadow/diffuse.js +19 -0
- package/dist/styles/shadow/flat.js +19 -0
- package/dist/styles/shadow/glassmorphism.js +19 -0
- package/dist/styles/shadow/index.js +129 -0
- package/dist/styles/shadow/neumorphism.js +21 -0
- package/dist/styles/shadow/retro.js +19 -0
- package/dist/styles/shadow/sharp-business.js +19 -0
- package/dist/styles/shadow/skeuomorphic.js +21 -0
- package/dist/styles/shape/chamfer.js +19 -0
- package/dist/styles/shape/circle.js +19 -0
- package/dist/styles/shape/index.js +174 -0
- package/dist/styles/shape/organic.js +19 -0
- package/dist/styles/shape/pill.js +19 -0
- package/dist/styles/shape/rounded.js +21 -0
- package/dist/styles/shape/rounder.js +19 -0
- package/dist/styles/shape/sharp.js +19 -0
- package/dist/styles/shape/smooth.js +19 -0
- package/dist/styles/theme/aliyun.d.ts +1 -1
- package/dist/styles/theme/aliyun.d.ts.map +1 -1
- package/dist/styles/theme/aliyun.js +102 -0
- package/dist/styles/theme/amber.d.ts +1 -1
- package/dist/styles/theme/amber.d.ts.map +1 -1
- package/dist/styles/theme/amber.js +101 -0
- package/dist/styles/theme/blue.d.ts +1 -1
- package/dist/styles/theme/blue.d.ts.map +1 -1
- package/dist/styles/theme/blue.js +101 -0
- package/dist/styles/theme/charcoal.d.ts +1 -1
- package/dist/styles/theme/charcoal.d.ts.map +1 -1
- package/dist/styles/theme/charcoal.js +106 -0
- package/dist/styles/theme/cyan.d.ts +1 -1
- package/dist/styles/theme/cyan.d.ts.map +1 -1
- package/dist/styles/theme/cyan.js +96 -0
- package/dist/styles/theme/dark.d.ts +1 -1
- package/dist/styles/theme/dark.d.ts.map +1 -1
- package/dist/styles/theme/dark.js +106 -0
- package/dist/styles/theme/ebony.d.ts +1 -1
- package/dist/styles/theme/ebony.d.ts.map +1 -1
- package/dist/styles/theme/ebony.js +106 -0
- package/dist/styles/theme/festive.d.ts +1 -1
- package/dist/styles/theme/festive.d.ts.map +1 -1
- package/dist/styles/theme/festive.js +101 -0
- package/dist/styles/theme/graphite.d.ts +1 -1
- package/dist/styles/theme/graphite.d.ts.map +1 -1
- package/dist/styles/theme/graphite.js +106 -0
- package/dist/styles/theme/gray.d.ts +1 -1
- package/dist/styles/theme/gray.d.ts.map +1 -1
- package/dist/styles/theme/gray.js +101 -0
- package/dist/styles/theme/huawei.d.ts +1 -1
- package/dist/styles/theme/huawei.d.ts.map +1 -1
- package/dist/styles/theme/huawei.js +102 -0
- package/dist/styles/theme/index.d.ts +1 -1
- package/dist/styles/theme/index.d.ts.map +1 -1
- package/dist/styles/theme/index.js +276 -0
- package/dist/styles/theme/indigo.d.ts +1 -1
- package/dist/styles/theme/indigo.d.ts.map +1 -1
- package/dist/styles/theme/indigo.js +101 -0
- package/dist/styles/theme/ink.d.ts +1 -1
- package/dist/styles/theme/ink.d.ts.map +1 -1
- package/dist/styles/theme/ink.js +106 -0
- package/dist/styles/theme/light.d.ts +1 -1
- package/dist/styles/theme/light.d.ts.map +1 -1
- package/dist/styles/theme/light.js +102 -0
- package/dist/styles/theme/midnight.d.ts +1 -1
- package/dist/styles/theme/midnight.d.ts.map +1 -1
- package/dist/styles/theme/midnight.js +106 -0
- package/dist/styles/theme/navy.d.ts +1 -1
- package/dist/styles/theme/navy.d.ts.map +1 -1
- package/dist/styles/theme/navy.js +106 -0
- package/dist/styles/theme/obsidian.d.ts +1 -1
- package/dist/styles/theme/obsidian.d.ts.map +1 -1
- package/dist/styles/theme/obsidian.js +106 -0
- package/dist/styles/theme/onyx.d.ts +1 -1
- package/dist/styles/theme/onyx.d.ts.map +1 -1
- package/dist/styles/theme/onyx.js +106 -0
- package/dist/styles/theme/orange.d.ts +1 -1
- package/dist/styles/theme/orange.d.ts.map +1 -1
- package/dist/styles/theme/orange.js +101 -0
- package/dist/styles/theme/pink.d.ts +1 -1
- package/dist/styles/theme/pink.d.ts.map +1 -1
- package/dist/styles/theme/pink.js +101 -0
- package/dist/styles/theme/purple.d.ts +1 -1
- package/dist/styles/theme/purple.d.ts.map +1 -1
- package/dist/styles/theme/purple.js +101 -0
- package/dist/styles/theme/raisin.d.ts +1 -1
- package/dist/styles/theme/raisin.d.ts.map +1 -1
- package/dist/styles/theme/raisin.js +106 -0
- package/dist/styles/theme/slate.d.ts +1 -1
- package/dist/styles/theme/slate.d.ts.map +1 -1
- package/dist/styles/theme/slate.js +106 -0
- package/dist/styles/theme/teal.d.ts +1 -1
- package/dist/styles/theme/teal.d.ts.map +1 -1
- package/dist/styles/theme/teal.js +101 -0
- package/dist/styles/theme/tianyi.d.ts +1 -1
- package/dist/styles/theme/tianyi.d.ts.map +1 -1
- package/dist/styles/theme/tianyi.js +102 -0
- package/dist/styles/types.js +1 -0
- package/dist/styles/typo/business.js +34 -0
- package/dist/styles/typo/compact.js +34 -0
- package/dist/styles/typo/index.js +99 -0
- package/dist/styles/typo/luxury.js +34 -0
- package/dist/styles/typo/minimal.js +34 -0
- package/dist/types/index.js +2 -0
- package/dist/utils/dom.js +51 -0
- package/dist/utils/events.js +32 -0
- package/dist/utils/icon.js +176 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/utils.d.ts +5 -5
- package/dist/utils/utils.js +89 -0
- package/dist/utils/validation.js +52 -0
- package/docs/api/basic/button.md +9 -6
- package/docs/api/basic/tag.md +24 -17
- package/docs/api/data/box-table.md +73 -0
- package/docs/api/data/dropdown.md +3 -2
- package/docs/api/data/metrics.md +2 -0
- package/docs/api/data/table-column.md +37 -23
- package/docs/api/data/table.md +158 -44
- package/docs/api/data/tabs.md +46 -1
- package/docs/api/data/tree-menu.md +55 -2
- package/docs/api/display/box.md +66 -0
- package/docs/api/display/brief-box.md +73 -0
- package/docs/api/display/desc-item.md +57 -0
- package/docs/api/display/desc.md +204 -0
- package/docs/api/display/detail-box.md +75 -0
- package/docs/api/display/mini-box.md +100 -0
- package/docs/api/display/profile.md +92 -0
- package/docs/api/feedback/popover.md +10 -10
- package/docs/api/feedback/tooltip.md +14 -14
- package/docs/api/form/autoform-item.md +100 -0
- package/docs/api/form/autoform.md +4 -1
- package/docs/api/form/select.md +28 -28
- package/docs/api/framework/log-panel.md +46 -0
- package/docs/api/framework/sidebar.md +3 -2
- package/docs/api/summary.md +45 -35
- package/docs/api/theme/theme-switch.md +1 -1
- package/docs/autoform.md +13 -1
- package/docs/changelog/CHANGELOG.md +80 -0
- package/docs/changelog/VERSION_26.3.1.md +966 -0
- package/docs/datahub.md +1 -1
- package/docs/filter.md +332 -0
- package/docs/framework-integration.md +2 -2
- package/docs/guide.md +66 -1
- package/docs/i18n.md +2 -2
- package/docs/issue/issue_26.3.1.0.md +84 -0
- package/docs/issue/issue_26.3.1.1.md +72 -0
- package/docs/issue/issue_26.3.1.2.md +75 -0
- package/docs/issue/issue_26.3.1.3.md +78 -0
- package/docs/issue/issue_26.3.1.4.md +113 -0
- package/docs/issue/issue_26.3.1.5.md +142 -0
- package/docs/issue/issue_26.3.1.6.md +100 -0
- package/docs/issue/issue_26.3.1.7.md +78 -0
- package/docs/quickstart.md +5 -5
- package/package.json +5 -2
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { css, html } from 'lit';
|
|
8
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
9
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
10
|
+
import { repeat } from 'lit/directives/repeat.js';
|
|
11
|
+
import { AitheElement } from '../../core/aithe-element';
|
|
12
|
+
import { logger, LogLevel, LOG_LEVEL_LABEL } from '../../core/logger';
|
|
13
|
+
import { safeStringify } from '../../utils/utils';
|
|
14
|
+
const LEVEL_COLORS = {
|
|
15
|
+
DEBUG: 'var(--aithe-color-text-muted)',
|
|
16
|
+
INFO: 'var(--aithe-primary-6)',
|
|
17
|
+
WARN: '#d18f29',
|
|
18
|
+
ERROR: '#df526b',
|
|
19
|
+
FATAL: '#a0153a',
|
|
20
|
+
};
|
|
21
|
+
const LEVEL_ICONS = {
|
|
22
|
+
DEBUG: '·',
|
|
23
|
+
INFO: 'ℹ',
|
|
24
|
+
WARN: '⚠',
|
|
25
|
+
ERROR: '✕',
|
|
26
|
+
FATAL: '✕✕',
|
|
27
|
+
};
|
|
28
|
+
function formatTime(ts) {
|
|
29
|
+
const d = new Date(ts);
|
|
30
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
31
|
+
return `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}.${String(d.getMilliseconds()).padStart(3, '0')}`;
|
|
32
|
+
}
|
|
33
|
+
let AitheLogPanel = class AitheLogPanel extends AitheElement {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(...arguments);
|
|
36
|
+
this.open = false;
|
|
37
|
+
this.panelPlacement = 'overlay';
|
|
38
|
+
this._entries = [];
|
|
39
|
+
this._filterLevel = null;
|
|
40
|
+
this._searchText = '';
|
|
41
|
+
this._expandedIds = new Set();
|
|
42
|
+
this._panelHeight = 200;
|
|
43
|
+
this._unsubscribe = null;
|
|
44
|
+
this._unsubscribeClear = null;
|
|
45
|
+
this._dragStartY = 0;
|
|
46
|
+
this._dragStartHeight = 0;
|
|
47
|
+
this._dragging = false;
|
|
48
|
+
}
|
|
49
|
+
static { this.styles = css `
|
|
50
|
+
:host {
|
|
51
|
+
display: contents;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.panel {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
background: var(--aithe-color-surface-elevated, #fff);
|
|
58
|
+
border-top: 1px solid var(--aithe-color-border, #e0e0e0);
|
|
59
|
+
font-family: var(--aithe-font-family-mono, 'SF Mono', Menlo, Consolas, monospace);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.panel.overlay {
|
|
63
|
+
position: fixed;
|
|
64
|
+
right: 0;
|
|
65
|
+
bottom: 0;
|
|
66
|
+
width: min(560px, 100vw);
|
|
67
|
+
max-height: 60vh;
|
|
68
|
+
border-top: 1px solid var(--aithe-color-border, #e0e0e0);
|
|
69
|
+
border-left: 1px solid var(--aithe-color-border, #e0e0e0);
|
|
70
|
+
border-radius: var(--aithe-container-radius-lg, 8px) 0 0 0;
|
|
71
|
+
box-shadow: var(--aithe-shadow-4, 0 8px 32px rgba(0, 0, 0, 0.12));
|
|
72
|
+
z-index: 99999;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.panel.inline {
|
|
76
|
+
position: relative;
|
|
77
|
+
width: 100%;
|
|
78
|
+
max-width: 100%;
|
|
79
|
+
height: var(--aithe-log-panel-height, 200px);
|
|
80
|
+
min-height: 120px;
|
|
81
|
+
max-height: 60vh;
|
|
82
|
+
margin: 0 auto;
|
|
83
|
+
border: 1px solid var(--aithe-color-border, #e0e0e0);
|
|
84
|
+
border-radius: var(--aithe-container-radius-md, 6px);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.panel.inline.hidden {
|
|
88
|
+
display: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.resize-handle {
|
|
92
|
+
height: 6px;
|
|
93
|
+
cursor: ns-resize;
|
|
94
|
+
background: var(--aithe-color-border, #e0e0e0);
|
|
95
|
+
border-radius: var(--aithe-container-radius-md, 6px) var(--aithe-container-radius-md, 6px) 0 0;
|
|
96
|
+
flex-shrink: 0;
|
|
97
|
+
position: relative;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.resize-handle::after {
|
|
101
|
+
content: '';
|
|
102
|
+
position: absolute;
|
|
103
|
+
left: 50%;
|
|
104
|
+
top: 50%;
|
|
105
|
+
transform: translate(-50%, -50%);
|
|
106
|
+
width: 32px;
|
|
107
|
+
height: 3px;
|
|
108
|
+
border-radius: 2px;
|
|
109
|
+
background: var(--aithe-color-text-muted, #999);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.resize-handle:hover,
|
|
113
|
+
.resize-handle.dragging {
|
|
114
|
+
background: var(--aithe-primary-6, #1677ff);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.resize-handle:hover::after,
|
|
118
|
+
.resize-handle.dragging::after {
|
|
119
|
+
background: #fff;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.toolbar {
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
gap: var(--aithe-space-2, 8px);
|
|
126
|
+
padding: var(--aithe-space-2, 8px) var(--aithe-space-3, 12px);
|
|
127
|
+
border-bottom: 1px solid var(--aithe-color-border, #e0e0e0);
|
|
128
|
+
flex-shrink: 0;
|
|
129
|
+
flex-wrap: wrap;
|
|
130
|
+
background: var(--aithe-color-surface, var(--aithe-color-surface-elevated, #fff));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.toolbar-title {
|
|
134
|
+
font-size: var(--aithe-font-size-sm, 13px);
|
|
135
|
+
font-weight: var(--aithe-font-weight-semibold, 600);
|
|
136
|
+
color: var(--aithe-color-text, #1a1a1a);
|
|
137
|
+
margin-right: auto;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.search-input {
|
|
141
|
+
height: 26px;
|
|
142
|
+
padding: 0 var(--aithe-space-2, 8px);
|
|
143
|
+
border: 1px solid var(--aithe-color-border, #e0e0e0);
|
|
144
|
+
border-radius: var(--aithe-radius-sm, 4px);
|
|
145
|
+
background: var(--aithe-color-surface, #fff);
|
|
146
|
+
color: var(--aithe-color-text, #1a1a1a);
|
|
147
|
+
font-size: var(--aithe-font-size-xs, 12px);
|
|
148
|
+
outline: none;
|
|
149
|
+
width: 120px;
|
|
150
|
+
transition: border-color 0.15s;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.search-input:focus {
|
|
154
|
+
border-color: var(--aithe-primary-6, #1677ff);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.search-input::placeholder {
|
|
158
|
+
color: var(--aithe-color-text-muted, #999);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.toolbar-btn {
|
|
162
|
+
display: inline-flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
justify-content: center;
|
|
165
|
+
height: 26px;
|
|
166
|
+
padding: 0 var(--aithe-space-2, 8px);
|
|
167
|
+
border: 1px solid var(--aithe-color-border, #e0e0e0);
|
|
168
|
+
border-radius: var(--aithe-radius-sm, 4px);
|
|
169
|
+
background: transparent;
|
|
170
|
+
color: var(--aithe-color-text, #1a1a1a);
|
|
171
|
+
font-size: var(--aithe-font-size-xs, 12px);
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
white-space: nowrap;
|
|
174
|
+
transition:
|
|
175
|
+
background 0.15s,
|
|
176
|
+
border-color 0.15s;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.toolbar-btn:hover {
|
|
180
|
+
background: var(--aithe-color-surface-muted, #f5f5f5);
|
|
181
|
+
border-color: var(--aithe-primary-6, #1677ff);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.toolbar-btn.active {
|
|
185
|
+
background: var(--aithe-primary-6, #1677ff);
|
|
186
|
+
color: #fff;
|
|
187
|
+
border-color: var(--aithe-primary-6, #1677ff);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.log-list {
|
|
191
|
+
flex: 1;
|
|
192
|
+
overflow-y: auto;
|
|
193
|
+
overflow-x: hidden;
|
|
194
|
+
font-size: var(--aithe-font-size-xs, 12px);
|
|
195
|
+
line-height: 1.5;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.log-item {
|
|
199
|
+
display: flex;
|
|
200
|
+
align-items: flex-start;
|
|
201
|
+
gap: var(--aithe-space-2, 8px);
|
|
202
|
+
padding: var(--aithe-space-1, 4px) var(--aithe-space-3, 12px);
|
|
203
|
+
border-bottom: 1px solid var(--aithe-color-border-subtle, #f0f0f0);
|
|
204
|
+
word-break: break-all;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.log-item:hover {
|
|
208
|
+
background: var(--aithe-color-surface-muted, #f5f5f5);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.log-item:hover .log-actions {
|
|
212
|
+
opacity: 1;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.log-time {
|
|
216
|
+
flex-shrink: 0;
|
|
217
|
+
color: var(--aithe-color-text-muted, #999);
|
|
218
|
+
font-size: 11px;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.log-level {
|
|
222
|
+
flex-shrink: 0;
|
|
223
|
+
font-weight: var(--aithe-font-weight-semibold, 600);
|
|
224
|
+
font-size: 11px;
|
|
225
|
+
min-width: 42px;
|
|
226
|
+
text-align: center;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.log-icon {
|
|
230
|
+
flex-shrink: 0;
|
|
231
|
+
width: 16px;
|
|
232
|
+
text-align: center;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.log-msg {
|
|
236
|
+
flex: 1;
|
|
237
|
+
min-width: 0;
|
|
238
|
+
color: var(--aithe-color-text, #1a1a1a);
|
|
239
|
+
display: flex;
|
|
240
|
+
flex-direction: column;
|
|
241
|
+
gap: 2px;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.log-msg-row {
|
|
245
|
+
display: flex;
|
|
246
|
+
align-items: flex-start;
|
|
247
|
+
gap: 4px;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.log-msg-text {
|
|
251
|
+
flex: 1;
|
|
252
|
+
min-width: 0;
|
|
253
|
+
word-break: break-word;
|
|
254
|
+
white-space: pre-wrap;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.log-actions {
|
|
258
|
+
display: inline-flex;
|
|
259
|
+
align-items: center;
|
|
260
|
+
gap: 2px;
|
|
261
|
+
flex-shrink: 0;
|
|
262
|
+
opacity: 0;
|
|
263
|
+
transition: opacity 0.15s;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.log-msg-row:hover .log-actions {
|
|
267
|
+
opacity: 1;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.log-action-btn {
|
|
271
|
+
display: inline-flex;
|
|
272
|
+
align-items: center;
|
|
273
|
+
justify-content: center;
|
|
274
|
+
width: 20px;
|
|
275
|
+
height: 20px;
|
|
276
|
+
border: none;
|
|
277
|
+
border-radius: var(--aithe-radius-sm, 4px);
|
|
278
|
+
background: transparent;
|
|
279
|
+
color: var(--aithe-color-text-muted, #999);
|
|
280
|
+
cursor: pointer;
|
|
281
|
+
font-size: 12px;
|
|
282
|
+
line-height: 1;
|
|
283
|
+
padding: 0;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.log-action-btn:hover {
|
|
287
|
+
background: var(--aithe-color-surface-muted, #f5f5f5);
|
|
288
|
+
color: var(--aithe-primary-6, #1677ff);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.log-data {
|
|
292
|
+
display: flex;
|
|
293
|
+
align-items: flex-start;
|
|
294
|
+
gap: 4px;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.log-data-content {
|
|
298
|
+
flex: 1;
|
|
299
|
+
min-width: 0;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.log-data-content pre {
|
|
303
|
+
margin: 0;
|
|
304
|
+
padding: var(--aithe-space-1, 4px);
|
|
305
|
+
background: var(--aithe-color-surface-muted, #f5f5f5);
|
|
306
|
+
border-radius: var(--aithe-radius-sm, 4px);
|
|
307
|
+
overflow-x: auto;
|
|
308
|
+
font-size: 11px;
|
|
309
|
+
line-height: 1.4;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.log-stack {
|
|
313
|
+
margin: 0;
|
|
314
|
+
padding: var(--aithe-space-1, 4px);
|
|
315
|
+
background: rgba(223, 82, 107, 0.06);
|
|
316
|
+
border-radius: var(--aithe-radius-sm, 4px);
|
|
317
|
+
font-size: 11px;
|
|
318
|
+
color: #df526b;
|
|
319
|
+
white-space: pre-wrap;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.empty {
|
|
323
|
+
display: flex;
|
|
324
|
+
align-items: center;
|
|
325
|
+
justify-content: center;
|
|
326
|
+
height: 120px;
|
|
327
|
+
color: var(--aithe-color-text-muted, #999);
|
|
328
|
+
font-size: var(--aithe-font-size-sm, 13px);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
@media (max-width: 480px) {
|
|
332
|
+
.panel.overlay {
|
|
333
|
+
width: 100vw;
|
|
334
|
+
max-height: 50vh;
|
|
335
|
+
border-radius: var(--aithe-container-radius-lg, 8px) var(--aithe-container-radius-lg, 8px) 0
|
|
336
|
+
0;
|
|
337
|
+
border-left: none;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.search-input {
|
|
341
|
+
width: 80px;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
`; }
|
|
345
|
+
connectedCallback() {
|
|
346
|
+
super.connectedCallback();
|
|
347
|
+
this._entries = [...logger.entries];
|
|
348
|
+
this._unsubscribe = logger.subscribe(() => {
|
|
349
|
+
this._entries = [...logger.entries];
|
|
350
|
+
if (this.open) {
|
|
351
|
+
this.updateComplete.then(() => this._scrollToBottom());
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
this._unsubscribeClear = logger.onClear(() => {
|
|
355
|
+
this._entries = [];
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
disconnectedCallback() {
|
|
359
|
+
super.disconnectedCallback();
|
|
360
|
+
this._unsubscribe?.();
|
|
361
|
+
this._unsubscribe = null;
|
|
362
|
+
this._unsubscribeClear?.();
|
|
363
|
+
this._unsubscribeClear = null;
|
|
364
|
+
}
|
|
365
|
+
_scrollToBottom() {
|
|
366
|
+
const el = this._scrollContainer;
|
|
367
|
+
if (el) {
|
|
368
|
+
el.scrollTop = el.scrollHeight;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
_togglePanel() {
|
|
372
|
+
this.open = !this.open;
|
|
373
|
+
this.emit('log-panel-toggle', { open: this.open });
|
|
374
|
+
}
|
|
375
|
+
_clearLogs() {
|
|
376
|
+
logger.clear();
|
|
377
|
+
}
|
|
378
|
+
_setFilter(level) {
|
|
379
|
+
this._filterLevel = this._filterLevel === level ? null : level;
|
|
380
|
+
}
|
|
381
|
+
_handleSearch(e) {
|
|
382
|
+
this._searchText = e.target.value;
|
|
383
|
+
}
|
|
384
|
+
_toggleExpand(id) {
|
|
385
|
+
const next = new Set(this._expandedIds);
|
|
386
|
+
if (next.has(id)) {
|
|
387
|
+
next.delete(id);
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
next.add(id);
|
|
391
|
+
}
|
|
392
|
+
this._expandedIds = next;
|
|
393
|
+
}
|
|
394
|
+
_copyMessage(entry) {
|
|
395
|
+
navigator.clipboard.writeText(entry.message);
|
|
396
|
+
}
|
|
397
|
+
_copyData(entry) {
|
|
398
|
+
const parts = [];
|
|
399
|
+
for (const d of entry.data) {
|
|
400
|
+
if (d !== null && typeof d === 'object') {
|
|
401
|
+
parts.push(safeStringify(d));
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
if (entry.stack) {
|
|
405
|
+
parts.push(entry.stack);
|
|
406
|
+
}
|
|
407
|
+
navigator.clipboard.writeText(parts.join('\n'));
|
|
408
|
+
}
|
|
409
|
+
_onDragStart(e) {
|
|
410
|
+
e.preventDefault();
|
|
411
|
+
this._dragging = true;
|
|
412
|
+
this._dragStartY = e.clientY;
|
|
413
|
+
this._dragStartHeight = this._panelHeight;
|
|
414
|
+
const target = e.currentTarget;
|
|
415
|
+
target.classList.add('dragging');
|
|
416
|
+
target.setPointerCapture(e.pointerId);
|
|
417
|
+
const onMove = (ev) => {
|
|
418
|
+
if (!this._dragging)
|
|
419
|
+
return;
|
|
420
|
+
const delta = this._dragStartY - ev.clientY;
|
|
421
|
+
const newHeight = Math.min(Math.max(this._dragStartHeight + delta, 120), globalThis.innerHeight * 0.6);
|
|
422
|
+
this._panelHeight = newHeight;
|
|
423
|
+
this.style.setProperty('--aithe-log-panel-height', `${newHeight}px`);
|
|
424
|
+
};
|
|
425
|
+
const onUp = (ev) => {
|
|
426
|
+
this._dragging = false;
|
|
427
|
+
target.classList.remove('dragging');
|
|
428
|
+
target.releasePointerCapture(ev.pointerId);
|
|
429
|
+
globalThis.removeEventListener('pointermove', onMove);
|
|
430
|
+
globalThis.removeEventListener('pointerup', onUp);
|
|
431
|
+
};
|
|
432
|
+
globalThis.addEventListener('pointermove', onMove);
|
|
433
|
+
globalThis.addEventListener('pointerup', onUp);
|
|
434
|
+
}
|
|
435
|
+
_filteredEntries() {
|
|
436
|
+
let result = this._entries;
|
|
437
|
+
if (this._filterLevel !== null) {
|
|
438
|
+
result = result.filter((e) => e.level >= this._filterLevel);
|
|
439
|
+
}
|
|
440
|
+
if (this._searchText) {
|
|
441
|
+
const kw = this._searchText.toLowerCase();
|
|
442
|
+
result = result.filter((e) => {
|
|
443
|
+
if (e.message.toLowerCase().includes(kw))
|
|
444
|
+
return true;
|
|
445
|
+
if (e.stack?.toLowerCase().includes(kw))
|
|
446
|
+
return true;
|
|
447
|
+
return e.data.some((d) => {
|
|
448
|
+
if (typeof d === 'string' && d.toLowerCase().includes(kw))
|
|
449
|
+
return true;
|
|
450
|
+
try {
|
|
451
|
+
return JSON.stringify(d).toLowerCase().includes(kw);
|
|
452
|
+
}
|
|
453
|
+
catch {
|
|
454
|
+
return false;
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
return result;
|
|
460
|
+
}
|
|
461
|
+
_renderEntry(entry) {
|
|
462
|
+
const color = LEVEL_COLORS[entry.levelLabel] ?? 'inherit';
|
|
463
|
+
const icon = LEVEL_ICONS[entry.levelLabel] ?? '';
|
|
464
|
+
const hasData = entry.data.some((d) => d !== null && typeof d === 'object') || !!entry.stack;
|
|
465
|
+
const expanded = this._expandedIds.has(entry.id);
|
|
466
|
+
const objectData = entry.data.filter((d) => d !== null && typeof d === 'object');
|
|
467
|
+
const expandTitle = expanded ? 'Collapse' : 'Expand';
|
|
468
|
+
const expandIcon = expanded ? '▴' : '⋯';
|
|
469
|
+
const expandBtn = hasData
|
|
470
|
+
? html `
|
|
471
|
+
<button
|
|
472
|
+
class="log-action-btn"
|
|
473
|
+
type="button"
|
|
474
|
+
title=${expandTitle}
|
|
475
|
+
@click=${(e) => {
|
|
476
|
+
e.stopPropagation();
|
|
477
|
+
this._toggleExpand(entry.id);
|
|
478
|
+
}}
|
|
479
|
+
>
|
|
480
|
+
${expandIcon}
|
|
481
|
+
</button>
|
|
482
|
+
`
|
|
483
|
+
: null;
|
|
484
|
+
const objectDataContent = objectData.length
|
|
485
|
+
? html `
|
|
486
|
+
<pre>
|
|
487
|
+
${objectData.map((d) => safeStringify(d)).join('\n')}</pre
|
|
488
|
+
>
|
|
489
|
+
`
|
|
490
|
+
: null;
|
|
491
|
+
const stackContent = entry.stack
|
|
492
|
+
? html `
|
|
493
|
+
<div class="log-stack">${entry.stack}</div>
|
|
494
|
+
`
|
|
495
|
+
: null;
|
|
496
|
+
const expandedContent = hasData && expanded
|
|
497
|
+
? html `
|
|
498
|
+
<div class="log-data">
|
|
499
|
+
<div class="log-data-content">
|
|
500
|
+
${objectDataContent}
|
|
501
|
+
${stackContent}
|
|
502
|
+
</div>
|
|
503
|
+
<span class="log-actions" style="opacity:1">
|
|
504
|
+
<button
|
|
505
|
+
class="log-action-btn"
|
|
506
|
+
type="button"
|
|
507
|
+
title="Copy data"
|
|
508
|
+
@click=${(e) => {
|
|
509
|
+
e.stopPropagation();
|
|
510
|
+
this._copyData(entry);
|
|
511
|
+
}}
|
|
512
|
+
>
|
|
513
|
+
⧉
|
|
514
|
+
</button>
|
|
515
|
+
</span>
|
|
516
|
+
</div>
|
|
517
|
+
`
|
|
518
|
+
: null;
|
|
519
|
+
return html `
|
|
520
|
+
<div class="log-item">
|
|
521
|
+
<span class="log-icon" style="color:${color}">${icon}</span>
|
|
522
|
+
<span class="log-time">${formatTime(entry.timestamp)}</span>
|
|
523
|
+
<span class="log-level" style="color:${color}">${entry.levelLabel}</span>
|
|
524
|
+
<div class="log-msg">
|
|
525
|
+
<div class="log-msg-row">
|
|
526
|
+
<span class="log-msg-text">${entry.message}</span>
|
|
527
|
+
<span class="log-actions">
|
|
528
|
+
${expandBtn}
|
|
529
|
+
<button
|
|
530
|
+
class="log-action-btn"
|
|
531
|
+
type="button"
|
|
532
|
+
title="Copy message"
|
|
533
|
+
@click=${(e) => {
|
|
534
|
+
e.stopPropagation();
|
|
535
|
+
this._copyMessage(entry);
|
|
536
|
+
}}
|
|
537
|
+
>
|
|
538
|
+
⧉
|
|
539
|
+
</button>
|
|
540
|
+
</span>
|
|
541
|
+
</div>
|
|
542
|
+
${expandedContent}
|
|
543
|
+
</div>
|
|
544
|
+
</div>
|
|
545
|
+
`;
|
|
546
|
+
}
|
|
547
|
+
render() {
|
|
548
|
+
const filtered = this._filteredEntries();
|
|
549
|
+
const countLabel = this._filterLevel !== null || this._searchText
|
|
550
|
+
? `${filtered.length}/${this._entries.length}`
|
|
551
|
+
: `${this._entries.length}`;
|
|
552
|
+
const filterBtns = Object.values(LogLevel)
|
|
553
|
+
.filter((v) => typeof v === 'number')
|
|
554
|
+
.map((level) => {
|
|
555
|
+
const label = LOG_LEVEL_LABEL[level];
|
|
556
|
+
const active = this._filterLevel === level;
|
|
557
|
+
return html `
|
|
558
|
+
<button
|
|
559
|
+
class=${classMap({ 'toolbar-btn': true, active })}
|
|
560
|
+
type="button"
|
|
561
|
+
@click=${() => this._setFilter(level)}
|
|
562
|
+
>
|
|
563
|
+
${label}
|
|
564
|
+
</button>
|
|
565
|
+
`;
|
|
566
|
+
});
|
|
567
|
+
const logList = filtered.length
|
|
568
|
+
? html `
|
|
569
|
+
<div class="log-list">
|
|
570
|
+
${repeat(filtered, (e) => e.id, (e) => this._renderEntry(e))}
|
|
571
|
+
</div>
|
|
572
|
+
`
|
|
573
|
+
: html `
|
|
574
|
+
<div class="empty">No logs</div>
|
|
575
|
+
`;
|
|
576
|
+
const panelClass = classMap({
|
|
577
|
+
panel: true,
|
|
578
|
+
overlay: this.panelPlacement === 'overlay',
|
|
579
|
+
inline: this.panelPlacement === 'inline',
|
|
580
|
+
hidden: this.panelPlacement === 'inline' && !this.open,
|
|
581
|
+
});
|
|
582
|
+
if (this.panelPlacement === 'overlay' && !this.open) {
|
|
583
|
+
return null;
|
|
584
|
+
}
|
|
585
|
+
return html `
|
|
586
|
+
<div class=${panelClass}>
|
|
587
|
+
${this.panelPlacement === 'inline'
|
|
588
|
+
? html `
|
|
589
|
+
<div class="resize-handle" @pointerdown=${this._onDragStart}></div>
|
|
590
|
+
`
|
|
591
|
+
: null}
|
|
592
|
+
<div class="toolbar">
|
|
593
|
+
<span class="toolbar-title">Logs (${countLabel})</span>
|
|
594
|
+
<input
|
|
595
|
+
class="search-input"
|
|
596
|
+
type="text"
|
|
597
|
+
placeholder="Search..."
|
|
598
|
+
.value=${this._searchText}
|
|
599
|
+
@input=${this._handleSearch}
|
|
600
|
+
/>
|
|
601
|
+
${filterBtns}
|
|
602
|
+
<button class="toolbar-btn" type="button" @click=${this._clearLogs}>Clear</button>
|
|
603
|
+
<button class="toolbar-btn" type="button" @click=${this._togglePanel}>✕</button>
|
|
604
|
+
</div>
|
|
605
|
+
${logList}
|
|
606
|
+
</div>
|
|
607
|
+
`;
|
|
608
|
+
}
|
|
609
|
+
};
|
|
610
|
+
__decorate([
|
|
611
|
+
property({ type: Boolean, reflect: true, attribute: 'open' })
|
|
612
|
+
], AitheLogPanel.prototype, "open", void 0);
|
|
613
|
+
__decorate([
|
|
614
|
+
property({ type: String, attribute: 'panel-placement' })
|
|
615
|
+
], AitheLogPanel.prototype, "panelPlacement", void 0);
|
|
616
|
+
__decorate([
|
|
617
|
+
state()
|
|
618
|
+
], AitheLogPanel.prototype, "_entries", void 0);
|
|
619
|
+
__decorate([
|
|
620
|
+
state()
|
|
621
|
+
], AitheLogPanel.prototype, "_filterLevel", void 0);
|
|
622
|
+
__decorate([
|
|
623
|
+
state()
|
|
624
|
+
], AitheLogPanel.prototype, "_searchText", void 0);
|
|
625
|
+
__decorate([
|
|
626
|
+
state()
|
|
627
|
+
], AitheLogPanel.prototype, "_expandedIds", void 0);
|
|
628
|
+
__decorate([
|
|
629
|
+
state()
|
|
630
|
+
], AitheLogPanel.prototype, "_panelHeight", void 0);
|
|
631
|
+
__decorate([
|
|
632
|
+
query('.log-list')
|
|
633
|
+
], AitheLogPanel.prototype, "_scrollContainer", void 0);
|
|
634
|
+
AitheLogPanel = __decorate([
|
|
635
|
+
customElement('aithe-log-panel')
|
|
636
|
+
], AitheLogPanel);
|
|
637
|
+
export { AitheLogPanel };
|