@wordpress/components 28.13.1-next.082ed6819.0 → 29.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -2
- package/CONTRIBUTING.md +16 -16
- 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/angle-picker-control/index.js +1 -1
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/animation/index.js +0 -6
- package/build/animation/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/border-box-control/border-box-control-split-controls/component.js +1 -1
- package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- 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/component.js +2 -0
- package/build/border-control/border-control/component.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 +35 -28
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/input-control.js +161 -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 +51 -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/circular-option-picker/circular-option-picker-actions.js +1 -0
- package/build/circular-option-picker/circular-option-picker-actions.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker-option.js +1 -0
- package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build/clipboard-button/index.js +5 -3
- package/build/clipboard-button/index.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/utils.js +1 -0
- package/build/color-palette/utils.js.map +1 -1
- package/build/color-picker/input-with-slider.js +2 -2
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/combobox-control/index.js +1 -0
- package/build/combobox-control/index.js.map +1 -1
- package/build/composite/item.js +0 -9
- package/build/composite/item.js.map +1 -1
- package/build/composite/legacy/index.js +1 -0
- package/build/composite/legacy/index.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.js +3 -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 +3 -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/types.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 +11 -2
- package/build/custom-select-control/index.js.map +1 -1
- package/build/custom-select-control/types.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 +1 -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 +1 -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/drop-zone/index.js +19 -13
- package/build/drop-zone/index.js.map +1 -1
- package/build/drop-zone/types.js.map +1 -1
- package/build/dropdown-menu/index.js +2 -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 +10 -14
- 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/font-size-picker/font-size-picker-select.js +2 -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 +2 -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/utils.js +1 -0
- package/build/font-size-picker/utils.js.map +1 -1
- package/build/form-file-upload/index.js +11 -1
- package/build/form-file-upload/index.js.map +1 -1
- package/build/form-file-upload/types.js.map +1 -1
- package/build/form-token-field/index.js +6 -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 +3 -0
- package/build/gradient-picker/index.js.map +1 -1
- package/build/gradient-picker/types.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/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/icon/index.js +9 -0
- package/build/icon/index.js.map +1 -1
- package/build/index.js +0 -6
- package/build/index.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 +5 -9
- package/build/menu/checkbox-item.js.map +1 -1
- package/build/menu/group-label.js +4 -1
- package/build/menu/group-label.js.map +1 -1
- package/build/menu/group.js +4 -1
- package/build/menu/group.js.map +1 -1
- package/build/menu/item-help-text.js +5 -0
- package/build/menu/item-help-text.js.map +1 -1
- package/build/menu/item-label.js +5 -0
- package/build/menu/item-label.js.map +1 -1
- package/build/menu/item.js +4 -8
- package/build/menu/item.js.map +1 -1
- package/build/menu/radio-item.js +5 -9
- package/build/menu/radio-item.js.map +1 -1
- package/build/menu/separator.js +5 -2
- package/build/menu/separator.js.map +1 -1
- package/build/menu/styles.js +16 -16
- package/build/menu/styles.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/modal/aria-helper.js +0 -1
- package/build/modal/aria-helper.js.map +1 -1
- package/build/modal/index.js +0 -1
- package/build/modal/index.js.map +1 -1
- package/build/navigable-container/container.js +1 -0
- package/build/navigable-container/container.js.map +1 -1
- package/build/navigation/group/index.js +1 -0
- package/build/navigation/group/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 +8 -0
- package/build/number-control/index.js.map +1 -1
- package/build/number-control/types.js.map +1 -1
- package/build/palette-edit/index.js +1 -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/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/range-control/index.js +2 -1
- package/build/range-control/index.js.map +1 -1
- package/build/range-control/mark.js +0 -1
- package/build/range-control/mark.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 +33 -45
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/resizable-box/index.js +10 -1
- 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 +1 -0
- package/build/select-control/index.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/fill.js +8 -12
- package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +7 -10
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot.js +4 -10
- package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build/slot-fill/provider.js +1 -0
- package/build/slot-fill/provider.js.map +1 -1
- package/build/slot-fill/slot.js +1 -0
- 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/style-provider/index.js +0 -1
- package/build/style-provider/index.js.map +1 -1
- package/build/tab-panel/index.js +1 -0
- package/build/tab-panel/index.js.map +1 -1
- package/build/tabs/index.js +1 -0
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/tab.js +0 -17
- package/build/tabs/tab.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/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-button/index.js +2 -0
- package/build/toolbar/toolbar-button/index.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/component.js +2 -0
- package/build/tools-panel/tools-panel/component.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/tree-grid/cell.js +4 -1
- package/build/tree-grid/cell.js.map +1 -1
- package/build/tree-grid/index.js +1 -0
- package/build/tree-grid/index.js.map +1 -1
- package/build/tree-grid/types.js.map +1 -1
- package/build/tree-select/index.js +1 -0
- package/build/tree-select/index.js.map +1 -1
- package/build/unit-control/index.js +11 -1
- 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/types.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/angle-picker-control/index.js +1 -1
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/animation/index.js +1 -1
- package/build-module/animation/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/border-box-control/border-box-control-split-controls/component.js +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- 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/component.js +2 -0
- package/build-module/border-control/border-control/component.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 +37 -30
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-control.js +153 -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 +48 -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/circular-option-picker/circular-option-picker-actions.js +1 -0
- package/build-module/circular-option-picker/circular-option-picker-actions.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-option.js +1 -0
- package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build-module/clipboard-button/index.js +5 -3
- package/build-module/clipboard-button/index.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/utils.js +1 -0
- package/build-module/color-palette/utils.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +2 -2
- package/build-module/color-picker/input-with-slider.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/item.js +0 -9
- package/build-module/composite/item.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/custom-gradient-picker/gradient-bar/control-points.js +3 -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 +3 -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/types.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 +11 -2
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/custom-select-control/types.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 +1 -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 +1 -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/drop-zone/index.js +19 -13
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/drop-zone/types.js.map +1 -1
- package/build-module/dropdown-menu/index.js +2 -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 +11 -15
- 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/font-size-picker/font-size-picker-select.js +2 -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 +2 -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/utils.js +1 -0
- package/build-module/font-size-picker/utils.js.map +1 -1
- package/build-module/form-file-upload/index.js +13 -2
- package/build-module/form-file-upload/index.js.map +1 -1
- package/build-module/form-file-upload/types.js.map +1 -1
- package/build-module/form-token-field/index.js +6 -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 +3 -0
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/gradient-picker/types.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/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/icon/index.js +9 -0
- package/build-module/icon/index.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.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 +5 -9
- package/build-module/menu/checkbox-item.js.map +1 -1
- package/build-module/menu/group-label.js +4 -1
- package/build-module/menu/group-label.js.map +1 -1
- package/build-module/menu/group.js +4 -1
- package/build-module/menu/group.js.map +1 -1
- package/build-module/menu/item-help-text.js +6 -1
- package/build-module/menu/item-help-text.js.map +1 -1
- package/build-module/menu/item-label.js +6 -1
- package/build-module/menu/item-label.js.map +1 -1
- package/build-module/menu/item.js +4 -8
- package/build-module/menu/item.js.map +1 -1
- package/build-module/menu/radio-item.js +5 -9
- package/build-module/menu/radio-item.js.map +1 -1
- package/build-module/menu/separator.js +5 -2
- package/build-module/menu/separator.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-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/modal/aria-helper.js +0 -1
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/modal/index.js +0 -1
- package/build-module/modal/index.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/group/index.js +1 -0
- package/build-module/navigation/group/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 +8 -0
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/number-control/types.js.map +1 -1
- package/build-module/palette-edit/index.js +1 -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/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/range-control/index.js +2 -1
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/range-control/mark.js +0 -1
- package/build-module/range-control/mark.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 +33 -45
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/resizable-box/index.js +10 -1
- 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 +1 -0
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/fill.js +9 -13
- package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +7 -10
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot.js +4 -10
- package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build-module/slot-fill/provider.js +1 -0
- package/build-module/slot-fill/provider.js.map +1 -1
- package/build-module/slot-fill/slot.js +1 -0
- 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/style-provider/index.js +0 -1
- package/build-module/style-provider/index.js.map +1 -1
- package/build-module/tab-panel/index.js +1 -0
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/tabs/index.js +1 -0
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/tab.js +0 -15
- package/build-module/tabs/tab.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/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-button/index.js +2 -0
- package/build-module/toolbar/toolbar-button/index.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/component.js +2 -0
- package/build-module/tools-panel/tools-panel/component.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/tree-grid/cell.js +4 -1
- package/build-module/tree-grid/cell.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-grid/types.js.map +1 -1
- package/build-module/tree-select/index.js +1 -0
- package/build-module/tree-select/index.js.map +1 -1
- package/build-module/unit-control/index.js +11 -1
- 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/types.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 +15 -11
- package/build-style/style.css +15 -11
- package/build-types/alignment-matrix-control/styles.d.ts.map +1 -1
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
- package/build-types/animation/index.d.ts +1 -1
- package/build-types/animation/index.d.ts.map +1 -1
- package/build-types/base-control/hooks.d.ts +4 -4
- package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +83 -83
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +93 -93
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +83 -83
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +83 -83
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +83 -83
- package/build-types/border-control/border-control-dropdown/hook.d.ts +83 -83
- package/build-types/border-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/index.d.ts +14 -13
- 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 +852 -816
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/styles/box-control-icon-styles.d.ts.map +1 -1
- package/build-types/box-control/styles/box-control-styles.d.ts +3 -2
- package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
- package/build-types/box-control/types.d.ts +25 -3
- package/build-types/box-control/types.d.ts.map +1 -1
- package/build-types/box-control/utils.d.ts +23 -15
- package/build-types/box-control/utils.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts +18 -0
- 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/card/card/hook.d.ts +83 -83
- package/build-types/card/card-body/hook.d.ts +83 -83
- package/build-types/card/card-divider/hook.d.ts +84 -84
- package/build-types/card/card-footer/hook.d.ts +83 -83
- package/build-types/card/card-header/hook.d.ts +83 -83
- package/build-types/card/card-media/hook.d.ts +83 -83
- package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
- package/build-types/clipboard-button/index.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +3 -2
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/composite/index.d.ts.map +1 -1
- package/build-types/composite/item.d.ts.map +1 -1
- package/build-types/context/constants.d.ts.map +1 -1
- package/build-types/context/get-styled-class-name-from-key.d.ts +1 -9
- package/build-types/context/get-styled-class-name-from-key.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/index.d.ts +1 -1
- package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/types.d.ts +6 -0
- package/build-types/custom-gradient-picker/types.d.ts.map +1 -1
- package/build-types/custom-select-control/index.d.ts.map +1 -1
- package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-select-control/types.d.ts +7 -0
- package/build-types/custom-select-control/types.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts.map +1 -1
- package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
- package/build-types/date-time/stories/date.story.d.ts.map +1 -1
- package/build-types/date-time/stories/time.story.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts +8 -4
- package/build-types/date-time/time/styles.d.ts.map +1 -1
- package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
- package/build-types/drop-zone/index.d.ts +1 -1
- package/build-types/drop-zone/index.d.ts.map +1 -1
- package/build-types/drop-zone/types.d.ts +5 -0
- package/build-types/drop-zone/types.d.ts.map +1 -1
- package/build-types/dropdown-menu/index.d.ts.map +1 -1
- package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +83 -83
- package/build-types/flex/flex/hook.d.ts +83 -83
- package/build-types/flex/flex-block/hook.d.ts +83 -83
- package/build-types/flex/flex-item/hook.d.ts +83 -83
- package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +2 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
- package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
- package/build-types/font-size-picker/index.d.ts.map +1 -1
- package/build-types/font-size-picker/styles.d.ts.map +1 -1
- package/build-types/form-file-upload/index.d.ts +2 -1
- package/build-types/form-file-upload/index.d.ts.map +1 -1
- package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
- package/build-types/form-file-upload/types.d.ts +10 -8
- package/build-types/form-file-upload/types.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
- package/build-types/gradient-picker/index.d.ts +1 -1
- package/build-types/gradient-picker/index.d.ts.map +1 -1
- package/build-types/gradient-picker/types.d.ts +6 -0
- package/build-types/gradient-picker/types.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +83 -83
- package/build-types/h-stack/hook.d.ts +83 -83
- package/build-types/heading/hook.d.ts +82 -82
- package/build-types/higher-order/with-fallback-styles/index.d.ts +2 -2
- package/build-types/higher-order/with-filters/index.d.ts +4 -4
- package/build-types/icon/index.d.ts +23 -7
- package/build-types/icon/index.d.ts.map +1 -1
- package/build-types/icon/stories/index.story.d.ts +7 -1
- package/build-types/icon/stories/index.story.d.ts.map +1 -1
- package/build-types/index.d.ts +1 -1
- package/build-types/index.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +83 -83
- package/build-types/item-group/item-group/hook.d.ts +83 -83
- package/build-types/lock-unlock.d.ts +2 -2
- package/build-types/menu/checkbox-item.d.ts.map +1 -1
- package/build-types/menu/group-label.d.ts.map +1 -1
- package/build-types/menu/group.d.ts.map +1 -1
- package/build-types/menu/index.d.ts.map +1 -1
- package/build-types/menu/item-help-text.d.ts.map +1 -1
- package/build-types/menu/item-label.d.ts.map +1 -1
- package/build-types/menu/item.d.ts.map +1 -1
- package/build-types/menu/radio-item.d.ts.map +1 -1
- package/build-types/menu/separator.d.ts.map +1 -1
- package/build-types/menu/styles.d.ts.map +1 -1
- package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +92 -92
- package/build-types/navigator/navigator-button/hook.d.ts +92 -92
- package/build-types/number-control/index.d.ts +2 -1
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/stories/index.story.d.ts +2 -1
- package/build-types/number-control/stories/index.story.d.ts.map +1 -1
- package/build-types/number-control/types.d.ts +7 -0
- package/build-types/number-control/types.d.ts.map +1 -1
- package/build-types/popover/stories/index.story.d.ts.map +1 -1
- package/build-types/progress-bar/styles.d.ts.map +1 -1
- package/build-types/range-control/index.d.ts +1 -1
- package/build-types/range-control/index.d.ts.map +1 -1
- package/build-types/range-control/mark.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +4 -3
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/resizable-box/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
- package/build-types/scrollable/hook.d.ts +83 -83
- package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts +1 -1
- package/build-types/slot-fill/types.d.ts +4 -3
- package/build-types/slot-fill/types.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +83 -83
- package/build-types/spinner/styles.d.ts.map +1 -1
- package/build-types/surface/hook.d.ts +83 -83
- package/build-types/tabs/tab.d.ts +3 -0
- package/build-types/tabs/tab.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +83 -83
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
- package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/component.d.ts +2 -0
- package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +83 -83
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +83 -83
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +83 -83
- package/build-types/tree-grid/cell.d.ts.map +1 -1
- package/build-types/tree-grid/types.d.ts +1 -1
- package/build-types/tree-grid/types.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +83 -83
- package/build-types/unit-control/index.d.ts +3 -2
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +2 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/unit-control/types.d.ts +7 -0
- package/build-types/unit-control/types.d.ts.map +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/utils/hooks/use-controlled-state.d.ts +1 -1
- package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
- package/build-types/utils/rtl.d.ts +1 -1
- package/build-types/utils/rtl.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +83 -83
- package/build-types/z-stack/styles.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/alignment-matrix-control/stories/index.story.tsx +2 -2
- package/src/angle-picker-control/index.tsx +1 -1
- package/src/angle-picker-control/stories/index.story.tsx +2 -2
- package/src/animation/index.tsx +0 -1
- package/src/base-control/stories/index.story.tsx +1 -1
- package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -1
- package/src/border-box-control/stories/index.story.tsx +1 -1
- package/src/border-control/border-control/component.tsx +2 -0
- package/src/border-control/stories/index.story.tsx +1 -1
- package/src/box-control/README.md +80 -60
- package/src/box-control/docs-manifest.json +5 -0
- package/src/box-control/index.tsx +47 -29
- package/src/box-control/input-control.tsx +197 -0
- package/src/box-control/stories/index.story.tsx +2 -1
- package/src/box-control/test/index.tsx +33 -26
- package/src/box-control/types.ts +80 -55
- package/src/box-control/utils.ts +62 -60
- package/src/button/README.md +108 -219
- 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/types.ts +6 -4
- package/src/button-group/stories/index.story.tsx +1 -1
- package/src/card/stories/index.story.tsx +2 -2
- package/src/checkbox-control/stories/index.story.tsx +1 -1
- package/src/circular-option-picker/circular-option-picker-actions.tsx +1 -0
- package/src/circular-option-picker/circular-option-picker-option.tsx +1 -0
- package/src/circular-option-picker/stories/index.story.tsx +2 -2
- package/src/circular-option-picker/style.scss +2 -2
- package/src/clipboard-button/index.tsx +5 -3
- package/src/color-palette/stories/index.story.tsx +3 -3
- package/src/color-picker/input-with-slider.tsx +1 -1
- package/src/color-picker/stories/index.story.tsx +2 -2
- package/src/combobox-control/stories/index.story.tsx +1 -1
- package/src/composite/item.tsx +1 -19
- package/src/composite/stories/index.story.tsx +3 -3
- package/src/confirm-dialog/stories/index.story.tsx +1 -1
- package/src/custom-gradient-picker/gradient-bar/control-points.tsx +2 -0
- package/src/custom-gradient-picker/index.tsx +2 -0
- package/src/custom-gradient-picker/style.scss +1 -1
- package/src/custom-gradient-picker/types.ts +6 -0
- package/src/custom-select-control/README.md +2 -0
- package/src/custom-select-control/index.tsx +11 -2
- package/src/custom-select-control/stories/index.story.tsx +3 -2
- package/src/custom-select-control/test/index.tsx +13 -9
- package/src/custom-select-control/types.ts +7 -0
- package/src/custom-select-control-v2/stories/index.story.tsx +2 -2
- package/src/date-time/stories/date-time.story.tsx +4 -1
- package/src/date-time/stories/date.story.tsx +4 -1
- package/src/date-time/stories/time.story.tsx +4 -1
- package/src/dimension-control/stories/index.story.tsx +1 -1
- package/src/disabled/stories/index.story.tsx +3 -3
- package/src/divider/stories/index.story.tsx +1 -1
- package/src/draggable/stories/index.story.tsx +2 -2
- package/src/drop-zone/index.tsx +21 -24
- package/src/drop-zone/types.ts +5 -0
- package/src/dropdown/stories/index.story.tsx +7 -7
- package/src/dropdown-menu/index.tsx +4 -1
- package/src/dropdown-menu/stories/index.story.tsx +3 -3
- package/src/dropdown-menu/style.scss +1 -1
- package/src/duotone-picker/color-list-picker/index.tsx +8 -8
- package/src/duotone-picker/color-list-picker/style.scss +0 -6
- package/src/duotone-picker/stories/duotone-picker.story.tsx +1 -1
- package/src/flex/stories/index.story.tsx +1 -1
- package/src/font-size-picker/font-size-picker-select.tsx +1 -0
- package/src/font-size-picker/index.tsx +1 -0
- package/src/font-size-picker/stories/index.story.tsx +1 -1
- package/src/form-file-upload/README.md +58 -48
- package/src/form-file-upload/docs-manifest.json +5 -0
- package/src/form-file-upload/index.tsx +12 -1
- package/src/form-file-upload/stories/index.story.tsx +4 -3
- package/src/form-file-upload/test/index.tsx +5 -1
- package/src/form-file-upload/types.ts +10 -8
- package/src/form-token-field/README.md +1 -0
- package/src/form-token-field/index.tsx +7 -0
- package/src/form-token-field/stories/index.story.tsx +4 -2
- package/src/form-token-field/test/index.tsx +5 -1
- package/src/gradient-picker/README.md +8 -0
- package/src/gradient-picker/index.tsx +2 -0
- package/src/gradient-picker/stories/index.story.tsx +1 -1
- package/src/gradient-picker/types.ts +6 -0
- package/src/grid/stories/index.story.tsx +1 -1
- package/src/h-stack/stories/index.story.tsx +2 -2
- package/src/icon/README.md +22 -65
- package/src/icon/docs-manifest.json +5 -0
- package/src/icon/index.tsx +28 -13
- package/src/icon/stories/index.story.tsx +50 -8
- package/src/index.ts +1 -5
- package/src/input-control/stories/index.story.tsx +4 -4
- package/src/item-group/stories/index.story.tsx +2 -2
- package/src/menu/checkbox-item.tsx +9 -7
- package/src/menu/group-label.tsx +8 -1
- package/src/menu/group.tsx +8 -1
- package/src/menu/item-help-text.tsx +10 -1
- package/src/menu/item-label.tsx +10 -1
- package/src/menu/item.tsx +8 -6
- package/src/menu/radio-item.tsx +9 -7
- package/src/menu/separator.tsx +9 -2
- package/src/menu/stories/index.story.tsx +2 -2
- package/src/menu/styles.ts +1 -1
- package/src/menu-group/stories/index.story.tsx +1 -1
- package/src/menu-item/stories/index.story.tsx +1 -1
- package/src/menu-items-choice/stories/index.story.tsx +1 -1
- package/src/menu-items-choice/style.scss +1 -0
- package/src/modal/stories/index.story.tsx +2 -2
- package/src/modal/test/index.tsx +2 -1
- package/src/navigable-container/stories/navigable-menu.story.tsx +1 -1
- package/src/navigable-container/stories/tabbable-container.story.tsx +1 -1
- package/src/navigation/stories/index.story.tsx +4 -4
- package/src/navigation/styles/navigation-styles.tsx +3 -2
- package/src/navigator/stories/index.story.tsx +3 -3
- package/src/number-control/README.md +2 -1
- package/src/number-control/index.tsx +9 -0
- package/src/number-control/stories/index.story.tsx +2 -1
- package/src/number-control/test/index.tsx +5 -1
- package/src/number-control/types.ts +7 -0
- package/src/panel/stories/index.story.tsx +1 -1
- package/src/placeholder/stories/index.story.tsx +3 -3
- package/src/popover/stories/index.story.tsx +11 -9
- package/src/query-controls/stories/index.story.tsx +6 -6
- package/src/radio-control/stories/index.story.tsx +1 -1
- package/src/radio-group/stories/index.story.tsx +3 -3
- package/src/range-control/index.tsx +1 -0
- package/src/range-control/mark.tsx +0 -1
- package/src/range-control/stories/index.story.tsx +7 -7
- package/src/range-control/styles/range-control-styles.ts +18 -19
- package/src/resizable-box/index.tsx +10 -0
- package/src/resizable-box/stories/index.story.tsx +1 -1
- package/src/resizable-box/style.scss +8 -0
- package/src/responsive-wrapper/stories/index.story.tsx +1 -1
- package/src/sandbox/stories/index.story.tsx +1 -1
- package/src/scrollable/stories/index.story.tsx +2 -1
- package/src/search-control/stories/index.story.tsx +1 -1
- package/src/select-control/stories/index.story.tsx +1 -1
- package/src/slot-fill/bubbles-virtually/fill.tsx +7 -11
- package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +2 -13
- package/src/slot-fill/bubbles-virtually/slot.tsx +4 -7
- package/src/slot-fill/stories/index.story.tsx +2 -2
- package/src/slot-fill/types.ts +4 -3
- package/src/snackbar/stories/index.story.tsx +4 -4
- package/src/snackbar/stories/list.story.tsx +2 -2
- package/src/surface/stories/index.story.tsx +1 -1
- package/src/tabs/tab.tsx +0 -18
- package/src/tabs/test/index.tsx +1492 -947
- package/src/text-control/stories/index.story.tsx +1 -1
- package/src/textarea-control/stories/index.story.tsx +1 -1
- package/src/theme/stories/index.story.tsx +1 -1
- package/src/toggle-control/stories/index.story.tsx +1 -1
- package/src/toggle-group-control/stories/index.story.tsx +1 -1
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +22 -22
- 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/toolbar/stories/index.story.tsx +1 -1
- package/src/toolbar/toolbar-button/index.tsx +2 -0
- package/src/tools-panel/stories/index.story.tsx +15 -3
- package/src/tools-panel/test/index.tsx +0 -17
- package/src/tools-panel/tools-panel/README.md +4 -0
- package/src/tools-panel/tools-panel/component.tsx +2 -0
- package/src/tooltip/stories/index.story.tsx +1 -1
- package/src/tree-grid/cell.tsx +5 -1
- package/src/tree-grid/stories/index.story.tsx +1 -1
- package/src/tree-grid/types.ts +1 -1
- package/src/tree-select/stories/index.story.tsx +1 -1
- package/src/unit-control/README.md +3 -3
- package/src/unit-control/index.tsx +11 -1
- package/src/unit-control/stories/index.story.tsx +5 -4
- package/src/unit-control/test/index.tsx +5 -1
- package/src/unit-control/types.ts +7 -0
- package/src/utils/colors-values.js +3 -0
- package/src/utils/config-values.js +0 -1
- package/src/view/stories/index.story.tsx +1 -1
- package/src/visually-hidden/stories/index.story.tsx +1 -1
- package/src/z-stack/stories/index.story.tsx +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/box-control/all-input-control.js +0 -90
- package/build/box-control/all-input-control.js.map +0 -1
- package/build/box-control/axial-input-controls.js +0 -124
- package/build/box-control/axial-input-controls.js.map +0 -1
- package/build/box-control/input-controls.js +0 -132
- package/build/box-control/input-controls.js.map +0 -1
- package/build/menu/use-temporary-focus-visible-fix.js +0 -27
- package/build/menu/use-temporary-focus-visible-fix.js.map +0 -1
- package/build-module/box-control/all-input-control.js +0 -83
- package/build-module/box-control/all-input-control.js.map +0 -1
- package/build-module/box-control/axial-input-controls.js +0 -115
- package/build-module/box-control/axial-input-controls.js.map +0 -1
- package/build-module/box-control/input-controls.js +0 -123
- package/build-module/box-control/input-controls.js.map +0 -1
- package/build-module/menu/use-temporary-focus-visible-fix.js +0 -20
- package/build-module/menu/use-temporary-focus-visible-fix.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/menu/use-temporary-focus-visible-fix.d.ts +0 -8
- package/build-types/menu/use-temporary-focus-visible-fix.d.ts.map +0 -1
- package/src/box-control/all-input-control.tsx +0 -109
- package/src/box-control/axial-input-controls.tsx +0 -164
- package/src/box-control/input-controls.tsx +0 -166
- package/src/menu/use-temporary-focus-visible-fix.ts +0 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useState","isShallowEqual","observableMap","SlotFillContext","jsx","_jsx","createSlotRegistry","slots","fills","registerSlot","name","ref","fillProps","
|
|
1
|
+
{"version":3,"names":["useState","isShallowEqual","observableMap","SlotFillContext","jsx","_jsx","createSlotRegistry","slots","fills","registerSlot","name","ref","fillProps","set","unregisterSlot","slot","get","delete","updateSlot","registerFill","unregisterFill","fillsForName","filter","fillRef","SlotFillProvider","children","registry","Provider","value"],"sources":["@wordpress/components/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\nimport { observableMap } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './slot-fill-context';\nimport type {\n\tSlotFillProviderProps,\n\tSlotFillBubblesVirtuallyContext,\n} from '../types';\n\nfunction createSlotRegistry(): SlotFillBubblesVirtuallyContext {\n\tconst slots: SlotFillBubblesVirtuallyContext[ 'slots' ] = observableMap();\n\tconst fills: SlotFillBubblesVirtuallyContext[ 'fills' ] = observableMap();\n\n\tconst registerSlot: SlotFillBubblesVirtuallyContext[ 'registerSlot' ] = (\n\t\tname,\n\t\tref,\n\t\tfillProps\n\t) => {\n\t\tslots.set( name, { ref, fillProps } );\n\t};\n\n\tconst unregisterSlot: SlotFillBubblesVirtuallyContext[ 'unregisterSlot' ] =\n\t\t( name, ref ) => {\n\t\t\tconst slot = slots.get( name );\n\t\t\tif ( ! slot ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Make sure we're not unregistering a slot registered by another element\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412\n\t\t\tif ( slot.ref !== ref ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tslots.delete( name );\n\t\t};\n\n\tconst updateSlot: SlotFillBubblesVirtuallyContext[ 'updateSlot' ] = (\n\t\tname,\n\t\tref,\n\t\tfillProps\n\t) => {\n\t\tconst slot = slots.get( name );\n\t\tif ( ! slot ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( slot.ref !== ref ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isShallowEqual( slot.fillProps, fillProps ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tslots.set( name, { ref, fillProps } );\n\t};\n\n\tconst registerFill: SlotFillBubblesVirtuallyContext[ 'registerFill' ] = (\n\t\tname,\n\t\tref\n\t) => {\n\t\tfills.set( name, [ ...( fills.get( name ) || [] ), ref ] );\n\t};\n\n\tconst unregisterFill: SlotFillBubblesVirtuallyContext[ 'unregisterFill' ] =\n\t\t( name, ref ) => {\n\t\t\tconst fillsForName = fills.get( name );\n\t\t\tif ( ! fillsForName ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfills.set(\n\t\t\t\tname,\n\t\t\t\tfillsForName.filter( ( fillRef ) => fillRef !== ref )\n\t\t\t);\n\t\t};\n\n\treturn {\n\t\tslots,\n\t\tfills,\n\t\tregisterSlot,\n\t\tupdateSlot,\n\t\tunregisterSlot,\n\t\tregisterFill,\n\t\tunregisterFill,\n\t};\n}\n\nexport default function SlotFillProvider( {\n\tchildren,\n}: SlotFillProviderProps ) {\n\tconst [ registry ] = useState( createSlotRegistry );\n\treturn (\n\t\t<SlotFillContext.Provider value={ registry }>\n\t\t\t{ children }\n\t\t</SlotFillContext.Provider>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,OAAOC,cAAc,MAAM,6BAA6B;AACxD,SAASC,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;AACA,OAAOC,eAAe,MAAM,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMlD,SAASC,kBAAkBA,CAAA,EAAoC;EAC9D,MAAMC,KAAiD,GAAGL,aAAa,CAAC,CAAC;EACzE,MAAMM,KAAiD,GAAGN,aAAa,CAAC,CAAC;EAEzE,MAAMO,YAA+D,GAAGA,CACvEC,IAAI,EACJC,GAAG,EACHC,SAAS,KACL;IACJL,KAAK,CAACM,GAAG,CAAEH,IAAI,EAAE;MAAEC,GAAG;MAAEC;IAAU,CAAE,CAAC;EACtC,CAAC;EAED,MAAME,cAAmE,GACxEA,CAAEJ,IAAI,EAAEC,GAAG,KAAM;IAChB,MAAMI,IAAI,GAAGR,KAAK,CAACS,GAAG,CAAEN,IAAK,CAAC;IAC9B,IAAK,CAAEK,IAAI,EAAG;MACb;IACD;;IAEA;IACA;IACA,IAAKA,IAAI,CAACJ,GAAG,KAAKA,GAAG,EAAG;MACvB;IACD;IAEAJ,KAAK,CAACU,MAAM,CAAEP,IAAK,CAAC;EACrB,CAAC;EAEF,MAAMQ,UAA2D,GAAGA,CACnER,IAAI,EACJC,GAAG,EACHC,SAAS,KACL;IACJ,MAAMG,IAAI,GAAGR,KAAK,CAACS,GAAG,CAAEN,IAAK,CAAC;IAC9B,IAAK,CAAEK,IAAI,EAAG;MACb;IACD;IAEA,IAAKA,IAAI,CAACJ,GAAG,KAAKA,GAAG,EAAG;MACvB;IACD;IAEA,IAAKV,cAAc,CAAEc,IAAI,CAACH,SAAS,EAAEA,SAAU,CAAC,EAAG;MAClD;IACD;IAEAL,KAAK,CAACM,GAAG,CAAEH,IAAI,EAAE;MAAEC,GAAG;MAAEC;IAAU,CAAE,CAAC;EACtC,CAAC;EAED,MAAMO,YAA+D,GAAGA,CACvET,IAAI,EACJC,GAAG,KACC;IACJH,KAAK,CAACK,GAAG,CAAEH,IAAI,EAAE,CAAE,IAAKF,KAAK,CAACQ,GAAG,CAAEN,IAAK,CAAC,IAAI,EAAE,CAAE,EAAEC,GAAG,CAAG,CAAC;EAC3D,CAAC;EAED,MAAMS,cAAmE,GACxEA,CAAEV,IAAI,EAAEC,GAAG,KAAM;IAChB,MAAMU,YAAY,GAAGb,KAAK,CAACQ,GAAG,CAAEN,IAAK,CAAC;IACtC,IAAK,CAAEW,YAAY,EAAG;MACrB;IACD;IAEAb,KAAK,CAACK,GAAG,CACRH,IAAI,EACJW,YAAY,CAACC,MAAM,CAAIC,OAAO,IAAMA,OAAO,KAAKZ,GAAI,CACrD,CAAC;EACF,CAAC;EAEF,OAAO;IACNJ,KAAK;IACLC,KAAK;IACLC,YAAY;IACZS,UAAU;IACVJ,cAAc;IACdK,YAAY;IACZC;EACD,CAAC;AACF;AAEA,eAAe,SAASI,gBAAgBA,CAAE;EACzCC;AACsB,CAAC,EAAG;EAC1B,MAAM,CAAEC,QAAQ,CAAE,GAAG1B,QAAQ,CAAEM,kBAAmB,CAAC;EACnD,oBACCD,IAAA,CAACF,eAAe,CAACwB,QAAQ;IAACC,KAAK,EAAGF,QAAU;IAAAD,QAAA,EACzCA;EAAQ,CACe,CAAC;AAE7B","ignoreList":[]}
|
|
@@ -24,11 +24,7 @@ function Slot(props, forwardedRef) {
|
|
|
24
24
|
children,
|
|
25
25
|
...restProps
|
|
26
26
|
} = props;
|
|
27
|
-
const
|
|
28
|
-
registerSlot,
|
|
29
|
-
unregisterSlot,
|
|
30
|
-
...registry
|
|
31
|
-
} = useContext(SlotFillContext);
|
|
27
|
+
const registry = useContext(SlotFillContext);
|
|
32
28
|
const ref = useRef(null);
|
|
33
29
|
|
|
34
30
|
// We don't want to unregister and register the slot whenever
|
|
@@ -40,11 +36,9 @@ function Slot(props, forwardedRef) {
|
|
|
40
36
|
fillPropsRef.current = fillProps;
|
|
41
37
|
}, [fillProps]);
|
|
42
38
|
useLayoutEffect(() => {
|
|
43
|
-
registerSlot(name, ref, fillPropsRef.current);
|
|
44
|
-
return () =>
|
|
45
|
-
|
|
46
|
-
};
|
|
47
|
-
}, [registerSlot, unregisterSlot, name]);
|
|
39
|
+
registry.registerSlot(name, ref, fillPropsRef.current);
|
|
40
|
+
return () => registry.unregisterSlot(name, ref);
|
|
41
|
+
}, [registry, name]);
|
|
48
42
|
useLayoutEffect(() => {
|
|
49
43
|
registry.updateSlot(name, ref, fillPropsRef.current);
|
|
50
44
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRef","useLayoutEffect","useContext","forwardRef","useMergeRefs","View","SlotFillContext","jsx","_jsx","Slot","props","forwardedRef","name","fillProps","as","children","restProps","
|
|
1
|
+
{"version":3,"names":["useRef","useLayoutEffect","useContext","forwardRef","useMergeRefs","View","SlotFillContext","jsx","_jsx","Slot","props","forwardedRef","name","fillProps","as","children","restProps","registry","ref","fillPropsRef","current","registerSlot","unregisterSlot","updateSlot"],"sources":["@wordpress/components/src/slot-fill/bubbles-virtually/slot.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tuseContext,\n\tforwardRef,\n} from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { View } from '../../view';\nimport SlotFillContext from './slot-fill-context';\nimport type { WordPressComponentProps } from '../../context';\nimport type { SlotComponentProps } from '../types';\n\nfunction Slot(\n\tprops: WordPressComponentProps<\n\t\tOmit< SlotComponentProps, 'bubblesVirtually' >,\n\t\t'div'\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\tname,\n\t\tfillProps = {},\n\t\tas,\n\t\t// `children` is not allowed. However, if it is passed,\n\t\t// it will be displayed as is, so remove `children`.\n\t\tchildren,\n\t\t...restProps\n\t} = props;\n\n\tconst registry = useContext( SlotFillContext );\n\n\tconst ref = useRef< HTMLElement >( null );\n\n\t// We don't want to unregister and register the slot whenever\n\t// `fillProps` change, which would cause the fill to be re-mounted. Instead,\n\t// we can just update the slot (see hook below).\n\t// For more context, see https://github.com/WordPress/gutenberg/pull/44403#discussion_r994415973\n\tconst fillPropsRef = useRef( fillProps );\n\tuseLayoutEffect( () => {\n\t\tfillPropsRef.current = fillProps;\n\t}, [ fillProps ] );\n\n\tuseLayoutEffect( () => {\n\t\tregistry.registerSlot( name, ref, fillPropsRef.current );\n\t\treturn () => registry.unregisterSlot( name, ref );\n\t}, [ registry, name ] );\n\n\tuseLayoutEffect( () => {\n\t\tregistry.updateSlot( name, ref, fillPropsRef.current );\n\t} );\n\n\treturn (\n\t\t<View\n\t\t\tas={ as }\n\t\t\tref={ useMergeRefs( [ forwardedRef, ref ] ) }\n\t\t\t{ ...restProps }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( Slot );\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SACCA,MAAM,EACNC,eAAe,EACfC,UAAU,EACVC,UAAU,QACJ,oBAAoB;AAC3B,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;AACA,SAASC,IAAI,QAAQ,YAAY;AACjC,OAAOC,eAAe,MAAM,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIlD,SAASC,IAAIA,CACZC,KAGC,EACDC,YAAiC,EAChC;EACD,MAAM;IACLC,IAAI;IACJC,SAAS,GAAG,CAAC,CAAC;IACdC,EAAE;IACF;IACA;IACAC,QAAQ;IACR,GAAGC;EACJ,CAAC,GAAGN,KAAK;EAET,MAAMO,QAAQ,GAAGf,UAAU,CAAEI,eAAgB,CAAC;EAE9C,MAAMY,GAAG,GAAGlB,MAAM,CAAiB,IAAK,CAAC;;EAEzC;EACA;EACA;EACA;EACA,MAAMmB,YAAY,GAAGnB,MAAM,CAAEa,SAAU,CAAC;EACxCZ,eAAe,CAAE,MAAM;IACtBkB,YAAY,CAACC,OAAO,GAAGP,SAAS;EACjC,CAAC,EAAE,CAAEA,SAAS,CAAG,CAAC;EAElBZ,eAAe,CAAE,MAAM;IACtBgB,QAAQ,CAACI,YAAY,CAAET,IAAI,EAAEM,GAAG,EAAEC,YAAY,CAACC,OAAQ,CAAC;IACxD,OAAO,MAAMH,QAAQ,CAACK,cAAc,CAAEV,IAAI,EAAEM,GAAI,CAAC;EAClD,CAAC,EAAE,CAAED,QAAQ,EAAEL,IAAI,CAAG,CAAC;EAEvBX,eAAe,CAAE,MAAM;IACtBgB,QAAQ,CAACM,UAAU,CAAEX,IAAI,EAAEM,GAAG,EAAEC,YAAY,CAACC,OAAQ,CAAC;EACvD,CAAE,CAAC;EAEH,oBACCZ,IAAA,CAACH,IAAI;IACJS,EAAE,EAAGA,EAAI;IACTI,GAAG,EAAGd,YAAY,CAAE,CAAEO,YAAY,EAAEO,GAAG,CAAG,CAAG;IAAA,GACxCF;EAAS,CACd,CAAC;AAEJ;AAEA,eAAeb,UAAU,CAAEM,IAAK,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useState","SlotFillContext","jsx","_jsx","createSlotRegistry","slots","fills","listeners","registerSlot","name","slot","previousSlot","triggerListeners","forceUpdateSlot","rerender","registerFill","instance","unregisterSlot","unregisterFill","_fills$name$filter","filter","fill","getSlot","getFills","slotInstance","forEach","listener","subscribe","push","l","SlotFillProvider","children","contextValue","Provider","value"],"sources":["@wordpress/components/src/slot-fill/provider.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './context';\nimport type {\n\tFillComponentProps,\n\tBaseSlotFillContext,\n\tSlotFillProviderProps,\n\tSlotKey,\n\tRerenderable,\n} from './types';\n\nfunction createSlotRegistry(): BaseSlotFillContext {\n\tconst slots: Record< SlotKey, Rerenderable > = {};\n\tconst fills: Record< SlotKey, FillComponentProps[] > = {};\n\tlet listeners: Array< () => void > = [];\n\n\tfunction registerSlot( name: SlotKey, slot: Rerenderable ) {\n\t\tconst previousSlot = slots[ name ];\n\t\tslots[ name ] = slot;\n\t\ttriggerListeners();\n\n\t\t// Sometimes the fills are registered after the initial render of slot\n\t\t// But before the registerSlot call, we need to rerender the slot.\n\t\tforceUpdateSlot( name );\n\n\t\t// If a new instance of a slot is being mounted while another with the\n\t\t// same name exists, force its update _after_ the new slot has been\n\t\t// assigned into the instance, such that its own rendering of children\n\t\t// will be empty (the new Slot will subsume all fills for this name).\n\t\tif ( previousSlot ) {\n\t\t\tpreviousSlot.rerender();\n\t\t}\n\t}\n\n\tfunction registerFill( name: SlotKey, instance: FillComponentProps ) {\n\t\tfills[ name ] = [ ...( fills[ name ] || [] ), instance ];\n\t\tforceUpdateSlot( name );\n\t}\n\n\tfunction unregisterSlot( name: SlotKey, instance: Rerenderable ) {\n\t\t// If a previous instance of a Slot by this name unmounts, do nothing,\n\t\t// as the slot and its fills should only be removed for the current\n\t\t// known instance.\n\t\tif ( slots[ name ] !== instance ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdelete slots[ name ];\n\t\ttriggerListeners();\n\t}\n\n\tfunction unregisterFill( name: SlotKey, instance: FillComponentProps ) {\n\t\tfills[ name ] =\n\t\t\tfills[ name ]?.filter( ( fill ) => fill !== instance ) ?? [];\n\t\tforceUpdateSlot( name );\n\t}\n\n\tfunction getSlot( name: SlotKey ): Rerenderable | undefined {\n\t\treturn slots[ name ];\n\t}\n\n\tfunction getFills(\n\t\tname: SlotKey,\n\t\tslotInstance: Rerenderable\n\t): FillComponentProps[] {\n\t\t// Fills should only be returned for the current instance of the slot\n\t\t// in which they occupy.\n\t\tif ( slots[ name ] !== slotInstance ) {\n\t\t\treturn [];\n\t\t}\n\t\treturn fills[ name ];\n\t}\n\n\tfunction forceUpdateSlot( name: SlotKey ) {\n\t\tconst slot = getSlot( name );\n\n\t\tif ( slot ) {\n\t\t\tslot.rerender();\n\t\t}\n\t}\n\n\tfunction triggerListeners() {\n\t\tlisteners.forEach( ( listener ) => listener() );\n\t}\n\n\tfunction subscribe( listener: () => void ) {\n\t\tlisteners.push( listener );\n\n\t\treturn () => {\n\t\t\tlisteners = listeners.filter( ( l ) => l !== listener );\n\t\t};\n\t}\n\n\treturn {\n\t\tregisterSlot,\n\t\tunregisterSlot,\n\t\tregisterFill,\n\t\tunregisterFill,\n\t\tgetSlot,\n\t\tgetFills,\n\t\tsubscribe,\n\t};\n}\n\nexport function SlotFillProvider( { children }: SlotFillProviderProps ) {\n\tconst [ contextValue ] = useState( createSlotRegistry );\n\treturn (\n\t\t<SlotFillContext.Provider value={ contextValue }>\n\t\t\t{ children }\n\t\t</SlotFillContext.Provider>\n\t);\n}\n\nexport default SlotFillProvider;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,OAAOC,eAAe,MAAM,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AASxC,SAASC,kBAAkBA,CAAA,EAAwB;EAClD,MAAMC,KAAsC,GAAG,CAAC,CAAC;EACjD,MAAMC,KAA8C,GAAG,CAAC,CAAC;EACzD,IAAIC,SAA8B,GAAG,EAAE;EAEvC,SAASC,YAAYA,CAAEC,IAAa,EAAEC,IAAkB,EAAG;IAC1D,MAAMC,YAAY,GAAGN,KAAK,CAAEI,IAAI,CAAE;IAClCJ,KAAK,CAAEI,IAAI,CAAE,GAAGC,IAAI;IACpBE,gBAAgB,CAAC,CAAC;;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,EAAG;MACXA,IAAI,CAACI,QAAQ,CAAC,CAAC;IAChB;EACD;EAEA,SAASF,gBAAgBA,CAAA,EAAG;IAC3BL,SAAS,CAACkB,OAAO,CAAIC,QAAQ,IAAMA,QAAQ,CAAC,CAAE,CAAC;EAChD;EAEA,SAASC,SAASA,CAAED,QAAoB,EAAG;IAC1CnB,SAAS,CAACqB,IAAI,CAAEF,QAAS,CAAC;IAE1B,OAAO,MAAM;MACZnB,SAAS,GAAGA,SAAS,CAACa,MAAM,CAAIS,CAAC,IAAMA,CAAC,KAAKH,QAAS,CAAC;IACxD,CAAC;EACF;EAEA,OAAO;IACNlB,YAAY;IACZS,cAAc;IACdF,YAAY;IACZG,cAAc;IACdI,OAAO;IACPC,QAAQ;IACRI;EACD,CAAC;AACF;AAEA,OAAO,SAASG,gBAAgBA,CAAE;EAAEC;AAAgC,CAAC,EAAG;EACvE,MAAM,CAAEC,YAAY,CAAE,GAAGhC,QAAQ,CAAEI,kBAAmB,CAAC;EACvD,oBACCD,IAAA,CAACF,eAAe,CAACgC,QAAQ;IAACC,KAAK,EAAGF,YAAc;IAAAD,QAAA,EAC7CA;EAAQ,CACe,CAAC;AAE7B;AAEA,eAAeD,gBAAgB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useState","SlotFillContext","jsx","_jsx","createSlotRegistry","slots","fills","listeners","registerSlot","name","slot","previousSlot","triggerListeners","forceUpdateSlot","rerender","registerFill","instance","unregisterSlot","unregisterFill","_fills$name$filter","filter","fill","getSlot","getFills","slotInstance","forEach","listener","subscribe","push","l","SlotFillProvider","children","contextValue","Provider","value"],"sources":["@wordpress/components/src/slot-fill/provider.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './context';\nimport type {\n\tFillComponentProps,\n\tBaseSlotFillContext,\n\tSlotFillProviderProps,\n\tSlotKey,\n\tRerenderable,\n} from './types';\n\nfunction createSlotRegistry(): BaseSlotFillContext {\n\tconst slots: Record< SlotKey, Rerenderable > = {};\n\tconst fills: Record< SlotKey, FillComponentProps[] > = {};\n\tlet listeners: Array< () => void > = [];\n\n\tfunction registerSlot( name: SlotKey, slot: Rerenderable ) {\n\t\tconst previousSlot = slots[ name ];\n\t\tslots[ name ] = slot;\n\t\ttriggerListeners();\n\n\t\t// Sometimes the fills are registered after the initial render of slot\n\t\t// But before the registerSlot call, we need to rerender the slot.\n\t\tforceUpdateSlot( name );\n\n\t\t// If a new instance of a slot is being mounted while another with the\n\t\t// same name exists, force its update _after_ the new slot has been\n\t\t// assigned into the instance, such that its own rendering of children\n\t\t// will be empty (the new Slot will subsume all fills for this name).\n\t\tif ( previousSlot ) {\n\t\t\tpreviousSlot.rerender();\n\t\t}\n\t}\n\n\tfunction registerFill( name: SlotKey, instance: FillComponentProps ) {\n\t\tfills[ name ] = [ ...( fills[ name ] || [] ), instance ];\n\t\tforceUpdateSlot( name );\n\t}\n\n\tfunction unregisterSlot( name: SlotKey, instance: Rerenderable ) {\n\t\t// If a previous instance of a Slot by this name unmounts, do nothing,\n\t\t// as the slot and its fills should only be removed for the current\n\t\t// known instance.\n\t\tif ( slots[ name ] !== instance ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdelete slots[ name ];\n\t\ttriggerListeners();\n\t}\n\n\tfunction unregisterFill( name: SlotKey, instance: FillComponentProps ) {\n\t\tfills[ name ] =\n\t\t\tfills[ name ]?.filter( ( fill ) => fill !== instance ) ?? [];\n\t\tforceUpdateSlot( name );\n\t}\n\n\tfunction getSlot( name: SlotKey ): Rerenderable | undefined {\n\t\treturn slots[ name ];\n\t}\n\n\tfunction getFills(\n\t\tname: SlotKey,\n\t\tslotInstance: Rerenderable\n\t): FillComponentProps[] {\n\t\t// Fills should only be returned for the current instance of the slot\n\t\t// in which they occupy.\n\t\tif ( slots[ name ] !== slotInstance ) {\n\t\t\treturn [];\n\t\t}\n\t\treturn fills[ name ];\n\t}\n\n\tfunction forceUpdateSlot( name: SlotKey ) {\n\t\tconst slot = getSlot( name );\n\n\t\tif ( slot ) {\n\t\t\tslot.rerender();\n\t\t}\n\t}\n\n\tfunction triggerListeners() {\n\t\tlisteners.forEach( ( listener ) => listener() );\n\t}\n\n\tfunction subscribe( listener: () => void ) {\n\t\tlisteners.push( listener );\n\n\t\treturn () => {\n\t\t\tlisteners = listeners.filter( ( l ) => l !== listener );\n\t\t};\n\t}\n\n\treturn {\n\t\tregisterSlot,\n\t\tunregisterSlot,\n\t\tregisterFill,\n\t\tunregisterFill,\n\t\tgetSlot,\n\t\tgetFills,\n\t\tsubscribe,\n\t};\n}\n\nexport function SlotFillProvider( { children }: SlotFillProviderProps ) {\n\tconst [ contextValue ] = useState( createSlotRegistry );\n\treturn (\n\t\t<SlotFillContext.Provider value={ contextValue }>\n\t\t\t{ children }\n\t\t</SlotFillContext.Provider>\n\t);\n}\n\nexport default SlotFillProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,OAAOC,eAAe,MAAM,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AASxC,SAASC,kBAAkBA,CAAA,EAAwB;EAClD,MAAMC,KAAsC,GAAG,CAAC,CAAC;EACjD,MAAMC,KAA8C,GAAG,CAAC,CAAC;EACzD,IAAIC,SAA8B,GAAG,EAAE;EAEvC,SAASC,YAAYA,CAAEC,IAAa,EAAEC,IAAkB,EAAG;IAC1D,MAAMC,YAAY,GAAGN,KAAK,CAAEI,IAAI,CAAE;IAClCJ,KAAK,CAAEI,IAAI,CAAE,GAAGC,IAAI;IACpBE,gBAAgB,CAAC,CAAC;;IAElB;IACA;IACAC,eAAe,CAAEJ,IAAK,CAAC;;IAEvB;IACA;IACA;IACA;IACA,IAAKE,YAAY,EAAG;MACnBA,YAAY,CAACG,QAAQ,CAAC,CAAC;IACxB;EACD;EAEA,SAASC,YAAYA,CAAEN,IAAa,EAAEO,QAA4B,EAAG;IACpEV,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,EAAG;IAC1CnB,SAAS,CAACqB,IAAI,CAAEF,QAAS,CAAC;IAE1B,OAAO,MAAM;MACZnB,SAAS,GAAGA,SAAS,CAACa,MAAM,CAAIS,CAAC,IAAMA,CAAC,KAAKH,QAAS,CAAC;IACxD,CAAC;EACF;EAEA,OAAO;IACNlB,YAAY;IACZS,cAAc;IACdF,YAAY;IACZG,cAAc;IACdI,OAAO;IACPC,QAAQ;IACRI;EACD,CAAC;AACF;AAEA,OAAO,SAASG,gBAAgBA,CAAE;EAAEC;AAAgC,CAAC,EAAG;EACvE,MAAM,CAAEC,YAAY,CAAE,GAAGhC,QAAQ,CAAEI,kBAAmB,CAAC;EACvD,oBACCD,IAAA,CAACF,eAAe,CAACgC,QAAQ;IAACC,KAAK,EAAGF,YAAc;IAAAD,QAAA,EAC7CA;EAAQ,CACe,CAAC;AAE7B;AAEA,eAAeD,gBAAgB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useContext","useEffect","useReducer","useRef","Children","cloneElement","isEmptyElement","SlotFillContext","Fragment","_Fragment","jsx","_jsx","isFunction","maybeFunc","Slot","props","_registry$getFills","registry","rerender","ref","name","children","fillProps","refValue","current","registerSlot","unregisterSlot","fills","getFills","map","fill","fillChildren","child","childIndex","childKey","key","filter","element"],"sources":["@wordpress/components/src/slot-fill/slot.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactElement, ReactNode, Key } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseContext,\n\tuseEffect,\n\tuseReducer,\n\tuseRef,\n\tChildren,\n\tcloneElement,\n\tisEmptyElement,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './context';\nimport type { SlotComponentProps } from './types';\n\n/**\n * Whether the argument is a function.\n *\n * @param maybeFunc The argument to check.\n * @return True if the argument is a function, false otherwise.\n */\nfunction isFunction( maybeFunc: any ): maybeFunc is Function {\n\treturn typeof maybeFunc === 'function';\n}\n\nfunction Slot( props: Omit< SlotComponentProps, 'bubblesVirtually' > ) {\n\tconst registry = useContext( SlotFillContext );\n\tconst [ , rerender ] = useReducer( () => [], [] );\n\tconst ref = useRef( { rerender } );\n\n\tconst { name, children, fillProps = {} } = props;\n\n\tuseEffect( () => {\n\t\tconst refValue = ref.current;\n\t\tregistry.registerSlot( name, refValue );\n\t\treturn () => registry.unregisterSlot( name, refValue );\n\t}, [ registry, name ] );\n\n\tconst fills: ReactNode[] = ( registry.getFills( name, ref.current ) ?? [] )\n\t\t.map( ( fill ) => {\n\t\t\tconst fillChildren = isFunction( fill.children )\n\t\t\t\t? fill.children( fillProps )\n\t\t\t\t: fill.children;\n\t\t\treturn Children.map( fillChildren, ( child, childIndex ) => {\n\t\t\t\tif ( ! child || typeof child === 'string' ) {\n\t\t\t\t\treturn child;\n\t\t\t\t}\n\t\t\t\tlet childKey: Key = childIndex;\n\t\t\t\tif (\n\t\t\t\t\ttypeof child === 'object' &&\n\t\t\t\t\t'key' in child &&\n\t\t\t\t\tchild?.key\n\t\t\t\t) {\n\t\t\t\t\tchildKey = child.key;\n\t\t\t\t}\n\n\t\t\t\treturn cloneElement( child as ReactElement, {\n\t\t\t\t\tkey: childKey,\n\t\t\t\t} );\n\t\t\t} );\n\t\t} )\n\t\t.filter(\n\t\t\t// In some cases fills are rendered only when some conditions apply.\n\t\t\t// This ensures that we only use non-empty fills when rendering, i.e.,\n\t\t\t// it allows us to render wrappers only when the fills are actually present.\n\t\t\t( element ) => ! isEmptyElement( element )\n\t\t);\n\n\treturn <>{ isFunction( children ) ? children( fills ) : fills }</>;\n}\n\nexport default Slot;\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SACCA,UAAU,EACVC,SAAS,EACTC,UAAU,EACVC,MAAM,EACNC,QAAQ,EACRC,YAAY,EACZC,cAAc,QACR,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,eAAe,MAAM,WAAW;AAAC,SAAAC,QAAA,IAAAC,SA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AAQ,EAAG;QAC3C,OAAOA,KAAK;MACb;MACA,IAAIE,QAAa,GAAGD,UAAU;MAC9B,IACC,OAAOD,KAAK,KAAK,QAAQ,IACzB,KAAK,IAAIA,KAAK,IACdA,KAAK,EAAEG,GAAG,EACT;QACDD,QAAQ,GAAGF,KAAK,CAACG,GAAG;MACrB;MAEA,OAAO9B,YAAY,CAAE2B,KAAK,EAAkB;QAC3CG,GAAG,EAAED;MACN,CAAE,CAAC;IACJ,CAAE,CAAC;EACJ,CAAE,CAAC,CACFE,MAAM;EACN;EACA;EACA;EACEC,OAAO,IAAM,CAAE/B,cAAc,CAAE+B,OAAQ,CAC1C,CAAC;EAEF,oBAAO1B,IAAA,CAAAF,SAAA;IAAAY,QAAA,EAAIT,UAAU,CAAES,QAAS,CAAC,GAAGA,QAAQ,CAAEM,KAAM,CAAC,GAAGA;EAAK,CAAI,CAAC;AACnE;AAEA,eAAeb,IAAI","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useContext","useEffect","useReducer","useRef","Children","cloneElement","isEmptyElement","SlotFillContext","Fragment","_Fragment","jsx","_jsx","isFunction","maybeFunc","Slot","props","_registry$getFills","registry","rerender","ref","name","children","fillProps","refValue","current","registerSlot","unregisterSlot","fills","getFills","map","fill","fillChildren","child","childIndex","childKey","key","filter","element"],"sources":["@wordpress/components/src/slot-fill/slot.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactElement, ReactNode, Key } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseContext,\n\tuseEffect,\n\tuseReducer,\n\tuseRef,\n\tChildren,\n\tcloneElement,\n\tisEmptyElement,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './context';\nimport type { SlotComponentProps } from './types';\n\n/**\n * Whether the argument is a function.\n *\n * @param maybeFunc The argument to check.\n * @return True if the argument is a function, false otherwise.\n */\nfunction isFunction( maybeFunc: any ): maybeFunc is Function {\n\treturn typeof maybeFunc === 'function';\n}\n\nfunction Slot( props: Omit< SlotComponentProps, 'bubblesVirtually' > ) {\n\tconst registry = useContext( SlotFillContext );\n\tconst [ , rerender ] = useReducer( () => [], [] );\n\tconst ref = useRef( { rerender } );\n\n\tconst { name, children, fillProps = {} } = props;\n\n\tuseEffect( () => {\n\t\tconst refValue = ref.current;\n\t\tregistry.registerSlot( name, refValue );\n\t\treturn () => registry.unregisterSlot( name, refValue );\n\t}, [ registry, name ] );\n\n\tconst fills: ReactNode[] = ( registry.getFills( name, ref.current ) ?? [] )\n\t\t.map( ( fill ) => {\n\t\t\tconst fillChildren = isFunction( fill.children )\n\t\t\t\t? fill.children( fillProps )\n\t\t\t\t: fill.children;\n\t\t\treturn Children.map( fillChildren, ( child, childIndex ) => {\n\t\t\t\tif ( ! child || typeof child === 'string' ) {\n\t\t\t\t\treturn child;\n\t\t\t\t}\n\t\t\t\tlet childKey: Key = childIndex;\n\t\t\t\tif (\n\t\t\t\t\ttypeof child === 'object' &&\n\t\t\t\t\t'key' in child &&\n\t\t\t\t\tchild?.key\n\t\t\t\t) {\n\t\t\t\t\tchildKey = child.key;\n\t\t\t\t}\n\n\t\t\t\treturn cloneElement( child as ReactElement, {\n\t\t\t\t\tkey: childKey,\n\t\t\t\t} );\n\t\t\t} );\n\t\t} )\n\t\t.filter(\n\t\t\t// In some cases fills are rendered only when some conditions apply.\n\t\t\t// This ensures that we only use non-empty fills when rendering, i.e.,\n\t\t\t// it allows us to render wrappers only when the fills are actually present.\n\t\t\t( element ) => ! isEmptyElement( element )\n\t\t);\n\n\treturn <>{ isFunction( children ) ? children( fills ) : fills }</>;\n}\n\nexport default Slot;\n"],"mappings":";AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SACCA,UAAU,EACVC,SAAS,EACTC,UAAU,EACVC,MAAM,EACNC,QAAQ,EACRC,YAAY,EACZC,cAAc,QACR,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,eAAe,MAAM,WAAW;AAAC,SAAAC,QAAA,IAAAC,SA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AAQ,EAAG;QAC3C,OAAOA,KAAK;MACb;MACA,IAAIE,QAAa,GAAGD,UAAU;MAC9B,IACC,OAAOD,KAAK,KAAK,QAAQ,IACzB,KAAK,IAAIA,KAAK,IACdA,KAAK,EAAEG,GAAG,EACT;QACDD,QAAQ,GAAGF,KAAK,CAACG,GAAG;MACrB;MAEA,OAAO9B,YAAY,CAAE2B,KAAK,EAAkB;QAC3CG,GAAG,EAAED;MACN,CAAE,CAAC;IACJ,CAAE,CAAC;EACJ,CAAE,CAAC,CACFE,MAAM;EACN;EACA;EACA;EACEC,OAAO,IAAM,CAAE/B,cAAc,CAAE+B,OAAQ,CAC1C,CAAC;EAEF,oBAAO1B,IAAA,CAAAF,SAAA;IAAAY,QAAA,EAAIT,UAAU,CAAES,QAAS,CAAC,GAAGA,QAAQ,CAAEM,KAAM,CAAC,GAAGA;EAAK,CAAI,CAAC;AACnE;AAEA,eAAeb,IAAI","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/components/src/slot-fill/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode, RefObject } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport type { ObservableMap } from '@wordpress/compose';\n\nexport type DistributiveOmit< T, K extends keyof any > = T extends any\n\t? Omit< T, K >\n\t: never;\n\nexport type SlotKey = string | symbol;\n\nexport type FillProps = Record< string, any >;\n\ntype SlotPropBase = {\n\t/**\n\t * Slot name.\n\t */\n\tname: SlotKey;\n\n\t/**\n\t * props to pass from `Slot` to `Fill`.\n\t *\n\t * @default {}\n\t */\n\tfillProps?: FillProps;\n};\n\nexport type SlotComponentProps =\n\t| ( SlotPropBase & {\n\t\t\t/**\n\t\t\t * By default, events will bubble to their parents on the DOM hierarchy (native event bubbling).\n\t\t\t * If set to true, events will bubble to their virtual parent in the React elements hierarchy instead,\n\t\t\t * also accept an optional `className`, `id`, etc. to add to the slot container.\n\t\t\t */\n\t\t\tbubblesVirtually: true;\n\n\t\t\t/**\n\t\t\t * A function that returns nodes to be rendered.\n\t\t\t * Supported only when `bubblesVirtually` is `false`.\n\t\t\t */\n\t\t\tchildren?: never;\n\n\t\t\t/**\n\t\t\t * Additional className for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tclassName?: string;\n\n\t\t\t/**\n\t\t\t * Additional styles for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tstyle?: React.CSSProperties;\n\t } )\n\t| ( SlotPropBase & {\n\t\t\t/**\n\t\t\t * By default, events will bubble to their parents on the DOM hierarchy (native event bubbling).\n\t\t\t * If set to true, events will bubble to their virtual parent in the React elements hierarchy instead,\n\t\t\t * also accept an optional `className`, `id`, etc. to add to the slot container.\n\t\t\t */\n\t\t\tbubblesVirtually?: false;\n\n\t\t\t/**\n\t\t\t * A function that returns nodes to be rendered.\n\t\t\t * Supported only when `bubblesVirtually` is `false`.\n\t\t\t */\n\t\t\tchildren?: ( fills: ReactNode ) => ReactNode;\n\n\t\t\t/**\n\t\t\t * Additional className for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tclassName?: never;\n\n\t\t\t/**\n\t\t\t * Additional styles for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tstyle?: never;\n\t } );\n\nexport type FillComponentProps = {\n\t/**\n\t * The name of the slot to fill into.\n\t */\n\tname: SlotKey;\n\n\t/**\n\t * Children elements or render function.\n\t */\n\tchildren?: ReactNode | ( ( fillProps: FillProps ) => ReactNode );\n};\n\nexport type SlotFillProviderProps = {\n\t/**\n\t * The children elements.\n\t */\n\tchildren: ReactNode;\n\n\t/**\n\t * Whether to pass slots to the parent provider if existent.\n\t */\n\tpassthrough?: boolean;\n};\n\nexport type SlotRef = RefObject< HTMLElement >;\nexport type Rerenderable = { rerender: () => void };\n\nexport type SlotFillBubblesVirtuallyContext = {\n\tslots: ObservableMap< SlotKey, { ref: SlotRef; fillProps: FillProps } >;\n\tfills: ObservableMap< SlotKey,
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/slot-fill/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode, RefObject } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport type { ObservableMap } from '@wordpress/compose';\n\nexport type DistributiveOmit< T, K extends keyof any > = T extends any\n\t? Omit< T, K >\n\t: never;\n\nexport type SlotKey = string | symbol;\n\nexport type FillProps = Record< string, any >;\n\ntype SlotPropBase = {\n\t/**\n\t * Slot name.\n\t */\n\tname: SlotKey;\n\n\t/**\n\t * props to pass from `Slot` to `Fill`.\n\t *\n\t * @default {}\n\t */\n\tfillProps?: FillProps;\n};\n\nexport type SlotComponentProps =\n\t| ( SlotPropBase & {\n\t\t\t/**\n\t\t\t * By default, events will bubble to their parents on the DOM hierarchy (native event bubbling).\n\t\t\t * If set to true, events will bubble to their virtual parent in the React elements hierarchy instead,\n\t\t\t * also accept an optional `className`, `id`, etc. to add to the slot container.\n\t\t\t */\n\t\t\tbubblesVirtually: true;\n\n\t\t\t/**\n\t\t\t * A function that returns nodes to be rendered.\n\t\t\t * Supported only when `bubblesVirtually` is `false`.\n\t\t\t */\n\t\t\tchildren?: never;\n\n\t\t\t/**\n\t\t\t * Additional className for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tclassName?: string;\n\n\t\t\t/**\n\t\t\t * Additional styles for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tstyle?: React.CSSProperties;\n\t } )\n\t| ( SlotPropBase & {\n\t\t\t/**\n\t\t\t * By default, events will bubble to their parents on the DOM hierarchy (native event bubbling).\n\t\t\t * If set to true, events will bubble to their virtual parent in the React elements hierarchy instead,\n\t\t\t * also accept an optional `className`, `id`, etc. to add to the slot container.\n\t\t\t */\n\t\t\tbubblesVirtually?: false;\n\n\t\t\t/**\n\t\t\t * A function that returns nodes to be rendered.\n\t\t\t * Supported only when `bubblesVirtually` is `false`.\n\t\t\t */\n\t\t\tchildren?: ( fills: ReactNode ) => ReactNode;\n\n\t\t\t/**\n\t\t\t * Additional className for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tclassName?: never;\n\n\t\t\t/**\n\t\t\t * Additional styles for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tstyle?: never;\n\t } );\n\nexport type FillComponentProps = {\n\t/**\n\t * The name of the slot to fill into.\n\t */\n\tname: SlotKey;\n\n\t/**\n\t * Children elements or render function.\n\t */\n\tchildren?: ReactNode | ( ( fillProps: FillProps ) => ReactNode );\n};\n\nexport type SlotFillProviderProps = {\n\t/**\n\t * The children elements.\n\t */\n\tchildren: ReactNode;\n\n\t/**\n\t * Whether to pass slots to the parent provider if existent.\n\t */\n\tpassthrough?: boolean;\n};\n\nexport type SlotRef = RefObject< HTMLElement >;\nexport type Rerenderable = { rerender: () => void };\nexport type FillInstance = {};\n\nexport type SlotFillBubblesVirtuallyContext = {\n\tslots: ObservableMap< SlotKey, { ref: SlotRef; fillProps: FillProps } >;\n\tfills: ObservableMap< SlotKey, FillInstance[] >;\n\tregisterSlot: ( name: SlotKey, ref: SlotRef, fillProps: FillProps ) => void;\n\tunregisterSlot: ( name: SlotKey, ref: SlotRef ) => void;\n\tupdateSlot: ( name: SlotKey, ref: SlotRef, fillProps: FillProps ) => void;\n\tregisterFill: ( name: SlotKey, instance: FillInstance ) => void;\n\tunregisterFill: ( name: SlotKey, instance: FillInstance ) => void;\n\n\t/**\n\t * This helps the provider know if it's using the default context value or not.\n\t */\n\tisDefault?: boolean;\n};\n\nexport type BaseSlotFillContext = {\n\tregisterSlot: ( name: SlotKey, slot: Rerenderable ) => void;\n\tunregisterSlot: ( name: SlotKey, slot: Rerenderable ) => void;\n\tregisterFill: ( name: SlotKey, instance: FillComponentProps ) => void;\n\tunregisterFill: ( name: SlotKey, instance: FillComponentProps ) => void;\n\tgetSlot: ( name: SlotKey ) => Rerenderable | undefined;\n\tgetFills: (\n\t\tname: SlotKey,\n\t\tslotInstance: Rerenderable\n\t) => FillComponentProps[];\n\tsubscribe: ( listener: () => void ) => () => void;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","speak","useEffect","useLayoutEffect","useRef","forwardRef","renderToString","__","warning","Button","jsx","_jsx","jsxs","_jsxs","NOTICE_TIMEOUT","useSpokenMessage","message","politeness","spokenMessage","UnforwardedSnackbar","className","children","actions","onRemove","icon","explicitDismiss","onDismiss","listRef","ref","dismissMe","event","preventDefault","current","focus","onActionClick","onClick","stopPropagation","callbacksRef","timeoutHandle","setTimeout","clearTimeout","classes","length","globalThis","SCRIPT_DEBUG","snackbarContentClassnames","undefined","tabIndex","role","onKeyPress","map","label","url","index","__next40pxDefaultSize","href","variant","Snackbar"],"sources":["@wordpress/components/src/snackbar/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport {\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tforwardRef,\n\trenderToString,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { SnackbarProps } from './types';\nimport type { NoticeAction } from '../notice/types';\nimport type { WordPressComponentProps } from '../context';\n\nconst NOTICE_TIMEOUT = 10000;\n\n/**\n * Custom hook which announces the message with the given politeness, if a\n * valid message is provided.\n *\n * @param message Message to announce.\n * @param politeness Politeness to announce.\n */\nfunction useSpokenMessage(\n\tmessage: SnackbarProps[ 'spokenMessage' ],\n\tpoliteness: NonNullable< SnackbarProps[ '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 UnforwardedSnackbar(\n\t{\n\t\tclassName,\n\t\tchildren,\n\t\tspokenMessage = children,\n\t\tpoliteness = 'polite',\n\t\tactions = [],\n\t\tonRemove,\n\t\ticon = null,\n\t\texplicitDismiss = false,\n\t\t// onDismiss is a callback executed when the snackbar is dismissed.\n\t\t// It is distinct from onRemove, which _looks_ like a callback but is\n\t\t// actually the function to call to remove the snackbar from the UI.\n\t\tonDismiss,\n\t\tlistRef,\n\t}: WordPressComponentProps< SnackbarProps, 'div' >,\n\tref: ForwardedRef< any >\n) {\n\tfunction dismissMe( event: KeyboardEvent | MouseEvent ) {\n\t\tif ( event && event.preventDefault ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t// Prevent focus loss by moving it to the list element.\n\t\tlistRef?.current?.focus();\n\n\t\tonDismiss?.();\n\t\tonRemove?.();\n\t}\n\n\tfunction onActionClick(\n\t\tevent: MouseEvent< HTMLButtonElement >,\n\t\tonClick: NoticeAction[ 'onClick' ]\n\t) {\n\t\tevent.stopPropagation();\n\n\t\tonRemove?.();\n\n\t\tif ( onClick ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\tuseSpokenMessage( spokenMessage, politeness );\n\n\t// The `onDismiss/onRemove` can have unstable references,\n\t// trigger side-effect cleanup, and reset timers.\n\tconst callbacksRef = useRef( { onDismiss, onRemove } );\n\tuseLayoutEffect( () => {\n\t\tcallbacksRef.current = { onDismiss, onRemove };\n\t} );\n\n\tuseEffect( () => {\n\t\t// Only set up the timeout dismiss if we're not explicitly dismissing.\n\t\tconst timeoutHandle = setTimeout( () => {\n\t\t\tif ( ! explicitDismiss ) {\n\t\t\t\tcallbacksRef.current.onDismiss?.();\n\t\t\t\tcallbacksRef.current.onRemove?.();\n\t\t\t}\n\t\t}, NOTICE_TIMEOUT );\n\n\t\treturn () => clearTimeout( timeoutHandle );\n\t}, [ explicitDismiss ] );\n\n\tconst classes = clsx( className, 'components-snackbar', {\n\t\t'components-snackbar-explicit-dismiss': !! explicitDismiss,\n\t} );\n\tif ( actions && actions.length > 1 ) {\n\t\t// We need to inform developers that snackbar only accepts 1 action.\n\t\twarning(\n\t\t\t'Snackbar can only have one action. Use Notice if your message requires many actions.'\n\t\t);\n\t\t// return first element only while keeping it inside an array\n\t\tactions = [ actions[ 0 ] ];\n\t}\n\n\tconst snackbarContentClassnames = clsx( 'components-snackbar__content', {\n\t\t'components-snackbar__content-with-icon': !! icon,\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName={ classes }\n\t\t\tonClick={ ! explicitDismiss ? dismissMe : undefined }\n\t\t\ttabIndex={ 0 }\n\t\t\trole={ ! explicitDismiss ? 'button' : undefined }\n\t\t\tonKeyPress={ ! explicitDismiss ? dismissMe : undefined }\n\t\t\taria-label={\n\t\t\t\t! explicitDismiss ? __( 'Dismiss this notice' ) : undefined\n\t\t\t}\n\t\t\tdata-testid=\"snackbar\"\n\t\t>\n\t\t\t<div className={ snackbarContentClassnames }>\n\t\t\t\t{ icon && (\n\t\t\t\t\t<div className=\"components-snackbar__icon\">{ icon }</div>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t\t{ actions.map( ( { label, onClick, url }, index ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\thref={ url }\n\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\tonClick={ (\n\t\t\t\t\t\t\t\tevent: MouseEvent< HTMLButtonElement >\n\t\t\t\t\t\t\t) => onActionClick( event, onClick ) }\n\t\t\t\t\t\t\tclassName=\"components-snackbar__action\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t\t{ explicitDismiss && (\n\t\t\t\t\t<span\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\taria-label={ __( 'Dismiss this notice' ) }\n\t\t\t\t\t\ttabIndex={ 0 }\n\t\t\t\t\t\tclassName=\"components-snackbar__dismiss-button\"\n\t\t\t\t\t\tonClick={ dismissMe }\n\t\t\t\t\t\tonKeyPress={ dismissMe }\n\t\t\t\t\t>\n\t\t\t\t\t\t✕\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n/**\n * A Snackbar displays a succinct message that is cleared out after a small delay.\n *\n * It can also offer the user options, like viewing a published post.\n * But these options should also be available elsewhere in the UI.\n *\n * ```jsx\n * const MySnackbarNotice = () => (\n * <Snackbar>Post published successfully.</Snackbar>\n * );\n * ```\n */\nexport const Snackbar = forwardRef( UnforwardedSnackbar );\n\nexport default Snackbar;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SACCC,SAAS,EACTC,eAAe,EACfC,MAAM,EACNC,UAAU,EACVC,cAAc,QACR,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAK/B,MAAMC,cAAc,GAAG,KAAK;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CACxBC,OAAyC,EACzCC,UAAwD,EACvD;EACD,MAAMC,aAAa,GAClB,OAAOF,OAAO,KAAK,QAAQ,GAAGA,OAAO,GAAGV,c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,GAAG,CAAE,CAAE;QAAEC,KAAK;QAAEhB,OAAO;QAAEiB;MAAI,CAAC,EAAEC,KAAK,KAAM;QACpD,oBACC1C,IAAA,CAACF,MAAM;UACN6C,qBAAqB;UAErBC,IAAI,EAAGH,GAAK;UACZI,OAAO,EAAC,MAAM;UACdrB,OAAO,EACNL,KAAsC,IAClCI,aAAa,CAAEJ,KAAK,EAAEK,OAAQ,CAAG;UACtCf,SAAS,EAAC,6BAA6B;UAAAC,QAAA,EAErC8B;QAAK,GARDE,KASC,CAAC;MAEX,CAAE,CAAC,EACD5B,eAAe,iBAChBd,IAAA;QACCqC,IAAI,EAAC,QAAQ;QACb,cAAazC,EAAE,CAAE,qBAAsB,CAAG;QAC1CwC,QAAQ,EAAG,CAAG;QACd3B,SAAS,EAAC,qCAAqC;QAC/Ce,OAAO,EAAGN,SAAW;QACrBoB,UAAU,EAAGpB,SAAW;QAAAR,QAAA,EACxB;MAED,CAAM,CACN;IAAA,CACG;EAAC,CACF,CAAC;AAER;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMoC,QAAQ,GAAGpD,UAAU,CAAEc,mBAAoB,CAAC;AAEzD,eAAesC,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","speak","useEffect","useLayoutEffect","useRef","forwardRef","renderToString","__","warning","Button","jsx","_jsx","jsxs","_jsxs","NOTICE_TIMEOUT","useSpokenMessage","message","politeness","spokenMessage","UnforwardedSnackbar","className","children","actions","onRemove","icon","explicitDismiss","onDismiss","listRef","ref","dismissMe","event","preventDefault","current","focus","onActionClick","onClick","stopPropagation","callbacksRef","timeoutHandle","setTimeout","clearTimeout","classes","length","globalThis","SCRIPT_DEBUG","snackbarContentClassnames","undefined","tabIndex","role","onKeyPress","map","label","url","index","__next40pxDefaultSize","href","variant","Snackbar"],"sources":["@wordpress/components/src/snackbar/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport {\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tforwardRef,\n\trenderToString,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { SnackbarProps } from './types';\nimport type { NoticeAction } from '../notice/types';\nimport type { WordPressComponentProps } from '../context';\n\nconst NOTICE_TIMEOUT = 10000;\n\n/**\n * Custom hook which announces the message with the given politeness, if a\n * valid message is provided.\n *\n * @param message Message to announce.\n * @param politeness Politeness to announce.\n */\nfunction useSpokenMessage(\n\tmessage: SnackbarProps[ 'spokenMessage' ],\n\tpoliteness: NonNullable< SnackbarProps[ '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 UnforwardedSnackbar(\n\t{\n\t\tclassName,\n\t\tchildren,\n\t\tspokenMessage = children,\n\t\tpoliteness = 'polite',\n\t\tactions = [],\n\t\tonRemove,\n\t\ticon = null,\n\t\texplicitDismiss = false,\n\t\t// onDismiss is a callback executed when the snackbar is dismissed.\n\t\t// It is distinct from onRemove, which _looks_ like a callback but is\n\t\t// actually the function to call to remove the snackbar from the UI.\n\t\tonDismiss,\n\t\tlistRef,\n\t}: WordPressComponentProps< SnackbarProps, 'div' >,\n\tref: ForwardedRef< any >\n) {\n\tfunction dismissMe( event: KeyboardEvent | MouseEvent ) {\n\t\tif ( event && event.preventDefault ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t// Prevent focus loss by moving it to the list element.\n\t\tlistRef?.current?.focus();\n\n\t\tonDismiss?.();\n\t\tonRemove?.();\n\t}\n\n\tfunction onActionClick(\n\t\tevent: MouseEvent< HTMLButtonElement >,\n\t\tonClick: NoticeAction[ 'onClick' ]\n\t) {\n\t\tevent.stopPropagation();\n\n\t\tonRemove?.();\n\n\t\tif ( onClick ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\tuseSpokenMessage( spokenMessage, politeness );\n\n\t// The `onDismiss/onRemove` can have unstable references,\n\t// trigger side-effect cleanup, and reset timers.\n\tconst callbacksRef = useRef( { onDismiss, onRemove } );\n\tuseLayoutEffect( () => {\n\t\tcallbacksRef.current = { onDismiss, onRemove };\n\t} );\n\n\tuseEffect( () => {\n\t\t// Only set up the timeout dismiss if we're not explicitly dismissing.\n\t\tconst timeoutHandle = setTimeout( () => {\n\t\t\tif ( ! explicitDismiss ) {\n\t\t\t\tcallbacksRef.current.onDismiss?.();\n\t\t\t\tcallbacksRef.current.onRemove?.();\n\t\t\t}\n\t\t}, NOTICE_TIMEOUT );\n\n\t\treturn () => clearTimeout( timeoutHandle );\n\t}, [ explicitDismiss ] );\n\n\tconst classes = clsx( className, 'components-snackbar', {\n\t\t'components-snackbar-explicit-dismiss': !! explicitDismiss,\n\t} );\n\tif ( actions && actions.length > 1 ) {\n\t\t// We need to inform developers that snackbar only accepts 1 action.\n\t\twarning(\n\t\t\t'Snackbar can only have one action. Use Notice if your message requires many actions.'\n\t\t);\n\t\t// return first element only while keeping it inside an array\n\t\tactions = [ actions[ 0 ] ];\n\t}\n\n\tconst snackbarContentClassnames = clsx( 'components-snackbar__content', {\n\t\t'components-snackbar__content-with-icon': !! icon,\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName={ classes }\n\t\t\tonClick={ ! explicitDismiss ? dismissMe : undefined }\n\t\t\ttabIndex={ 0 }\n\t\t\trole={ ! explicitDismiss ? 'button' : undefined }\n\t\t\tonKeyPress={ ! explicitDismiss ? dismissMe : undefined }\n\t\t\taria-label={\n\t\t\t\t! explicitDismiss ? __( 'Dismiss this notice' ) : undefined\n\t\t\t}\n\t\t\tdata-testid=\"snackbar\"\n\t\t>\n\t\t\t<div className={ snackbarContentClassnames }>\n\t\t\t\t{ icon && (\n\t\t\t\t\t<div className=\"components-snackbar__icon\">{ icon }</div>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t\t{ actions.map( ( { label, onClick, url }, index ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\thref={ url }\n\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\tonClick={ (\n\t\t\t\t\t\t\t\tevent: MouseEvent< HTMLButtonElement >\n\t\t\t\t\t\t\t) => onActionClick( event, onClick ) }\n\t\t\t\t\t\t\tclassName=\"components-snackbar__action\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t\t{ explicitDismiss && (\n\t\t\t\t\t<span\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\taria-label={ __( 'Dismiss this notice' ) }\n\t\t\t\t\t\ttabIndex={ 0 }\n\t\t\t\t\t\tclassName=\"components-snackbar__dismiss-button\"\n\t\t\t\t\t\tonClick={ dismissMe }\n\t\t\t\t\t\tonKeyPress={ dismissMe }\n\t\t\t\t\t>\n\t\t\t\t\t\t✕\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n/**\n * A Snackbar displays a succinct message that is cleared out after a small delay.\n *\n * It can also offer the user options, like viewing a published post.\n * But these options should also be available elsewhere in the UI.\n *\n * ```jsx\n * const MySnackbarNotice = () => (\n * <Snackbar>Post published successfully.</Snackbar>\n * );\n * ```\n */\nexport const Snackbar = forwardRef( UnforwardedSnackbar );\n\nexport default Snackbar;\n"],"mappings":";AAAA;AACA;AACA;;AAEA,OAAOA,IAAI,MAA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AU,CAAEc,mBAAoB,CAAC;AAEzD,eAAesC,QAAQ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","useReducedMotion","useRef","Snackbar","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","jsx","_jsx","jsxs","_jsxs","SNACKBAR_VARIANTS","init","height","opacity","open","transition","type","duration","ease","delay","exit","SnackbarList","notices","className","children","onRemove","listRef","isReducedMotion","removeNotice","notice","id","tabIndex","ref","map","content","restNotice","div","layout","initial","animate","variants","undefined"],"sources":["@wordpress/components/src/snackbar/list.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion } from '@wordpress/compose';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Snackbar from '.';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '../animation';\nimport type { SnackbarListProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nconst SNACKBAR_VARIANTS = {\n\tinit: {\n\t\theight: 0,\n\t\topacity: 0,\n\t},\n\topen: {\n\t\theight: 'auto',\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\theight: { type: 'tween', duration: 0.3, ease: [ 0, 0, 0.2, 1 ] },\n\t\t\topacity: {\n\t\t\t\ttype: 'tween',\n\t\t\t\tduration: 0.25,\n\t\t\t\tdelay: 0.05,\n\t\t\t\tease: [ 0, 0, 0.2, 1 ],\n\t\t\t},\n\t\t},\n\t},\n\texit: {\n\t\topacity: 0,\n\t\ttransition: {\n\t\t\ttype: 'tween',\n\t\t\tduration: 0.1,\n\t\t\tease: [ 0, 0, 0.2, 1 ],\n\t\t},\n\t},\n};\n\n/**\n * Renders a list of notices.\n *\n * ```jsx\n * const MySnackbarListNotice = () => (\n * <SnackbarList\n * notices={ notices }\n * onRemove={ removeNotice }\n * />\n * );\n * ```\n */\nexport function SnackbarList( {\n\tnotices,\n\tclassName,\n\tchildren,\n\tonRemove,\n}: WordPressComponentProps< SnackbarListProps, 'div' > ) {\n\tconst listRef = useRef< HTMLDivElement | null >( null );\n\tconst isReducedMotion = useReducedMotion();\n\tclassName = clsx( 'components-snackbar-list', className );\n\tconst removeNotice =\n\t\t( notice: SnackbarListProps[ 'notices' ][ number ] ) => () =>\n\t\t\tonRemove?.( notice.id );\n\treturn (\n\t\t<div\n\t\t\tclassName={ className }\n\t\t\ttabIndex={ -1 }\n\t\t\tref={ listRef }\n\t\t\tdata-testid=\"snackbar-list\"\n\t\t>\n\t\t\t{ children }\n\t\t\t<AnimatePresence>\n\t\t\t\t{ notices.map( ( notice ) => {\n\t\t\t\t\tconst { content, ...restNotice } = notice;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tlayout={ ! isReducedMotion } // See https://www.framer.com/docs/animation/#layout-animations\n\t\t\t\t\t\t\tinitial=\"init\"\n\t\t\t\t\t\t\tanimate=\"open\"\n\t\t\t\t\t\t\texit=\"exit\"\n\t\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\t\tvariants={\n\t\t\t\t\t\t\t\tisReducedMotion ? undefined : SNACKBAR_VARIANTS\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"components-snackbar-list__notice-container\">\n\t\t\t\t\t\t\t\t<Snackbar\n\t\t\t\t\t\t\t\t\t{ ...restNotice }\n\t\t\t\t\t\t\t\t\tonRemove={ removeNotice( notice ) }\n\t\t\t\t\t\t\t\t\tlistRef={ listRef }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ notice.content }\n\t\t\t\t\t\t\t\t</Snackbar>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</AnimatePresence>\n\t\t</div>\n\t);\n}\n\nexport default SnackbarList;\n"],"mappings":"AAAA;AACA;A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2B,eAAe,GAAG5B,gBAAgB,CAAC,CAAC;EAC1CwB,SAAS,GAAGzB,IAAI,CAAE,0BAA0B,EAAEyB,SAAU,CAAC;EACzD,MAAMK,YAAY,GACfC,MAAgD,IAAM,MACvDJ,QAAQ,GAAII,MAAM,CAACC,EAAG,CAAC;EACzB,oBACCrB,KAAA;IACCc,SAAS,EAAGA,SAAW;IACvBQ,QAAQ,EAAG,CAAC,CAAG;IACfC,GAAG,EAAGN,OAAS;IACf,eAAY,eAAe;IAAAF,QAAA,GAEzBA,QAAQ,eACVjB,IAAA,CAACF,eAAe;MAAAmB,QAAA,EACbF,OAAO,CAACW,GAAG,CAAIJ,MAAM,IAAM;QAC5B,MAAM;UAAEK,OAAO;UAAE,GAAGC;QAAW,CAAC,GAAGN,MAAM;QAEzC,oBACCtB,IAAA,CAACJ,MAAM,CAACiC,GAAG;UACVC,MAAM,EAAG,CAAEV,eAAiB,CAAC;UAAA;UAC7BW,OAAO,EAAC,MAAM;UACdC,OAAO,EAAC,MAAM;UACdnB,IAAI,EAAC,MAAM;UAEXoB,QAAQ,EACPb,eAAe,GAAGc,SAAS,GAAG/B,iBAC9B;UAAAc,QAAA,eAEDjB,IAAA;YAAKgB,SAAS,EAAC,4CAA4C;YAAAC,QAAA,eAC1DjB,IAAA,CAACN,QAAQ;cAAA,GACHkC,UAAU;cACfV,QAAQ,EAAGG,YAAY,CAAEC,MAAO,CAAG;cACnCH,OAAO,EAAGA,OAAS;cAAAF,QAAA,EAEjBK,MAAM,CAACK;YAAO,CACP;UAAC,CACP;QAAC,GAbAL,MAAM,CAACC,EAcF,CAAC;MAEf,CAAE;IAAC,CACa,CAAC;EAAA,CACd,CAAC;AAER;AAEA,eAAeT,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","useReducedMotion","useRef","Snackbar","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","jsx","_jsx","jsxs","_jsxs","SNACKBAR_VARIANTS","init","height","opacity","open","transition","type","duration","ease","delay","exit","SnackbarList","notices","className","children","onRemove","listRef","isReducedMotion","removeNotice","notice","id","tabIndex","ref","map","content","restNotice","div","layout","initial","animate","variants","undefined"],"sources":["@wordpress/components/src/snackbar/list.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion } from '@wordpress/compose';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Snackbar from '.';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '../animation';\nimport type { SnackbarListProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nconst SNACKBAR_VARIANTS = {\n\tinit: {\n\t\theight: 0,\n\t\topacity: 0,\n\t},\n\topen: {\n\t\theight: 'auto',\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\theight: { type: 'tween', duration: 0.3, ease: [ 0, 0, 0.2, 1 ] },\n\t\t\topacity: {\n\t\t\t\ttype: 'tween',\n\t\t\t\tduration: 0.25,\n\t\t\t\tdelay: 0.05,\n\t\t\t\tease: [ 0, 0, 0.2, 1 ],\n\t\t\t},\n\t\t},\n\t},\n\texit: {\n\t\topacity: 0,\n\t\ttransition: {\n\t\t\ttype: 'tween',\n\t\t\tduration: 0.1,\n\t\t\tease: [ 0, 0, 0.2, 1 ],\n\t\t},\n\t},\n};\n\n/**\n * Renders a list of notices.\n *\n * ```jsx\n * const MySnackbarListNotice = () => (\n * <SnackbarList\n * notices={ notices }\n * onRemove={ removeNotice }\n * />\n * );\n * ```\n */\nexport function SnackbarList( {\n\tnotices,\n\tclassName,\n\tchildren,\n\tonRemove,\n}: WordPressComponentProps< SnackbarListProps, 'div' > ) {\n\tconst listRef = useRef< HTMLDivElement | null >( null );\n\tconst isReducedMotion = useReducedMotion();\n\tclassName = clsx( 'components-snackbar-list', className );\n\tconst removeNotice =\n\t\t( notice: SnackbarListProps[ 'notices' ][ number ] ) => () =>\n\t\t\tonRemove?.( notice.id );\n\treturn (\n\t\t<div\n\t\t\tclassName={ className }\n\t\t\ttabIndex={ -1 }\n\t\t\tref={ listRef }\n\t\t\tdata-testid=\"snackbar-list\"\n\t\t>\n\t\t\t{ children }\n\t\t\t<AnimatePresence>\n\t\t\t\t{ notices.map( ( notice ) => {\n\t\t\t\t\tconst { content, ...restNotice } = notice;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tlayout={ ! isReducedMotion } // See https://www.framer.com/docs/animation/#layout-animations\n\t\t\t\t\t\t\tinitial=\"init\"\n\t\t\t\t\t\t\tanimate=\"open\"\n\t\t\t\t\t\t\texit=\"exit\"\n\t\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\t\tvariants={\n\t\t\t\t\t\t\t\tisReducedMotion ? undefined : SNACKBAR_VARIANTS\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"components-snackbar-list__notice-container\">\n\t\t\t\t\t\t\t\t<Snackbar\n\t\t\t\t\t\t\t\t\t{ ...restNotice }\n\t\t\t\t\t\t\t\t\tonRemove={ removeNotice( notice ) }\n\t\t\t\t\t\t\t\t\tlistRef={ listRef }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ notice.content }\n\t\t\t\t\t\t\t\t</Snackbar>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</AnimatePresence>\n\t\t</div>\n\t);\n}\n\nexport default SnackbarList;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,MAAM,QAAQ,oBAAoB;;AAE3C;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,GAAG;AACxB,SACCC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,Q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ACvBQ,QAAQ,EAAG,CAAC,CAAG;IACfC,GAAG,EAAGN,OAAS;IACf,eAAY,eAAe;IAAAF,QAAA,GAEzBA,QAAQ,eACVjB,IAAA,CAACF,eAAe;MAAAmB,QAAA,EACbF,OAAO,CAACW,GAAG,CAAIJ,MAAM,IAAM;QAC5B,MAAM;UAAEK,OAAO;UAAE,GAAGC;QAAW,CAAC,GAAGN,MAAM;QAEzC,oBACCtB,IAAA,CAACJ,MAAM,CAACiC,GAAG;UACVC,MAAM,EAAG,CAAEV,eAAiB,CAAC;UAAA;UAC7BW,OAAO,EAAC,MAAM;UACdC,OAAO,EAAC,MAAM;UACdnB,IAAI,EAAC,MAAM;UAEXoB,QAAQ,EACPb,eAAe,GAAGc,SAAS,GAAG/B,iBAC9B;UAAAc,QAAA,eAEDjB,IAAA;YAAKgB,SAAS,EAAC,4CAA4C;YAAAC,QAAA,eAC1DjB,IAAA,CAACN,QAAQ;cAAA,GACHkC,UAAU;cACfV,QAAQ,EAAGG,YAAY,CAAEC,MAAO,CAAG;cACnCH,OAAO,EAAGA,OAAS;cAAAF,QAAA,EAEjBK,MAAM,CAACK;YAAO,CACP;UAAC,CACP;QAAC,GAbAL,MAAM,CAACC,EAcF,CAAC;MAEf,CAAE;IAAC,CACa,CAAC;EAAA,CACd,CAAC;AAER;AAEA,eAAeT,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CacheProvider","createCache","uuid","jsx","_jsx","uuidCache","Set","containerCacheMap","WeakMap","memoizedCreateCacheWithContainer","container","has","get","key","v4","replace","add","cache","set","StyleProvider","props","children","document","head","value"],"sources":["@wordpress/components/src/style-provider/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { CacheProvider } from '@emotion/react';\nimport createCache from '@emotion/cache';\nimport * as uuid from 'uuid';\n\n/**\n * Internal dependencies\n */\nimport type { StyleProviderProps } from './types';\n\nconst uuidCache = new Set();\n// Use a weak map so that when the container is detached it's automatically\n// dereferenced to avoid memory leak.\nconst containerCacheMap = new WeakMap();\n\nconst memoizedCreateCacheWithContainer = ( container: HTMLElement ) => {\n\tif ( containerCacheMap.has( container ) ) {\n\t\treturn containerCacheMap.get( container );\n\t}\n\n\t// Emotion only accepts alphabetical and hyphenated keys so we just\n\t// strip the numbers from the UUID. It _should_ be fine.\n\tlet key = uuid.v4().replace( /[0-9]/g, '' );\n\twhile ( uuidCache.has( key ) ) {\n\t\tkey = uuid.v4().replace( /[0-9]/g, '' );\n\t}\n\tuuidCache.add( key );\n\n\tconst cache = createCache( { container, key } );\n\tcontainerCacheMap.set( container, cache );\n\treturn cache;\n};\n\nexport function StyleProvider( props: StyleProviderProps ) {\n\tconst { children, document } = props;\n\n\tif ( ! document ) {\n\t\treturn null;\n\t}\n\n\tconst cache = memoizedCreateCacheWithContainer( document.head );\n\n\treturn <CacheProvider value={ cache }>{ children }</CacheProvider>;\n}\n\nexport default StyleProvider;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["CacheProvider","createCache","uuid","jsx","_jsx","uuidCache","Set","containerCacheMap","WeakMap","memoizedCreateCacheWithContainer","container","has","get","key","v4","replace","add","cache","set","StyleProvider","props","children","document","head","value"],"sources":["@wordpress/components/src/style-provider/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { CacheProvider } from '@emotion/react';\nimport createCache from '@emotion/cache';\nimport * as uuid from 'uuid';\n\n/**\n * Internal dependencies\n */\nimport type { StyleProviderProps } from './types';\n\nconst uuidCache = new Set();\n// Use a weak map so that when the container is detached it's automatically\n// dereferenced to avoid memory leak.\nconst containerCacheMap = new WeakMap();\n\nconst memoizedCreateCacheWithContainer = ( container: HTMLElement ) => {\n\tif ( containerCacheMap.has( container ) ) {\n\t\treturn containerCacheMap.get( container );\n\t}\n\n\t// Emotion only accepts alphabetical and hyphenated keys so we just\n\t// strip the numbers from the UUID. It _should_ be fine.\n\tlet key = uuid.v4().replace( /[0-9]/g, '' );\n\twhile ( uuidCache.has( key ) ) {\n\t\tkey = uuid.v4().replace( /[0-9]/g, '' );\n\t}\n\tuuidCache.add( key );\n\n\tconst cache = createCache( { container, key } );\n\tcontainerCacheMap.set( container, cache );\n\treturn cache;\n};\n\nexport function StyleProvider( props: StyleProviderProps ) {\n\tconst { children, document } = props;\n\n\tif ( ! document ) {\n\t\treturn null;\n\t}\n\n\tconst cache = memoizedCreateCacheWithContainer( document.head );\n\n\treturn <CacheProvider value={ cache }>{ children }</CacheProvider>;\n}\n\nexport default StyleProvider;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,gBAAgB;AAC9C,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAO,KAAKC,IAAI,MAAM,MAAM;;AAE5B;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA;AAKA,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAC,CAAC;AAC3B;AACA;AACA,MAAMC,iBAAiB,GAAG,IAAIC,OAAO,CAAC,CAAC;AAEvC,MAAMC,gCAAgC,GAAKC,SAAsB,IAAM;EACtE,IAAKH,iBAAiB,CAACI,GAAG,CAAED,SAAU,CAAC,EAAG;IACzC,OAAOH,iBAAiB,CAACK,GAAG,CAAEF,SAAU,CAAC;EAC1C;;EAEA;EACA;EACA,IAAIG,GAAG,GAAGX,IAAI,CAACY,EAAE,CAAC,CAAC,CAACC,OAAO,CAAE,QAAQ,EAAE,EAAG,CAAC;EAC3C,OAAQV,SAAS,CAACM,GAAG,CAAEE,GAAI,CAAC,EAAG;IAC9BA,GAAG,GAAGX,IAAI,CAACY,EAAE,CAAC,CAAC,CAACC,OAAO,CAAE,QAAQ,EAAE,EAAG,CAAC;EACxC;EACAV,SAAS,CAACW,GAAG,CAAEH,GAAI,CAAC;EAEpB,MAAMI,KAAK,GAAGhB,WAAW,CAAE;IAAES,SAAS;IAAEG;EAAI,CAAE,CAAC;EAC/CN,iBAAiB,CAACW,GAAG,CAAER,SAAS,EAAEO,KAAM,CAAC;EACzC,OAAOA,KAAK;AACb,CAAC;AAED,OAAO,SAASE,aAAaA,CAAEC,KAAyB,EAAG;EAC1D,MAAM;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAGF,KAAK;EAEpC,IAAK,CAAEE,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,MAAML,KAAK,GAAGR,gCAAgC,CAAEa,QAAQ,CAACC,IAAK,CAAC;EAE/D,oBAAOnB,IAAA,CAACJ,aAAa;IAACwB,KAAK,EAAGP,KAAO;IAAAI,QAAA,EAAGA;EAAQ,CAAiB,CAAC;AACnE;AAEA,eAAeF,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","useStoreState","clsx","forwardRef","useEffect","useLayoutEffect","useCallback","useInstanceId","usePrevious","isRTL","Button","jsx","_jsx","jsxs","_jsxs","extractTabName","id","match","UnforwardedTabPanel","className","children","tabs","selectOnMove","initialTabName","orientation","activeClass","onSelect","ref","instanceId","TabPanel","prependInstanceId","tabName","tabStore","useTabStore","setSelectedId","newTabValue","newTab","find","t","name","disabled","selectedTab","simplifiedTabName","defaultSelectedId","rtl","selectedTabName","setTabStoreSelectedId","setState","previousSelectedTabName","initialTab","tab","firstEnabledTab","TabList","store","map","Tab","render","__next40pxDefaultSize","icon","label","title","showTooltip","tabId"],"sources":["@wordpress/components/src/tab-panel/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { useStoreState } from '@ariakit/react';\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tforwardRef,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseCallback,\n} from '@wordpress/element';\nimport { useInstanceId, usePrevious } from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\n\nimport Button from '../button';\nimport type { TabPanelProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\n// Separate the actual tab name from the instance ID. This is\n// necessary because Ariakit internally uses the element ID when\n// a new tab is selected, but our implementation looks specifically\n// for the tab name to be passed to the `onSelect` callback.\nconst extractTabName = ( id: string | undefined | null ) => {\n\tif ( typeof id === 'undefined' || id === null ) {\n\t\treturn;\n\t}\n\treturn id.match( /^tab-panel-[0-9]*-(.*)/ )?.[ 1 ];\n};\n\n/**\n * TabPanel is an ARIA-compliant tabpanel.\n *\n * TabPanels organize content across different screens, data sets, and interactions.\n * It has two sections: a list of tabs, and the view to show when tabs are chosen.\n *\n * ```jsx\n * import { TabPanel } from '@wordpress/components';\n *\n * const onSelect = ( tabName ) => {\n * console.log( 'Selecting tab', tabName );\n * };\n *\n * const MyTabPanel = () => (\n * <TabPanel\n * className=\"my-tab-panel\"\n * activeClass=\"active-tab\"\n * onSelect={ onSelect }\n * tabs={ [\n * {\n * name: 'tab1',\n * title: 'Tab 1',\n * className: 'tab-one',\n * },\n * {\n * name: 'tab2',\n * title: 'Tab 2',\n * className: 'tab-two',\n * },\n * ] }\n * >\n * { ( tab ) => <p>{ tab.title }</p> }\n * </TabPanel>\n * );\n * ```\n */\nconst UnforwardedTabPanel = (\n\t{\n\t\tclassName,\n\t\tchildren,\n\t\ttabs,\n\t\tselectOnMove = true,\n\t\tinitialTabName,\n\t\torientation = 'horizontal',\n\t\tactiveClass = 'is-active',\n\t\tonSelect,\n\t}: WordPressComponentProps< TabPanelProps, 'div', false >,\n\tref: ForwardedRef< any >\n) => {\n\tconst instanceId = useInstanceId( TabPanel, 'tab-panel' );\n\n\tconst prependInstanceId = useCallback(\n\t\t( tabName: string | undefined ) => {\n\t\t\tif ( typeof tabName === 'undefined' ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn `${ instanceId }-${ tabName }`;\n\t\t},\n\t\t[ instanceId ]\n\t);\n\n\tconst tabStore = Ariakit.useTabStore( {\n\t\tsetSelectedId: ( newTabValue ) => {\n\t\t\tif ( typeof newTabValue === 'undefined' || newTabValue === null ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst newTab = tabs.find(\n\t\t\t\t( t ) => prependInstanceId( t.name ) === newTabValue\n\t\t\t);\n\t\t\tif ( newTab?.disabled || newTab === selectedTab ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst simplifiedTabName = extractTabName( newTabValue );\n\t\t\tif ( typeof simplifiedTabName === 'undefined' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonSelect?.( simplifiedTabName );\n\t\t},\n\t\torientation,\n\t\tselectOnMove,\n\t\tdefaultSelectedId: prependInstanceId( initialTabName ),\n\t\trtl: isRTL(),\n\t} );\n\n\tconst selectedTabName = extractTabName(\n\t\tuseStoreState( tabStore, 'selectedId' )\n\t);\n\n\tconst setTabStoreSelectedId = useCallback(\n\t\t( tabName: string ) => {\n\t\t\ttabStore.setState( 'selectedId', prependInstanceId( tabName ) );\n\t\t},\n\t\t[ prependInstanceId, tabStore ]\n\t);\n\n\tconst selectedTab = tabs.find( ( { name } ) => name === selectedTabName );\n\n\tconst previousSelectedTabName = usePrevious( selectedTabName );\n\n\t// Ensure `onSelect` is called when the initial tab is selected.\n\tuseEffect( () => {\n\t\tif (\n\t\t\tpreviousSelectedTabName !== selectedTabName &&\n\t\t\tselectedTabName === initialTabName &&\n\t\t\t!! selectedTabName\n\t\t) {\n\t\t\tonSelect?.( selectedTabName );\n\t\t}\n\t}, [ selectedTabName, initialTabName, onSelect, previousSelectedTabName ] );\n\n\t// Handle selecting the initial tab.\n\tuseLayoutEffect( () => {\n\t\t// If there's a selected tab, don't override it.\n\t\tif ( selectedTab ) {\n\t\t\treturn;\n\t\t}\n\t\tconst initialTab = tabs.find( ( tab ) => tab.name === initialTabName );\n\t\t// Wait for the denoted initial tab to be declared before making a\n\t\t// selection. This ensures that if a tab is declared lazily it can\n\t\t// still receive initial selection.\n\t\tif ( initialTabName && ! initialTab ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( initialTab && ! initialTab.disabled ) {\n\t\t\t// Select the initial tab if it's not disabled.\n\t\t\tsetTabStoreSelectedId( initialTab.name );\n\t\t} else {\n\t\t\t// Fallback to the first enabled tab when the initial tab is\n\t\t\t// disabled or it can't be found.\n\t\t\tconst firstEnabledTab = tabs.find( ( tab ) => ! tab.disabled );\n\t\t\tif ( firstEnabledTab ) {\n\t\t\t\tsetTabStoreSelectedId( firstEnabledTab.name );\n\t\t\t}\n\t\t}\n\t}, [\n\t\ttabs,\n\t\tselectedTab,\n\t\tinitialTabName,\n\t\tinstanceId,\n\t\tsetTabStoreSelectedId,\n\t] );\n\n\t// Handle the currently selected tab becoming disabled.\n\tuseEffect( () => {\n\t\t// This effect only runs when the selected tab is defined and becomes disabled.\n\t\tif ( ! selectedTab?.disabled ) {\n\t\t\treturn;\n\t\t}\n\t\tconst firstEnabledTab = tabs.find( ( tab ) => ! tab.disabled );\n\t\t// If the currently selected tab becomes disabled, select the first enabled tab.\n\t\t// (if there is one).\n\t\tif ( firstEnabledTab ) {\n\t\t\tsetTabStoreSelectedId( firstEnabledTab.name );\n\t\t}\n\t}, [ tabs, selectedTab?.disabled, setTabStoreSelectedId, instanceId ] );\n\treturn (\n\t\t<div className={ className } ref={ ref }>\n\t\t\t<Ariakit.TabList\n\t\t\t\tstore={ tabStore }\n\t\t\t\tclassName=\"components-tab-panel__tabs\"\n\t\t\t>\n\t\t\t\t{ tabs.map( ( tab ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Ariakit.Tab\n\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\tid={ prependInstanceId( tab.name ) }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'components-tab-panel__tabs-item',\n\t\t\t\t\t\t\t\ttab.className,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t[ activeClass ]:\n\t\t\t\t\t\t\t\t\t\ttab.name === selectedTabName,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tdisabled={ tab.disabled }\n\t\t\t\t\t\t\taria-controls={ `${ prependInstanceId(\n\t\t\t\t\t\t\t\ttab.name\n\t\t\t\t\t\t\t) }-view` }\n\t\t\t\t\t\t\trender={\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\ticon={ tab.icon }\n\t\t\t\t\t\t\t\t\tlabel={ tab.icon && tab.title }\n\t\t\t\t\t\t\t\t\tshowTooltip={ !! tab.icon }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ ! tab.icon && tab.title }\n\t\t\t\t\t\t</Ariakit.Tab>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</Ariakit.TabList>\n\t\t\t{ selectedTab && (\n\t\t\t\t<Ariakit.TabPanel\n\t\t\t\t\tid={ `${ prependInstanceId( selectedTab.name ) }-view` }\n\t\t\t\t\tstore={ tabStore }\n\t\t\t\t\ttabId={ prependInstanceId( selectedTab.name ) }\n\t\t\t\t\tclassName=\"components-tab-panel__tab-content\"\n\t\t\t\t>\n\t\t\t\t\t{ children( selectedTab ) }\n\t\t\t\t</Ariakit.TabPanel>\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\nexport const TabPanel = forwardRef( UnforwardedTabPanel );\nexport default TabPanel;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,OAAOC,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SACCC,UAAU,EACVC,SAAS,EACTC,eAAe,EACfC,WAAW,QACL,oBAAoB;AAC3B,SAASC,aAAa,EAAEC,WAAW,QAAQ,oBAAoB;AAC/D,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;;AAEA,OAAOC,MAAM,MAAM,WAAW;AAAC,SAAAC,GAAA,I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AAGjB,IAAI,CACf,iCAAiC,EACjCgD,GAAG,CAAC/B,SAAS,EACb;YACC,CAAEM,WAAW,GACZyB,GAAG,CAACX,IAAI,KAAKM;UACf,CACD,CAAG;UACHL,QAAQ,EAAGU,GAAG,CAACV,QAAU;UACzB,iBAAgB,GAAIV,iBAAiB,CACpCoB,GAAG,CAACX,IACL,CAAC,OAAU;UACXiB,MAAM,eACL5C,IAAA,CAACF,MAAM;YACN+C,qBAAqB;YACrBC,IAAI,EAAGR,GAAG,CAACQ,IAAM;YACjBC,KAAK,EAAGT,GAAG,CAACQ,IAAI,IAAIR,GAAG,CAACU,KAAO;YAC/BC,WAAW,EAAG,CAAC,CAAEX,GAAG,CAACQ;UAAM,CAC3B,CACD;UAAAtC,QAAA,EAEC,CAAE8B,GAAG,CAACQ,IAAI,IAAIR,GAAG,CAACU;QAAK,GAvBnBV,GAAG,CAACX,IAwBE,CAAC;MAEhB,CAAE;IAAC,CACa,CAAC,EAChBE,WAAW,iBACZ7B,IAAA,CAACZ,OAAO,CAAC6B,QAAQ;MAChBb,EAAE,EAAG,GAAIc,iBAAiB,CAAEW,WAAW,CAACF,IAAK,CAAC,OAAU;MACxDc,KAAK,EAAGrB,QAAU;MAClB8B,KAAK,EAAGhC,iBAAiB,CAAEW,WAAW,CAACF,IAAK,CAAG;MAC/CpB,SAAS,EAAC,mCAAmC;MAAAC,QAAA,EAE3CA,QAAQ,CAAEqB,WAAY;IAAC,CACR,CAClB;EAAA,CACG,CAAC;AAER,CAAC;AAED,OAAO,MAAMZ,QAAQ,GAAG1B,UAAU,CAAEe,mBAAoB,CAAC;AACzD,eAAeW,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Ariakit","useStoreState","clsx","forwardRef","useEffect","useLayoutEffect","useCallback","useInstanceId","usePrevious","isRTL","Button","jsx","_jsx","jsxs","_jsxs","extractTabName","id","match","UnforwardedTabPanel","className","children","tabs","selectOnMove","initialTabName","orientation","activeClass","onSelect","ref","instanceId","TabPanel","prependInstanceId","tabName","tabStore","useTabStore","setSelectedId","newTabValue","newTab","find","t","name","disabled","selectedTab","simplifiedTabName","defaultSelectedId","rtl","selectedTabName","setTabStoreSelectedId","setState","previousSelectedTabName","initialTab","tab","firstEnabledTab","TabList","store","map","Tab","render","__next40pxDefaultSize","icon","label","title","showTooltip","tabId"],"sources":["@wordpress/components/src/tab-panel/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { useStoreState } from '@ariakit/react';\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tforwardRef,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseCallback,\n} from '@wordpress/element';\nimport { useInstanceId, usePrevious } from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\n\nimport Button from '../button';\nimport type { TabPanelProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\n// Separate the actual tab name from the instance ID. This is\n// necessary because Ariakit internally uses the element ID when\n// a new tab is selected, but our implementation looks specifically\n// for the tab name to be passed to the `onSelect` callback.\nconst extractTabName = ( id: string | undefined | null ) => {\n\tif ( typeof id === 'undefined' || id === null ) {\n\t\treturn;\n\t}\n\treturn id.match( /^tab-panel-[0-9]*-(.*)/ )?.[ 1 ];\n};\n\n/**\n * TabPanel is an ARIA-compliant tabpanel.\n *\n * TabPanels organize content across different screens, data sets, and interactions.\n * It has two sections: a list of tabs, and the view to show when tabs are chosen.\n *\n * ```jsx\n * import { TabPanel } from '@wordpress/components';\n *\n * const onSelect = ( tabName ) => {\n * console.log( 'Selecting tab', tabName );\n * };\n *\n * const MyTabPanel = () => (\n * <TabPanel\n * className=\"my-tab-panel\"\n * activeClass=\"active-tab\"\n * onSelect={ onSelect }\n * tabs={ [\n * {\n * name: 'tab1',\n * title: 'Tab 1',\n * className: 'tab-one',\n * },\n * {\n * name: 'tab2',\n * title: 'Tab 2',\n * className: 'tab-two',\n * },\n * ] }\n * >\n * { ( tab ) => <p>{ tab.title }</p> }\n * </TabPanel>\n * );\n * ```\n */\nconst UnforwardedTabPanel = (\n\t{\n\t\tclassName,\n\t\tchildren,\n\t\ttabs,\n\t\tselectOnMove = true,\n\t\tinitialTabName,\n\t\torientation = 'horizontal',\n\t\tactiveClass = 'is-active',\n\t\tonSelect,\n\t}: WordPressComponentProps< TabPanelProps, 'div', false >,\n\tref: ForwardedRef< any >\n) => {\n\tconst instanceId = useInstanceId( TabPanel, 'tab-panel' );\n\n\tconst prependInstanceId = useCallback(\n\t\t( tabName: string | undefined ) => {\n\t\t\tif ( typeof tabName === 'undefined' ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn `${ instanceId }-${ tabName }`;\n\t\t},\n\t\t[ instanceId ]\n\t);\n\n\tconst tabStore = Ariakit.useTabStore( {\n\t\tsetSelectedId: ( newTabValue ) => {\n\t\t\tif ( typeof newTabValue === 'undefined' || newTabValue === null ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst newTab = tabs.find(\n\t\t\t\t( t ) => prependInstanceId( t.name ) === newTabValue\n\t\t\t);\n\t\t\tif ( newTab?.disabled || newTab === selectedTab ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst simplifiedTabName = extractTabName( newTabValue );\n\t\t\tif ( typeof simplifiedTabName === 'undefined' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonSelect?.( simplifiedTabName );\n\t\t},\n\t\torientation,\n\t\tselectOnMove,\n\t\tdefaultSelectedId: prependInstanceId( initialTabName ),\n\t\trtl: isRTL(),\n\t} );\n\n\tconst selectedTabName = extractTabName(\n\t\tuseStoreState( tabStore, 'selectedId' )\n\t);\n\n\tconst setTabStoreSelectedId = useCallback(\n\t\t( tabName: string ) => {\n\t\t\ttabStore.setState( 'selectedId', prependInstanceId( tabName ) );\n\t\t},\n\t\t[ prependInstanceId, tabStore ]\n\t);\n\n\tconst selectedTab = tabs.find( ( { name } ) => name === selectedTabName );\n\n\tconst previousSelectedTabName = usePrevious( selectedTabName );\n\n\t// Ensure `onSelect` is called when the initial tab is selected.\n\tuseEffect( () => {\n\t\tif (\n\t\t\tpreviousSelectedTabName !== selectedTabName &&\n\t\t\tselectedTabName === initialTabName &&\n\t\t\t!! selectedTabName\n\t\t) {\n\t\t\tonSelect?.( selectedTabName );\n\t\t}\n\t}, [ selectedTabName, initialTabName, onSelect, previousSelectedTabName ] );\n\n\t// Handle selecting the initial tab.\n\tuseLayoutEffect( () => {\n\t\t// If there's a selected tab, don't override it.\n\t\tif ( selectedTab ) {\n\t\t\treturn;\n\t\t}\n\t\tconst initialTab = tabs.find( ( tab ) => tab.name === initialTabName );\n\t\t// Wait for the denoted initial tab to be declared before making a\n\t\t// selection. This ensures that if a tab is declared lazily it can\n\t\t// still receive initial selection.\n\t\tif ( initialTabName && ! initialTab ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( initialTab && ! initialTab.disabled ) {\n\t\t\t// Select the initial tab if it's not disabled.\n\t\t\tsetTabStoreSelectedId( initialTab.name );\n\t\t} else {\n\t\t\t// Fallback to the first enabled tab when the initial tab is\n\t\t\t// disabled or it can't be found.\n\t\t\tconst firstEnabledTab = tabs.find( ( tab ) => ! tab.disabled );\n\t\t\tif ( firstEnabledTab ) {\n\t\t\t\tsetTabStoreSelectedId( firstEnabledTab.name );\n\t\t\t}\n\t\t}\n\t}, [\n\t\ttabs,\n\t\tselectedTab,\n\t\tinitialTabName,\n\t\tinstanceId,\n\t\tsetTabStoreSelectedId,\n\t] );\n\n\t// Handle the currently selected tab becoming disabled.\n\tuseEffect( () => {\n\t\t// This effect only runs when the selected tab is defined and becomes disabled.\n\t\tif ( ! selectedTab?.disabled ) {\n\t\t\treturn;\n\t\t}\n\t\tconst firstEnabledTab = tabs.find( ( tab ) => ! tab.disabled );\n\t\t// If the currently selected tab becomes disabled, select the first enabled tab.\n\t\t// (if there is one).\n\t\tif ( firstEnabledTab ) {\n\t\t\tsetTabStoreSelectedId( firstEnabledTab.name );\n\t\t}\n\t}, [ tabs, selectedTab?.disabled, setTabStoreSelectedId, instanceId ] );\n\treturn (\n\t\t<div className={ className } ref={ ref }>\n\t\t\t<Ariakit.TabList\n\t\t\t\tstore={ tabStore }\n\t\t\t\tclassName=\"components-tab-panel__tabs\"\n\t\t\t>\n\t\t\t\t{ tabs.map( ( tab ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Ariakit.Tab\n\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\tid={ prependInstanceId( tab.name ) }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'components-tab-panel__tabs-item',\n\t\t\t\t\t\t\t\ttab.className,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t[ activeClass ]:\n\t\t\t\t\t\t\t\t\t\ttab.name === selectedTabName,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tdisabled={ tab.disabled }\n\t\t\t\t\t\t\taria-controls={ `${ prependInstanceId(\n\t\t\t\t\t\t\t\ttab.name\n\t\t\t\t\t\t\t) }-view` }\n\t\t\t\t\t\t\trender={\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\ticon={ tab.icon }\n\t\t\t\t\t\t\t\t\tlabel={ tab.icon && tab.title }\n\t\t\t\t\t\t\t\t\tshowTooltip={ !! tab.icon }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ ! tab.icon && tab.title }\n\t\t\t\t\t\t</Ariakit.Tab>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</Ariakit.TabList>\n\t\t\t{ selectedTab && (\n\t\t\t\t<Ariakit.TabPanel\n\t\t\t\t\tid={ `${ prependInstanceId( selectedTab.name ) }-view` }\n\t\t\t\t\tstore={ tabStore }\n\t\t\t\t\ttabId={ prependInstanceId( selectedTab.name ) }\n\t\t\t\t\tclassName=\"components-tab-panel__tab-content\"\n\t\t\t\t>\n\t\t\t\t\t{ children( selectedTab ) }\n\t\t\t\t</Ariakit.TabPanel>\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\nexport const TabPanel = forwardRef( UnforwardedTabPanel );\nexport default TabPanel;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,OAAOC,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SACCC,UAAU,EACVC,SAAS,EACTC,eAAe,EACfC,WAAW,QACL,oBAAoB;AAC3B,SAASC,aAAa,EAAEC,WAAW,QAAQ,oBAAoB;AAC/D,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;;AAEA,OAAOC,MAAM,MAAM,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAI/B;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAKC,EAA6B,IAAM;EAC3D,IAAK,OAAOA,EAAE,KAAK,WAAW,IAAIA,EAAE,KAAK,IAAI,EAAG;IAC/C;EACD;EACA,OAAOA,EAAE,CAACC,KAAK,CAAE,wBAAyB,CAAC,GAAI,CAAC,CAAE;AACnD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAGA,CAC3B;EACCC,SAAS;EACTC,QAAQ;EACRC,IAAI;EACJC,YAAY,GAAG,IAAI;EACnBC,cAAc;EACdC,WAAW,GAAG,YAAY;EAC1BC,WAAW,GAAG,WAAW;EACzBC;AACuD,CAAC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7B,IAAA,CAACZ,OAAO,CAAC6B,QAAQ;MAChBb,EAAE,EAAG,GAAIc,iBAAiB,CAAEW,WAAW,CAACF,IAAK,CAAC,OAAU;MACxDc,KAAK,EAAGrB,QAAU;MAClB8B,KAAK,EAAGhC,iBAAiB,CAAEW,WAAW,CAACF,IAAK,CAAG;MAC/CpB,SAAS,EAAC,mCAAmC;MAAAC,QAAA,EAE3CA,QAAQ,CAAEqB,WAAY;IAAC,CACR,CAClB;EAAA,CACG,CAAC;AAER,CAAC;AAED,OAAO,MAAMZ,QAAQ,GAAG1B,UAAU,CAAEe,mBAAoB,CAAC;AACzD,eAAeW,QAAQ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","useInstanceId","useEffect","useMemo","isRTL","TabsContext","Tab","TabList","TabPanel","jsx","_jsx","externalToInternalTabId","externalId","instanceId","internalToExternalTabId","internalId","replace","Tabs","Object","assign","selectOnMove","defaultTabId","orientation","onSelect","children","selectedTabId","activeTabId","defaultActiveTabId","onActiveTabIdChange","store","useTabStore","defaultSelectedId","setSelectedId","newSelectedId","selectedId","defaultActiveId","setActiveId","newActiveId","activeId","rtl","items","useStoreState","requestAnimationFrame","focusedElement","element","ownerDocument","activeElement","some","item","id","contextValue","Provider","value","displayName","Context"],"sources":["@wordpress/components/src/tabs/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { TabsProps } from './types';\nimport { TabsContext } from './context';\nimport { Tab } from './tab';\nimport { TabList } from './tablist';\nimport { TabPanel } from './tabpanel';\n\nfunction externalToInternalTabId(\n\texternalId: string | undefined | null,\n\tinstanceId: string\n) {\n\treturn externalId && `${ instanceId }-${ externalId }`;\n}\n\nfunction internalToExternalTabId(\n\tinternalId: string | undefined | null,\n\tinstanceId: string\n) {\n\treturn typeof internalId === 'string'\n\t\t? internalId.replace( `${ instanceId }-`, '' )\n\t\t: internalId;\n}\n\n/**\n * Display one panel of content at a time with a tabbed interface, based on the\n * WAI-ARIA Tabs Pattern.\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/tabs/\n * ```\n */\nexport const Tabs = Object.assign(\n\tfunction Tabs( {\n\t\tselectOnMove = true,\n\t\tdefaultTabId,\n\t\torientation = 'horizontal',\n\t\tonSelect,\n\t\tchildren,\n\t\tselectedTabId,\n\t\tactiveTabId,\n\t\tdefaultActiveTabId,\n\t\tonActiveTabIdChange,\n\t}: TabsProps ) {\n\t\tconst instanceId = useInstanceId( Tabs, 'tabs' );\n\t\tconst store = Ariakit.useTabStore( {\n\t\t\tselectOnMove,\n\t\t\torientation,\n\t\t\tdefaultSelectedId: externalToInternalTabId(\n\t\t\t\tdefaultTabId,\n\t\t\t\tinstanceId\n\t\t\t),\n\t\t\tsetSelectedId: ( newSelectedId ) => {\n\t\t\t\tonSelect?.(\n\t\t\t\t\tinternalToExternalTabId( newSelectedId, instanceId )\n\t\t\t\t);\n\t\t\t},\n\t\t\tselectedId: externalToInternalTabId( selectedTabId, instanceId ),\n\t\t\tdefaultActiveId: externalToInternalTabId(\n\t\t\t\tdefaultActiveTabId,\n\t\t\t\tinstanceId\n\t\t\t),\n\t\t\tsetActiveId: ( newActiveId ) => {\n\t\t\t\tonActiveTabIdChange?.(\n\t\t\t\t\tinternalToExternalTabId( newActiveId, instanceId )\n\t\t\t\t);\n\t\t\t},\n\t\t\tactiveId: externalToInternalTabId( activeTabId, instanceId ),\n\t\t\trtl: isRTL(),\n\t\t} );\n\n\t\tconst { items, activeId } = Ariakit.useStoreState( store );\n\t\tconst { setActiveId } = store;\n\n\t\tuseEffect( () => {\n\t\t\trequestAnimationFrame( () => {\n\t\t\t\tconst focusedElement =\n\t\t\t\t\titems?.[ 0 ]?.element?.ownerDocument.activeElement;\n\n\t\t\t\tif (\n\t\t\t\t\t! focusedElement ||\n\t\t\t\t\t! items.some( ( item ) => focusedElement === item.element )\n\t\t\t\t) {\n\t\t\t\t\treturn; // Return early if no tabs are focused.\n\t\t\t\t}\n\n\t\t\t\t// If, after ariakit re-computes the active tab, that tab doesn't match\n\t\t\t\t// the currently focused tab, then we force an update to ariakit to avoid\n\t\t\t\t// any mismatches, especially when navigating to previous/next tab with\n\t\t\t\t// arrow keys.\n\t\t\t\tif ( activeId !== focusedElement.id ) {\n\t\t\t\t\tsetActiveId( focusedElement.id );\n\t\t\t\t}\n\t\t\t} );\n\t\t}, [ activeId, items, setActiveId ] );\n\n\t\tconst contextValue = useMemo(\n\t\t\t() => ( {\n\t\t\t\tstore,\n\t\t\t\tinstanceId,\n\t\t\t} ),\n\t\t\t[ store, instanceId ]\n\t\t);\n\n\t\treturn (\n\t\t\t<TabsContext.Provider value={ contextValue }>\n\t\t\t\t{ children }\n\t\t\t</TabsContext.Provider>\n\t\t);\n\t},\n\t{\n\t\tTab: Object.assign( Tab, {\n\t\t\tdisplayName: 'Tabs.Tab',\n\t\t} ),\n\t\tTabList: Object.assign( TabList, {\n\t\t\tdisplayName: 'Tabs.TabList',\n\t\t} ),\n\t\tTabPanel: Object.assign( TabPanel, {\n\t\t\tdisplayName: 'Tabs.TabPanel',\n\t\t} ),\n\t\tContext: Object.assign( TabsContext, {\n\t\t\tdisplayName: 'Tabs.Context',\n\t\t} ),\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,OAAO,QAAQ,oBAAoB;AACvD,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;;AAEA,SAASC,WAAW,QAAQ,WAAW;AACvC,SAASC,GAAG,QAAQ,OAAO;AAC3B,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,Q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W,EAAE;EACd,CAAE,CAAC;EACHC,OAAO,EAAEpC,MAAM,CAACC,MAAM,CAAEd,WAAW,EAAE;IACpCgD,WAAW,EAAE;EACd,CAAE;AACH,CACD,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Ariakit","useInstanceId","useEffect","useMemo","isRTL","TabsContext","Tab","TabList","TabPanel","jsx","_jsx","externalToInternalTabId","externalId","instanceId","internalToExternalTabId","internalId","replace","Tabs","Object","assign","selectOnMove","defaultTabId","orientation","onSelect","children","selectedTabId","activeTabId","defaultActiveTabId","onActiveTabIdChange","store","useTabStore","defaultSelectedId","setSelectedId","newSelectedId","selectedId","defaultActiveId","setActiveId","newActiveId","activeId","rtl","items","useStoreState","requestAnimationFrame","focusedElement","element","ownerDocument","activeElement","some","item","id","contextValue","Provider","value","displayName","Context"],"sources":["@wordpress/components/src/tabs/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { TabsProps } from './types';\nimport { TabsContext } from './context';\nimport { Tab } from './tab';\nimport { TabList } from './tablist';\nimport { TabPanel } from './tabpanel';\n\nfunction externalToInternalTabId(\n\texternalId: string | undefined | null,\n\tinstanceId: string\n) {\n\treturn externalId && `${ instanceId }-${ externalId }`;\n}\n\nfunction internalToExternalTabId(\n\tinternalId: string | undefined | null,\n\tinstanceId: string\n) {\n\treturn typeof internalId === 'string'\n\t\t? internalId.replace( `${ instanceId }-`, '' )\n\t\t: internalId;\n}\n\n/**\n * Display one panel of content at a time with a tabbed interface, based on the\n * WAI-ARIA Tabs Pattern.\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/tabs/\n * ```\n */\nexport const Tabs = Object.assign(\n\tfunction Tabs( {\n\t\tselectOnMove = true,\n\t\tdefaultTabId,\n\t\torientation = 'horizontal',\n\t\tonSelect,\n\t\tchildren,\n\t\tselectedTabId,\n\t\tactiveTabId,\n\t\tdefaultActiveTabId,\n\t\tonActiveTabIdChange,\n\t}: TabsProps ) {\n\t\tconst instanceId = useInstanceId( Tabs, 'tabs' );\n\t\tconst store = Ariakit.useTabStore( {\n\t\t\tselectOnMove,\n\t\t\torientation,\n\t\t\tdefaultSelectedId: externalToInternalTabId(\n\t\t\t\tdefaultTabId,\n\t\t\t\tinstanceId\n\t\t\t),\n\t\t\tsetSelectedId: ( newSelectedId ) => {\n\t\t\t\tonSelect?.(\n\t\t\t\t\tinternalToExternalTabId( newSelectedId, instanceId )\n\t\t\t\t);\n\t\t\t},\n\t\t\tselectedId: externalToInternalTabId( selectedTabId, instanceId ),\n\t\t\tdefaultActiveId: externalToInternalTabId(\n\t\t\t\tdefaultActiveTabId,\n\t\t\t\tinstanceId\n\t\t\t),\n\t\t\tsetActiveId: ( newActiveId ) => {\n\t\t\t\tonActiveTabIdChange?.(\n\t\t\t\t\tinternalToExternalTabId( newActiveId, instanceId )\n\t\t\t\t);\n\t\t\t},\n\t\t\tactiveId: externalToInternalTabId( activeTabId, instanceId ),\n\t\t\trtl: isRTL(),\n\t\t} );\n\n\t\tconst { items, activeId } = Ariakit.useStoreState( store );\n\t\tconst { setActiveId } = store;\n\n\t\tuseEffect( () => {\n\t\t\trequestAnimationFrame( () => {\n\t\t\t\tconst focusedElement =\n\t\t\t\t\titems?.[ 0 ]?.element?.ownerDocument.activeElement;\n\n\t\t\t\tif (\n\t\t\t\t\t! focusedElement ||\n\t\t\t\t\t! items.some( ( item ) => focusedElement === item.element )\n\t\t\t\t) {\n\t\t\t\t\treturn; // Return early if no tabs are focused.\n\t\t\t\t}\n\n\t\t\t\t// If, after ariakit re-computes the active tab, that tab doesn't match\n\t\t\t\t// the currently focused tab, then we force an update to ariakit to avoid\n\t\t\t\t// any mismatches, especially when navigating to previous/next tab with\n\t\t\t\t// arrow keys.\n\t\t\t\tif ( activeId !== focusedElement.id ) {\n\t\t\t\t\tsetActiveId( focusedElement.id );\n\t\t\t\t}\n\t\t\t} );\n\t\t}, [ activeId, items, setActiveId ] );\n\n\t\tconst contextValue = useMemo(\n\t\t\t() => ( {\n\t\t\t\tstore,\n\t\t\t\tinstanceId,\n\t\t\t} ),\n\t\t\t[ store, instanceId ]\n\t\t);\n\n\t\treturn (\n\t\t\t<TabsContext.Provider value={ contextValue }>\n\t\t\t\t{ children }\n\t\t\t</TabsContext.Provider>\n\t\t);\n\t},\n\t{\n\t\tTab: Object.assign( Tab, {\n\t\t\tdisplayName: 'Tabs.Tab',\n\t\t} ),\n\t\tTabList: Object.assign( TabList, {\n\t\t\tdisplayName: 'Tabs.TabList',\n\t\t} ),\n\t\tTabPanel: Object.assign( TabPanel, {\n\t\t\tdisplayName: 'Tabs.TabPanel',\n\t\t} ),\n\t\tContext: Object.assign( TabsContext, {\n\t\t\tdisplayName: 'Tabs.Context',\n\t\t} ),\n\t}\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,OAAO,QAAQ,oBAAoB;AACvD,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;;AAEA,SAASC,WAAW,QAAQ,WAAW;AACvC,SAASC,GAAG,QAAQ,OAAO;AAC3B,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,QAAQ,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEtC,SAASC,uBAAuBA,CAC/BC,UAAqC,EACrCC,UAAkB,EACjB;EACD,OAAOD,UAAU,IAAI,GAAIC,UAAU,IAAMD,UAAU,EAAG;AACvD;AAEA,SAASE,uBAAuBA,CAC/BC,UAAqC,EACrCF,UAAkB,EACjB;EACD,OAAO,OAAOE,UAAU,KAAK,QAAQ,GAClCA,UAAU,CAACC,OAAO,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AK,GAAI,CAAC,CAAE,EAAEI,OAAO,EAAEC,aAAa,CAACC,aAAa;MAEnD,IACC,CAAEH,cAAc,IAChB,CAAEH,KAAK,CAACO,IAAI,CAAIC,IAAI,IAAML,cAAc,KAAKK,IAAI,CAACJ,OAAQ,CAAC,EAC1D;QACD,OAAO,CAAC;MACT;;MAEA;MACA;MACA;MACA;MACA,IAAKN,QAAQ,KAAKK,cAAc,CAACM,EAAE,EAAG;QACrCb,WAAW,CAAEO,cAAc,CAACM,EAAG,CAAC;MACjC;IACD,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEX,QAAQ,EAAEE,KAAK,EAAEJ,WAAW,CAAG,CAAC;EAErC,MAAMc,YAAY,GAAG/C,OAAO,CAC3B,OAAQ;IACP0B,KAAK;IACLhB;EACD,CAAC,CAAE,EACH,CAAEgB,KAAK,EAAEhB,UAAU,CACpB,CAAC;EAED,oBACCH,IAAA,CAACL,WAAW,CAAC8C,QAAQ;IAACC,KAAK,EAAGF,YAAc;IAAA1B,QAAA,EACzCA;EAAQ,CACW,CAAC;AAEzB,CAAC,EACD;EACClB,GAAG,EAAEY,MAAM,CAACC,MAAM,CAAEb,GAAG,EAAE;IACxB+C,WAAW,EAAE;EACd,CAAE,CAAC;EACH9C,OAAO,EAAEW,MAAM,CAACC,MAAM,CAAEZ,OAAO,EAAE;IAChC8C,WAAW,EAAE;EACd,CAAE,CAAC;EACH7C,QAAQ,EAAEU,MAAM,CAACC,MAAM,CAAEX,QAAQ,EAAE;IAClC6C,WAAW,EAAE;EACd,CAAE,CAAC;EACHC,OAAO,EAAEpC,MAAM,CAACC,MAAM,CAAEd,WAAW,EAAE;IACpCgD,WAAW,EAAE;EACd,CAAE;AACH,CACD,CAAC","ignoreList":[]}
|
package/build-module/tabs/tab.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import * as Ariakit from '@ariakit/react';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -30,15 +25,6 @@ export const Tab = forwardRef(function Tab({
|
|
|
30
25
|
store,
|
|
31
26
|
instanceId
|
|
32
27
|
} = (_useTabsContext = useTabsContext()) !== null && _useTabsContext !== void 0 ? _useTabsContext : {};
|
|
33
|
-
|
|
34
|
-
// If the active item is not connected, the tablist may end up in a state
|
|
35
|
-
// where none of the tabs are tabbable. In this case, we force all tabs to
|
|
36
|
-
// be tabbable, so that as soon as an item received focus, it becomes active
|
|
37
|
-
// and Tablist goes back to working as expected.
|
|
38
|
-
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
|
39
|
-
const tabbable = Ariakit.useStoreState(store, state => {
|
|
40
|
-
return state?.activeId !== null && !store?.item(state?.activeId)?.element?.isConnected;
|
|
41
|
-
});
|
|
42
28
|
if (!store) {
|
|
43
29
|
globalThis.SCRIPT_DEBUG === true ? warning('`Tabs.Tab` must be wrapped in a `Tabs` component.') : void 0;
|
|
44
30
|
return null;
|
|
@@ -50,7 +36,6 @@ export const Tab = forwardRef(function Tab({
|
|
|
50
36
|
id: instancedTabId,
|
|
51
37
|
disabled: disabled,
|
|
52
38
|
render: render,
|
|
53
|
-
tabbable: tabbable,
|
|
54
39
|
...otherProps,
|
|
55
40
|
children: [/*#__PURE__*/_jsx(StyledTabChildren, {
|
|
56
41
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["forwardRef","warning","useTabsContext","Tab","StyledTab","TabChildren","StyledTabChildren","TabChevron","StyledTabChevron","chevronRight","jsx","_jsx","jsxs","_jsxs","children","tabId","disabled","render","otherProps","ref","_useTabsContext","store","instanceId","globalThis","SCRIPT_DEBUG","instancedTabId","id","icon"],"sources":["@wordpress/components/src/tabs/tab.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { TabProps } from './types';\nimport warning from '@wordpress/warning';\nimport { useTabsContext } from './context';\nimport {\n\tTab as StyledTab,\n\tTabChildren as StyledTabChildren,\n\tTabChevron as StyledTabChevron,\n} from './styles';\nimport type { WordPressComponentProps } from '../context';\nimport { chevronRight } from '@wordpress/icons';\n\nexport const Tab = forwardRef<\n\tHTMLButtonElement,\n\tOmit< WordPressComponentProps< TabProps, 'button', false >, 'id' >\n>( function Tab( { children, tabId, disabled, render, ...otherProps }, ref ) {\n\tconst { store, instanceId } = useTabsContext() ?? {};\n\n\tif ( ! store ) {\n\t\twarning( '`Tabs.Tab` must be wrapped in a `Tabs` component.' );\n\t\treturn null;\n\t}\n\n\tconst instancedTabId = `${ instanceId }-${ tabId }`;\n\n\treturn (\n\t\t<StyledTab\n\t\t\tref={ ref }\n\t\t\tstore={ store }\n\t\t\tid={ instancedTabId }\n\t\t\tdisabled={ disabled }\n\t\t\trender={ render }\n\t\t\t{ ...otherProps }\n\t\t>\n\t\t\t<StyledTabChildren>{ children }</StyledTabChildren>\n\t\t\t<StyledTabChevron icon={ chevronRight } />\n\t\t</StyledTab>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAEA,OAAOC,OAAO,MAAM,oBAAoB;AACxC,SAASC,cAAc,QAAQ,WAAW;AAC1C,SACCC,GAAG,IAAIC,SAAS,EAChBC,WAAW,IAAIC,iBAAiB,EAChCC,UAAU,IAAIC,gBAAgB,QACxB,UAAU;AAEjB,SAASC,YAAY,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhD,OAAO,MAAMV,GAAG,GAAGH,UAAU,CAG1B,SAASG,GAAGA,CAAE;EAAEW,QAAQ;EAAEC,KAAK;EAAEC,QAAQ;EAAEC,MAAM;EAAE,GAAGC;AAAW,CAAC,EAAEC,GAAG,EAAG;EAAA,IAAAC,eAAA;EAC5E,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,IAAAF,eAAA,GAAGlB,cAAc,CAAC,CAAC,cAAAkB,eAAA,cAAAA,eAAA,GAAI,CAAC,CAAC;EAEpD,IAAK,CAAEC,KAAK,EAAG;IACdE,UAAA,CAAAC,YAAA,YAAAvB,OAAO,CAAE,mDAAoD,CAAC;IAC9D,OAAO,IAAI;EACZ;EAEA,MAAMwB,cAAc,GAAG,GAAIH,UAAU,IAAMP,KAAK,EAAG;EAEnD,oBACCF,KAAA,CAACT,SAAS;IACTe,GAAG,EAAGA,GAAK;IACXE,KAAK,EAAGA,KAAO;IACfK,EAAE,EAAGD,cAAgB;IACrBT,QAAQ,EAAGA,QAAU;IACrBC,MAAM,EAAGA,MAAQ;IAAA,GACZC,UAAU;IAAAJ,QAAA,gBAEfH,IAAA,CAACL,iBAAiB;MAAAQ,QAAA,EAAGA;IAAQ,CAAqB,CAAC,eACnDH,IAAA,CAACH,gBAAgB;MAACmB,IAAI,EAAGlB;IAAc,CAAE,CAAC;EAAA,CAChC,CAAC;AAEd,CAAE,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["memoize","findAll","createElement","lowercaseProps","object","mapped","key","toLowerCase","memoizedLowercaseProps","createHighlighterText","activeClassName","activeIndex","activeStyle","autoEscape","caseSensitive","children","findChunks","highlightClassName","highlightStyle","highlightTag","sanitize","searchWords","unhighlightClassName","unhighlightStyle","textToHighlight","chunks","HighlightTag","highlightIndex","highlightClassNames","highlightStyles","textContent","map","chunk","index","text","substr","start","end","highlight","highlightClass","isActive","Object","assign","props","className","style"],"sources":["@wordpress/components/src/text/utils.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport memoize from 'memize';\nimport type { FindAllArgs } from 'highlight-words-core';\nimport { findAll } from 'highlight-words-core';\n\n/**\n * WordPress dependencies\n */\nimport { createElement } from '@wordpress/element';\n\n/**\n * Source:\n * https://github.com/bvaughn/react-highlight-words/blob/HEAD/src/Highlighter.js\n */\n\n/**\n * @typedef Options\n * @property {string} [activeClassName=''] Classname for active highlighted areas.\n * @property {number} [activeIndex=-1] The index of the active highlighted area.\n * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [activeStyle] Styles to apply to the active highlighted area.\n * @property {boolean} [autoEscape] Whether to automatically escape text.\n * @property {boolean} [caseSensitive=false] Whether to highlight in a case-sensitive manner.\n * @property {string} children Children to highlight.\n * @property {import('highlight-words-core').FindAllArgs['findChunks']} [findChunks] Custom `findChunks` function to pass to `highlight-words-core`.\n * @property {string | Record<string, unknown>} [highlightClassName=''] Classname to apply to highlighted text or a Record of classnames to apply to given text (which should be the key).\n * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [highlightStyle={}] Styles to apply to highlighted text.\n * @property {keyof JSX.IntrinsicElements} [highlightTag='mark'] Tag to use for the highlighted text.\n * @property {import('highlight-words-core').FindAllArgs['sanitize']} [sanitize] Custom `santize` function to pass to `highlight-words-core`.\n * @property {string[]} [searchWords=[]] Words to search for and highlight.\n * @property {string} [unhighlightClassName=''] Classname to apply to unhighlighted text.\n * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [unhighlightStyle] Style to apply to unhighlighted text.\n */\n\ninterface Options {\n\tactiveClassName?: string;\n\tactiveIndex?: number;\n\tactiveStyle?: React.AllHTMLAttributes< HTMLDivElement >[ 'style' ];\n\tautoEscape?: boolean;\n\tcaseSensitive?: boolean;\n\tchildren: string;\n\tfindChunks?: FindAllArgs[ 'findChunks' ];\n\thighlightClassName?: string | Record< string, unknown >;\n\thighlightStyle?: React.AllHTMLAttributes< HTMLDivElement >[ 'style' ];\n\thighlightTag?: keyof JSX.IntrinsicElements;\n\tsanitize?: FindAllArgs[ 'sanitize' ];\n\tsearchWords?: string[];\n\tunhighlightClassName?: string;\n\tunhighlightStyle?: React.AllHTMLAttributes< HTMLDivElement >[ 'style' ];\n}\n\n/**\n * Maps props to lowercase names.\n *\n * @param object Props to map.\n * @return The mapped props.\n */\nconst lowercaseProps = < T extends Record< string, unknown > >( object: T ) => {\n\tconst mapped: Record< string, unknown > = {};\n\tfor ( const key in object ) {\n\t\tmapped[ key.toLowerCase() ] = object[ key ];\n\t}\n\treturn mapped as { [ K in keyof T as Lowercase< string & K > ]: T[ K ] };\n};\n\nconst memoizedLowercaseProps = memoize( lowercaseProps );\n\n/**\n * @param options\n * @param options.activeClassName\n * @param options.activeIndex\n * @param options.activeStyle\n * @param options.autoEscape\n * @param options.caseSensitive\n * @param options.children\n * @param options.findChunks\n * @param options.highlightClassName\n * @param options.highlightStyle\n * @param options.highlightTag\n * @param options.sanitize\n * @param options.searchWords\n * @param options.unhighlightClassName\n * @param options.unhighlightStyle\n */\nexport function createHighlighterText( {\n\tactiveClassName = '',\n\tactiveIndex = -1,\n\tactiveStyle,\n\tautoEscape,\n\tcaseSensitive = false,\n\tchildren,\n\tfindChunks,\n\thighlightClassName = '',\n\thighlightStyle = {},\n\thighlightTag = 'mark',\n\tsanitize,\n\tsearchWords = [],\n\tunhighlightClassName = '',\n\tunhighlightStyle,\n}: Options ) {\n\tif ( ! children ) {\n\t\treturn null;\n\t}\n\tif ( typeof children !== 'string' ) {\n\t\treturn children;\n\t}\n\n\tconst textToHighlight = children;\n\n\tconst chunks = findAll( {\n\t\tautoEscape,\n\t\tcaseSensitive,\n\t\tfindChunks,\n\t\tsanitize,\n\t\tsearchWords,\n\t\ttextToHighlight,\n\t} );\n\tconst HighlightTag = highlightTag;\n\tlet highlightIndex = -1;\n\tlet highlightClassNames = '';\n\tlet highlightStyles;\n\n\tconst textContent = chunks.map( ( chunk, index ) => {\n\t\tconst text = textToHighlight.substr(\n\t\t\tchunk.start,\n\t\t\tchunk.end - chunk.start\n\t\t);\n\n\t\tif ( chunk.highlight ) {\n\t\t\thighlightIndex++;\n\n\t\t\tlet highlightClass;\n\t\t\tif ( typeof highlightClassName === 'object' ) {\n\t\t\t\tif ( ! caseSensitive ) {\n\t\t\t\t\thighlightClassName =\n\t\t\t\t\t\tmemoizedLowercaseProps( highlightClassName );\n\t\t\t\t\thighlightClass = highlightClassName[ text.toLowerCase() ];\n\t\t\t\t} else {\n\t\t\t\t\thighlightClass = highlightClassName[ text ];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thighlightClass = highlightClassName;\n\t\t\t}\n\n\t\t\tconst isActive = highlightIndex === +activeIndex;\n\n\t\t\thighlightClassNames = `${ highlightClass } ${\n\t\t\t\tisActive ? activeClassName : ''\n\t\t\t}`;\n\t\t\thighlightStyles =\n\t\t\t\tisActive === true && activeStyle !== null\n\t\t\t\t\t? Object.assign( {}, highlightStyle, activeStyle )\n\t\t\t\t\t: highlightStyle;\n\n\t\t\tconst props: Record< string, unknown > = {\n\t\t\t\tchildren: text,\n\t\t\t\tclassName: highlightClassNames,\n\t\t\t\tkey: index,\n\t\t\t\tstyle: highlightStyles,\n\t\t\t};\n\n\t\t\t// Don't attach arbitrary props to DOM elements; this triggers React DEV warnings (https://fb.me/react-unknown-prop)\n\t\t\t// Only pass through the highlightIndex attribute for custom components.\n\t\t\tif ( typeof HighlightTag !== 'string' ) {\n\t\t\t\tprops.highlightIndex = highlightIndex;\n\t\t\t}\n\n\t\t\treturn createElement( HighlightTag, props );\n\t\t}\n\t\treturn createElement( 'span', {\n\t\t\tchildren: text,\n\t\t\tclassName: unhighlightClassName,\n\t\t\tkey: index,\n\t\t\tstyle: unhighlightStyle,\n\t\t} );\n\t} );\n\n\treturn textContent;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,OAAO,MAAM,QAAQ;AAE5B,SAASC,OAAO,QAAQ,sBAAsB;;AAE9C;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAA4CC,MAAS,IAAM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Y,KAAK,EAAEtB;IACR,CAAE,CAAC;EACJ,CAAE,CAAC;EAEH,OAAOO,WAAW;AACnB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["memoize","findAll","createElement","lowercaseProps","object","mapped","key","toLowerCase","memoizedLowercaseProps","createHighlighterText","activeClassName","activeIndex","activeStyle","autoEscape","caseSensitive","children","findChunks","highlightClassName","highlightStyle","highlightTag","sanitize","searchWords","unhighlightClassName","unhighlightStyle","textToHighlight","chunks","HighlightTag","highlightIndex","highlightClassNames","highlightStyles","textContent","map","chunk","index","text","substr","start","end","highlight","highlightClass","isActive","Object","assign","props","className","style"],"sources":["@wordpress/components/src/text/utils.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport memoize from 'memize';\nimport type { FindAllArgs } from 'highlight-words-core';\nimport { findAll } from 'highlight-words-core';\n\n/**\n * WordPress dependencies\n */\nimport { createElement } from '@wordpress/element';\n\n/**\n * Source:\n * https://github.com/bvaughn/react-highlight-words/blob/HEAD/src/Highlighter.js\n */\n\n/**\n * @typedef Options\n * @property {string} [activeClassName=''] Classname for active highlighted areas.\n * @property {number} [activeIndex=-1] The index of the active highlighted area.\n * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [activeStyle] Styles to apply to the active highlighted area.\n * @property {boolean} [autoEscape] Whether to automatically escape text.\n * @property {boolean} [caseSensitive=false] Whether to highlight in a case-sensitive manner.\n * @property {string} children Children to highlight.\n * @property {import('highlight-words-core').FindAllArgs['findChunks']} [findChunks] Custom `findChunks` function to pass to `highlight-words-core`.\n * @property {string | Record<string, unknown>} [highlightClassName=''] Classname to apply to highlighted text or a Record of classnames to apply to given text (which should be the key).\n * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [highlightStyle={}] Styles to apply to highlighted text.\n * @property {keyof JSX.IntrinsicElements} [highlightTag='mark'] Tag to use for the highlighted text.\n * @property {import('highlight-words-core').FindAllArgs['sanitize']} [sanitize] Custom `santize` function to pass to `highlight-words-core`.\n * @property {string[]} [searchWords=[]] Words to search for and highlight.\n * @property {string} [unhighlightClassName=''] Classname to apply to unhighlighted text.\n * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [unhighlightStyle] Style to apply to unhighlighted text.\n */\n\ninterface Options {\n\tactiveClassName?: string;\n\tactiveIndex?: number;\n\tactiveStyle?: React.AllHTMLAttributes< HTMLDivElement >[ 'style' ];\n\tautoEscape?: boolean;\n\tcaseSensitive?: boolean;\n\tchildren: string;\n\tfindChunks?: FindAllArgs[ 'findChunks' ];\n\thighlightClassName?: string | Record< string, unknown >;\n\thighlightStyle?: React.AllHTMLAttributes< HTMLDivElement >[ 'style' ];\n\thighlightTag?: keyof JSX.IntrinsicElements;\n\tsanitize?: FindAllArgs[ 'sanitize' ];\n\tsearchWords?: string[];\n\tunhighlightClassName?: string;\n\tunhighlightStyle?: React.AllHTMLAttributes< HTMLDivElement >[ 'style' ];\n}\n\n/**\n * Maps props to lowercase names.\n *\n * @param object Props to map.\n * @return The mapped props.\n */\nconst lowercaseProps = < T extends Record< string, unknown > >( object: T ) => {\n\tconst mapped: Record< string, unknown > = {};\n\tfor ( const key in object ) {\n\t\tmapped[ key.toLowerCase() ] = object[ key ];\n\t}\n\treturn mapped as { [ K in keyof T as Lowercase< string & K > ]: T[ K ] };\n};\n\nconst memoizedLowercaseProps = memoize( lowercaseProps );\n\n/**\n * @param options\n * @param options.activeClassName\n * @param options.activeIndex\n * @param options.activeStyle\n * @param options.autoEscape\n * @param options.caseSensitive\n * @param options.children\n * @param options.findChunks\n * @param options.highlightClassName\n * @param options.highlightStyle\n * @param options.highlightTag\n * @param options.sanitize\n * @param options.searchWords\n * @param options.unhighlightClassName\n * @param options.unhighlightStyle\n */\nexport function createHighlighterText( {\n\tactiveClassName = '',\n\tactiveIndex = -1,\n\tactiveStyle,\n\tautoEscape,\n\tcaseSensitive = false,\n\tchildren,\n\tfindChunks,\n\thighlightClassName = '',\n\thighlightStyle = {},\n\thighlightTag = 'mark',\n\tsanitize,\n\tsearchWords = [],\n\tunhighlightClassName = '',\n\tunhighlightStyle,\n}: Options ) {\n\tif ( ! children ) {\n\t\treturn null;\n\t}\n\tif ( typeof children !== 'string' ) {\n\t\treturn children;\n\t}\n\n\tconst textToHighlight = children;\n\n\tconst chunks = findAll( {\n\t\tautoEscape,\n\t\tcaseSensitive,\n\t\tfindChunks,\n\t\tsanitize,\n\t\tsearchWords,\n\t\ttextToHighlight,\n\t} );\n\tconst HighlightTag = highlightTag;\n\tlet highlightIndex = -1;\n\tlet highlightClassNames = '';\n\tlet highlightStyles;\n\n\tconst textContent = chunks.map( ( chunk, index ) => {\n\t\tconst text = textToHighlight.substr(\n\t\t\tchunk.start,\n\t\t\tchunk.end - chunk.start\n\t\t);\n\n\t\tif ( chunk.highlight ) {\n\t\t\thighlightIndex++;\n\n\t\t\tlet highlightClass;\n\t\t\tif ( typeof highlightClassName === 'object' ) {\n\t\t\t\tif ( ! caseSensitive ) {\n\t\t\t\t\thighlightClassName =\n\t\t\t\t\t\tmemoizedLowercaseProps( highlightClassName );\n\t\t\t\t\thighlightClass = highlightClassName[ text.toLowerCase() ];\n\t\t\t\t} else {\n\t\t\t\t\thighlightClass = highlightClassName[ text ];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thighlightClass = highlightClassName;\n\t\t\t}\n\n\t\t\tconst isActive = highlightIndex === +activeIndex;\n\n\t\t\thighlightClassNames = `${ highlightClass } ${\n\t\t\t\tisActive ? activeClassName : ''\n\t\t\t}`;\n\t\t\thighlightStyles =\n\t\t\t\tisActive === true && activeStyle !== null\n\t\t\t\t\t? Object.assign( {}, highlightStyle, activeStyle )\n\t\t\t\t\t: highlightStyle;\n\n\t\t\tconst props: Record< string, unknown > = {\n\t\t\t\tchildren: text,\n\t\t\t\tclassName: highlightClassNames,\n\t\t\t\tkey: index,\n\t\t\t\tstyle: highlightStyles,\n\t\t\t};\n\n\t\t\t// Don't attach arbitrary props to DOM elements; this triggers React DEV warnings (https://fb.me/react-unknown-prop)\n\t\t\t// Only pass through the highlightIndex attribute for custom components.\n\t\t\tif ( typeof HighlightTag !== 'string' ) {\n\t\t\t\tprops.highlightIndex = highlightIndex;\n\t\t\t}\n\n\t\t\treturn createElement( HighlightTag, props );\n\t\t}\n\t\treturn createElement( 'span', {\n\t\t\tchildren: text,\n\t\t\tclassName: unhighlightClassName,\n\t\t\tkey: index,\n\t\t\tstyle: unhighlightStyle,\n\t\t} );\n\t} );\n\n\treturn textContent;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,OAAO,MAAM,QAAQ;AAE5B,SAASC,OAAO,QAAQ,sBAAsB;;AAE9C;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAA4CC,MAAS,IAAM;EAC9E,MAAMC,MAAiC,GAAG,CAAC,CAAC;EAC5C,KAAM,MAAMC,GAAG,IAAIF,MAAM,EAAG;IAC3BC,MAAM,CAAEC,GAAG,CAACC,WAAW,CAAC,CAAC,CAAE,GAAGH,MAAM,CAAEE,GAAG,CAAE;EAC5C;EACA,OAAOD,MAAM;AACd,CAAC;AAED,MAAMG,sBAAsB,GAAGR,OAAO,CAAEG,cAAe,CAAC;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,qBAAqBA,CAAE;EACtCC,eAAe,GAAG,EAAE;EACpBC,WAAW,GAAG,CAAC,CAAC;EAChBC,WAAW;EACXC,UAAU;EACVC,aAAa,GAAG,KAAK;EACrBC,QAAQ;EACRC,UAAU;EACVC,kBAAkB,GAAG,EAAE;EACvBC,cAAc,GAAG,CAAC,CAAC;EACnBC,YAAY,GAAG,MAAM;EACrBC,QAAQ;EACRC,WAAW,GA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