@cube-dev/ui-kit 0.158.0 → 0.160.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +159 -0
- package/dist/_internal/hooks/use-chained-callback.js +1 -1
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.d.ts +2 -2
- package/dist/components/actions/Button/Button.js +14 -6
- package/dist/components/actions/Button/Button.js.map +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.d.ts +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +4 -3
- package/dist/components/actions/ItemAction/ItemAction.js.map +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -1
- package/dist/components/actions/use-context-menu.js +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +8 -4
- package/dist/components/content/Disclosure/Disclosure.js.map +1 -1
- package/dist/components/content/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.d.ts +8 -1
- package/dist/components/content/Item/Item.js +24 -11
- package/dist/components/content/Item/Item.js.map +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +1 -1
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +41 -32
- package/dist/components/content/use-auto-tooltip.js.map +1 -1
- package/dist/components/data/DataTable/DataTable.js +82 -24
- package/dist/components/data/DataTable/DataTable.js.map +1 -1
- package/dist/components/data/DataTable/types.d.ts +56 -1
- package/dist/components/data/ItemTable/ItemTable.js +13 -5
- package/dist/components/data/ItemTable/ItemTable.js.map +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +3 -7
- package/dist/components/data/ItemTable/ItemTableBulkBar.js.map +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/types.d.ts +19 -0
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +5 -3
- package/dist/components/data/TableBase/RowCollection.js.map +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +115 -0
- package/dist/components/data/TableBase/TableHeaderCell.js.map +1 -0
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableView.js +195 -33
- package/dist/components/data/TableBase/TableView.js.map +1 -1
- package/dist/components/data/TableBase/column-menu.d.ts +36 -0
- package/dist/components/data/TableBase/column-menu.js +104 -0
- package/dist/components/data/TableBase/column-menu.js.map +1 -0
- package/dist/components/data/TableBase/column-tint.js +168 -0
- package/dist/components/data/TableBase/column-tint.js.map +1 -0
- package/dist/components/data/TableBase/index.d.ts +3 -2
- package/dist/components/data/TableBase/row-menu.js +11 -6
- package/dist/components/data/TableBase/row-menu.js.map +1 -1
- package/dist/components/data/TableBase/styled.js +45 -16
- package/dist/components/data/TableBase/styled.js.map +1 -1
- package/dist/components/data/TableBase/types.d.ts +104 -6
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/types.js.map +1 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-order.js +100 -0
- package/dist/components/data/TableBase/use-column-order.js.map +1 -0
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +24 -2
- package/dist/components/data/TableBase/use-table-columns.js.map +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +20 -1
- package/dist/components/data/TableBase/use-table-sort.js.map +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +40 -1
- package/dist/components/data/TableBase/use-table-sorts.js.map +1 -1
- package/dist/components/data/TableBase/use-table-storage.d.ts +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +6 -2
- package/dist/components/data/TableBase/use-table-storage.js.map +1 -1
- package/dist/components/data/index.d.ts +2 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/ColorSwatch.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Board/Board.js +28 -4
- package/dist/components/layout/Board/Board.js.map +1 -1
- package/dist/components/layout/Board/BoardProvider.js +1 -1
- package/dist/components/layout/Board/BoardResponsive.js +1 -1
- package/dist/components/layout/Board/Widget.js +1 -1
- package/dist/components/layout/Board/WidgetHost.js +6 -3
- package/dist/components/layout/Board/WidgetHost.js.map +1 -1
- package/dist/components/layout/Board/board-context.js +1 -1
- package/dist/components/layout/Board/board-store.js +1 -1
- package/dist/components/layout/Board/grid-core/calculate.js +1 -1
- package/dist/components/layout/Board/grid-core/collision.js +1 -1
- package/dist/components/layout/Board/grid-core/compactors.js +1 -1
- package/dist/components/layout/Board/grid-core/constraints.js +1 -1
- package/dist/components/layout/Board/grid-core/group-move.js +138 -33
- package/dist/components/layout/Board/grid-core/group-move.js.map +1 -1
- package/dist/components/layout/Board/grid-core/layout.js +1 -1
- package/dist/components/layout/Board/grid-core/sort.js +1 -1
- package/dist/components/layout/Board/index.js +1 -1
- package/dist/components/layout/Board/responsive-utils.js +1 -1
- package/dist/components/layout/Board/use-board-layout.js +1 -1
- package/dist/components/layout/Board/use-board-registry.js +1 -1
- package/dist/components/layout/Board/use-board-select-modifier-key.js +1 -1
- package/dist/components/layout/Board/use-board-selection.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.d.ts +1 -1
- package/dist/data/item-themes.js +45 -2
- package/dist/data/item-themes.js.map +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +13 -1
- package/dist/eslint-plugin/defaults.generated.js.map +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +5 -1
- package/dist/i18n/locales/en-US/uikit.js +5 -1
- package/dist/i18n/locales/en-US/uikit.json.d.ts +4 -0
- package/dist/i18n/locales/es-ES/uikit.js +5 -1
- package/dist/i18n/locales/es-MX/uikit.js +5 -1
- package/dist/i18n/locales/fr-FR/uikit.js +5 -1
- package/dist/i18n/locales/it-IT/uikit.js +5 -1
- package/dist/i18n/locales/ja-JP/uikit.js +5 -1
- package/dist/i18n/locales/nb-NO/uikit.js +5 -1
- package/dist/i18n/locales/pt-BR/uikit.js +5 -1
- package/dist/i18n/locales/pt-PT/uikit.js +5 -1
- package/dist/i18n/locales/sv-SE/uikit.js +5 -1
- package/dist/i18n/locales/vi-VN/uikit.js +5 -1
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.d.ts +12 -0
- package/dist/icons/ArrowNarrowDownIcon.js +11 -0
- package/dist/icons/ArrowNarrowDownIcon.js.map +1 -0
- package/dist/icons/ArrowNarrowUpIcon.d.ts +12 -0
- package/dist/icons/ArrowNarrowUpIcon.js +11 -0
- package/dist/icons/ArrowNarrowUpIcon.js.map +1 -0
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-theme.d.ts +86 -0
- package/dist/tokens/color-theme.js +156 -0
- package/dist/tokens/color-theme.js.map +1 -0
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.js +2 -1
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/palette-config.js +2 -2
- package/dist/tokens/palette.d.ts +1 -1
- package/dist/tokens/palette.js +44 -2
- package/dist/tokens/palette.js.map +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.d.ts +49 -0
- package/dist/utils/react/disabledProps.js +82 -0
- package/dist/utils/react/disabledProps.js.map +1 -0
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.d.ts +1 -0
- package/dist/utils/react/index.js +2 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/components/actions/Button.md +19 -1
- package/docs/components/content/Item.md +25 -3
- package/docs/components/data/DataTable.md +118 -2
- package/docs/components/data/ItemTable.md +37 -5
- package/docs/components/layout/Board.md +23 -12
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-move.js","names":[],"sources":["../../../../../src/components/layout/Board/grid-core/group-move.ts"],"sourcesContent":["/**\n * Rigid multi-item movement.\n *\n * `moveElement` (see ./layout.ts) moves exactly one item and is free to displace\n * any other item — including one the caller also wanted to move — as a collision\n * victim. That makes it unusable for moving a *selection* as a block: the shape\n * of the group would be destroyed by the very collision resolution meant to make\n * room for it.\n *\n * `moveElements` moves a set of items rigidly instead. Every mover receives the\n * same `(dx, dy)`, so the group's shape is invariant *by construction* rather\n * than by repair — and the compaction that follows is ordered so it cannot\n * undo that (see `compactWithGroupOrder`).\n *\n * This module is UI-Kit-specific; it is not part of the vendored react-grid-layout\n * core (see ./NOTICE.md).\n */\n\nimport { collides, getFirstCollision } from './collision';\nimport { compactItemHorizontal, compactItemVertical } from './compactors';\nimport { bottom, cloneLayout, cloneLayoutItem, getStatics } from './layout';\nimport { sortLayoutItemsByColRow, sortLayoutItemsByRowCol } from './sort';\n\nimport type { Compactor, Layout, LayoutItem, Mutable } from './types';\n\nexport interface MoveElementsOptions {\n /**\n * The board's compactor. Supplies `type`, `allowOverlap` and\n * `preventCollision` as one consistent unit, and performs the tidy-up pass —\n * taking it whole is what keeps this function from ever disagreeing with the\n * board about compaction mode.\n */\n compactor: Compactor;\n cols: number;\n /** @default Infinity */\n maxRows?: number;\n}\n\nexport interface MoveElementsResult {\n layout: LayoutItem[];\n /** The delta actually applied, after clamping the group to the grid. */\n dx: number;\n dy: number;\n /**\n * Whether a valid arrangement was produced. `false` means the frame must be\n * discarded and the previous one kept — never partially applied, since a\n * partial delta is precisely what shears the group apart.\n */\n moved: boolean;\n}\n\n/** An item may be moved unless it is static and does not opt back in. */\nfunction isMovable(item: LayoutItem): boolean {\n return !item.static || item.isDraggable === true;\n}\n\n/**\n * Move every item in `ids` by the same delta, resolving collisions with the\n * items that are *not* moving.\n *\n * Semantics, all deliberate:\n *\n * - **Group-clamped, not item-clamped.** The delta is clamped once against the\n * whole group, so dragging into an edge parks the block against it. Clamping\n * each item into bounds separately would collapse the group's shape the first\n * time it touched a wall, and it would never recover.\n * - **All-or-nothing.** If the frame cannot be resolved, nothing moves.\n * - **Movers never collide with each other.** They keep their relative\n * positions, so only mover↔non-mover and non-mover↔non-mover overlaps resolve.\n * - **A static item is never a mover**, matching `moveElement`'s own guard, and\n * a mover can never displace a static item — that frame is rejected instead.\n * - **Gravity still wins, but it cannot reach inside the group.** A compacting\n * board reflows the movers along with everyone else, so the block is not held\n * in mid-air; the group is merely compacted as one consecutive run, which is\n * what stops a displaced neighbour being packed *between* two members.\n *\n * Returns a new layout in the input's item order; the input is never mutated.\n */\nexport function moveElements(\n layout: Layout,\n ids: ReadonlySet<string>,\n dx: number,\n dy: number,\n options: MoveElementsOptions,\n): MoveElementsResult {\n const { compactor, cols, maxRows = Infinity } = options;\n\n const working = cloneLayout(layout);\n const movers = working.filter((it) => ids.has(it.i) && isMovable(it));\n\n if (movers.length === 0) {\n return { layout: working, dx: 0, dy: 0, moved: false };\n }\n\n const moverIds = new Set(movers.map((it) => it.i));\n const others = working.filter((it) => !moverIds.has(it.i));\n\n // ---- Clamp the delta to the group ----------------------------------------\n //\n // The group can travel until its *first* item hits an edge. `Math.max` on the\n // upper bounds guards the degenerate case of an item wider/taller than the\n // grid, where the max would otherwise fall below the min and invert the range.\n let minDx = -Infinity;\n let maxDx = Infinity;\n let minDy = -Infinity;\n let maxDy = Infinity;\n\n for (const it of movers) {\n minDx = Math.max(minDx, -it.x);\n maxDx = Math.min(maxDx, cols - it.w - it.x);\n minDy = Math.max(minDy, -it.y);\n maxDy = Math.min(maxDy, maxRows - it.h - it.y);\n }\n maxDx = Math.max(minDx, maxDx);\n maxDy = Math.max(minDy, maxDy);\n\n // `|| 0` collapses `-0`, which `Math.max` produces whenever a mover sits at\n // coordinate 0. It compares equal to `0` but not under `Object.is`, and it\n // would otherwise be handed back to callers as a delta.\n const clampedDx = Math.min(Math.max(dx, minDx), maxDx) || 0;\n const clampedDy = Math.min(Math.max(dy, minDy), maxDy) || 0;\n\n for (const it of movers) {\n (it as Mutable<LayoutItem>).x = it.x + clampedDx;\n (it as Mutable<LayoutItem>).y = it.y + clampedDy;\n }\n\n const rejected: MoveElementsResult = {\n layout: cloneLayout(layout),\n dx: 0,\n dy: 0,\n moved: false,\n };\n\n if (!compactor.allowOverlap) {\n // A static non-mover cannot be pushed out of the way, so overlapping one is\n // never resolvable.\n for (const it of others) {\n if (it.static && getFirstCollision(movers, it)) {\n return rejected;\n }\n }\n\n if (compactor.preventCollision) {\n // `compact=\"free\"` / legacy no-compaction with collisions prevented: the\n // group may only land where it fits outright.\n for (const it of movers) {\n if (getFirstCollision(others, it)) {\n return rejected;\n }\n }\n } else if (compactor.type === null && !pushOthersDown(movers, others)) {\n // Only when nothing else will: a compacting compactor resolves overlaps\n // itself (and floats items back up afterwards), so pre-pushing there just\n // shoves neighbours further than needed and makes the board look like it\n // is lagging a step behind the pointer.\n return rejected;\n }\n }\n\n // Compact exactly as the single-widget path does — the group is not held in\n // place. On a vertically-compacted board a lone widget can never be parked in\n // empty space, and a group must not be able to either: neighbours have to\n // close the gap the moment it opens, or the board reads as a step behind.\n //\n // But *order* the pass so the group stays one run. A plain compaction sorts\n // every item by `(y, x)` and packs each one independently, with no idea a\n // group exists — so the moment movers and non-movers interleave in y, a\n // displaced neighbour gets packed between two members and the selection comes\n // apart mid-drag. Check `allowOverlap` first: the overlap compactors report a\n // `type` but their `compact` is a plain clone, so there is nothing to order.\n const groupAware =\n !compactor.allowOverlap &&\n (compactor.type === 'vertical' || compactor.type === 'horizontal');\n\n const out = groupAware\n ? compactWithGroupOrder(working, moverIds, {\n axis: compactor.type as CompactionAxis,\n travel: compactor.type === 'horizontal' ? clampedDx : clampedDy,\n cols,\n })\n : [...compactor.compact(working, cols)];\n\n return { layout: out, dx: clampedDx, dy: clampedDy, moved: true };\n}\n\ntype CompactionAxis = 'vertical' | 'horizontal';\n\ninterface GroupOrderOptions {\n /** The axis the board compacts along. */\n axis: CompactionAxis;\n /**\n * The group's clamped travel along that axis. Only the sign is read — it\n * decides who wins a tie for the same row (or column).\n */\n travel: number;\n cols: number;\n}\n\n/** A group of movers, or a single non-mover, as one thing to place. */\ninterface CompactionUnit {\n isGroup: boolean;\n /** Leading edge along the compaction axis. */\n head: number;\n /** Leading edge across it, among the members sitting at `head`. */\n cross: number;\n members: LayoutItem[];\n}\n\n/**\n * Compact a layout the way the board's own compactor would, except that the\n * movers are placed as one consecutive run instead of being interleaved with\n * everyone else by a global `(y, x)` sort.\n *\n * Each member still floats individually under gravity, so the result is a fixed\n * point of the plain compactor — nothing is parked in mid-air, and a later\n * unrelated drag (which re-compacts the whole board) cannot shear the group\n * after the fact. The single invariant this adds is that a non-mover can never\n * end up *between* two members.\n *\n * Placement order decides everything, and it turns on the direction of travel:\n *\n * - Moving **against** gravity (`travel < 0`), the group claims the row it was\n * dropped on and the widgets it passed fall in below it.\n * - Moving **with** gravity, the non-movers close the vacated space first.\n * Handing the group the tie here would leave it exactly where it started and\n * the drag would read as a no-op.\n *\n * The comparison is a strict `travel < 0`, so a zero-travel re-run lands in the\n * second branch — that is what makes the pass idempotent, which the live drag\n * and the keyboard path both depend on.\n */\nfunction compactWithGroupOrder(\n layout: Layout,\n moverIds: ReadonlySet<string>,\n { axis, travel, cols }: GroupOrderOptions,\n): LayoutItem[] {\n const horizontal = axis === 'horizontal';\n const head = horizontal ? 'x' : 'y';\n const cross = horizontal ? 'y' : 'x';\n const groupFirst = travel < 0;\n\n const clones = layout.map(cloneLayoutItem);\n const movers: LayoutItem[] = [];\n const units: CompactionUnit[] = [];\n\n for (const it of clones) {\n if (moverIds.has(it.i)) {\n movers.push(it);\n } else {\n units.push({\n isGroup: false,\n head: it[head],\n cross: it[cross],\n members: [it],\n });\n }\n }\n\n if (movers.length > 0) {\n const groupHead = Math.min(...movers.map((it) => it[head]));\n\n units.push({\n isGroup: true,\n head: groupHead,\n cross: Math.min(\n ...movers.filter((it) => it[head] === groupHead).map((it) => it[cross]),\n ),\n // Members are placed in the same reading order the compactor would have\n // used, so within the run each one lands exactly where it would have.\n members: horizontal\n ? sortLayoutItemsByColRow(movers)\n : sortLayoutItemsByRowCol(movers),\n });\n }\n\n units.sort((a, b) => {\n if (a.head !== b.head) return a.head - b.head;\n // Same row: direction decides whether the group or the displaced non-movers\n // get first claim on it.\n if (a.isGroup !== b.isGroup) return a.isGroup === groupFirst ? -1 : 1;\n if (a.cross !== b.cross) return a.cross - b.cross;\n\n return 0;\n });\n\n // From here on this mirrors `verticalCompactor` / `horizontalCompactor`\n // exactly: statics seed the obstacle set and are never floated, every other\n // item is packed against what is already placed, and `maxY` tracks how far\n // down the board has filled.\n const order = units.flatMap((unit) => unit.members);\n const compareWith = getStatics(clones);\n let maxY = bottom(compareWith);\n\n for (const l of order) {\n if (!l.static) {\n if (horizontal) {\n compactItemHorizontal(compareWith, l, cols, order);\n } else {\n compactItemVertical(compareWith, l, order, maxY);\n maxY = Math.max(maxY, l.y + l.h);\n }\n compareWith.push(l);\n }\n l.moved = false;\n }\n\n return clones;\n}\n\n/**\n * Push every non-mover that overlaps the group (or another displaced item)\n * straight down until nothing overlaps.\n *\n * Down, always — even under horizontal compaction. Downward is the one direction\n * a grid always has room in, so the pass is guaranteed to terminate; the\n * compactor then re-packs along its own axis immediately afterwards. Pushing\n * sideways would need overflow wrapping here and could ping-pong an item between\n * two neighbours.\n *\n * Mutates `others` in place. Returns `false` if the cascade fails to settle,\n * which the caller turns into a rejected frame.\n */\nfunction pushOthersDown(movers: LayoutItem[], others: LayoutItem[]): boolean {\n // Place one at a time, in reading order, against a set that starts as the\n // group. Each push moves an item strictly past a placed item's bottom edge, so\n // it advances monotonically and the loop is bounded by the stack height.\n const ordered = [...others].sort((a, b) =>\n a.y === b.y ? a.x - b.x : a.y - b.y,\n );\n const placed: LayoutItem[] = [...movers];\n const limit = bottom(movers) + bottom(others) + others.length + 1;\n\n for (const item of ordered) {\n if (item.static) {\n // Verified collision-free against the movers by the caller; other statics\n // are pre-existing and not ours to resolve.\n placed.push(item);\n continue;\n }\n\n let steps = 0;\n let shifted = true;\n\n while (shifted) {\n shifted = false;\n for (const other of placed) {\n if (collides(item, other)) {\n (item as Mutable<LayoutItem>).y = other.y + other.h;\n shifted = true;\n }\n }\n if (++steps > limit) {\n return false;\n }\n }\n\n placed.push(item);\n }\n\n return true;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,SAAS,UAAU,MAA2B;AAC5C,QAAO,CAAC,KAAK,UAAU,KAAK,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;AAyB9C,SAAgB,aACd,QACA,KACA,IACA,IACA,SACoB;CACpB,MAAM,EAAE,WAAW,MAAM,UAAU,aAAa;CAEhD,MAAM,UAAU,YAAY,OAAO;CACnC,MAAM,SAAS,QAAQ,QAAQ,OAAO,IAAI,IAAI,GAAG,EAAE,IAAI,UAAU,GAAG,CAAC;AAErE,KAAI,OAAO,WAAW,EACpB,QAAO;EAAE,QAAQ;EAAS,IAAI;EAAG,IAAI;EAAG,OAAO;EAAO;CAGxD,MAAM,WAAW,IAAI,IAAI,OAAO,KAAK,OAAO,GAAG,EAAE,CAAC;CAClD,MAAM,SAAS,QAAQ,QAAQ,OAAO,CAAC,SAAS,IAAI,GAAG,EA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I,CAAC,EAAE,QAAQ;AACb,OAAI,WACF,uBAAsB,aAAa,GAAG,MAAM,MAAM;QAC7C;AACL,wBAAoB,aAAa,GAAG,OAAO,KAAK;AAChD,WAAO,KAAK,IAAI,MAAM,EAAE,IAAI,EAAE,EAAE;;AAElC,eAAY,KAAK,EAAE;;AAErB,IAAE,QAAQ;;AAGZ,QAAO;;;;;;;;;;;;;;;AAgBT,SAAS,eAAe,QAAsB,QAA+B;CAI3E,MAAM,UAAU,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,MACnC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EACnC;CACD,MAAM,SAAuB,CAAC,GAAG,OAAO;CACxC,MAAM,QAAQ,OAAO,OAAO,GAAG,OAAO,OAAO,GAAG,OAAO,SAAS;AAEhE,MAAK,MAAM,QAAQ,SAAS;AAC1B,MAAI,KAAK,QAAQ;AAGf,UAAO,KAAK,KAAK;AACjB;;EAGF,IAAI,QAAQ;EACZ,IAAI,UAAU;AAEd,SAAO,SAAS;AACd,aAAU;AACV,QAAK,MAAM,SAAS,OAClB,KAAI,SAAS,MAAM,MAAM,EAAE;AACzB,IAAC,KAA6B,IAAI,MAAM,IAAI,MAAM;AAClD,cAAU;;AAGd,OAAI,EAAE,QAAQ,MACZ,QAAO;;AAIX,SAAO,KAAK,KAAK;;AAGnB,QAAO"}
|
|
1
|
+
{"version":3,"file":"group-move.js","names":[],"sources":["../../../../../src/components/layout/Board/grid-core/group-move.ts"],"sourcesContent":["/**\n * Rigid multi-item movement.\n *\n * `moveElement` (see ./layout.ts) moves exactly one item and is free to displace\n * any other item — including one the caller also wanted to move — as a collision\n * victim. That makes it unusable for moving a *selection* as a block: the shape\n * of the group would be destroyed by the very collision resolution meant to make\n * room for it.\n *\n * `moveElements` moves a set of items rigidly instead. Every mover receives the\n * same `(dx, dy)`, so the group's shape is invariant *by construction* rather\n * than by repair — and the compaction that follows both orders and places the\n * group as one block, so it cannot undo that (see `compactWithGroupOrder`).\n *\n * This module is UI-Kit-specific; it is not part of the vendored react-grid-layout\n * core (see ./NOTICE.md).\n */\n\nimport { collides, getFirstCollision } from './collision';\nimport { compactItemHorizontal, compactItemVertical } from './compactors';\nimport { bottom, cloneLayout, cloneLayoutItem, getStatics } from './layout';\nimport { sortLayoutItemsByColRow, sortLayoutItemsByRowCol } from './sort';\n\nimport type { Compactor, Layout, LayoutItem, Mutable } from './types';\n\nexport interface MoveElementsOptions {\n /**\n * The board's compactor. Supplies `type`, `allowOverlap` and\n * `preventCollision` as one consistent unit, and performs the tidy-up pass —\n * taking it whole is what keeps this function from ever disagreeing with the\n * board about compaction mode.\n */\n compactor: Compactor;\n cols: number;\n /** @default Infinity */\n maxRows?: number;\n}\n\nexport interface MoveElementsResult {\n layout: LayoutItem[];\n /** The delta actually applied, after clamping the group to the grid. */\n dx: number;\n dy: number;\n /**\n * Whether a valid arrangement was produced. `false` means the frame must be\n * discarded and the previous one kept — never partially applied, since a\n * partial delta is precisely what shears the group apart.\n */\n moved: boolean;\n}\n\n/** An item may be moved unless it is static and does not opt back in. */\nfunction isMovable(item: LayoutItem): boolean {\n return !item.static || item.isDraggable === true;\n}\n\n/**\n * Move every item in `ids` by the same delta, resolving collisions with the\n * items that are *not* moving.\n *\n * Semantics, all deliberate:\n *\n * - **Group-clamped, not item-clamped.** The delta is clamped once against the\n * whole group, so dragging into an edge parks the block against it. Clamping\n * each item into bounds separately would collapse the group's shape the first\n * time it touched a wall, and it would never recover.\n * - **All-or-nothing.** If the frame cannot be resolved, nothing moves.\n * - **Movers never collide with each other.** They keep their relative\n * positions, so only mover↔non-mover and non-mover↔non-mover overlaps resolve.\n * - **A static item is never a mover**, matching `moveElement`'s own guard, and\n * a mover can never displace a static item — that frame is rejected instead.\n * - **Gravity still wins, but it cannot reach inside the group.** A compacting\n * board floats the block along with everyone else, so it is not held in\n * mid-air; it just floats as *one rigid unit*, which is what stops a\n * displaced neighbour being packed between two members or one member being\n * floated out from under another.\n *\n * Returns a new layout in the input's item order; the input is never mutated.\n */\nexport function moveElements(\n layout: Layout,\n ids: ReadonlySet<string>,\n dx: number,\n dy: number,\n options: MoveElementsOptions,\n): MoveElementsResult {\n const { compactor, cols, maxRows = Infinity } = options;\n\n const working = cloneLayout(layout);\n const movers = working.filter((it) => ids.has(it.i) && isMovable(it));\n\n if (movers.length === 0) {\n return { layout: working, dx: 0, dy: 0, moved: false };\n }\n\n const moverIds = new Set(movers.map((it) => it.i));\n const others = working.filter((it) => !moverIds.has(it.i));\n\n // ---- Clamp the delta to the group ----------------------------------------\n //\n // The group can travel until its *first* item hits an edge. `Math.max` on the\n // upper bounds guards the degenerate case of an item wider/taller than the\n // grid, where the max would otherwise fall below the min and invert the range.\n let minDx = -Infinity;\n let maxDx = Infinity;\n let minDy = -Infinity;\n let maxDy = Infinity;\n\n for (const it of movers) {\n minDx = Math.max(minDx, -it.x);\n maxDx = Math.min(maxDx, cols - it.w - it.x);\n minDy = Math.max(minDy, -it.y);\n maxDy = Math.min(maxDy, maxRows - it.h - it.y);\n }\n maxDx = Math.max(minDx, maxDx);\n maxDy = Math.max(minDy, maxDy);\n\n // `|| 0` collapses `-0`, which `Math.max` produces whenever a mover sits at\n // coordinate 0. It compares equal to `0` but not under `Object.is`, and it\n // would otherwise be handed back to callers as a delta.\n const clampedDx = Math.min(Math.max(dx, minDx), maxDx) || 0;\n const clampedDy = Math.min(Math.max(dy, minDy), maxDy) || 0;\n\n for (const it of movers) {\n (it as Mutable<LayoutItem>).x = it.x + clampedDx;\n (it as Mutable<LayoutItem>).y = it.y + clampedDy;\n }\n\n const rejected: MoveElementsResult = {\n layout: cloneLayout(layout),\n dx: 0,\n dy: 0,\n moved: false,\n };\n\n // The axis the board compacts along; `null` has none, but its pre-push has to\n // pick a direction and down is the one a grid always has room in.\n const axis: 'x' | 'y' = compactor.type === 'horizontal' ? 'x' : 'y';\n const travel = axis === 'x' ? clampedDx : clampedDy;\n const drift = axis === 'x' ? clampedDy : clampedDx;\n /**\n * Whether the group is taking ground rather than giving it up — the question\n * that decides who has to move aside.\n *\n * Only a move *along* the compaction axis gives ground up: the group leaves\n * rows behind it, and the widgets below fall into them. Moving against the\n * axis, or purely *across* it, takes ground instead: every cell the group\n * lands on has to be vacated for it.\n */\n const takesGround = travel < 0 || (travel === 0 && drift !== 0);\n\n if (!compactor.allowOverlap) {\n // A static non-mover cannot be pushed out of the way, so overlapping one is\n // never resolvable.\n for (const it of others) {\n if (it.static && getFirstCollision(movers, it)) {\n return rejected;\n }\n }\n\n if (compactor.preventCollision) {\n // `compact=\"free\"` / legacy no-compaction with collisions prevented: the\n // group may only land where it fits outright.\n for (const it of movers) {\n if (getFirstCollision(others, it)) {\n return rejected;\n }\n }\n } else if (\n compactor.type === null ||\n ((compactor.type === 'vertical' || compactor.type === 'horizontal') &&\n takesGround)\n ) {\n // Nothing else will resolve it:\n //\n // - `type === null` has no compaction pass at all.\n // - Whenever the group *takes* ground, the widgets standing on it have to\n // be moved off first. Compaction alone cannot do that: it places items\n // in `head` order, so a non-mover on the group's landing row is placed\n // first and then blocks it. Against the axis the group stops short (or\n // does not move at all) while the widgets it did overlap slide down —\n // the \"only some of them moved\" symptom. Across the axis it is worse:\n // the group is the one gravity shoves aside, so dragging a pair\n // sideways slides *it* down under the widgets it was supposed to\n // displace, and they look pinned in place.\n //\n // Displacing first is what the single-widget path does too\n // (`moveElementAwayFromCollision` runs before compaction), and it costs\n // nothing extra: `compactWithGroupOrder` reads each unit's `head` from\n // these updated coordinates, so the pushed items sort after the group\n // and gravity floats them straight back to their minimal positions in\n // the same frame.\n //\n // Giving ground up needs the opposite: the non-movers must claim the\n // vacated rows first, or the group lands back where it started and the\n // drag reads as a no-op.\n if (!displaceOthers(movers, others, axis)) {\n return rejected;\n }\n }\n }\n\n // Compact exactly as the single-widget path does — the group is not held in\n // place. On a vertically-compacted board a lone widget can never be parked in\n // empty space, and a group must not be able to either: neighbours have to\n // close the gap the moment it opens, or the board reads as a step behind.\n //\n // But the group is placed as *one block*. A plain compaction sorts every item\n // by `(y, x)` and packs each one independently, with no idea a group exists —\n // so a displaced neighbour gets packed between two members, or one member\n // floats out from under another and the selection comes apart mid-drag. Check\n // `allowOverlap` first: the overlap compactors report a `type` but their\n // `compact` is a plain clone, so there is nothing to order.\n const groupAware =\n !compactor.allowOverlap &&\n (compactor.type === 'vertical' || compactor.type === 'horizontal');\n\n const out = groupAware\n ? compactWithGroupOrder(working, moverIds, {\n axis: compactor.type as CompactionAxis,\n travel,\n cols,\n })\n : [...compactor.compact(working, cols)];\n\n return { layout: out, dx: clampedDx, dy: clampedDy, moved: true };\n}\n\ntype CompactionAxis = 'vertical' | 'horizontal';\n\ninterface GroupOrderOptions {\n /** The axis the board compacts along. */\n axis: CompactionAxis;\n /**\n * The group's clamped travel along that axis. Only the sign is read — it\n * decides who wins a tie for the same row (or column).\n */\n travel: number;\n cols: number;\n}\n\n/** A group of movers, or a single non-mover, as one thing to place. */\ninterface CompactionUnit {\n isGroup: boolean;\n /** Leading edge along the compaction axis. */\n head: number;\n /** Leading edge across it, among the members sitting at `head`. */\n cross: number;\n members: LayoutItem[];\n /**\n * Where the members sat before *anything* was placed, in `members` order.\n *\n * The group's shape has to be read from here rather than from the live items:\n * packing a non-mover runs `resolveCompactionCollision`, which shoves items\n * later in the placement order out of its way — and for any drag where the\n * group is placed after a non-mover, that cascade reaches inside the group and\n * moves one member without the others. Left alone it would be baked into the\n * block as if it were the shape the user is holding, and two members can end\n * up on top of each other.\n */\n origin?: Array<{ x: number; y: number }>;\n}\n\n/**\n * Compact a layout the way the board's own compactor would, except that the\n * movers are placed as one rigid block instead of being packed one by one by a\n * global `(y, x)` sort.\n *\n * The block still floats under gravity — it is never parked in mid-air — but it\n * floats as a unit: one shift is applied to every member, so relative offsets\n * are invariant for the whole drag. Nothing can be packed between two members,\n * and no member can float out from under another.\n *\n * The cost, deliberately accepted: a *ragged* group (one whose members could\n * individually float further) is no longer a fixed point of the plain compactor,\n * so the drop — which re-compacts the source board — settles it. Holding the\n * shape while the pointer is down is what the gesture is about; the resting\n * layout stays an ordinary compacted layout.\n *\n * Placement order decides everything, and it turns on the direction of travel:\n *\n * - Moving **against** gravity (`travel < 0`), the group claims the row it was\n * dropped on and the widgets it passed fall in below it.\n * - Moving **with** gravity, the non-movers close the vacated space first.\n * Handing the group the tie here would leave it exactly where it started and\n * the drag would read as a no-op.\n *\n * The comparison is a strict `travel < 0`, so a zero-travel re-run lands in the\n * second branch — that is what makes the pass idempotent, which the live drag\n * and the keyboard path both depend on.\n */\nfunction compactWithGroupOrder(\n layout: Layout,\n moverIds: ReadonlySet<string>,\n { axis, travel, cols }: GroupOrderOptions,\n): LayoutItem[] {\n const horizontal = axis === 'horizontal';\n const head = horizontal ? 'x' : 'y';\n const cross = horizontal ? 'y' : 'x';\n const groupFirst = travel < 0;\n\n const clones = layout.map(cloneLayoutItem);\n const movers: LayoutItem[] = [];\n const units: CompactionUnit[] = [];\n\n for (const it of clones) {\n if (moverIds.has(it.i)) {\n movers.push(it);\n } else {\n units.push({\n isGroup: false,\n head: it[head],\n cross: it[cross],\n members: [it],\n });\n }\n }\n\n if (movers.length > 0) {\n const groupHead = Math.min(...movers.map((it) => it[head]));\n // Members are placed in the same reading order the compactor would have\n // used, so a block that has to fall back to item-by-item packing lands\n // exactly where it would have.\n const members = horizontal\n ? sortLayoutItemsByColRow(movers)\n : sortLayoutItemsByRowCol(movers);\n\n units.push({\n isGroup: true,\n head: groupHead,\n cross: Math.min(\n ...movers.filter((it) => it[head] === groupHead).map((it) => it[cross]),\n ),\n members,\n origin: members.map((it) => ({ x: it.x, y: it.y })),\n });\n }\n\n units.sort((a, b) => {\n if (a.head !== b.head) return a.head - b.head;\n // Same row: direction decides whether the group or the displaced non-movers\n // get first claim on it.\n if (a.isGroup !== b.isGroup) return a.isGroup === groupFirst ? -1 : 1;\n if (a.cross !== b.cross) return a.cross - b.cross;\n\n return 0;\n });\n\n // From here on this mirrors `verticalCompactor` / `horizontalCompactor`\n // exactly: statics seed the obstacle set and are never floated, every other\n // item is packed against what is already placed, and `maxY` tracks how far\n // down the board has filled. The one departure is a group of two or more,\n // which is floated as a block instead of item by item.\n const order = units.flatMap((unit) => unit.members);\n const compareWith = getStatics(clones);\n let maxY = bottom(compareWith);\n\n for (const unit of units) {\n const asBlock =\n unit.isGroup &&\n unit.members.length > 1 &&\n unit.origin !== undefined &&\n placeBlock(compareWith, unit.members, unit.origin, {\n horizontal,\n cols,\n maxHead: horizontal ? Infinity : maxY,\n });\n\n // A single mover, a non-mover, or a block that could not be placed in one\n // piece: pack each item on its own, exactly as the plain compactor would. A\n // one-item group must stay byte-identical to dragging that widget alone.\n if (!asBlock) {\n for (const l of unit.members) {\n if (!l.static) {\n if (horizontal) {\n compactItemHorizontal(compareWith, l, cols, order);\n } else {\n compactItemVertical(compareWith, l, order, maxY);\n maxY = Math.max(maxY, l.y + l.h);\n }\n compareWith.push(l);\n }\n l.moved = false;\n }\n continue;\n }\n\n for (const l of unit.members) {\n compareWith.push(l);\n if (!horizontal) maxY = Math.max(maxY, l.y + l.h);\n l.moved = false;\n }\n }\n\n return clones;\n}\n\ninterface PlaceBlockOptions {\n horizontal: boolean;\n cols: number;\n /**\n * How far the board has filled along the compaction axis. The block's leading\n * edge is pulled back to it before floating, mirroring `compactItemVertical`'s\n * `y = Math.min(maxY, y)` — a group dropped far past the end of the board must\n * not be able to park out there any more than a single widget can.\n * `Infinity` disables the clamp (the horizontal compactor has no equivalent).\n */\n maxHead: number;\n}\n\n/**\n * Float a whole group into place with a single shift, so every member keeps its\n * exact offset from every other.\n *\n * The shape is taken from `origin` — where the members sat before any placement\n * ran — not from their live coordinates, which an earlier unit's collision\n * cascade may already have pulled apart (see `CompactionUnit.origin`).\n *\n * Members are mutated only on success; a failure restores them, which is what\n * lets the caller fall back to packing them individually. Failure is reserved\n * for the one case a block genuinely cannot express: a horizontal board where\n * settling the overlap would push a member past the last column.\n *\n * Returns whether the block was placed.\n */\nfunction placeBlock(\n compareWith: Layout,\n members: LayoutItem[],\n origin: ReadonlyArray<{ x: number; y: number }>,\n { horizontal, cols, maxHead }: PlaceBlockOptions,\n): boolean {\n const head = horizontal ? 'x' : 'y';\n const size = horizontal ? 'w' : 'h';\n\n const restore = () => {\n members.forEach((it, index) => {\n const at = origin[index] as { x: number; y: number };\n (it as Mutable<LayoutItem>).x = at.x;\n (it as Mutable<LayoutItem>).y = at.y;\n });\n };\n\n restore();\n\n const shift = (delta: number) => {\n for (const it of members) {\n (it as Mutable<LayoutItem>)[head] += delta;\n }\n };\n const leadingEdge = () => Math.min(...members.map((it) => it[head]));\n const trailingEdge = () =>\n Math.max(...members.map((it) => it[head] + it[size]));\n const overlaps = () =>\n members.some((it) => getFirstCollision(compareWith, it) !== undefined);\n\n // Correct the block into the grid, then pull it back to the fill line.\n if (leadingEdge() < 0) shift(-leadingEdge());\n const overshoot = leadingEdge() - maxHead;\n if (overshoot > 0) shift(-overshoot);\n\n // Float against gravity for as long as the *whole* block is clear one step\n // earlier. Testing the next position rather than the current one (which is\n // how `compactItemVertical` is written) matters here: a block can straddle\n // several rows, so stepping into an overlap and unwinding it afterwards would\n // let the settle loop below carry it past where it should have stopped.\n while (leadingEdge() > 0) {\n shift(-1);\n if (overlaps()) {\n shift(1);\n break;\n }\n }\n\n if (!overlaps()) {\n // Clear where it floated to — as long as it is still on the grid. Only the\n // horizontal axis can fail that: `cols` bounds it, and the delta clamp has\n // already guaranteed every member fits before this ran.\n if (!horizontal || trailingEdge() <= cols) return true;\n restore();\n\n return false;\n }\n\n // Landed on something already placed — push the block forward until it is\n // clear. Bounded by how far the placed items reach plus the block's own\n // extent, so an unresolvable frame cannot spin.\n const span = members.reduce((total, it) => total + it[size], 0);\n const limit =\n Math.max(0, ...compareWith.map((it) => it[head] + it[size])) +\n span +\n members.length +\n 1;\n\n for (let step = 0; step < limit; step++) {\n shift(1);\n if (horizontal && trailingEdge() > cols) {\n restore();\n return false;\n }\n if (!overlaps()) return true;\n }\n\n restore();\n return false;\n}\n\n/**\n * Push every non-mover that overlaps the group (or another displaced item) past\n * it along `axis`, until nothing overlaps.\n *\n * `axis` is the board's compaction axis, so the compactor re-packs along the same\n * line immediately afterwards and pulls each displaced item back to its minimal\n * position. A board that does not compact at all (`compact=\"free\"`) is pushed\n * down: down is the one direction a grid always has room in.\n *\n * Pushing along `x` can carry an item past the last column. That is fine and\n * deliberate: `compactItemHorizontal` wraps an overflowing item to the next row,\n * which is a resolution — rejecting the frame here instead would freeze better\n * than a quarter of all leftward group drags.\n *\n * Mutates `others` in place. Returns `false` if the cascade fails to settle,\n * which the caller turns into a rejected frame.\n */\nfunction displaceOthers(\n movers: LayoutItem[],\n others: LayoutItem[],\n axis: 'x' | 'y',\n): boolean {\n const size = axis === 'x' ? 'w' : 'h';\n // Place one at a time, in reading order, against a set that starts as the\n // group. Each push moves an item strictly past a placed item's far edge, so it\n // advances monotonically and the loop is bounded by the stack extent.\n const ordered = [...others].sort((a, b) =>\n a.y === b.y ? a.x - b.x : a.y - b.y,\n );\n const placed: LayoutItem[] = [...movers];\n const reach = (items: LayoutItem[]) =>\n Math.max(0, ...items.map((it) => it[axis] + it[size]));\n const limit = reach(movers) + reach(others) + others.length + 1;\n\n for (const item of ordered) {\n if (item.static) {\n // Verified collision-free against the movers by the caller; other statics\n // are pre-existing and not ours to resolve.\n placed.push(item);\n continue;\n }\n\n let steps = 0;\n let shifted = true;\n\n while (shifted) {\n shifted = false;\n for (const other of placed) {\n if (collides(item, other)) {\n (item as Mutable<LayoutItem>)[axis] = other[axis] + other[size];\n shifted = true;\n }\n }\n if (++steps > limit) {\n return false;\n }\n }\n\n placed.push(item);\n }\n\n return true;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,SAAS,UAAU,MAA2B;AAC5C,QAAO,CAAC,KAAK,UAAU,KAAK,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;AA0B9C,SAAgB,aACd,QACA,KACA,IACA,IACA,SACoB;CACpB,M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,GAAG,MAAM;AACvC,YAAS;AACT,UAAO;;AAET,MAAI,CAAC,UAAU,CAAE,QAAO;;AAG1B,UAAS;AACT,QAAO;;;;;;;;;;;;;;;;;;;AAoBT,SAAS,eACP,QACA,QACA,MACS;CACT,MAAM,OAAO,SAAS,MAAM,MAAM;CAIlC,MAAM,UAAU,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,MACnC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EACnC;CACD,MAAM,SAAuB,CAAC,GAAG,OAAO;CACxC,MAAM,SAAS,UACb,KAAK,IAAI,GAAG,GAAG,MAAM,KAAK,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;CACxD,MAAM,QAAQ,MAAM,OAAO,GAAG,MAAM,OAAO,GAAG,OAAO,SAAS;AAE9D,MAAK,MAAM,QAAQ,SAAS;AAC1B,MAAI,KAAK,QAAQ;AAGf,UAAO,KAAK,KAAK;AACjB;;EAGF,IAAI,QAAQ;EACZ,IAAI,UAAU;AAEd,SAAO,SAAS;AACd,aAAU;AACV,QAAK,MAAM,SAAS,OAClB,KAAI,SAAS,MAAM,MAAM,EAAE;AACzB,IAAC,KAA6B,QAAQ,MAAM,QAAQ,MAAM;AAC1D,cAAU;;AAGd,OAAI,EAAE,QAAQ,MACZ,QAAO;;AAIX,SAAO,KAAK,KAAK;;AAGnB,QAAO"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { getCompactor, horizontalCompactor, noCompactor, verticalCompactor } from "./grid-core/compactors.js";
|
|
3
3
|
import { aspectRatio, boundedX, boundedY, containerBounds, gridBounds, maxSize, minMaxSize, minSize, snapToGrid } from "./grid-core/constraints.js";
|
|
4
4
|
import { BoardProvider } from "./BoardProvider.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { cloneLayout } from "./grid-core/layout.js";
|
|
4
4
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { BoardWidgetStore } from "./board-store.js";
|
|
4
4
|
import { collides } from "./grid-core/collision.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { useIsDarwin } from "../../../utils/react/useIsDarwin.js";
|
|
3
3
|
|
|
4
4
|
//#region src/components/layout/Board/use-board-select-modifier-key.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
4
4
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { CONTAINER_STYLES, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { CONTAINER_STYLES, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { CONTAINER_STYLES, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { BASE_STYLES, BLOCK_STYLES, COLOR_STYLES, DIMENSION_STYLES, OUTER_STYLES, tasty } from "@tenphi/tasty";
|
|
3
3
|
import { forwardRef, useMemo } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { useLayoutEffect as useLayoutEffect$1 } from "../../utils/react/useLayoutEffect.js";
|
|
4
4
|
import { useCombinedRefs } from "../../utils/react/useCombinedRefs.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../utils/react/mergeProps.js";
|
|
3
3
|
import { useCombinedRefs } from "../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { useEvent } from "../../_internal/hooks/use-event.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { CONTAINER_STYLES, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { useCombinedRefs } from "../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { CONTAINER_STYLES, filterBaseProps, parseStyle, tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
4
4
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { useControlledState } from "@react-stately/utils";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
4
4
|
import { ItemActionProvider } from "../../actions/ItemActionContext.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { DropIndicatorElement } from "./styled.js";
|
|
3
3
|
import { useTabsContext } from "./TabsContext.js";
|
|
4
4
|
import { useEffect, useRef, useState } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { TabPanelElement } from "./styled.js";
|
|
3
3
|
import { useEffect, useMemo, useRef } from "react";
|
|
4
4
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { ItemAction } from "../../actions/ItemAction/ItemAction.js";
|
|
3
3
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
4
4
|
import { CloseIcon } from "../../../icons/CloseIcon.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { _ItemButton } from "../../actions/ItemButton/ItemButton.js";
|
|
3
3
|
import { useOptionalTabsContext } from "./TabsContext.js";
|
|
4
4
|
import { tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
//#region src/components/navigation/Tabs/popover-placement.ts
|
|
3
3
|
/**
|
|
4
4
|
* Maps the parent Tabs `placement` to the popover placement for menus and
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { _Text } from "../../content/Text.js";
|
|
3
3
|
import { _Title } from "../../content/Title.js";
|
|
4
4
|
import { Card } from "../../content/Card/Card.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { _Title } from "../../content/Title.js";
|
|
3
3
|
import { useProviderProps } from "../../../provider.js";
|
|
4
4
|
import { Space } from "../../layout/Space.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { getWeekNumber } from "../../fields/DatePicker/period.js";
|
|
3
3
|
import { CalendarCell } from "./CalendarCell.js";
|
|
4
4
|
import { tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { _Title } from "../../content/Title.js";
|
|
3
3
|
import { useProviderProps } from "../../../provider.js";
|
|
4
4
|
import { Space } from "../../layout/Space.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { _Title } from "../../content/Title.js";
|
|
3
3
|
import { useProviderProps } from "../../../provider.js";
|
|
4
4
|
import { Space } from "../../layout/Space.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { chain } from "../../../utils/react/chain.js";
|
|
3
3
|
import { Paragraph } from "../../content/Paragraph.js";
|
|
4
4
|
import { _Title } from "../../content/Title.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { AlertDialogZone } from "./AlertDialogZone.js";
|
|
3
3
|
import { createContext, useContext, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { Portal } from "../../portal/Portal.js";
|
|
3
3
|
import { DialogContainer } from "../Dialog/DialogContainer.js";
|
|
4
4
|
import { _AlertDialog } from "./AlertDialog.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { SlotProvider } from "../../../utils/react/Slots.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { _Modal } from "../Modal/Modal.js";
|
|
3
3
|
import { DialogContext } from "./context.js";
|
|
4
4
|
import { Children, isValidElement, useRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { _Title } from "../../content/Title.js";
|
|
3
3
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
4
4
|
import { ButtonGroup } from "../../actions/ButtonGroup/ButtonGroup.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from "../../../utils/react/useLayoutEffect.js";
|
|
3
3
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { usePopoverSync } from "../../../utils/react/usePopoverSync.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
4
4
|
import { DialogContainer } from "./DialogContainer.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { _Overlay } from "./Overlay.js";
|
|
4
4
|
import { _Underlay } from "./Underlay.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { DisplayTransition } from "../../helpers/DisplayTransition/DisplayTransition.js";
|
|
3
3
|
import { Provider, useProviderProps } from "../../../provider.js";
|
|
4
4
|
import { OpenTransitionContext } from "./OpenTransitionContext.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { _Overlay } from "./Overlay.js";
|
|
4
4
|
import { tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { _Overlay } from "./Overlay.js";
|
|
4
4
|
import { _Underlay } from "./Underlay.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { ItemAction } from "../../actions/ItemAction/ItemAction.js";
|
|
4
4
|
import { createContext, useContext, useMemo } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { Block } from "../../Block.js";
|
|
3
3
|
import { ItemActionProvider } from "../../actions/ItemActionContext.js";
|
|
4
4
|
import { Space } from "../../layout/Space.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { NotificationCard } from "./NotificationCard.js";
|
|
4
4
|
import { tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from "../../../utils/react/useLayoutEffect.js";
|
|
3
3
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
4
4
|
import { DisplayTransition } from "../../helpers/DisplayTransition/DisplayTransition.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { NotificationContext, PersistentNotificationsContext, ToastContext, useNotificationContext, useToastContext } from "./NotificationContext.js";
|
|
3
3
|
import { OverlayContainer } from "./OverlayContainer.js";
|
|
4
4
|
import { useNotificationState } from "./use-notification-state.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { _Text } from "../../content/Text.js";
|
|
4
4
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
//#region src/components/overlays/Notifications/dismissed-storage.ts
|
|
3
3
|
const STORAGE_KEY = "cube-ui-dismissed-notifications";
|
|
4
4
|
const TTL_MS = 864e5;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.160.0 | Cube Dev Team */
|
|
2
2
|
import { useToastContext } from "./NotificationContext.js";
|
|
3
3
|
import { NotificationAction } from "./NotificationAction.js";
|
|
4
4
|
import { NotificationCard } from "./NotificationCard.js";
|