@kapiuara/ui 0.22.0 → 0.23.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/components/chat/KapiChatDivider.js +1 -2
- package/dist/components/chat/KapiChatList.js +15 -16
- package/dist/components/chat/KapiChatThread.js +21 -22
- package/dist/components/chat/KapiComposer.js +23 -24
- package/dist/components/chat/KapiMessageBubble.js +5 -6
- package/dist/components/chat/KapiTypingIndicator.js +5 -6
- package/dist/components/chat/chatLogic.js +1 -2
- package/dist/components/data/KapiBarChart.js +22 -23
- package/dist/components/data/KapiDataTable.js +92 -93
- package/dist/components/data/KapiEventCalendar.js +96 -97
- package/dist/components/data/KapiHeatmap.js +21 -22
- package/dist/components/data/KapiLineChart.js +23 -24
- package/dist/components/data/KapiPagination.js +1 -2
- package/dist/components/data/KapiPaginationFooter.js +5 -6
- package/dist/components/data/KapiScatterChart.js +18 -19
- package/dist/components/data/KapiSheet.js +2 -3
- package/dist/components/data/KapiSparkline.js +1 -2
- package/dist/components/data/KapiTable.js +107 -108
- package/dist/components/data/KapiTableFilter.js +13 -14
- package/dist/components/data/KapiTableFooter.js +21 -22
- package/dist/components/data/KapiTableRow.js +10 -11
- package/dist/components/data/KapiTableToolbar.js +95 -96
- package/dist/components/data/barChartLogic.js +1 -2
- package/dist/components/data/chartFrame.js +13 -14
- package/dist/components/data/datasetSelectionLogic.js +1 -2
- package/dist/components/data/eventCalendarLogic.js +2 -3
- package/dist/components/data/heatmapLogic.js +1 -2
- package/dist/components/data/lineChartLogic.js +1 -2
- package/dist/components/data/rowClickLogic.js +2 -17
- package/dist/components/data/scatterLogic.js +1 -2
- package/dist/components/data/sparklineLogic.js +1 -2
- package/dist/components/data/tableCells.js +14 -15
- package/dist/components/data/tableHeaderMenu.js +1 -2
- package/dist/components/data/tableLabels.js +1 -2
- package/dist/components/data/tableLogic.js +0 -1
- package/dist/components/data/tablePaginationLogic.js +1 -2
- package/dist/components/data/tableResizeLogic.js +1 -2
- package/dist/components/data/tableSlots.js +1 -2
- package/dist/components/data/tableSpanLogic.js +1 -2
- package/dist/components/data/useColumnResize.js +23 -24
- package/dist/components/data/useRowKeyWarning.js +1 -2
- package/dist/components/data/useTableEdges.js +1 -2
- package/dist/components/data/useTableSelection.js +25 -26
- package/dist/components/display/KapiAnchor.js +7 -8
- package/dist/components/display/KapiAnnotation.js +15 -16
- package/dist/components/display/KapiAvatar.js +6 -7
- package/dist/components/display/KapiAvatarGroup.js +15 -16
- package/dist/components/display/KapiBadge.js +1 -2
- package/dist/components/display/KapiCodeBlock.js +14 -15
- package/dist/components/display/KapiComment.js +10 -11
- package/dist/components/display/KapiCommentComposer.js +13 -14
- package/dist/components/display/KapiDescriptionList.js +1 -2
- package/dist/components/display/KapiDiff.js +23 -24
- package/dist/components/display/KapiFileItem.js +13 -14
- package/dist/components/display/KapiFileViewer.js +17 -18
- package/dist/components/display/KapiHighlight.js +2 -3
- package/dist/components/display/KapiIconTile.js +2 -3
- package/dist/components/display/KapiStat.js +8 -9
- package/dist/components/display/KapiTag.js +6 -7
- package/dist/components/display/KapiText.js +5 -6
- package/dist/components/display/KapiTimeline.js +2 -3
- package/dist/components/display/KapiTitle.js +1 -2
- package/dist/components/display/KapiTruncate.js +5 -6
- package/dist/components/display/annotationLogic.js +1 -2
- package/dist/components/display/avatarGroupLogic.js +1 -2
- package/dist/components/display/avatarGroupSlots.js +1 -2
- package/dist/components/display/avatarLogic.js +1 -2
- package/dist/components/display/codeBlockSlots.js +1 -2
- package/dist/components/display/commentLogic.js +1 -2
- package/dist/components/display/diffLogic.js +1 -2
- package/dist/components/display/diffSlots.js +1 -2
- package/dist/components/display/fileItemLogic.js +1 -2
- package/dist/components/display/highlightLogic.js +1 -2
- package/dist/components/display/highlightSlots.js +1 -2
- package/dist/components/display/iconTileLogic.js +1 -2
- package/dist/components/display/statLogic.js +1 -2
- package/dist/components/display/tagLogic.js +1 -2
- package/dist/components/display/textLogic.js +1 -2
- package/dist/components/display/timelineLogic.js +1 -2
- package/dist/components/display/truncateLogic.js +1 -2
- package/dist/components/feedback/KapiAlert.js +6 -7
- package/dist/components/feedback/KapiBulkBar.js +5 -6
- package/dist/components/feedback/KapiCountdown.js +16 -17
- package/dist/components/feedback/KapiEmpty.js +2 -3
- package/dist/components/feedback/KapiFab.js +96 -97
- package/dist/components/feedback/KapiOfflineBanner.js +4 -5
- package/dist/components/feedback/KapiProgress.js +1 -2
- package/dist/components/feedback/KapiSkeleton.js +1 -2
- package/dist/components/feedback/KapiSpinner.js +5 -6
- package/dist/components/feedback/KapiToastContainer.js +28 -29
- package/dist/components/feedback/KapiTour.js +24 -25
- package/dist/components/feedback/KapiUnsavedBar.js +5 -6
- package/dist/components/feedback/alertSlots.js +1 -2
- package/dist/components/feedback/bulkBarLogic.js +1 -2
- package/dist/components/feedback/countdownLogic.js +1 -2
- package/dist/components/feedback/countdownSlots.js +1 -2
- package/dist/components/feedback/emptySlots.js +1 -2
- package/dist/components/feedback/fabLogic.js +1 -2
- package/dist/components/feedback/offlineBannerLogic.js +1 -2
- package/dist/components/feedback/progressLogic.js +1 -2
- package/dist/components/feedback/toastLayer.js +1 -2
- package/dist/components/feedback/toastStore.js +2 -3
- package/dist/components/feedback/tourLogic.js +1 -2
- package/dist/components/feedback/unsavedBarLogic.js +1 -2
- package/dist/components/inputs/KapiAutocomplete.js +23 -24
- package/dist/components/inputs/KapiButton.js +1 -2
- package/dist/components/inputs/KapiCalendar.js +12 -13
- package/dist/components/inputs/KapiCalendarGrid.js +15 -16
- package/dist/components/inputs/KapiCheckCard.js +4 -5
- package/dist/components/inputs/KapiCheckbox.js +1 -2
- package/dist/components/inputs/KapiChecklist.js +62 -63
- package/dist/components/inputs/KapiCopyButton.js +6 -7
- package/dist/components/inputs/KapiDatePicker.js +33 -34
- package/dist/components/inputs/KapiDateRangePicker.js +145 -146
- package/dist/components/inputs/KapiFacetedSearch.js +55 -56
- package/dist/components/inputs/KapiField.js +5 -6
- package/dist/components/inputs/KapiFileUpload.js +26 -27
- package/dist/components/inputs/KapiIconButton.js +1 -2
- package/dist/components/inputs/KapiInput.js +46 -47
- package/dist/components/inputs/KapiInputGroup.js +1 -2
- package/dist/components/inputs/KapiMaskedInput.js +50 -51
- package/dist/components/inputs/KapiNumberStepper.js +49 -50
- package/dist/components/inputs/KapiPinInput.js +9 -10
- package/dist/components/inputs/KapiPropsForm.js +43 -44
- package/dist/components/inputs/KapiRadio.js +1 -2
- package/dist/components/inputs/KapiRating.js +38 -39
- package/dist/components/inputs/KapiSearchChip.js +10 -11
- package/dist/components/inputs/KapiSegmented.js +65 -66
- package/dist/components/inputs/KapiSelect.js +198 -199
- package/dist/components/inputs/KapiSelectMenu.js +1 -2
- package/dist/components/inputs/KapiSlider.js +11 -12
- package/dist/components/inputs/KapiSwitch.js +6 -7
- package/dist/components/inputs/KapiTagInput.js +32 -33
- package/dist/components/inputs/KapiTextarea.js +22 -23
- package/dist/components/inputs/asyncSelectLogic.js +22 -23
- package/dist/components/inputs/autocompleteLogic.js +1 -2
- package/dist/components/inputs/checkControl.js +4 -5
- package/dist/components/inputs/checklistLogic.js +1 -2
- package/dist/components/inputs/copyLogic.js +1 -2
- package/dist/components/inputs/datePickerLogic.js +1 -2
- package/dist/components/inputs/dateRangeLogic.js +1 -2
- package/dist/components/inputs/facetedSearchLogic.js +1 -2
- package/dist/components/inputs/fieldLogic.js +1 -2
- package/dist/components/inputs/fileUploadLogic.js +1 -2
- package/dist/components/inputs/formBridgeLogic.js +1 -2
- package/dist/components/inputs/inputGroupLogic.js +1 -2
- package/dist/components/inputs/inputLogic.js +1 -2
- package/dist/components/inputs/maskLogic.js +0 -1
- package/dist/components/inputs/misuseWarnings.js +1 -2
- package/dist/components/inputs/numberStepLogic.js +1 -2
- package/dist/components/inputs/ownField.js +9 -10
- package/dist/components/inputs/pinInputLogic.js +1 -2
- package/dist/components/inputs/propsFormLogic.js +1 -2
- package/dist/components/inputs/ratingLogic.js +1 -2
- package/dist/components/inputs/searchChipLogic.js +1 -2
- package/dist/components/inputs/segmentedLogic.js +1 -2
- package/dist/components/inputs/selectKeyLogic.js +1 -2
- package/dist/components/inputs/selectLogic.js +1 -2
- package/dist/components/inputs/selectSlots.js +1 -2
- package/dist/components/inputs/sliderLogic.js +1 -2
- package/dist/components/inputs/tagInputLogic.js +1 -2
- package/dist/components/inputs/textareaLogic.js +1 -2
- package/dist/components/inputs/useCalendarFocus.js +1 -2
- package/dist/components/inputs/useDatePopSide.js +1 -2
- package/dist/components/inputs/useSelectCreate.js +1 -2
- package/dist/components/inputs/useSelectSource.js +11 -12
- package/dist/components/labelsLogic.js +1 -2
- package/dist/components/layout/KapiAccessCard.js +10 -11
- package/dist/components/layout/KapiAccountMenu.js +24 -25
- package/dist/components/layout/KapiBox.js +5 -6
- package/dist/components/layout/KapiCard.js +18 -19
- package/dist/components/layout/KapiCenter.js +1 -2
- package/dist/components/layout/KapiCluster.js +1 -2
- package/dist/components/layout/KapiCol.js +1 -2
- package/dist/components/layout/KapiCollapse.js +1 -2
- package/dist/components/layout/KapiContextSlot.js +98 -99
- package/dist/components/layout/KapiDivider.js +1 -2
- package/dist/components/layout/KapiGrid.js +9 -10
- package/dist/components/layout/KapiMasonry.js +1 -2
- package/dist/components/layout/KapiNotificationBell.js +53 -54
- package/dist/components/layout/KapiPageHeader.js +42 -43
- package/dist/components/layout/KapiPanelParts.js +43 -44
- package/dist/components/layout/KapiRail.js +103 -104
- package/dist/components/layout/KapiRailAccount.js +11 -12
- package/dist/components/layout/KapiRoot.js +33 -34
- package/dist/components/layout/KapiScrollArea.js +7 -8
- package/dist/components/layout/KapiShell.js +8 -9
- package/dist/components/layout/KapiStack.js +1 -2
- package/dist/components/layout/KapiThemeScript.js +1 -2
- package/dist/components/layout/accessCardLogic.js +1 -2
- package/dist/components/layout/cardLogic.js +1 -2
- package/dist/components/layout/cardSlots.js +1 -2
- package/dist/components/layout/gridSpanLogic.js +1 -2
- package/dist/components/layout/layoutPrimitives.js +1 -2
- package/dist/components/layout/masonryLogic.js +1 -2
- package/dist/components/layout/notificationBellLogic.js +1 -2
- package/dist/components/layout/pageHeaderLogic.js +1 -2
- package/dist/components/layout/pageHeaderSlots.js +1 -2
- package/dist/components/layout/railContext.js +1 -2
- package/dist/components/layout/railLogic.js +1 -2
- package/dist/components/layout/railSlots.js +1 -2
- package/dist/components/layout/reopenBus.js +1 -2
- package/dist/components/layout/shellSlots.js +1 -2
- package/dist/components/layout/useGridBreakpoint.js +1 -2
- package/dist/components/layout/useMasonrySpans.js +6 -7
- package/dist/components/layout/useRailOverflow.js +7 -8
- package/dist/components/locale/KapiLocaleProvider.js +1 -2
- package/dist/components/locale/linkLabels.js +1 -2
- package/dist/components/locale/localeLogic.js +1 -2
- package/dist/components/navigation/CtxSlidingList.js +7 -8
- package/dist/components/navigation/KapiAccordion.js +11 -12
- package/dist/components/navigation/KapiBreadcrumb.js +11 -12
- package/dist/components/navigation/KapiCollapsiblePanel.js +13 -14
- package/dist/components/navigation/KapiContextPanel.js +138 -139
- package/dist/components/navigation/KapiFilterChips.js +25 -22
- package/dist/components/navigation/KapiNavBadge.js +6 -7
- package/dist/components/navigation/KapiPanelGroup.js +34 -35
- package/dist/components/navigation/KapiSteps.js +41 -36
- package/dist/components/navigation/KapiTabs.js +40 -41
- package/dist/components/navigation/KapiToc.js +15 -16
- package/dist/components/navigation/KapiTree.js +126 -124
- package/dist/components/navigation/KapiWizard.js +12 -13
- package/dist/components/navigation/MiniNavItem.js +11 -12
- package/dist/components/navigation/accordionLogic.js +1 -2
- package/dist/components/navigation/activeItemLogic.js +1 -2
- package/dist/components/navigation/breadcrumbLogic.js +1 -2
- package/dist/components/navigation/contextPanelLogic.js +1 -2
- package/dist/components/navigation/filterChipsLogic.d.ts +9 -1
- package/dist/components/navigation/filterChipsLogic.js +2 -3
- package/dist/components/navigation/navBadgeLogic.js +1 -2
- package/dist/components/navigation/navLink.js +1 -2
- package/dist/components/navigation/navLinkLogic.js +1 -2
- package/dist/components/navigation/panelGroupLogic.js +1 -2
- package/dist/components/navigation/panelMini.js +0 -1
- package/dist/components/navigation/panelMiniLogic.js +1 -2
- package/dist/components/navigation/stepsLogic.js +1 -2
- package/dist/components/navigation/tabsLogic.js +1 -2
- package/dist/components/navigation/tocLogic.js +1 -2
- package/dist/components/navigation/tocSlots.js +1 -2
- package/dist/components/navigation/treeLogic.js +1 -2
- package/dist/components/navigation/wizardLogic.js +1 -2
- package/dist/components/overlays/KapiCanvasForm.js +5 -6
- package/dist/components/overlays/KapiCommandPalette.js +45 -45
- package/dist/components/overlays/KapiConfirm.js +9 -10
- package/dist/components/overlays/KapiContextMenu.js +16 -17
- package/dist/components/overlays/KapiDialogHost.js +50 -51
- package/dist/components/overlays/KapiDropdown.js +2 -3
- package/dist/components/overlays/KapiImageViewer.js +8 -9
- package/dist/components/overlays/KapiLoading.js +7 -8
- package/dist/components/overlays/KapiMenuButton.js +19 -20
- package/dist/components/overlays/KapiModal.js +58 -59
- package/dist/components/overlays/KapiOffcanvas.js +146 -147
- package/dist/components/overlays/KapiOffcanvasStack.js +18 -19
- package/dist/components/overlays/KapiPhotoView.js +21 -22
- package/dist/components/overlays/KapiPopover.js +12 -13
- package/dist/components/overlays/KapiShapeSheet.js +11 -12
- package/dist/components/overlays/KapiShortcutsHelp.js +18 -19
- package/dist/components/overlays/KapiSplitModal.js +20 -21
- package/dist/components/overlays/KapiTooltip.js +46 -47
- package/dist/components/overlays/KapiViewport.js +17 -18
- package/dist/components/overlays/canvasFormLogic.js +1 -2
- package/dist/components/overlays/commandPaletteLogic.js +1 -2
- package/dist/components/overlays/dialogStore.js +3 -4
- package/dist/components/overlays/dialogUtils.js +1 -2
- package/dist/components/overlays/exitPresenceLogic.js +1 -2
- package/dist/components/overlays/menuButtonLogic.js +1 -2
- package/dist/components/overlays/menuKeyboardLogic.js +1 -2
- package/dist/components/overlays/menuList.js +94 -95
- package/dist/components/overlays/modalSlots.js +1 -2
- package/dist/components/overlays/modalStack.js +1 -2
- package/dist/components/overlays/offcanvasCompanion.js +1 -2
- package/dist/components/overlays/offcanvasResize.js +0 -1
- package/dist/components/overlays/offcanvasSide.js +1 -2
- package/dist/components/overlays/offcanvasStack.js +1 -2
- package/dist/components/overlays/overlayPortal.js +1 -2
- package/dist/components/overlays/popoverLogic.js +1 -2
- package/dist/components/overlays/shortcutsHelpSlots.js +1 -2
- package/dist/components/overlays/splitModalLayout.js +1 -2
- package/dist/components/overlays/useExitPresence.js +11 -12
- package/dist/components/overlays/useNativeDialog.js +21 -22
- package/dist/components/overlays/viewportLogic.js +1 -2
- package/dist/components/renderSlot.js +1 -2
- package/dist/components/rootProps.js +1 -2
- package/dist/components/slotCatalog.js +33 -34
- package/dist/components/slotsLogic.js +1 -2
- package/dist/components/tone.js +1 -2
- package/dist/css/base.css +1 -1
- package/dist/css/components/navigation/navigation.css +1 -1
- package/dist/css/components/overlays/KapiViewport.css +1 -1
- package/dist/hooks/asyncResourceLogic.js +1 -2
- package/dist/hooks/breakpointOpenLogic.js +1 -2
- package/dist/hooks/colorLogic.js +1 -2
- package/dist/hooks/dateFormat.js +1 -2
- package/dist/hooks/densityLogic.js +1 -2
- package/dist/hooks/directionLogic.js +1 -2
- package/dist/hooks/downloadLogic.js +1 -2
- package/dist/hooks/elementSizeLogic.js +1 -2
- package/dist/hooks/fieldErrorsLogic.js +1 -2
- package/dist/hooks/focusLogic.js +2 -11
- package/dist/hooks/growOriginLogic.js +1 -2
- package/dist/hooks/hotkeyLogic.js +1 -2
- package/dist/hooks/hotkeyRegistry.js +1 -2
- package/dist/hooks/kapiRoot.js +2 -3
- package/dist/hooks/mergeRefs.js +1 -2
- package/dist/hooks/numberFormatLogic.js +1 -2
- package/dist/hooks/onlineStatusLogic.js +1 -2
- package/dist/hooks/ownerDocument.js +1 -2
- package/dist/hooks/persistentStateLogic.js +1 -2
- package/dist/hooks/portalRoot.js +1 -2
- package/dist/hooks/rafThrottle.js +1 -2
- package/dist/hooks/rangeSelectLogic.js +1 -2
- package/dist/hooks/recentLogic.js +1 -2
- package/dist/hooks/reducedMotion.js +8 -9
- package/dist/hooks/rightClick.js +10 -11
- package/dist/hooks/scrollCollapseLogic.js +1 -2
- package/dist/hooks/scrollEdgesLogic.js +1 -2
- package/dist/hooks/shallowStable.js +1 -2
- package/dist/hooks/slidingIndicatorLogic.js +1 -2
- package/dist/hooks/storageLogic.js +1 -2
- package/dist/hooks/themeColorsLogic.js +1 -2
- package/dist/hooks/themeContrastLogic.js +1 -2
- package/dist/hooks/themeDeriveLogic.js +0 -1
- package/dist/hooks/themeRadiiLogic.js +1 -2
- package/dist/hooks/themeScript.js +1 -2
- package/dist/hooks/toneFamilyLogic.js +1 -2
- package/dist/hooks/unsavedGuardLogic.js +1 -2
- package/dist/hooks/useAsyncLoader.js +1 -2
- package/dist/hooks/useAsyncResource.js +5 -6
- package/dist/hooks/useAsyncTasks.js +1 -2
- package/dist/hooks/useBottomBarInset.js +9 -10
- package/dist/hooks/useControllableState.js +1 -2
- package/dist/hooks/useDebouncedValue.js +1 -2
- package/dist/hooks/useDisclosure.js +1 -2
- package/dist/hooks/useDismiss.js +10 -11
- package/dist/hooks/useDragScroll.js +12 -13
- package/dist/hooks/useElementSize.js +1 -2
- package/dist/hooks/useFieldErrors.js +1 -2
- package/dist/hooks/useFocusReturn.js +1 -2
- package/dist/hooks/useFormReset.js +1 -2
- package/dist/hooks/useGlobalRightClick.js +1 -2
- package/dist/hooks/useGrowOrigin.js +1 -2
- package/dist/hooks/useHotkey.js +1 -2
- package/dist/hooks/useHydrated.js +1 -2
- package/dist/hooks/useKapiTheme.js +55 -56
- package/dist/hooks/useMediaQuery.js +1 -2
- package/dist/hooks/useObjectUrl.js +1 -2
- package/dist/hooks/useOnlineStatus.js +1 -2
- package/dist/hooks/useOutsidePress.js +1 -2
- package/dist/hooks/usePersistentState.js +9 -10
- package/dist/hooks/usePlacement.js +15 -16
- package/dist/hooks/useRangeSelect.js +2 -3
- package/dist/hooks/useRecent.js +6 -7
- package/dist/hooks/useScrollCollapse.js +1 -2
- package/dist/hooks/useScrollEdges.js +25 -26
- package/dist/hooks/useSlidingIndicator.js +19 -20
- package/dist/hooks/useSubmitDraft.js +1 -2
- package/dist/hooks/useToneFamilies.js +0 -1
- package/dist/hooks/useTypeahead.js +1 -2
- package/dist/hooks/useUnsavedGuard.js +5 -6
- package/dist/hooks/useVirtualList.js +1 -2
- package/dist/hooks/useWheelZoom.js +1 -2
- package/dist/hooks/viewportInsetLogic.js +1 -2
- package/dist/hooks/virtualListLogic.js +0 -1
- package/dist/hooks/wheelZoomLogic.js +1 -2
- package/dist/kapi.css +1 -1
- package/dist/kapi.layered.css +1 -1
- package/dist/logic.js +45 -45
- package/package.json +35 -36
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { prefersReducedMotion as e } from "./reducedMotion.js";
|
|
3
3
|
import { onViewportChange as t } from "./rafThrottle.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { DEFAULT_PAGE_FRACTION as n, pageTarget as r, revealTarget as i, sameScrollEdges as a, scrollEdges as o } from "./scrollEdgesLogic.js";
|
|
5
|
+
import { directionOf as s } from "./directionLogic.js";
|
|
6
|
+
import { winOf as c } from "./ownerDocument.js";
|
|
7
7
|
import { useCallback as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
|
|
8
|
-
|
|
9
|
-
var p = (e) =>
|
|
8
|
+
// src/hooks/useScrollEdges.ts
|
|
9
|
+
var p = (e) => s(e) === "rtl" ? -e.scrollLeft : e.scrollLeft, m = (e, t) => t === "x" ? {
|
|
10
10
|
position: p(e),
|
|
11
11
|
clientSize: e.clientWidth,
|
|
12
12
|
scrollSize: e.scrollWidth
|
|
@@ -18,7 +18,7 @@ var p = (e) => n(e) === "rtl" ? -e.scrollLeft : e.scrollLeft, m = (e, t) => t ==
|
|
|
18
18
|
start: !1,
|
|
19
19
|
end: !1
|
|
20
20
|
};
|
|
21
|
-
function g({ axis: p = "x", tolerance: g = 1, pageFraction: _ =
|
|
21
|
+
function g({ axis: p = "x", tolerance: g = 1, pageFraction: _ = n } = {}) {
|
|
22
22
|
let v = d(null), [y, b] = f(h), x = d({
|
|
23
23
|
axis: p,
|
|
24
24
|
tolerance: g,
|
|
@@ -34,8 +34,8 @@ function g({ axis: p = "x", tolerance: g = 1, pageFraction: _ = i } = {}) {
|
|
|
34
34
|
let S = l(() => {
|
|
35
35
|
let e = v.current;
|
|
36
36
|
if (!e) return;
|
|
37
|
-
let { axis: t, tolerance: n } = x.current, r =
|
|
38
|
-
b((e) =>
|
|
37
|
+
let { axis: t, tolerance: n } = x.current, r = o(m(e, t), n);
|
|
38
|
+
b((e) => a(e, r) ? e : r);
|
|
39
39
|
}, []), C = d(null), w = d(/* @__PURE__ */ new Set()), T = l(() => {
|
|
40
40
|
let e = C.current, t = v.current;
|
|
41
41
|
if (!e || !t) return;
|
|
@@ -48,22 +48,22 @@ function g({ axis: p = "x", tolerance: g = 1, pageFraction: _ = i } = {}) {
|
|
|
48
48
|
}, []);
|
|
49
49
|
u(() => {
|
|
50
50
|
S();
|
|
51
|
-
let
|
|
51
|
+
let e = c(v.current), n = t(S, e ? { target: e } : {});
|
|
52
52
|
return typeof ResizeObserver < "u" && (C.current = new ResizeObserver(() => S()), T()), () => {
|
|
53
|
-
|
|
53
|
+
n(), C.current?.disconnect(), C.current = null, w.current = /* @__PURE__ */ new Set();
|
|
54
54
|
};
|
|
55
55
|
}, [S, T]), u(() => {
|
|
56
56
|
T(), S();
|
|
57
57
|
});
|
|
58
|
-
let E = l((
|
|
59
|
-
let
|
|
60
|
-
left:
|
|
61
|
-
behavior:
|
|
58
|
+
let E = l((t, n, r) => {
|
|
59
|
+
let i = x.current.axis, a = r || e(t) ? "auto" : "smooth", o = s(t) === "rtl" ? -n : n, c = i === "x" ? {
|
|
60
|
+
left: o,
|
|
61
|
+
behavior: a
|
|
62
62
|
} : {
|
|
63
|
-
top:
|
|
64
|
-
behavior:
|
|
63
|
+
top: n,
|
|
64
|
+
behavior: a
|
|
65
65
|
};
|
|
66
|
-
typeof
|
|
66
|
+
typeof t.scrollTo == "function" ? t.scrollTo(c) : i === "x" ? t.scrollLeft = o : t.scrollTop = n;
|
|
67
67
|
}, []);
|
|
68
68
|
return {
|
|
69
69
|
ref: v,
|
|
@@ -71,13 +71,13 @@ function g({ axis: p = "x", tolerance: g = 1, pageFraction: _ = i } = {}) {
|
|
|
71
71
|
scrollByPage: l((e) => {
|
|
72
72
|
let t = v.current;
|
|
73
73
|
if (!t) return;
|
|
74
|
-
let { axis: n, pageFraction:
|
|
75
|
-
E(t,
|
|
74
|
+
let { axis: n, pageFraction: i } = x.current;
|
|
75
|
+
E(t, r(m(t, n), e, i), !1);
|
|
76
76
|
}, [E]),
|
|
77
|
-
reveal: l((e, { padding: t = 0, instant:
|
|
78
|
-
let
|
|
79
|
-
if (!
|
|
80
|
-
let a = x.current.axis,
|
|
77
|
+
reveal: l((e, { padding: t = 0, instant: n = !1 } = {}) => {
|
|
78
|
+
let r = v.current;
|
|
79
|
+
if (!r) return;
|
|
80
|
+
let a = x.current.axis, o = r.getBoundingClientRect(), c = e.getBoundingClientRect(), l = a === "x" ? r.clientLeft : r.clientTop, u = (a === "x" ? o.left : o.top) + l, d = m(r, a), f = a === "x" && s(r) === "rtl" ? u + r.clientWidth : null, p = i(d, f === null ? a === "x" ? {
|
|
81
81
|
start: c.left - u,
|
|
82
82
|
end: c.right - u
|
|
83
83
|
} : {
|
|
@@ -87,10 +87,9 @@ function g({ axis: p = "x", tolerance: g = 1, pageFraction: _ = i } = {}) {
|
|
|
87
87
|
start: f - c.right,
|
|
88
88
|
end: f - c.left
|
|
89
89
|
}, t);
|
|
90
|
-
Math.abs(p - d.position) < .5 || E(
|
|
90
|
+
Math.abs(p - d.position) < .5 || E(r, p, n);
|
|
91
91
|
}, [E]),
|
|
92
92
|
update: S
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
//#endregion
|
|
96
95
|
export { g as useScrollEdges };
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { slidingIndicatorBox as e } from "./slidingIndicatorLogic.js";
|
|
3
|
+
import { computedStyleOf as t, docOf as n, winOf as r } from "./ownerDocument.js";
|
|
4
|
+
import { onViewportChange as i } from "./rafThrottle.js";
|
|
5
5
|
import { useCallback as a, useEffect as o, useLayoutEffect as s, useRef as c } from "react";
|
|
6
|
-
|
|
6
|
+
// src/hooks/useSlidingIndicator.ts
|
|
7
7
|
function l({ active: l, deps: u, findActive: d }) {
|
|
8
8
|
let f = c(null), p = c(null), m = c(null), h = c(d);
|
|
9
9
|
s(() => {
|
|
10
10
|
h.current = d;
|
|
11
11
|
});
|
|
12
12
|
let g = a(() => {
|
|
13
|
-
let
|
|
14
|
-
if (!
|
|
15
|
-
let
|
|
16
|
-
if (!
|
|
17
|
-
|
|
13
|
+
let n = f.current, r = p.current;
|
|
14
|
+
if (!n || !r) return;
|
|
15
|
+
let i = h.current(n);
|
|
16
|
+
if (!i) {
|
|
17
|
+
r.classList.remove("is-visible"), r.classList.remove("is-ready"), m.current = null;
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
let a = m.current;
|
|
21
|
-
a && a !==
|
|
22
|
-
let o =
|
|
23
|
-
left:
|
|
24
|
-
top:
|
|
21
|
+
a && a !== i && !a.isConnected && r.classList.remove("is-ready");
|
|
22
|
+
let o = t(n), s = e(i.getBoundingClientRect(), n.getBoundingClientRect(), {
|
|
23
|
+
left: n.scrollLeft,
|
|
24
|
+
top: n.scrollTop
|
|
25
25
|
}, {
|
|
26
26
|
left: parseFloat(o.borderLeftWidth) || 0,
|
|
27
27
|
top: parseFloat(o.borderTopWidth) || 0
|
|
28
28
|
});
|
|
29
|
-
|
|
29
|
+
r.style.transform = `translate(${s.x}px, ${s.y}px)`, r.style.width = `${s.width}px`, r.style.height = `${s.height}px`, r.classList.add("is-visible"), r.classList.contains("is-ready") || requestAnimationFrame(() => r.classList.add("is-ready")), m.current = i;
|
|
30
30
|
}, []);
|
|
31
31
|
return s(g, [
|
|
32
32
|
g,
|
|
@@ -35,16 +35,16 @@ function l({ active: l, deps: u, findActive: d }) {
|
|
|
35
35
|
]), o(() => {
|
|
36
36
|
let e = f.current;
|
|
37
37
|
if (!e) return;
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
let a =
|
|
38
|
+
let t = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(g);
|
|
39
|
+
t?.observe(e);
|
|
40
|
+
let a = r(e), o = i(g, {
|
|
41
41
|
...a ? { target: a } : {},
|
|
42
42
|
events: "resize"
|
|
43
|
-
}), s =
|
|
43
|
+
}), s = n(e)?.fonts, c = !0;
|
|
44
44
|
return s?.addEventListener?.("loadingdone", g), s?.ready?.then(() => {
|
|
45
45
|
c && g();
|
|
46
46
|
}), () => {
|
|
47
|
-
c = !1,
|
|
47
|
+
c = !1, t?.disconnect(), o(), s?.removeEventListener?.("loadingdone", g);
|
|
48
48
|
};
|
|
49
49
|
}, [g]), {
|
|
50
50
|
containerRef: f,
|
|
@@ -52,5 +52,4 @@ function l({ active: l, deps: u, findActive: d }) {
|
|
|
52
52
|
remeasure: g
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
//#endregion
|
|
56
55
|
export { l as useSlidingIndicator };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useControllableState as e } from "./useControllableState.js";
|
|
3
3
|
import { canSubmitComment as t, draftAfterSubmit as n } from "../components/display/commentLogic.js";
|
|
4
4
|
import { useRef as r, useState as i } from "react";
|
|
5
|
-
|
|
5
|
+
// src/hooks/useSubmitDraft.ts
|
|
6
6
|
var a = (e) => typeof e?.then == "function", o = ({ value: o, defaultValue: s, onChange: c, onSubmit: l, disabled: u, loading: d = !1 }) => {
|
|
7
7
|
let [f, p, m] = e(o, s ?? "", c), h = r(null), [g, _] = i(!1), v = d || g, y = t(f, {
|
|
8
8
|
disabled: u,
|
|
@@ -23,5 +23,4 @@ var a = (e) => typeof e?.then == "function", o = ({ value: o, defaultValue: s, o
|
|
|
23
23
|
boxRef: h
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
//#endregion
|
|
27
26
|
export { o as useSubmitDraft };
|
|
@@ -46,5 +46,4 @@ var c = n(/* @__PURE__ */ new Set()), l = (t) => {
|
|
|
46
46
|
let n = f(e);
|
|
47
47
|
return o(() => n(t), [n, t]);
|
|
48
48
|
};
|
|
49
|
-
//#endregion
|
|
50
49
|
export { c as ToneFamilyNamesContext, u as useToneFamilyProblemWarning, l as useToneFamilyRegistry, p as useToneLook, f as useToneLookResolver };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useCallback as e, useEffect as t, useRef as n } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/useTypeahead.ts
|
|
4
4
|
var r = (r) => {
|
|
5
5
|
let i = n({
|
|
6
6
|
text: "",
|
|
@@ -16,5 +16,4 @@ var r = (r) => {
|
|
|
16
16
|
}, r), t.text;
|
|
17
17
|
}, [r]);
|
|
18
18
|
};
|
|
19
|
-
//#endregion
|
|
20
19
|
export { r as useTypeahead };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { createLeaveGate as e } from "./unsavedGuardLogic.js";
|
|
3
|
+
import { useLabels as t } from "../components/locale/KapiLocaleProvider.js";
|
|
4
4
|
import { useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
|
|
5
|
-
|
|
5
|
+
// src/hooks/useUnsavedGuard.ts
|
|
6
6
|
var s = {
|
|
7
7
|
title: "Tienes cambios sin guardar",
|
|
8
8
|
message: "Si sales ahora, se van a perder los cambios que no guardaste.",
|
|
@@ -12,12 +12,12 @@ var s = {
|
|
|
12
12
|
let [d, f] = o(!1), p = a(l);
|
|
13
13
|
p.current = l;
|
|
14
14
|
let m = a(null);
|
|
15
|
-
m.current ||=
|
|
15
|
+
m.current ||= e(f);
|
|
16
16
|
let h = m.current;
|
|
17
17
|
r(() => {
|
|
18
18
|
if (l) return window.addEventListener("beforeunload", c), () => window.removeEventListener("beforeunload", c);
|
|
19
19
|
}, [l]), r(() => () => h.settle(!1), [h]);
|
|
20
|
-
let g = n(() => h.request(p.current), [h]), _ = n(() => h.settle(!1), [h]), v = n(() => h.settle(!0), [h]), y =
|
|
20
|
+
let g = n(() => h.request(p.current), [h]), _ = n(() => h.settle(!1), [h]), v = n(() => h.settle(!0), [h]), y = t("unsavedGuard", s), b = u.title ?? y.title, x = u.message ?? y.message, S = u.leaveLabel ?? y.leave, C = u.stayLabel ?? y.stay;
|
|
21
21
|
return {
|
|
22
22
|
confirmLeave: g,
|
|
23
23
|
open: d,
|
|
@@ -44,5 +44,4 @@ var s = {
|
|
|
44
44
|
])
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
|
-
//#endregion
|
|
48
47
|
export { s as DEFAULT_UNSAVED_GUARD_LABELS, c as unsavedGuardHandler, l as useUnsavedGuard };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { anchoredScrollTop as e, computeWindow as t, measuredLayout as n, mergeMeasured as r, nextVirtualScroll as i, resolveSizes as a, scrollTopToReveal as o, sizesFromBoxes as s, uniformLayout as c } from "./virtualListLogic.js";
|
|
3
3
|
import { useCallback as l, useEffect as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
4
|
-
|
|
4
|
+
// src/hooks/useVirtualList.ts
|
|
5
5
|
var h = 8, g = "data-vindex";
|
|
6
6
|
function _({ enabled: _, count: v, scrollRef: y, estimate: b, measure: x = !1, keys: S, overscan: C = 6, fallbackViewHeight: w }) {
|
|
7
7
|
let [T, E] = m({
|
|
@@ -122,5 +122,4 @@ function _({ enabled: _, count: v, scrollRef: y, estimate: b, measure: x = !1, k
|
|
|
122
122
|
scrollToIndex: R
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
//#endregion
|
|
126
125
|
export { g as VIRTUAL_INDEX_ATTR, _ as useVirtualList };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { nextWheelZoom as e } from "./wheelZoomLogic.js";
|
|
3
3
|
import { useEffect as t, useRef as n } from "react";
|
|
4
|
-
|
|
4
|
+
// src/hooks/useWheelZoom.ts
|
|
5
5
|
var r = (r) => {
|
|
6
6
|
let i = n(null), a = n(r);
|
|
7
7
|
a.current = r;
|
|
@@ -23,5 +23,4 @@ var r = (r) => {
|
|
|
23
23
|
return t.addEventListener("wheel", n, { passive: !1 }), () => t.removeEventListener("wheel", n);
|
|
24
24
|
}, [o]), i;
|
|
25
25
|
};
|
|
26
|
-
//#endregion
|
|
27
26
|
export { r as useWheelZoom };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computedStyleOf as e, docOf as t, winOf as n } from "./ownerDocument.js";
|
|
2
|
-
|
|
2
|
+
// src/hooks/viewportInsetLogic.ts
|
|
3
3
|
var r = "--kapi-viewport-inset-bottom", i = (e, t) => e.width < t.width * .6 || e.bottom < t.height - 2 ? 0 : Math.max(0, Math.round(t.height - e.top)), a = (e) => {
|
|
4
4
|
let t = Number.parseFloat(e.trim());
|
|
5
5
|
return Number.isFinite(t) && t > 0 ? t : 0;
|
|
@@ -16,5 +16,4 @@ var r = "--kapi-viewport-inset-bottom", i = (e, t) => e.width < t.width * .6 ||
|
|
|
16
16
|
height: t.innerHeight
|
|
17
17
|
}, s(e));
|
|
18
18
|
};
|
|
19
|
-
//#endregion
|
|
20
19
|
export { r as VIEWPORT_INSET_BOTTOM_VAR, i as bottomBarInset, o as insetViewport, a as parseInset, c as placementViewport, s as viewportInsetBottom };
|
|
@@ -76,5 +76,4 @@ var e = .5, t = (e, t) => ({
|
|
|
76
76
|
o !== void 0 && Math.abs(o - t) <= .5 || (r ??= new Map(e), r.set(a, t));
|
|
77
77
|
}), r ?? e;
|
|
78
78
|
}, u = (e, t, n, r) => n <= 0 ? n : Math.max(0, n + t.offsetOf(r) - e.offsetOf(r));
|
|
79
|
-
//#endregion
|
|
80
79
|
export { e as MEASURE_TOLERANCE, u as anchoredScrollTop, i as computeWindow, n as measuredLayout, l as mergeMeasured, o as nextVirtualScroll, r as resolveSizes, a as sameWindow, s as scrollTopToReveal, c as sizesFromBoxes, t as uniformLayout };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/wheelZoomLogic.ts
|
|
2
2
|
var e = 1e-9, t = (t, n, r) => {
|
|
3
3
|
let { min: i, max: a, step: o } = r;
|
|
4
4
|
if (!(Number.isFinite(i) && Number.isFinite(a) && Number.isFinite(o) && o > 0 && i <= a) || n === 0 || Number.isNaN(n)) return t;
|
|
5
5
|
let s = ((Number.isNaN(t) ? i : Math.min(a, Math.max(i, t))) - i) / o, c = n < 0 ? Math.floor(s + e) + 1 : Math.ceil(s - e) - 1;
|
|
6
6
|
return Math.min(a, Math.max(i, i + c * o));
|
|
7
7
|
};
|
|
8
|
-
//#endregion
|
|
9
8
|
export { t as nextWheelZoom };
|