@wordpress/components 29.0.1-next.a9f418477.0 → 29.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -10
- package/LICENSE.md +1 -1
- package/build/alignment-matrix-control/icon.js +1 -0
- package/build/alignment-matrix-control/icon.js.map +1 -1
- package/build/alignment-matrix-control/index.js +1 -0
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +1 -0
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.native.js +1 -0
- package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build/autocomplete/get-default-use-items.js +1 -0
- package/build/autocomplete/get-default-use-items.js.map +1 -1
- package/build/autocomplete/index.js +1 -0
- package/build/autocomplete/index.js.map +1 -1
- package/build/badge/index.js +64 -0
- package/build/badge/index.js.map +1 -0
- package/build/badge/types.js +6 -0
- package/build/badge/types.js.map +1 -0
- package/build/border-box-control/utils.js +1 -0
- package/build/border-box-control/utils.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +1 -0
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/border-control-style-picker/component.js +1 -0
- package/build/border-control/border-control-style-picker/component.js.map +1 -1
- package/build/box-control/index.js +18 -14
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/input-control.js +222 -0
- package/build/box-control/input-control.js.map +1 -0
- package/build/box-control/types.js.map +1 -1
- package/build/box-control/utils.js +101 -48
- package/build/box-control/utils.js.map +1 -1
- package/build/button/index.native.js +1 -0
- package/build/button/index.native.js.map +1 -1
- package/build/button/types.js.map +1 -1
- package/build/button-group/index.js +10 -0
- package/build/button-group/index.js.map +1 -1
- package/build/button-group/types.js.map +1 -1
- package/build/color-indicator/index.native.js +1 -0
- package/build/color-indicator/index.native.js.map +1 -1
- package/build/color-palette/index.js +1 -0
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/index.native.js +1 -0
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-palette/utils.js +1 -0
- package/build/color-palette/utils.js.map +1 -1
- package/build/combobox-control/index.js +1 -0
- package/build/combobox-control/index.js.map +1 -1
- package/build/composite/legacy/index.js +1 -0
- package/build/composite/legacy/index.js.map +1 -1
- package/build/context/context-connect.js +1 -0
- package/build/context/context-connect.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.js +1 -0
- package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/index.js +1 -0
- package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/utils.js +1 -0
- package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
- package/build/custom-gradient-picker/index.js +1 -0
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/custom-gradient-picker/serializer.js +1 -0
- package/build/custom-gradient-picker/serializer.js.map +1 -1
- package/build/custom-gradient-picker/utils.js +1 -0
- package/build/custom-gradient-picker/utils.js.map +1 -1
- package/build/custom-select-control/index.js +2 -3
- package/build/custom-select-control/index.js.map +1 -1
- package/build/custom-select-control-v2/custom-select.js +2 -3
- package/build/custom-select-control-v2/custom-select.js.map +1 -1
- package/build/dashicon/index.js +1 -0
- package/build/dashicon/index.js.map +1 -1
- package/build/date-time/date/index.js +2 -0
- package/build/date-time/date/index.js.map +1 -1
- package/build/date-time/date/use-lilius/index.js +1 -0
- package/build/date-time/date/use-lilius/index.js.map +1 -1
- package/build/date-time/time/index.js +1 -0
- package/build/date-time/time/index.js.map +1 -1
- package/build/dimension-control/index.js +2 -0
- package/build/dimension-control/index.js.map +1 -1
- package/build/dimension-control/sizes.js +1 -0
- package/build/dimension-control/sizes.js.map +1 -1
- package/build/draggable/index.js +1 -0
- package/build/draggable/index.js.map +1 -1
- package/build/draggable/index.native.js +1 -0
- package/build/draggable/index.native.js.map +1 -1
- package/build/dropdown-menu/index.js +1 -0
- package/build/dropdown-menu/index.js.map +1 -1
- package/build/dropdown-menu/index.native.js +1 -0
- package/build/dropdown-menu/index.native.js.map +1 -1
- package/build/duotone-picker/color-list-picker/index.js +1 -0
- package/build/duotone-picker/color-list-picker/index.js.map +1 -1
- package/build/duotone-picker/duotone-picker.js +1 -0
- package/build/duotone-picker/duotone-picker.js.map +1 -1
- package/build/duotone-picker/utils.js +1 -0
- package/build/duotone-picker/utils.js.map +1 -1
- package/build/external-link/index.js +1 -0
- package/build/external-link/index.js.map +1 -1
- package/build/font-size-picker/font-size-picker-select.js +1 -0
- package/build/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build/font-size-picker/font-size-picker-toggle-group.js +1 -0
- package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
- package/build/font-size-picker/index.js +1 -0
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/index.native.js +1 -0
- package/build/font-size-picker/index.native.js.map +1 -1
- package/build/font-size-picker/styles.js +9 -9
- package/build/font-size-picker/styles.js.map +1 -1
- package/build/font-size-picker/utils.js +1 -0
- package/build/font-size-picker/utils.js.map +1 -1
- package/build/form-token-field/index.js +1 -0
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +1 -0
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/gradient-picker/index.js +1 -0
- package/build/gradient-picker/index.js.map +1 -1
- package/build/guide/index.js +1 -0
- package/build/guide/index.js.map +1 -1
- package/build/guide/page-control.js +1 -0
- package/build/guide/page-control.js.map +1 -1
- package/build/h-stack/hook.js +1 -0
- package/build/h-stack/hook.js.map +1 -1
- package/build/heading/hook.js +1 -1
- package/build/heading/hook.js.map +1 -1
- package/build/higher-order/navigate-regions/index.js +1 -0
- package/build/higher-order/navigate-regions/index.js.map +1 -1
- package/build/higher-order/with-fallback-styles/index.js +1 -0
- package/build/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build/higher-order/with-filters/index.js +1 -0
- package/build/higher-order/with-filters/index.js.map +1 -1
- package/build/higher-order/with-notices/index.js +1 -0
- package/build/higher-order/with-notices/index.js.map +1 -1
- package/build/input-control/index.js +9 -0
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/types.js.map +1 -1
- package/build/keyboard-shortcuts/index.js +1 -0
- package/build/keyboard-shortcuts/index.js.map +1 -1
- package/build/menu/checkbox-item.js +2 -0
- package/build/menu/checkbox-item.js.map +1 -1
- package/build/menu/index.js +25 -94
- package/build/menu/index.js.map +1 -1
- package/build/menu/item.js +10 -1
- package/build/menu/item.js.map +1 -1
- package/build/menu/popover.js +89 -0
- package/build/menu/popover.js.map +1 -0
- package/build/menu/radio-item.js +2 -0
- package/build/menu/radio-item.js.map +1 -1
- package/build/menu/styles.js +16 -16
- package/build/menu/styles.js.map +1 -1
- package/build/menu/submenu-trigger-item.js +58 -0
- package/build/menu/submenu-trigger-item.js.map +1 -0
- package/build/menu/trigger-button.js +45 -0
- package/build/menu/trigger-button.js.map +1 -0
- package/build/menu/types.js.map +1 -1
- package/build/menu-items-choice/index.js +1 -0
- package/build/menu-items-choice/index.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -0
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
- package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +1 -0
- package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
- package/build/mobile/bottom-sheet/picker-cell.native.js +1 -0
- package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet-select-control/index.native.js +1 -0
- package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +1 -0
- package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build/mobile/gradient/index.native.js +1 -0
- package/build/mobile/gradient/index.native.js.map +1 -1
- package/build/mobile/media-edit/index.native.js +1 -0
- package/build/mobile/media-edit/index.native.js.map +1 -1
- package/build/mobile/picker/index.android.js +1 -0
- package/build/mobile/picker/index.android.js.map +1 -1
- package/build/mobile/picker/index.ios.js +1 -0
- package/build/mobile/picker/index.ios.js.map +1 -1
- package/build/mobile/segmented-control/index.native.js +1 -0
- package/build/mobile/segmented-control/index.native.js.map +1 -1
- package/build/mobile/utils/get-px-from-css-unit.native.js +1 -0
- package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
- package/build/navigable-container/container.js +1 -0
- package/build/navigable-container/container.js.map +1 -1
- package/build/navigation/back-button/index.js +1 -0
- package/build/navigation/back-button/index.js.map +1 -1
- package/build/navigation/group/index.js +1 -0
- package/build/navigation/group/index.js.map +1 -1
- package/build/navigation/index.js +6 -0
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/item/index.js +1 -0
- package/build/navigation/item/index.js.map +1 -1
- package/build/navigation/menu/menu-title-search.js +1 -0
- package/build/navigation/menu/menu-title-search.js.map +1 -1
- package/build/navigation/menu/search-no-results-found.js +1 -0
- package/build/navigation/menu/search-no-results-found.js.map +1 -1
- package/build/navigation/styles/navigation-styles.js +12 -12
- package/build/navigation/styles/navigation-styles.js.map +1 -1
- package/build/navigator/navigator/component.js +1 -0
- package/build/navigator/navigator/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +1 -0
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/navigator/utils/router.js +1 -0
- package/build/navigator/utils/router.js.map +1 -1
- package/build/notice/index.js +1 -0
- package/build/notice/index.js.map +1 -1
- package/build/notice/list.js +1 -0
- package/build/notice/list.js.map +1 -1
- package/build/notice/list.native.js +1 -0
- package/build/notice/list.native.js.map +1 -1
- package/build/number-control/index.js +1 -0
- package/build/number-control/index.js.map +1 -1
- package/build/palette-edit/index.js +2 -0
- package/build/palette-edit/index.js.map +1 -1
- package/build/panel/actions.native.js +1 -0
- package/build/panel/actions.native.js.map +1 -1
- package/build/private-apis.js +3 -1
- package/build/private-apis.js.map +1 -1
- package/build/query-controls/index.js +1 -0
- package/build/query-controls/index.js.map +1 -1
- package/build/query-controls/terms.js +1 -0
- package/build/query-controls/terms.js.map +1 -1
- package/build/radio-control/index.js +1 -0
- package/build/radio-control/index.js.map +1 -1
- package/build/radio-control/index.native.js +1 -0
- package/build/radio-control/index.native.js.map +1 -1
- package/build/radio-group/index.js +6 -0
- package/build/radio-group/index.js.map +1 -1
- package/build/radio-group/radio.js +2 -3
- package/build/radio-group/radio.js.map +1 -1
- package/build/range-control/rail.js +1 -0
- package/build/range-control/rail.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +28 -28
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/resizable-box/index.js +1 -0
- package/build/resizable-box/index.js.map +1 -1
- package/build/sandbox/index.js +1 -0
- package/build/sandbox/index.js.map +1 -1
- package/build/sandbox/index.native.js +1 -0
- package/build/sandbox/index.native.js.map +1 -1
- package/build/search-control/index.native.js +1 -0
- package/build/search-control/index.native.js.map +1 -1
- package/build/select-control/index.js +10 -0
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/types.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -0
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build/slot-fill/context.js +4 -3
- package/build/slot-fill/context.js.map +1 -1
- package/build/slot-fill/fill.js +10 -15
- package/build/slot-fill/fill.js.map +1 -1
- package/build/slot-fill/provider.js +42 -55
- package/build/slot-fill/provider.js.map +1 -1
- package/build/slot-fill/slot.js +32 -23
- package/build/slot-fill/slot.js.map +1 -1
- package/build/slot-fill/types.js.map +1 -1
- package/build/snackbar/index.js +1 -0
- package/build/snackbar/index.js.map +1 -1
- package/build/snackbar/list.js +1 -0
- package/build/snackbar/list.js.map +1 -1
- package/build/tab-panel/index.js +3 -3
- package/build/tab-panel/index.js.map +1 -1
- package/build/tabs/index.js +22 -4
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/types.js.map +1 -1
- package/build/text/hook.js +6 -6
- package/build/text/hook.js.map +1 -1
- package/build/text/styles.js +7 -7
- package/build/text/styles.js.map +1 -1
- package/build/text/utils.js +1 -0
- package/build/text/utils.js.map +1 -1
- package/build/theme/color-algorithms.js +1 -0
- package/build/theme/color-algorithms.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js +2 -3
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js +8 -8
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build/toolbar/toolbar-group/index.js +1 -0
- package/build/toolbar/toolbar-group/index.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +1 -0
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +1 -0
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tooltip/index.js +2 -3
- package/build/tooltip/index.js.map +1 -1
- package/build/tree-grid/index.js +1 -0
- package/build/tree-grid/index.js.map +1 -1
- package/build/tree-select/index.js +11 -2
- package/build/tree-select/index.js.map +1 -1
- package/build/tree-select/types.js.map +1 -1
- package/build/unit-control/index.js +1 -0
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/index.native.js +1 -0
- package/build/unit-control/index.native.js.map +1 -1
- package/build/unit-control/unit-select-control.js +1 -0
- package/build/unit-control/unit-select-control.js.map +1 -1
- package/build/unit-control/utils.js +1 -0
- package/build/unit-control/utils.js.map +1 -1
- package/build/utils/colors-values.js +3 -0
- package/build/utils/colors-values.js.map +1 -1
- package/build/utils/config-values.js +0 -1
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/get-valid-children.js +1 -0
- package/build/utils/get-valid-children.js.map +1 -1
- package/build/utils/hooks/use-animated-offset-rect.js +1 -0
- package/build/utils/hooks/use-animated-offset-rect.js.map +1 -1
- package/build/utils/hooks/use-cx.js +1 -0
- package/build/utils/hooks/use-cx.js.map +1 -1
- package/build/utils/math.js +1 -0
- package/build/utils/math.js.map +1 -1
- package/build/utils/rtl.js +1 -0
- package/build/utils/rtl.js.map +1 -1
- package/build/utils/values.js +1 -0
- package/build/utils/values.js.map +1 -1
- package/build/z-stack/component.js +1 -0
- package/build/z-stack/component.js.map +1 -1
- package/build-module/alignment-matrix-control/icon.js +1 -0
- package/build-module/alignment-matrix-control/icon.js.map +1 -1
- package/build-module/alignment-matrix-control/index.js +1 -0
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +1 -0
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.native.js +1 -0
- package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build-module/autocomplete/get-default-use-items.js +1 -0
- package/build-module/autocomplete/get-default-use-items.js.map +1 -1
- package/build-module/autocomplete/index.js +1 -0
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/badge/index.js +57 -0
- package/build-module/badge/index.js.map +1 -0
- package/build-module/badge/types.js +2 -0
- package/build-module/badge/types.js.map +1 -0
- package/build-module/border-box-control/utils.js +1 -0
- package/build-module/border-box-control/utils.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +1 -0
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/border-control-style-picker/component.js +1 -0
- package/build-module/border-control/border-control-style-picker/component.js.map +1 -1
- package/build-module/box-control/index.js +20 -16
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-control.js +214 -0
- package/build-module/box-control/input-control.js.map +1 -0
- package/build-module/box-control/types.js.map +1 -1
- package/build-module/box-control/utils.js +95 -46
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/button/index.native.js +1 -0
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/button/types.js.map +1 -1
- package/build-module/button-group/index.js +10 -0
- package/build-module/button-group/index.js.map +1 -1
- package/build-module/button-group/types.js.map +1 -1
- package/build-module/color-indicator/index.native.js +1 -0
- package/build-module/color-indicator/index.native.js.map +1 -1
- package/build-module/color-palette/index.js +1 -0
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +1 -0
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-palette/utils.js +1 -0
- package/build-module/color-palette/utils.js.map +1 -1
- package/build-module/combobox-control/index.js +1 -0
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/composite/legacy/index.js +1 -0
- package/build-module/composite/legacy/index.js.map +1 -1
- package/build-module/context/context-connect.js +1 -0
- package/build-module/context/context-connect.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +1 -0
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -0
- package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/utils.js +1 -0
- package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +1 -0
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/custom-gradient-picker/serializer.js +1 -0
- package/build-module/custom-gradient-picker/serializer.js.map +1 -1
- package/build-module/custom-gradient-picker/utils.js +1 -0
- package/build-module/custom-gradient-picker/utils.js.map +1 -1
- package/build-module/custom-select-control/index.js +2 -3
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/custom-select-control-v2/custom-select.js +1 -2
- package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
- package/build-module/dashicon/index.js +1 -0
- package/build-module/dashicon/index.js.map +1 -1
- package/build-module/date-time/date/index.js +2 -0
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/date-time/date/use-lilius/index.js +1 -0
- package/build-module/date-time/date/use-lilius/index.js.map +1 -1
- package/build-module/date-time/time/index.js +1 -0
- package/build-module/date-time/time/index.js.map +1 -1
- package/build-module/dimension-control/index.js +2 -0
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/dimension-control/sizes.js +1 -0
- package/build-module/dimension-control/sizes.js.map +1 -1
- package/build-module/draggable/index.js +1 -0
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/draggable/index.native.js +1 -0
- package/build-module/draggable/index.native.js.map +1 -1
- package/build-module/dropdown-menu/index.js +1 -0
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/dropdown-menu/index.native.js +1 -0
- package/build-module/dropdown-menu/index.native.js.map +1 -1
- package/build-module/duotone-picker/color-list-picker/index.js +1 -0
- package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
- package/build-module/duotone-picker/duotone-picker.js +1 -0
- package/build-module/duotone-picker/duotone-picker.js.map +1 -1
- package/build-module/duotone-picker/utils.js +1 -0
- package/build-module/duotone-picker/utils.js.map +1 -1
- package/build-module/external-link/index.js +1 -0
- package/build-module/external-link/index.js.map +1 -1
- package/build-module/font-size-picker/font-size-picker-select.js +1 -0
- package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build-module/font-size-picker/font-size-picker-toggle-group.js +1 -0
- package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
- package/build-module/font-size-picker/index.js +1 -0
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/index.native.js +1 -0
- package/build-module/font-size-picker/index.native.js.map +1 -1
- package/build-module/font-size-picker/styles.js +9 -9
- package/build-module/font-size-picker/styles.js.map +1 -1
- package/build-module/font-size-picker/utils.js +1 -0
- package/build-module/font-size-picker/utils.js.map +1 -1
- package/build-module/form-token-field/index.js +1 -0
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +1 -0
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/gradient-picker/index.js +1 -0
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/guide/index.js +1 -0
- package/build-module/guide/index.js.map +1 -1
- package/build-module/guide/page-control.js +1 -0
- package/build-module/guide/page-control.js.map +1 -1
- package/build-module/h-stack/hook.js +1 -0
- package/build-module/h-stack/hook.js.map +1 -1
- package/build-module/heading/hook.js +1 -1
- package/build-module/heading/hook.js.map +1 -1
- package/build-module/higher-order/navigate-regions/index.js +1 -0
- package/build-module/higher-order/navigate-regions/index.js.map +1 -1
- package/build-module/higher-order/with-fallback-styles/index.js +1 -0
- package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build-module/higher-order/with-filters/index.js +1 -0
- package/build-module/higher-order/with-filters/index.js.map +1 -1
- package/build-module/higher-order/with-notices/index.js +1 -0
- package/build-module/higher-order/with-notices/index.js.map +1 -1
- package/build-module/input-control/index.js +9 -0
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/types.js.map +1 -1
- package/build-module/keyboard-shortcuts/index.js +1 -0
- package/build-module/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/menu/checkbox-item.js +2 -0
- package/build-module/menu/checkbox-item.js.map +1 -1
- package/build-module/menu/index.js +28 -97
- package/build-module/menu/index.js.map +1 -1
- package/build-module/menu/item.js +10 -1
- package/build-module/menu/item.js.map +1 -1
- package/build-module/menu/popover.js +81 -0
- package/build-module/menu/popover.js.map +1 -0
- package/build-module/menu/radio-item.js +2 -0
- package/build-module/menu/radio-item.js.map +1 -1
- package/build-module/menu/styles.js +16 -16
- package/build-module/menu/styles.js.map +1 -1
- package/build-module/menu/submenu-trigger-item.js +50 -0
- package/build-module/menu/submenu-trigger-item.js.map +1 -0
- package/build-module/menu/trigger-button.js +37 -0
- package/build-module/menu/trigger-button.js.map +1 -0
- package/build-module/menu/types.js.map +1 -1
- package/build-module/menu-items-choice/index.js +1 -0
- package/build-module/menu-items-choice/index.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -0
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js +1 -0
- package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/picker-cell.native.js +1 -0
- package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-select-control/index.native.js +1 -0
- package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +1 -0
- package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build-module/mobile/gradient/index.native.js +1 -0
- package/build-module/mobile/gradient/index.native.js.map +1 -1
- package/build-module/mobile/media-edit/index.native.js +1 -0
- package/build-module/mobile/media-edit/index.native.js.map +1 -1
- package/build-module/mobile/picker/index.android.js +1 -0
- package/build-module/mobile/picker/index.android.js.map +1 -1
- package/build-module/mobile/picker/index.ios.js +1 -0
- package/build-module/mobile/picker/index.ios.js.map +1 -1
- package/build-module/mobile/segmented-control/index.native.js +1 -0
- package/build-module/mobile/segmented-control/index.native.js.map +1 -1
- package/build-module/mobile/utils/get-px-from-css-unit.native.js +1 -0
- package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
- package/build-module/navigable-container/container.js +1 -0
- package/build-module/navigable-container/container.js.map +1 -1
- package/build-module/navigation/back-button/index.js +1 -0
- package/build-module/navigation/back-button/index.js.map +1 -1
- package/build-module/navigation/group/index.js +1 -0
- package/build-module/navigation/group/index.js.map +1 -1
- package/build-module/navigation/index.js +6 -0
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/item/index.js +1 -0
- package/build-module/navigation/item/index.js.map +1 -1
- package/build-module/navigation/menu/menu-title-search.js +1 -0
- package/build-module/navigation/menu/menu-title-search.js.map +1 -1
- package/build-module/navigation/menu/search-no-results-found.js +1 -0
- package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
- package/build-module/navigation/styles/navigation-styles.js +12 -12
- package/build-module/navigation/styles/navigation-styles.js.map +1 -1
- package/build-module/navigator/navigator/component.js +1 -0
- package/build-module/navigator/navigator/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +1 -0
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/navigator/utils/router.js +1 -0
- package/build-module/navigator/utils/router.js.map +1 -1
- package/build-module/notice/index.js +1 -0
- package/build-module/notice/index.js.map +1 -1
- package/build-module/notice/list.js +1 -0
- package/build-module/notice/list.js.map +1 -1
- package/build-module/notice/list.native.js +1 -0
- package/build-module/notice/list.native.js.map +1 -1
- package/build-module/number-control/index.js +1 -0
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/palette-edit/index.js +2 -0
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/panel/actions.native.js +1 -0
- package/build-module/panel/actions.native.js.map +1 -1
- package/build-module/private-apis.js +3 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/query-controls/index.js +1 -0
- package/build-module/query-controls/index.js.map +1 -1
- package/build-module/query-controls/terms.js +1 -0
- package/build-module/query-controls/terms.js.map +1 -1
- package/build-module/radio-control/index.js +1 -0
- package/build-module/radio-control/index.js.map +1 -1
- package/build-module/radio-control/index.native.js +1 -0
- package/build-module/radio-control/index.native.js.map +1 -1
- package/build-module/radio-group/index.js +6 -0
- package/build-module/radio-group/index.js.map +1 -1
- package/build-module/radio-group/radio.js +1 -2
- package/build-module/radio-group/radio.js.map +1 -1
- package/build-module/range-control/rail.js +1 -0
- package/build-module/range-control/rail.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +28 -28
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/resizable-box/index.js +1 -0
- package/build-module/resizable-box/index.js.map +1 -1
- package/build-module/sandbox/index.js +1 -0
- package/build-module/sandbox/index.js.map +1 -1
- package/build-module/sandbox/index.native.js +1 -0
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/search-control/index.native.js +1 -0
- package/build-module/search-control/index.native.js.map +1 -1
- package/build-module/select-control/index.js +10 -0
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/types.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -0
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build-module/slot-fill/context.js +5 -3
- package/build-module/slot-fill/context.js.map +1 -1
- package/build-module/slot-fill/fill.js +10 -15
- package/build-module/slot-fill/fill.js.map +1 -1
- package/build-module/slot-fill/provider.js +42 -55
- package/build-module/slot-fill/provider.js.map +1 -1
- package/build-module/slot-fill/slot.js +33 -24
- package/build-module/slot-fill/slot.js.map +1 -1
- package/build-module/slot-fill/types.js.map +1 -1
- package/build-module/snackbar/index.js +1 -0
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/snackbar/list.js +1 -0
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/tab-panel/index.js +2 -2
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/tabs/index.js +22 -4
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/types.js.map +1 -1
- package/build-module/text/hook.js +6 -6
- package/build-module/text/hook.js.map +1 -1
- package/build-module/text/styles.js +7 -7
- package/build-module/text/styles.js.map +1 -1
- package/build-module/text/utils.js +1 -0
- package/build-module/text/utils.js.map +1 -1
- package/build-module/theme/color-algorithms.js +1 -0
- package/build-module/theme/color-algorithms.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +1 -2
- 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/styles.js +7 -7
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +8 -8
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build-module/toolbar/toolbar-group/index.js +1 -0
- package/build-module/toolbar/toolbar-group/index.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +1 -0
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +1 -0
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tooltip/index.js +1 -2
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tree-grid/index.js +1 -0
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/tree-select/index.js +11 -2
- package/build-module/tree-select/index.js.map +1 -1
- package/build-module/tree-select/types.js.map +1 -1
- package/build-module/unit-control/index.js +1 -0
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/index.native.js +1 -0
- package/build-module/unit-control/index.native.js.map +1 -1
- package/build-module/unit-control/unit-select-control.js +1 -0
- package/build-module/unit-control/unit-select-control.js.map +1 -1
- package/build-module/unit-control/utils.js +1 -0
- package/build-module/unit-control/utils.js.map +1 -1
- package/build-module/utils/colors-values.js +3 -0
- package/build-module/utils/colors-values.js.map +1 -1
- package/build-module/utils/config-values.js +0 -1
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/get-valid-children.js +1 -0
- package/build-module/utils/get-valid-children.js.map +1 -1
- package/build-module/utils/hooks/use-animated-offset-rect.js +1 -0
- package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -1
- package/build-module/utils/hooks/use-cx.js +1 -0
- package/build-module/utils/hooks/use-cx.js.map +1 -1
- package/build-module/utils/math.js +1 -0
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/rtl.js +1 -0
- package/build-module/utils/rtl.js.map +1 -1
- package/build-module/utils/values.js +1 -0
- package/build-module/utils/values.js.map +1 -1
- package/build-module/z-stack/component.js +1 -0
- package/build-module/z-stack/component.js.map +1 -1
- package/build-style/style-rtl.css +60 -13
- package/build-style/style.css +60 -13
- package/build-types/alignment-matrix-control/stories/index.story.d.ts +1 -1
- package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
- package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
- package/build-types/animate/stories/index.story.d.ts +7 -7
- package/build-types/animate/stories/index.story.d.ts.map +1 -1
- package/build-types/badge/index.d.ts +8 -0
- package/build-types/badge/index.d.ts.map +1 -0
- package/build-types/badge/stories/index.story.d.ts +17 -0
- package/build-types/badge/stories/index.story.d.ts.map +1 -0
- package/build-types/badge/test/index.d.ts +2 -0
- package/build-types/badge/test/index.d.ts.map +1 -0
- package/build-types/badge/types.d.ts +13 -0
- package/build-types/badge/types.d.ts.map +1 -0
- package/build-types/base-control/stories/index.story.d.ts +1 -1
- package/build-types/border-box-control/stories/index.story.d.ts +1 -1
- package/build-types/border-control/stories/index.story.d.ts +5 -5
- package/build-types/box-control/index.d.ts +1 -1
- package/build-types/box-control/index.d.ts.map +1 -1
- package/build-types/box-control/input-control.d.ts +3 -0
- package/build-types/box-control/input-control.d.ts.map +1 -0
- package/build-types/box-control/stories/index.story.d.ts +356 -11
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/styles/box-control-styles.d.ts +2 -2
- package/build-types/box-control/types.d.ts +26 -1
- package/build-types/box-control/types.d.ts.map +1 -1
- package/build-types/box-control/utils.d.ts +49 -15
- package/build-types/box-control/utils.d.ts.map +1 -1
- package/build-types/button/stories/e2e/index.story.d.ts +1 -1
- package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts +25 -7
- package/build-types/button/stories/index.story.d.ts.map +1 -1
- package/build-types/button/types.d.ts +6 -4
- package/build-types/button/types.d.ts.map +1 -1
- package/build-types/button-group/index.d.ts +3 -1
- package/build-types/button-group/index.d.ts.map +1 -1
- package/build-types/button-group/stories/index.story.d.ts +6 -0
- package/build-types/button-group/stories/index.story.d.ts.map +1 -1
- package/build-types/button-group/types.d.ts +7 -0
- package/build-types/button-group/types.d.ts.map +1 -1
- package/build-types/circular-option-picker/stories/index.story.d.ts +5 -5
- package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/color-palette/stories/index.story.d.ts +3 -3
- package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +2 -2
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts +4 -4
- package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
- package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/stories/index.story.d.ts +1 -1
- package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-select-control/stories/index.story.d.ts +3 -3
- package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/stories/index.story.d.ts +3 -3
- package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/date-time/stories/time.story.d.ts +1 -1
- package/build-types/date-time/stories/time.story.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts +4 -4
- package/build-types/dimension-control/index.d.ts.map +1 -1
- package/build-types/dimension-control/stories/index.story.d.ts +1 -1
- package/build-types/disabled/stories/index.story.d.ts.map +1 -1
- package/build-types/drop-zone/stories/index.story.d.ts +1 -1
- package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
- package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +1 -1
- package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +1 -1
- package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +3 -3
- package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
- package/build-types/focal-point-picker/stories/index.story.d.ts +4 -4
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
- package/build-types/font-size-picker/styles.d.ts.map +1 -1
- package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
- package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
- package/build-types/gradient-picker/stories/index.story.d.ts +3 -3
- package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/guide/stories/index.story.d.ts +1 -1
- package/build-types/guide/stories/index.story.d.ts.map +1 -1
- package/build-types/icon/stories/index.story.d.ts +4 -4
- package/build-types/icon/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/index.d.ts +1 -0
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/stories/index.story.d.ts +7 -7
- package/build-types/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +11 -2
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts +1 -1
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
- package/build-types/menu/checkbox-item.d.ts.map +1 -1
- package/build-types/menu/index.d.ts +10 -1
- package/build-types/menu/index.d.ts.map +1 -1
- package/build-types/menu/item.d.ts.map +1 -1
- package/build-types/menu/popover.d.ts +3 -0
- package/build-types/menu/popover.d.ts.map +1 -0
- package/build-types/menu/radio-item.d.ts.map +1 -1
- package/build-types/menu/stories/index.story.d.ts +9 -9
- package/build-types/menu/stories/index.story.d.ts.map +1 -1
- package/build-types/menu/submenu-trigger-item.d.ts +3 -0
- package/build-types/menu/submenu-trigger-item.d.ts.map +1 -0
- package/build-types/menu/trigger-button.d.ts +3 -0
- package/build-types/menu/trigger-button.d.ts.map +1 -0
- package/build-types/menu/types.d.ts +208 -57
- package/build-types/menu/types.d.ts.map +1 -1
- package/build-types/menu-group/stories/index.story.d.ts +1 -1
- package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-item/stories/index.story.d.ts +4 -4
- package/build-types/modal/stories/index.story.d.ts.map +1 -1
- package/build-types/navigation/back-button/index.d.ts.map +1 -1
- package/build-types/navigation/index.d.ts.map +1 -1
- package/build-types/navigation/item/index.d.ts.map +1 -1
- package/build-types/navigation/stories/index.story.d.ts +6 -6
- package/build-types/navigation/stories/index.story.d.ts.map +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
- package/build-types/notice/stories/index.story.d.ts +4 -4
- package/build-types/notice/stories/index.story.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts +1 -1
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/stories/index.story.d.ts +2 -2
- package/build-types/palette-edit/index.d.ts.map +1 -1
- package/build-types/palette-edit/stories/index.story.d.ts +2 -2
- package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/progress-bar/stories/index.story.d.ts +1 -1
- package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
- package/build-types/query-controls/stories/index.story.d.ts +1 -1
- package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
- package/build-types/radio-group/index.d.ts.map +1 -1
- package/build-types/radio-group/radio.d.ts.map +1 -1
- package/build-types/range-control/index.d.ts +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.story.d.ts +2 -2
- package/build-types/responsive-wrapper/stories/index.story.d.ts +1 -1
- package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
- package/build-types/sandbox/stories/index.story.d.ts +1 -1
- package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
- package/build-types/search-control/stories/index.story.d.ts +1 -1
- package/build-types/search-control/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts +1 -0
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/stories/index.story.d.ts +5 -5
- package/build-types/select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/types.d.ts +1 -1
- package/build-types/select-control/types.d.ts.map +1 -1
- package/build-types/shortcut/stories/index.story.d.ts +1 -1
- package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
- package/build-types/slot-fill/context.d.ts.map +1 -1
- package/build-types/slot-fill/fill.d.ts.map +1 -1
- package/build-types/slot-fill/provider.d.ts.map +1 -1
- package/build-types/slot-fill/slot.d.ts.map +1 -1
- package/build-types/slot-fill/types.d.ts +13 -11
- package/build-types/slot-fill/types.d.ts.map +1 -1
- package/build-types/tab-panel/index.d.ts.map +1 -1
- package/build-types/tab-panel/stories/index.story.d.ts +4 -4
- package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/index.d.ts +21 -4
- package/build-types/tabs/index.d.ts.map +1 -1
- package/build-types/tabs/stories/index.story.d.ts +10 -10
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/types.d.ts +13 -13
- package/build-types/tabs/types.d.ts.map +1 -1
- package/build-types/text/stories/index.story.d.ts +3 -3
- package/build-types/theme/stories/index.story.d.ts +1 -1
- package/build-types/toggle-control/stories/index.story.d.ts +2 -2
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
- package/build-types/toolbar/stories/index.story.d.ts +3 -3
- package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/tooltip/stories/index.story.d.ts +1 -1
- package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-select/index.d.ts +3 -2
- package/build-types/tree-select/index.d.ts.map +1 -1
- package/build-types/tree-select/stories/index.story.d.ts +1 -1
- package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-select/types.d.ts +5 -1
- package/build-types/tree-select/types.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
- package/build-types/utils/colors-values.d.ts +3 -0
- package/build-types/utils/colors-values.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +0 -1
- package/build-types/v-stack/stories/index.story.d.ts +1 -1
- package/package.json +19 -19
- package/src/alignment-matrix-control/README.md +16 -15
- package/src/angle-picker-control/README.md +10 -9
- package/src/badge/README.md +24 -0
- package/src/badge/docs-manifest.json +5 -0
- package/src/badge/index.tsx +67 -0
- package/src/badge/stories/index.story.tsx +54 -0
- package/src/badge/styles.scss +49 -0
- package/src/badge/test/index.tsx +45 -0
- package/src/badge/types.ts +12 -0
- package/src/base-control/README.md +22 -21
- package/src/box-control/README.md +41 -24
- package/src/box-control/index.tsx +28 -14
- package/src/box-control/input-control.tsx +299 -0
- package/src/box-control/stories/index.story.tsx +12 -0
- package/src/box-control/types.ts +27 -1
- package/src/box-control/utils.ts +122 -60
- package/src/button/README.md +110 -220
- package/src/button/docs-manifest.json +5 -0
- package/src/button/stories/best-practices.mdx +31 -0
- package/src/button/stories/index.story.tsx +18 -0
- package/src/button/style.scss +9 -10
- package/src/button/test/index.tsx +9 -2
- package/src/button/types.ts +6 -4
- package/src/button-group/README.md +4 -0
- package/src/button-group/index.tsx +11 -1
- package/src/button-group/stories/index.story.tsx +8 -1
- package/src/button-group/types.ts +7 -0
- package/src/custom-select-control/index.tsx +1 -1
- package/src/custom-select-control-v2/custom-select.tsx +1 -2
- package/src/custom-select-control-v2/stories/index.story.tsx +4 -0
- package/src/date-time/date/index.tsx +1 -0
- package/src/dimension-control/index.tsx +1 -0
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -4
- package/src/disabled/stories/index.story.tsx +1 -0
- package/src/drop-zone/stories/index.story.tsx +7 -1
- package/src/font-size-picker/styles.ts +1 -0
- package/src/form-file-upload/README.md +22 -21
- package/src/gradient-picker/README.md +36 -35
- package/src/heading/hook.ts +1 -1
- package/src/heading/test/__snapshots__/index.tsx.snap +4 -4
- package/src/icon/README.md +9 -8
- package/src/input-control/README.md +1 -0
- package/src/input-control/index.tsx +10 -0
- package/src/input-control/stories/index.story.tsx +6 -1
- package/src/input-control/test/index.js +9 -3
- package/src/input-control/types.ts +11 -2
- package/src/menu/checkbox-item.tsx +2 -1
- package/src/menu/index.tsx +61 -165
- package/src/menu/item.tsx +17 -2
- package/src/menu/popover.tsx +103 -0
- package/src/menu/radio-item.tsx +2 -1
- package/src/menu/stories/index.story.tsx +533 -381
- package/src/menu/styles.ts +1 -1
- package/src/menu/submenu-trigger-item.tsx +61 -0
- package/src/menu/test/index.tsx +266 -182
- package/src/menu/trigger-button.tsx +46 -0
- package/src/menu/types.ts +210 -63
- package/src/modal/stories/index.story.tsx +4 -1
- package/src/navigation/back-button/index.tsx +1 -0
- package/src/navigation/index.tsx +7 -0
- package/src/navigation/item/index.tsx +2 -0
- package/src/navigation/styles/navigation-styles.tsx +3 -2
- package/src/navigation/test/index.tsx +4 -0
- package/src/navigator/test/index.tsx +4 -0
- package/src/number-control/index.tsx +1 -0
- package/src/palette-edit/index.tsx +1 -0
- package/src/panel/stories/index.story.tsx +3 -3
- package/src/private-apis.ts +2 -0
- package/src/radio-group/index.tsx +12 -1
- package/src/radio-group/radio.tsx +1 -2
- package/src/range-control/styles/range-control-styles.ts +8 -4
- package/src/select-control/README.md +3 -0
- package/src/select-control/index.tsx +10 -0
- package/src/select-control/stories/index.story.tsx +2 -0
- package/src/select-control/test/select-control.tsx +7 -1
- package/src/select-control/types.ts +1 -0
- package/src/slot-fill/context.ts +5 -3
- package/src/slot-fill/fill.ts +10 -15
- package/src/slot-fill/provider.tsx +63 -64
- package/src/slot-fill/slot.tsx +40 -27
- package/src/slot-fill/types.ts +23 -11
- package/src/style.scss +1 -0
- package/src/tab-panel/index.tsx +1 -2
- package/src/tab-panel/stories/index.story.tsx +4 -0
- package/src/tabs/README.md +151 -187
- package/src/tabs/docs-manifest.json +22 -0
- package/src/tabs/index.tsx +21 -4
- package/src/tabs/stories/best-practices.mdx +99 -0
- package/src/tabs/stories/index.story.tsx +5 -0
- package/src/tabs/types.ts +13 -14
- package/src/text/hook.ts +2 -2
- package/src/text/styles.ts +1 -1
- package/src/text/test/__snapshots__/index.tsx.snap +3 -3
- package/src/text/test/index.tsx +1 -1
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +24 -24
- package/src/toggle-group-control/test/index.tsx +7 -1
- package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +1 -2
- package/src/toggle-group-control/toggle-group-control/styles.ts +1 -1
- package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +6 -6
- package/src/tooltip/index.tsx +1 -2
- package/src/tree-grid/stories/index.story.tsx +2 -0
- package/src/tree-select/README.md +144 -28
- package/src/tree-select/docs-manifest.json +5 -0
- package/src/tree-select/index.tsx +11 -2
- package/src/tree-select/stories/index.story.tsx +1 -0
- package/src/tree-select/types.ts +8 -1
- package/src/utils/colors-values.js +3 -0
- package/src/utils/config-values.js +0 -1
- package/tsconfig.json +0 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/build/box-control/all-input-control.js +0 -91
- package/build/box-control/all-input-control.js.map +0 -1
- package/build/box-control/axial-input-controls.js +0 -125
- package/build/box-control/axial-input-controls.js.map +0 -1
- package/build/box-control/input-controls.js +0 -133
- package/build/box-control/input-controls.js.map +0 -1
- package/build/slot-fill/use-slot.js +0 -32
- package/build/slot-fill/use-slot.js.map +0 -1
- package/build-module/box-control/all-input-control.js +0 -84
- package/build-module/box-control/all-input-control.js.map +0 -1
- package/build-module/box-control/axial-input-controls.js +0 -116
- package/build-module/box-control/axial-input-controls.js.map +0 -1
- package/build-module/box-control/input-controls.js +0 -124
- package/build-module/box-control/input-controls.js.map +0 -1
- package/build-module/slot-fill/use-slot.js +0 -24
- package/build-module/slot-fill/use-slot.js.map +0 -1
- package/build-types/box-control/all-input-control.d.ts +0 -3
- package/build-types/box-control/all-input-control.d.ts.map +0 -1
- package/build-types/box-control/axial-input-controls.d.ts +0 -3
- package/build-types/box-control/axial-input-controls.d.ts.map +0 -1
- package/build-types/box-control/input-controls.d.ts +0 -3
- package/build-types/box-control/input-controls.d.ts.map +0 -1
- package/build-types/slot-fill/use-slot.d.ts +0 -10
- package/build-types/slot-fill/use-slot.d.ts.map +0 -1
- package/src/box-control/all-input-control.tsx +0 -110
- package/src/box-control/axial-input-controls.tsx +0 -165
- package/src/box-control/input-controls.tsx +0 -167
- package/src/slot-fill/use-slot.ts +0 -27
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_colorsValues","_button","_interopRequireDefault","_text","_heading","_utils","_space","_EMOTION_STRINGIFIED_CSS_ERROR__","NavigationUI","exports","_base","default","process","env","NODE_ENV","target","label","space","MenuUI","MenuBackButtonUI","Button","name","styles","map","toString","MenuTitleUI","MenuTitleSearchControlWrapper","MenuTitleActionsUI","GroupTitleUI","Heading","isRTL","ItemBaseUI","CONFIG","radiusSmall","rtl","textAlign","COLORS","theme","accent","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_colorsValues","_button","_interopRequireDefault","_text","_heading","_utils","_space","_EMOTION_STRINGIFIED_CSS_ERROR__","NavigationUI","exports","_base","default","process","env","NODE_ENV","target","label","space","MenuUI","MenuBackButtonUI","Button","name","styles","map","toString","MenuTitleUI","MenuTitleSearchControlWrapper","MenuTitleActionsUI","GroupTitleUI","Heading","isRTL","ItemBaseUI","CONFIG","radiusSmall","rtl","textAlign","COLORS","theme","accent","accentInverted","gray","ItemUI","ItemIconUI","ItemBadgeUI","ItemTitleUI","Text"],"sources":["@wordpress/components/src/navigation/styles/navigation-styles.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n\n/**\n * WordPress dependencies\n */\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { COLORS } from '../../utils/colors-values';\nimport Button from '../../button';\nimport { Text } from '../../text';\nimport { Heading } from '../../heading';\nimport { rtl, CONFIG } from '../../utils';\nimport { space } from '../../utils/space';\n\nexport const NavigationUI = styled.div`\n\twidth: 100%;\n\tbox-sizing: border-box;\n\tpadding: 0 ${ space( 4 ) };\n\toverflow: hidden;\n`;\n\nexport const MenuUI = styled.div`\n\tmargin-top: ${ space( 6 ) };\n\tmargin-bottom: ${ space( 6 ) };\n\tdisplay: flex;\n\tflex-direction: column;\n\tul {\n\t\tpadding: 0;\n\t\tmargin: 0;\n\t\tlist-style: none;\n\t}\n\t.components-navigation__back-button {\n\t\tmargin-bottom: ${ space( 6 ) };\n\t}\n\n\t.components-navigation__group + .components-navigation__group {\n\t\tmargin-top: ${ space( 6 ) };\n\t}\n`;\n\nexport const MenuBackButtonUI = styled( Button )`\n\t&.is-tertiary {\n\t\tcolor: inherit;\n\t\topacity: 0.7;\n\n\t\t&:hover:not( :disabled ) {\n\t\t\topacity: 1;\n\t\t\tbox-shadow: none;\n\t\t\tcolor: inherit;\n\t\t}\n\n\t\t&:active:not( :disabled ) {\n\t\t\tbackground: transparent;\n\t\t\topacity: 1;\n\t\t\tcolor: inherit;\n\t\t}\n\t}\n`;\n\nexport const MenuTitleUI = styled.div`\n\toverflow: hidden;\n\twidth: 100%;\n`;\n\nexport const MenuTitleSearchControlWrapper = styled.div`\n\tmargin: 11px 0; // non-ideal hardcoding to maintain same height as Heading, could be improved\n\tpadding: 1px; // so the focus border doesn't get cut off by the overflow hidden on MenuTitleUI\n`;\n\nexport const MenuTitleActionsUI = styled.span`\n\theight: ${ space( 6 ) }; // 24px, same height as the buttons inside\n\n\t.components-button.is-small {\n\t\tcolor: inherit;\n\t\topacity: 0.7;\n\t\tmargin-right: ${ space( 1 ) }; // Avoid hiding the focus outline\n\t\tpadding: 0;\n\n\t\t&:active:not( :disabled ) {\n\t\t\tbackground: none;\n\t\t\topacity: 1;\n\t\t\tcolor: inherit;\n\t\t}\n\t\t&:hover:not( :disabled ) {\n\t\t\tbox-shadow: none;\n\t\t\topacity: 1;\n\t\t\tcolor: inherit;\n\t\t}\n\t}\n`;\n\nexport const GroupTitleUI = styled( Heading )`\n\tmin-height: ${ space( 12 ) };\n\talign-items: center;\n\tcolor: inherit;\n\tdisplay: flex;\n\tjustify-content: space-between;\n\tmargin-bottom: ${ space( 2 ) };\n\tpadding: ${ () =>\n\t\tisRTL()\n\t\t\t? `${ space( 1 ) } ${ space( 4 ) } ${ space( 1 ) } ${ space( 2 ) }`\n\t\t\t: `${ space( 1 ) } ${ space( 2 ) } ${ space( 1 ) } ${ space(\n\t\t\t\t\t4\n\t\t\t ) }` };\n`;\n\nexport const ItemBaseUI = styled.li`\n\tborder-radius: ${ CONFIG.radiusSmall };\n\tcolor: inherit;\n\tmargin-bottom: 0;\n\n\t> button,\n\t> a.components-button,\n\t> a {\n\t\twidth: 100%;\n\t\tcolor: inherit;\n\t\topacity: 0.7;\n\t\tpadding: ${ space( 2 ) } ${ space( 4 ) }; /* 8px 16px */\n\t\t${ rtl( { textAlign: 'left' }, { textAlign: 'right' } ) }\n\n\t\t&:hover,\n\t\t&:focus:not( [aria-disabled='true'] ):active,\n\t\t&:active:not( [aria-disabled='true'] ):active {\n\t\t\tcolor: inherit;\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t&.is-active {\n\t\tbackground-color: ${ COLORS.theme.accent };\n\t\tcolor: ${ COLORS.theme.accentInverted };\n\n\t\t> button,\n\t\t.components-button:hover,\n\t\t> a {\n\t\t\tcolor: ${ COLORS.theme.accentInverted };\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t> svg path {\n\t\tcolor: ${ COLORS.gray[ 600 ] };\n\t}\n`;\n\nexport const ItemUI = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\theight: auto;\n\tmin-height: 40px;\n\tmargin: 0;\n\tpadding: ${ space( 1.5 ) } ${ space( 4 ) };\n\tfont-weight: 400;\n\tline-height: 20px;\n\twidth: 100%;\n\tcolor: inherit;\n\topacity: 0.7;\n`;\n\nexport const ItemIconUI = styled.span`\n\tdisplay: flex;\n\tmargin-right: ${ space( 2 ) };\n`;\n\nexport const ItemBadgeUI = styled.span`\n\tmargin-left: ${ () => ( isRTL() ? '0' : space( 2 ) ) };\n\tmargin-right: ${ () => ( isRTL() ? space( 2 ) : '0' ) };\n\tdisplay: inline-flex;\n\tpadding: ${ space( 1 ) } ${ space( 3 ) };\n\tborder-radius: ${ CONFIG.radiusSmall };\n\n\t@keyframes fade-in {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t@media not ( prefers-reduced-motion ) {\n\t\tanimation: fade-in 250ms ease-out;\n\t}\n`;\n\nexport const ItemTitleUI = styled( Text )`\n\t${ () => ( isRTL() ? 'margin-left: auto;' : 'margin-right: auto;' ) }\n\tfont-size: 14px;\n\tline-height: 20px;\n\tcolor: inherit;\n`;\n"],"mappings":";;;;;;;;AAQA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAA0C,SAAAQ,iCAAA,gPAlB1C;AACA;AACA,GAFA,CAKA;AACA;AACA,GAFA,CAKA;AACA;AACA;AAQO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,oBAAAE,KAAA,CAAAC,OAAA,SAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,kDAGV,IAAAC,YAAK,EAAE,CAAE,CAAC,yBAAAL,OAAA,CAAAC,GAAA,CAAAC,QAAA,4vMAExB;AAEM,MAAMI,MAAM,GAAAT,OAAA,CAAAS,MAAA,oBAAAR,KAAA,CAAAC,OAAA,SAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,kBACH,IAAAC,YAAK,EAAE,CAAE,CAAC,qBACP,IAAAA,YAAK,EAAE,CAAE,CAAC,mIAST,IAAAA,YAAK,EAAE,CAAE,CAAC,+EAIb,IAAAA,YAAK,EAAE,CAAE,CAAC,UAAA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AA,CAAAmC,WAAA,gBAAG,IAAAlC,KAAA,CAAAC,OAAA,EAAQkC,UAAI,EAAAjC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,CACrC,MAAQ,IAAAc,WAAK,EAAC,CAAC,GAAG,oBAAoB,GAAG,qBAAuB,uDAAAlB,OAAA,CAAAC,GAAA,CAAAC,QAAA,4vMAInE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_isShallowEqual","_interopRequireDefault","_warning","_context","_useCx","_router","_view","_context2","styles","_interopRequireWildcard","_deprecated","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","addScreen","screens","screen","some","s","path","globalThis","SCRIPT_DEBUG","warning","id","removeScreen","filter","goTo","state","options","_focusSelectorsCopy2","focusSelectors","currentLocation","isBack","skipFocus","replace","focusTargetSelector","restOptions","focusSelectorsCopy","getFocusSelectorsCopy","_focusSelectorsCopy","Map","currentFocusSelector","delete","isInitial","hasRestoredFocus","goToParent","currentPath","undefined","parentPath","findParent","routerReducer","action","matchedPath","restState","type","patternMatch","isShallowEqual","params","UnconnectedNavigator","props","forwardedRef","initialPath","initialPathProp","children","className","otherProps","useContextSystem","routerState","dispatch","useReducer","methods","useMemo","goBack","deprecated","since","alternative","navigatorContextValue","_matchedPath$params","location","match","cx","useCx","classes","navigatorWrapper","jsx","View","ref","NavigatorContext","Provider","value","Navigator","exports","contextConnect"],"sources":["@wordpress/components/src/navigator/navigator/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useReducer } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect, useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { patternMatch, findParent } from '../utils/router';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport * as styles from '../styles';\nimport type {\n\tNavigatorProps,\n\tNavigatorLocation,\n\tNavigatorContext as NavigatorContextType,\n\tNavigateOptions,\n\tScreen,\n\tNavigateToParentOptions,\n} from '../types';\nimport deprecated from '@wordpress/deprecated';\n\ntype MatchedPath = ReturnType< typeof patternMatch >;\n\ntype RouterAction =\n\t| { type: 'add' | 'remove'; screen: Screen }\n\t| { type: 'goto'; path: string; options?: NavigateOptions }\n\t| { type: 'gotoparent'; options?: NavigateToParentOptions };\n\ntype RouterState = {\n\tinitialPath: string;\n\tscreens: Screen[];\n\tcurrentLocation: NavigatorLocation;\n\tmatchedPath: MatchedPath;\n\tfocusSelectors: Map< string, string >;\n};\n\nfunction addScreen( { screens }: RouterState, screen: Screen ) {\n\tif ( screens.some( ( s ) => s.path === screen.path ) ) {\n\t\twarning(\n\t\t\t`Navigator: a screen with path ${ screen.path } already exists.\nThe screen with id ${ screen.id } will not be added.`\n\t\t);\n\t\treturn screens;\n\t}\n\treturn [ ...screens, screen ];\n}\n\nfunction removeScreen( { screens }: RouterState, screen: Screen ) {\n\treturn screens.filter( ( s ) => s.id !== screen.id );\n}\n\nfunction goTo(\n\tstate: RouterState,\n\tpath: string,\n\toptions: NavigateOptions = {}\n) {\n\tconst { focusSelectors } = state;\n\tconst currentLocation = { ...state.currentLocation };\n\n\tconst {\n\t\t// Default assignments\n\t\tisBack = false,\n\t\tskipFocus = false,\n\t\t// Extract to avoid forwarding\n\t\treplace,\n\t\tfocusTargetSelector,\n\t\t// Rest\n\t\t...restOptions\n\t} = options;\n\n\tif ( currentLocation.path === path ) {\n\t\treturn { currentLocation, focusSelectors };\n\t}\n\n\tlet focusSelectorsCopy: typeof focusSelectors | undefined;\n\tfunction getFocusSelectorsCopy() {\n\t\tfocusSelectorsCopy =\n\t\t\tfocusSelectorsCopy ?? new Map( state.focusSelectors );\n\t\treturn focusSelectorsCopy;\n\t}\n\n\t// Set a focus selector that will be used when navigating\n\t// back to the current location.\n\tif ( focusTargetSelector && currentLocation.path ) {\n\t\tgetFocusSelectorsCopy().set(\n\t\t\tcurrentLocation.path,\n\t\t\tfocusTargetSelector\n\t\t);\n\t}\n\n\t// Get the focus selector for the new location.\n\tlet currentFocusSelector;\n\tif ( focusSelectors.get( path ) ) {\n\t\tif ( isBack ) {\n\t\t\t// Use the found focus selector only when navigating back.\n\t\t\tcurrentFocusSelector = focusSelectors.get( path );\n\t\t}\n\t\t// Make a copy of the focusSelectors map to remove the focus selector\n\t\t// only if necessary (ie. a focus selector was found).\n\t\tgetFocusSelectorsCopy().delete( path );\n\t}\n\n\treturn {\n\t\tcurrentLocation: {\n\t\t\t...restOptions,\n\t\t\tisInitial: false,\n\t\t\tpath,\n\t\t\tisBack,\n\t\t\thasRestoredFocus: false,\n\t\t\tfocusTargetSelector: currentFocusSelector,\n\t\t\tskipFocus,\n\t\t},\n\t\tfocusSelectors: focusSelectorsCopy ?? focusSelectors,\n\t};\n}\n\nfunction goToParent(\n\tstate: RouterState,\n\toptions: NavigateToParentOptions = {}\n) {\n\tconst { screens, focusSelectors } = state;\n\tconst currentLocation = { ...state.currentLocation };\n\tconst currentPath = currentLocation.path;\n\tif ( currentPath === undefined ) {\n\t\treturn { currentLocation, focusSelectors };\n\t}\n\tconst parentPath = findParent( currentPath, screens );\n\tif ( parentPath === undefined ) {\n\t\treturn { currentLocation, focusSelectors };\n\t}\n\treturn goTo( state, parentPath, {\n\t\t...options,\n\t\tisBack: true,\n\t} );\n}\n\nfunction routerReducer(\n\tstate: RouterState,\n\taction: RouterAction\n): RouterState {\n\tlet {\n\t\tscreens,\n\t\tcurrentLocation,\n\t\tmatchedPath,\n\t\tfocusSelectors,\n\t\t...restState\n\t} = state;\n\tswitch ( action.type ) {\n\t\tcase 'add':\n\t\t\tscreens = addScreen( state, action.screen );\n\t\t\tbreak;\n\t\tcase 'remove':\n\t\t\tscreens = removeScreen( state, action.screen );\n\t\t\tbreak;\n\t\tcase 'goto':\n\t\t\t( { currentLocation, focusSelectors } = goTo(\n\t\t\t\tstate,\n\t\t\t\taction.path,\n\t\t\t\taction.options\n\t\t\t) );\n\t\t\tbreak;\n\t\tcase 'gotoparent':\n\t\t\t( { currentLocation, focusSelectors } = goToParent(\n\t\t\t\tstate,\n\t\t\t\taction.options\n\t\t\t) );\n\t\t\tbreak;\n\t}\n\n\t// Return early in case there is no change\n\tif (\n\t\tscreens === state.screens &&\n\t\tcurrentLocation === state.currentLocation\n\t) {\n\t\treturn state;\n\t}\n\n\t// Compute the matchedPath\n\tconst currentPath = currentLocation.path;\n\tmatchedPath =\n\t\tcurrentPath !== undefined\n\t\t\t? patternMatch( currentPath, screens )\n\t\t\t: undefined;\n\n\t// If the new match is the same as the previous match,\n\t// return the previous one to keep immutability.\n\tif (\n\t\tmatchedPath &&\n\t\tstate.matchedPath &&\n\t\tmatchedPath.id === state.matchedPath.id &&\n\t\tisShallowEqual( matchedPath.params, state.matchedPath.params )\n\t) {\n\t\tmatchedPath = state.matchedPath;\n\t}\n\n\treturn {\n\t\t...restState,\n\t\tscreens,\n\t\tcurrentLocation,\n\t\tmatchedPath,\n\t\tfocusSelectors,\n\t};\n}\n\nfunction UnconnectedNavigator(\n\tprops: WordPressComponentProps< NavigatorProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\tinitialPath: initialPathProp,\n\t\tchildren,\n\t\tclassName,\n\t\t...otherProps\n\t} = useContextSystem( props, 'Navigator' );\n\n\tconst [ routerState, dispatch ] = useReducer(\n\t\trouterReducer,\n\t\tinitialPathProp,\n\t\t( path ) => ( {\n\t\t\tscreens: [],\n\t\t\tcurrentLocation: { path, isInitial: true },\n\t\t\tmatchedPath: undefined,\n\t\t\tfocusSelectors: new Map(),\n\t\t\tinitialPath: initialPathProp,\n\t\t} )\n\t);\n\n\t// The methods are constant forever, create stable references to them.\n\tconst methods = useMemo(\n\t\t() => ( {\n\t\t\t// Note: calling goBack calls `goToParent` internally, as it was established\n\t\t\t// that `goBack` should behave like `goToParent`, and `goToParent` should\n\t\t\t// be marked as deprecated.\n\t\t\tgoBack: ( options: NavigateToParentOptions | undefined ) =>\n\t\t\t\tdispatch( { type: 'gotoparent', options } ),\n\t\t\tgoTo: ( path: string, options?: NavigateOptions ) =>\n\t\t\t\tdispatch( { type: 'goto', path, options } ),\n\t\t\tgoToParent: ( options: NavigateToParentOptions | undefined ) => {\n\t\t\t\tdeprecated( `wp.components.useNavigator().goToParent`, {\n\t\t\t\t\tsince: '6.7',\n\t\t\t\t\talternative: 'wp.components.useNavigator().goBack',\n\t\t\t\t} );\n\t\t\t\tdispatch( { type: 'gotoparent', options } );\n\t\t\t},\n\t\t\taddScreen: ( screen: Screen ) =>\n\t\t\t\tdispatch( { type: 'add', screen } ),\n\t\t\tremoveScreen: ( screen: Screen ) =>\n\t\t\t\tdispatch( { type: 'remove', screen } ),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst { currentLocation, matchedPath } = routerState;\n\n\tconst navigatorContextValue: NavigatorContextType = useMemo(\n\t\t() => ( {\n\t\t\tlocation: currentLocation,\n\t\t\tparams: matchedPath?.params ?? {},\n\t\t\tmatch: matchedPath?.id,\n\t\t\t...methods,\n\t\t} ),\n\t\t[ currentLocation, matchedPath, methods ]\n\t);\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() => cx( styles.navigatorWrapper, className ),\n\t\t[ className, cx ]\n\t);\n\n\treturn (\n\t\t<View ref={ forwardedRef } className={ classes } { ...otherProps }>\n\t\t\t<NavigatorContext.Provider value={ navigatorContextValue }>\n\t\t\t\t{ children }\n\t\t\t</NavigatorContext.Provider>\n\t\t</View>\n\t);\n}\n\nexport const Navigator = contextConnect( UnconnectedNavigator, 'Navigator' );\n"],"mappings":";;;;;;;AAQA,IAAA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YAAc;IAACI,SAAS,EAAGkB,OAAS;IAAA,GAAMjB,UAAU;IAAAF,QAAA,eAC/D,IAAAtE,WAAA,CAAA2F,GAAA,EAAC/F,SAAA,CAAAkG,gBAAgB,CAACC,QAAQ;MAACC,KAAK,EAAGb,qBAAuB;MAAAb,QAAA,EACvDA;IAAQ,CACgB;EAAC,CACvB,CAAC;AAET;AAEO,MAAM2B,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,uBAAc,EAAElC,oBAAoB,EAAE,WAAY,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_element","require","_isShallowEqual","_interopRequireDefault","_warning","_context","_useCx","_router","_view","_context2","styles","_interopRequireWildcard","_deprecated","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","addScreen","screens","screen","some","s","path","globalThis","SCRIPT_DEBUG","warning","id","removeScreen","filter","goTo","state","options","_focusSelectorsCopy2","focusSelectors","currentLocation","isBack","skipFocus","replace","focusTargetSelector","restOptions","focusSelectorsCopy","getFocusSelectorsCopy","_focusSelectorsCopy","Map","currentFocusSelector","delete","isInitial","hasRestoredFocus","goToParent","currentPath","undefined","parentPath","findParent","routerReducer","action","matchedPath","restState","type","patternMatch","isShallowEqual","params","UnconnectedNavigator","props","forwardedRef","initialPath","initialPathProp","children","className","otherProps","useContextSystem","routerState","dispatch","useReducer","methods","useMemo","goBack","deprecated","since","alternative","navigatorContextValue","_matchedPath$params","location","match","cx","useCx","classes","navigatorWrapper","jsx","View","ref","NavigatorContext","Provider","value","Navigator","exports","contextConnect"],"sources":["@wordpress/components/src/navigator/navigator/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useReducer } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect, useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { patternMatch, findParent } from '../utils/router';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport * as styles from '../styles';\nimport type {\n\tNavigatorProps,\n\tNavigatorLocation,\n\tNavigatorContext as NavigatorContextType,\n\tNavigateOptions,\n\tScreen,\n\tNavigateToParentOptions,\n} from '../types';\nimport deprecated from '@wordpress/deprecated';\n\ntype MatchedPath = ReturnType< typeof patternMatch >;\n\ntype RouterAction =\n\t| { type: 'add' | 'remove'; screen: Screen }\n\t| { type: 'goto'; path: string; options?: NavigateOptions }\n\t| { type: 'gotoparent'; options?: NavigateToParentOptions };\n\ntype RouterState = {\n\tinitialPath: string;\n\tscreens: Screen[];\n\tcurrentLocation: NavigatorLocation;\n\tmatchedPath: MatchedPath;\n\tfocusSelectors: Map< string, string >;\n};\n\nfunction addScreen( { screens }: RouterState, screen: Screen ) {\n\tif ( screens.some( ( s ) => s.path === screen.path ) ) {\n\t\twarning(\n\t\t\t`Navigator: a screen with path ${ screen.path } already exists.\nThe screen with id ${ screen.id } will not be added.`\n\t\t);\n\t\treturn screens;\n\t}\n\treturn [ ...screens, screen ];\n}\n\nfunction removeScreen( { screens }: RouterState, screen: Screen ) {\n\treturn screens.filter( ( s ) => s.id !== screen.id );\n}\n\nfunction goTo(\n\tstate: RouterState,\n\tpath: string,\n\toptions: NavigateOptions = {}\n) {\n\tconst { focusSelectors } = state;\n\tconst currentLocation = { ...state.currentLocation };\n\n\tconst {\n\t\t// Default assignments\n\t\tisBack = false,\n\t\tskipFocus = false,\n\t\t// Extract to avoid forwarding\n\t\treplace,\n\t\tfocusTargetSelector,\n\t\t// Rest\n\t\t...restOptions\n\t} = options;\n\n\tif ( currentLocation.path === path ) {\n\t\treturn { currentLocation, focusSelectors };\n\t}\n\n\tlet focusSelectorsCopy: typeof focusSelectors | undefined;\n\tfunction getFocusSelectorsCopy() {\n\t\tfocusSelectorsCopy =\n\t\t\tfocusSelectorsCopy ?? new Map( state.focusSelectors );\n\t\treturn focusSelectorsCopy;\n\t}\n\n\t// Set a focus selector that will be used when navigating\n\t// back to the current location.\n\tif ( focusTargetSelector && currentLocation.path ) {\n\t\tgetFocusSelectorsCopy().set(\n\t\t\tcurrentLocation.path,\n\t\t\tfocusTargetSelector\n\t\t);\n\t}\n\n\t// Get the focus selector for the new location.\n\tlet currentFocusSelector;\n\tif ( focusSelectors.get( path ) ) {\n\t\tif ( isBack ) {\n\t\t\t// Use the found focus selector only when navigating back.\n\t\t\tcurrentFocusSelector = focusSelectors.get( path );\n\t\t}\n\t\t// Make a copy of the focusSelectors map to remove the focus selector\n\t\t// only if necessary (ie. a focus selector was found).\n\t\tgetFocusSelectorsCopy().delete( path );\n\t}\n\n\treturn {\n\t\tcurrentLocation: {\n\t\t\t...restOptions,\n\t\t\tisInitial: false,\n\t\t\tpath,\n\t\t\tisBack,\n\t\t\thasRestoredFocus: false,\n\t\t\tfocusTargetSelector: currentFocusSelector,\n\t\t\tskipFocus,\n\t\t},\n\t\tfocusSelectors: focusSelectorsCopy ?? focusSelectors,\n\t};\n}\n\nfunction goToParent(\n\tstate: RouterState,\n\toptions: NavigateToParentOptions = {}\n) {\n\tconst { screens, focusSelectors } = state;\n\tconst currentLocation = { ...state.currentLocation };\n\tconst currentPath = currentLocation.path;\n\tif ( currentPath === undefined ) {\n\t\treturn { currentLocation, focusSelectors };\n\t}\n\tconst parentPath = findParent( currentPath, screens );\n\tif ( parentPath === undefined ) {\n\t\treturn { currentLocation, focusSelectors };\n\t}\n\treturn goTo( state, parentPath, {\n\t\t...options,\n\t\tisBack: true,\n\t} );\n}\n\nfunction routerReducer(\n\tstate: RouterState,\n\taction: RouterAction\n): RouterState {\n\tlet {\n\t\tscreens,\n\t\tcurrentLocation,\n\t\tmatchedPath,\n\t\tfocusSelectors,\n\t\t...restState\n\t} = state;\n\tswitch ( action.type ) {\n\t\tcase 'add':\n\t\t\tscreens = addScreen( state, action.screen );\n\t\t\tbreak;\n\t\tcase 'remove':\n\t\t\tscreens = removeScreen( state, action.screen );\n\t\t\tbreak;\n\t\tcase 'goto':\n\t\t\t( { currentLocation, focusSelectors } = goTo(\n\t\t\t\tstate,\n\t\t\t\taction.path,\n\t\t\t\taction.options\n\t\t\t) );\n\t\t\tbreak;\n\t\tcase 'gotoparent':\n\t\t\t( { currentLocation, focusSelectors } = goToParent(\n\t\t\t\tstate,\n\t\t\t\taction.options\n\t\t\t) );\n\t\t\tbreak;\n\t}\n\n\t// Return early in case there is no change\n\tif (\n\t\tscreens === state.screens &&\n\t\tcurrentLocation === state.currentLocation\n\t) {\n\t\treturn state;\n\t}\n\n\t// Compute the matchedPath\n\tconst currentPath = currentLocation.path;\n\tmatchedPath =\n\t\tcurrentPath !== undefined\n\t\t\t? patternMatch( currentPath, screens )\n\t\t\t: undefined;\n\n\t// If the new match is the same as the previous match,\n\t// return the previous one to keep immutability.\n\tif (\n\t\tmatchedPath &&\n\t\tstate.matchedPath &&\n\t\tmatchedPath.id === state.matchedPath.id &&\n\t\tisShallowEqual( matchedPath.params, state.matchedPath.params )\n\t) {\n\t\tmatchedPath = state.matchedPath;\n\t}\n\n\treturn {\n\t\t...restState,\n\t\tscreens,\n\t\tcurrentLocation,\n\t\tmatchedPath,\n\t\tfocusSelectors,\n\t};\n}\n\nfunction UnconnectedNavigator(\n\tprops: WordPressComponentProps< NavigatorProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\tinitialPath: initialPathProp,\n\t\tchildren,\n\t\tclassName,\n\t\t...otherProps\n\t} = useContextSystem( props, 'Navigator' );\n\n\tconst [ routerState, dispatch ] = useReducer(\n\t\trouterReducer,\n\t\tinitialPathProp,\n\t\t( path ) => ( {\n\t\t\tscreens: [],\n\t\t\tcurrentLocation: { path, isInitial: true },\n\t\t\tmatchedPath: undefined,\n\t\t\tfocusSelectors: new Map(),\n\t\t\tinitialPath: initialPathProp,\n\t\t} )\n\t);\n\n\t// The methods are constant forever, create stable references to them.\n\tconst methods = useMemo(\n\t\t() => ( {\n\t\t\t// Note: calling goBack calls `goToParent` internally, as it was established\n\t\t\t// that `goBack` should behave like `goToParent`, and `goToParent` should\n\t\t\t// be marked as deprecated.\n\t\t\tgoBack: ( options: NavigateToParentOptions | undefined ) =>\n\t\t\t\tdispatch( { type: 'gotoparent', options } ),\n\t\t\tgoTo: ( path: string, options?: NavigateOptions ) =>\n\t\t\t\tdispatch( { type: 'goto', path, options } ),\n\t\t\tgoToParent: ( options: NavigateToParentOptions | undefined ) => {\n\t\t\t\tdeprecated( `wp.components.useNavigator().goToParent`, {\n\t\t\t\t\tsince: '6.7',\n\t\t\t\t\talternative: 'wp.components.useNavigator().goBack',\n\t\t\t\t} );\n\t\t\t\tdispatch( { type: 'gotoparent', options } );\n\t\t\t},\n\t\t\taddScreen: ( screen: Screen ) =>\n\t\t\t\tdispatch( { type: 'add', screen } ),\n\t\t\tremoveScreen: ( screen: Screen ) =>\n\t\t\t\tdispatch( { type: 'remove', screen } ),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst { currentLocation, matchedPath } = routerState;\n\n\tconst navigatorContextValue: NavigatorContextType = useMemo(\n\t\t() => ( {\n\t\t\tlocation: currentLocation,\n\t\t\tparams: matchedPath?.params ?? {},\n\t\t\tmatch: matchedPath?.id,\n\t\t\t...methods,\n\t\t} ),\n\t\t[ currentLocation, matchedPath, methods ]\n\t);\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() => cx( styles.navigatorWrapper, className ),\n\t\t[ className, cx ]\n\t);\n\n\treturn (\n\t\t<View ref={ forwardedRef } className={ classes } { ...otherProps }>\n\t\t\t<NavigatorContext.Provider value={ navigatorContextValue }>\n\t\t\t\t{ children }\n\t\t\t</NavigatorContext.Provider>\n\t\t</View>\n\t);\n}\n\nexport const Navigator = contextConnect( UnconnectedNavigator, 'Navigator' );\n"],"mappings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;IAACC,GAAG,EAAG1B,YAAc;IAACI,SAAS,EAAGkB,OAAS;IAAA,GAAMjB,UAAU;IAAAF,QAAA,eAC/D,IAAAtE,WAAA,CAAA2F,GAAA,EAAC/F,SAAA,CAAAkG,gBAAgB,CAACC,QAAQ;MAACC,KAAK,EAAGb,qBAAuB;MAAAb,QAAA,EACvDA;IAAQ,CACgB;EAAC,CACvB,CAAC;AAET;AAEO,MAAM2B,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,uBAAc,EAAElC,oBAAoB,EAAE,WAAY,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_dom","require","_element","_compose","_escapeHtml","_warning","_interopRequireDefault","_context","_useCx","_view","_context2","styles","_interopRequireWildcard","_useScreenAnimatePresence","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","UnconnectedNavigatorScreen","props","forwardedRef","test","path","globalThis","SCRIPT_DEBUG","warning","screenId","useId","children","className","onAnimationEnd","onAnimationEndProp","otherProps","useContextSystem","location","match","addScreen","removeScreen","useContext","NavigatorContext","isInitial","isBack","focusTargetSelector","skipFocus","isMatch","wrapperRef","useRef","skipAnimationAndFocusRestoration","useEffect","screen","id","escapeAttribute","animationStyles","shouldRenderScreen","screenProps","useScreenAnimatePresence","skipAnimation","cx","useCx","classes","useMemo","navigatorScreen","locationRef","current","wrapperEl","hasRestoredFocus","activeElement","ownerDocument","contains","elementToFocus","querySelector","firstTabbable","focus","tabbable","find","mergedWrapperRef","useMergeRefs","jsx","View","ref","NavigatorScreen","exports","contextConnect"],"sources":["@wordpress/components/src/navigator/navigator-screen/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport {\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseId,\n} from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { escapeAttribute } from '@wordpress/escape-html';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect, useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport * as styles from '../styles';\nimport type { NavigatorScreenProps } from '../types';\nimport { useScreenAnimatePresence } from './use-screen-animate-presence';\n\nfunction UnconnectedNavigatorScreen(\n\tprops: WordPressComponentProps< NavigatorScreenProps, 'div', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tif ( ! /^\\//.test( props.path ) ) {\n\t\twarning(\n\t\t\t'wp.components.Navigator.Screen: the `path` should follow a URL-like scheme; it should start with and be separated by the `/` character.'\n\t\t);\n\t}\n\n\tconst screenId = useId();\n\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tpath,\n\t\tonAnimationEnd: onAnimationEndProp,\n\t\t...otherProps\n\t} = useContextSystem( props, 'Navigator.Screen' );\n\n\tconst { location, match, addScreen, removeScreen } =\n\t\tuseContext( NavigatorContext );\n\tconst { isInitial, isBack, focusTargetSelector, skipFocus } = location;\n\n\tconst isMatch = match === screenId;\n\tconst wrapperRef = useRef< HTMLDivElement >( null );\n\tconst skipAnimationAndFocusRestoration = !! isInitial && ! isBack;\n\n\t// Register / unregister screen with the navigator context.\n\tuseEffect( () => {\n\t\tconst screen = {\n\t\t\tid: screenId,\n\t\t\tpath: escapeAttribute( path ),\n\t\t};\n\t\taddScreen( screen );\n\t\treturn () => removeScreen( screen );\n\t}, [ screenId, path, addScreen, removeScreen ] );\n\n\t// Animation.\n\tconst { animationStyles, shouldRenderScreen, screenProps } =\n\t\tuseScreenAnimatePresence( {\n\t\t\tisMatch,\n\t\t\tisBack,\n\t\t\tonAnimationEnd: onAnimationEndProp,\n\t\t\tskipAnimation: skipAnimationAndFocusRestoration,\n\t\t} );\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() => cx( styles.navigatorScreen, animationStyles, className ),\n\t\t[ className, cx, animationStyles ]\n\t);\n\n\t// Focus restoration\n\tconst locationRef = useRef( location );\n\tuseEffect( () => {\n\t\tlocationRef.current = location;\n\t}, [ location ] );\n\tuseEffect( () => {\n\t\tconst wrapperEl = wrapperRef.current;\n\t\t// Only attempt to restore focus:\n\t\t// - if the current location is not the initial one (to avoid moving focus on page load)\n\t\t// - when the screen becomes visible\n\t\t// - if the wrapper ref has been assigned\n\t\t// - if focus hasn't already been restored for the current location\n\t\t// - if the `skipFocus` option is not set to `true`. This is useful when we trigger the navigation outside of NavigatorScreen.\n\t\tif (\n\t\t\tskipAnimationAndFocusRestoration ||\n\t\t\t! isMatch ||\n\t\t\t! wrapperEl ||\n\t\t\tlocationRef.current.hasRestoredFocus ||\n\t\t\tskipFocus\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = wrapperEl.ownerDocument.activeElement;\n\n\t\t// If an element is already focused within the wrapper do not focus the\n\t\t// element. This prevents inputs or buttons from losing focus unnecessarily.\n\t\tif ( wrapperEl.contains( activeElement ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet elementToFocus: HTMLElement | null = null;\n\n\t\t// When navigating back, if a selector is provided, use it to look for the\n\t\t// target element (assumed to be a node inside the current NavigatorScreen)\n\t\tif ( isBack && focusTargetSelector ) {\n\t\t\telementToFocus = wrapperEl.querySelector( focusTargetSelector );\n\t\t}\n\n\t\t// If the previous query didn't run or find any element to focus, fallback\n\t\t// to the first tabbable element in the screen (or the screen itself).\n\t\tif ( ! elementToFocus ) {\n\t\t\tconst [ firstTabbable ] = focus.tabbable.find( wrapperEl );\n\t\t\telementToFocus = firstTabbable ?? wrapperEl;\n\t\t}\n\n\t\tlocationRef.current.hasRestoredFocus = true;\n\t\telementToFocus.focus();\n\t}, [\n\t\tskipAnimationAndFocusRestoration,\n\t\tisMatch,\n\t\tisBack,\n\t\tfocusTargetSelector,\n\t\tskipFocus,\n\t] );\n\n\tconst mergedWrapperRef = useMergeRefs( [ forwardedRef, wrapperRef ] );\n\n\treturn shouldRenderScreen ? (\n\t\t<View\n\t\t\tref={ mergedWrapperRef }\n\t\t\tclassName={ classes }\n\t\t\t{ ...screenProps }\n\t\t\t{ ...otherProps }\n\t\t>\n\t\t\t{ children }\n\t\t</View>\n\t) : null;\n}\n\nexport const NavigatorScreen = contextConnect(\n\tUnconnectedNavigatorScreen,\n\t'Navigator.Screen'\n);\n"],"mappings":";;;;;;;AAQA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAOA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAC,sBAAA,CAAAL,OAAA;AAMA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAC,uBAAA,CAAAX,OAAA;AAEA,IAAAY,yBAAA,GAAAZ,OAAA;AAAyE,IAAAa,WAAA,GAAAb,OAAA;AAAA,SAAAc,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAA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AAE,uBAAc,EAC5ChE,0BAA0B,EAC1B,kBACD,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_dom","require","_element","_compose","_escapeHtml","_warning","_interopRequireDefault","_context","_useCx","_view","_context2","styles","_interopRequireWildcard","_useScreenAnimatePresence","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","UnconnectedNavigatorScreen","props","forwardedRef","test","path","globalThis","SCRIPT_DEBUG","warning","screenId","useId","children","className","onAnimationEnd","onAnimationEndProp","otherProps","useContextSystem","location","match","addScreen","removeScreen","useContext","NavigatorContext","isInitial","isBack","focusTargetSelector","skipFocus","isMatch","wrapperRef","useRef","skipAnimationAndFocusRestoration","useEffect","screen","id","escapeAttribute","animationStyles","shouldRenderScreen","screenProps","useScreenAnimatePresence","skipAnimation","cx","useCx","classes","useMemo","navigatorScreen","locationRef","current","wrapperEl","hasRestoredFocus","activeElement","ownerDocument","contains","elementToFocus","querySelector","firstTabbable","focus","tabbable","find","mergedWrapperRef","useMergeRefs","jsx","View","ref","NavigatorScreen","exports","contextConnect"],"sources":["@wordpress/components/src/navigator/navigator-screen/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport {\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseId,\n} from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { escapeAttribute } from '@wordpress/escape-html';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect, useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport * as styles from '../styles';\nimport type { NavigatorScreenProps } from '../types';\nimport { useScreenAnimatePresence } from './use-screen-animate-presence';\n\nfunction UnconnectedNavigatorScreen(\n\tprops: WordPressComponentProps< NavigatorScreenProps, 'div', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tif ( ! /^\\//.test( props.path ) ) {\n\t\twarning(\n\t\t\t'wp.components.Navigator.Screen: the `path` should follow a URL-like scheme; it should start with and be separated by the `/` character.'\n\t\t);\n\t}\n\n\tconst screenId = useId();\n\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tpath,\n\t\tonAnimationEnd: onAnimationEndProp,\n\t\t...otherProps\n\t} = useContextSystem( props, 'Navigator.Screen' );\n\n\tconst { location, match, addScreen, removeScreen } =\n\t\tuseContext( NavigatorContext );\n\tconst { isInitial, isBack, focusTargetSelector, skipFocus } = location;\n\n\tconst isMatch = match === screenId;\n\tconst wrapperRef = useRef< HTMLDivElement >( null );\n\tconst skipAnimationAndFocusRestoration = !! isInitial && ! isBack;\n\n\t// Register / unregister screen with the navigator context.\n\tuseEffect( () => {\n\t\tconst screen = {\n\t\t\tid: screenId,\n\t\t\tpath: escapeAttribute( path ),\n\t\t};\n\t\taddScreen( screen );\n\t\treturn () => removeScreen( screen );\n\t}, [ screenId, path, addScreen, removeScreen ] );\n\n\t// Animation.\n\tconst { animationStyles, shouldRenderScreen, screenProps } =\n\t\tuseScreenAnimatePresence( {\n\t\t\tisMatch,\n\t\t\tisBack,\n\t\t\tonAnimationEnd: onAnimationEndProp,\n\t\t\tskipAnimation: skipAnimationAndFocusRestoration,\n\t\t} );\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() => cx( styles.navigatorScreen, animationStyles, className ),\n\t\t[ className, cx, animationStyles ]\n\t);\n\n\t// Focus restoration\n\tconst locationRef = useRef( location );\n\tuseEffect( () => {\n\t\tlocationRef.current = location;\n\t}, [ location ] );\n\tuseEffect( () => {\n\t\tconst wrapperEl = wrapperRef.current;\n\t\t// Only attempt to restore focus:\n\t\t// - if the current location is not the initial one (to avoid moving focus on page load)\n\t\t// - when the screen becomes visible\n\t\t// - if the wrapper ref has been assigned\n\t\t// - if focus hasn't already been restored for the current location\n\t\t// - if the `skipFocus` option is not set to `true`. This is useful when we trigger the navigation outside of NavigatorScreen.\n\t\tif (\n\t\t\tskipAnimationAndFocusRestoration ||\n\t\t\t! isMatch ||\n\t\t\t! wrapperEl ||\n\t\t\tlocationRef.current.hasRestoredFocus ||\n\t\t\tskipFocus\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = wrapperEl.ownerDocument.activeElement;\n\n\t\t// If an element is already focused within the wrapper do not focus the\n\t\t// element. This prevents inputs or buttons from losing focus unnecessarily.\n\t\tif ( wrapperEl.contains( activeElement ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet elementToFocus: HTMLElement | null = null;\n\n\t\t// When navigating back, if a selector is provided, use it to look for the\n\t\t// target element (assumed to be a node inside the current NavigatorScreen)\n\t\tif ( isBack && focusTargetSelector ) {\n\t\t\telementToFocus = wrapperEl.querySelector( focusTargetSelector );\n\t\t}\n\n\t\t// If the previous query didn't run or find any element to focus, fallback\n\t\t// to the first tabbable element in the screen (or the screen itself).\n\t\tif ( ! elementToFocus ) {\n\t\t\tconst [ firstTabbable ] = focus.tabbable.find( wrapperEl );\n\t\t\telementToFocus = firstTabbable ?? wrapperEl;\n\t\t}\n\n\t\tlocationRef.current.hasRestoredFocus = true;\n\t\telementToFocus.focus();\n\t}, [\n\t\tskipAnimationAndFocusRestoration,\n\t\tisMatch,\n\t\tisBack,\n\t\tfocusTargetSelector,\n\t\tskipFocus,\n\t] );\n\n\tconst mergedWrapperRef = useMergeRefs( [ forwardedRef, wrapperRef ] );\n\n\treturn shouldRenderScreen ? (\n\t\t<View\n\t\t\tref={ mergedWrapperRef }\n\t\t\tclassName={ classes }\n\t\t\t{ ...screenProps }\n\t\t\t{ ...otherProps }\n\t\t>\n\t\t\t{ children }\n\t\t</View>\n\t) : null;\n}\n\nexport const NavigatorScreen = contextConnect(\n\tUnconnectedN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IAAI;;IAE7C;IACA;IACA,IAAK5B,MAAM,IAAIC,mBAAmB,EAAG;MACpC2B,cAAc,GAAGL,SAAS,CAACM,aAAa,CAAE5B,mBAAoB,CAAC;IAChE;;IAEA;IACA;IACA,IAAK,CAAE2B,cAAc,EAAG;MACvB,MAAM,CAAEE,aAAa,CAAE,GAAGC,UAAK,CAACC,QAAQ,CAACC,IAAI,CAAEV,SAAU,CAAC;MAC1DK,cAAc,GAAGE,aAAa,aAAbA,aAAa,cAAbA,aAAa,GAAIP,SAAS;IAC5C;IAEAF,WAAW,CAACC,OAAO,CAACE,gBAAgB,GAAG,IAAI;IAC3CI,cAAc,CAACG,KAAK,CAAC,CAAC;EACvB,CAAC,EAAE,CACFzB,gCAAgC,EAChCH,OAAO,EACPH,MAAM,EACNC,mBAAmB,EACnBC,SAAS,CACR,CAAC;EAEH,MAAMgC,gBAAgB,GAAG,IAAAC,qBAAY,EAAE,CAAExD,YAAY,EAAEyB,UAAU,CAAG,CAAC;EAErE,OAAOQ,kBAAkB,gBACxB,IAAAxD,WAAA,CAAAgF,GAAA,EAACrF,KAAA,CAAAsF,IAAI;IACJC,GAAG,EAAGJ,gBAAkB;IACxB9C,SAAS,EAAG8B,OAAS;IAAA,GAChBL,WAAW;IAAA,GACXtB,UAAU;IAAAJ,QAAA,EAEbA;EAAQ,CACL,CAAC,GACJ,IAAI;AACT;AAEO,MAAMoD,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,uBAAc,EAC5ChE,0BAA0B,EAC1B,kBACD,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pathToRegexp","require","matchPath","path","pattern","matchingFunction","match","decode","decodeURIComponent","patternMatch","screens","screen","matched","params","id","undefined","findParent","startsWith","pathParts","split","parentPath","length","pop","potentialParentPath","join","find"],"sources":["@wordpress/components/src/navigator/utils/router.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { match } from 'path-to-regexp';\n\n/**\n * Internal dependencies\n */\nimport type { Screen, MatchParams } from '../types';\n\nfunction matchPath( path: string, pattern: string ) {\n\tconst matchingFunction = match< MatchParams >( pattern, {\n\t\tdecode: decodeURIComponent,\n\t} );\n\treturn matchingFunction( path );\n}\n\nexport function patternMatch( path: string, screens: Screen[] ) {\n\tfor ( const screen of screens ) {\n\t\tconst matched = matchPath( path, screen.path );\n\t\tif ( matched ) {\n\t\t\treturn { params: matched.params, id: screen.id };\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nexport function findParent( path: string, screens: Screen[] ) {\n\tif ( ! path.startsWith( '/' ) ) {\n\t\treturn undefined;\n\t}\n\tconst pathParts = path.split( '/' );\n\tlet parentPath;\n\twhile ( pathParts.length > 1 && parentPath === undefined ) {\n\t\tpathParts.pop();\n\t\tconst potentialParentPath =\n\t\t\tpathParts.join( '/' ) === '' ? '/' : pathParts.join( '/' );\n\t\tif (\n\t\t\tscreens.find( ( screen ) => {\n\t\t\t\treturn matchPath( potentialParentPath, screen.path ) !== false;\n\t\t\t} )\n\t\t) {\n\t\t\tparentPath = potentialParentPath;\n\t\t}\n\t}\n\n\treturn parentPath;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_pathToRegexp","require","matchPath","path","pattern","matchingFunction","match","decode","decodeURIComponent","patternMatch","screens","screen","matched","params","id","undefined","findParent","startsWith","pathParts","split","parentPath","length","pop","potentialParentPath","join","find"],"sources":["@wordpress/components/src/navigator/utils/router.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { match } from 'path-to-regexp';\n\n/**\n * Internal dependencies\n */\nimport type { Screen, MatchParams } from '../types';\n\nfunction matchPath( path: string, pattern: string ) {\n\tconst matchingFunction = match< MatchParams >( pattern, {\n\t\tdecode: decodeURIComponent,\n\t} );\n\treturn matchingFunction( path );\n}\n\nexport function patternMatch( path: string, screens: Screen[] ) {\n\tfor ( const screen of screens ) {\n\t\tconst matched = matchPath( path, screen.path );\n\t\tif ( matched ) {\n\t\t\treturn { params: matched.params, id: screen.id };\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nexport function findParent( path: string, screens: Screen[] ) {\n\tif ( ! path.startsWith( '/' ) ) {\n\t\treturn undefined;\n\t}\n\tconst pathParts = path.split( '/' );\n\tlet parentPath;\n\twhile ( pathParts.length > 1 && parentPath === undefined ) {\n\t\tpathParts.pop();\n\t\tconst potentialParentPath =\n\t\t\tpathParts.join( '/' ) === '' ? '/' : pathParts.join( '/' );\n\t\tif (\n\t\t\tscreens.find( ( screen ) => {\n\t\t\t\treturn matchPath( potentialParentPath, screen.path ) !== false;\n\t\t\t} )\n\t\t) {\n\t\t\tparentPath = potentialParentPath;\n\t\t}\n\t}\n\n\treturn parentPath;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,aAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,SAASC,SAASA,CAAEC,IAAY,EAAEC,OAAe,EAAG;EACnD,MAAMC,gBAAgB,GAAG,IAAAC,mBAAK,EAAiBF,OAAO,EAAE;IACvDG,MAAM,EAAEC;EACT,CAAE,CAAC;EACH,OAAOH,gBAAgB,CAAEF,IAAK,CAAC;AAChC;AAEO,SAASM,YAAYA,CAAEN,IAAY,EAAEO,OAAiB,EAAG;EAC/D,KAAM,MAAMC,MAAM,IAAID,OAAO,EAAG;IAC/B,MAAME,OAAO,GAAGV,SAAS,CAAEC,IAAI,EAAEQ,MAAM,CAACR,IAAK,CAAC;IAC9C,IAAKS,OAAO,EAAG;MACd,OAAO;QAAEC,MAAM,EAAED,OAAO,CAACC,MAAM;QAAEC,EAAE,EAAEH,MAAM,CAACG;MAAG,CAAC;IACjD;EACD;EAEA,OAAOC,SAAS;AACjB;AAEO,SAASC,UAAUA,CAAEb,IAAY,EAAEO,OAAiB,EAAG;EAC7D,IAAK,CAAEP,IAAI,CAACc,UAAU,CAAE,GAAI,CAAC,EAAG;IAC/B,OAAOF,SAAS;EACjB;EACA,MAAMG,SAAS,GAAGf,IAAI,CAACgB,KAAK,CAAE,GAAI,CAAC;EACnC,IAAIC,UAAU;EACd,OAAQF,SAAS,CAACG,MAAM,GAAG,CAAC,IAAID,UAAU,KAAKL,SAAS,EAAG;IAC1DG,SAAS,CAACI,GAAG,CAAC,CAAC;IACf,MAAMC,mBAAmB,GACxBL,SAAS,CAACM,IAAI,CAAE,GAAI,CAAC,KAAK,EAAE,GAAG,GAAG,GAAGN,SAAS,CAACM,IAAI,CAAE,GAAI,CAAC;IAC3D,IACCd,OAAO,CAACe,IAAI,CAAId,MAAM,IAAM;MAC3B,OAAOT,SAAS,CAAEqB,mBAAmB,EAAEZ,MAAM,CAACR,IAAK,CAAC,KAAK,KAAK;IAC/D,CAAE,CAAC,EACF;MACDiB,UAAU,GAAGG,mBAAmB;IACjC;EACD;EAEA,OAAOH,UAAU;AAClB","ignoreList":[]}
|
package/build/notice/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_a11y","_icons","_button","_visuallyHidden","_jsxRuntime","noop","useSpokenMessage","message","politeness","spokenMessage","renderToString","useEffect","speak","getDefaultPoliteness","status","getStatusLabel","__","Notice","className","children","onRemove","isDismissible","actions","__unstableHTML","onDismiss","classes","clsx","jsx","RawHTML","onDismissNotice","jsxs","VisuallyHidden","map","buttonCustomClasses","label","isPrimary","variant","noDefaultClasses","onClick","url","index","computedVariant","default","__next40pxDefaultSize","href","undefined","size","icon","close","_default","exports"],"sources":["@wordpress/components/src/notice/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { RawHTML, useEffect, renderToString } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\nimport { close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { NoticeAction, NoticeProps } from './types';\nimport type { DeprecatedButtonProps } from '../button/types';\nimport { VisuallyHidden } from '../visually-hidden';\n\nconst noop = () => {};\n\n/**\n * Custom hook which announces the message with the given politeness, if a\n * valid message is provided.\n */\nfunction useSpokenMessage(\n\tmessage: NoticeProps[ 'spokenMessage' ],\n\tpoliteness: NoticeProps[ 'politeness' ]\n) {\n\tconst spokenMessage =\n\t\ttypeof message === 'string' ? message : renderToString( message );\n\n\tuseEffect( () => {\n\t\tif ( spokenMessage ) {\n\t\t\tspeak( spokenMessage, politeness );\n\t\t}\n\t}, [ spokenMessage, politeness ] );\n}\n\nfunction getDefaultPoliteness( status: NoticeProps[ 'status' ] ) {\n\tswitch ( status ) {\n\t\tcase 'success':\n\t\tcase 'warning':\n\t\tcase 'info':\n\t\t\treturn 'polite';\n\t\t// The default will also catch the 'error' status.\n\t\tdefault:\n\t\t\treturn 'assertive';\n\t}\n}\n\nfunction getStatusLabel( status: NoticeProps[ 'status' ] ) {\n\tswitch ( status ) {\n\t\tcase 'warning':\n\t\t\treturn __( 'Warning notice' );\n\t\tcase 'info':\n\t\t\treturn __( 'Information notice' );\n\t\tcase 'error':\n\t\t\treturn __( 'Error notice' );\n\t\t// The default will also catch the 'success' status.\n\t\tdefault:\n\t\t\treturn __( 'Notice' );\n\t}\n}\n\n/**\n * `Notice` is a component used to communicate feedback to the user.\n *\n *```jsx\n * import { Notice } from `@wordpress/components`;\n *\n * const MyNotice = () => (\n * <Notice status=\"error\">An unknown error occurred.</Notice>\n * );\n * ```\n */\nfunction Notice( {\n\tclassName,\n\tstatus = 'info',\n\tchildren,\n\tspokenMessage = children,\n\tonRemove = noop,\n\tisDismissible = true,\n\tactions = [],\n\tpoliteness = getDefaultPoliteness( status ),\n\t__unstableHTML,\n\t// onDismiss is a callback executed when the notice is dismissed.\n\t// It is distinct from onRemove, which _looks_ like a callback but is\n\t// actually the function to call to remove the notice from the UI.\n\tonDismiss = noop,\n}: NoticeProps ) {\n\tuseSpokenMessage( spokenMessage, politeness );\n\n\tconst classes = clsx( className, 'components-notice', 'is-' + status, {\n\t\t'is-dismissible': isDismissible,\n\t} );\n\n\tif ( __unstableHTML && typeof children === 'string' ) {\n\t\tchildren = <RawHTML>{ children }</RawHTML>;\n\t}\n\n\tconst onDismissNotice = () => {\n\t\tonDismiss();\n\t\tonRemove();\n\t};\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t<VisuallyHidden>{ getStatusLabel( status ) }</VisuallyHidden>\n\t\t\t<div className=\"components-notice__content\">\n\t\t\t\t{ children }\n\t\t\t\t<div className=\"components-notice__actions\">\n\t\t\t\t\t{ actions.map(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclassName: buttonCustomClasses,\n\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\tisPrimary,\n\t\t\t\t\t\t\t\tvariant,\n\t\t\t\t\t\t\t\tnoDefaultClasses = false,\n\t\t\t\t\t\t\t\tonClick,\n\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t}: NoticeAction &\n\t\t\t\t\t\t\t\t// `isPrimary` is a legacy prop included for\n\t\t\t\t\t\t\t\t// backcompat, but `variant` should be used\n\t\t\t\t\t\t\t\t// instead.\n\t\t\t\t\t\t\t\tPick< DeprecatedButtonProps, 'isPrimary' >,\n\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\tlet computedVariant = variant;\n\t\t\t\t\t\t\tif ( variant !== 'primary' && ! noDefaultClasses ) {\n\t\t\t\t\t\t\t\tcomputedVariant = ! url ? 'secondary' : 'link';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\ttypeof computedVariant === 'undefined' &&\n\t\t\t\t\t\t\t\tisPrimary\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcomputedVariant = 'primary';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\thref={ url }\n\t\t\t\t\t\t\t\t\tvariant={ computedVariant }\n\t\t\t\t\t\t\t\t\tonClick={ url ? undefined : onClick }\n\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'components-notice__action',\n\t\t\t\t\t\t\t\t\t\tbuttonCustomClasses\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t</Button>\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</div>\n\t\t\t</div>\n\t\t\t{ isDismissible && (\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tclassName=\"components-notice__dismiss\"\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ onDismissNotice }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default Notice;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_a11y","_icons","_button","_visuallyHidden","_jsxRuntime","noop","useSpokenMessage","message","politeness","spokenMessage","renderToString","useEffect","speak","getDefaultPoliteness","status","getStatusLabel","__","Notice","className","children","onRemove","isDismissible","actions","__unstableHTML","onDismiss","classes","clsx","jsx","RawHTML","onDismissNotice","jsxs","VisuallyHidden","map","buttonCustomClasses","label","isPrimary","variant","noDefaultClasses","onClick","url","index","computedVariant","default","__next40pxDefaultSize","href","undefined","size","icon","close","_default","exports"],"sources":["@wordpress/components/src/notice/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { RawHTML, useEffect, renderToString } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\nimport { close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { NoticeAction, NoticeProps } from './types';\nimport type { DeprecatedButtonProps } from '../button/types';\nimport { VisuallyHidden } from '../visually-hidden';\n\nconst noop = () => {};\n\n/**\n * Custom hook which announces the message with the given politeness, if a\n * valid message is provided.\n */\nfunction useSpokenMessage(\n\tmessage: NoticeProps[ 'spokenMessage' ],\n\tpoliteness: NoticeProps[ 'politeness' ]\n) {\n\tconst spokenMessage =\n\t\ttypeof message === 'string' ? message : renderToString( message );\n\n\tuseEffect( () => {\n\t\tif ( spokenMessage ) {\n\t\t\tspeak( spokenMessage, politeness );\n\t\t}\n\t}, [ spokenMessage, politeness ] );\n}\n\nfunction getDefaultPoliteness( status: NoticeProps[ 'status' ] ) {\n\tswitch ( status ) {\n\t\tcase 'success':\n\t\tcase 'warning':\n\t\tcase 'info':\n\t\t\treturn 'polite';\n\t\t// The default will also catch the 'error' status.\n\t\tdefault:\n\t\t\treturn 'assertive';\n\t}\n}\n\nfunction getStatusLabel( status: NoticeProps[ 'status' ] ) {\n\tswitch ( status ) {\n\t\tcase 'warning':\n\t\t\treturn __( 'Warning notice' );\n\t\tcase 'info':\n\t\t\treturn __( 'Information notice' );\n\t\tcase 'error':\n\t\t\treturn __( 'Error notice' );\n\t\t// The default will also catch the 'success' status.\n\t\tdefault:\n\t\t\treturn __( 'Notice' );\n\t}\n}\n\n/**\n * `Notice` is a component used to communicate feedback to the user.\n *\n *```jsx\n * import { Notice } from `@wordpress/components`;\n *\n * const MyNotice = () => (\n * <Notice status=\"error\">An unknown error occurred.</Notice>\n * );\n * ```\n */\nfunction Notice( {\n\tclassName,\n\tstatus = 'info',\n\tchildren,\n\tspokenMessage = children,\n\tonRemove = noop,\n\tisDismissible = true,\n\tactions = [],\n\tpoliteness = getDefaultPoliteness( status ),\n\t__unstableHTML,\n\t// onDismiss is a callback executed when the notice is dismissed.\n\t// It is distinct from onRemove, which _looks_ like a callback but is\n\t// actually the function to call to remove the notice from the UI.\n\tonDismiss = noop,\n}: NoticeProps ) {\n\tuseSpokenMessage( spokenMessage, politeness );\n\n\tconst classes = clsx( className, 'components-notice', 'is-' + status, {\n\t\t'is-dismissible': isDismissible,\n\t} );\n\n\tif ( __unstableHTML && typeof children === 'string' ) {\n\t\tchildren = <RawHTML>{ children }</RawHTML>;\n\t}\n\n\tconst onDismissNotice = () => {\n\t\tonDismiss();\n\t\tonRemove();\n\t};\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t<VisuallyHidden>{ getStatusLabel( status ) }</VisuallyHidden>\n\t\t\t<div className=\"components-notice__content\">\n\t\t\t\t{ children }\n\t\t\t\t<div className=\"components-notice__actions\">\n\t\t\t\t\t{ actions.map(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclassName: buttonCustomClasses,\n\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\tisPrimary,\n\t\t\t\t\t\t\t\tvariant,\n\t\t\t\t\t\t\t\tnoDefaultClasses = false,\n\t\t\t\t\t\t\t\tonClick,\n\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t}: NoticeAction &\n\t\t\t\t\t\t\t\t// `isPrimary` is a legacy prop included for\n\t\t\t\t\t\t\t\t// backcompat, but `variant` should be used\n\t\t\t\t\t\t\t\t// instead.\n\t\t\t\t\t\t\t\tPick< DeprecatedButtonProps, 'isPrimary' >,\n\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\tlet computedVariant = variant;\n\t\t\t\t\t\t\tif ( variant !== 'primary' && ! noDefaultClasses ) {\n\t\t\t\t\t\t\t\tcomputedVariant = ! url ? 'secondary' : 'link';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\ttypeof computedVariant === 'undefined' &&\n\t\t\t\t\t\t\t\tisPrimary\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcomputedVariant = 'primary';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\thref={ url }\n\t\t\t\t\t\t\t\t\tvariant={ computedVariant }\n\t\t\t\t\t\t\t\t\tonClick={ url ? undefined : onClick }\n\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'components-notice__action',\n\t\t\t\t\t\t\t\t\t\tbuttonCustomClasses\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t</Button>\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</div>\n\t\t\t</div>\n\t\t\t{ isDismissible && (\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tclassName=\"components-notice__dismiss\"\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ onDismissNotice }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default Notice;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,OAAA,GAAAN,sBAAA,CAAAC,OAAA;AAGA,IAAAM,eAAA,GAAAN,OAAA;AAAoD,IAAAO,WAAA,GAAAP,OAAA;AAnBpD;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAMA,MAAMQ,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA,SAASC,gBAAgBA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OAAM;YACNC,qBAAqB;YAErBC,IAAI,EAAGL,GAAK;YACZH,OAAO,EAAGK,eAAiB;YAC3BH,OAAO,EAAGC,GAAG,GAAGM,SAAS,GAAGP,OAAS;YACrCpB,SAAS,EAAG,IAAAQ,aAAI,EACf,2BAA2B,EAC3BO,mBACD,CAAG;YAAAd,QAAA,EAEDe;UAAK,GATDM,KAUC,CAAC;QAEX,CACD;MAAC,CACG,CAAC;IAAA,CACF,CAAC,EACJnB,aAAa,iBACd,IAAAjB,WAAA,CAAAuB,GAAA,EAACzB,OAAA,CAAAwC,OAAM;MACNI,IAAI,EAAC,OAAO;MACZ5B,SAAS,EAAC,4BAA4B;MACtC6B,IAAI,EAAGC,YAAO;MACdd,KAAK,EAAG,IAAAlB,QAAE,EAAE,OAAQ,CAAG;MACvBsB,OAAO,EAAGT;IAAiB,CAC3B,CACD;EAAA,CACG,CAAC;AAER;AAAC,IAAAoB,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAEczB,MAAM","ignoreList":[]}
|
package/build/notice/list.js
CHANGED
package/build/notice/list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_","_react","_jsxRuntime","noop","NoticeList","notices","onRemove","className","children","removeNotice","id","clsx","jsxs","reverse","map","notice","content","restNotice","createElement","default","key","_default","exports"],"sources":["@wordpress/components/src/notice/list.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport Notice from '.';\nimport type { WordPressComponentProps } from '../context';\nimport type { NoticeListProps } from './types';\n\nconst noop = () => {};\n\n/**\n * `NoticeList` is a component used to render a collection of notices.\n *\n *```jsx\n * import { Notice, NoticeList } from `@wordpress/components`;\n *\n * const MyNoticeList = () => {\n *\tconst [ notices, setNotices ] = useState( [\n *\t\t{\n *\t\t\tid: 'second-notice',\n *\t\t\tcontent: 'second notice content',\n *\t\t},\n *\t\t{\n *\t\t\tid: 'fist-notice',\n *\t\t\tcontent: 'first notice content',\n *\t\t},\n *\t] );\n *\n *\tconst removeNotice = ( id ) => {\n *\t\tsetNotices( notices.filter( ( notice ) => notice.id !== id ) );\n *\t};\n *\n *\treturn <NoticeList notices={ notices } onRemove={ removeNotice } />;\n *};\n *```\n */\nfunction NoticeList( {\n\tnotices,\n\tonRemove = noop,\n\tclassName,\n\tchildren,\n}: WordPressComponentProps< NoticeListProps, 'div', false > ) {\n\tconst removeNotice =\n\t\t( id: NoticeListProps[ 'notices' ][ number ][ 'id' ] ) => () =>\n\t\t\tonRemove( id );\n\n\tclassName = clsx( 'components-notice-list', className );\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t{ children }\n\t\t\t{ [ ...notices ].reverse().map( ( notice ) => {\n\t\t\t\tconst { content, ...restNotice } = notice;\n\t\t\t\treturn (\n\t\t\t\t\t<Notice\n\t\t\t\t\t\t{ ...restNotice }\n\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\tonRemove={ removeNotice( notice.id ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ notice.content }\n\t\t\t\t\t</Notice>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n\nexport default NoticeList;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_","_react","_jsxRuntime","noop","NoticeList","notices","onRemove","className","children","removeNotice","id","clsx","jsxs","reverse","map","notice","content","restNotice","createElement","default","key","_default","exports"],"sources":["@wordpress/components/src/notice/list.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport Notice from '.';\nimport type { WordPressComponentProps } from '../context';\nimport type { NoticeListProps } from './types';\n\nconst noop = () => {};\n\n/**\n * `NoticeList` is a component used to render a collection of notices.\n *\n *```jsx\n * import { Notice, NoticeList } from `@wordpress/components`;\n *\n * const MyNoticeList = () => {\n *\tconst [ notices, setNotices ] = useState( [\n *\t\t{\n *\t\t\tid: 'second-notice',\n *\t\t\tcontent: 'second notice content',\n *\t\t},\n *\t\t{\n *\t\t\tid: 'fist-notice',\n *\t\t\tcontent: 'first notice content',\n *\t\t},\n *\t] );\n *\n *\tconst removeNotice = ( id ) => {\n *\t\tsetNotices( notices.filter( ( notice ) => notice.id !== id ) );\n *\t};\n *\n *\treturn <NoticeList notices={ notices } onRemove={ removeNotice } />;\n *};\n *```\n */\nfunction NoticeList( {\n\tnotices,\n\tonRemove = noop,\n\tclassName,\n\tchildren,\n}: WordPressComponentProps< NoticeListProps, 'div', false > ) {\n\tconst removeNotice =\n\t\t( id: NoticeListProps[ 'notices' ][ number ][ 'id' ] ) => () =>\n\t\t\tonRemove( id );\n\n\tclassName = clsx( 'components-notice-list', className );\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t{ children }\n\t\t\t{ [ ...notices ].reverse().map( ( notice ) => {\n\t\t\t\tconst { content, ...restNotice } = notice;\n\t\t\t\treturn (\n\t\t\t\t\t<Notice\n\t\t\t\t\t\t{ ...restNotice }\n\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\tonRemove={ removeNotice( notice.id ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ notice.content }\n\t\t\t\t\t</Notice>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n\nexport default NoticeList;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,CAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAuB,IAAAE,MAAA,GAAAF,OAAA;AAAA,IAAAG,WAAA,GAAAH,OAAA;AARvB;AACA;AACA;;AAGA;AACA;AACA;;AAKA,MAAMI,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;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,SAASC,UAAUA,CAAE;EACpBC,OAAO;EACPC,QAAQ,GAAGH,IAAI;EACfI,SAAS;EACTC;AACyD,CAAC,EAAG;EAC7D,MAAMC,YAAY,GACfC,EAAkD,IAAM,MACzDJ,QAAQ,CAAEI,EAAG,CAAC;EAEhBH,SAAS,GAAG,IAAAI,aAAI,EAAE,wBAAwB,EAAEJ,SAAU,CAAC;EAEvD,oBACC,IAAAL,WAAA,CAAAU,IAAA;IAAKL,SAAS,EAAGA,SAAW;IAAAC,QAAA,GACzBA,QAAQ,EACR,CAAE,GAAGH,OAAO,CAAE,CAACQ,OAAO,CAAC,CAAC,CAACC,GAAG,CAAIC,MAAM,IAAM;MAC7C,MAAM;QAAEC,OAAO;QAAE,GAAGC;MAAW,CAAC,GAAGF,MAAM;MACzC,oBACC,IAAAd,MAAA,CAAAiB,aAAA,EAAClB,CAAA,CAAAmB,OAAM;QAAA,GACDF,UAAU;QACfG,GAAG,EAAGL,MAAM,CAACL,EAAI;QACjBJ,QAAQ,EAAGG,YAAY,CAAEM,MAAM,CAACL,EAAG;MAAG,GAEpCK,MAAM,CAACC,OACF,CAAC;IAEX,CAAE,CAAC;EAAA,CACC,CAAC;AAER;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEcf,UAAU","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_data","_notices","_","_interopRequireDefault","_style","_element","_react","_jsxRuntime","NoticeList","notices","useSelect","select","getNotices","noticesStore","removeNotice","useDispatch","onRemoveNotice","useCallback","id","length","jsx","View","style","styles","list","children","map","notice","createElement","default","key","onNoticeHidden","_default","exports"],"sources":["@wordpress/components/src/notice/list.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport Notice from './';\nimport styles from './style.scss';\nimport { useCallback } from '@wordpress/element';\n\nfunction NoticeList() {\n\tconst { notices } = useSelect( ( select ) => {\n\t\tconst { getNotices } = select( noticesStore );\n\t\treturn {\n\t\t\tnotices: getNotices(),\n\t\t};\n\t}, [] );\n\n\tconst { removeNotice } = useDispatch( noticesStore );\n\n\tconst onRemoveNotice = useCallback(\n\t\t( id ) => {\n\t\t\tremoveNotice( id );\n\t\t},\n\t\t[ removeNotice ]\n\t);\n\n\tif ( ! notices.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<View style={ styles.list }>\n\t\t\t{ notices.map( ( notice ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Notice\n\t\t\t\t\t\t{ ...notice }\n\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\tonNoticeHidden={ onRemoveNotice }\n\t\t\t\t\t></Notice>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</View>\n\t);\n}\n\nexport default NoticeList;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_data","_notices","_","_interopRequireDefault","_style","_element","_react","_jsxRuntime","NoticeList","notices","useSelect","select","getNotices","noticesStore","removeNotice","useDispatch","onRemoveNotice","useCallback","id","length","jsx","View","style","styles","list","children","map","notice","createElement","default","key","onNoticeHidden","_default","exports"],"sources":["@wordpress/components/src/notice/list.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport Notice from './';\nimport styles from './style.scss';\nimport { useCallback } from '@wordpress/element';\n\nfunction NoticeList() {\n\tconst { notices } = useSelect( ( select ) => {\n\t\tconst { getNotices } = select( noticesStore );\n\t\treturn {\n\t\t\tnotices: getNotices(),\n\t\t};\n\t}, [] );\n\n\tconst { removeNotice } = useDispatch( noticesStore );\n\n\tconst onRemoveNotice = useCallback(\n\t\t( id ) => {\n\t\t\tremoveNotice( id );\n\t\t},\n\t\t[ removeNotice ]\n\t);\n\n\tif ( ! notices.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<View style={ styles.list }>\n\t\t\t{ notices.map( ( notice ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Notice\n\t\t\t\t\t\t{ ...notice }\n\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\tonNoticeHidden={ onRemoveNotice }\n\t\t\t\t\t></Notice>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</View>\n\t);\n}\n\nexport default NoticeList;\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,CAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAAiD,IAAAO,MAAA,GAAAP,OAAA;AAAA,IAAAQ,WAAA,GAAAR,OAAA;AAhBjD;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAKA,SAASS,UAAUA,CAAA,EAAG;EACrB,MAAM;IAAEC;EAAQ,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5C,MAAM;MAAEC;IAAW,CAAC,GAAGD,MAAM,CAAEE,cAAa,CAAC;IAC7C,OAAO;MACNJ,OAAO,EAAEG,UAAU,CAAC;IACrB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEE;EAAa,CAAC,GAAG,IAAAC,iBAAW,EAAEF,cAAa,CAAC;EAEpD,MAAMG,cAAc,GAAG,IAAAC,oBAAW,EAC/BC,EAAE,IAAM;IACTJ,YAAY,CAAEI,EAAG,CAAC;EACnB,CAAC,EACD,CAAEJ,YAAY,CACf,CAAC;EAED,IAAK,CAAEL,OAAO,CAACU,MAAM,EAAG;IACvB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAZ,WAAA,CAAAa,GAAA,EAACtB,YAAA,CAAAuB,IAAI;IAACC,KAAK,EAAGC,cAAM,CAACC,IAAM;IAAAC,QAAA,EACxBhB,OAAO,CAACiB,GAAG,CAAIC,MAAM,IAAM;MAC5B,oBACC,IAAArB,MAAA,CAAAsB,aAAA,EAAC1B,CAAA,CAAA2B,OAAM;QAAA,GACDF,MAAM;QACXG,GAAG,EAAGH,MAAM,CAACT,EAAI;QACjBa,cAAc,EAAGf;MAAgB,CACzB,CAAC;IAEZ,CAAE;EAAC,CACE,CAAC;AAET;AAAC,IAAAgB,QAAA,GAAAC,OAAA,CAAAJ,OAAA,GAEcrB,UAAU","ignoreList":[]}
|
|
@@ -205,6 +205,7 @@ function UnforwardedNumberControl(props, forwardedRef) {
|
|
|
205
205
|
return (_stateReducerProp = stateReducerProp?.(baseState, action)) !== null && _stateReducerProp !== void 0 ? _stateReducerProp : baseState;
|
|
206
206
|
},
|
|
207
207
|
size: size,
|
|
208
|
+
__shouldNotWarnDeprecated36pxSize: true,
|
|
208
209
|
suffix: spinControls === 'custom' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
209
210
|
children: [suffix, /*#__PURE__*/(0, _jsxRuntime.jsx)(_spacer.Spacer, {
|
|
210
211
|
marginBottom: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_icons","_compose","_deprecated","_numberControlStyles","inputControlActionTypes","_interopRequireWildcard","_math","_values","_hStack","_spacer","_utils","_useDeprecatedProps","_deprecated36pxSize","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","noop","UnforwardedNumberControl","props","forwardedRef","__unstableStateReducer","stateReducerProp","className","dragDirection","hideHTMLArrows","spinControls","isDragEnabled","isShiftStepEnabled","label","max","Infinity","min","required","shiftStep","step","spinFactor","type","typeProp","value","valueProp","size","suffix","onChange","__shouldNotWarnDeprecated36pxSize","restProps","useDeprecated36pxDefaultSizeProp","maybeWarnDeprecated36pxSize","componentName","__next40pxDefaultSize","deprecated","alternative","since","version","inputRef","useRef","mergedRef","useMergeRefs","isStepAny","baseStep","ensureNumber","baseSpin","baseValue","roundClamp","constrainValue","stepOverride","Math","autoComplete","undefined","classes","clsx","cx","useCx","spinButtonClasses","styles","smallSpinButtons","spinValue","direction","event","preventDefault","shift","shiftKey","delta","nextValue","isValueEmpty","add","subtract","numberControlStateReducer","state","action","nextState","payload","currentValue","PRESS_UP","PRESS_DOWN","DRAG","x","y","enableShift","modifier","directionModifier","isRTL","ceil","abs","sign","distance","PRESS_ENTER","COMMIT","applyEmptyValue","buildSpinButtonClickHandler","String","target","current","jsx","Input","inputMode","ref","_stateReducerProp","baseState","jsxs","Fragment","children","Spacer","marginBottom","marginRight","HStack","spacing","SpinButton","icon","plusIcon","__","onClick","resetIcon","NumberControl","exports","forwardRef","_default"],"sources":["@wordpress/components/src/number-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { plus as plusIcon, reset as resetIcon } from '@wordpress/icons';\nimport { useMergeRefs } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { Input, SpinButton, styles } from './styles/number-control-styles';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { add, subtract, roundClamp } from '../utils/math';\nimport { ensureNumber, isValueEmpty } from '../utils/values';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type { NumberControlProps } from './types';\nimport { HStack } from '../h-stack';\nimport { Spacer } from '../spacer';\nimport { useCx } from '../utils';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\n\nconst noop = () => {};\n\nfunction UnforwardedNumberControl(\n\tprops: WordPressComponentProps< NumberControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__unstableStateReducer: stateReducerProp,\n\t\tclassName,\n\t\tdragDirection = 'n',\n\t\thideHTMLArrows = false,\n\t\tspinControls = hideHTMLArrows ? 'none' : 'native',\n\t\tisDragEnabled = true,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmax = Infinity,\n\t\tmin = -Infinity,\n\t\trequired = false,\n\t\tshiftStep = 10,\n\t\tstep = 1,\n\t\tspinFactor = 1,\n\t\ttype: typeProp = 'number',\n\t\tvalue: valueProp,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\tonChange = noop,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t\t...restProps\n\t} = useDeprecated36pxDefaultSizeProp< NumberControlProps >( props );\n\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'NumberControl',\n\t\tsize,\n\t\t__next40pxDefaultSize: restProps.__next40pxDefaultSize,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t} );\n\n\tif ( hideHTMLArrows ) {\n\t\tdeprecated( 'wp.components.NumberControl hideHTMLArrows prop ', {\n\t\t\talternative: 'spinControls=\"none\"',\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.3',\n\t\t} );\n\t}\n\tconst inputRef = useRef< HTMLInputElement >();\n\tconst mergedRef = useMergeRefs( [ inputRef, forwardedRef ] );\n\n\tconst isStepAny = step === 'any';\n\tconst baseStep = isStepAny ? 1 : ensureNumber( step );\n\tconst baseSpin = ensureNumber( spinFactor ) * baseStep;\n\tconst baseValue = roundClamp( 0, min, max, baseStep );\n\tconst constrainValue = (\n\t\tvalue: number | string,\n\t\tstepOverride?: number\n\t) => {\n\t\t// When step is \"any\" clamp the value, otherwise round and clamp it.\n\t\t// Use '' + to convert to string for use in input value attribute.\n\t\treturn isStepAny\n\t\t\t? '' + Math.min( max, Math.max( min, ensureNumber( value ) ) )\n\t\t\t: '' + roundClamp( value, min, max, stepOverride ?? baseStep );\n\t};\n\n\tconst autoComplete = typeProp === 'number' ? 'off' : undefined;\n\tconst classes = clsx( 'components-number-control', className );\n\tconst cx = useCx();\n\tconst spinButtonClasses = cx( size === 'small' && styles.smallSpinButtons );\n\n\tconst spinValue = (\n\t\tvalue: string | number | undefined,\n\t\tdirection: 'up' | 'down',\n\t\tevent: KeyboardEvent | MouseEvent | undefined\n\t) => {\n\t\tevent?.preventDefault();\n\t\tconst shift = event?.shiftKey && isShiftStepEnabled;\n\t\tconst delta = shift ? ensureNumber( shiftStep ) * baseSpin : baseSpin;\n\t\tlet nextValue = isValueEmpty( value ) ? baseValue : value;\n\t\tif ( direction === 'up' ) {\n\t\t\tnextValue = add( nextValue, delta );\n\t\t} else if ( direction === 'down' ) {\n\t\t\tnextValue = subtract( nextValue, delta );\n\t\t}\n\t\treturn constrainValue( nextValue, shift ? delta : undefined );\n\t};\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @return The updated state to apply to InputControl\n\t */\n\tconst numberControlStateReducer: NumberControlProps[ '__unstableStateReducer' ] =\n\t\t( state, action ) => {\n\t\t\tconst nextState = { ...state };\n\n\t\t\tconst { type, payload } = action;\n\t\t\tconst event = payload.event;\n\t\t\tconst currentValue = nextState.value;\n\n\t\t\t/**\n\t\t\t * Handles custom UP and DOWN Keyboard events\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_UP ||\n\t\t\t\ttype === inputControlActionTypes.PRESS_DOWN\n\t\t\t) {\n\t\t\t\tnextState.value = spinValue(\n\t\t\t\t\tcurrentValue,\n\t\t\t\t\ttype === inputControlActionTypes.PRESS_UP ? 'up' : 'down',\n\t\t\t\t\tevent as KeyboardEvent | undefined\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles drag to update events\n\t\t\t */\n\t\t\tif ( type === inputControlActionTypes.DRAG && isDragEnabled ) {\n\t\t\t\tconst [ x, y ] = payload.delta;\n\t\t\t\tconst enableShift = payload.shiftKey && isShiftStepEnabled;\n\t\t\t\tconst modifier = enableShift\n\t\t\t\t\t? ensureNumber( shiftStep ) * baseSpin\n\t\t\t\t\t: baseSpin;\n\n\t\t\t\tlet directionModifier;\n\t\t\t\tlet delta;\n\n\t\t\t\tswitch ( dragDirection ) {\n\t\t\t\t\tcase 'n':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = -1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'e':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? -1 : 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 's':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'w':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? 1 : -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( delta !== 0 ) {\n\t\t\t\t\tdelta = Math.ceil( Math.abs( delta ) ) * Math.sign( delta );\n\t\t\t\t\tconst distance = delta * modifier * directionModifier;\n\n\t\t\t\t\tnextState.value = constrainValue(\n\t\t\t\t\t\t// @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t\tadd( currentValue, distance ),\n\t\t\t\t\t\tenableShift ? modifier : undefined\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles commit (ENTER key press or blur)\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_ENTER ||\n\t\t\t\ttype === inputControlActionTypes.COMMIT\n\t\t\t) {\n\t\t\t\tconst applyEmptyValue =\n\t\t\t\t\trequired === false && currentValue === '';\n\n\t\t\t\tnextState.value = applyEmptyValue\n\t\t\t\t\t? currentValue\n\t\t\t\t\t: // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t constrainValue( currentValue );\n\t\t\t}\n\n\t\t\treturn nextState;\n\t\t};\n\n\tconst buildSpinButtonClickHandler =\n\t\t( direction: 'up' | 'down' ) =>\n\t\t( event: MouseEvent< HTMLButtonElement > ) =>\n\t\t\tonChange( String( spinValue( valueProp, direction, event ) ), {\n\t\t\t\t// Set event.target to the <input> so that consumers can use\n\t\t\t\t// e.g. event.target.validity.\n\t\t\t\tevent: {\n\t\t\t\t\t...event,\n\t\t\t\t\ttarget: inputRef.current!,\n\t\t\t\t},\n\t\t\t} );\n\n\treturn (\n\t\t<Input\n\t\t\tautoComplete={ autoComplete }\n\t\t\tinputMode=\"numeric\"\n\t\t\t{ ...restProps }\n\t\t\tclassName={ classes }\n\t\t\tdragDirection={ dragDirection }\n\t\t\thideHTMLArrows={ spinControls !== 'native' }\n\t\t\tisDragEnabled={ isDragEnabled }\n\t\t\tlabel={ label }\n\t\t\tmax={ max }\n\t\t\tmin={ min }\n\t\t\tref={ mergedRef }\n\t\t\trequired={ required }\n\t\t\tstep={ step }\n\t\t\ttype={ typeProp }\n\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\tvalue={ valueProp }\n\t\t\t__unstableStateReducer={ ( state, action ) => {\n\t\t\t\tconst baseState = numberControlStateReducer( state, action );\n\t\t\t\treturn stateReducerProp?.( baseState, action ) ?? baseState;\n\t\t\t} }\n\t\t\tsize={ size }\n\t\t\tsuffix={\n\t\t\t\tspinControls === 'custom' ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t\t<Spacer marginBottom={ 0 } marginRight={ 2 }>\n\t\t\t\t\t\t\t<HStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\tclassName={ spinButtonClasses }\n\t\t\t\t\t\t\t\t\ticon={ plusIcon }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Increment' ) }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'up'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\tclassName={ spinButtonClasses }\n\t\t\t\t\t\t\t\t\ticon={ resetIcon }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Decrement' ) }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'down'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\tsuffix\n\t\t\t\t)\n\t\t\t}\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\nexport const NumberControl = forwardRef( UnforwardedNumberControl );\n\nexport default NumberControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAN,sBAAA,CAAAC,OAAA;AAKA,IAAAM,oBAAA,GAAAN,OAAA;AACA,IAAAO,uBAAA,GAAAC,uBAAA,CAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AAC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,gBACxB,IAAA9B,WAAA,CAAA2H,IAAA,EAAA3H,WAAA,CAAA4H,QAAA;MAAAC,QAAA,GACG/E,MAAM,eACR,IAAA9C,WAAA,CAAAqH,GAAA,EAACzH,OAAA,CAAAkI,MAAM;QAACC,YAAY,EAAG,CAAG;QAACC,WAAW,EAAG,CAAG;QAAAH,QAAA,eAC3C,IAAA7H,WAAA,CAAA2H,IAAA,EAAChI,OAAA,CAAAsI,MAAM;UAACC,OAAO,EAAG,CAAG;UAAAL,QAAA,gBACpB,IAAA7H,WAAA,CAAAqH,GAAA,EAAC/H,oBAAA,CAAA6I,UAAU;YACVxG,SAAS,EAAGkD,iBAAmB;YAC/BuD,IAAI,EAAGC,WAAU;YACjBxF,IAAI,EAAC,OAAO;YACZZ,KAAK,EAAG,IAAAqG,QAAE,EAAE,WAAY,CAAG;YAC3BC,OAAO,EAAGtB,2BAA2B,CACpC,IACD;UAAG,CACH,CAAC,eACF,IAAAjH,WAAA,CAAAqH,GAAA,EAAC/H,oBAAA,CAAA6I,UAAU;YACVxG,SAAS,EAAGkD,iBAAmB;YAC/BuD,IAAI,EAAGI,YAAW;YAClB3F,IAAI,EAAC,OAAO;YACZZ,KAAK,EAAG,IAAAqG,QAAE,EAAE,WAAY,CAAG;YAC3BC,OAAO,EAAGtB,2BAA2B,CACpC,MACD;UAAG,CACH,CAAC;QAAA,CACK;MAAC,CACF,CAAC;IAAA,CACR,CAAC,GAEHnE,MAED;IACDC,QAAQ,EAAGA;EAAU,CACrB,CAAC;AAEJ;AAEO,MAAM0F,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAAE,mBAAU,EAAErH,wBAAyB,CAAC;AAAC,IAAAsH,QAAA,GAAAF,OAAA,CAAAnI,OAAA,GAErDkI,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_icons","_compose","_deprecated","_numberControlStyles","inputControlActionTypes","_interopRequireWildcard","_math","_values","_hStack","_spacer","_utils","_useDeprecatedProps","_deprecated36pxSize","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","noop","UnforwardedNumberControl","props","forwardedRef","__unstableStateReducer","stateReducerProp","className","dragDirection","hideHTMLArrows","spinControls","isDragEnabled","isShiftStepEnabled","label","max","Infinity","min","required","shiftStep","step","spinFactor","type","typeProp","value","valueProp","size","suffix","onChange","__shouldNotWarnDeprecated36pxSize","restProps","useDeprecated36pxDefaultSizeProp","maybeWarnDeprecated36pxSize","componentName","__next40pxDefaultSize","deprecated","alternative","since","version","inputRef","useRef","mergedRef","useMergeRefs","isStepAny","baseStep","ensureNumber","baseSpin","baseValue","roundClamp","constrainValue","stepOverride","Math","autoComplete","undefined","classes","clsx","cx","useCx","spinButtonClasses","styles","smallSpinButtons","spinValue","direction","event","preventDefault","shift","shiftKey","delta","nextValue","isValueEmpty","add","subtract","numberControlStateReducer","state","action","nextState","payload","currentValue","PRESS_UP","PRESS_DOWN","DRAG","x","y","enableShift","modifier","directionModifier","isRTL","ceil","abs","sign","distance","PRESS_ENTER","COMMIT","applyEmptyValue","buildSpinButtonClickHandler","String","target","current","jsx","Input","inputMode","ref","_stateReducerProp","baseState","jsxs","Fragment","children","Spacer","marginBottom","marginRight","HStack","spacing","SpinButton","icon","plusIcon","__","onClick","resetIcon","NumberControl","exports","forwardRef","_default"],"sources":["@wordpress/components/src/number-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { plus as plusIcon, reset as resetIcon } from '@wordpress/icons';\nimport { useMergeRefs } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { Input, SpinButton, styles } from './styles/number-control-styles';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { add, subtract, roundClamp } from '../utils/math';\nimport { ensureNumber, isValueEmpty } from '../utils/values';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type { NumberControlProps } from './types';\nimport { HStack } from '../h-stack';\nimport { Spacer } from '../spacer';\nimport { useCx } from '../utils';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\n\nconst noop = () => {};\n\nfunction UnforwardedNumberControl(\n\tprops: WordPressComponentProps< NumberControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__unstableStateReducer: stateReducerProp,\n\t\tclassName,\n\t\tdragDirection = 'n',\n\t\thideHTMLArrows = false,\n\t\tspinControls = hideHTMLArrows ? 'none' : 'native',\n\t\tisDragEnabled = true,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmax = Infinity,\n\t\tmin = -Infinity,\n\t\trequired = false,\n\t\tshiftStep = 10,\n\t\tstep = 1,\n\t\tspinFactor = 1,\n\t\ttype: typeProp = 'number',\n\t\tvalue: valueProp,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\tonChange = noop,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t\t...restProps\n\t} = useDeprecated36pxDefaultSizeProp< NumberControlProps >( props );\n\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'NumberControl',\n\t\tsize,\n\t\t__next40pxDefaultSize: restProps.__next40pxDefaultSize,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t} );\n\n\tif ( hideHTMLArrows ) {\n\t\tdeprecated( 'wp.components.NumberControl hideHTMLArrows prop ', {\n\t\t\talternative: 'spinControls=\"none\"',\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.3',\n\t\t} );\n\t}\n\tconst inputRef = useRef< HTMLInputElement >();\n\tconst mergedRef = useMergeRefs( [ inputRef, forwardedRef ] );\n\n\tconst isStepAny = step === 'any';\n\tconst baseStep = isStepAny ? 1 : ensureNumber( step );\n\tconst baseSpin = ensureNumber( spinFactor ) * baseStep;\n\tconst baseValue = roundClamp( 0, min, max, baseStep );\n\tconst constrainValue = (\n\t\tvalue: number | string,\n\t\tstepOverride?: number\n\t) => {\n\t\t// When step is \"any\" clamp the value, otherwise round and clamp it.\n\t\t// Use '' + to convert to string for use in input value attribute.\n\t\treturn isStepAny\n\t\t\t? '' + Math.min( max, Math.max( min, ensureNumber( value ) ) )\n\t\t\t: '' + roundClamp( value, min, max, stepOverride ?? baseStep );\n\t};\n\n\tconst autoComplete = typeProp === 'number' ? 'off' : undefined;\n\tconst classes = clsx( 'components-number-control', className );\n\tconst cx = useCx();\n\tconst spinButtonClasses = cx( size === 'small' && styles.smallSpinButtons );\n\n\tconst spinValue = (\n\t\tvalue: string | number | undefined,\n\t\tdirection: 'up' | 'down',\n\t\tevent: KeyboardEvent | MouseEvent | undefined\n\t) => {\n\t\tevent?.preventDefault();\n\t\tconst shift = event?.shiftKey && isShiftStepEnabled;\n\t\tconst delta = shift ? ensureNumber( shiftStep ) * baseSpin : baseSpin;\n\t\tlet nextValue = isValueEmpty( value ) ? baseValue : value;\n\t\tif ( direction === 'up' ) {\n\t\t\tnextValue = add( nextValue, delta );\n\t\t} else if ( direction === 'down' ) {\n\t\t\tnextValue = subtract( nextValue, delta );\n\t\t}\n\t\treturn constrainValue( nextValue, shift ? delta : undefined );\n\t};\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @return The updated state to apply to InputControl\n\t */\n\tconst numberControlStateReducer: NumberControlProps[ '__unstableStateReducer' ] =\n\t\t( state, action ) => {\n\t\t\tconst nextState = { ...state };\n\n\t\t\tconst { type, payload } = action;\n\t\t\tconst event = payload.event;\n\t\t\tconst currentValue = nextState.value;\n\n\t\t\t/**\n\t\t\t * Handles custom UP and DOWN Keyboard events\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_UP ||\n\t\t\t\ttype === inputControlActionTypes.PRESS_DOWN\n\t\t\t) {\n\t\t\t\tnextState.value = spinValue(\n\t\t\t\t\tcurrentValue,\n\t\t\t\t\ttype === inputControlActionTypes.PRESS_UP ? 'up' : 'down',\n\t\t\t\t\tevent as KeyboardEvent | undefined\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles drag to update events\n\t\t\t */\n\t\t\tif ( type === inputControlActionTypes.DRAG && isDragEnabled ) {\n\t\t\t\tconst [ x, y ] = payload.delta;\n\t\t\t\tconst enableShift = payload.shiftKey && isShiftStepEnabled;\n\t\t\t\tconst modifier = enableShift\n\t\t\t\t\t? ensureNumber( shiftStep ) * baseSpin\n\t\t\t\t\t: baseSpin;\n\n\t\t\t\tlet directionModifier;\n\t\t\t\tlet delta;\n\n\t\t\t\tswitch ( dragDirection ) {\n\t\t\t\t\tcase 'n':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = -1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'e':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? -1 : 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 's':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'w':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? 1 : -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( delta !== 0 ) {\n\t\t\t\t\tdelta = Math.ceil( Math.abs( delta ) ) * Math.sign( delta );\n\t\t\t\t\tconst distance = delta * modifier * directionModifier;\n\n\t\t\t\t\tnextState.value = constrainValue(\n\t\t\t\t\t\t// @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t\tadd( currentValue, distance ),\n\t\t\t\t\t\tenableShift ? modifier : undefined\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles commit (ENTER key press or blur)\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_ENTER ||\n\t\t\t\ttype === inputControlActionTypes.COMMIT\n\t\t\t) {\n\t\t\t\tconst applyEmptyValue =\n\t\t\t\t\trequired === false && currentValue === '';\n\n\t\t\t\tnextState.value = applyEmptyValue\n\t\t\t\t\t? currentValue\n\t\t\t\t\t: // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t constrainValue( currentValue );\n\t\t\t}\n\n\t\t\treturn nextState;\n\t\t};\n\n\tconst buildSpinButtonClickHandler =\n\t\t( direction: 'up' | 'down' ) =>\n\t\t( event: MouseEvent< HTMLButtonElement > ) =>\n\t\t\tonChange( String( spinValue( valueProp, direction, event ) ), {\n\t\t\t\t// Set event.target to the <input> so that consumers can use\n\t\t\t\t// e.g. event.target.validity.\n\t\t\t\tevent: {\n\t\t\t\t\t...event,\n\t\t\t\t\ttarget: inputRef.current!,\n\t\t\t\t},\n\t\t\t} );\n\n\treturn (\n\t\t<Input\n\t\t\tautoComplete={ autoComplete }\n\t\t\tinputMode=\"numeric\"\n\t\t\t{ ...restProps }\n\t\t\tclassName={ classes }\n\t\t\tdragDirection={ dragDirection }\n\t\t\thideHTMLArrows={ spinControls !== 'native' }\n\t\t\tisDragEnabled={ isDragEnabled }\n\t\t\tlabel={ label }\n\t\t\tmax={ max }\n\t\t\tmin={ min }\n\t\t\tref={ mergedRef }\n\t\t\trequired={ required }\n\t\t\tstep={ step }\n\t\t\ttype={ typeProp }\n\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\tvalue={ valueProp }\n\t\t\t__unstableStateReducer={ ( state, action ) => {\n\t\t\t\tconst baseState = numberControlStateReducer( state, action );\n\t\t\t\treturn stateReducerProp?.( baseState, action ) ?? baseState;\n\t\t\t} }\n\t\t\tsize={ size }\n\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\tsuffix={\n\t\t\t\tspinControls === 'custom' ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t\t<Spacer marginBottom={ 0 } marginRight={ 2 }>\n\t\t\t\t\t\t\t<HStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\tclassName={ spinButtonClasses }\n\t\t\t\t\t\t\t\t\ticon={ plusIcon }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Increment' ) }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'up'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\tclassName={ spinButtonClasses }\n\t\t\t\t\t\t\t\t\ticon={ resetIcon }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Decrement' ) }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'down'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\tsuffix\n\t\t\t\t)\n\t\t\t}\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\nexport const NumberControl = forwardRef( UnforwardedNumberControl );\n\nexport default NumberControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GA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AM0F,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAAE,mBAAU,EAAErH,wBAAyB,CAAC;AAAC,IAAAsH,QAAA,GAAAF,OAAA,CAAAnI,OAAA,GAErDkI,aAAa","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* wp:polyfill */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -48,6 +49,7 @@ function NameInput({
|
|
|
48
49
|
label
|
|
49
50
|
}) {
|
|
50
51
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.NameInputControl, {
|
|
52
|
+
size: "compact",
|
|
51
53
|
label: label,
|
|
52
54
|
hideLabelFromVision: true,
|
|
53
55
|
value: value,
|