@celestia-island/hikari 0.4.4 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +22 -7
- package/src/DemoApp.tsx +491 -0
- package/src/animation/registerAnimations.test.ts +94 -0
- package/src/animation/registerAnimations.ts +103 -0
- package/src/components/HkAboutModal.scss +95 -0
- package/src/components/HkAboutModal.tsx +114 -0
- package/src/components/HkAdaptiveDialog.scss +22 -0
- package/src/components/HkAdaptiveDialog.test.tsx +271 -0
- package/src/components/HkAdaptiveDialog.tsx +167 -0
- package/src/components/HkAdminHeader.test.tsx +185 -0
- package/src/components/HkAdminHeader.tsx +308 -0
- package/src/components/HkAdminShell.test.tsx +237 -0
- package/src/components/HkAdminShell.tsx +129 -0
- package/src/components/HkAdminTablePage.tsx +70 -0
- package/src/components/HkAdminWidgets.test.ts +89 -0
- package/src/components/HkAlert.tsx +1 -1
- package/src/components/HkAltSignIn.scss +55 -0
- package/src/components/HkAltSignIn.test.tsx +88 -0
- package/src/components/HkAltSignIn.tsx +92 -0
- package/src/components/HkAttachmentModal.scss +49 -0
- package/src/components/HkAttachmentModal.tsx +318 -0
- package/src/components/HkAuthCard.tsx +50 -0
- package/src/components/HkAuthSubmitButton.scss +12 -0
- package/src/components/HkAuthSubmitButton.tsx +94 -0
- package/src/components/HkAvatar.scss +93 -0
- package/src/components/HkAvatar.tsx +2 -2
- package/src/components/HkBlockingToast.scss +123 -0
- package/src/components/HkBlockingToast.test.tsx +221 -0
- package/src/components/HkBlockingToast.tsx +182 -0
- package/src/components/HkBreadcrumb.scss +624 -0
- package/src/components/HkBreadcrumb.tsx +2 -2
- package/src/components/HkButton.scss +16 -2
- package/src/components/HkCaptchaModal.scss +14 -0
- package/src/components/HkCaptchaModal.tsx +62 -0
- package/src/components/HkCaptchaWidget.scss +30 -0
- package/src/components/HkCaptchaWidget.tsx +181 -0
- package/src/components/HkCard.scss +1 -1
- package/src/components/HkChatTypes.ts +65 -0
- package/src/components/HkCheckbox.scss +4 -9
- package/src/components/HkCheckbox.tsx +18 -6
- package/src/components/HkColorPicker.scss +120 -3
- package/src/components/HkColorPicker.tsx +130 -19
- package/src/components/HkColorPickerTouch.test.tsx +145 -0
- package/src/components/HkColorSchemeDialog.scss +52 -0
- package/src/components/HkColorSchemeDialog.test.ts +201 -0
- package/src/components/HkColorSchemeDialog.tsx +96 -0
- package/src/components/HkColorSchemeEditor.test.ts +270 -0
- package/src/components/HkColorSchemeEditor.tsx +410 -0
- package/src/components/HkConfirmDialog.scss +43 -3
- package/src/components/HkConfirmDialog.tsx +7 -4
- package/src/components/HkConnectionInfo.ts +80 -0
- package/src/components/HkConnectionStatus.tsx +158 -0
- package/src/components/HkCookieConsent.scss +22 -0
- package/src/components/HkCookieConsent.test.tsx +70 -0
- package/src/components/HkCookieConsent.tsx +56 -0
- package/src/components/HkCountdownDigit.tsx +105 -0
- package/src/components/HkDatePicker.scss +361 -0
- package/src/components/HkDatePicker.test.ts +459 -0
- package/src/components/HkDatePicker.tsx +568 -0
- package/src/components/HkDateTimePicker.scss +65 -37
- package/src/components/HkDateTimePicker.test.ts +344 -0
- package/src/components/HkDateTimePicker.tsx +249 -82
- package/src/components/HkDraggableGrid.scss +4 -1
- package/src/components/HkDraggableList.scss +4 -1
- package/src/components/HkDrawer.scss +27 -13
- package/src/components/HkDrawer.test.tsx +73 -0
- package/src/components/HkDrawer.tsx +157 -10
- package/src/components/HkErrorBoundary.scss +5 -2
- package/src/components/HkErrorBoundary.tsx +7 -4
- package/src/components/HkExpansionPanel.scss +143 -0
- package/src/components/HkExpansionPanel.test.tsx +109 -0
- package/src/components/HkExpansionPanel.tsx +101 -0
- package/src/components/HkFab.scss +162 -0
- package/src/components/HkFab.test.tsx +217 -0
- package/src/components/HkFab.tsx +214 -0
- package/src/components/HkHoverRevealAction.scss +6 -0
- package/src/components/HkHoverRevealAction.test.ts +68 -0
- package/src/components/HkHoverRevealAction.tsx +84 -6
- package/src/components/HkIcon.scss +123 -0
- package/src/components/HkIcon.tsx +7 -23
- package/src/components/HkIconButton.scss +170 -0
- package/src/components/HkIconButton.test.tsx +75 -0
- package/src/components/HkIconButton.tsx +4 -3
- package/src/components/HkIconButtonVars.scss +180 -0
- package/src/components/HkInput.affix.test.ts +253 -0
- package/src/components/HkInput.enter.test.ts +88 -0
- package/src/components/HkInput.scss +127 -8
- package/src/components/HkInput.tsx +245 -13
- package/src/components/HkKeywordSearchModal.scss +13 -0
- package/src/components/HkKeywordSearchModal.tsx +46 -9
- package/src/components/HkLabel.scss +34 -0
- package/src/components/HkLabel.test.tsx +61 -0
- package/src/components/HkLabel.tsx +45 -0
- package/src/components/HkListTransition.scss +26 -0
- package/src/components/HkListTransition.tsx +57 -0
- package/src/components/HkLocalePicker.scss +37 -0
- package/src/components/HkLocalePicker.tsx +133 -0
- package/src/components/HkLocalePickerPopup.tsx +35 -19
- package/src/components/HkLocalizedInput.scss +277 -0
- package/src/components/HkLocalizedInput.test.tsx +693 -0
- package/src/components/HkLocalizedInput.tsx +495 -0
- package/src/components/HkLogWindow.scss +121 -0
- package/src/components/HkLogWindow.tsx +195 -0
- package/src/components/HkLogo.scss +1 -1
- package/src/components/HkLogo.tsx +1 -1
- package/src/components/HkMarkdownRenderer.scss +22 -2
- package/src/components/HkMarkdownRenderer.tsx +33 -3
- package/src/components/HkMediaControlBar.tsx +20 -13
- package/src/components/HkMenu.scss +200 -0
- package/src/components/HkMenu.test.ts +779 -0
- package/src/components/HkMenu.tsx +770 -0
- package/src/components/HkMenuActionItem.scss +58 -0
- package/src/components/HkMenuActionItem.tsx +41 -0
- package/src/components/HkMenuIdentityItem.scss +70 -0
- package/src/components/HkMenuIdentityItem.tsx +42 -0
- package/src/components/HkMenuPanel.scss +20 -0
- package/src/components/HkMenuPanel.test.tsx +118 -0
- package/src/components/HkMenuPanel.tsx +32 -0
- package/src/components/HkMinimap.tsx +16 -8
- package/src/components/HkModal.autofollow.test.ts +44 -0
- package/src/components/HkModal.scss +170 -53
- package/src/components/HkModal.sheetgap.test.ts +82 -0
- package/src/components/HkModal.test.tsx +334 -0
- package/src/components/HkModal.tsx +314 -68
- package/src/components/HkModalBreadcrumb.scss +4 -1
- package/src/components/HkModalBreadcrumb.test.tsx +111 -0
- package/src/components/HkModalBreadcrumb.tsx +34 -11
- package/src/components/HkModelCatalog.ts +98 -0
- package/src/components/HkModelTag.scss +130 -0
- package/src/components/HkModelTag.test.tsx +111 -0
- package/src/components/HkModelTag.tsx +190 -0
- package/src/components/HkNavItem.scss +13 -2
- package/src/components/HkNavItem.tsx +2 -1
- package/src/components/HkNavSidebar.tsx +99 -0
- package/src/components/HkNumberInput.scss +12 -0
- package/src/components/HkNumberInput.tsx +15 -8
- package/src/components/HkPageHeader.scss +79 -0
- package/src/components/HkPageHeader.test.ts +67 -0
- package/src/components/HkPageHeader.tsx +51 -0
- package/src/components/HkPasswordInput.scss +29 -17
- package/src/components/HkPasswordInput.test.ts +281 -0
- package/src/components/HkPasswordInput.tsx +337 -59
- package/src/components/HkPickerPane.scss +158 -0
- package/src/components/HkPlaceholderMarquee.scss +109 -0
- package/src/components/HkPlaceholderMarquee.test.ts +305 -0
- package/src/components/HkPlaceholderMarquee.tsx +170 -0
- package/src/components/HkPopover.scss +134 -10
- package/src/components/HkPopover.sheetdock.test.ts +34 -0
- package/src/components/HkPopover.surfacevars.test.ts +20 -0
- package/src/components/HkPopover.titleSuppress.test.tsx +265 -0
- package/src/components/HkPopover.tsx +225 -50
- package/src/components/HkPopoverSheet.test.tsx +130 -0
- package/src/components/HkPopupSelect.scss +30 -10
- package/src/components/HkPopupSelect.tsx +21 -1
- package/src/components/HkProgressDialog.scss +31 -0
- package/src/components/HkProgressDialog.tsx +37 -19
- package/src/components/HkProtocolModal.scss +26 -0
- package/src/components/HkProtocolModal.tsx +112 -0
- package/src/components/HkRadio.scss +1 -16
- package/src/components/HkRadio.tsx +5 -2
- package/src/components/HkRichInput.scss +162 -0
- package/src/components/HkRichInput.tsx +335 -0
- package/src/components/HkRollingNumber.test.ts +90 -0
- package/src/components/HkRollingNumber.tsx +39 -1
- package/src/components/HkScrollContainer.scss +71 -54
- package/src/components/HkScrollContainer.test.ts +160 -0
- package/src/components/HkScrollContainer.tsx +187 -160
- package/src/components/HkSearchInput.tsx +3 -3
- package/src/components/HkSecretRevealModal.scss +61 -0
- package/src/components/HkSecretRevealModal.tsx +91 -0
- package/src/components/HkSelect.scss +263 -12
- package/src/components/HkSelect.sheetdock.test.ts +30 -0
- package/src/components/HkSelect.test.tsx +88 -0
- package/src/components/HkSelect.tsx +59 -74
- package/src/components/HkSelectPanel.test.tsx +666 -0
- package/src/components/HkSelectPanel.tsx +595 -0
- package/src/components/HkSelectSheet.test.tsx +132 -0
- package/src/components/HkSelectionGrid.scss +1 -1
- package/src/components/HkSelectionGrid.tsx +2 -1
- package/src/components/HkSelectionWaterfall.scss +1 -1
- package/src/components/HkShareBar.scss +40 -0
- package/src/components/HkShareBar.tsx +50 -0
- package/src/components/HkSidebar.scss +15 -10
- package/src/components/HkSidebar.tsx +26 -2
- package/src/components/HkSignInCard.test.ts +154 -0
- package/src/components/HkSignInCard.tsx +155 -0
- package/src/components/HkSlider.scss +99 -0
- package/src/components/HkSlider.test.tsx +155 -0
- package/src/components/HkSlider.tsx +173 -0
- package/src/components/HkSpinner.scss +36 -1
- package/src/components/HkSpinner.test.tsx +63 -0
- package/src/components/HkSpinner.tsx +16 -1
- package/src/components/HkSplash.scss +1 -1
- package/src/components/HkSplash.tsx +3 -1
- package/src/components/HkStatCard.scss +73 -0
- package/src/components/HkStatCard.tsx +46 -0
- package/src/components/HkStatusBar.test.tsx +178 -0
- package/src/components/HkStatusBar.tsx +379 -0
- package/src/components/HkStatusPill.scss +73 -0
- package/src/components/HkStatusPill.tsx +41 -0
- package/src/components/HkStepFlow.scss +75 -0
- package/src/components/HkStepFlow.test.tsx +246 -0
- package/src/components/HkStepFlow.tsx +115 -0
- package/src/components/HkSwitch.scss +5 -17
- package/src/components/HkSwitch.tsx +6 -3
- package/src/components/HkTable.scss +20 -1
- package/src/components/HkTable.tsx +28 -3
- package/src/components/HkTabs.scss +222 -48
- package/src/components/HkTabs.test.ts +517 -0
- package/src/components/HkTabs.tsx +567 -56
- package/src/components/HkTag.tsx +2 -1
- package/src/components/HkTextarea.tsx +5 -0
- package/src/components/HkThemeToggle.scss +232 -0
- package/src/components/HkThemeToggle.test.ts +231 -0
- package/src/components/HkThemeToggle.tsx +289 -0
- package/src/components/HkTimeline.scss +134 -1
- package/src/components/HkTimeline.test.tsx +319 -0
- package/src/components/HkTimeline.tsx +303 -54
- package/src/components/HkToast.scss +34 -5
- package/src/components/HkToast.test.tsx +109 -0
- package/src/components/HkToast.tsx +57 -8
- package/src/components/HkTokenUsageBadge.scss +53 -0
- package/src/components/HkTokenUsageBadge.test.tsx +59 -0
- package/src/components/HkTokenUsageBadge.tsx +54 -0
- package/src/components/HkTokenUsagePanel.scss +95 -0
- package/src/components/HkTokenUsagePanel.tsx +140 -0
- package/src/components/HkToolBlock.scss +428 -0
- package/src/components/HkToolBlock.tsx +639 -0
- package/src/components/HkTooltip.scss +14 -2
- package/src/components/HkTooltip.tsx +25 -2
- package/src/components/HkTrendChart.tsx +27 -16
- package/src/components/HkVoiceInputPopup.scss +77 -0
- package/src/components/HkVoiceInputPopup.tsx +97 -0
- package/src/components/HkZoomToolbar.scss +4 -1
- package/src/components/HkZoomToolbar.tsx +7 -4
- package/src/components/_hikari-vars.scss +6 -0
- package/src/composables/highlightLanguages.ts +109 -0
- package/src/composables/iconRegistry.ts +127 -0
- package/src/composables/messaging/browserTransport.ts +96 -0
- package/src/composables/messaging/index.ts +204 -0
- package/src/composables/messaging/messaging.test.ts +256 -0
- package/src/composables/messaging/toastTransport.ts +26 -0
- package/src/composables/messaging/types.ts +115 -0
- package/src/composables/useActionBar.ts +66 -0
- package/src/composables/useAttachments.ts +154 -0
- package/src/composables/useConnectionProbe.ts +142 -0
- package/src/composables/useDeferredTransition.ts +16 -0
- package/src/composables/useEngineHealth.ts +69 -0
- package/src/composables/useHighlight.ts +124 -0
- package/src/composables/useMeasuredHighlight.ts +150 -0
- package/src/composables/useOverlayScrollbar.test.ts +221 -0
- package/src/composables/useOverlayScrollbar.ts +296 -0
- package/src/composables/usePageTitle.ts +37 -0
- package/src/composables/useReducedMotion.ts +34 -0
- package/src/composables/useResourceListModal.tsx +147 -0
- package/src/composables/useSafeArea.ts +137 -0
- package/src/composables/useSendShortcut.ts +35 -0
- package/src/composables/useSizeMorph.test.ts +156 -0
- package/src/composables/useSizeMorph.ts +149 -0
- package/src/composables/useSurfaceTransition.test.ts +96 -0
- package/src/composables/useSurfaceTransition.ts +71 -0
- package/src/composables/useZoomPan.ts +192 -0
- package/src/demo.scss +9 -1
- package/src/demo.ts +5 -1
- package/src/i18n/locales/ar/chat.json +38 -0
- package/src/i18n/locales/ar/components.json +141 -40
- package/src/i18n/locales/ar/components.toml +59 -0
- package/src/i18n/locales/ar/platform.json +65 -0
- package/src/i18n/locales/de/chat.json +38 -0
- package/src/i18n/locales/de/components.json +139 -38
- package/src/i18n/locales/de/components.toml +59 -0
- package/src/i18n/locales/de/platform.json +65 -0
- package/src/i18n/locales/en/chat.json +38 -0
- package/src/i18n/locales/en/components.json +104 -3
- package/src/i18n/locales/en/components.toml +59 -0
- package/src/i18n/locales/en/platform.json +65 -0
- package/src/i18n/locales/es/chat.json +38 -0
- package/src/i18n/locales/es/components.json +141 -40
- package/src/i18n/locales/es/components.toml +59 -0
- package/src/i18n/locales/es/platform.json +65 -0
- package/src/i18n/locales/fr/chat.json +38 -0
- package/src/i18n/locales/fr/components.json +137 -36
- package/src/i18n/locales/fr/components.toml +59 -0
- package/src/i18n/locales/fr/platform.json +65 -0
- package/src/i18n/locales/ja/chat.json +38 -0
- package/src/i18n/locales/ja/components.json +104 -3
- package/src/i18n/locales/ja/components.toml +59 -0
- package/src/i18n/locales/ja/platform.json +65 -0
- package/src/i18n/locales/ko/chat.json +38 -0
- package/src/i18n/locales/ko/components.json +104 -3
- package/src/i18n/locales/ko/components.toml +59 -0
- package/src/i18n/locales/ko/platform.json +65 -0
- package/src/i18n/locales/pt/chat.json +38 -0
- package/src/i18n/locales/pt/components.json +141 -40
- package/src/i18n/locales/pt/components.toml +59 -0
- package/src/i18n/locales/pt/platform.json +65 -0
- package/src/i18n/locales/ru/chat.json +38 -0
- package/src/i18n/locales/ru/components.json +141 -40
- package/src/i18n/locales/ru/components.toml +59 -0
- package/src/i18n/locales/ru/platform.json +65 -0
- package/src/i18n/locales/zh-Hans/chat.json +38 -0
- package/src/i18n/locales/zh-Hans/components.json +109 -4
- package/src/i18n/locales/zh-Hans/components.toml +59 -0
- package/src/i18n/locales/zh-Hans/platform.json +65 -0
- package/src/i18n/locales/zh-Hant/chat.json +38 -0
- package/src/i18n/locales/zh-Hant/components.json +109 -4
- package/src/i18n/locales/zh-Hant/components.toml +59 -0
- package/src/i18n/locales/zh-Hant/platform.json +65 -0
- package/src/index.ts +225 -6
- package/src/plugins/bootScriptsPlugin.ts +47 -0
- package/src/plugins/buildHashPlugin.ts +67 -0
- package/src/plugins/index.ts +2 -0
- package/src/render.ts +1 -1
- package/src/runtime/animationBus.test.ts +112 -0
- package/src/runtime/animationBus.ts +33 -2
- package/src/runtime/backStack.test.ts +334 -0
- package/src/runtime/backStack.ts +377 -0
- package/src/runtime/env.ts +4 -0
- package/src/runtime/index.ts +15 -3
- package/src/runtime/intervalBus.test.ts +118 -0
- package/src/runtime/intervalBus.ts +189 -0
- package/src/runtime/mobileViewport.test.ts +132 -0
- package/src/runtime/mobileViewport.ts +157 -0
- package/src/runtime/pageLifecycle.ts +91 -0
- package/src/runtime/useBlockingToast.ts +112 -0
- package/src/runtime/useClipboard.ts +28 -0
- package/src/runtime/useConfirm.ts +15 -7
- package/src/runtime/useMediaQuery.test.ts +67 -0
- package/src/runtime/useMediaQuery.ts +89 -0
- package/src/runtime/useOverlay.test.ts +160 -0
- package/src/runtime/useOverlay.ts +59 -12
- package/src/runtime/usePopupManager.test.ts +200 -0
- package/src/runtime/usePopupManager.ts +106 -10
- package/src/runtime/useToast.test.ts +90 -0
- package/src/runtime/useToast.ts +20 -2
- package/src/styles/admin-tokens.scss +744 -0
- package/src/styles/index.scss +5 -3
- package/src/styles/theme/_glass.scss +33 -0
- package/src/styles/theme/_layout.scss +123 -0
- package/src/styles/theme/_scrollbar.scss +73 -0
- package/src/styles/theme/_tokens.scss +69 -0
- package/src/styles/theme/base.scss +617 -0
- package/src/styles/theme/foundation.scss +219 -0
- package/src/styles/theme/mixins.scss +793 -0
- package/src/styles/theme/themes.scss +25 -0
- package/src/styles/theme/variables.scss +125 -0
- package/src/theme/_field.scss +116 -0
- package/src/theme/fontContext.test.ts +179 -0
- package/src/theme/fontContext.ts +169 -0
- package/src/theme/index.ts +19 -2
- package/src/theme/presets.ts +86 -18
- package/src/theme/theme.scss +61 -1
- package/src/theme/tokenGroups.test.ts +534 -0
- package/src/theme/tokenGroups.ts +552 -0
- package/src/theme/useSolarTime.test.ts +113 -0
- package/src/theme/useSolarTime.ts +95 -20
- package/src/theme/useTheme.test.ts +72 -0
- package/src/theme/useTheme.ts +144 -9
- package/src/tokens.scss +110 -0
- package/src/utils/base64.ts +31 -0
- package/src/utils/connectivity.ts +51 -0
- package/src/utils/dom.test.ts +131 -0
- package/src/utils/dom.ts +133 -0
- package/src/utils/download.ts +22 -0
- package/src/utils/fileType.ts +127 -0
- package/src/utils/format.ts +98 -0
- package/src/utils/fuzzy.ts +77 -0
- package/src/utils/fuzzySearch.test.ts +87 -0
- package/src/utils/healthProbe.ts +64 -0
- package/src/utils/objectPath.ts +59 -0
- package/src/utils/password.ts +53 -0
- package/src/utils/pow.test.ts +45 -0
- package/src/utils/pow.ts +226 -0
- package/src/utils/powNonce.ts +95 -0
- package/src/utils/validation.test.ts +78 -0
- package/src/DemoApp.vue +0 -400
- package/src/components/HkCollapse.tsx +0 -48
- package/src/components/HkMorphingTabs.scss +0 -141
- package/src/components/HkMorphingTabs.tsx +0 -113
- package/src/composables/useBreakpoint.ts +0 -41
- package/src/composables/useClipboard.ts +0 -37
- package/src/composables/useConfirm.ts +0 -35
- package/src/composables/useToast.ts +0 -2
- package/src/runtime/useAsyncData.ts +0 -30
|
@@ -1,19 +1,42 @@
|
|
|
1
|
-
import { defineComponent, nextTick, ref, watch } from "vue";
|
|
1
|
+
import { defineComponent, nextTick, onBeforeUnmount, ref, watch } from "vue";
|
|
2
2
|
|
|
3
3
|
import { useProgressDialog } from "../composables/useProgressDialog";
|
|
4
|
+
import { attachOverlayScrollbars, type OverlayScrollbarHandle } from "../composables/useOverlayScrollbar";
|
|
4
5
|
import HModal from "./HkModal";
|
|
5
6
|
import HProgressBar from "./HkProgressBar";
|
|
6
7
|
import HSpinner from "./HkSpinner";
|
|
8
|
+
import "./HkProgressDialog.scss";
|
|
7
9
|
|
|
8
10
|
export default defineComponent({
|
|
9
11
|
name: "HkProgressDialog",
|
|
10
12
|
setup() {
|
|
11
13
|
const state = useProgressDialog();
|
|
12
14
|
const logRef = ref<HTMLElement>();
|
|
15
|
+
// Positioned wrapper around the conditional log pane — the rail host
|
|
16
|
+
// (the modal body also holds the spinner/progress bands).
|
|
17
|
+
const logWrapRef = ref<HTMLElement>();
|
|
18
|
+
// Overlay scrollbar (shared chrome) on the conditional log pane —
|
|
19
|
+
// attached when it mounts, detached when it unmounts.
|
|
20
|
+
let logScrollbar: OverlayScrollbarHandle | null = null;
|
|
21
|
+
|
|
22
|
+
function syncLogScrollbar() {
|
|
23
|
+
void nextTick(() => {
|
|
24
|
+
if (logRef.value) {
|
|
25
|
+
logScrollbar ??= attachOverlayScrollbars(logRef.value, {
|
|
26
|
+
axis: "vertical",
|
|
27
|
+
host: logWrapRef.value,
|
|
28
|
+
});
|
|
29
|
+
} else {
|
|
30
|
+
logScrollbar?.detach();
|
|
31
|
+
logScrollbar = null;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
13
35
|
|
|
14
36
|
watch(
|
|
15
37
|
() => state.logs.length,
|
|
16
38
|
() => {
|
|
39
|
+
syncLogScrollbar();
|
|
17
40
|
nextTick(() => {
|
|
18
41
|
const el = logRef.value;
|
|
19
42
|
if (el) el.scrollTop = el.scrollHeight;
|
|
@@ -21,6 +44,11 @@ export default defineComponent({
|
|
|
21
44
|
},
|
|
22
45
|
);
|
|
23
46
|
|
|
47
|
+
onBeforeUnmount(() => {
|
|
48
|
+
logScrollbar?.detach();
|
|
49
|
+
logScrollbar = null;
|
|
50
|
+
});
|
|
51
|
+
|
|
24
52
|
return () => (
|
|
25
53
|
<HModal
|
|
26
54
|
modelValue={state.open}
|
|
@@ -40,24 +68,14 @@ export default defineComponent({
|
|
|
40
68
|
</div>
|
|
41
69
|
)}
|
|
42
70
|
{state.logs.length > 0 ? (
|
|
43
|
-
<div
|
|
44
|
-
ref={logRef}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
fontFamily: "monospace",
|
|
52
|
-
fontSize: "0.75rem",
|
|
53
|
-
lineHeight: "1.5",
|
|
54
|
-
}}
|
|
55
|
-
>
|
|
56
|
-
<ul style={{ listStyle: "none", margin: 0, padding: 0 }}>
|
|
57
|
-
{state.logs.map((line, i) => (
|
|
58
|
-
<li key={i}>{line}</li>
|
|
59
|
-
))}
|
|
60
|
-
</ul>
|
|
71
|
+
<div ref={logWrapRef} class="s-progress-dialog-log-wrap">
|
|
72
|
+
<div ref={logRef} class="s-progress-dialog-log">
|
|
73
|
+
<ul style={{ listStyle: "none", margin: 0, padding: 0 }}>
|
|
74
|
+
{state.logs.map((line, i) => (
|
|
75
|
+
<li key={i}>{line}</li>
|
|
76
|
+
))}
|
|
77
|
+
</ul>
|
|
78
|
+
</div>
|
|
61
79
|
</div>
|
|
62
80
|
) : null}
|
|
63
81
|
</div>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.s-protocol-modal {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.s-protocol-modal-copied {
|
|
6
|
+
position: absolute;
|
|
7
|
+
top: -0.25rem;
|
|
8
|
+
right: 0;
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: var(--space-4, 0.25rem) var(--space-8, 0.5rem);
|
|
11
|
+
border-radius: var(--radius-sm, 6px);
|
|
12
|
+
background: rgb(var(--color-success) / 15%);
|
|
13
|
+
color: rgb(var(--color-success));
|
|
14
|
+
font-size: var(--text-xs, 0.75rem);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* With `bodyHeight` set the body becomes its own scroll region (nested
|
|
18
|
+
* inside HkModal's body scroller) — overlay chrome only. */
|
|
19
|
+
.s-protocol-modal {
|
|
20
|
+
overflow-y: auto;
|
|
21
|
+
scrollbar-width: none;
|
|
22
|
+
|
|
23
|
+
&::-webkit-scrollbar {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { computed, defineComponent, onBeforeUnmount, ref, watch } from "vue";
|
|
2
|
+
import { HMarkdownRenderer, HModal, useClipboard, type ModalAction } from "@celestia-island/hikari";
|
|
3
|
+
|
|
4
|
+
import { useI18n } from "../i18n/context";
|
|
5
|
+
import { attachOverlayScrollbars, type OverlayScrollbarHandle } from "../composables/useOverlayScrollbar";
|
|
6
|
+
|
|
7
|
+
import "./HkProtocolModal.scss";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* HkProtocolModal — markdown EULA / privacy / terms modal.
|
|
11
|
+
* (Upstreamed from shittim-chest's plana-legacy layer.)
|
|
12
|
+
*
|
|
13
|
+
* Renders arbitrary markdown `content` (via HMarkdownRenderer) with
|
|
14
|
+
* a Decline/Accept footer. `accept`/`decline` are the caller's commit
|
|
15
|
+
* actions; closing (overlay click / ESC / X) only emits `update:modelValue`
|
|
16
|
+
* so the caller can decide whether close === decline.
|
|
17
|
+
*/
|
|
18
|
+
export const HkProtocolModal = defineComponent({
|
|
19
|
+
name: "HkProtocolModal",
|
|
20
|
+
props: {
|
|
21
|
+
modelValue: { type: Boolean, default: false },
|
|
22
|
+
/** Modal title (defaults to "Agreement"). */
|
|
23
|
+
title: { type: String, default: undefined },
|
|
24
|
+
/** Markdown content to render — protocols always render as markdown. */
|
|
25
|
+
content: { type: String, default: "" },
|
|
26
|
+
/** Accept button label override. */
|
|
27
|
+
acceptLabel: { type: String, default: undefined },
|
|
28
|
+
/** Decline button label override. */
|
|
29
|
+
declineLabel: { type: String, default: undefined },
|
|
30
|
+
/** Allow dismissing without a decision (overlay/ESC/X). Default true. */
|
|
31
|
+
closable: { type: Boolean, default: true },
|
|
32
|
+
width: { type: String, default: "48rem" },
|
|
33
|
+
/** Cap the scroll body height (e.g. "60vh"). */
|
|
34
|
+
bodyHeight: { type: String, default: undefined },
|
|
35
|
+
},
|
|
36
|
+
emits: {
|
|
37
|
+
"update:modelValue": (_v: boolean) => true,
|
|
38
|
+
accept: () => true,
|
|
39
|
+
decline: () => true,
|
|
40
|
+
},
|
|
41
|
+
setup(props, { emit }) {
|
|
42
|
+
const { t } = useI18n();
|
|
43
|
+
const clipboard = useClipboard();
|
|
44
|
+
const copied = computed(() => clipboard.copied.value);
|
|
45
|
+
|
|
46
|
+
const footerActions = computed<ModalAction[]>(() => [
|
|
47
|
+
{
|
|
48
|
+
label: t("hikari::protocol.copy", "Copy"),
|
|
49
|
+
variant: "secondary" as const,
|
|
50
|
+
onClick: () => void clipboard.copy(props.content),
|
|
51
|
+
disabled: !props.content,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: props.declineLabel ?? t("hikari::protocol.decline", "Decline"),
|
|
55
|
+
variant: "secondary" as const,
|
|
56
|
+
onClick: () => emit("decline"),
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: props.acceptLabel ?? t("hikari::protocol.accept", "Accept"),
|
|
60
|
+
variant: "primary" as const,
|
|
61
|
+
onClick: () => emit("accept"),
|
|
62
|
+
disabled: !props.content,
|
|
63
|
+
},
|
|
64
|
+
]);
|
|
65
|
+
|
|
66
|
+
// ── overlay scrollbar (shared chrome) ─────────────────────────
|
|
67
|
+
// With `bodyHeight` set the body becomes a height-capped scroll
|
|
68
|
+
// region NESTED inside HkModal's overlay-equipped body scroller —
|
|
69
|
+
// without the overlay it would be a surviving native bar (the exact
|
|
70
|
+
// double-scroll this library eliminates). Attach on mount, re-sync
|
|
71
|
+
// when the cap flips, detach on unmount.
|
|
72
|
+
const bodyRef = ref<HTMLElement | null>(null);
|
|
73
|
+
let bodyScrollbar: OverlayScrollbarHandle | null = null;
|
|
74
|
+
function syncBodyScrollbar(): void {
|
|
75
|
+
if (props.bodyHeight && bodyRef.value) {
|
|
76
|
+
if (!bodyScrollbar) bodyScrollbar = attachOverlayScrollbars(bodyRef.value);
|
|
77
|
+
} else {
|
|
78
|
+
bodyScrollbar?.detach();
|
|
79
|
+
bodyScrollbar = null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function bindBodyRef(el: unknown): void {
|
|
83
|
+
bodyRef.value = (el as HTMLElement) ?? null;
|
|
84
|
+
syncBodyScrollbar();
|
|
85
|
+
}
|
|
86
|
+
watch(() => props.bodyHeight, () => syncBodyScrollbar());
|
|
87
|
+
onBeforeUnmount(() => {
|
|
88
|
+
bodyScrollbar?.detach();
|
|
89
|
+
bodyScrollbar = null;
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
return () => (
|
|
93
|
+
<HModal
|
|
94
|
+
modelValue={props.modelValue}
|
|
95
|
+
onUpdate:modelValue={(v: boolean) => emit("update:modelValue", v)}
|
|
96
|
+
title={props.title ?? t("hikari::protocol.title", "Agreement")}
|
|
97
|
+
width={props.width}
|
|
98
|
+
closable={props.closable}
|
|
99
|
+
footerActions={footerActions.value}
|
|
100
|
+
>
|
|
101
|
+
<div
|
|
102
|
+
ref={bindBodyRef}
|
|
103
|
+
class="s-protocol-modal"
|
|
104
|
+
style={props.bodyHeight ? { maxHeight: props.bodyHeight } : undefined}
|
|
105
|
+
>
|
|
106
|
+
{copied.value && <p class="s-protocol-modal-copied">{t("hikari::protocol.copied", "Copied")}</p>}
|
|
107
|
+
<HMarkdownRenderer content={props.content} />
|
|
108
|
+
</div>
|
|
109
|
+
</HModal>
|
|
110
|
+
);
|
|
111
|
+
},
|
|
112
|
+
});
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
width: 6px;
|
|
90
90
|
height: 6px;
|
|
91
91
|
border-radius: 50%;
|
|
92
|
-
background: var(--
|
|
92
|
+
background: rgb(var(--color-on-solid-icon, 255 255 255));
|
|
93
93
|
z-index: 1;
|
|
94
94
|
|
|
95
95
|
[data-size="lg"] & {
|
|
@@ -102,18 +102,3 @@
|
|
|
102
102
|
height: 5px;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
|
|
106
|
-
/* --- Label --- */
|
|
107
|
-
|
|
108
|
-
.hk-radio-label-text {
|
|
109
|
-
font-size: 0.875rem;
|
|
110
|
-
color: var(--hi-color-text-primary);
|
|
111
|
-
|
|
112
|
-
[data-size="sm"] & {
|
|
113
|
-
font-size: 0.75rem;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
[data-size="lg"] & {
|
|
117
|
-
font-size: 1rem;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { computed, defineComponent, type PropType } from "vue";
|
|
2
|
+
import HkLabel from "./HkLabel";
|
|
2
3
|
import "./HkRadio.scss";
|
|
3
4
|
|
|
4
5
|
export interface HkRadioOption {
|
|
@@ -31,7 +32,7 @@ export default defineComponent({
|
|
|
31
32
|
emits: {
|
|
32
33
|
"update:modelValue": (_value: string | number) => true,
|
|
33
34
|
},
|
|
34
|
-
setup(props, { emit }) {
|
|
35
|
+
setup(props, { emit, slots }) {
|
|
35
36
|
return () => (
|
|
36
37
|
<div
|
|
37
38
|
class={[
|
|
@@ -65,7 +66,9 @@ export default defineComponent({
|
|
|
65
66
|
/>
|
|
66
67
|
{isSelected && <span class="hk-radio-dot" />}
|
|
67
68
|
</span>
|
|
68
|
-
<
|
|
69
|
+
<HkLabel size={props.size}>
|
|
70
|
+
{slots.label?.({ option: opt }) ?? opt.label}
|
|
71
|
+
</HkLabel>
|
|
69
72
|
</label>
|
|
70
73
|
);
|
|
71
74
|
})}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// Use theme variables with namespace to avoid conflicts
|
|
2
|
+
@use "./hikari-vars" as vars;
|
|
3
|
+
|
|
4
|
+
.s-rich-input {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: var(--space-8, 0.5rem);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* ── Attachment strip ───────────────────────────────────────────── */
|
|
11
|
+
.s-rich-input-attachments-wrap {
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.s-rich-input-attachments {
|
|
16
|
+
display: flex;
|
|
17
|
+
gap: var(--space-8, 0.5rem);
|
|
18
|
+
padding: var(--space-2, 0.125rem);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.s-rich-input-attachment {
|
|
22
|
+
position: relative;
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
border: 1px solid var(--border-faint, rgb(var(--color-border) / 10%));
|
|
26
|
+
border-radius: var(--radius-md, 8px);
|
|
27
|
+
background: rgb(var(--color-surface) / 0.5);
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
|
|
31
|
+
&[data-variant="media"] {
|
|
32
|
+
width: 72px;
|
|
33
|
+
height: 48px;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.s-rich-input-attachment-thumb {
|
|
38
|
+
position: relative;
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
|
|
42
|
+
video, img {
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
object-fit: cover;
|
|
46
|
+
display: block;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.s-rich-input-attachment-play {
|
|
51
|
+
position: absolute;
|
|
52
|
+
inset: 0;
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
color: #fff;
|
|
57
|
+
background: rgb(0 0 0 / 25%);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.s-rich-input-attachment-progress {
|
|
61
|
+
position: absolute;
|
|
62
|
+
inset: 0;
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
background: rgb(0 0 0 / 30%);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.s-rich-input-attachment-chip {
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
gap: var(--space-6, 0.375rem);
|
|
73
|
+
padding: var(--space-4, 0.25rem) var(--space-8, 0.5rem);
|
|
74
|
+
font-size: var(--text-2xs, 0.625rem);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.s-rich-input-attachment-chip-name {
|
|
78
|
+
max-width: 140px;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
text-overflow: ellipsis;
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
color: rgb(var(--color-text));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.s-rich-input-attachment-chip-size {
|
|
86
|
+
color: rgb(var(--color-muted));
|
|
87
|
+
font-family: var(--font-mono, vars.$hikari-font-family-mono);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.s-rich-input-attachment-remove {
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: 2px;
|
|
93
|
+
right: 2px;
|
|
94
|
+
opacity: 0;
|
|
95
|
+
transition: opacity var(--duration-short, 0.15s) ease;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.s-rich-input-attachment:hover .s-rich-input-attachment-remove {
|
|
99
|
+
opacity: 1;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* ── Drag overlay ───────────────────────────────────────────────── */
|
|
103
|
+
.s-rich-input-drag-overlay {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
gap: var(--space-8, 0.5rem);
|
|
108
|
+
padding: var(--space-16, 1rem);
|
|
109
|
+
border: 1px dashed rgb(var(--color-primary) / 45%);
|
|
110
|
+
border-radius: var(--radius-md, 8px);
|
|
111
|
+
background: var(--c-primary-subtle, rgb(var(--color-primary) / 8%));
|
|
112
|
+
color: rgb(var(--color-primary));
|
|
113
|
+
font-size: var(--text-xs, 0.75rem);
|
|
114
|
+
pointer-events: none;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* ── Body ───────────────────────────────────────────────────────── */
|
|
118
|
+
.s-rich-input-body {
|
|
119
|
+
border: 1px solid var(--border-faint, rgb(var(--color-border) / 10%));
|
|
120
|
+
border-radius: var(--radius-md, 8px);
|
|
121
|
+
background: rgb(var(--color-surface) / 0.5);
|
|
122
|
+
transition: border-color var(--duration-short, 0.15s) ease;
|
|
123
|
+
|
|
124
|
+
&.is-drag-over {
|
|
125
|
+
border-color: rgb(var(--color-primary));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.s-rich-input-textarea {
|
|
129
|
+
border: none;
|
|
130
|
+
box-shadow: none;
|
|
131
|
+
background: transparent;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.s-rich-input-textarea {
|
|
136
|
+
width: 100%;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* ── Tools row ──────────────────────────────────────────────────── */
|
|
140
|
+
.s-rich-input-tools {
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
gap: var(--space-6, 0.375rem);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.s-rich-input-tool-btn {
|
|
147
|
+
color: rgb(var(--color-muted));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.s-rich-input-mic-anchor {
|
|
151
|
+
display: inline-flex;
|
|
152
|
+
position: relative;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.s-rich-input-mic.is-recording {
|
|
156
|
+
color: rgb(var(--color-error));
|
|
157
|
+
background: rgb(var(--color-error) / 10%);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.s-rich-input-spacer {
|
|
161
|
+
flex: 1;
|
|
162
|
+
}
|