@wordpress/components 25.1.0 → 25.1.2
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/CHANGELOG.md +29 -1
- package/README.md +1 -1
- package/build/alignment-matrix-control/cell.js +4 -5
- package/build/alignment-matrix-control/cell.js.map +1 -1
- package/build/alignment-matrix-control/icon.js +2 -4
- package/build/alignment-matrix-control/icon.js.map +1 -1
- package/build/alignment-matrix-control/index.js +6 -7
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/angle-picker-control/angle-circle.js +4 -7
- package/build/angle-picker-control/angle-circle.js.map +1 -1
- package/build/angle-picker-control/index.js +2 -4
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +28 -1
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/index.js +0 -20
- package/build/autocomplete/index.js.map +1 -1
- package/build/base-control/index.js +2 -4
- package/build/base-control/index.js.map +1 -1
- package/build/border-box-control/border-box-control/component.js +4 -6
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control-linked-button/component.js +2 -4
- package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/component.js +15 -13
- package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build/border-box-control/border-box-control-visualizer/component.js +2 -6
- package/build/border-box-control/border-box-control-visualizer/component.js.map +1 -1
- package/build/border-control/border-control/component.js +4 -6
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +4 -6
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/border-control-style-picker/component.js +2 -4
- package/build/border-control/border-control-style-picker/component.js.map +1 -1
- package/build/box-control/all-input-control.js +2 -4
- package/build/box-control/all-input-control.js.map +1 -1
- package/build/box-control/axial-input-controls.js +2 -4
- package/build/box-control/axial-input-controls.js.map +1 -1
- package/build/box-control/icon.js +4 -7
- package/build/box-control/icon.js.map +1 -1
- package/build/box-control/index.js +7 -6
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/input-controls.js +2 -4
- package/build/box-control/input-controls.js.map +1 -1
- package/build/box-control/linked-button.js +2 -4
- package/build/box-control/linked-button.js.map +1 -1
- package/build/box-control/unit-control.js +6 -6
- package/build/box-control/unit-control.js.map +1 -1
- package/build/button/deprecated.js +2 -4
- package/build/button/deprecated.js.map +1 -1
- package/build/button/index.js +20 -7
- package/build/button/index.js.map +1 -1
- package/build/button-group/index.js +4 -5
- package/build/button-group/index.js.map +1 -1
- package/build/card/card/component.js +2 -4
- package/build/card/card/component.js.map +1 -1
- package/build/card/card-body/component.js +4 -8
- package/build/card/card-body/component.js.map +1 -1
- package/build/card/card-divider/component.js +2 -6
- package/build/card/card-divider/component.js.map +1 -1
- package/build/card/card-footer/component.js +2 -6
- package/build/card/card-footer/component.js.map +1 -1
- package/build/card/card-header/component.js +2 -6
- package/build/card/card-header/component.js.map +1 -1
- package/build/card/card-media/component.js +2 -6
- package/build/card/card-media/component.js.map +1 -1
- package/build/checkbox-control/index.js +4 -5
- package/build/checkbox-control/index.js.map +1 -1
- package/build/circular-option-picker/index.js +19 -16
- package/build/circular-option-picker/index.js.map +1 -1
- package/build/clipboard-button/index.js +9 -20
- package/build/clipboard-button/index.js.map +1 -1
- package/build/clipboard-button/types.js +6 -0
- package/build/clipboard-button/types.js.map +1 -0
- package/build/color-control/index.native.js +4 -5
- package/build/color-control/index.native.js.map +1 -1
- package/build/color-indicator/index.js +4 -5
- package/build/color-indicator/index.js.map +1 -1
- package/build/color-palette/index.js +11 -11
- package/build/color-palette/index.js.map +1 -1
- package/build/color-picker/color-input.js +6 -3
- package/build/color-picker/color-input.js.map +1 -1
- package/build/color-picker/component.js +4 -5
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/legacy-adapter.js +2 -1
- package/build/color-picker/legacy-adapter.js.map +1 -1
- package/build/confirm-dialog/component.js +13 -6
- package/build/confirm-dialog/component.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.js +8 -8
- package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build/custom-select-control/index.js +34 -32
- package/build/custom-select-control/index.js.map +1 -1
- package/build/dashicon/index.js +4 -7
- package/build/dashicon/index.js.map +1 -1
- package/build/dashicon/index.native.js +4 -7
- package/build/dashicon/index.native.js.map +1 -1
- package/build/disabled/index.js +4 -7
- package/build/disabled/index.js.map +1 -1
- package/build/divider/component.js +4 -8
- package/build/divider/component.js.map +1 -1
- package/build/drop-zone/index.js +2 -4
- package/build/drop-zone/index.js.map +1 -1
- package/build/dropdown/dropdown-content-wrapper.js +2 -6
- package/build/dropdown/dropdown-content-wrapper.js.map +1 -1
- package/build/dropdown/index.js +29 -24
- package/build/dropdown/index.js.map +1 -1
- package/build/dropdown-menu/index.js +98 -93
- package/build/dropdown-menu/index.js.map +1 -1
- package/build/dropdown-menu/index.native.js +2 -4
- package/build/dropdown-menu/index.native.js.map +1 -1
- package/build/dropdown-menu-v2/index.js +14 -12
- package/build/dropdown-menu-v2/index.js.map +1 -1
- package/build/dropdown-menu-v2/styles.js +16 -16
- package/build/dropdown-menu-v2/styles.js.map +1 -1
- package/build/elevation/component.js +2 -6
- package/build/elevation/component.js.map +1 -1
- package/build/external-link/index.js +2 -4
- package/build/external-link/index.js.map +1 -1
- package/build/flex/flex/component.js +2 -6
- package/build/flex/flex/component.js.map +1 -1
- package/build/flex/flex-block/component.js +2 -6
- package/build/flex/flex-block/component.js.map +1 -1
- package/build/flex/flex-item/component.js +2 -6
- package/build/flex/flex-item/component.js.map +1 -1
- package/build/focal-point-picker/controls.js +4 -7
- package/build/focal-point-picker/controls.js.map +1 -1
- package/build/focal-point-picker/focal-point.js +2 -4
- package/build/focal-point-picker/focal-point.js.map +1 -1
- package/build/focal-point-picker/grid.js +2 -6
- package/build/focal-point-picker/grid.js.map +1 -1
- package/build/focal-point-picker/index.js +4 -6
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/focal-point-picker/index.native.js +2 -4
- package/build/focal-point-picker/index.native.js.map +1 -1
- package/build/focal-point-picker/media.js +7 -10
- package/build/focal-point-picker/media.js.map +1 -1
- package/build/focal-point-picker/tooltip/index.native.js +2 -4
- package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build/focusable-iframe/index.js +4 -5
- package/build/focusable-iframe/index.js.map +1 -1
- package/build/font-size-picker/index.js +5 -3
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/styles.js +19 -26
- package/build/font-size-picker/styles.js.map +1 -1
- package/build/footer-message-control/index.native.js +2 -1
- package/build/footer-message-control/index.native.js.map +1 -1
- package/build/form-file-upload/index.js +4 -5
- package/build/form-file-upload/index.js.map +1 -1
- package/build/form-toggle/index.js +4 -5
- package/build/form-toggle/index.js.map +1 -1
- package/build/form-token-field/index.js +4 -5
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/token-input.js +4 -6
- package/build/form-token-field/token-input.js.map +1 -1
- package/build/gradient-picker/index.js +14 -12
- package/build/gradient-picker/index.js.map +1 -1
- package/build/grid/component.js +2 -4
- package/build/grid/component.js.map +1 -1
- package/build/guide/page.js +2 -1
- package/build/guide/page.js.map +1 -1
- package/build/h-stack/component.js +2 -6
- package/build/h-stack/component.js.map +1 -1
- package/build/h-stack/hook.js +4 -7
- package/build/h-stack/hook.js.map +1 -1
- package/build/heading/component.js +2 -6
- package/build/heading/component.js.map +1 -1
- package/build/higher-order/navigate-regions/index.js +3 -1
- package/build/higher-order/navigate-regions/index.js.map +1 -1
- package/build/higher-order/with-constrained-tabbing/index.js +2 -1
- package/build/higher-order/with-constrained-tabbing/index.js.map +1 -1
- package/build/higher-order/with-fallback-styles/index.js +3 -3
- package/build/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build/higher-order/with-filters/index.js +2 -1
- package/build/higher-order/with-filters/index.js.map +1 -1
- package/build/higher-order/with-focus-outside/index.js +5 -7
- package/build/higher-order/with-focus-outside/index.js.map +1 -1
- package/build/higher-order/with-focus-outside/index.native.js +5 -7
- package/build/higher-order/with-focus-outside/index.native.js.map +1 -1
- package/build/higher-order/with-focus-return/index.js +2 -1
- package/build/higher-order/with-focus-return/index.js.map +1 -1
- package/build/higher-order/with-notices/index.js +3 -4
- package/build/higher-order/with-notices/index.js.map +1 -1
- package/build/higher-order/with-spoken-messages/index.js +2 -6
- package/build/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build/icon/index.js +6 -6
- package/build/icon/index.js.map +1 -1
- package/build/input-control/index.js +5 -5
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js +3 -4
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/input-field.js +3 -6
- package/build/input-control/input-field.js.map +1 -1
- package/build/input-control/input-prefix-wrapper.js +4 -8
- package/build/input-control/input-prefix-wrapper.js.map +1 -1
- package/build/input-control/input-suffix-wrapper.js +4 -8
- package/build/input-control/input-suffix-wrapper.js.map +1 -1
- package/build/input-control/label.js +4 -7
- package/build/input-control/label.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +2 -4
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/isolated-event-container/index.js +2 -4
- package/build/isolated-event-container/index.js.map +1 -1
- package/build/item-group/item/component.js +2 -6
- package/build/item-group/item/component.js.map +1 -1
- package/build/item-group/item-group/component.js +2 -6
- package/build/item-group/item-group/component.js.map +1 -1
- package/build/item-group/styles.js +10 -10
- package/build/item-group/styles.js.map +1 -1
- package/build/menu-item/index.js +4 -5
- package/build/menu-item/index.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +4 -6
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +2 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js +5 -6
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/color-cell.native.js +2 -4
- package/build/mobile/bottom-sheet/color-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cycle-picker-cell.native.js +4 -5
- package/build/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/footer-message-cell.native.js +2 -4
- package/build/mobile/bottom-sheet/footer-message-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/index.native.js +8 -8
- package/build/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +4 -7
- package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +2 -4
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/picker-cell.native.js +4 -5
- package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/radio-cell.native.js +2 -4
- package/build/mobile/bottom-sheet/radio-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/range-cell.native.js +2 -4
- package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/ripple.native.js +4 -6
- package/build/mobile/bottom-sheet/ripple.native.js.map +1 -1
- package/build/mobile/bottom-sheet/switch-cell.native.js +2 -4
- package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build/mobile/color-settings/index.native.js +5 -5
- package/build/mobile/color-settings/index.native.js.map +1 -1
- package/build/mobile/cycle-select-control/index.native.js +4 -5
- package/build/mobile/cycle-select-control/index.native.js.map +1 -1
- package/build/mobile/focal-point-settings-panel/index.native.js +5 -5
- package/build/mobile/focal-point-settings-panel/index.native.js.map +1 -1
- package/build/mobile/global-styles-context/index.native.js +2 -6
- package/build/mobile/global-styles-context/index.native.js.map +1 -1
- package/build/mobile/gradient/index.native.js +4 -5
- package/build/mobile/gradient/index.native.js.map +1 -1
- package/build/mobile/image/image-editing-button.native.js +4 -5
- package/build/mobile/image/image-editing-button.native.js.map +1 -1
- package/build/mobile/image/index.native.js +15 -15
- package/build/mobile/image/index.native.js.map +1 -1
- package/build/mobile/keyboard-avoiding-view/index.ios.js +2 -4
- package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.android.js +4 -5
- package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.ios.js +2 -1
- package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build/mobile/link-picker/link-picker-results.native.js +4 -6
- package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build/mobile/link-settings/link-settings-navigation.native.js +4 -5
- package/build/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
- package/build/mobile/link-settings/link-settings-screen.native.js +2 -4
- package/build/mobile/link-settings/link-settings-screen.native.js.map +1 -1
- package/build/mobile/picker/index.ios.js +4 -6
- package/build/mobile/picker/index.ios.js.map +1 -1
- package/build/mobile/segmented-control/index.native.js +4 -5
- package/build/mobile/segmented-control/index.native.js.map +1 -1
- package/build/modal/index.js +4 -6
- package/build/modal/index.js.map +1 -1
- package/build/navigable-container/container.js +6 -9
- package/build/navigable-container/container.js.map +1 -1
- package/build/navigable-container/menu.js +4 -5
- package/build/navigable-container/menu.js.map +1 -1
- package/build/navigable-container/tabbable.js +4 -5
- package/build/navigable-container/tabbable.js.map +1 -1
- package/build/navigation/item/base.js +4 -5
- package/build/navigation/item/base.js.map +1 -1
- package/build/navigation/item/index.js +3 -4
- package/build/navigation/item/index.js.map +1 -1
- package/build/navigator/navigator-back-button/component.js +4 -7
- package/build/navigator/navigator-back-button/component.js.map +1 -1
- package/build/navigator/navigator-button/component.js +4 -7
- package/build/navigator/navigator-button/component.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +4 -5
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +9 -10
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/navigator/navigator-to-parent-button/component.js +4 -7
- package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
- package/build/notice/list.js +2 -4
- package/build/notice/list.js.map +1 -1
- package/build/notice/list.native.js +2 -4
- package/build/notice/list.native.js.map +1 -1
- package/build/number-control/index.js +12 -10
- package/build/number-control/index.js.map +1 -1
- package/build/number-control/styles/number-control-styles.js +9 -15
- package/build/number-control/styles/number-control-styles.js.map +1 -1
- package/build/palette-edit/index.js +11 -12
- package/build/palette-edit/index.js.map +1 -1
- package/build/panel/body.js +8 -8
- package/build/panel/body.js.map +1 -1
- package/build/placeholder/index.js +2 -4
- package/build/placeholder/index.js.map +1 -1
- package/build/popover/index.js +11 -12
- package/build/popover/index.js.map +1 -1
- package/build/popover/utils.js +15 -1
- package/build/popover/utils.js.map +1 -1
- package/build/query-controls/category-select.js +4 -6
- package/build/query-controls/category-select.js.map +1 -1
- package/build/radio-control/index.js +4 -5
- package/build/radio-control/index.js.map +1 -1
- package/build/radio-control/index.native.js +4 -5
- package/build/radio-control/index.native.js.map +1 -1
- package/build/radio-group/index.js +5 -5
- package/build/radio-group/index.js.map +1 -1
- package/build/radio-group/radio/index.js +5 -5
- package/build/radio-group/radio/index.js.map +1 -1
- package/build/range-control/index.js +2 -4
- package/build/range-control/index.js.map +1 -1
- package/build/range-control/index.native.js +4 -5
- package/build/range-control/index.native.js.map +1 -1
- package/build/range-control/input-range.js +2 -6
- package/build/range-control/input-range.js.map +1 -1
- package/build/range-control/mark.js +2 -4
- package/build/range-control/mark.js.map +1 -1
- package/build/range-control/rail.js +6 -7
- package/build/range-control/rail.js.map +1 -1
- package/build/range-control/tooltip.js +2 -4
- package/build/range-control/tooltip.js.map +1 -1
- package/build/resizable-box/index.js +5 -5
- package/build/resizable-box/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/index.js +4 -5
- package/build/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/label.js +4 -7
- package/build/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build/scrollable/component.js +2 -6
- package/build/scrollable/component.js.map +1 -1
- package/build/search-control/index.js +2 -4
- package/build/search-control/index.js.map +1 -1
- package/build/select-control/index.js +4 -5
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/index.native.js +4 -5
- package/build/select-control/index.native.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot.js +4 -5
- package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build/slot-fill/index.js +17 -13
- package/build/slot-fill/index.js.map +1 -1
- package/build/slot-fill/index.native.js +10 -9
- package/build/slot-fill/index.native.js.map +1 -1
- package/build/slot-fill/slot.js +2 -4
- package/build/slot-fill/slot.js.map +1 -1
- package/build/snackbar/list.js +2 -4
- package/build/snackbar/list.js.map +1 -1
- package/build/spacer/component.js +2 -6
- package/build/spacer/component.js.map +1 -1
- package/build/spinner/index.js +4 -6
- package/build/spinner/index.js.map +1 -1
- package/build/surface/component.js +2 -6
- package/build/surface/component.js.map +1 -1
- package/build/tab-panel/index.js +4 -5
- package/build/tab-panel/index.js.map +1 -1
- package/build/text/component.js +4 -6
- package/build/text/component.js.map +1 -1
- package/build/text-control/index.js +4 -5
- package/build/text-control/index.js.map +1 -1
- package/build/text-control/index.native.js +4 -5
- package/build/text-control/index.native.js.map +1 -1
- package/build/textarea-control/index.js +4 -5
- package/build/textarea-control/index.js.map +1 -1
- package/build/theme/index.js +4 -7
- package/build/theme/index.js.map +1 -1
- package/build/toggle-control/index.native.js +4 -5
- package/build/toggle-control/index.native.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-button-group.js +4 -6
- package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js +4 -6
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +2 -4
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option/component.js +2 -6
- package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js +6 -7
- package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-icon/component.js +2 -4
- package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
- package/build/toolbar/toolbar/index.js +9 -13
- package/build/toolbar/toolbar/index.js.map +1 -1
- package/build/toolbar/toolbar/toolbar-container.js +9 -13
- package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
- package/build/toolbar/toolbar-button/index.js +13 -11
- package/build/toolbar/toolbar-button/index.js.map +1 -1
- package/build/toolbar/toolbar-context/index.js.map +1 -1
- package/build/toolbar/toolbar-dropdown-menu/index.js +8 -10
- package/build/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
- package/build/toolbar/toolbar-group/index.js +11 -10
- package/build/toolbar/toolbar-group/index.js.map +1 -1
- package/build/toolbar/toolbar-group/toolbar-group-collapsed.js +6 -6
- package/build/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
- package/build/toolbar/toolbar-group/toolbar-group-collapsed.native.js +4 -5
- package/build/toolbar/toolbar-group/toolbar-group-collapsed.native.js.map +1 -1
- package/build/toolbar/toolbar-group/toolbar-group-container.js +4 -7
- package/build/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
- package/build/toolbar/toolbar-item/index.js +13 -11
- package/build/toolbar/toolbar-item/index.js.map +1 -1
- package/build/toolbar/toolbar-item/types.js +6 -0
- package/build/toolbar/toolbar-item/types.js.map +1 -0
- package/build/tools-panel/tools-panel/component.js +2 -4
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +2 -4
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tools-panel/tools-panel-item/component.js +4 -8
- package/build/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build/tooltip/index.js +4 -5
- package/build/tooltip/index.js.map +1 -1
- package/build/tooltip/index.native.js +2 -1
- package/build/tooltip/index.native.js.map +1 -1
- package/build/tree-grid/cell.js +2 -4
- package/build/tree-grid/cell.js.map +1 -1
- package/build/tree-grid/index.js +2 -4
- package/build/tree-grid/index.js.map +1 -1
- package/build/tree-grid/item.js +4 -5
- package/build/tree-grid/item.js.map +1 -1
- package/build/tree-grid/roving-tab-index-item.js +2 -1
- package/build/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build/tree-grid/row.js +2 -6
- package/build/tree-grid/row.js.map +1 -1
- package/build/tree-select/index.js +4 -7
- package/build/tree-select/index.js.map +1 -1
- package/build/truncate/component.js +4 -6
- package/build/truncate/component.js.map +1 -1
- package/build/ui/control-group/component.js +8 -12
- package/build/ui/control-group/component.js.map +1 -1
- package/build/ui/control-label/component.js +4 -8
- package/build/ui/control-label/component.js.map +1 -1
- package/build/ui/form-group/form-group-content.js +4 -5
- package/build/ui/form-group/form-group-content.js.map +1 -1
- package/build/ui/form-group/form-group-label.js +2 -1
- package/build/ui/form-group/form-group-label.js.map +1 -1
- package/build/ui/form-group/form-group.js +8 -8
- package/build/ui/form-group/form-group.js.map +1 -1
- package/build/ui/shortcut/component.js +4 -7
- package/build/ui/shortcut/component.js.map +1 -1
- package/build/ui/spinner/component.js +2 -6
- package/build/ui/spinner/component.js.map +1 -1
- package/build/ui/tooltip/component.js +3 -4
- package/build/ui/tooltip/component.js.map +1 -1
- package/build/ui/tooltip/content.js +5 -8
- package/build/ui/tooltip/content.js.map +1 -1
- package/build/unit-control/index.js +31 -94
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/index.native.js +7 -7
- package/build/unit-control/index.native.js.map +1 -1
- package/build/unit-control/unit-select-control.js +15 -7
- package/build/unit-control/unit-select-control.js.map +1 -1
- package/build/v-stack/component.js +2 -6
- package/build/v-stack/component.js.map +1 -1
- package/build/visually-hidden/component.js +4 -8
- package/build/visually-hidden/component.js.map +1 -1
- package/build/z-stack/component.js +7 -9
- package/build/z-stack/component.js.map +1 -1
- package/build/z-stack/styles.js +23 -42
- package/build/z-stack/styles.js.map +1 -1
- package/build-module/alignment-matrix-control/cell.js +4 -4
- package/build-module/alignment-matrix-control/cell.js.map +1 -1
- package/build-module/alignment-matrix-control/icon.js +2 -3
- package/build-module/alignment-matrix-control/icon.js.map +1 -1
- package/build-module/alignment-matrix-control/index.js +6 -6
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/angle-picker-control/angle-circle.js +4 -4
- package/build-module/angle-picker-control/angle-circle.js.map +1 -1
- package/build-module/angle-picker-control/index.js +2 -3
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +27 -2
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/index.js +1 -19
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/base-control/index.js +2 -3
- package/build-module/base-control/index.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js +4 -5
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-linked-button/component.js +2 -3
- package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js +15 -12
- package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-visualizer/component.js +2 -3
- package/build-module/border-box-control/border-box-control-visualizer/component.js.map +1 -1
- package/build-module/border-control/border-control/component.js +4 -5
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +4 -5
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/border-control-style-picker/component.js +2 -3
- package/build-module/border-control/border-control-style-picker/component.js.map +1 -1
- package/build-module/box-control/all-input-control.js +2 -3
- package/build-module/box-control/all-input-control.js.map +1 -1
- package/build-module/box-control/axial-input-controls.js +2 -3
- package/build-module/box-control/axial-input-controls.js.map +1 -1
- package/build-module/box-control/icon.js +4 -4
- package/build-module/box-control/icon.js.map +1 -1
- package/build-module/box-control/index.js +7 -5
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-controls.js +2 -3
- package/build-module/box-control/input-controls.js.map +1 -1
- package/build-module/box-control/linked-button.js +2 -3
- package/build-module/box-control/linked-button.js.map +1 -1
- package/build-module/box-control/unit-control.js +6 -5
- package/build-module/box-control/unit-control.js.map +1 -1
- package/build-module/button/deprecated.js +2 -3
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/index.js +20 -6
- package/build-module/button/index.js.map +1 -1
- package/build-module/button-group/index.js +4 -4
- package/build-module/button-group/index.js.map +1 -1
- package/build-module/card/card/component.js +2 -3
- package/build-module/card/card/component.js.map +1 -1
- package/build-module/card/card-body/component.js +4 -5
- package/build-module/card/card-body/component.js.map +1 -1
- package/build-module/card/card-divider/component.js +2 -3
- package/build-module/card/card-divider/component.js.map +1 -1
- package/build-module/card/card-footer/component.js +2 -3
- package/build-module/card/card-footer/component.js.map +1 -1
- package/build-module/card/card-header/component.js +2 -3
- package/build-module/card/card-header/component.js.map +1 -1
- package/build-module/card/card-media/component.js +2 -3
- package/build-module/card/card-media/component.js.map +1 -1
- package/build-module/checkbox-control/index.js +4 -4
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/circular-option-picker/index.js +19 -15
- package/build-module/circular-option-picker/index.js.map +1 -1
- package/build-module/clipboard-button/index.js +9 -20
- package/build-module/clipboard-button/index.js.map +1 -1
- package/build-module/clipboard-button/types.js +2 -0
- package/build-module/clipboard-button/types.js.map +1 -0
- package/build-module/color-control/index.native.js +4 -4
- package/build-module/color-control/index.native.js.map +1 -1
- package/build-module/color-indicator/index.js +4 -4
- package/build-module/color-indicator/index.js.map +1 -1
- package/build-module/color-palette/index.js +11 -10
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-picker/color-input.js +6 -3
- package/build-module/color-picker/color-input.js.map +1 -1
- package/build-module/color-picker/component.js +4 -4
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/legacy-adapter.js +2 -1
- package/build-module/color-picker/legacy-adapter.js.map +1 -1
- package/build-module/confirm-dialog/component.js +14 -6
- package/build-module/confirm-dialog/component.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +8 -7
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-select-control/index.js +34 -31
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/dashicon/index.js +4 -4
- package/build-module/dashicon/index.js.map +1 -1
- package/build-module/dashicon/index.native.js +4 -4
- package/build-module/dashicon/index.native.js.map +1 -1
- package/build-module/disabled/index.js +4 -4
- package/build-module/disabled/index.js.map +1 -1
- package/build-module/divider/component.js +4 -5
- package/build-module/divider/component.js.map +1 -1
- package/build-module/drop-zone/index.js +2 -3
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/dropdown/dropdown-content-wrapper.js +2 -3
- package/build-module/dropdown/dropdown-content-wrapper.js.map +1 -1
- package/build-module/dropdown/index.js +29 -24
- package/build-module/dropdown/index.js.map +1 -1
- package/build-module/dropdown-menu/index.js +95 -91
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/dropdown-menu/index.native.js +2 -3
- package/build-module/dropdown-menu/index.native.js.map +1 -1
- package/build-module/dropdown-menu-v2/index.js +14 -11
- package/build-module/dropdown-menu-v2/index.js.map +1 -1
- package/build-module/dropdown-menu-v2/styles.js +16 -16
- package/build-module/dropdown-menu-v2/styles.js.map +1 -1
- package/build-module/elevation/component.js +2 -3
- package/build-module/elevation/component.js.map +1 -1
- package/build-module/external-link/index.js +2 -3
- package/build-module/external-link/index.js.map +1 -1
- package/build-module/flex/flex/component.js +2 -3
- package/build-module/flex/flex/component.js.map +1 -1
- package/build-module/flex/flex-block/component.js +2 -3
- package/build-module/flex/flex-block/component.js.map +1 -1
- package/build-module/flex/flex-item/component.js +2 -3
- package/build-module/flex/flex-item/component.js.map +1 -1
- package/build-module/focal-point-picker/controls.js +4 -4
- package/build-module/focal-point-picker/controls.js.map +1 -1
- package/build-module/focal-point-picker/focal-point.js +2 -3
- package/build-module/focal-point-picker/focal-point.js.map +1 -1
- package/build-module/focal-point-picker/grid.js +2 -3
- package/build-module/focal-point-picker/grid.js.map +1 -1
- package/build-module/focal-point-picker/index.js +4 -5
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/focal-point-picker/index.native.js +2 -3
- package/build-module/focal-point-picker/index.native.js.map +1 -1
- package/build-module/focal-point-picker/media.js +7 -7
- package/build-module/focal-point-picker/media.js.map +1 -1
- package/build-module/focal-point-picker/tooltip/index.native.js +2 -3
- package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build-module/focusable-iframe/index.js +4 -4
- package/build-module/focusable-iframe/index.js.map +1 -1
- package/build-module/font-size-picker/index.js +5 -4
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/styles.js +17 -23
- package/build-module/font-size-picker/styles.js.map +1 -1
- package/build-module/footer-message-control/index.native.js +2 -1
- package/build-module/footer-message-control/index.native.js.map +1 -1
- package/build-module/form-file-upload/index.js +4 -4
- package/build-module/form-file-upload/index.js.map +1 -1
- package/build-module/form-toggle/index.js +4 -4
- package/build-module/form-toggle/index.js.map +1 -1
- package/build-module/form-token-field/index.js +4 -4
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/token-input.js +4 -5
- package/build-module/form-token-field/token-input.js.map +1 -1
- package/build-module/gradient-picker/index.js +14 -11
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/grid/component.js +2 -3
- package/build-module/grid/component.js.map +1 -1
- package/build-module/guide/page.js +2 -1
- package/build-module/guide/page.js.map +1 -1
- package/build-module/h-stack/component.js +2 -3
- package/build-module/h-stack/component.js.map +1 -1
- package/build-module/h-stack/hook.js +4 -4
- package/build-module/h-stack/hook.js.map +1 -1
- package/build-module/heading/component.js +2 -3
- package/build-module/heading/component.js.map +1 -1
- package/build-module/higher-order/navigate-regions/index.js +3 -1
- package/build-module/higher-order/navigate-regions/index.js.map +1 -1
- package/build-module/higher-order/with-constrained-tabbing/index.js +2 -1
- package/build-module/higher-order/with-constrained-tabbing/index.js.map +1 -1
- package/build-module/higher-order/with-fallback-styles/index.js +3 -2
- package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build-module/higher-order/with-filters/index.js +2 -1
- package/build-module/higher-order/with-filters/index.js.map +1 -1
- package/build-module/higher-order/with-focus-outside/index.js +5 -4
- package/build-module/higher-order/with-focus-outside/index.js.map +1 -1
- package/build-module/higher-order/with-focus-outside/index.native.js +5 -4
- package/build-module/higher-order/with-focus-outside/index.native.js.map +1 -1
- package/build-module/higher-order/with-focus-return/index.js +2 -1
- package/build-module/higher-order/with-focus-return/index.js.map +1 -1
- package/build-module/higher-order/with-notices/index.js +3 -3
- package/build-module/higher-order/with-notices/index.js.map +1 -1
- package/build-module/higher-order/with-spoken-messages/index.js +2 -3
- package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build-module/icon/index.js +6 -6
- package/build-module/icon/index.js.map +1 -1
- package/build-module/input-control/index.js +5 -4
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js +3 -3
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/input-field.js +3 -3
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/input-control/input-prefix-wrapper.js +4 -5
- package/build-module/input-control/input-prefix-wrapper.js.map +1 -1
- package/build-module/input-control/input-suffix-wrapper.js +4 -5
- package/build-module/input-control/input-suffix-wrapper.js.map +1 -1
- package/build-module/input-control/label.js +4 -4
- package/build-module/input-control/label.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +2 -3
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/isolated-event-container/index.js +2 -3
- package/build-module/isolated-event-container/index.js.map +1 -1
- package/build-module/item-group/item/component.js +2 -3
- package/build-module/item-group/item/component.js.map +1 -1
- package/build-module/item-group/item-group/component.js +2 -3
- package/build-module/item-group/item-group/component.js.map +1 -1
- package/build-module/item-group/styles.js +10 -10
- package/build-module/item-group/styles.js.map +1 -1
- package/build-module/menu-item/index.js +4 -4
- package/build-module/menu-item/index.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +4 -5
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +2 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js +5 -5
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/color-cell.native.js +2 -3
- package/build-module/mobile/bottom-sheet/color-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js +4 -4
- package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/footer-message-cell.native.js +2 -3
- package/build-module/mobile/bottom-sheet/footer-message-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js +8 -7
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js +4 -4
- package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +2 -3
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/picker-cell.native.js +4 -4
- package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/radio-cell.native.js +2 -3
- package/build-module/mobile/bottom-sheet/radio-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-cell.native.js +2 -3
- package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/ripple.native.js +4 -5
- package/build-module/mobile/bottom-sheet/ripple.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/switch-cell.native.js +2 -3
- package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js +5 -4
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/cycle-select-control/index.native.js +4 -4
- package/build-module/mobile/cycle-select-control/index.native.js.map +1 -1
- package/build-module/mobile/focal-point-settings-panel/index.native.js +5 -4
- package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/index.native.js +2 -3
- package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
- package/build-module/mobile/gradient/index.native.js +4 -4
- package/build-module/mobile/gradient/index.native.js.map +1 -1
- package/build-module/mobile/image/image-editing-button.native.js +4 -4
- package/build-module/mobile/image/image-editing-button.native.js.map +1 -1
- package/build-module/mobile/image/index.native.js +15 -14
- package/build-module/mobile/image/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js +2 -3
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.android.js +4 -4
- package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +2 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build-module/mobile/link-picker/link-picker-results.native.js +4 -5
- package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build-module/mobile/link-settings/link-settings-navigation.native.js +4 -4
- package/build-module/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
- package/build-module/mobile/link-settings/link-settings-screen.native.js +2 -3
- package/build-module/mobile/link-settings/link-settings-screen.native.js.map +1 -1
- package/build-module/mobile/picker/index.ios.js +4 -5
- package/build-module/mobile/picker/index.ios.js.map +1 -1
- package/build-module/mobile/segmented-control/index.native.js +4 -4
- package/build-module/mobile/segmented-control/index.native.js.map +1 -1
- package/build-module/modal/index.js +4 -5
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigable-container/container.js +6 -6
- package/build-module/navigable-container/container.js.map +1 -1
- package/build-module/navigable-container/menu.js +4 -4
- package/build-module/navigable-container/menu.js.map +1 -1
- package/build-module/navigable-container/tabbable.js +4 -4
- package/build-module/navigable-container/tabbable.js.map +1 -1
- package/build-module/navigation/item/base.js +4 -4
- package/build-module/navigation/item/base.js.map +1 -1
- package/build-module/navigation/item/index.js +3 -3
- package/build-module/navigation/item/index.js.map +1 -1
- package/build-module/navigator/navigator-back-button/component.js +4 -4
- package/build-module/navigator/navigator-back-button/component.js.map +1 -1
- package/build-module/navigator/navigator-button/component.js +4 -4
- package/build-module/navigator/navigator-button/component.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +4 -4
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +9 -7
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/navigator/navigator-to-parent-button/component.js +4 -4
- package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -1
- package/build-module/notice/list.js +2 -3
- package/build-module/notice/list.js.map +1 -1
- package/build-module/notice/list.native.js +2 -3
- package/build-module/notice/list.native.js.map +1 -1
- package/build-module/number-control/index.js +12 -10
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/number-control/styles/number-control-styles.js +7 -14
- package/build-module/number-control/styles/number-control-styles.js.map +1 -1
- package/build-module/palette-edit/index.js +11 -11
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/panel/body.js +8 -7
- package/build-module/panel/body.js.map +1 -1
- package/build-module/placeholder/index.js +2 -3
- package/build-module/placeholder/index.js.map +1 -1
- package/build-module/popover/index.js +12 -12
- package/build-module/popover/index.js.map +1 -1
- package/build-module/popover/utils.js +11 -0
- package/build-module/popover/utils.js.map +1 -1
- package/build-module/query-controls/category-select.js +4 -5
- package/build-module/query-controls/category-select.js.map +1 -1
- package/build-module/radio-control/index.js +4 -4
- package/build-module/radio-control/index.js.map +1 -1
- package/build-module/radio-control/index.native.js +4 -4
- package/build-module/radio-control/index.native.js.map +1 -1
- package/build-module/radio-group/index.js +5 -4
- package/build-module/radio-group/index.js.map +1 -1
- package/build-module/radio-group/radio/index.js +5 -4
- package/build-module/radio-group/radio/index.js.map +1 -1
- package/build-module/range-control/index.js +2 -3
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/range-control/index.native.js +4 -4
- package/build-module/range-control/index.native.js.map +1 -1
- package/build-module/range-control/input-range.js +2 -3
- package/build-module/range-control/input-range.js.map +1 -1
- package/build-module/range-control/mark.js +2 -3
- package/build-module/range-control/mark.js.map +1 -1
- package/build-module/range-control/rail.js +6 -6
- package/build-module/range-control/rail.js.map +1 -1
- package/build-module/range-control/tooltip.js +2 -3
- package/build-module/range-control/tooltip.js.map +1 -1
- package/build-module/resizable-box/index.js +5 -4
- package/build-module/resizable-box/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/index.js +4 -4
- package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/label.js +4 -4
- package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build-module/scrollable/component.js +2 -3
- package/build-module/scrollable/component.js.map +1 -1
- package/build-module/search-control/index.js +2 -3
- package/build-module/search-control/index.js.map +1 -1
- package/build-module/select-control/index.js +4 -4
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/index.native.js +4 -4
- package/build-module/select-control/index.native.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot.js +4 -4
- package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build-module/slot-fill/index.js +17 -12
- package/build-module/slot-fill/index.js.map +1 -1
- package/build-module/slot-fill/index.native.js +10 -8
- package/build-module/slot-fill/index.native.js.map +1 -1
- package/build-module/slot-fill/slot.js +2 -3
- package/build-module/slot-fill/slot.js.map +1 -1
- package/build-module/snackbar/list.js +2 -3
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/spacer/component.js +2 -3
- package/build-module/spacer/component.js.map +1 -1
- package/build-module/spinner/index.js +4 -5
- package/build-module/spinner/index.js.map +1 -1
- package/build-module/surface/component.js +2 -3
- package/build-module/surface/component.js.map +1 -1
- package/build-module/tab-panel/index.js +4 -4
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/text/component.js +4 -5
- package/build-module/text/component.js.map +1 -1
- package/build-module/text-control/index.js +4 -4
- package/build-module/text-control/index.js.map +1 -1
- package/build-module/text-control/index.native.js +4 -4
- package/build-module/text-control/index.native.js.map +1 -1
- package/build-module/textarea-control/index.js +4 -4
- package/build-module/textarea-control/index.js.map +1 -1
- package/build-module/theme/index.js +4 -4
- package/build-module/theme/index.js.map +1 -1
- package/build-module/toggle-control/index.native.js +4 -4
- package/build-module/toggle-control/index.native.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-button-group.js +4 -5
- package/build-module/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +4 -5
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +2 -3
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option/component.js +2 -3
- package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +6 -6
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +2 -3
- package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
- package/build-module/toolbar/toolbar/index.js +10 -13
- package/build-module/toolbar/toolbar/index.js.map +1 -1
- package/build-module/toolbar/toolbar/toolbar-container.js +9 -12
- package/build-module/toolbar/toolbar/toolbar-container.js.map +1 -1
- package/build-module/toolbar/toolbar-button/index.js +13 -10
- package/build-module/toolbar/toolbar-button/index.js.map +1 -1
- package/build-module/toolbar/toolbar-context/index.js.map +1 -1
- package/build-module/toolbar/toolbar-dropdown-menu/index.js +8 -9
- package/build-module/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
- package/build-module/toolbar/toolbar-group/index.js +11 -9
- package/build-module/toolbar/toolbar-group/index.js.map +1 -1
- package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js +6 -5
- package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
- package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.native.js +4 -4
- package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.native.js.map +1 -1
- package/build-module/toolbar/toolbar-group/toolbar-group-container.js +4 -4
- package/build-module/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
- package/build-module/toolbar/toolbar-item/index.js +13 -10
- package/build-module/toolbar/toolbar-item/index.js.map +1 -1
- package/build-module/toolbar/toolbar-item/types.js +2 -0
- package/build-module/toolbar/toolbar-item/types.js.map +1 -0
- package/build-module/tools-panel/tools-panel/component.js +2 -3
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +2 -3
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/component.js +4 -5
- package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build-module/tooltip/index.js +4 -4
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tooltip/index.native.js +2 -1
- package/build-module/tooltip/index.native.js.map +1 -1
- package/build-module/tree-grid/cell.js +2 -3
- package/build-module/tree-grid/cell.js.map +1 -1
- package/build-module/tree-grid/index.js +2 -3
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/tree-grid/item.js +4 -4
- package/build-module/tree-grid/item.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index-item.js +2 -1
- package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build-module/tree-grid/row.js +2 -3
- package/build-module/tree-grid/row.js.map +1 -1
- package/build-module/tree-select/index.js +4 -4
- package/build-module/tree-select/index.js.map +1 -1
- package/build-module/truncate/component.js +4 -5
- package/build-module/truncate/component.js.map +1 -1
- package/build-module/ui/control-group/component.js +8 -9
- package/build-module/ui/control-group/component.js.map +1 -1
- package/build-module/ui/control-label/component.js +4 -5
- package/build-module/ui/control-label/component.js.map +1 -1
- package/build-module/ui/form-group/form-group-content.js +4 -4
- package/build-module/ui/form-group/form-group-content.js.map +1 -1
- package/build-module/ui/form-group/form-group-label.js +2 -1
- package/build-module/ui/form-group/form-group-label.js.map +1 -1
- package/build-module/ui/form-group/form-group.js +8 -7
- package/build-module/ui/form-group/form-group.js.map +1 -1
- package/build-module/ui/shortcut/component.js +4 -4
- package/build-module/ui/shortcut/component.js.map +1 -1
- package/build-module/ui/spinner/component.js +2 -3
- package/build-module/ui/spinner/component.js.map +1 -1
- package/build-module/ui/tooltip/component.js +3 -3
- package/build-module/ui/tooltip/component.js.map +1 -1
- package/build-module/ui/tooltip/content.js +5 -5
- package/build-module/ui/tooltip/content.js.map +1 -1
- package/build-module/unit-control/index.js +31 -88
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/index.native.js +7 -6
- package/build-module/unit-control/index.native.js.map +1 -1
- package/build-module/unit-control/unit-select-control.js +19 -6
- package/build-module/unit-control/unit-select-control.js.map +1 -1
- package/build-module/v-stack/component.js +2 -3
- package/build-module/v-stack/component.js.map +1 -1
- package/build-module/visually-hidden/component.js +4 -5
- package/build-module/visually-hidden/component.js.map +1 -1
- package/build-module/z-stack/component.js +7 -6
- package/build-module/z-stack/component.js.map +1 -1
- package/build-module/z-stack/styles.js +22 -44
- package/build-module/z-stack/styles.js.map +1 -1
- package/build-style/style-rtl.css +16 -21
- package/build-style/style.css +16 -21
- package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/button/deprecated.d.ts +6 -6
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/button/stories/e2e/index.d.ts +1 -0
- package/build-types/button/stories/e2e/index.d.ts.map +1 -1
- package/build-types/button/types.d.ts +16 -9
- package/build-types/button/types.d.ts.map +1 -1
- package/build-types/circular-option-picker/types.d.ts +2 -2
- package/build-types/circular-option-picker/types.d.ts.map +1 -1
- package/build-types/clipboard-button/index.d.ts +4 -15
- package/build-types/clipboard-button/index.d.ts.map +1 -1
- package/build-types/clipboard-button/types.d.ts +11 -0
- package/build-types/clipboard-button/types.d.ts.map +1 -0
- package/build-types/confirm-dialog/component.d.ts.map +1 -1
- package/build-types/dropdown/index.d.ts +1 -1
- package/build-types/dropdown/index.d.ts.map +1 -1
- package/build-types/dropdown/types.d.ts +7 -0
- package/build-types/dropdown/types.d.ts.map +1 -1
- package/build-types/dropdown-menu/index.d.ts +1 -1
- package/build-types/dropdown-menu/index.d.ts.map +1 -1
- package/build-types/dropdown-menu/stories/index.d.ts +4 -3
- package/build-types/dropdown-menu/stories/index.d.ts.map +1 -1
- package/build-types/dropdown-menu/types.d.ts +7 -0
- package/build-types/dropdown-menu/types.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/styles.d.ts +4 -4
- package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/types.d.ts +2 -2
- package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
- package/build-types/font-size-picker/index.d.ts.map +1 -1
- package/build-types/font-size-picker/styles.d.ts +0 -6
- package/build-types/font-size-picker/styles.d.ts.map +1 -1
- package/build-types/item-group/styles.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/component.d.ts +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +1 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts +1 -1
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/styles/number-control-styles.d.ts +5 -3
- package/build-types/number-control/styles/number-control-styles.d.ts.map +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/stories/index.d.ts +0 -1
- package/build-types/popover/stories/index.d.ts.map +1 -1
- package/build-types/popover/utils.d.ts +10 -0
- package/build-types/popover/utils.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/types.d.ts +6 -0
- package/build-types/select-control/types.d.ts.map +1 -1
- package/build-types/toolbar/stories/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/index.d.ts +6 -6
- package/build-types/toolbar/toolbar-context/index.d.ts +2 -2
- package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-item/index.d.ts +4 -6
- package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-item/types.d.ts +17 -0
- package/build-types/toolbar/toolbar-item/types.d.ts.map +1 -0
- package/build-types/unit-control/index.d.ts +3 -6
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/stories/index.d.ts.map +1 -1
- package/build-types/unit-control/unit-select-control.d.ts +7 -6
- package/build-types/unit-control/unit-select-control.d.ts.map +1 -1
- package/build-types/z-stack/component.d.ts.map +1 -1
- package/build-types/z-stack/stories/index.d.ts.map +1 -1
- package/build-types/z-stack/styles.d.ts +5 -4
- package/build-types/z-stack/styles.d.ts.map +1 -1
- package/package.json +21 -20
- package/src/autocomplete/autocompleter-ui.tsx +44 -2
- package/src/autocomplete/index.tsx +2 -32
- package/src/box-control/test/index.tsx +28 -60
- package/src/button/README.md +15 -0
- package/src/button/index.tsx +11 -4
- package/src/button/stories/e2e/index.tsx +22 -0
- package/src/button/style.scss +18 -25
- package/src/button/test/index.tsx +13 -0
- package/src/button/types.ts +17 -9
- package/src/circular-option-picker/types.ts +2 -5
- package/src/clipboard-button/{index.js → index.tsx} +11 -17
- package/src/clipboard-button/types.ts +11 -0
- package/src/confirm-dialog/component.tsx +12 -2
- package/src/confirm-dialog/stories/index.js +8 -15
- package/src/confirm-dialog/test/index.js +42 -0
- package/src/dropdown/index.tsx +20 -10
- package/src/dropdown/types.ts +8 -0
- package/src/dropdown-menu/index.tsx +101 -85
- package/src/dropdown-menu/stories/index.tsx +1 -1
- package/src/dropdown-menu/types.ts +8 -0
- package/src/dropdown-menu-v2/index.tsx +2 -2
- package/src/dropdown-menu-v2/styles.ts +7 -5
- package/src/dropdown-menu-v2/types.ts +2 -2
- package/src/font-size-picker/index.tsx +9 -5
- package/src/font-size-picker/styles.ts +0 -10
- package/src/item-group/styles.ts +13 -5
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +16 -29
- package/src/mobile/bottom-sheet/cell.native.js +1 -1
- package/src/mobile/html-text-input/test/__snapshots__/index.native.js.snap +46 -0
- package/src/mobile/html-text-input/test/index.native.js +2 -2
- package/src/mobile/image/index.native.js +1 -1
- package/src/mobile/link-settings/test/link-settings-navigation.native.js +5 -16
- package/src/modal/style.scss +2 -2
- package/src/number-control/index.tsx +6 -3
- package/src/number-control/styles/number-control-styles.ts +8 -16
- package/src/popover/index.tsx +3 -2
- package/src/popover/stories/index.tsx +0 -13
- package/src/popover/test/index.tsx +22 -1
- package/src/popover/utils.ts +12 -0
- package/src/search-control/README.md +7 -1
- package/src/select-control/index.tsx +1 -0
- package/src/select-control/types.ts +6 -0
- package/src/toolbar/stories/index.tsx +0 -3
- package/src/toolbar/toolbar/index.tsx +3 -6
- package/src/toolbar/toolbar/toolbar-container.tsx +5 -9
- package/src/toolbar/toolbar-context/index.ts +2 -4
- package/src/toolbar/toolbar-dropdown-menu/index.js +0 -1
- package/src/toolbar/toolbar-item/index.tsx +13 -15
- package/src/toolbar/toolbar-item/types.ts +27 -0
- package/src/tooltip/test/index.native.js +1 -3
- package/src/unit-control/index.tsx +29 -95
- package/src/unit-control/stories/index.tsx +0 -4
- package/src/unit-control/test/index.tsx +151 -223
- package/src/unit-control/unit-select-control.tsx +20 -10
- package/src/z-stack/component.tsx +4 -2
- package/src/z-stack/stories/index.tsx +6 -13
- package/src/z-stack/styles.ts +23 -24
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -270,7 +270,8 @@ const TooltipSlot = ({
|
|
|
270
270
|
pointerEvents: "box-none",
|
|
271
271
|
style: _reactNative.StyleSheet.absoluteFill,
|
|
272
272
|
testID: "tooltip-overlay"
|
|
273
|
-
}, children, (0, _element.createElement)(Slot, rest
|
|
273
|
+
}, children, (0, _element.createElement)(Slot, { ...rest
|
|
274
|
+
})));
|
|
274
275
|
};
|
|
275
276
|
|
|
276
277
|
Tooltip.Slot = TooltipSlot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tooltip/index.native.js"],"names":["RIGHT_ALIGN_ARROW_OFFSET","TOOLTIP_VERTICAL_OFFSET","TooltipContext","onHandleScreenTouch","Fill","Slot","useKeyboardVisibility","keyboardVisible","setKeyboardVisible","previousKeyboardVisible","showListener","Keyboard","addListener","keyboardHideEvent","Platform","select","android","ios","hideListener","remove","Tooltip","children","position","text","visible","initialVisible","referenceElementRef","animationValue","Animated","Value","current","horizontalPosition","split","setVisible","animating","setAnimating","hidden","previousVisible","referenceLayout","setReferenceLayout","height","width","x","y","tooltipLayout","setTooltipLayout","startAnimation","getReferenceElementPosition","frameListener","timing","toValue","duration","useNativeDriver","delay","easing","Easing","out","quad","start","tooltipStyles","styles","tooltip","left","Math","floor","top","tooltipBoxStyles","tooltip__box","elevation","opacity","shadowColor","tooltip__shadow","color","shadowOffset","shadowOpacity","shadowRadius","transform","translateY","interpolate","inputRange","outputRange","arrowStyles","tooltip__arrow","requestAnimationFrame","measure","_x","_y","pageX","pageY","getTooltipLayout","nativeEvent","layout","ref","onLayout","tooltip__text","TooltipSlot","rest","handleScreenTouch","setHandleScreenTouch","callback","handleTouchStart","value","undefined","StyleSheet","absoluteFill"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AAsBA;;AAKA;;AACA;;AA/BA;AACA;AACA;;AAWA;AACA;AACA;;AAYA;AACA;AACA;AAIA,MAAMA,wBAAwB,GAAG,EAAjC;AACA,MAAMC,uBAAuB,GAAG,CAAhC;AAEA,MAAMC,cAAc,GAAG,4BAAe;AACrCC,EAAAA,mBAAmB,EAAE,MAAM,CAAE;AADQ,CAAf,CAAvB;AAGA,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,8BAAgB,SAAhB,CAAvB;;AAEA,MAAMC,qBAAqB,GAAG,MAAM;AACnC,QAAM,CAAEC,eAAF,EAAmBC,kBAAnB,IAA0C,uBAAU,KAAV,CAAhD;AACA,QAAMC,uBAAuB,GAAG,0BAAaF,eAAb,CAAhC;AAEA,0BAAW,MAAM;AAChB,UAAMG,YAAY,GAAGC,sBAASC,WAAT,CAAsB,iBAAtB,EAAyC,MAAM;AACnE,UAAKH,uBAAuB,KAAK,IAAjC,EAAwC;AACvCD,QAAAA,kBAAkB,CAAE,IAAF,CAAlB;AACA;AACD,KAJoB,CAArB;;AAKA,UAAMK,iBAAiB,GAAGC,sBAASC,MAAT,CAAiB;AAC1CC,MAAAA,OAAO,EAAE,iBADiC;AAE1CC,MAAAA,GAAG,EAAE;AAFqC,KAAjB,CAA1B;;AAIA,UAAMC,YAAY,GAAGP,sBAASC,WAAT,CAAsBC,iBAAtB,EAAyC,MAAM;AACnE,UAAKJ,uBAAuB,KAAK,KAAjC,EAAyC;AACxCD,QAAAA,kBAAkB,CAAE,KAAF,CA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BAAWC,YAPpB;AAQC,IAAA,MAAM,EAAC;AARR,KAUGnF,QAVH,EAWC,4BAAC,IAAD,EAAW2E,IAAX,CAXD,CADD,CADD;AAiBA,CAjCD;;AAmCA5E,OAAO,CAACf,IAAR,GAAe0F,WAAf;eAEe3E,O","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tAnimated,\n\tEasing,\n\tKeyboard,\n\tPlatform,\n\tStyleSheet,\n\tText,\n\tView,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcloneElement,\n\tcreateContext,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { createSlotFill } from '../slot-fill';\nimport styles from './style.scss';\n\nconst RIGHT_ALIGN_ARROW_OFFSET = 16;\nconst TOOLTIP_VERTICAL_OFFSET = 2;\n\nconst TooltipContext = createContext( {\n\tonHandleScreenTouch: () => {},\n} );\nconst { Fill, Slot } = createSlotFill( 'Tooltip' );\n\nconst useKeyboardVisibility = () => {\n\tconst [ keyboardVisible, setKeyboardVisible ] = useState( false );\n\tconst previousKeyboardVisible = usePrevious( keyboardVisible );\n\n\tuseEffect( () => {\n\t\tconst showListener = Keyboard.addListener( 'keyboardDidShow', () => {\n\t\t\tif ( previousKeyboardVisible !== true ) {\n\t\t\t\tsetKeyboardVisible( true );\n\t\t\t}\n\t\t} );\n\t\tconst keyboardHideEvent = Platform.select( {\n\t\t\tandroid: 'keyboardDidHide',\n\t\t\tios: 'keyboardWillHide',\n\t\t} );\n\t\tconst hideListener = Keyboard.addListener( keyboardHideEvent, () => {\n\t\t\tif ( previousKeyboardVisible !== false ) {\n\t\t\t\tsetKeyboardVisible( false );\n\t\t\t}\n\t\t} );\n\t\treturn () => {\n\t\t\tshowListener.remove();\n\t\t\thideListener.remove();\n\t\t};\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\treturn keyboardVisible;\n};\n\nconst Tooltip = ( {\n\tchildren,\n\tposition = 'top',\n\ttext,\n\tvisible: initialVisible = false,\n} ) => {\n\tconst referenceElementRef = useRef( null );\n\tconst animationValue = useRef( new Animated.Value( 0 ) ).current;\n\tconst [ , horizontalPosition = 'center' ] = position.split( ' ' );\n\tconst [ visible, setVisible ] = useState( initialVisible );\n\tconst [ animating, setAnimating ] = useState( false );\n\tconst hidden = ! visible && ! animating;\n\tconst previousVisible = usePrevious( visible );\n\tconst [ referenceLayout, setReferenceLayout ] = useState( {\n\t\theight: 0,\n\t\twidth: 0,\n\t\tx: 0,\n\t\ty: 0,\n\t} );\n\tconst [ tooltipLayout, setTooltipLayout ] = useState( {\n\t\theight: 0,\n\t\twidth: 0,\n\t} );\n\tconst { onHandleScreenTouch } = useContext( TooltipContext );\n\tconst keyboardVisible = useKeyboardVisibility();\n\n\t// Register callback to dismiss the tooltip whenever the screen is touched.\n\tuseEffect( () => {\n\t\tif ( visible ) {\n\t\t\tonHandleScreenTouch( () => {\n\t\t\t\tsetAnimating( true );\n\t\t\t\tsetVisible( false );\n\t\t\t} );\n\t\t}\n\t\treturn () => onHandleScreenTouch( null );\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ visible ] );\n\n\t// Manage visibility animation.\n\tuseEffect( () => {\n\t\tif (\n\t\t\t// Initial render and visibility enabled, animate show.\n\t\t\t( typeof previousVisible === 'undefined' && visible ) ||\n\t\t\t// Previously visible, animate hide\n\t\t\t( previousVisible && previousVisible !== visible )\n\t\t) {\n\t\t\tsetAnimating( true );\n\t\t\tstartAnimation();\n\t\t}\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ visible ] );\n\n\t// Manage tooltip visibility and position in relation to keyboard.\n\tuseEffect( () => {\n\t\tif ( ! visible ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update tooltip position if keyboard is visible.\n\t\tif ( keyboardVisible ) {\n\t\t\tgetReferenceElementPosition();\n\t\t}\n\n\t\t// Hide tooltip if keyboard hides\n\t\tif ( typeof previousVisible !== 'undefined' && ! keyboardVisible ) {\n\t\t\tsetAnimating( true );\n\t\t\tsetVisible( false );\n\t\t}\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ visible, keyboardVisible ] );\n\n\t// Manage tooltip position during keyboard frame changes.\n\tuseEffect( () => {\n\t\tconst frameListener = Keyboard.addListener(\n\t\t\t'keyboardWillChangeFrame',\n\t\t\t() => {\n\t\t\t\tif ( visible ) {\n\t\t\t\t\tgetReferenceElementPosition();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn () => {\n\t\t\tframeListener.remove();\n\t\t};\n\t}, [ visible ] );\n\n\tconst startAnimation = () => {\n\t\tAnimated.timing( animationValue, {\n\t\t\ttoValue: visible ? 1 : 0,\n\t\t\tduration: visible ? 300 : 150,\n\t\t\tuseNativeDriver: true,\n\t\t\tdelay: visible ? 500 : 0,\n\t\t\teasing: Easing.out( Easing.quad ),\n\t\t} ).start( () => {\n\t\t\tsetAnimating( false );\n\t\t} );\n\t};\n\n\tconst tooltipStyles = [\n\t\tstyles.tooltip,\n\t\t{\n\t\t\tleft:\n\t\t\t\treferenceLayout.x +\n\t\t\t\tMath.floor( referenceLayout.width / 2 ) -\n\t\t\t\t( horizontalPosition === 'right'\n\t\t\t\t\t? RIGHT_ALIGN_ARROW_OFFSET\n\t\t\t\t\t: Math.floor( tooltipLayout.width / 2 ) ),\n\t\t\ttop:\n\t\t\t\treferenceLayout.y -\n\t\t\t\ttooltipLayout.height -\n\t\t\t\tTOOLTIP_VERTICAL_OFFSET,\n\t\t},\n\t];\n\tconst tooltipBoxStyles = [\n\t\tstyles.tooltip__box,\n\t\thorizontalPosition === 'right' && styles[ 'tooltip--rightAlign' ],\n\t\t{\n\t\t\televation: 2,\n\t\t\topacity: animationValue,\n\t\t\tshadowColor: styles.tooltip__shadow?.color,\n\t\t\tshadowOffset: { height: 2, width: 0 },\n\t\t\tshadowOpacity: 0.25,\n\t\t\tshadowRadius: 2,\n\t\t\ttransform: [\n\t\t\t\t{\n\t\t\t\t\ttranslateY: animationValue.interpolate( {\n\t\t\t\t\t\tinputRange: [ 0, 1 ],\n\t\t\t\t\t\toutputRange: [ visible ? 4 : -8, -8 ],\n\t\t\t\t\t} ),\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t];\n\tconst arrowStyles = [\n\t\tstyles.tooltip__arrow,\n\t\thorizontalPosition === 'right' &&\n\t\t\tstyles[ 'tooltip__arrow--rightAlign' ],\n\t];\n\n\tconst getReferenceElementPosition = () => {\n\t\t// rAF allows render to complete before calculating layout\n\t\t// eslint-disable-next-line no-undef\n\t\trequestAnimationFrame( () => {\n\t\t\tif ( ! referenceElementRef.current ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treferenceElementRef.current.measure(\n\t\t\t\t( _x, _y, width, height, pageX, pageY ) => {\n\t\t\t\t\tsetReferenceLayout( {\n\t\t\t\t\t\theight,\n\t\t\t\t\t\twidth,\n\t\t\t\t\t\tx: pageX,\n\t\t\t\t\t\ty: pageY,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t);\n\t\t} );\n\t};\n\tconst getTooltipLayout = ( { nativeEvent } ) => {\n\t\tconst { height, width } = nativeEvent.layout;\n\t\tsetTooltipLayout( { height, width } );\n\t};\n\n\tif ( hidden ) {\n\t\treturn children;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ cloneElement( children, {\n\t\t\t\tref: referenceElementRef,\n\t\t\t\tonLayout: getReferenceElementPosition,\n\t\t\t} ) }\n\t\t\t<Fill>\n\t\t\t\t<View onLayout={ getTooltipLayout } style={ tooltipStyles }>\n\t\t\t\t\t<Animated.View style={ tooltipBoxStyles }>\n\t\t\t\t\t\t<Text style={ styles.tooltip__text }>{ text }</Text>\n\t\t\t\t\t\t<View style={ arrowStyles } />\n\t\t\t\t\t</Animated.View>\n\t\t\t\t</View>\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nconst TooltipSlot = ( { children, ...rest } ) => {\n\tconst [ handleScreenTouch, setHandleScreenTouch ] = useState( null );\n\tconst onHandleScreenTouch = ( callback ) => {\n\t\t// Must use function to set state below as `callback` is a function itself.\n\t\tsetHandleScreenTouch( () => callback );\n\t};\n\tconst handleTouchStart = () => {\n\t\thandleScreenTouch();\n\t\tsetHandleScreenTouch( null );\n\t};\n\t// Memoize context value to avoid unnecessary rerenders of the Provider's children\n\t// Disable reason: deferring this refactor to the native team.\n\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tconst value = useMemo( () => ( { onHandleScreenTouch } ) );\n\n\treturn (\n\t\t<TooltipContext.Provider value={ value }>\n\t\t\t<View\n\t\t\t\tonTouchStart={\n\t\t\t\t\ttypeof handleScreenTouch === 'function'\n\t\t\t\t\t\t? handleTouchStart\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tpointerEvents=\"box-none\"\n\t\t\t\tstyle={ StyleSheet.absoluteFill }\n\t\t\t\ttestID=\"tooltip-overlay\"\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<Slot { ...rest } />\n\t\t\t</View>\n\t\t</TooltipContext.Provider>\n\t);\n};\n\nTooltip.Slot = TooltipSlot;\n\nexport default Tooltip;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tooltip/index.native.js"],"names":["RIGHT_ALIGN_ARROW_OFFSET","TOOLTIP_VERTICAL_OFFSET","TooltipContext","onHandleScreenTouch","Fill","Slot","useKeyboardVisibility","keyboardVisible","setKeyboardVisible","previousKeyboardVisible","showListener","Keyboard","addListener","keyboardHideEvent","Platform","select","android","ios","hideListener","remove","Tooltip","children","position","text","visible","initialVisible","referenceElementRef","animationValue","Animated","Value","current","horizontalPosition","split","setVisible","animating","setAnimating","hidden","previousVisible","referenceLayout","setReferenceLayout","height","width","x","y","tooltipLayout","setTooltipLayout","startAnimation","getReferenceElementPosition","frameListener","timing","toValue","duration","useNativeDriver","delay","easing","Easing","out","quad","start","tooltipStyles","styles","tooltip","left","Math","floor","top","tooltipBoxStyles","tooltip__box","elevation","opacity","shadowColor","tooltip__shadow","color","shadowOffset","shadowOpacity","shadowRadius","transform","translateY","interpolate","inputRange","outputRange","arrowStyles","tooltip__arrow","requestAnimationFrame","measure","_x","_y","pageX","pageY","getTooltipLayout","nativeEvent","layout","ref","onLayout","tooltip__text","TooltipSlot","rest","handleScreenTouch","setHandleScreenTouch","callback","handleTouchStart","value","undefined","StyleSheet","absoluteFill"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AAsBA;;AAKA;;AACA;;AA/BA;AACA;AACA;;AAWA;AACA;AACA;;AAYA;AACA;AACA;AAIA,MAAMA,wBAAwB,GAAG,EAAjC;AACA,MAAMC,uBAAuB,GAAG,CAAhC;AAEA,MAAMC,cAAc,GAAG,4BAAe;AACrCC,EAAAA,mBAAmB,EAAE,MAAM,CAAE;AADQ,CAAf,CAAvB;AAGA,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,8BAAgB,SAAhB,CAAvB;;AAEA,MAAMC,qBAAqB,GAAG,MAAM;AACnC,QAAM,CAAEC,eAAF,EAAmBC,kBAAnB,IAA0C,uBAAU,KAAV,CAAhD;AACA,QAAMC,uBAAuB,GAAG,0BAAaF,eAAb,CAAhC;AAEA,0BAAW,MAAM;AAChB,UAAMG,YAAY,GAAGC,sBAASC,WAAT,CAAsB,iBAAtB,EAAyC,MAAM;AACnE,UAAKH,uBAAuB,KAAK,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AoB,CAAE,IAAF,CAApB;AACA,GAHD,CANgD,CAUhD;AACA;AACA;AACA;;;AACA,QAAMG,KAAK,GAAG,sBAAS,OAAQ;AAAElG,IAAAA;AAAF,GAAR,CAAT,CAAd;AAEA,SACC,4BAAC,cAAD,CAAgB,QAAhB;AAAyB,IAAA,KAAK,EAAGkG;AAAjC,KACC,4BAAC,iBAAD;AACC,IAAA,YAAY,EACX,OAAOJ,iBAAP,KAA6B,UAA7B,GACGG,gBADH,GAEGE,SAJL;AAMC,IAAA,aAAa,EAAC,UANf;AAOC,IAAA,KAAK,EAAGC,wBAAWC,YAPpB;AAQC,IAAA,MAAM,EAAC;AARR,KAUGnF,QAVH,EAWC,4BAAC,IAAD,OAAW2E;AAAX,IAXD,CADD,CADD;AAiBA,CAjCD;;AAmCA5E,OAAO,CAACf,IAAR,GAAe0F,WAAf;eAEe3E,O","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tAnimated,\n\tEasing,\n\tKeyboard,\n\tPlatform,\n\tStyleSheet,\n\tText,\n\tView,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcloneElement,\n\tcreateContext,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { createSlotFill } from '../slot-fill';\nimport styles from './style.scss';\n\nconst RIGHT_ALIGN_ARROW_OFFSET = 16;\nconst TOOLTIP_VERTICAL_OFFSET = 2;\n\nconst TooltipContext = createContext( {\n\tonHandleScreenTouch: () => {},\n} );\nconst { Fill, Slot } = createSlotFill( 'Tooltip' );\n\nconst useKeyboardVisibility = () => {\n\tconst [ keyboardVisible, setKeyboardVisible ] = useState( false );\n\tconst previousKeyboardVisible = usePrevious( keyboardVisible );\n\n\tuseEffect( () => {\n\t\tconst showListener = Keyboard.addListener( 'keyboardDidShow', () => {\n\t\t\tif ( previousKeyboardVisible !== true ) {\n\t\t\t\tsetKeyboardVisible( true );\n\t\t\t}\n\t\t} );\n\t\tconst keyboardHideEvent = Platform.select( {\n\t\t\tandroid: 'keyboardDidHide',\n\t\t\tios: 'keyboardWillHide',\n\t\t} );\n\t\tconst hideListener = Keyboard.addListener( keyboardHideEvent, () => {\n\t\t\tif ( previousKeyboardVisible !== false ) {\n\t\t\t\tsetKeyboardVisible( false );\n\t\t\t}\n\t\t} );\n\t\treturn () => {\n\t\t\tshowListener.remove();\n\t\t\thideListener.remove();\n\t\t};\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\treturn keyboardVisible;\n};\n\nconst Tooltip = ( {\n\tchildren,\n\tposition = 'top',\n\ttext,\n\tvisible: initialVisible = false,\n} ) => {\n\tconst referenceElementRef = useRef( null );\n\tconst animationValue = useRef( new Animated.Value( 0 ) ).current;\n\tconst [ , horizontalPosition = 'center' ] = position.split( ' ' );\n\tconst [ visible, setVisible ] = useState( initialVisible );\n\tconst [ animating, setAnimating ] = useState( false );\n\tconst hidden = ! visible && ! animating;\n\tconst previousVisible = usePrevious( visible );\n\tconst [ referenceLayout, setReferenceLayout ] = useState( {\n\t\theight: 0,\n\t\twidth: 0,\n\t\tx: 0,\n\t\ty: 0,\n\t} );\n\tconst [ tooltipLayout, setTooltipLayout ] = useState( {\n\t\theight: 0,\n\t\twidth: 0,\n\t} );\n\tconst { onHandleScreenTouch } = useContext( TooltipContext );\n\tconst keyboardVisible = useKeyboardVisibility();\n\n\t// Register callback to dismiss the tooltip whenever the screen is touched.\n\tuseEffect( () => {\n\t\tif ( visible ) {\n\t\t\tonHandleScreenTouch( () => {\n\t\t\t\tsetAnimating( true );\n\t\t\t\tsetVisible( false );\n\t\t\t} );\n\t\t}\n\t\treturn () => onHandleScreenTouch( null );\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ visible ] );\n\n\t// Manage visibility animation.\n\tuseEffect( () => {\n\t\tif (\n\t\t\t// Initial render and visibility enabled, animate show.\n\t\t\t( typeof previousVisible === 'undefined' && visible ) ||\n\t\t\t// Previously visible, animate hide\n\t\t\t( previousVisible && previousVisible !== visible )\n\t\t) {\n\t\t\tsetAnimating( true );\n\t\t\tstartAnimation();\n\t\t}\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ visible ] );\n\n\t// Manage tooltip visibility and position in relation to keyboard.\n\tuseEffect( () => {\n\t\tif ( ! visible ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update tooltip position if keyboard is visible.\n\t\tif ( keyboardVisible ) {\n\t\t\tgetReferenceElementPosition();\n\t\t}\n\n\t\t// Hide tooltip if keyboard hides\n\t\tif ( typeof previousVisible !== 'undefined' && ! keyboardVisible ) {\n\t\t\tsetAnimating( true );\n\t\t\tsetVisible( false );\n\t\t}\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ visible, keyboardVisible ] );\n\n\t// Manage tooltip position during keyboard frame changes.\n\tuseEffect( () => {\n\t\tconst frameListener = Keyboard.addListener(\n\t\t\t'keyboardWillChangeFrame',\n\t\t\t() => {\n\t\t\t\tif ( visible ) {\n\t\t\t\t\tgetReferenceElementPosition();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn () => {\n\t\t\tframeListener.remove();\n\t\t};\n\t}, [ visible ] );\n\n\tconst startAnimation = () => {\n\t\tAnimated.timing( animationValue, {\n\t\t\ttoValue: visible ? 1 : 0,\n\t\t\tduration: visible ? 300 : 150,\n\t\t\tuseNativeDriver: true,\n\t\t\tdelay: visible ? 500 : 0,\n\t\t\teasing: Easing.out( Easing.quad ),\n\t\t} ).start( () => {\n\t\t\tsetAnimating( false );\n\t\t} );\n\t};\n\n\tconst tooltipStyles = [\n\t\tstyles.tooltip,\n\t\t{\n\t\t\tleft:\n\t\t\t\treferenceLayout.x +\n\t\t\t\tMath.floor( referenceLayout.width / 2 ) -\n\t\t\t\t( horizontalPosition === 'right'\n\t\t\t\t\t? RIGHT_ALIGN_ARROW_OFFSET\n\t\t\t\t\t: Math.floor( tooltipLayout.width / 2 ) ),\n\t\t\ttop:\n\t\t\t\treferenceLayout.y -\n\t\t\t\ttooltipLayout.height -\n\t\t\t\tTOOLTIP_VERTICAL_OFFSET,\n\t\t},\n\t];\n\tconst tooltipBoxStyles = [\n\t\tstyles.tooltip__box,\n\t\thorizontalPosition === 'right' && styles[ 'tooltip--rightAlign' ],\n\t\t{\n\t\t\televation: 2,\n\t\t\topacity: animationValue,\n\t\t\tshadowColor: styles.tooltip__shadow?.color,\n\t\t\tshadowOffset: { height: 2, width: 0 },\n\t\t\tshadowOpacity: 0.25,\n\t\t\tshadowRadius: 2,\n\t\t\ttransform: [\n\t\t\t\t{\n\t\t\t\t\ttranslateY: animationValue.interpolate( {\n\t\t\t\t\t\tinputRange: [ 0, 1 ],\n\t\t\t\t\t\toutputRange: [ visible ? 4 : -8, -8 ],\n\t\t\t\t\t} ),\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t];\n\tconst arrowStyles = [\n\t\tstyles.tooltip__arrow,\n\t\thorizontalPosition === 'right' &&\n\t\t\tstyles[ 'tooltip__arrow--rightAlign' ],\n\t];\n\n\tconst getReferenceElementPosition = () => {\n\t\t// rAF allows render to complete before calculating layout\n\t\t// eslint-disable-next-line no-undef\n\t\trequestAnimationFrame( () => {\n\t\t\tif ( ! referenceElementRef.current ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treferenceElementRef.current.measure(\n\t\t\t\t( _x, _y, width, height, pageX, pageY ) => {\n\t\t\t\t\tsetReferenceLayout( {\n\t\t\t\t\t\theight,\n\t\t\t\t\t\twidth,\n\t\t\t\t\t\tx: pageX,\n\t\t\t\t\t\ty: pageY,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t);\n\t\t} );\n\t};\n\tconst getTooltipLayout = ( { nativeEvent } ) => {\n\t\tconst { height, width } = nativeEvent.layout;\n\t\tsetTooltipLayout( { height, width } );\n\t};\n\n\tif ( hidden ) {\n\t\treturn children;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ cloneElement( children, {\n\t\t\t\tref: referenceElementRef,\n\t\t\t\tonLayout: getReferenceElementPosition,\n\t\t\t} ) }\n\t\t\t<Fill>\n\t\t\t\t<View onLayout={ getTooltipLayout } style={ tooltipStyles }>\n\t\t\t\t\t<Animated.View style={ tooltipBoxStyles }>\n\t\t\t\t\t\t<Text style={ styles.tooltip__text }>{ text }</Text>\n\t\t\t\t\t\t<View style={ arrowStyles } />\n\t\t\t\t\t</Animated.View>\n\t\t\t\t</View>\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nconst TooltipSlot = ( { children, ...rest } ) => {\n\tconst [ handleScreenTouch, setHandleScreenTouch ] = useState( null );\n\tconst onHandleScreenTouch = ( callback ) => {\n\t\t// Must use function to set state below as `callback` is a function itself.\n\t\tsetHandleScreenTouch( () => callback );\n\t};\n\tconst handleTouchStart = () => {\n\t\thandleScreenTouch();\n\t\tsetHandleScreenTouch( null );\n\t};\n\t// Memoize context value to avoid unnecessary rerenders of the Provider's children\n\t// Disable reason: deferring this refactor to the native team.\n\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tconst value = useMemo( () => ( { onHandleScreenTouch } ) );\n\n\treturn (\n\t\t<TooltipContext.Provider value={ value }>\n\t\t\t<View\n\t\t\t\tonTouchStart={\n\t\t\t\t\ttypeof handleScreenTouch === 'function'\n\t\t\t\t\t\t? handleTouchStart\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tpointerEvents=\"box-none\"\n\t\t\t\tstyle={ StyleSheet.absoluteFill }\n\t\t\t\ttestID=\"tooltip-overlay\"\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<Slot { ...rest } />\n\t\t\t</View>\n\t\t</TooltipContext.Provider>\n\t);\n};\n\nTooltip.Slot = TooltipSlot;\n\nexport default Tooltip;\n"]}
|
package/build/tree-grid/cell.js
CHANGED
|
@@ -9,8 +9,6 @@ exports.default = exports.TreeGridCell = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
12
|
var _item = _interopRequireDefault(require("./item"));
|
|
15
13
|
|
|
16
14
|
/**
|
|
@@ -25,9 +23,9 @@ function UnforwardedTreeGridCell({
|
|
|
25
23
|
withoutGridItem = false,
|
|
26
24
|
...props
|
|
27
25
|
}, ref) {
|
|
28
|
-
return (0, _element.createElement)("td",
|
|
26
|
+
return (0, _element.createElement)("td", { ...props,
|
|
29
27
|
role: "gridcell"
|
|
30
|
-
}
|
|
28
|
+
}, withoutGridItem ? (0, _element.createElement)(_element.Fragment, null, children) : (0, _element.createElement)(_item.default, {
|
|
31
29
|
ref: ref
|
|
32
30
|
}, children));
|
|
33
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tree-grid/cell.tsx"],"names":["UnforwardedTreeGridCell","children","withoutGridItem","props","ref","TreeGridCell"],"mappings":";;;;;;;;;AAGA
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tree-grid/cell.tsx"],"names":["UnforwardedTreeGridCell","children","withoutGridItem","props","ref","TreeGridCell"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAKA,SAASA,uBAAT,CACC;AACCC,EAAAA,QADD;AAECC,EAAAA,eAAe,GAAG,KAFnB;AAGC,KAAGC;AAHJ,CADD,EAMCC,GAND,EAOE;AACD,SACC,uCAASD,KAAT;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACGD,eAAe,GAChB,qDAAID,QAAJ,CADgB,GAGhB,4BAAC,aAAD;AAAc,IAAA,GAAG,EAAGG;AAApB,KAA4BH,QAA5B,CAJF,CADD;AASA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMI,YAAY,GAAG,yBAAYL,uBAAZ,CAArB;;eAEQK,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TreeGridItem from './item';\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { TreeGridCellProps } from './types';\n\nfunction UnforwardedTreeGridCell(\n\t{\n\t\tchildren,\n\t\twithoutGridItem = false,\n\t\t...props\n\t}: WordPressComponentProps< TreeGridCellProps, 'td', false >,\n\tref: React.ForwardedRef< any >\n) {\n\treturn (\n\t\t<td { ...props } role=\"gridcell\">\n\t\t\t{ withoutGridItem ? (\n\t\t\t\t<>{ children }</>\n\t\t\t) : (\n\t\t\t\t<TreeGridItem ref={ ref }>{ children }</TreeGridItem>\n\t\t\t) }\n\t\t</td>\n\t);\n}\n\n/**\n * `TreeGridCell` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridCell = forwardRef( UnforwardedTreeGridCell );\n\nexport default TreeGridCell;\n"]}
|
package/build/tree-grid/index.js
CHANGED
|
@@ -28,8 +28,6 @@ exports.default = void 0;
|
|
|
28
28
|
|
|
29
29
|
var _element = require("@wordpress/element");
|
|
30
30
|
|
|
31
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
32
|
-
|
|
33
31
|
var _dom = require("@wordpress/dom");
|
|
34
32
|
|
|
35
33
|
var _keycodes = require("@wordpress/keycodes");
|
|
@@ -289,11 +287,11 @@ ref) {
|
|
|
289
287
|
return (0, _element.createElement)(_rovingTabIndex.default, null, (0, _element.createElement)("div", {
|
|
290
288
|
role: "application",
|
|
291
289
|
"aria-label": applicationAriaLabel
|
|
292
|
-
}, (0, _element.createElement)("table",
|
|
290
|
+
}, (0, _element.createElement)("table", { ...props,
|
|
293
291
|
role: "treegrid",
|
|
294
292
|
onKeyDown: onKeyDown,
|
|
295
293
|
ref: ref
|
|
296
|
-
}
|
|
294
|
+
}, (0, _element.createElement)("tbody", null, children))));
|
|
297
295
|
/* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */
|
|
298
296
|
}
|
|
299
297
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tree-grid/index.tsx"],"names":["getRowFocusables","rowElement","focusablesInRow","focus","focusable","find","sequential","filter","closest","UnforwardedTreeGrid","children","onExpandRow","onCollapseRow","onFocusRow","applicationAriaLabel","props","ref","onKeyDown","event","keyCode","metaKey","ctrlKey","altKey","hasModifierKeyPressed","UP","DOWN","LEFT","RIGHT","HOME","END","includes","stopPropagation","activeElement","document","currentTarget","treeGridElement","contains","activeRow","currentColumnIndex","indexOf","canExpandCollapse","cannotFocusNextColumn","getAttribute","nextIndex","Math","max","min","length","preventDefault","level","parseInt","rows","Array","from","querySelectorAll","parentRow","currentRowIndex","i","ariaLevel","focusableItems","nextRowIndex","focusablesInNextRow","TreeGrid"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;;;AADA;;AAEA;;AAKA;;AA4XA;;AACA;;AACA;;AAxYA;AACA;AACA;;AAKA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,gBAAT,CAA2BC,UAA3B,EAAqD;AACpD,QAAMC,eAAe,GAAGC,WAAMC,SAAN,CAAgBC,IAAhB,CAAsBJ,UAAtB,EAAkC;AACzDK,IAAAA,UAAU,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CAAxB,CAAV,CAhD+D,CAkD/D;AACA;;AACA1C,MAAAA,KAAK,CAAC8B,cAAN;AACA;AACD,GAzPgB,EA0PjB,CAAErC,WAAF,EAAeC,aAAf,EAA8BC,UAA9B,CA1PiB,CAAlB;AA6PA;;AACA;;AACA,SACC,4BAAC,uBAAD,QAMC;AAAK,IAAA,IAAI,EAAC,aAAV;AAAwB,kBAAaC;AAArC,KACC,gEACMC,KADN;AAEC,IAAA,IAAI,EAAC,UAFN;AAGC,IAAA,SAAS,EAAGE,SAHb;AAIC,IAAA,GAAG,EAAGD;AAJP,MAMC,2CAASN,QAAT,CAND,CADD,CAND,CADD;AAmBA;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMoD,QAAQ,GAAG,yBAAYrD,mBAAZ,CAAjB;;eAEQqD,Q","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { forwardRef, useCallback } from '@wordpress/element';\nimport { UP, DOWN, LEFT, RIGHT, HOME, END } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexContainer from './roving-tab-index';\nimport type { TreeGridProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\n/**\n * Return focusables in a row element, excluding those from other branches\n * nested within the row.\n *\n * @param rowElement The DOM element representing the row.\n *\n * @return The array of focusables in the row.\n */\nfunction getRowFocusables( rowElement: HTMLElement ) {\n\tconst focusablesInRow = focus.focusable.find( rowElement, {\n\t\tsequential: true,\n\t} );\n\n\treturn focusablesInRow.filter( ( focusable ) => {\n\t\treturn focusable.closest( '[role=\"row\"]' ) === rowElement;\n\t} );\n}\n\n/**\n * Renders both a table and tbody element, used to create a tree hierarchy.\n *\n */\nfunction UnforwardedTreeGrid(\n\t{\n\t\tchildren,\n\t\tonExpandRow = () => {},\n\t\tonCollapseRow = () => {},\n\t\tonFocusRow = () => {},\n\t\tapplicationAriaLabel,\n\t\t...props\n\t}: WordPressComponentProps< TreeGridProps, 'table', false >,\n\t/** A ref to the underlying DOM table element. */\n\tref: React.ForwardedRef< HTMLTableElement >\n) {\n\tconst onKeyDown = useCallback(\n\t\t( event: React.KeyboardEvent< HTMLTableElement > ) => {\n\t\t\tconst { keyCode, metaKey, ctrlKey, altKey } = event;\n\n\t\t\t// The shift key is intentionally absent from the following list,\n\t\t\t// to enable shift + up/down to select items from the list.\n\t\t\tconst hasModifierKeyPressed = metaKey || ctrlKey || altKey;\n\n\t\t\tif (\n\t\t\t\thasModifierKeyPressed ||\n\t\t\t\t! ( [ UP, DOWN, LEFT, RIGHT, HOME, END ] as number[] ).includes(\n\t\t\t\t\tkeyCode\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The event will be handled, stop propagation.\n\t\t\tevent.stopPropagation();\n\n\t\t\tconst { activeElement } = document;\n\t\t\tconst { currentTarget: treeGridElement } = event;\n\n\t\t\tif (\n\t\t\t\t! activeElement ||\n\t\t\t\t! treeGridElement.contains( activeElement )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Calculate the columnIndex of the active element.\n\t\t\tconst activeRow =\n\t\t\t\tactiveElement.closest< HTMLElement >( '[role=\"row\"]' );\n\n\t\t\tif ( ! activeRow ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst focusablesInRow = getRowFocusables( activeRow );\n\t\t\tconst currentColumnIndex = focusablesInRow.indexOf(\n\t\t\t\tactiveElement as HTMLElement\n\t\t\t);\n\t\t\tconst canExpandCollapse = 0 === currentColumnIndex;\n\t\t\tconst cannotFocusNextColumn =\n\t\t\t\tcanExpandCollapse &&\n\t\t\t\t( activeRow.getAttribute( 'data-expanded' ) === 'false' ||\n\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'false' ) &&\n\t\t\t\tkeyCode === RIGHT;\n\n\t\t\tif ( ( [ LEFT, RIGHT ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate to the next element.\n\t\t\t\tlet nextIndex;\n\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\tnextIndex = Math.max( 0, currentColumnIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextIndex = Math.min(\n\t\t\t\t\t\tcurrentColumnIndex + 1,\n\t\t\t\t\t\tfocusablesInRow.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is at the left most column.\n\t\t\t\tif ( canExpandCollapse ) {\n\t\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\t\t// Left:\n\t\t\t\t\t\t// If a row is focused, and it is expanded, collapses the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'data-expanded' ) ===\n\t\t\t\t\t\t\t\t'true' ||\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'true'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonCollapseRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, moves to the parent row (if there is one).\n\t\t\t\t\t\tconst level = Math.max(\n\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\tactiveRow?.getAttribute( 'aria-level' ) ?? '1',\n\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t) - 1,\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst rows = Array.from(\n\t\t\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlet parentRow = activeRow;\n\t\t\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\t\t\tfor ( let i = currentRowIndex; i >= 0; i-- ) {\n\t\t\t\t\t\t\tconst ariaLevel =\n\t\t\t\t\t\t\t\trows[ i ].getAttribute( 'aria-level' );\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tariaLevel !== null &&\n\t\t\t\t\t\t\t\tparseInt( ariaLevel, 10 ) === level\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tparentRow = rows[ i ];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgetRowFocusables( parentRow )?.[ 0 ]?.focus();\n\t\t\t\t\t}\n\t\t\t\t\tif ( keyCode === RIGHT ) {\n\t\t\t\t\t\t// Right:\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, expands the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'data-expanded' ) ===\n\t\t\t\t\t\t\t\t'false' ||\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) ===\n\t\t\t\t\t\t\t\t'false'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonExpandRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is expanded, focuses the next cell in the row.\n\t\t\t\t\t\tconst focusableItems = getRowFocusables( activeRow );\n\t\t\t\t\t\tif ( focusableItems.length > 0 ) {\n\t\t\t\t\t\t\tfocusableItems[ nextIndex ]?.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start reading text on continued use of left/right arrow\n\t\t\t\t\t// keys.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Focus the next element. If at most left column and row is collapsed, moving right is not allowed as this will expand. However, if row is collapsed, moving left is allowed.\n\t\t\t\tif ( cannotFocusNextColumn ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfocusablesInRow[ nextIndex ].focus();\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( ( [ UP, DOWN ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === UP ) {\n\t\t\t\t\tnextRowIndex = Math.max( 0, currentRowIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = Math.min(\n\t\t\t\t\t\tcurrentRowIndex + 1,\n\t\t\t\t\t\trows.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( ( [ HOME, END ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === HOME ) {\n\t\t\t\t\tnextRowIndex = 0;\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = rows.length - 1;\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ onExpandRow, onCollapseRow, onFocusRow ]\n\t);\n\n\t/* Disable reason: A treegrid is implemented using a table element. */\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */\n\treturn (\n\t\t<RovingTabIndexContainer>\n\t\t\t{\n\t\t\t\t// Prevent browser mode from triggering in NVDA by wrapping List View\n\t\t\t\t// in a role=application wrapper.\n\t\t\t\t// see: https://github.com/WordPress/gutenberg/issues/43729\n\t\t\t }\n\t\t\t<div role=\"application\" aria-label={ applicationAriaLabel }>\n\t\t\t\t<table\n\t\t\t\t\t{ ...props }\n\t\t\t\t\trole=\"treegrid\"\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t\tref={ ref }\n\t\t\t\t>\n\t\t\t\t\t<tbody>{ children }</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t</RovingTabIndexContainer>\n\t);\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */\n}\n\n/**\n * `TreeGrid` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * A tree grid is a hierarchical 2 dimensional UI component, for example it could be\n * used to implement a file system browser.\n *\n * A tree grid allows the user to navigate using arrow keys.\n * Up/down to navigate vertically across rows, and left/right to navigate horizontally\n * between focusables in a row.\n *\n * The `TreeGrid` renders both a `table` and `tbody` element, and is intended to be used\n * with `TreeGridRow` (`tr`) and `TreeGridCell` (`td`) to build out a grid.\n *\n * ```jsx\n * function TreeMenu() {\n * \treturn (\n * \t\t<TreeGrid>\n * \t\t\t<TreeGridRow level={ 1 } positionInSet={ 1 } setSize={ 2 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t\t<TreeGridRow level={ 1 } positionInSet={ 2 } setSize={ 2 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t\t<TreeGridRow level={ 2 } positionInSet={ 1 } setSize={ 1 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t</TreeGrid>\n * \t);\n * }\n * ```\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGrid = forwardRef( UnforwardedTreeGrid );\n\nexport default TreeGrid;\nexport { default as TreeGridRow } from './row';\nexport { default as TreeGridCell } from './cell';\nexport { default as TreeGridItem } from './item';\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tree-grid/index.tsx"],"names":["getRowFocusables","rowElement","focusablesInRow","focus","focusable","find","sequential","filter","closest","UnforwardedTreeGrid","children","onExpandRow","onCollapseRow","onFocusRow","applicationAriaLabel","props","ref","onKeyDown","event","keyCode","metaKey","ctrlKey","altKey","hasModifierKeyPressed","UP","DOWN","LEFT","RIGHT","HOME","END","includes","stopPropagation","activeElement","document","currentTarget","treeGridElement","contains","activeRow","currentColumnIndex","indexOf","canExpandCollapse","cannotFocusNextColumn","getAttribute","nextIndex","Math","max","min","length","preventDefault","level","parseInt","rows","Array","from","querySelectorAll","parentRow","currentRowIndex","i","ariaLevel","focusableItems","nextRowIndex","focusablesInNextRow","TreeGrid"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AADA;;AAEA;;AAKA;;AA4XA;;AACA;;AACA;;AAxYA;AACA;AACA;;AAKA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,gBAAT,CAA2BC,UAA3B,EAAqD;AACpD,QAA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+D,CA8C/D;AACA;;AACAU,MAAAA,UAAU,CAAEK,KAAF,EAASmB,SAAT,EAAoBc,IAAI,CAAES,YAAF,CAAxB,CAAV,CAhD+D,CAkD/D;AACA;;AACA1C,MAAAA,KAAK,CAAC8B,cAAN;AACA;AACD,GAzPgB,EA0PjB,CAAErC,WAAF,EAAeC,aAAf,EAA8BC,UAA9B,CA1PiB,CAAlB;AA6PA;;AACA;;AACA,SACC,4BAAC,uBAAD,QAMC;AAAK,IAAA,IAAI,EAAC,aAAV;AAAwB,kBAAaC;AAArC,KACC,0CACMC,KADN;AAEC,IAAA,IAAI,EAAC,UAFN;AAGC,IAAA,SAAS,EAAGE,SAHb;AAIC,IAAA,GAAG,EAAGD;AAJP,KAMC,2CAASN,QAAT,CAND,CADD,CAND,CADD;AAmBA;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMoD,QAAQ,GAAG,yBAAYrD,mBAAZ,CAAjB;;eAEQqD,Q","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { forwardRef, useCallback } from '@wordpress/element';\nimport { UP, DOWN, LEFT, RIGHT, HOME, END } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexContainer from './roving-tab-index';\nimport type { TreeGridProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\n/**\n * Return focusables in a row element, excluding those from other branches\n * nested within the row.\n *\n * @param rowElement The DOM element representing the row.\n *\n * @return The array of focusables in the row.\n */\nfunction getRowFocusables( rowElement: HTMLElement ) {\n\tconst focusablesInRow = focus.focusable.find( rowElement, {\n\t\tsequential: true,\n\t} );\n\n\treturn focusablesInRow.filter( ( focusable ) => {\n\t\treturn focusable.closest( '[role=\"row\"]' ) === rowElement;\n\t} );\n}\n\n/**\n * Renders both a table and tbody element, used to create a tree hierarchy.\n *\n */\nfunction UnforwardedTreeGrid(\n\t{\n\t\tchildren,\n\t\tonExpandRow = () => {},\n\t\tonCollapseRow = () => {},\n\t\tonFocusRow = () => {},\n\t\tapplicationAriaLabel,\n\t\t...props\n\t}: WordPressComponentProps< TreeGridProps, 'table', false >,\n\t/** A ref to the underlying DOM table element. */\n\tref: React.ForwardedRef< HTMLTableElement >\n) {\n\tconst onKeyDown = useCallback(\n\t\t( event: React.KeyboardEvent< HTMLTableElement > ) => {\n\t\t\tconst { keyCode, metaKey, ctrlKey, altKey } = event;\n\n\t\t\t// The shift key is intentionally absent from the following list,\n\t\t\t// to enable shift + up/down to select items from the list.\n\t\t\tconst hasModifierKeyPressed = metaKey || ctrlKey || altKey;\n\n\t\t\tif (\n\t\t\t\thasModifierKeyPressed ||\n\t\t\t\t! ( [ UP, DOWN, LEFT, RIGHT, HOME, END ] as number[] ).includes(\n\t\t\t\t\tkeyCode\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The event will be handled, stop propagation.\n\t\t\tevent.stopPropagation();\n\n\t\t\tconst { activeElement } = document;\n\t\t\tconst { currentTarget: treeGridElement } = event;\n\n\t\t\tif (\n\t\t\t\t! activeElement ||\n\t\t\t\t! treeGridElement.contains( activeElement )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Calculate the columnIndex of the active element.\n\t\t\tconst activeRow =\n\t\t\t\tactiveElement.closest< HTMLElement >( '[role=\"row\"]' );\n\n\t\t\tif ( ! activeRow ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst focusablesInRow = getRowFocusables( activeRow );\n\t\t\tconst currentColumnIndex = focusablesInRow.indexOf(\n\t\t\t\tactiveElement as HTMLElement\n\t\t\t);\n\t\t\tconst canExpandCollapse = 0 === currentColumnIndex;\n\t\t\tconst cannotFocusNextColumn =\n\t\t\t\tcanExpandCollapse &&\n\t\t\t\t( activeRow.getAttribute( 'data-expanded' ) === 'false' ||\n\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'false' ) &&\n\t\t\t\tkeyCode === RIGHT;\n\n\t\t\tif ( ( [ LEFT, RIGHT ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate to the next element.\n\t\t\t\tlet nextIndex;\n\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\tnextIndex = Math.max( 0, currentColumnIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextIndex = Math.min(\n\t\t\t\t\t\tcurrentColumnIndex + 1,\n\t\t\t\t\t\tfocusablesInRow.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is at the left most column.\n\t\t\t\tif ( canExpandCollapse ) {\n\t\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\t\t// Left:\n\t\t\t\t\t\t// If a row is focused, and it is expanded, collapses the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'data-expanded' ) ===\n\t\t\t\t\t\t\t\t'true' ||\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'true'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonCollapseRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, moves to the parent row (if there is one).\n\t\t\t\t\t\tconst level = Math.max(\n\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\tactiveRow?.getAttribute( 'aria-level' ) ?? '1',\n\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t) - 1,\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst rows = Array.from(\n\t\t\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlet parentRow = activeRow;\n\t\t\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\t\t\tfor ( let i = currentRowIndex; i >= 0; i-- ) {\n\t\t\t\t\t\t\tconst ariaLevel =\n\t\t\t\t\t\t\t\trows[ i ].getAttribute( 'aria-level' );\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tariaLevel !== null &&\n\t\t\t\t\t\t\t\tparseInt( ariaLevel, 10 ) === level\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tparentRow = rows[ i ];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgetRowFocusables( parentRow )?.[ 0 ]?.focus();\n\t\t\t\t\t}\n\t\t\t\t\tif ( keyCode === RIGHT ) {\n\t\t\t\t\t\t// Right:\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, expands the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'data-expanded' ) ===\n\t\t\t\t\t\t\t\t'false' ||\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) ===\n\t\t\t\t\t\t\t\t'false'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonExpandRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is expanded, focuses the next cell in the row.\n\t\t\t\t\t\tconst focusableItems = getRowFocusables( activeRow );\n\t\t\t\t\t\tif ( focusableItems.length > 0 ) {\n\t\t\t\t\t\t\tfocusableItems[ nextIndex ]?.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start reading text on continued use of left/right arrow\n\t\t\t\t\t// keys.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Focus the next element. If at most left column and row is collapsed, moving right is not allowed as this will expand. However, if row is collapsed, moving left is allowed.\n\t\t\t\tif ( cannotFocusNextColumn ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfocusablesInRow[ nextIndex ].focus();\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( ( [ UP, DOWN ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === UP ) {\n\t\t\t\t\tnextRowIndex = Math.max( 0, currentRowIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = Math.min(\n\t\t\t\t\t\tcurrentRowIndex + 1,\n\t\t\t\t\t\trows.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( ( [ HOME, END ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === HOME ) {\n\t\t\t\t\tnextRowIndex = 0;\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = rows.length - 1;\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ onExpandRow, onCollapseRow, onFocusRow ]\n\t);\n\n\t/* Disable reason: A treegrid is implemented using a table element. */\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */\n\treturn (\n\t\t<RovingTabIndexContainer>\n\t\t\t{\n\t\t\t\t// Prevent browser mode from triggering in NVDA by wrapping List View\n\t\t\t\t// in a role=application wrapper.\n\t\t\t\t// see: https://github.com/WordPress/gutenberg/issues/43729\n\t\t\t }\n\t\t\t<div role=\"application\" aria-label={ applicationAriaLabel }>\n\t\t\t\t<table\n\t\t\t\t\t{ ...props }\n\t\t\t\t\trole=\"treegrid\"\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t\tref={ ref }\n\t\t\t\t>\n\t\t\t\t\t<tbody>{ children }</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t</RovingTabIndexContainer>\n\t);\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */\n}\n\n/**\n * `TreeGrid` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * A tree grid is a hierarchical 2 dimensional UI component, for example it could be\n * used to implement a file system browser.\n *\n * A tree grid allows the user to navigate using arrow keys.\n * Up/down to navigate vertically across rows, and left/right to navigate horizontally\n * between focusables in a row.\n *\n * The `TreeGrid` renders both a `table` and `tbody` element, and is intended to be used\n * with `TreeGridRow` (`tr`) and `TreeGridCell` (`td`) to build out a grid.\n *\n * ```jsx\n * function TreeMenu() {\n * \treturn (\n * \t\t<TreeGrid>\n * \t\t\t<TreeGridRow level={ 1 } positionInSet={ 1 } setSize={ 2 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t\t<TreeGridRow level={ 1 } positionInSet={ 2 } setSize={ 2 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t\t<TreeGridRow level={ 2 } positionInSet={ 1 } setSize={ 1 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t</TreeGrid>\n * \t);\n * }\n * ```\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGrid = forwardRef( UnforwardedTreeGrid );\n\nexport default TreeGrid;\nexport { default as TreeGridRow } from './row';\nexport { default as TreeGridCell } from './cell';\nexport { default as TreeGridItem } from './item';\n"]}
|
package/build/tree-grid/item.js
CHANGED
|
@@ -9,8 +9,6 @@ exports.default = exports.TreeGridItem = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
12
|
var _rovingTabIndexItem = _interopRequireDefault(require("./roving-tab-index-item"));
|
|
15
13
|
|
|
16
14
|
/**
|
|
@@ -24,9 +22,10 @@ function UnforwardedTreeGridItem({
|
|
|
24
22
|
children,
|
|
25
23
|
...props
|
|
26
24
|
}, ref) {
|
|
27
|
-
return (0, _element.createElement)(_rovingTabIndexItem.default,
|
|
28
|
-
ref: ref
|
|
29
|
-
|
|
25
|
+
return (0, _element.createElement)(_rovingTabIndexItem.default, {
|
|
26
|
+
ref: ref,
|
|
27
|
+
...props
|
|
28
|
+
}, children);
|
|
30
29
|
}
|
|
31
30
|
/**
|
|
32
31
|
* `TreeGridItem` is used to create a tree hierarchy.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tree-grid/item.tsx"],"names":["UnforwardedTreeGridItem","children","props","ref","TreeGridItem"],"mappings":";;;;;;;;;AAGA
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tree-grid/item.tsx"],"names":["UnforwardedTreeGridItem","children","props","ref","TreeGridItem"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAIA,SAASA,uBAAT,CACC;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CADD,EAECC,GAFD,EAGE;AACD,SACC,4BAAC,2BAAD;AAAoB,IAAA,GAAG,EAAGA,GAA1B;AAAA,OAAqCD;AAArC,KACGD,QADH,CADD;AAKA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMG,YAAY,GAAG,yBAAYJ,uBAAZ,CAArB;;eAEQI,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexItem from './roving-tab-index-item';\nimport type { RovingTabIndexItemProps } from './types';\n\nfunction UnforwardedTreeGridItem(\n\t{ children, ...props }: RovingTabIndexItemProps,\n\tref: React.ForwardedRef< any >\n) {\n\treturn (\n\t\t<RovingTabIndexItem ref={ ref } { ...props }>\n\t\t\t{ children }\n\t\t</RovingTabIndexItem>\n\t);\n}\n\n/**\n * `TreeGridItem` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridItem = forwardRef( UnforwardedTreeGridItem );\n\nexport default TreeGridItem;\n"]}
|
|
@@ -52,7 +52,8 @@ const RovingTabIndexItem = (0, _element.forwardRef)(function UnforwardedRovingTa
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
if (!Component) return null;
|
|
55
|
-
return (0, _element.createElement)(Component, allProps
|
|
55
|
+
return (0, _element.createElement)(Component, { ...allProps
|
|
56
|
+
}, children);
|
|
56
57
|
});
|
|
57
58
|
exports.RovingTabIndexItem = RovingTabIndexItem;
|
|
58
59
|
var _default = RovingTabIndexItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tree-grid/roving-tab-index-item.tsx"],"names":["RovingTabIndexItem","UnforwardedRovingTabIndexItem","children","as","Component","props","forwardedRef","localRef","ref","lastFocusedElement","setLastFocusedElement","tabIndex","current","undefined","onFocus","event","target","allProps"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAIO,MAAMA,kBAAkB,GAAG,yBACjC,SAASC,6BAAT,CACC;AAAEC,EAAAA,QAAF;AAAYC,EAAAA,EAAE,EAAEC,SAAhB;AAA2B,KAAGC;AAA9B,CADD,EAECC,YAFD,EAGE;AACD,QAAMC,QAAQ,GAAG,sBAAjB;AACA,QAAMC,GAAG,GAAGF,YAAY,IAAIC,QAA5B,CAFC,CAGD;;AACA,QAAM;AAAEE,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,MACL,sDADD;AAEA,MAAIC,QAAJ;;AAEA,MAAKF,kBAAL,EAA0B;AACzBE,IAAAA,QAAQ,GACPF,kBAAkB,OAClB;AACA;AACA;AACA;AACE,iBAAaD,GAAb,GAAmBA,GAAG,CAACI,OAAvB,GAAiCC,SALjB,CAAlB,GAMG,CANH,GAOG,CAAC,CARL;AASA;;AAED,QAAMC,OAA+C,GAAKC,KAAF,IACvDL,qBAAqB,GAAIK,KAAK,CAACC,MAAV,CADtB;;AAEA,QAAMC,QAAQ,GAAG;AAAET,IAAAA,GAAF;AAAOG,IAAAA,QAAP;AAAiBG,IAAAA,OAAjB;AAA0B,OAAGT;AAA7B,GAAjB;;AAEA,MAAK,OAAOH,QAAP,KAAoB,UAAzB,EAAsC;AACrC,WAAOA,QAAQ,CAAEe,QAAF,CAAf;AACA;;AAED,MAAK,CAAEb,SAAP,EAAmB,OAAO,IAAP;AAEnB,SAAO,4BAAC,SAAD,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tree-grid/roving-tab-index-item.tsx"],"names":["RovingTabIndexItem","UnforwardedRovingTabIndexItem","children","as","Component","props","forwardedRef","localRef","ref","lastFocusedElement","setLastFocusedElement","tabIndex","current","undefined","onFocus","event","target","allProps"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAIO,MAAMA,kBAAkB,GAAG,yBACjC,SAASC,6BAAT,CACC;AAAEC,EAAAA,QAAF;AAAYC,EAAAA,EAAE,EAAEC,SAAhB;AAA2B,KAAGC;AAA9B,CADD,EAECC,YAFD,EAGE;AACD,QAAMC,QAAQ,GAAG,sBAAjB;AACA,QAAMC,GAAG,GAAGF,YAAY,IAAIC,QAA5B,CAFC,CAGD;;AACA,QAAM;AAAEE,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,MACL,sDADD;AAEA,MAAIC,QAAJ;;AAEA,MAAKF,kBAAL,EAA0B;AACzBE,IAAAA,QAAQ,GACPF,kBAAkB,OAClB;AACA;AACA;AACA;AACE,iBAAaD,GAAb,GAAmBA,GAAG,CAACI,OAAvB,GAAiCC,SALjB,CAAlB,GAMG,CANH,GAOG,CAAC,CARL;AASA;;AAED,QAAMC,OAA+C,GAAKC,KAAF,IACvDL,qBAAqB,GAAIK,KAAK,CAACC,MAAV,CADtB;;AAEA,QAAMC,QAAQ,GAAG;AAAET,IAAAA,GAAF;AAAOG,IAAAA,QAAP;AAAiBG,IAAAA,OAAjB;AAA0B,OAAGT;AAA7B,GAAjB;;AAEA,MAAK,OAAOH,QAAP,KAAoB,UAAzB,EAAsC;AACrC,WAAOA,QAAQ,CAAEe,QAAF,CAAf;AACA;;AAED,MAAK,CAAEb,SAAP,EAAmB,OAAO,IAAP;AAEnB,SAAO,4BAAC,SAAD,OAAgBa;AAAhB,KAA6Bf,QAA7B,CAAP;AACA,CAnCgC,CAA3B;;eAsCQF,kB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useRovingTabIndexContext } from './roving-tab-index-context';\nimport type { RovingTabIndexItemProps } from './types';\n\nexport const RovingTabIndexItem = forwardRef(\n\tfunction UnforwardedRovingTabIndexItem(\n\t\t{ children, as: Component, ...props }: RovingTabIndexItemProps,\n\t\tforwardedRef: React.ForwardedRef< any >\n\t) {\n\t\tconst localRef = useRef< any >();\n\t\tconst ref = forwardedRef || localRef;\n\t\t// @ts-expect-error - We actually want to throw an error if this is undefined.\n\t\tconst { lastFocusedElement, setLastFocusedElement } =\n\t\t\tuseRovingTabIndexContext();\n\t\tlet tabIndex;\n\n\t\tif ( lastFocusedElement ) {\n\t\t\ttabIndex =\n\t\t\t\tlastFocusedElement ===\n\t\t\t\t// TODO: The original implementation simply used `ref.current` here, assuming\n\t\t\t\t// that a forwarded ref would always be an object, which is not necessarily true.\n\t\t\t\t// This workaround maintains the original runtime behavior in a type-safe way,\n\t\t\t\t// but should be revisited.\n\t\t\t\t( 'current' in ref ? ref.current : undefined )\n\t\t\t\t\t? 0\n\t\t\t\t\t: -1;\n\t\t}\n\n\t\tconst onFocus: React.FocusEventHandler< HTMLElement > = ( event ) =>\n\t\t\tsetLastFocusedElement?.( event.target );\n\t\tconst allProps = { ref, tabIndex, onFocus, ...props };\n\n\t\tif ( typeof children === 'function' ) {\n\t\t\treturn children( allProps );\n\t\t}\n\n\t\tif ( ! Component ) return null;\n\n\t\treturn <Component { ...allProps }>{ children }</Component>;\n\t}\n);\n\nexport default RovingTabIndexItem;\n"]}
|
package/build/tree-grid/row.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -9,8 +7,6 @@ exports.default = exports.TreeGridRow = void 0;
|
|
|
9
7
|
|
|
10
8
|
var _element = require("@wordpress/element");
|
|
11
9
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
10
|
/**
|
|
15
11
|
* WordPress dependencies
|
|
16
12
|
*/
|
|
@@ -22,14 +18,14 @@ function UnforwardedTreeGridRow({
|
|
|
22
18
|
isExpanded,
|
|
23
19
|
...props
|
|
24
20
|
}, ref) {
|
|
25
|
-
return (0, _element.createElement)("tr",
|
|
21
|
+
return (0, _element.createElement)("tr", { ...props,
|
|
26
22
|
ref: ref,
|
|
27
23
|
role: "row",
|
|
28
24
|
"aria-level": level,
|
|
29
25
|
"aria-posinset": positionInSet,
|
|
30
26
|
"aria-setsize": setSize,
|
|
31
27
|
"aria-expanded": isExpanded
|
|
32
|
-
}
|
|
28
|
+
}, children);
|
|
33
29
|
}
|
|
34
30
|
/**
|
|
35
31
|
* `TreeGridRow` is used to create a tree hierarchy.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tree-grid/row.tsx"],"names":["UnforwardedTreeGridRow","children","level","positionInSet","setSize","isExpanded","props","ref","TreeGridRow"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tree-grid/row.tsx"],"names":["UnforwardedTreeGridRow","children","level","positionInSet","setSize","isExpanded","props","ref","TreeGridRow"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AASA,SAASA,sBAAT,CACC;AACCC,EAAAA,QADD;AAECC,EAAAA,KAFD;AAGCC,EAAAA,aAHD;AAICC,EAAAA,OAJD;AAKCC,EAAAA,UALD;AAMC,KAAGC;AANJ,CADD,EASCC,GATD,EAUE;AACD,SACC,uCACMD,KADN;AAEC,IAAA,GAAG,EAAGC,GAFP;AAGC,IAAA,IAAI,EAAC,KAHN;AAIC,kBAAaL,KAJd;AAKC,qBAAgBC,aALjB;AAMC,oBAAeC,OANhB;AAOC,qBAAgBC;AAPjB,KASGJ,QATH,CADD;AAaA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMO,WAAW,GAAG,yBAAYR,sBAAZ,CAApB;;eAEQQ,W","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { TreeGridRowProps } from './types';\n\nfunction UnforwardedTreeGridRow(\n\t{\n\t\tchildren,\n\t\tlevel,\n\t\tpositionInSet,\n\t\tsetSize,\n\t\tisExpanded,\n\t\t...props\n\t}: WordPressComponentProps< TreeGridRowProps, 'tr', false >,\n\tref: React.ForwardedRef< HTMLTableRowElement >\n) {\n\treturn (\n\t\t<tr\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t\trole=\"row\"\n\t\t\taria-level={ level }\n\t\t\taria-posinset={ positionInSet }\n\t\t\taria-setsize={ setSize }\n\t\t\taria-expanded={ isExpanded }\n\t\t>\n\t\t\t{ children }\n\t\t</tr>\n\t);\n}\n\n/**\n * `TreeGridRow` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridRow = forwardRef( UnforwardedTreeGridRow );\n\nexport default TreeGridRow;\n"]}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -10,8 +8,6 @@ exports.default = void 0;
|
|
|
10
8
|
|
|
11
9
|
var _element = require("@wordpress/element");
|
|
12
10
|
|
|
13
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
|
-
|
|
15
11
|
var _htmlEntities = require("@wordpress/html-entities");
|
|
16
12
|
|
|
17
13
|
var _selectControl = require("../select-control");
|
|
@@ -93,12 +89,13 @@ function TreeSelect({
|
|
|
93
89
|
label: noOptionLabel
|
|
94
90
|
}, ...getSelectOptions(tree)].filter(option => !!option);
|
|
95
91
|
}, [noOptionLabel, tree]);
|
|
96
|
-
return (0, _element.createElement)(_selectControl.SelectControl,
|
|
92
|
+
return (0, _element.createElement)(_selectControl.SelectControl, {
|
|
97
93
|
label,
|
|
98
94
|
options,
|
|
99
95
|
onChange,
|
|
100
|
-
value: selectedId
|
|
101
|
-
|
|
96
|
+
value: selectedId,
|
|
97
|
+
...props
|
|
98
|
+
});
|
|
102
99
|
}
|
|
103
100
|
|
|
104
101
|
var _default = TreeSelect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tree-select/index.tsx"],"names":["getSelectOptions","tree","level","flatMap","treeNode","value","id","label","repeat","name","children","TreeSelect","noOptionLabel","onChange","selectedId","props","options","filter","option"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tree-select/index.tsx"],"names":["getSelectOptions","tree","level","flatMap","treeNode","value","id","label","repeat","name","children","TreeSelect","noOptionLabel","onChange","selectedId","props","options","filter","option"],"mappings":";;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAIA,SAASA,gBAAT,CACCC,IADD,EAECC,KAAK,GAAG,CAFT,EAG+C;AAC9C,SAAOD,IAAI,CAACE,OAAL,CAAgBC,QAAF,IAAgB,CACpC;AACCC,IAAAA,KAAK,EAAED,QAAQ,CAACE,EADjB;AAECC,IAAAA,KAAK,EACJ,SAASC,MAAT,CAAiBN,KAAK,GAAG,CAAzB,IAA+B,kCAAgBE,QAAQ,CAACK,IAAzB;AAHjC,GADoC,EAMpC,GAAGT,gBAAgB,CAAEI,QAAQ,CAACM,QAAT,IAAqB,EAAvB,EAA2BR,KAAK,GAAG,CAAnC,CANiB,CAA9B,CAAP;AAQA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAEO,SAASS,UAAT,CAAqB;AAC3BJ,EAAAA,KAD2B;AAE3BK,EAAAA,aAF2B;AAG3BC,EAAAA,QAH2B;AAI3BC,EAAAA,UAJ2B;AAK3Bb,EAAAA,IAAI,GAAG,EALoB;AAM3B,KAAGc;AANwB,CAArB,EAOc;AACpB,QAAMC,OAAO,GAAG,sBAAS,MAAM;AAC9B,WAAO,CACNJ,aAAa,IAAI;AAAEP,MAAAA,KAAK,EAAE,EAAT;AAAaE,MAAAA,KAAK,EAAEK;AAApB,KADX,EAEN,GAAGZ,gBAAgB,CAAEC,IAAF,CAFb,EAGLgB,MAHK,CAGWC,MAAR,IAA8C,CAAC,CAAEA,MAHpD,CAAP;AAIA,GALe,EAKb,CAAEN,aAAF,EAAiBX,IAAjB,CALa,CAAhB;AAOA,SACC,4BAAC,4BAAD;AACQM,IAAAA,KADR;AACeS,IAAAA,OADf;AACwBH,IAAAA,QADxB;AAEC,IAAA,KAAK,EAAGC,UAFT;AAAA,OAGMC;AAHN,IADD;AAOA;;eAEcJ,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { SelectControl } from '../select-control';\nimport type { TreeSelectProps, Tree, Truthy } from './types';\n\nfunction getSelectOptions(\n\ttree: Tree[],\n\tlevel = 0\n): NonNullable< TreeSelectProps[ 'options' ] > {\n\treturn tree.flatMap( ( treeNode ) => [\n\t\t{\n\t\t\tvalue: treeNode.id,\n\t\t\tlabel:\n\t\t\t\t'\\u00A0'.repeat( level * 3 ) + decodeEntities( treeNode.name ),\n\t\t},\n\t\t...getSelectOptions( treeNode.children || [], level + 1 ),\n\t] );\n}\n\n/**\n * TreeSelect component is used to generate select input fields.\n *\n * @example\n * ```jsx\n * import { TreeSelect } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTreeSelect = () => {\n * \tconst [ page, setPage ] = useState( 'p21' );\n *\n * \treturn (\n * \t\t<TreeSelect\n * \t\t\tlabel=\"Parent page\"\n * \t\t\tnoOptionLabel=\"No parent page\"\n * \t\t\tonChange={ ( newPage ) => setPage( newPage ) }\n * \t\t\tselectedId={ page }\n * \t\t\ttree={ [\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 1',\n * \t\t\t\t\tid: 'p1',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{ name: 'Descend 1 of page 1', id: 'p11' },\n * \t\t\t\t\t\t{ name: 'Descend 2 of page 1', id: 'p12' },\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 2',\n * \t\t\t\t\tid: 'p2',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{\n * \t\t\t\t\t\t\tname: 'Descend 1 of page 2',\n * \t\t\t\t\t\t\tid: 'p21',\n * \t\t\t\t\t\t\tchildren: [\n * \t\t\t\t\t\t\t\t{\n * \t\t\t\t\t\t\t\t\tname: 'Descend 1 of Descend 1 of page 2',\n * \t\t\t\t\t\t\t\t\tid: 'p211',\n * \t\t\t\t\t\t\t\t},\n * \t\t\t\t\t\t\t],\n * \t\t\t\t\t\t},\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t] }\n * \t\t/>\n * \t);\n * }\n * ```\n */\n\nexport function TreeSelect( {\n\tlabel,\n\tnoOptionLabel,\n\tonChange,\n\tselectedId,\n\ttree = [],\n\t...props\n}: TreeSelectProps ) {\n\tconst options = useMemo( () => {\n\t\treturn [\n\t\t\tnoOptionLabel && { value: '', label: noOptionLabel },\n\t\t\t...getSelectOptions( tree ),\n\t\t].filter( < T, >( option: T ): option is Truthy< T > => !! option );\n\t}, [ noOptionLabel, tree ] );\n\n\treturn (\n\t\t<SelectControl\n\t\t\t{ ...{ label, options, onChange } }\n\t\t\tvalue={ selectedId }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default TreeSelect;\n"]}
|
|
@@ -9,8 +9,6 @@ exports.default = exports.Truncate = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
12
|
var _context = require("../ui/context");
|
|
15
13
|
|
|
16
14
|
var _view = require("../view");
|
|
@@ -26,11 +24,11 @@ var _hook = _interopRequireDefault(require("./hook"));
|
|
|
26
24
|
*/
|
|
27
25
|
function UnconnectedTruncate(props, forwardedRef) {
|
|
28
26
|
const truncateProps = (0, _hook.default)(props);
|
|
29
|
-
return (0, _element.createElement)(_view.View,
|
|
30
|
-
as: "span"
|
|
31
|
-
|
|
27
|
+
return (0, _element.createElement)(_view.View, {
|
|
28
|
+
as: "span",
|
|
29
|
+
...truncateProps,
|
|
32
30
|
ref: forwardedRef
|
|
33
|
-
})
|
|
31
|
+
});
|
|
34
32
|
}
|
|
35
33
|
/**
|
|
36
34
|
* `Truncate` is a typography primitive that trims text content.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/truncate/component.tsx"],"names":["UnconnectedTruncate","props","forwardedRef","truncateProps","Truncate"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/truncate/component.tsx"],"names":["UnconnectedTruncate","props","forwardedRef","truncateProps","Truncate"],"mappings":";;;;;;;;;;;AAQA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAMA,SAASA,mBAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,aAAa,GAAG,mBAAaF,KAAb,CAAtB;AAEA,SAAO,4BAAC,UAAD;AAAM,IAAA,EAAE,EAAC,MAAT;AAAA,OAAqBE,aAArB;AAAqC,IAAA,GAAG,EAAGD;AAA3C,IAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAME,QAAQ,GAAG,6BAAgBJ,mBAAhB,EAAqC,UAArC,CAAjB;;eAEQI,Q","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { contextConnect, WordPressComponentProps } from '../ui/context';\nimport { View } from '../view';\nimport useTruncate from './hook';\nimport type { TruncateProps } from './types';\n\nfunction UnconnectedTruncate(\n\tprops: WordPressComponentProps< TruncateProps, 'span' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst truncateProps = useTruncate( props );\n\n\treturn <View as=\"span\" { ...truncateProps } ref={ forwardedRef } />;\n}\n\n/**\n * `Truncate` is a typography primitive that trims text content.\n * For almost all cases, it is recommended that `Text`, `Heading`, or\n * `Subheading` is used to render text content. However,`Truncate` is\n * available for custom implementations.\n *\n * ```jsx\n * import { __experimentalTruncate as Truncate } from `@wordpress/components`;\n *\n * function Example() {\n * \treturn (\n * \t\t<Truncate>\n * \t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ex\n * \t\t\tneque, vulputate a diam et, luctus convallis lacus. Vestibulum ac\n * \t\t\tmollis mi. Morbi id elementum massa.\n * \t\t</Truncate>\n * \t);\n * }\n * ```\n */\nexport const Truncate = contextConnect( UnconnectedTruncate, 'Truncate' );\n\nexport default Truncate;\n"]}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -9,8 +7,6 @@ exports.default = void 0;
|
|
|
9
7
|
|
|
10
8
|
var _element = require("@wordpress/element");
|
|
11
9
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
10
|
var _flex = require("../../flex");
|
|
15
11
|
|
|
16
12
|
var _grid = require("../../grid");
|
|
@@ -41,20 +37,20 @@ function ControlGroup(props, forwardedRef) {
|
|
|
41
37
|
const isGrid = !!templateColumns;
|
|
42
38
|
|
|
43
39
|
if (isGrid) {
|
|
44
|
-
return (0, _element.createElement)(_grid.Grid,
|
|
40
|
+
return (0, _element.createElement)(_grid.Grid, {
|
|
45
41
|
gap: 0,
|
|
46
|
-
templateColumns: templateColumns
|
|
47
|
-
|
|
42
|
+
templateColumns: templateColumns,
|
|
43
|
+
...otherProps,
|
|
48
44
|
ref: forwardedRef
|
|
49
|
-
}
|
|
45
|
+
}, children);
|
|
50
46
|
}
|
|
51
47
|
|
|
52
|
-
return (0, _element.createElement)(_flex.Flex,
|
|
48
|
+
return (0, _element.createElement)(_flex.Flex, {
|
|
53
49
|
direction: direction,
|
|
54
|
-
gap: `-1px
|
|
55
|
-
|
|
50
|
+
gap: `-1px`,
|
|
51
|
+
...otherProps,
|
|
56
52
|
ref: forwardedRef
|
|
57
|
-
}
|
|
53
|
+
}, children);
|
|
58
54
|
}
|
|
59
55
|
/**
|
|
60
56
|
* `ControlGroup` is a layout-based component for rendering a group of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/control-group/component.js"],"names":["ControlGroup","props","forwardedRef","children","direction","templateColumns","otherProps","isGrid","ConnectedControlGroup"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/ui/control-group/component.js"],"names":["ControlGroup","props","forwardedRef","children","direction","templateColumns","otherProps","isGrid","ConnectedControlGroup"],"mappings":";;;;;;;;;AAOA;;AACA;;AACA;;AACA;;AAVA;AACA;AACA;;AAEA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA,SAASA,YAAT,CAAuBC,KAAvB,EAA8BC,YAA9B,EAA6C;AAC5C,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,SAAS,GAAG,KAFP;AAGLC,IAAAA,eAHK;AAIL,OAAGC;AAJE,MAKF,2BAAiBL,KAAjB,CALJ;AAOA,QAAMM,MAAM,GAAG,CAAC,CAAEF,eAAlB;;AAEA,MAAKE,MAAL,EAAc;AACb,WACC,4BAAC,UAAD;AACC,MAAA,GAAG,EAAG,CADP;AAEC,MAAA,eAAe,EAAGF,eAFnB;AAAA,SAGMC,UAHN;AAIC,MAAA,GAAG,EAAGJ;AAJP,OAMGC,QANH,CADD;AAUA;;AAED,SACC,4BAAC,UAAD;AACC,IAAA,SAAS,EAAGC,SADb;AAEC,IAAA,GAAG,EAAI,MAFR;AAAA,OAGME,UAHN;AAIC,IAAA,GAAG,EAAGJ;AAJP,KAMGC,QANH,CADD;AAUA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMK,qBAAqB,GAAG,6BAAgBR,YAAhB,EAA8B,cAA9B,CAA9B;eAEeQ,qB","sourcesContent":["/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\nimport { Flex } from '../../flex';\nimport { Grid } from '../../grid';\nimport { useControlGroup } from './hook';\nimport { contextConnect } from '../context';\n\n/**\n * @param {import('../context').WordPressComponentProps<import('./types').Props, 'div'>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction ControlGroup( props, forwardedRef ) {\n\tconst {\n\t\tchildren,\n\t\tdirection = 'row',\n\t\ttemplateColumns,\n\t\t...otherProps\n\t} = useControlGroup( props );\n\n\tconst isGrid = !! templateColumns;\n\n\tif ( isGrid ) {\n\t\treturn (\n\t\t\t<Grid\n\t\t\t\tgap={ 0 }\n\t\t\t\ttemplateColumns={ templateColumns }\n\t\t\t\t{ ...otherProps }\n\t\t\t\tref={ forwardedRef }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</Grid>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Flex\n\t\t\tdirection={ direction }\n\t\t\tgap={ `-1px` }\n\t\t\t{ ...otherProps }\n\t\t\tref={ forwardedRef }\n\t\t>\n\t\t\t{ children }\n\t\t</Flex>\n\t);\n}\n\n/**\n * `ControlGroup` is a layout-based component for rendering a group of\n * control-based components, such as `Button`, `Select` or `TextInput`.\n * Control components that render within `ControlGroup` automatically\n * have their borders offset and border-radii rounded.\n *\n * @example\n * ```jsx\n * import { Button, ControlGroup, Select, TextInput } from `@wordpress/components/ui`;\n *\n * function Example() {\n * return (\n * <ControlGroup templateColumns=\"auto 1fr auto\">\n * <Select />\n * <TextInput placeholder=\"First name\" />\n * <Button variant=\"primary\" />\n * </ControlGroup>\n * );\n * }\n * ```\n */\nconst ConnectedControlGroup = contextConnect( ControlGroup, 'ControlGroup' );\n\nexport default ConnectedControlGroup;\n"]}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -9,8 +7,6 @@ exports.default = void 0;
|
|
|
9
7
|
|
|
10
8
|
var _element = require("@wordpress/element");
|
|
11
9
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
10
|
var _context = require("../context");
|
|
15
11
|
|
|
16
12
|
var _view = require("../../view");
|
|
@@ -27,11 +23,11 @@ var _hook = require("./hook");
|
|
|
27
23
|
*/
|
|
28
24
|
function ControlLabel(props, forwardedRef) {
|
|
29
25
|
const controlLabelProps = (0, _hook.useControlLabel)(props);
|
|
30
|
-
return (0, _element.createElement)(_view.View,
|
|
31
|
-
as: "label"
|
|
32
|
-
|
|
26
|
+
return (0, _element.createElement)(_view.View, {
|
|
27
|
+
as: "label",
|
|
28
|
+
...controlLabelProps,
|
|
33
29
|
ref: forwardedRef
|
|
34
|
-
})
|
|
30
|
+
});
|
|
35
31
|
}
|
|
36
32
|
/**
|
|
37
33
|
* `ControlLabel` is a form component that works with `FormGroup` to provide a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/control-label/component.js"],"names":["ControlLabel","props","forwardedRef","controlLabelProps","ConnectedControlLabel"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/ui/control-label/component.js"],"names":["ControlLabel","props","forwardedRef","controlLabelProps","ConnectedControlLabel"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,YAAT,CAAuBC,KAAvB,EAA8BC,YAA9B,EAA6C;AAC5C,QAAMC,iBAAiB,GAAG,2BAAiBF,KAAjB,CAA1B;AAEA,SAAO,4BAAC,UAAD;AAAM,IAAA,EAAE,EAAC,OAAT;AAAA,OAAsBE,iBAAtB;AAA0C,IAAA,GAAG,EAAGD;AAAhD,IAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,qBAAqB,GAAG,6BAAgBJ,YAAhB,EAA8B,cAA9B,CAA9B;eAEeI,qB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../context';\nimport { View } from '../../view';\nimport { useControlLabel } from './hook';\n\n/**\n * @param {import('../context').WordPressComponentProps<import('./types').Props, 'label', false>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction ControlLabel( props, forwardedRef ) {\n\tconst controlLabelProps = useControlLabel( props );\n\n\treturn <View as=\"label\" { ...controlLabelProps } ref={ forwardedRef } />;\n}\n\n/**\n * `ControlLabel` is a form component that works with `FormGroup` to provide a\n * label for form elements (e.g. `Switch` or `TextInput`).\n *\n * ```jsx\n * import { ControlLabel, FormGroup, TextInput } from '@wordpress/components/ui';\n *\n * function Example() {\n * \treturn (\n * \t\t<FormGroup>\n * \t\t\t<ControlLabel>First Name</ControlLabel>\n * \t\t\t<TextInput />\n * \t\t</FormGroup>\n * \t);\n * }\n * ```\n */\nconst ConnectedControlLabel = contextConnect( ControlLabel, 'ControlLabel' );\n\nexport default ConnectedControlLabel;\n"]}
|
|
@@ -9,8 +9,6 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
12
|
var _vStack = require("../../v-stack");
|
|
15
13
|
|
|
16
14
|
var _formGroupContext = require("./form-group-context");
|
|
@@ -52,12 +50,13 @@ function FormGroupContent({
|
|
|
52
50
|
}, children, (0, _element.createElement)(_formGroupHelp.default, null, help)) : children;
|
|
53
51
|
return (0, _element.createElement)(_formGroupContext.FormGroupContext.Provider, {
|
|
54
52
|
value: contextProps
|
|
55
|
-
}, (0, _element.createElement)(_formGroupLabel.default,
|
|
53
|
+
}, (0, _element.createElement)(_formGroupLabel.default, {
|
|
56
54
|
align: alignLabel,
|
|
57
55
|
id: id,
|
|
58
56
|
labelHidden: labelHidden,
|
|
59
|
-
truncate: truncate
|
|
60
|
-
|
|
57
|
+
truncate: truncate,
|
|
58
|
+
...props
|
|
59
|
+
}, label), content);
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
var _default = (0, _element.memo)(FormGroupContent);
|