@wordpress/components 25.6.1 → 26.0.1-next.5a1d1283.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 +21 -1
- package/CONTRIBUTING.md +1 -1
- package/README.md +3 -8
- package/build/color-picker/hsv-color-picker.native.js +92 -0
- package/build/color-picker/hsv-color-picker.native.js.map +1 -0
- package/build/color-picker/hue-picker.native.js +195 -0
- package/build/color-picker/hue-picker.native.js.map +1 -0
- package/build/color-picker/index.native.js +3 -2
- package/build/color-picker/index.native.js.map +1 -1
- package/build/color-picker/saturation-picker.native.js +178 -0
- package/build/color-picker/saturation-picker.native.js.map +1 -0
- package/build/item-group/item/component.js +0 -1
- package/build/item-group/item/component.js.map +1 -1
- package/build/item-group/item-group/component.js +0 -1
- package/build/item-group/item-group/component.js.map +1 -1
- package/build/menu-item/index.js +6 -4
- package/build/menu-item/index.js.map +1 -1
- package/build/menu-item/types.js.map +1 -1
- package/build/mobile/link-settings/link-settings-navigation.native.js +1 -1
- package/build/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
- package/build/navigation/index.js +0 -1
- package/build/navigation/index.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +1 -2
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/palette-edit/styles.js +10 -10
- package/build/palette-edit/styles.js.map +1 -1
- package/build/popover/index.js +38 -75
- package/build/popover/index.js.map +1 -1
- package/build/popover/overlay-middlewares.js.map +1 -1
- package/build/popover/types.js.map +1 -1
- package/build/popover/utils.js +5 -50
- package/build/popover/utils.js.map +1 -1
- package/build/progress-bar/styles.js +6 -5
- package/build/progress-bar/styles.js.map +1 -1
- package/build/search-control/index.native.js +27 -24
- package/build/search-control/index.native.js.map +1 -1
- package/build/shortcut/index.js +13 -0
- package/build/shortcut/index.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-context.js +3 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot.js +14 -8
- package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build/slot-fill/index.js +5 -0
- package/build/slot-fill/index.js.map +1 -1
- package/build/spinner/index.js +0 -1
- package/build/spinner/index.js.map +1 -1
- package/build/theme/index.js +0 -1
- package/build/theme/index.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js +0 -1
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +5 -1
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tree-select/index.js +0 -1
- package/build/tree-select/index.js.map +1 -1
- package/build/unit-control/index.js +0 -1
- package/build/unit-control/index.js.map +1 -1
- package/build/utils/hooks/use-cx.js +2 -1
- package/build/utils/hooks/use-cx.js.map +1 -1
- package/build/view/component.js +1 -2
- package/build/view/component.js.map +1 -1
- package/build-module/color-picker/hsv-color-picker.native.js +84 -0
- package/build-module/color-picker/hsv-color-picker.native.js.map +1 -0
- package/build-module/color-picker/hue-picker.native.js +185 -0
- package/build-module/color-picker/hue-picker.native.js.map +1 -0
- package/build-module/color-picker/index.native.js +2 -1
- package/build-module/color-picker/index.native.js.map +1 -1
- package/build-module/color-picker/saturation-picker.native.js +168 -0
- package/build-module/color-picker/saturation-picker.native.js.map +1 -0
- package/build-module/item-group/item/component.js +0 -1
- package/build-module/item-group/item/component.js.map +1 -1
- package/build-module/item-group/item-group/component.js +0 -1
- package/build-module/item-group/item-group/component.js.map +1 -1
- package/build-module/menu-item/index.js +4 -2
- package/build-module/menu-item/index.js.map +1 -1
- package/build-module/menu-item/types.js.map +1 -1
- package/build-module/mobile/link-settings/link-settings-navigation.native.js +1 -1
- package/build-module/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
- package/build-module/navigation/index.js +0 -1
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +1 -2
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/palette-edit/styles.js +10 -10
- package/build-module/palette-edit/styles.js.map +1 -1
- package/build-module/popover/index.js +42 -79
- package/build-module/popover/index.js.map +1 -1
- package/build-module/popover/overlay-middlewares.js.map +1 -1
- package/build-module/popover/types.js.map +1 -1
- package/build-module/popover/utils.js +4 -47
- package/build-module/popover/utils.js.map +1 -1
- package/build-module/progress-bar/styles.js +6 -5
- package/build-module/progress-bar/styles.js.map +1 -1
- package/build-module/search-control/index.native.js +28 -25
- package/build-module/search-control/index.native.js.map +1 -1
- package/build-module/shortcut/index.js +13 -0
- package/build-module/shortcut/index.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js +3 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot.js +14 -8
- package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build-module/slot-fill/index.js +6 -1
- package/build-module/slot-fill/index.js.map +1 -1
- package/build-module/spinner/index.js +0 -1
- package/build-module/spinner/index.js.map +1 -1
- package/build-module/theme/index.js +0 -1
- package/build-module/theme/index.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +0 -1
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +5 -1
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tree-select/index.js +0 -1
- package/build-module/tree-select/index.js.map +1 -1
- package/build-module/unit-control/index.js +0 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/utils/hooks/use-cx.js +2 -1
- package/build-module/utils/hooks/use-cx.js.map +1 -1
- package/build-module/view/component.js +1 -2
- package/build-module/view/component.js.map +1 -1
- package/build-types/alignment-matrix-control/stories/index.story.d.ts +2 -2
- package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
- package/build-types/angle-picker-control/stories/index.story.d.ts +2 -2
- package/build-types/angle-picker-control/stories/index.story.d.ts.map +1 -1
- package/build-types/animate/stories/index.story.d.ts +9 -9
- package/build-types/animate/stories/index.story.d.ts.map +1 -1
- package/build-types/base-control/stories/index.story.d.ts +4 -4
- package/build-types/base-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-box-control/stories/index.story.d.ts +2 -2
- package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-control/stories/index.story.d.ts +2 -2
- package/build-types/border-control/stories/index.story.d.ts.map +1 -1
- package/build-types/button/stories/e2e/index.story.d.ts +3 -3
- package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts +10 -9
- package/build-types/button/stories/index.story.d.ts.map +1 -1
- package/build-types/button-group/stories/index.story.d.ts +3 -3
- package/build-types/button-group/stories/index.story.d.ts.map +1 -1
- package/build-types/card/stories/index.story.d.ts +2 -2
- package/build-types/card/stories/index.story.d.ts.map +1 -1
- package/build-types/checkbox-control/stories/index.story.d.ts +4 -4
- package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/circular-option-picker/stories/index.story.d.ts +2 -2
- package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/color-indicator/stories/index.story.d.ts +3 -3
- package/build-types/color-indicator/stories/index.story.d.ts.map +1 -1
- package/build-types/color-palette/stories/index.story.d.ts +3 -3
- package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +1 -1
- package/build-types/color-picker/stories/index.story.d.ts +2 -2
- package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts +2 -2
- package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/stories/index.story.d.ts +2 -2
- package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +1 -1
- package/build-types/date-time/stories/date-time.story.d.ts +5 -5
- package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
- package/build-types/date-time/stories/date.story.d.ts +5 -5
- package/build-types/date-time/stories/date.story.d.ts.map +1 -1
- package/build-types/date-time/stories/time.story.d.ts +3 -3
- package/build-types/date-time/stories/time.story.d.ts.map +1 -1
- package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
- package/build-types/disabled/stories/index.story.d.ts +4 -4
- package/build-types/disabled/stories/index.story.d.ts.map +1 -1
- package/build-types/divider/stories/index.story.d.ts +5 -5
- package/build-types/divider/stories/index.story.d.ts.map +1 -1
- package/build-types/draggable/stories/index.story.d.ts +4 -4
- package/build-types/draggable/stories/index.story.d.ts.map +1 -1
- package/build-types/drop-zone/stories/index.story.d.ts +2 -2
- package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown/stories/index.story.d.ts +6 -5
- package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu/stories/index.story.d.ts +2 -2
- package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts +2 -2
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
- package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +2 -2
- package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +1 -1
- package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +2 -2
- package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
- package/build-types/elevation/stories/index.story.d.ts +5 -5
- package/build-types/elevation/stories/index.story.d.ts.map +1 -1
- package/build-types/external-link/stories/index.story.d.ts +3 -3
- package/build-types/external-link/stories/index.story.d.ts.map +1 -1
- package/build-types/flex/stories/index.story.d.ts +4 -4
- package/build-types/flex/stories/index.story.d.ts.map +1 -1
- package/build-types/focal-point-picker/stories/index.story.d.ts +2 -2
- package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/font-size-picker/stories/e2e/index.story.d.ts +2 -2
- package/build-types/font-size-picker/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/font-size-picker/stories/index.story.d.ts +8 -8
- package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/form-file-upload/stories/index.story.d.ts +2 -2
- package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
- package/build-types/form-toggle/stories/index.story.d.ts +3 -3
- package/build-types/form-toggle/stories/index.story.d.ts.map +1 -1
- package/build-types/form-token-field/stories/index.story.d.ts +7 -7
- package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
- package/build-types/gradient-picker/stories/index.story.d.ts +2 -2
- package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/grid/stories/index.story.d.ts +3 -3
- package/build-types/grid/stories/index.story.d.ts.map +1 -1
- package/build-types/guide/stories/index.story.d.ts +2 -2
- package/build-types/guide/stories/index.story.d.ts.map +1 -1
- package/build-types/h-stack/stories/e2e/index.story.d.ts +3 -3
- package/build-types/h-stack/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/h-stack/stories/index.story.d.ts +3 -3
- package/build-types/h-stack/stories/index.story.d.ts.map +1 -1
- package/build-types/heading/stories/index.story.d.ts +3 -3
- package/build-types/heading/stories/index.story.d.ts.map +1 -1
- package/build-types/icon/stories/index.story.d.ts +4 -4
- package/build-types/icon/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/stories/index.story.d.ts +2 -2
- package/build-types/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/item-group/item/component.d.ts +0 -1
- package/build-types/item-group/item/component.d.ts.map +1 -1
- package/build-types/item-group/item-group/component.d.ts +0 -1
- package/build-types/item-group/item-group/component.d.ts.map +1 -1
- package/build-types/item-group/stories/index.story.d.ts +6 -6
- package/build-types/item-group/stories/index.story.d.ts.map +1 -1
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts +2 -2
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-group/stories/index.story.d.ts +3 -3
- package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-item/index.d.ts +5 -58
- package/build-types/menu-item/index.d.ts.map +1 -1
- package/build-types/menu-item/stories/index.story.d.ts +74 -0
- package/build-types/menu-item/stories/index.story.d.ts.map +1 -0
- package/build-types/menu-item/types.d.ts +3 -2
- package/build-types/menu-item/types.d.ts.map +1 -1
- package/build-types/menu-items-choice/stories/index.story.d.ts +3 -3
- package/build-types/menu-items-choice/stories/index.story.d.ts.map +1 -1
- package/build-types/modal/stories/index.story.d.ts +4 -4
- package/build-types/modal/stories/index.story.d.ts.map +1 -1
- package/build-types/navigable-container/stories/navigable-menu.story.d.ts +3 -3
- package/build-types/navigable-container/stories/navigable-menu.story.d.ts.map +1 -1
- package/build-types/navigable-container/stories/tabbable-container.story.d.ts +3 -3
- package/build-types/navigable-container/stories/tabbable-container.story.d.ts.map +1 -1
- package/build-types/navigation/index.d.ts +0 -1
- package/build-types/navigation/index.d.ts.map +1 -1
- package/build-types/navigation/stories/index.story.d.ts +2 -2
- package/build-types/navigation/stories/index.story.d.ts.map +1 -1
- package/build-types/navigation/stories/utils/controlled-state.d.ts +2 -2
- package/build-types/navigation/stories/utils/controlled-state.d.ts.map +1 -1
- package/build-types/navigation/stories/utils/default.d.ts +2 -2
- package/build-types/navigation/stories/utils/default.d.ts.map +1 -1
- package/build-types/navigation/stories/utils/group.d.ts +2 -2
- package/build-types/navigation/stories/utils/group.d.ts.map +1 -1
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts +2 -2
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -1
- package/build-types/navigation/stories/utils/more-examples.d.ts +2 -2
- package/build-types/navigation/stories/utils/more-examples.d.ts.map +1 -1
- package/build-types/navigation/stories/utils/search.d.ts +2 -2
- package/build-types/navigation/stories/utils/search.d.ts.map +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts +0 -1
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/stories/index.story.d.ts +5 -5
- package/build-types/navigator/stories/index.story.d.ts.map +1 -1
- package/build-types/notice/stories/index.story.d.ts +3 -3
- package/build-types/notice/stories/index.story.d.ts.map +1 -1
- package/build-types/number-control/stories/index.story.d.ts +2 -2
- package/build-types/number-control/stories/index.story.d.ts.map +1 -1
- package/build-types/palette-edit/stories/index.story.d.ts +2 -2
- package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
- package/build-types/palette-edit/styles.d.ts +1 -1
- package/build-types/palette-edit/styles.d.ts.map +1 -1
- package/build-types/panel/stories/index.story.d.ts +6 -6
- package/build-types/panel/stories/index.story.d.ts.map +1 -1
- package/build-types/placeholder/stories/index.story.d.ts +3 -3
- package/build-types/placeholder/stories/index.story.d.ts.map +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/overlay-middlewares.d.ts +2 -2
- package/build-types/popover/overlay-middlewares.d.ts.map +1 -1
- package/build-types/popover/stories/index.story.d.ts +7 -7
- package/build-types/popover/stories/index.story.d.ts.map +1 -1
- package/build-types/popover/types.d.ts +6 -0
- package/build-types/popover/types.d.ts.map +1 -1
- package/build-types/popover/utils.d.ts +1 -21
- package/build-types/popover/utils.d.ts.map +1 -1
- package/build-types/progress-bar/stories/index.story.d.ts +3 -3
- package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
- package/build-types/progress-bar/styles.d.ts.map +1 -1
- package/build-types/query-controls/stories/index.story.d.ts +4 -4
- package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
- package/build-types/radio-control/stories/index.story.d.ts +3 -3
- package/build-types/radio-control/stories/index.story.d.ts.map +1 -1
- package/build-types/range-control/stories/index.story.d.ts +9 -9
- package/build-types/range-control/stories/index.story.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.story.d.ts +2 -2
- package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
- package/build-types/responsive-wrapper/stories/index.story.d.ts +3 -3
- package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
- package/build-types/sandbox/stories/index.story.d.ts +2 -2
- package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
- package/build-types/scroll-lock/stories/index.story.d.ts +3 -3
- package/build-types/scroll-lock/stories/index.story.d.ts.map +1 -1
- package/build-types/scrollable/stories/index.story.d.ts +3 -3
- package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
- package/build-types/search-control/stories/index.story.d.ts +2 -2
- package/build-types/search-control/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/stories/index.story.d.ts +2 -2
- package/build-types/select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/shortcut/index.d.ts +13 -0
- package/build-types/shortcut/index.d.ts.map +1 -1
- package/build-types/shortcut/stories/index.story.d.ts +13 -0
- package/build-types/shortcut/stories/index.story.d.ts.map +1 -0
- package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts +1 -0
- package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -6
- package/build-types/slot-fill/index.d.ts +1 -1
- package/build-types/slot-fill/index.d.ts.map +1 -1
- package/build-types/snackbar/stories/index.story.d.ts +7 -7
- package/build-types/snackbar/stories/index.story.d.ts.map +1 -1
- package/build-types/snackbar/stories/list.story.d.ts +3 -3
- package/build-types/snackbar/stories/list.story.d.ts.map +1 -1
- package/build-types/spacer/stories/index.story.d.ts +3 -3
- package/build-types/spacer/stories/index.story.d.ts.map +1 -1
- package/build-types/spinner/index.d.ts +0 -1
- package/build-types/spinner/index.d.ts.map +1 -1
- package/build-types/spinner/stories/index.story.d.ts +4 -4
- package/build-types/spinner/stories/index.story.d.ts.map +1 -1
- package/build-types/surface/stories/index.story.d.ts +3 -3
- package/build-types/surface/stories/index.story.d.ts.map +1 -1
- package/build-types/tab-panel/stories/index.story.d.ts +2 -2
- package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/text-control/stories/index.story.d.ts +4 -4
- package/build-types/text-control/stories/index.story.d.ts.map +1 -1
- package/build-types/text-highlight/stories/index.story.d.ts +3 -3
- package/build-types/text-highlight/stories/index.story.d.ts.map +1 -1
- package/build-types/textarea-control/stories/index.story.d.ts +3 -3
- package/build-types/textarea-control/stories/index.story.d.ts.map +1 -1
- package/build-types/theme/index.d.ts +0 -1
- package/build-types/theme/index.d.ts.map +1 -1
- package/build-types/theme/stories/index.story.d.ts +4 -4
- package/build-types/theme/stories/index.story.d.ts.map +1 -1
- package/build-types/tip/stories/index.story.d.ts +3 -3
- package/build-types/tip/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-control/stories/index.story.d.ts +2 -2
- package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-group-control/stories/index.story.d.ts +6 -6
- package/build-types/toggle-group-control/stories/index.story.d.ts.map +1 -1
- package/build-types/toolbar/stories/index.story.d.ts +2 -2
- package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
- package/build-types/tools-panel/stories/index.story.d.ts +8 -8
- package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/component.d.ts +0 -1
- package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts +2 -2
- package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-select/index.d.ts +0 -1
- package/build-types/tree-select/index.d.ts.map +1 -1
- package/build-types/tree-select/stories/index.story.d.ts +2 -2
- package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
- package/build-types/truncate/stories/index.story.d.ts +4 -4
- package/build-types/truncate/stories/index.story.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +0 -1
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/stories/index.story.d.ts +7 -7
- package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
- package/build-types/utils/hooks/use-cx.d.ts +2 -1
- package/build-types/utils/hooks/use-cx.d.ts.map +1 -1
- package/build-types/v-stack/stories/e2e/index.story.d.ts +3 -3
- package/build-types/v-stack/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/v-stack/stories/index.story.d.ts +2 -2
- package/build-types/v-stack/stories/index.story.d.ts.map +1 -1
- package/build-types/view/component.d.ts +0 -1
- package/build-types/view/component.d.ts.map +1 -1
- package/build-types/view/stories/index.story.d.ts +3 -3
- package/build-types/view/stories/index.story.d.ts.map +1 -1
- package/build-types/visually-hidden/stories/index.story.d.ts +5 -5
- package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
- package/build-types/z-stack/stories/index.story.d.ts +3 -3
- package/build-types/z-stack/stories/index.story.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/alignment-matrix-control/stories/index.story.tsx +7 -3
- package/src/angle-picker-control/stories/index.story.tsx +3 -3
- package/src/animate/stories/index.story.tsx +12 -10
- package/src/base-control/stories/index.story.tsx +5 -9
- package/src/border-box-control/stories/index.story.tsx +5 -9
- package/src/border-control/stories/index.story.tsx +8 -14
- package/src/button/stories/e2e/index.story.tsx +3 -3
- package/src/button/stories/index.story.tsx +10 -10
- package/src/button-group/stories/index.story.tsx +4 -6
- package/src/card/stories/index.story.tsx +5 -5
- package/src/checkbox-control/stories/index.story.tsx +7 -6
- package/src/circular-option-picker/stories/index.story.tsx +16 -4
- package/src/color-indicator/stories/index.story.tsx +4 -6
- package/src/color-palette/stories/index.story.tsx +12 -21
- package/src/color-picker/hsv-color-picker.native.js +88 -0
- package/src/color-picker/hue-picker.native.js +194 -0
- package/src/color-picker/index.native.js +2 -1
- package/src/color-picker/saturation-picker.native.js +163 -0
- package/src/color-picker/stories/index.story.tsx +3 -3
- package/src/color-picker/style.native.scss +23 -0
- package/src/combobox-control/stories/index.story.tsx +3 -3
- package/src/custom-gradient-picker/stories/index.story.tsx +3 -3
- package/src/date-time/stories/date-time.story.tsx +8 -10
- package/src/date-time/stories/date.story.tsx +8 -9
- package/src/date-time/stories/time.story.tsx +4 -4
- package/src/dimension-control/stories/index.story.tsx +3 -3
- package/src/disabled/stories/index.story.tsx +4 -4
- package/src/divider/stories/index.story.tsx +6 -6
- package/src/draggable/stories/index.story.tsx +5 -7
- package/src/drop-zone/stories/index.story.tsx +3 -3
- package/src/dropdown/stories/index.story.tsx +8 -6
- package/src/dropdown-menu/stories/index.story.tsx +3 -3
- package/src/dropdown-menu-v2/stories/index.story.tsx +24 -10
- package/src/duotone-picker/stories/duotone-picker.story.tsx +3 -6
- package/src/duotone-picker/stories/duotone-swatch.story.tsx +3 -3
- package/src/elevation/stories/index.story.tsx +7 -7
- package/src/external-link/stories/index.story.tsx +4 -6
- package/src/flex/stories/index.story.tsx +6 -6
- package/src/focal-point-picker/stories/index.story.tsx +3 -3
- package/src/font-size-picker/stories/e2e/index.story.tsx +3 -3
- package/src/font-size-picker/stories/index.story.tsx +10 -10
- package/src/form-file-upload/stories/index.story.tsx +3 -3
- package/src/form-toggle/stories/index.story.tsx +4 -7
- package/src/form-token-field/stories/index.story.tsx +10 -11
- package/src/gradient-picker/stories/index.story.tsx +3 -3
- package/src/grid/stories/index.story.tsx +4 -4
- package/src/guide/stories/index.story.tsx +3 -3
- package/src/h-stack/stories/e2e/index.story.tsx +4 -4
- package/src/h-stack/stories/index.story.tsx +4 -4
- package/src/heading/stories/index.story.tsx +3 -3
- package/src/icon/stories/index.story.tsx +5 -5
- package/src/input-control/stories/index.story.tsx +5 -3
- package/src/item-group/item/component.tsx +0 -1
- package/src/item-group/item-group/component.tsx +0 -1
- package/src/item-group/stories/index.story.tsx +11 -12
- package/src/keyboard-shortcuts/stories/index.story.tsx +3 -3
- package/src/menu-group/stories/index.story.tsx +5 -5
- package/src/menu-item/README.md +1 -1
- package/src/menu-item/index.tsx +5 -2
- package/src/menu-item/stories/index.story.tsx +80 -0
- package/src/menu-item/types.ts +3 -2
- package/src/menu-items-choice/stories/index.story.tsx +4 -6
- package/src/mobile/link-settings/link-settings-navigation.native.js +1 -1
- package/src/modal/stories/index.story.tsx +5 -10
- package/src/navigable-container/stories/navigable-menu.story.tsx +3 -3
- package/src/navigable-container/stories/tabbable-container.story.tsx +3 -3
- package/src/navigation/index.tsx +0 -1
- package/src/navigation/stories/index.story.tsx +16 -2
- package/src/navigation/stories/utils/controlled-state.tsx +2 -2
- package/src/navigation/stories/utils/default.tsx +2 -2
- package/src/navigation/stories/utils/group.tsx +2 -2
- package/src/navigation/stories/utils/hide-if-empty.tsx +2 -2
- package/src/navigation/stories/utils/more-examples.tsx +2 -2
- package/src/navigation/stories/utils/search.tsx +2 -2
- package/src/navigator/navigator-provider/component.tsx +0 -1
- package/src/navigator/stories/index.story.tsx +9 -10
- package/src/notice/stories/index.story.tsx +6 -6
- package/src/number-control/stories/index.story.tsx +3 -3
- package/src/palette-edit/stories/index.story.tsx +3 -3
- package/src/palette-edit/styles.js +0 -1
- package/src/panel/stories/index.story.tsx +9 -11
- package/src/placeholder/stories/index.story.tsx +4 -6
- package/src/popover/README.md +2 -2
- package/src/popover/index.tsx +69 -103
- package/src/popover/overlay-middlewares.tsx +2 -2
- package/src/popover/stories/index.story.tsx +8 -10
- package/src/popover/test/index.tsx +15 -1
- package/src/popover/types.ts +6 -0
- package/src/popover/utils.ts +5 -56
- package/src/progress-bar/stories/index.story.tsx +4 -6
- package/src/progress-bar/styles.ts +4 -1
- package/src/query-controls/stories/index.story.tsx +5 -6
- package/src/radio-control/stories/index.story.tsx +4 -6
- package/src/radio-group/stories/index.story.js +1 -0
- package/src/range-control/stories/index.story.tsx +12 -18
- package/src/resizable-box/stories/index.story.tsx +3 -3
- package/src/responsive-wrapper/stories/index.story.tsx +4 -5
- package/src/sandbox/stories/index.story.tsx +3 -5
- package/src/scroll-lock/stories/index.story.tsx +3 -3
- package/src/scrollable/stories/index.story.tsx +4 -4
- package/src/search-control/index.native.js +39 -27
- package/src/search-control/stories/index.story.tsx +3 -3
- package/src/select-control/stories/index.story.tsx +3 -3
- package/src/shortcut/index.tsx +13 -0
- package/src/shortcut/stories/index.story.tsx +33 -0
- package/src/slot-fill/README.md +5 -5
- package/src/slot-fill/bubbles-virtually/slot-fill-context.js +3 -0
- package/src/slot-fill/bubbles-virtually/slot.js +17 -5
- package/src/slot-fill/index.js +6 -1
- package/src/slot-fill/stories/index.story.js +2 -0
- package/src/slot-fill/test/__snapshots__/slot.js.snap +12 -4
- package/src/snackbar/stories/index.story.tsx +10 -13
- package/src/snackbar/stories/list.story.tsx +3 -3
- package/src/spacer/stories/index.story.tsx +4 -4
- package/src/spinner/index.tsx +0 -1
- package/src/spinner/stories/index.story.tsx +5 -5
- package/src/surface/stories/index.story.tsx +4 -4
- package/src/tab-panel/stories/index.story.tsx +5 -13
- package/src/tab-panel/test/index.tsx +9 -25
- package/src/text-control/stories/index.story.tsx +7 -6
- package/src/text-highlight/stories/index.story.tsx +4 -6
- package/src/textarea-control/stories/index.story.tsx +4 -6
- package/src/theme/index.tsx +0 -1
- package/src/theme/stories/index.story.tsx +5 -5
- package/src/tip/stories/index.story.tsx +4 -4
- package/src/toggle-control/stories/index.story.tsx +3 -3
- package/src/toggle-group-control/stories/index.story.tsx +17 -11
- package/src/toolbar/stories/index.story.tsx +13 -3
- package/src/tools-panel/stories/index.story.tsx +17 -12
- package/src/tools-panel/tools-panel/component.tsx +0 -1
- package/src/tools-panel/tools-panel-header/component.tsx +3 -0
- package/src/tree-grid/stories/index.story.tsx +5 -3
- package/src/tree-select/index.tsx +0 -1
- package/src/tree-select/stories/index.story.tsx +3 -3
- package/src/truncate/stories/index.story.tsx +5 -7
- package/src/unit-control/index.tsx +0 -1
- package/src/unit-control/stories/index.story.tsx +10 -9
- package/src/utils/hooks/use-cx.ts +2 -1
- package/src/v-stack/stories/e2e/index.story.tsx +4 -4
- package/src/v-stack/stories/index.story.tsx +3 -3
- package/src/view/component.tsx +0 -1
- package/src/view/stories/index.story.tsx +4 -4
- package/src/visually-hidden/stories/index.story.tsx +7 -7
- package/src/z-stack/stories/index.story.tsx +4 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/build/popover/limit-shift.js +0 -129
- package/build/popover/limit-shift.js.map +0 -1
- package/build-module/popover/limit-shift.js +0 -122
- package/build-module/popover/limit-shift.js.map +0 -1
- package/build-types/popover/limit-shift.d.ts +0 -87
- package/build-types/popover/limit-shift.d.ts.map +0 -1
- package/src/popover/limit-shift.ts +0 -205
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["POSITION_TO_PLACEMENT","bottom","top","middle","positionToPlacement","position","_POSITION_TO_PLACEMEN","PLACEMENT_TO_ANIMATION_ORIGIN","originX","originY","right","left","overlay","placementToMotionAnimationProps","placement","translateProp","startsWith","translateDirection","style","initial","opacity","scale","animate","transition","duration","ease","getFrameOffset","document","frameElement","defaultView","iframeRect","getBoundingClientRect","x","y","getFrameScale","rect","width","offsetWidth","height","offsetHeight","getReferenceOwnerDocument","anchor","anchorRef","anchorRect","getAnchorRect","fallbackReferenceElement","fallbackDocument","_resultingReferenceOw","resultingReferenceOwnerDoc","ownerDocument","startContainer","current","getReferenceElement","_referenceElement","referenceElement","topRect","bottomRect","window","DOMRect","_rect$x","_rect$y","_rect$width","_rect$height","parentElement","computePopoverPosition","c","Number","isNaN","undefined","Math","round"],"sources":["@wordpress/components/src/popover/utils.ts"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type { MotionProps } from 'framer-motion';\nimport type { ReferenceType } from '@floating-ui/react-dom';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\n\nconst POSITION_TO_PLACEMENT: Record<\n\tNonNullable< PopoverProps[ 'position' ] >,\n\tNonNullable< PopoverProps[ 'placement' ] >\n> = {\n\tbottom: 'bottom',\n\ttop: 'top',\n\t'middle left': 'left',\n\t'middle right': 'right',\n\t'bottom left': 'bottom-end',\n\t'bottom center': 'bottom',\n\t'bottom right': 'bottom-start',\n\t'top left': 'top-end',\n\t'top center': 'top',\n\t'top right': 'top-start',\n\t'middle left left': 'left',\n\t'middle left right': 'left',\n\t'middle left bottom': 'left-end',\n\t'middle left top': 'left-start',\n\t'middle right left': 'right',\n\t'middle right right': 'right',\n\t'middle right bottom': 'right-end',\n\t'middle right top': 'right-start',\n\t'bottom left left': 'bottom-end',\n\t'bottom left right': 'bottom-end',\n\t'bottom left bottom': 'bottom-end',\n\t'bottom left top': 'bottom-end',\n\t'bottom center left': 'bottom',\n\t'bottom center right': 'bottom',\n\t'bottom center bottom': 'bottom',\n\t'bottom center top': 'bottom',\n\t'bottom right left': 'bottom-start',\n\t'bottom right right': 'bottom-start',\n\t'bottom right bottom': 'bottom-start',\n\t'bottom right top': 'bottom-start',\n\t'top left left': 'top-end',\n\t'top left right': 'top-end',\n\t'top left bottom': 'top-end',\n\t'top left top': 'top-end',\n\t'top center left': 'top',\n\t'top center right': 'top',\n\t'top center bottom': 'top',\n\t'top center top': 'top',\n\t'top right left': 'top-start',\n\t'top right right': 'top-start',\n\t'top right bottom': 'top-start',\n\t'top right top': 'top-start',\n\t// `middle`/`middle center [corner?]` positions are associated to a fallback\n\t// `bottom` placement because there aren't any corresponding placement values.\n\tmiddle: 'bottom',\n\t'middle center': 'bottom',\n\t'middle center bottom': 'bottom',\n\t'middle center left': 'bottom',\n\t'middle center right': 'bottom',\n\t'middle center top': 'bottom',\n};\n\n/**\n * Converts the `Popover`'s legacy \"position\" prop to the new \"placement\" prop\n * (used by `floating-ui`).\n *\n * @param position The legacy position\n * @return The corresponding placement\n */\nexport const positionToPlacement = (\n\tposition: NonNullable< PopoverProps[ 'position' ] >\n): NonNullable< PopoverProps[ 'placement' ] > =>\n\tPOSITION_TO_PLACEMENT[ position ] ?? 'bottom';\n\n/**\n * @typedef AnimationOrigin\n * @type {Object}\n * @property {number} originX A number between 0 and 1 (in CSS logical properties jargon, 0 is \"start\", 0.5 is \"center\", and 1 is \"end\")\n * @property {number} originY A number between 0 and 1 (0 is top, 0.5 is center, and 1 is bottom)\n */\n\nconst PLACEMENT_TO_ANIMATION_ORIGIN: Record<\n\tNonNullable< PopoverProps[ 'placement' ] >,\n\t{ originX: number; originY: number }\n> = {\n\ttop: { originX: 0.5, originY: 1 }, // open from bottom, center\n\t'top-start': { originX: 0, originY: 1 }, // open from bottom, left\n\t'top-end': { originX: 1, originY: 1 }, // open from bottom, right\n\tright: { originX: 0, originY: 0.5 }, // open from middle, left\n\t'right-start': { originX: 0, originY: 0 }, // open from top, left\n\t'right-end': { originX: 0, originY: 1 }, // open from bottom, left\n\tbottom: { originX: 0.5, originY: 0 }, // open from top, center\n\t'bottom-start': { originX: 0, originY: 0 }, // open from top, left\n\t'bottom-end': { originX: 1, originY: 0 }, // open from top, right\n\tleft: { originX: 1, originY: 0.5 }, // open from middle, right\n\t'left-start': { originX: 1, originY: 0 }, // open from top, right\n\t'left-end': { originX: 1, originY: 1 }, // open from bottom, right\n\toverlay: { originX: 0.5, originY: 0.5 }, // open from center, center\n};\n\n/**\n * Given the floating-ui `placement`, compute the framer-motion props for the\n * popover's entry animation.\n *\n * @param placement A placement string from floating ui\n * @return The object containing the motion props\n */\nexport const placementToMotionAnimationProps = (\n\tplacement: NonNullable< PopoverProps[ 'placement' ] >\n): MotionProps => {\n\tconst translateProp =\n\t\tplacement.startsWith( 'top' ) || placement.startsWith( 'bottom' )\n\t\t\t? 'translateY'\n\t\t\t: 'translateX';\n\tconst translateDirection =\n\t\tplacement.startsWith( 'top' ) || placement.startsWith( 'left' )\n\t\t\t? 1\n\t\t\t: -1;\n\n\treturn {\n\t\tstyle: PLACEMENT_TO_ANIMATION_ORIGIN[ placement ],\n\t\tinitial: {\n\t\t\topacity: 0,\n\t\t\tscale: 0,\n\t\t\t[ translateProp ]: `${ 2 * translateDirection }em`,\n\t\t},\n\t\tanimate: { opacity: 1, scale: 1, [ translateProp ]: 0 },\n\t\ttransition: { duration: 0.1, ease: [ 0, 0, 0.2, 1 ] },\n\t};\n};\n\n/**\n * Returns the offset of a document's frame element.\n *\n * @param document The iframe's owner document.\n *\n * @return The offset of the document's frame element, or undefined if the\n * document has no frame element.\n */\nexport const getFrameOffset = (\n\tdocument?: Document\n): { x: number; y: number } | undefined => {\n\tconst frameElement = document?.defaultView?.frameElement;\n\tif ( ! frameElement ) {\n\t\treturn;\n\t}\n\tconst iframeRect = frameElement.getBoundingClientRect();\n\treturn { x: iframeRect.left, y: iframeRect.top };\n};\n\nexport const getFrameScale = (\n\tdocument?: Document\n): {\n\tx: number;\n\ty: number;\n} => {\n\tconst frameElement = document?.defaultView?.frameElement as HTMLElement;\n\tif ( ! frameElement ) {\n\t\treturn { x: 1, y: 1 };\n\t}\n\tconst rect = frameElement.getBoundingClientRect();\n\treturn {\n\t\tx: rect.width / frameElement.offsetWidth,\n\t\ty: rect.height / frameElement.offsetHeight,\n\t};\n};\n\nexport const getReferenceOwnerDocument = ( {\n\tanchor,\n\tanchorRef,\n\tanchorRect,\n\tgetAnchorRect,\n\tfallbackReferenceElement,\n\tfallbackDocument,\n}: Pick<\n\tPopoverProps,\n\t'anchorRef' | 'anchorRect' | 'getAnchorRect' | 'anchor'\n> & {\n\tfallbackReferenceElement: Element | null;\n\tfallbackDocument: Document;\n} ): Document => {\n\t// In floating-ui's terms:\n\t// - \"reference\" refers to the popover's anchor element.\n\t// - \"floating\" refers the floating popover's element.\n\t// A floating element can also be positioned relative to a virtual element,\n\t// instead of a real one. A virtual element is represented by an object\n\t// with the `getBoundingClientRect()` function (like real elements).\n\t// See https://floating-ui.com/docs/virtual-elements for more info.\n\tlet resultingReferenceOwnerDoc;\n\tif ( anchor ) {\n\t\tresultingReferenceOwnerDoc = anchor.ownerDocument;\n\t} else if ( ( anchorRef as PopoverAnchorRefTopBottom | undefined )?.top ) {\n\t\tresultingReferenceOwnerDoc = ( anchorRef as PopoverAnchorRefTopBottom )\n\t\t\t?.top.ownerDocument;\n\t} else if ( ( anchorRef as Range | undefined )?.startContainer ) {\n\t\tresultingReferenceOwnerDoc = ( anchorRef as Range ).startContainer\n\t\t\t.ownerDocument;\n\t} else if (\n\t\t( anchorRef as PopoverAnchorRefReference | undefined )?.current\n\t) {\n\t\tresultingReferenceOwnerDoc = (\n\t\t\t( anchorRef as PopoverAnchorRefReference ).current as Element\n\t\t ).ownerDocument;\n\t} else if ( anchorRef as Element | undefined ) {\n\t\t// This one should be deprecated.\n\t\tresultingReferenceOwnerDoc = ( anchorRef as Element ).ownerDocument;\n\t} else if ( anchorRect && anchorRect?.ownerDocument ) {\n\t\tresultingReferenceOwnerDoc = anchorRect.ownerDocument;\n\t} else if ( getAnchorRect ) {\n\t\tresultingReferenceOwnerDoc = getAnchorRect(\n\t\t\tfallbackReferenceElement\n\t\t)?.ownerDocument;\n\t}\n\n\treturn resultingReferenceOwnerDoc ?? fallbackDocument;\n};\n\nexport const getReferenceElement = ( {\n\tanchor,\n\tanchorRef,\n\tanchorRect,\n\tgetAnchorRect,\n\tfallbackReferenceElement,\n\tscale,\n}: Pick<\n\tPopoverProps,\n\t'anchorRef' | 'anchorRect' | 'getAnchorRect' | 'anchor'\n> & {\n\tfallbackReferenceElement: Element | null;\n\tscale: { x: number; y: number };\n} ): ReferenceType | null => {\n\tlet referenceElement = null;\n\n\tif ( anchor ) {\n\t\treferenceElement = anchor;\n\t} else if ( ( anchorRef as PopoverAnchorRefTopBottom | undefined )?.top ) {\n\t\t// Create a virtual element for the ref. The expectation is that\n\t\t// if anchorRef.top is defined, then anchorRef.bottom is defined too.\n\t\t// Seems to be used by the block toolbar, when multiple blocks are selected\n\t\t// (top and bottom blocks are used to calculate the resulting rect).\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst topRect = (\n\t\t\t\t\tanchorRef as PopoverAnchorRefTopBottom\n\t\t\t\t ).top.getBoundingClientRect();\n\t\t\t\tconst bottomRect = (\n\t\t\t\t\tanchorRef as PopoverAnchorRefTopBottom\n\t\t\t\t ).bottom.getBoundingClientRect();\n\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\ttopRect.x,\n\t\t\t\t\ttopRect.y,\n\t\t\t\t\ttopRect.width,\n\t\t\t\t\tbottomRect.bottom - topRect.top\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t} else if (\n\t\t( anchorRef as PopoverAnchorRefReference | undefined )?.current\n\t) {\n\t\t// Standard React ref.\n\t\treferenceElement = ( anchorRef as PopoverAnchorRefReference ).current;\n\t} else if ( anchorRef as Element | undefined ) {\n\t\t// If `anchorRef` holds directly the element's value (no `current` key)\n\t\t// This is a weird scenario and should be deprecated.\n\t\treferenceElement = anchorRef as Element;\n\t} else if ( anchorRect ) {\n\t\t// Create a virtual element for the ref.\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn anchorRect;\n\t\t\t},\n\t\t};\n\t} else if ( getAnchorRect ) {\n\t\t// Create a virtual element for the ref.\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst rect = getAnchorRect( fallbackReferenceElement );\n\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\trect.x ?? rect.left,\n\t\t\t\t\trect.y ?? rect.top,\n\t\t\t\t\trect.width ?? rect.right - rect.left,\n\t\t\t\t\trect.height ?? rect.bottom - rect.top\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t} else if ( fallbackReferenceElement ) {\n\t\t// If no explicit ref is passed via props, fall back to\n\t\t// anchoring to the popover's parent node.\n\t\treferenceElement = fallbackReferenceElement.parentElement;\n\t}\n\n\tif ( referenceElement && ( scale.x !== 1 || scale.y !== 1 ) ) {\n\t\t// If the popover is inside an iframe, the coordinates of the\n\t\t// reference element need to be scaled to match the iframe's scale.\n\t\tconst rect = referenceElement.getBoundingClientRect();\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\trect.x * scale.x,\n\t\t\t\t\trect.y * scale.y,\n\t\t\t\t\trect.width * scale.x,\n\t\t\t\t\trect.height * scale.y\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t}\n\n\t// Convert any `undefined` value to `null`.\n\treturn referenceElement ?? null;\n};\n\n/**\n * Computes the final coordinate that needs to be applied to the floating\n * element when applying transform inline styles, defaulting to `undefined`\n * if the provided value is `null` or `NaN`.\n *\n * @param c input coordinate (usually as returned from floating-ui)\n * @return The coordinate's value to be used for inline styles. An `undefined`\n * return value means \"no style set\" for this coordinate.\n */\nexport const computePopoverPosition = ( c: number | null ) =>\n\tc === null || Number.isNaN( c ) ? undefined : Math.round( c );\n"],"mappings":"AAAA;AACA;AACA;AACA;;AAIA;AACA;AACA;;AAOA,MAAMA,qBAGL,GAAG;EACHC,MAAM,EAAE,QAAQ;EAChBC,GAAG,EAAE,KAAK;EACV,aAAa,EAAE,MAAM;EACrB,cAAc,EAAE,OAAO;EACvB,aAAa,EAAE,YAAY;EAC3B,eAAe,EAAE,QAAQ;EACzB,cAAc,EAAE,cAAc;EAC9B,UAAU,EAAE,SAAS;EACrB,YAAY,EAAE,KAAK;EACnB,WAAW,EAAE,WAAW;EACxB,kBAAkB,EAAE,MAAM;EAC1B,mBAAmB,EAAE,MAAM;EAC3B,oBAAoB,EAAE,UAAU;EAChC,iBAAiB,EAAE,YAAY;EAC/B,mBAAmB,EAAE,OAAO;EAC5B,oBAAoB,EAAE,OAAO;EAC7B,qBAAqB,EAAE,WAAW;EAClC,kBAAkB,EAAE,aAAa;EACjC,kBAAkB,EAAE,YAAY;EAChC,mBAAmB,EAAE,YAAY;EACjC,oBAAoB,EAAE,YAAY;EAClC,iBAAiB,EAAE,YAAY;EAC/B,oBAAoB,EAAE,QAAQ;EAC9B,qBAAqB,EAAE,QAAQ;EAC/B,sBAAsB,EAAE,QAAQ;EAChC,mBAAmB,EAAE,QAAQ;EAC7B,mBAAmB,EAAE,cAAc;EACnC,oBAAoB,EAAE,cAAc;EACpC,qBAAqB,EAAE,cAAc;EACrC,kBAAkB,EAAE,cAAc;EAClC,eAAe,EAAE,SAAS;EAC1B,gBAAgB,EAAE,SAAS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a;EAC1D;EAEA,IAAKT,gBAAgB,KAAMjC,KAAK,CAACW,CAAC,KAAK,CAAC,IAAIX,KAAK,CAACY,CAAC,KAAK,CAAC,CAAE,EAAG;IAC7D;IACA;IACA,MAAME,IAAI,GAAGmB,gBAAgB,CAACvB,qBAAqB,CAAC,CAAC;IACrDuB,gBAAgB,GAAG;MAClBvB,qBAAqBA,CAAA,EAAG;QACvB,OAAO,IAAI0B,MAAM,CAACC,OAAO,CACxBvB,IAAI,CAACH,CAAC,GAAGX,KAAK,CAACW,CAAC,EAChBG,IAAI,CAACF,CAAC,GAAGZ,KAAK,CAACY,CAAC,EAChBE,IAAI,CAACC,KAAK,GAAGf,KAAK,CAACW,CAAC,EACpBG,IAAI,CAACG,MAAM,GAAGjB,KAAK,CAACY,CACrB,CAAC;MACF;IACD,CAAC;EACF;;EAEA;EACA,QAAAoB,iBAAA,GAAOC,gBAAgB,cAAAD,iBAAA,cAAAA,iBAAA,GAAI,IAAI;AAChC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMW,sBAAsB,GAAKC,CAAgB,IACvDA,CAAC,KAAK,IAAI,IAAIC,MAAM,CAACC,KAAK,CAAEF,CAAE,CAAC,GAAGG,SAAS,GAAGC,IAAI,CAACC,KAAK,CAAEL,CAAE,CAAC"}
|
|
1
|
+
{"version":3,"names":["POSITION_TO_PLACEMENT","bottom","top","middle","positionToPlacement","position","_POSITION_TO_PLACEMEN","PLACEMENT_TO_ANIMATION_ORIGIN","originX","originY","right","left","overlay","placementToMotionAnimationProps","placement","translateProp","startsWith","translateDirection","style","initial","opacity","scale","animate","transition","duration","ease","getReferenceOwnerDocument","anchor","anchorRef","anchorRect","getAnchorRect","fallbackReferenceElement","fallbackDocument","_resultingReferenceOw","resultingReferenceOwnerDoc","contextElement","ownerDocument","startContainer","current","getReferenceElement","_referenceElement","referenceElement","getBoundingClientRect","topRect","bottomRect","window","DOMRect","x","y","width","_rect$x","_rect$y","_rect$width","_rect$height","rect","height","parentElement","computePopoverPosition","c","Number","isNaN","undefined","Math","round"],"sources":["@wordpress/components/src/popover/utils.ts"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type { MotionProps } from 'framer-motion';\nimport type { ReferenceType, VirtualElement } from '@floating-ui/react-dom';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\n\nconst POSITION_TO_PLACEMENT: Record<\n\tNonNullable< PopoverProps[ 'position' ] >,\n\tNonNullable< PopoverProps[ 'placement' ] >\n> = {\n\tbottom: 'bottom',\n\ttop: 'top',\n\t'middle left': 'left',\n\t'middle right': 'right',\n\t'bottom left': 'bottom-end',\n\t'bottom center': 'bottom',\n\t'bottom right': 'bottom-start',\n\t'top left': 'top-end',\n\t'top center': 'top',\n\t'top right': 'top-start',\n\t'middle left left': 'left',\n\t'middle left right': 'left',\n\t'middle left bottom': 'left-end',\n\t'middle left top': 'left-start',\n\t'middle right left': 'right',\n\t'middle right right': 'right',\n\t'middle right bottom': 'right-end',\n\t'middle right top': 'right-start',\n\t'bottom left left': 'bottom-end',\n\t'bottom left right': 'bottom-end',\n\t'bottom left bottom': 'bottom-end',\n\t'bottom left top': 'bottom-end',\n\t'bottom center left': 'bottom',\n\t'bottom center right': 'bottom',\n\t'bottom center bottom': 'bottom',\n\t'bottom center top': 'bottom',\n\t'bottom right left': 'bottom-start',\n\t'bottom right right': 'bottom-start',\n\t'bottom right bottom': 'bottom-start',\n\t'bottom right top': 'bottom-start',\n\t'top left left': 'top-end',\n\t'top left right': 'top-end',\n\t'top left bottom': 'top-end',\n\t'top left top': 'top-end',\n\t'top center left': 'top',\n\t'top center right': 'top',\n\t'top center bottom': 'top',\n\t'top center top': 'top',\n\t'top right left': 'top-start',\n\t'top right right': 'top-start',\n\t'top right bottom': 'top-start',\n\t'top right top': 'top-start',\n\t// `middle`/`middle center [corner?]` positions are associated to a fallback\n\t// `bottom` placement because there aren't any corresponding placement values.\n\tmiddle: 'bottom',\n\t'middle center': 'bottom',\n\t'middle center bottom': 'bottom',\n\t'middle center left': 'bottom',\n\t'middle center right': 'bottom',\n\t'middle center top': 'bottom',\n};\n\n/**\n * Converts the `Popover`'s legacy \"position\" prop to the new \"placement\" prop\n * (used by `floating-ui`).\n *\n * @param position The legacy position\n * @return The corresponding placement\n */\nexport const positionToPlacement = (\n\tposition: NonNullable< PopoverProps[ 'position' ] >\n): NonNullable< PopoverProps[ 'placement' ] > =>\n\tPOSITION_TO_PLACEMENT[ position ] ?? 'bottom';\n\n/**\n * @typedef AnimationOrigin\n * @type {Object}\n * @property {number} originX A number between 0 and 1 (in CSS logical properties jargon, 0 is \"start\", 0.5 is \"center\", and 1 is \"end\")\n * @property {number} originY A number between 0 and 1 (0 is top, 0.5 is center, and 1 is bottom)\n */\n\nconst PLACEMENT_TO_ANIMATION_ORIGIN: Record<\n\tNonNullable< PopoverProps[ 'placement' ] >,\n\t{ originX: number; originY: number }\n> = {\n\ttop: { originX: 0.5, originY: 1 }, // open from bottom, center\n\t'top-start': { originX: 0, originY: 1 }, // open from bottom, left\n\t'top-end': { originX: 1, originY: 1 }, // open from bottom, right\n\tright: { originX: 0, originY: 0.5 }, // open from middle, left\n\t'right-start': { originX: 0, originY: 0 }, // open from top, left\n\t'right-end': { originX: 0, originY: 1 }, // open from bottom, left\n\tbottom: { originX: 0.5, originY: 0 }, // open from top, center\n\t'bottom-start': { originX: 0, originY: 0 }, // open from top, left\n\t'bottom-end': { originX: 1, originY: 0 }, // open from top, right\n\tleft: { originX: 1, originY: 0.5 }, // open from middle, right\n\t'left-start': { originX: 1, originY: 0 }, // open from top, right\n\t'left-end': { originX: 1, originY: 1 }, // open from bottom, right\n\toverlay: { originX: 0.5, originY: 0.5 }, // open from center, center\n};\n\n/**\n * Given the floating-ui `placement`, compute the framer-motion props for the\n * popover's entry animation.\n *\n * @param placement A placement string from floating ui\n * @return The object containing the motion props\n */\nexport const placementToMotionAnimationProps = (\n\tplacement: NonNullable< PopoverProps[ 'placement' ] >\n): MotionProps => {\n\tconst translateProp =\n\t\tplacement.startsWith( 'top' ) || placement.startsWith( 'bottom' )\n\t\t\t? 'translateY'\n\t\t\t: 'translateX';\n\tconst translateDirection =\n\t\tplacement.startsWith( 'top' ) || placement.startsWith( 'left' )\n\t\t\t? 1\n\t\t\t: -1;\n\n\treturn {\n\t\tstyle: PLACEMENT_TO_ANIMATION_ORIGIN[ placement ],\n\t\tinitial: {\n\t\t\topacity: 0,\n\t\t\tscale: 0,\n\t\t\t[ translateProp ]: `${ 2 * translateDirection }em`,\n\t\t},\n\t\tanimate: { opacity: 1, scale: 1, [ translateProp ]: 0 },\n\t\ttransition: { duration: 0.1, ease: [ 0, 0, 0.2, 1 ] },\n\t};\n};\n\nexport const getReferenceOwnerDocument = ( {\n\tanchor,\n\tanchorRef,\n\tanchorRect,\n\tgetAnchorRect,\n\tfallbackReferenceElement,\n\tfallbackDocument,\n}: Pick<\n\tPopoverProps,\n\t'anchorRef' | 'anchorRect' | 'getAnchorRect' | 'anchor'\n> & {\n\tfallbackReferenceElement: Element | null;\n\tfallbackDocument: Document;\n} ): Document => {\n\t// In floating-ui's terms:\n\t// - \"reference\" refers to the popover's anchor element.\n\t// - \"floating\" refers the floating popover's element.\n\t// A floating element can also be positioned relative to a virtual element,\n\t// instead of a real one. A virtual element is represented by an object\n\t// with the `getBoundingClientRect()` function (like real elements).\n\t// See https://floating-ui.com/docs/virtual-elements for more info.\n\tlet resultingReferenceOwnerDoc;\n\tif ( ( anchor as VirtualElement )?.contextElement ) {\n\t\tresultingReferenceOwnerDoc = ( anchor as VirtualElement ).contextElement\n\t\t\t?.ownerDocument;\n\t} else if ( anchor ) {\n\t\tresultingReferenceOwnerDoc = anchor.ownerDocument;\n\t} else if ( ( anchorRef as PopoverAnchorRefTopBottom | undefined )?.top ) {\n\t\tresultingReferenceOwnerDoc = ( anchorRef as PopoverAnchorRefTopBottom )\n\t\t\t?.top.ownerDocument;\n\t} else if ( ( anchorRef as Range | undefined )?.startContainer ) {\n\t\tresultingReferenceOwnerDoc = ( anchorRef as Range ).startContainer\n\t\t\t.ownerDocument;\n\t} else if (\n\t\t( anchorRef as PopoverAnchorRefReference | undefined )?.current\n\t) {\n\t\tresultingReferenceOwnerDoc = (\n\t\t\t( anchorRef as PopoverAnchorRefReference ).current as Element\n\t\t ).ownerDocument;\n\t} else if ( anchorRef as Element | undefined ) {\n\t\t// This one should be deprecated.\n\t\tresultingReferenceOwnerDoc = ( anchorRef as Element ).ownerDocument;\n\t} else if ( anchorRect && anchorRect?.ownerDocument ) {\n\t\tresultingReferenceOwnerDoc = anchorRect.ownerDocument;\n\t} else if ( getAnchorRect ) {\n\t\tresultingReferenceOwnerDoc = getAnchorRect(\n\t\t\tfallbackReferenceElement\n\t\t)?.ownerDocument;\n\t}\n\n\treturn resultingReferenceOwnerDoc ?? fallbackDocument;\n};\n\nexport const getReferenceElement = ( {\n\tanchor,\n\tanchorRef,\n\tanchorRect,\n\tgetAnchorRect,\n\tfallbackReferenceElement,\n}: Pick<\n\tPopoverProps,\n\t'anchorRef' | 'anchorRect' | 'getAnchorRect' | 'anchor'\n> & {\n\tfallbackReferenceElement: Element | null;\n} ): ReferenceType | null => {\n\tlet referenceElement = null;\n\n\tif ( anchor ) {\n\t\treferenceElement = anchor;\n\t} else if ( ( anchorRef as PopoverAnchorRefTopBottom | undefined )?.top ) {\n\t\t// Create a virtual element for the ref. The expectation is that\n\t\t// if anchorRef.top is defined, then anchorRef.bottom is defined too.\n\t\t// Seems to be used by the block toolbar, when multiple blocks are selected\n\t\t// (top and bottom blocks are used to calculate the resulting rect).\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst topRect = (\n\t\t\t\t\tanchorRef as PopoverAnchorRefTopBottom\n\t\t\t\t ).top.getBoundingClientRect();\n\t\t\t\tconst bottomRect = (\n\t\t\t\t\tanchorRef as PopoverAnchorRefTopBottom\n\t\t\t\t ).bottom.getBoundingClientRect();\n\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\ttopRect.x,\n\t\t\t\t\ttopRect.y,\n\t\t\t\t\ttopRect.width,\n\t\t\t\t\tbottomRect.bottom - topRect.top\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t} else if (\n\t\t( anchorRef as PopoverAnchorRefReference | undefined )?.current\n\t) {\n\t\t// Standard React ref.\n\t\treferenceElement = ( anchorRef as PopoverAnchorRefReference ).current;\n\t} else if ( anchorRef as Element | undefined ) {\n\t\t// If `anchorRef` holds directly the element's value (no `current` key)\n\t\t// This is a weird scenario and should be deprecated.\n\t\treferenceElement = anchorRef as Element;\n\t} else if ( anchorRect ) {\n\t\t// Create a virtual element for the ref.\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn anchorRect;\n\t\t\t},\n\t\t};\n\t} else if ( getAnchorRect ) {\n\t\t// Create a virtual element for the ref.\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst rect = getAnchorRect( fallbackReferenceElement );\n\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\trect.x ?? rect.left,\n\t\t\t\t\trect.y ?? rect.top,\n\t\t\t\t\trect.width ?? rect.right - rect.left,\n\t\t\t\t\trect.height ?? rect.bottom - rect.top\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t} else if ( fallbackReferenceElement ) {\n\t\t// If no explicit ref is passed via props, fall back to\n\t\t// anchoring to the popover's parent node.\n\t\treferenceElement = fallbackReferenceElement.parentElement;\n\t}\n\n\t// Convert any `undefined` value to `null`.\n\treturn referenceElement ?? null;\n};\n\n/**\n * Computes the final coordinate that needs to be applied to the floating\n * element when applying transform inline styles, defaulting to `undefined`\n * if the provided value is `null` or `NaN`.\n *\n * @param c input coordinate (usually as returned from floating-ui)\n * @return The coordinate's value to be used for inline styles. An `undefined`\n * return value means \"no style set\" for this coordinate.\n */\nexport const computePopover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AG4C,IAAI,CAAC3C,IAAI,GAAA0C,YAAA,GACpCC,IAAI,CAACC,MAAM,cAAAF,YAAA,cAAAA,YAAA,GAAIC,IAAI,CAACrD,MAAM,GAAGqD,IAAI,CAACpD,GACnC,CAAC;MACF;IACD,CAAC;EACF,CAAC,MAAM,IAAK6B,wBAAwB,EAAG;IACtC;IACA;IACAU,gBAAgB,GAAGV,wBAAwB,CAACyB,aAAa;EAC1D;;EAEA;EACA,QAAAhB,iBAAA,GAAOC,gBAAgB,cAAAD,iBAAA,cAAAA,iBAAA,GAAI,IAAI;AAChC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMiB,sBAAsB,GAAKC,CAAgB,IACvDA,CAAC,KAAK,IAAI,IAAIC,MAAM,CAACC,KAAK,CAAEF,CAAE,CAAC,GAAGG,SAAS,GAAGC,IAAI,CAACC,KAAK,CAAEL,CAAE,CAAC"}
|
|
@@ -26,7 +26,7 @@ export const Track = _styled("div", process.env.NODE_ENV === "production" ? {
|
|
|
26
26
|
} : {
|
|
27
27
|
target: "e15u147w2",
|
|
28
28
|
label: "Track"
|
|
29
|
-
})("position:relative;overflow:hidden;width:100%;max-width:160px;height:", CONFIG.borderWidthFocus, ";background-color:var(\n\t\t--wp-components-color-gray-300,\n\t\t", COLORS.gray[300], "\n\t);border-radius:", CONFIG.radiusBlockUi, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcHJvZ3Jlc3MtYmFyL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1QitCIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcHJvZ3Jlc3MtYmFyL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZX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jtcblx0dmFsdWU/
|
|
29
|
+
})("position:relative;overflow:hidden;width:100%;max-width:160px;height:", CONFIG.borderWidthFocus, ";background-color:var(\n\t\t--wp-components-color-gray-300,\n\t\t", COLORS.gray[300], "\n\t);border-radius:", CONFIG.radiusBlockUi, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcHJvZ3Jlc3MtYmFyL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1QitCIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcHJvZ3Jlc3MtYmFyL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IGNzcywga2V5ZnJhbWVzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG4vKipcbiAqIEludGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBDT0xPUlMsIENPTkZJRyB9IGZyb20gJy4uL3V0aWxzJztcblxuY29uc3QgYW5pbWF0ZVByb2dyZXNzQmFyID0ga2V5ZnJhbWVzKCB7XG5cdCcwJSc6IHtcblx0XHRsZWZ0OiAnLTUwJScsXG5cdH0sXG5cdCcxMDAlJzoge1xuXHRcdGxlZnQ6ICcxMDAlJyxcblx0fSxcbn0gKTtcblxuLy8gV2lkdGggb2YgdGhlIGluZGljYXRvciBmb3IgdGhlIGluZGV0ZXJtaW5hdGUgcHJvZ3Jlc3MgYmFyXG5leHBvcnQgY29uc3QgSU5ERVRFUk1JTkFURV9UUkFDS19XSURUSCA9IDUwO1xuXG5leHBvcnQgY29uc3QgVHJhY2sgPSB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9ncmVzc0Jhcixcblx0XHRcdFx0XHR3aWR0aDogYCR7IElOREVURVJNSU5BVEVfVFJBQ0tfV0lEVEggfSVgLFxuXHRcdFx0ICB9IClcblx0XHRcdDogY3NzKCB7XG5cdFx0XHRcdFx0d2lkdGg6IGAkeyB2YWx1ZSB9JWAsXG5cdFx0XHRcdFx0dHJhbnNpdGlvbjogJ3dpZHRoIDAuNHMgZWFzZS1pbi1vdXQnLFxuXHRcdFx0ICB9ICkgfTtcbmA7XG5cbmV4cG9ydCBjb25zdCBQcm9ncmVzc0VsZW1lbnQgPSBzdHlsZWQucHJvZ3Jlc3NgXG5cdHBvc2l0aW9uOiBhYnNvbHV0ZTtcblx0dG9wOiAwO1xuXHRsZWZ0OiAwO1xuXHRvcGFjaXR5OiAwO1xuXHR3aWR0aDogMTAwJTtcblx0aGVpZ2h0OiAxMDAlO1xuYDtcbiJdfQ== */"));
|
|
30
30
|
export const Indicator = _styled("div", process.env.NODE_ENV === "production" ? {
|
|
31
31
|
target: "e15u147w1"
|
|
32
32
|
} : {
|
|
@@ -41,9 +41,10 @@ export const Indicator = _styled("div", process.env.NODE_ENV === "production" ?
|
|
|
41
41
|
animationIterationCount: 'infinite',
|
|
42
42
|
animationName: animateProgressBar,
|
|
43
43
|
width: `${INDETERMINATE_TRACK_WIDTH}%`
|
|
44
|
-
}, process.env.NODE_ENV === "production" ? "" : ";label:Indicator;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcHJvZ3Jlc3MtYmFyL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFpREsiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9wcm9ncmVzcy1iYXIvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlc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R2YWx1ZT86IG51bWJlcjtcbn0gPmBcblx0ZGlzcGxheTogaW5saW5lLWJsb2NrO1xuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHRvcDogMDtcblx0aGVpZ2h0OiAxMDAlO1xuXHRib3JkZXItcmFkaXVzOiAkeyBDT05GSUcucmFkaXVzQmxvY2tVaSB9O1xuXHRiYWNrZ3JvdW5kLWNvbG9yOiAkeyBDT0xPUlMudGhlbWUuYWNjZW50IH07XG5cblx0JHsgKCB7IGlzSW5kZXRlcm1pbmF0ZSwgdmFsdWUgfSApID0+XG5cdFx0aXNJbmRldGVybWluYXRlXG5cdFx0XHQ/
|
|
45
|
-
width: `${value}
|
|
46
|
-
|
|
44
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:Indicator;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcHJvZ3Jlc3MtYmFyL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFpREsiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9wcm9ncmVzcy1iYXIvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgY3NzLCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IENPTE9SUywgQ09ORklHIH0gZnJvbSAnLi4vdXRpbHMnO1xuXG5jb25zdCBhbmltYXRlUHJvZ3Jlc3NCYXIgPSBrZXlmcmFtZXMoIHtcblx0JzAlJz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luYXRlXG5cdFx0XHQ/IGNzcygge1xuXHRcdFx0XHRcdGFuaW1hdGlvbkR1cmF0aW9uOiAnMS41cycsXG5cdFx0XHRcdFx0YW5pbWF0aW9uVGltaW5nRnVuY3Rpb246ICdlYXNlLWluLW91dCcsXG5cdFx0XHRcdFx0YW5pbWF0aW9uSXRlcmF0aW9uQ291bnQ6ICdpbmZpbml0ZScsXG5cdFx0XHRcdFx0YW5pbWF0aW9uTmFtZTogYW5pbWF0ZVByb2dyZXNzQmFyLFxuXHRcdFx0XHRcdHdpZHRoOiBgJHsgSU5ERVRFUk1JTkFURV9UUkFDS19XSURUSCB9JWAsXG5cdFx0XHQgIH0gKVxuXHRcdFx0OiBjc3MoIHtcblx0XHRcdFx0XHR3aWR0aDogYCR7IHZhbHVlIH0lYCxcblx0XHRcdFx0XHR0cmFuc2l0aW9uOiAnd2lkdGggMC40cyBlYXNlLWluLW91dCcsXG5cdFx0XHQgIH0gKSB9O1xuYDtcblxuZXhwb3J0IGNvbnN0IFByb2dyZXNzRWxlbWVudCA9IHN0eWxlZC5wcm9ncmVzc2Bcblx0cG9zaXRpb246IGFic29sdXRlO1xuXHR0b3A6IDA7XG5cdGxlZnQ6IDA7XG5cdG9wYWNpdHk6IDA7XG5cdHdpZHRoOiAxMDAlO1xuXHRoZWlnaHQ6IDEwMCU7XG5gO1xuIl19 */") : /*#__PURE__*/css({
|
|
45
|
+
width: `${value}%`,
|
|
46
|
+
transition: 'width 0.4s ease-in-out'
|
|
47
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:Indicator;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcHJvZ3Jlc3MtYmFyL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF3REsiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb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SCB9JWAsXG5cdFx0XHQgIH0gKVxuXHRcdFx0OiBjc3MoIHtcblx0XHRcdFx0XHR3aWR0aDogYCR7IHZhbHVlIH0lYCxcblx0XHRcdFx0XHR0cmFuc2l0aW9uOiAnd2lkdGggMC40cyBlYXNlLWluLW91dCcsXG5cdFx0XHQgIH0gKSB9O1xuYDtcblxuZXhwb3J0IGNvbnN0IFByb2dyZXNzRWxlbWVudCA9IHN0eWxlZC5wcm9ncmVzc2Bcblx0cG9zaXRpb246IGFic29sdXRlO1xuXHR0b3A6IDA7XG5cdGxlZnQ6IDA7XG5cdG9wYWNpdHk6IDA7XG5cdHdpZHRoOiAxMDAlO1xuXHRoZWlnaHQ6IDEwMCU7XG5gO1xuIl19 */"));
|
|
47
48
|
export const ProgressElement = _styled("progress", process.env.NODE_ENV === "production" ? {
|
|
48
49
|
target: "e15u147w0"
|
|
49
50
|
} : {
|
|
@@ -55,7 +56,7 @@ export const ProgressElement = _styled("progress", process.env.NODE_ENV === "pro
|
|
|
55
56
|
} : {
|
|
56
57
|
name: "11fb690",
|
|
57
58
|
styles: "position:absolute;top:0;left:0;opacity:0;width:100%;height:100%",
|
|
58
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
59
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcHJvZ3Jlc3MtYmFyL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE4RDhDIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcHJvZ3Jlc3MtYmFyL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["css","keyframes","COLORS","CONFIG","animateProgressBar","left","INDETERMINATE_TRACK_WIDTH","Track","_styled","process","env","NODE_ENV","target","label","borderWidthFocus","gray","radiusBlockUi","Indicator","theme","accent","isIndeterminate","value","animationDuration","animationTimingFunction","animationIterationCount","animationName","width","ProgressElement","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__"],"sources":["@wordpress/components/src/progress-bar/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport { css, keyframes } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG } from '../utils';\n\nconst animateProgressBar = keyframes( {\n\t'0%': {\n\t\tleft: '-50%',\n\t},\n\t'100%': {\n\t\tleft: '100%',\n\t},\n} );\n\n// Width of the indicator for the indeterminate progress bar\nexport const INDETERMINATE_TRACK_WIDTH = 50;\n\nexport const Track = styled.div`\n\tposition: relative;\n\toverflow: hidden;\n\twidth: 100%;\n\tmax-width: 160px;\n\theight: ${ CONFIG.borderWidthFocus };\n\tbackground-color: var(\n\t\t--wp-components-color-gray-300,\n\t\t${ COLORS.gray[ 300 ] }\n\t);\n\tborder-radius: ${ CONFIG.radiusBlockUi };\n`;\n\nexport const Indicator = styled.div< {\n\tisIndeterminate: boolean;\n\tvalue?: number;\n} >`\n\tdisplay: inline-block;\n\tposition: absolute;\n\ttop: 0;\n\theight: 100%;\n\tborder-radius: ${ CONFIG.radiusBlockUi };\n\tbackground-color: ${ COLORS.theme.accent };\n\n\t${ ( { isIndeterminate, value } ) =>\n\t\tisIndeterminate\n\t\t\t? css( {\n\t\t\t\t\tanimationDuration: '1.5s',\n\t\t\t\t\tanimationTimingFunction: 'ease-in-out',\n\t\t\t\t\tanimationIterationCount: 'infinite',\n\t\t\t\t\tanimationName: animateProgressBar,\n\t\t\t\t\twidth: `${ INDETERMINATE_TRACK_WIDTH }%`,\n\t\t\t } )\n\t\t\t: css( {
|
|
1
|
+
{"version":3,"names":["css","keyframes","COLORS","CONFIG","animateProgressBar","left","INDETERMINATE_TRACK_WIDTH","Track","_styled","process","env","NODE_ENV","target","label","borderWidthFocus","gray","radiusBlockUi","Indicator","theme","accent","isIndeterminate","value","animationDuration","animationTimingFunction","animationIterationCount","animationName","width","transition","ProgressElement","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__"],"sources":["@wordpress/components/src/progress-bar/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport { css, keyframes } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG } from '../utils';\n\nconst animateProgressBar = keyframes( {\n\t'0%': {\n\t\tleft: '-50%',\n\t},\n\t'100%': {\n\t\tleft: '100%',\n\t},\n} );\n\n// Width of the indicator for the indeterminate progress bar\nexport const INDETERMINATE_TRACK_WIDTH = 50;\n\nexport const Track = styled.div`\n\tposition: relative;\n\toverflow: hidden;\n\twidth: 100%;\n\tmax-width: 160px;\n\theight: ${ CONFIG.borderWidthFocus };\n\tbackground-color: var(\n\t\t--wp-components-color-gray-300,\n\t\t${ COLORS.gray[ 300 ] }\n\t);\n\tborder-radius: ${ CONFIG.radiusBlockUi };\n`;\n\nexport const Indicator = styled.div< {\n\tisIndeterminate: boolean;\n\tvalue?: number;\n} >`\n\tdisplay: inline-block;\n\tposition: absolute;\n\ttop: 0;\n\theight: 100%;\n\tborder-radius: ${ CONFIG.radiusBlockUi };\n\tbackground-color: ${ COLORS.theme.accent };\n\n\t${ ( { isIndeterminate, value } ) =>\n\t\tisIndeterminate\n\t\t\t? css( {\n\t\t\t\t\tanimationDuration: '1.5s',\n\t\t\t\t\tanimationTimingFunction: 'ease-in-out',\n\t\t\t\t\tanimationIterationCount: 'infinite',\n\t\t\t\t\tanimationName: animateProgressBar,\n\t\t\t\t\twidth: `${ INDETERMINATE_TRACK_WIDTH }%`,\n\t\t\t } )\n\t\t\t: css( {\n\t\t\t\t\twidth: `${ value }%`,\n\t\t\t\t\ttransition: 'width 0.4s ease-in-out',\n\t\t\t } ) };\n`;\n\nexport const ProgressElement = styled.progress`\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\topacity: 0;\n\twidth: 100%;\n\theight: 100%;\n`;\n"],"mappings":";;AAAA;AACA;AACA;;AAEA,SAASA,GAAG,EAAEC,SAAS,QAAQ,gBAAgB;;AAE/C;AACA;AACA;AACA,SAASC,MAAM,EAAEC,MAAM,QAAQ,UAAU;AAEzC,MAAMC,kBAAkB,GAAGH,SAAS,CAAE;EACrC,IAAI,EAAE;IACLI,IAAI,EAAE;EACP,CAAC;EACD,MAAM,EAAE;IACPA,IAAI,EAAE;EACP;AACD,CAAE,CAAC;;AAEH;AACA,OAAO,MAAMC,yBAAyB,GAAG,EAAE;AAE3C,OAAO,MAAMC,KAAK,GAAAC,OAAA,QAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,2EAKNV,MAAM,CAACW,gBAAgB,uEAG9BZ,MAAM,CAACa,IAAI,CAAE,GAAG,CAAE,0BAEJZ,MAAM,CAACa,aAAa,SAAAP,OAAA,CAAAC,GAAA,CAAAC,QAAA,w7EACtC;AAED,OAAO,MAAMM,SAAS,GAAAT,OAAA,QAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,8EAQHV,MAAM,CAACa,aAAa,wBACjBd,MAAM,CAACgB,KAAK,CAACC,MAAM,OAErC,CAAE;EAAEC,eAAe;EAAEC;AAAM,CAAC,KAC9BD,eAAe,gBACZpB,GAAG,CAAE;EACLsB,iBAAiB,EAAE,MAAM;EACzBC,uBAAuB,EAAE,aAAa;EACtCC,uBAAuB,EAAE,UAAU;EACnCC,aAAa,EAAErB,kBAAkB;EACjCsB,KAAK,EAAG,GAAGpB,yBAA2B;AACtC,CAAC,EAAAG,OAAA,CAAAC,GAAA,CAAAC,QAAA,8CAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,k7EAAC,CAAC,gBACHX,GAAG,CAAE;EACL0B,KAAK,EAAG,GAAGL,KAAO,GAAE;EACpBM,UAAU,EAAE;AACZ,CAAC,EAAAlB,OAAA,CAAAC,GAAA,CAAAC,QAAA,8CAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,k7EAAC,CAAC,SAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,o7EACP;AAED,OAAO,MAAMiB,eAAe,GAAApB,OAAA,aAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAkB,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAC;AAAA,EAO3B"}
|
|
@@ -7,7 +7,7 @@ import { TextInput, Text, View, TouchableOpacity, Platform, useColorScheme, Keyb
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
import { useState, useRef, useMemo, useEffect } from '@wordpress/element';
|
|
10
|
+
import { useState, useRef, useMemo, useEffect, useCallback } from '@wordpress/element';
|
|
11
11
|
import { __ } from '@wordpress/i18n';
|
|
12
12
|
import { Button, Gridicons } from '@wordpress/components';
|
|
13
13
|
import { Icon, cancelCircleFilled as cancelCircleFilledIcon, arrowLeft as arrowLeftIcon, close as closeIcon } from '@wordpress/icons';
|
|
@@ -84,20 +84,36 @@ function SearchControl({
|
|
|
84
84
|
// see https://github.com/WordPress/gutenberg/pull/41166
|
|
85
85
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
86
86
|
}, [isActive, isDark]);
|
|
87
|
+
const clearInput = useCallback(() => {
|
|
88
|
+
onChange('');
|
|
89
|
+
}, [onChange]);
|
|
90
|
+
const onPress = useCallback(() => {
|
|
91
|
+
setIsActive(true);
|
|
92
|
+
inputRef.current?.focus();
|
|
93
|
+
}, []);
|
|
94
|
+
const onFocus = useCallback(() => {
|
|
95
|
+
setIsActive(true);
|
|
96
|
+
}, []);
|
|
97
|
+
const onCancel = useCallback(() => {
|
|
98
|
+
clearTimeout(onCancelTimer.current);
|
|
99
|
+
onCancelTimer.current = setTimeout(() => {
|
|
100
|
+
inputRef.current?.blur();
|
|
101
|
+
clearInput();
|
|
102
|
+
setIsActive(false);
|
|
103
|
+
}, 0);
|
|
104
|
+
}, [clearInput]);
|
|
105
|
+
const onKeyboardDidHide = useCallback(() => {
|
|
106
|
+
if (!isIOS) {
|
|
107
|
+
onCancel();
|
|
108
|
+
}
|
|
109
|
+
}, [isIOS, onCancel]);
|
|
87
110
|
useEffect(() => {
|
|
88
|
-
const keyboardHideSubscription = Keyboard.addListener('keyboardDidHide',
|
|
89
|
-
if (!isIOS) {
|
|
90
|
-
onCancel();
|
|
91
|
-
}
|
|
92
|
-
});
|
|
111
|
+
const keyboardHideSubscription = Keyboard.addListener('keyboardDidHide', onKeyboardDidHide);
|
|
93
112
|
return () => {
|
|
94
113
|
clearTimeout(onCancelTimer.current);
|
|
95
114
|
keyboardHideSubscription.remove();
|
|
96
115
|
};
|
|
97
|
-
|
|
98
|
-
// see https://github.com/WordPress/gutenberg/pull/41166
|
|
99
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
100
|
-
}, []);
|
|
116
|
+
}, [onKeyboardDidHide]);
|
|
101
117
|
const {
|
|
102
118
|
'search-control__container': containerStyle,
|
|
103
119
|
'search-control__inner-container': innerContainerStyle,
|
|
@@ -112,16 +128,6 @@ function SearchControl({
|
|
|
112
128
|
'search-control__icon': iconStyle,
|
|
113
129
|
'search-control__right-icon': rightIconStyle
|
|
114
130
|
} = currentStyles;
|
|
115
|
-
function clearInput() {
|
|
116
|
-
onChange('');
|
|
117
|
-
}
|
|
118
|
-
function onCancel() {
|
|
119
|
-
onCancelTimer.current = setTimeout(() => {
|
|
120
|
-
inputRef.current.blur();
|
|
121
|
-
clearInput();
|
|
122
|
-
setIsActive(false);
|
|
123
|
-
}, 0);
|
|
124
|
-
}
|
|
125
131
|
function renderLeftButton() {
|
|
126
132
|
const button = !isIOS && isActive ? createElement(Button, {
|
|
127
133
|
label: __('Cancel search'),
|
|
@@ -172,10 +178,7 @@ function SearchControl({
|
|
|
172
178
|
}
|
|
173
179
|
return createElement(TouchableOpacity, {
|
|
174
180
|
style: containerStyle,
|
|
175
|
-
onPress:
|
|
176
|
-
setIsActive(true);
|
|
177
|
-
inputRef.current.focus();
|
|
178
|
-
},
|
|
181
|
+
onPress: onPress,
|
|
179
182
|
activeOpacity: 1
|
|
180
183
|
}, createElement(View, {
|
|
181
184
|
style: innerContainerStyle
|
|
@@ -186,7 +189,7 @@ function SearchControl({
|
|
|
186
189
|
style: formInputStyle,
|
|
187
190
|
placeholderTextColor: placeholderStyle?.color,
|
|
188
191
|
onChangeText: onChange,
|
|
189
|
-
onFocus:
|
|
192
|
+
onFocus: onFocus,
|
|
190
193
|
value: value,
|
|
191
194
|
placeholder: placeholder
|
|
192
195
|
}), renderRightButton()), isActive && renderCancel()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TextInput","Text","View","TouchableOpacity","Platform","useColorScheme","Keyboard","useState","useRef","useMemo","useEffect","__","Button","Gridicons","Icon","cancelCircleFilled","cancelCircleFilledIcon","arrowLeft","arrowLeftIcon","close","closeIcon","allStyles","platformStyles","baseStyles","selector","selectModifiedStyles","styles","modifier","modifierMatcher","RegExp","modifierSelectors","Object","keys","filter","match","reduce","modifiedStyles","modifierSelector","blockElementSelector","split","mergeStyles","updateStyles","selectors","forEach","SearchControl","value","onChange","placeholder","isActive","setIsActive","currentStyles","setCurrentStyles","isDark","inputRef","onCancelTimer","isIOS","OS","darkStyles","activeStyles","activeDarkStyles","futureStyles","mergeFutureStyles","shouldUseConditions","shouldUseModified","every","should","updatedStyles","keyboardHideSubscription","addListener","onCancel","clearTimeout","current","remove","containerStyle","innerContainerStyle","inputContainerStyle","formInputStyle","placeholderStyle","inputButtonStyle","inputButtonLeftStyle","inputButtonRightStyle","cancelButtonStyle","cancelButtonTextStyle","iconStyle","rightIconStyle","clearInput","setTimeout","blur","renderLeftButton","button","createElement","label","icon","onClick","style","search","fill","color","renderRightButton","renderCancel","onPress","accessible","accessibilityRole","accessibilityLabel","accessibilityHint","focus","activeOpacity","ref","placeholderTextColor","onChangeText","onFocus"],"sources":["@wordpress/components/src/search-control/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tTextInput,\n\tText,\n\tView,\n\tTouchableOpacity,\n\tPlatform,\n\tuseColorScheme,\n\tKeyboard,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useRef, useMemo, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button, Gridicons } from '@wordpress/components';\nimport {\n\tIcon,\n\tcancelCircleFilled as cancelCircleFilledIcon,\n\tarrowLeft as arrowLeftIcon,\n\tclose as closeIcon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport allStyles from './style.scss';\nimport platformStyles from './platform-style.scss';\n\n// Merge platform specific styles with the default styles.\nconst baseStyles = { ...allStyles };\nfor ( const selector in platformStyles ) {\n\tbaseStyles[ selector ] = {\n\t\t...baseStyles[ selector ],\n\t\t...platformStyles[ selector ],\n\t};\n}\n\nfunction selectModifiedStyles( styles, modifier ) {\n\tconst modifierMatcher = new RegExp( `--${ modifier }$` );\n\tconst modifierSelectors = Object.keys( styles ).filter( ( selector ) =>\n\t\tselector.match( modifierMatcher )\n\t);\n\n\treturn modifierSelectors.reduce( ( modifiedStyles, modifierSelector ) => {\n\t\tconst blockElementSelector = modifierSelector.split( '--' )[ 0 ];\n\t\tmodifiedStyles[ blockElementSelector ] = styles[ modifierSelector ];\n\t\treturn modifiedStyles;\n\t}, {} );\n}\n\nfunction mergeStyles( styles, updateStyles, selectors ) {\n\tselectors.forEach( ( selector ) => {\n\t\tstyles[ selector ] = {\n\t\t\t...styles[ selector ],\n\t\t\t...updateStyles[ selector ],\n\t\t};\n\t} );\n\n\treturn styles;\n}\n\nfunction SearchControl( {\n\tvalue,\n\tonChange,\n\tplaceholder = __( 'Search blocks' ),\n} ) {\n\tconst [ isActive, setIsActive ] = useState( false );\n\tconst [ currentStyles, setCurrentStyles ] = useState( baseStyles );\n\n\tconst isDark = useColorScheme() === 'dark';\n\tconst inputRef = useRef();\n\tconst onCancelTimer = useRef();\n\n\tconst isIOS = Platform.OS === 'ios';\n\n\tconst darkStyles = useMemo( () => {\n\t\treturn selectModifiedStyles( baseStyles, 'dark' );\n\t}, [] );\n\n\tconst activeStyles = useMemo( () => {\n\t\treturn selectModifiedStyles( baseStyles, 'active' );\n\t}, [] );\n\n\tconst activeDarkStyles = useMemo( () => {\n\t\treturn selectModifiedStyles( baseStyles, 'active-dark' );\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tlet futureStyles = { ...baseStyles };\n\n\t\tfunction mergeFutureStyles( modifiedStyles, shouldUseConditions ) {\n\t\t\tconst shouldUseModified = shouldUseConditions.every(\n\t\t\t\t( should ) => should\n\t\t\t);\n\n\t\t\tconst updatedStyles = shouldUseModified\n\t\t\t\t? modifiedStyles\n\t\t\t\t: futureStyles;\n\n\t\t\tconst selectors = Object.keys( modifiedStyles );\n\n\t\t\tfutureStyles = mergeStyles(\n\t\t\t\tfutureStyles,\n\t\t\t\tupdatedStyles,\n\t\t\t\tselectors\n\t\t\t);\n\t\t}\n\n\t\tmergeFutureStyles( activeStyles, [ isActive ] );\n\t\tmergeFutureStyles( darkStyles, [ isDark ] );\n\t\tmergeFutureStyles( activeDarkStyles, [ isActive, isDark ] );\n\n\t\tsetCurrentStyles( futureStyles );\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ isActive, isDark ] );\n\n\tuseEffect( () => {\n\t\tconst keyboardHideSubscription = Keyboard.addListener(\n\t\t\t'keyboardDidHide',\n\t\t\t() => {\n\t\t\t\tif ( ! isIOS ) {\n\t\t\t\t\tonCancel();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\treturn () => {\n\t\t\tclearTimeout( onCancelTimer.current );\n\t\t\tkeyboardHideSubscription.remove();\n\t\t};\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tconst {\n\t\t'search-control__container': containerStyle,\n\t\t'search-control__inner-container': innerContainerStyle,\n\t\t'search-control__input-container': inputContainerStyle,\n\t\t'search-control__form-input': formInputStyle,\n\t\t'search-control__form-input-placeholder': placeholderStyle,\n\t\t'search-control__input-button': inputButtonStyle,\n\t\t'search-control__input-button-left': inputButtonLeftStyle,\n\t\t'search-control__input-button-right': inputButtonRightStyle,\n\t\t'search-control__cancel-button': cancelButtonStyle,\n\t\t'search-control__cancel-button-text': cancelButtonTextStyle,\n\t\t'search-control__icon': iconStyle,\n\t\t'search-control__right-icon': rightIconStyle,\n\t} = currentStyles;\n\n\tfunction clearInput() {\n\t\tonChange( '' );\n\t}\n\n\tfunction onCancel() {\n\t\tonCancelTimer.current = setTimeout( () => {\n\t\t\tinputRef.current.blur();\n\t\t\tclearInput();\n\t\t\tsetIsActive( false );\n\t\t}, 0 );\n\t}\n\n\tfunction renderLeftButton() {\n\t\tconst button =\n\t\t\t! isIOS && isActive ? (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={ __( 'Cancel search' ) }\n\t\t\t\t\ticon={ arrowLeftIcon }\n\t\t\t\t\tonClick={ onCancel }\n\t\t\t\t\tstyle={ iconStyle }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Icon icon={ Gridicons.search } fill={ iconStyle?.color } />\n\t\t\t);\n\n\t\treturn (\n\t\t\t<View style={ [ inputButtonStyle, inputButtonLeftStyle ] }>\n\t\t\t\t{ button }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tfunction renderRightButton() {\n\t\tlet button;\n\n\t\t// Add a View element to properly center the input placeholder via flexbox.\n\t\tif ( isIOS && ! isActive ) {\n\t\t\tbutton = <View />;\n\t\t}\n\n\t\tif ( !! value ) {\n\t\t\tbutton = (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={ __( 'Clear search' ) }\n\t\t\t\t\ticon={ isIOS ? cancelCircleFilledIcon : closeIcon }\n\t\t\t\t\tonClick={ clearInput }\n\t\t\t\t\tstyle={ [ iconStyle, rightIconStyle ] }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<View style={ [ inputButtonStyle, inputButtonRightStyle ] }>\n\t\t\t\t{ button }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tfunction renderCancel() {\n\t\tif ( ! isIOS ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\t<View style={ cancelButtonStyle }>\n\t\t\t\t<Text\n\t\t\t\t\tonPress={ onCancel }\n\t\t\t\t\tstyle={ cancelButtonTextStyle }\n\t\t\t\t\taccessible={ true }\n\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\taccessibilityLabel={ __( 'Cancel search' ) }\n\t\t\t\t\taccessibilityHint={ __( 'Cancel search' ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</Text>\n\t\t\t</View>\n\t\t);\n\t}\n\n\treturn (\n\t\t<TouchableOpacity\n\t\t\tstyle={ containerStyle }\n\t\t\tonPress={ () => {\n\t\t\t\tsetIsActive( true );\n\t\t\t\tinputRef.current.focus();\n\t\t\t} }\n\t\t\tactiveOpacity={ 1 }\n\t\t>\n\t\t\t<View style={ innerContainerStyle }>\n\t\t\t\t<View style={ inputContainerStyle }>\n\t\t\t\t\t{ renderLeftButton() }\n\t\t\t\t\t<TextInput\n\t\t\t\t\t\tref={ inputRef }\n\t\t\t\t\t\tstyle={ formInputStyle }\n\t\t\t\t\t\tplaceholderTextColor={ placeholderStyle?.color }\n\t\t\t\t\t\tonChangeText={ onChange }\n\t\t\t\t\t\tonFocus={ () => setIsActive( true ) }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\t/>\n\t\t\t\t\t{ renderRightButton() }\n\t\t\t\t</View>\n\t\t\t\t{ isActive && renderCancel() }\n\t\t\t</View>\n\t\t</TouchableOpacity>\n\t);\n}\n\nexport default SearchControl;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,SAAS,EACTC,IAAI,EACJC,IAAI,EACJC,gBAAgB,EAChBC,QAAQ,EACRC,cAAc,EACdC,QAAQ,QACF,cAAc;;AAErB;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,MAAM,EAAEC,OAAO,EAAEC,SAAS,QAAQ,oBAAoB;AACzE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,EAAEC,SAAS,QAAQ,uBAAuB;AACzD,SACCC,IAAI,EACJC,kBAAkB,IAAIC,sBAAsB,EAC5CC,SAAS,IAAIC,aAAa,EAC1BC,KAAK,IAAIC,SAAS,QACZ,kBAAkB;;AAEzB;AACA;AACA;AACA,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,cAAc,MAAM,uBAAuB;;AAElD;AACA,MAAMC,UAAU,GAAG;EAAE,GAAGF;AAAU,CAAC;AACnC,KAAM,MAAMG,QAAQ,IAAIF,cAAc,EAAG;EACxCC,UAAU,CAAEC,QAAQ,CAAE,GAAG;IACxB,GAAGD,UAAU,CAAEC,QAAQ,CAAE;IACzB,GAAGF,cAAc,CAAEE,QAAQ;EAC5B,CAAC;AACF;AAEA,SAASC,oBAAoBA,CAAEC,MAAM,EAAEC,QAAQ,EAAG;EACjD,MAAMC,eAAe,GAAG,IAAIC,MAAM,CAAG,KAAKF,QAAU,GAAG,CAAC;EACxD,MA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xB2B,OAAO,EAAGA,CAAA,KAAM;MACfnD,WAAW,CAAE,IAAK,CAAC;MACnBI,QAAQ,CAACkB,OAAO,CAACkC,KAAK,CAAC,CAAC;IACzB,CAAG;IACHC,aAAa,EAAG;EAAG,GAEnBhB,aAAA,CAACxF,IAAI;IAAC4F,KAAK,EAAGpB;EAAqB,GAClCgB,aAAA,CAACxF,IAAI;IAAC4F,KAAK,EAAGnB;EAAqB,GAChCa,gBAAgB,CAAC,CAAC,EACpBE,aAAA,CAAC1F,SAAS;IACT2G,GAAG,EAAGtD,QAAU;IAChByC,KAAK,EAAGlB,cAAgB;IACxBgC,oBAAoB,EAAG/B,gBAAgB,EAAEoB,KAAO;IAChDY,YAAY,EAAG/D,QAAU;IACzBgE,OAAO,EAAGA,CAAA,KAAM7D,WAAW,CAAE,IAAK,CAAG;IACrCJ,KAAK,EAAGA,KAAO;IACfE,WAAW,EAAGA;EAAa,CAC3B,CAAC,EACAmD,iBAAiB,CAAC,CACf,CAAC,EACLlD,QAAQ,IAAImD,YAAY,CAAC,CACtB,CACW,CAAC;AAErB;AAEA,eAAevD,aAAa"}
|
|
1
|
+
{"version":3,"names":["TextInput","Text","View","TouchableOpacity","Platform","useColorScheme","Keyboard","useState","useRef","useMemo","useEffect","useCallback","__","Button","Gridicons","Icon","cancelCircleFilled","cancelCircleFilledIcon","arrowLeft","arrowLeftIcon","close","closeIcon","allStyles","platformStyles","baseStyles","selector","selectModifiedStyles","styles","modifier","modifierMatcher","RegExp","modifierSelectors","Object","keys","filter","match","reduce","modifiedStyles","modifierSelector","blockElementSelector","split","mergeStyles","updateStyles","selectors","forEach","SearchControl","value","onChange","placeholder","isActive","setIsActive","currentStyles","setCurrentStyles","isDark","inputRef","onCancelTimer","isIOS","OS","darkStyles","activeStyles","activeDarkStyles","futureStyles","mergeFutureStyles","shouldUseConditions","shouldUseModified","every","should","updatedStyles","clearInput","onPress","current","focus","onFocus","onCancel","clearTimeout","setTimeout","blur","onKeyboardDidHide","keyboardHideSubscription","addListener","remove","containerStyle","innerContainerStyle","inputContainerStyle","formInputStyle","placeholderStyle","inputButtonStyle","inputButtonLeftStyle","inputButtonRightStyle","cancelButtonStyle","cancelButtonTextStyle","iconStyle","rightIconStyle","renderLeftButton","button","createElement","label","icon","onClick","style","search","fill","color","renderRightButton","renderCancel","accessible","accessibilityRole","accessibilityLabel","accessibilityHint","activeOpacity","ref","placeholderTextColor","onChangeText"],"sources":["@wordpress/components/src/search-control/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tTextInput,\n\tText,\n\tView,\n\tTouchableOpacity,\n\tPlatform,\n\tuseColorScheme,\n\tKeyboard,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tuseRef,\n\tuseMemo,\n\tuseEffect,\n\tuseCallback,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button, Gridicons } from '@wordpress/components';\nimport {\n\tIcon,\n\tcancelCircleFilled as cancelCircleFilledIcon,\n\tarrowLeft as arrowLeftIcon,\n\tclose as closeIcon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport allStyles from './style.scss';\nimport platformStyles from './platform-style.scss';\n\n// Merge platform specific styles with the default styles.\nconst baseStyles = { ...allStyles };\nfor ( const selector in platformStyles ) {\n\tbaseStyles[ selector ] = {\n\t\t...baseStyles[ selector ],\n\t\t...platformStyles[ selector ],\n\t};\n}\n\nfunction selectModifiedStyles( styles, modifier ) {\n\tconst modifierMatcher = new RegExp( `--${ modifier }$` );\n\tconst modifierSelectors = Object.keys( styles ).filter( ( selector ) =>\n\t\tselector.match( modifierMatcher )\n\t);\n\n\treturn modifierSelectors.reduce( ( modifiedStyles, modifierSelector ) => {\n\t\tconst blockElementSelector = modifierSelector.split( '--' )[ 0 ];\n\t\tmodifiedStyles[ blockElementSelector ] = styles[ modifierSelector ];\n\t\treturn modifiedStyles;\n\t}, {} );\n}\n\nfunction mergeStyles( styles, updateStyles, selectors ) {\n\tselectors.forEach( ( selector ) => {\n\t\tstyles[ selector ] = {\n\t\t\t...styles[ selector ],\n\t\t\t...updateStyles[ selector ],\n\t\t};\n\t} );\n\n\treturn styles;\n}\n\nfunction SearchControl( {\n\tvalue,\n\tonChange,\n\tplaceholder = __( 'Search blocks' ),\n} ) {\n\tconst [ isActive, setIsActive ] = useState( false );\n\tconst [ currentStyles, setCurrentStyles ] = useState( baseStyles );\n\n\tconst isDark = useColorScheme() === 'dark';\n\tconst inputRef = useRef();\n\tconst onCancelTimer = useRef();\n\n\tconst isIOS = Platform.OS === 'ios';\n\n\tconst darkStyles = useMemo( () => {\n\t\treturn selectModifiedStyles( baseStyles, 'dark' );\n\t}, [] );\n\n\tconst activeStyles = useMemo( () => {\n\t\treturn selectModifiedStyles( baseStyles, 'active' );\n\t}, [] );\n\n\tconst activeDarkStyles = useMemo( () => {\n\t\treturn selectModifiedStyles( baseStyles, 'active-dark' );\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tlet futureStyles = { ...baseStyles };\n\n\t\tfunction mergeFutureStyles( modifiedStyles, shouldUseConditions ) {\n\t\t\tconst shouldUseModified = shouldUseConditions.every(\n\t\t\t\t( should ) => should\n\t\t\t);\n\n\t\t\tconst updatedStyles = shouldUseModified\n\t\t\t\t? modifiedStyles\n\t\t\t\t: futureStyles;\n\n\t\t\tconst selectors = Object.keys( modifiedStyles );\n\n\t\t\tfutureStyles = mergeStyles(\n\t\t\t\tfutureStyles,\n\t\t\t\tupdatedStyles,\n\t\t\t\tselectors\n\t\t\t);\n\t\t}\n\n\t\tmergeFutureStyles( activeStyles, [ isActive ] );\n\t\tmergeFutureStyles( darkStyles, [ isDark ] );\n\t\tmergeFutureStyles( activeDarkStyles, [ isActive, isDark ] );\n\n\t\tsetCurrentStyles( futureStyles );\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ isActive, isDark ] );\n\n\tconst clearInput = useCallback( () => {\n\t\tonChange( '' );\n\t}, [ onChange ] );\n\n\tconst onPress = useCallback( () => {\n\t\tsetIsActive( true );\n\t\tinputRef.current?.focus();\n\t}, [] );\n\n\tconst onFocus = useCallback( () => {\n\t\tsetIsActive( true );\n\t}, [] );\n\n\tconst onCancel = useCallback( () => {\n\t\tclearTimeout( onCancelTimer.current );\n\t\tonCancelTimer.current = setTimeout( () => {\n\t\t\tinputRef.current?.blur();\n\t\t\tclearInput();\n\t\t\tsetIsActive( false );\n\t\t}, 0 );\n\t}, [ clearInput ] );\n\n\tconst onKeyboardDidHide = useCallback( () => {\n\t\tif ( ! isIOS ) {\n\t\t\tonCancel();\n\t\t}\n\t}, [ isIOS, onCancel ] );\n\n\tuseEffect( () => {\n\t\tconst keyboardHideSubscription = Keyboard.addListener(\n\t\t\t'keyboardDidHide',\n\t\t\tonKeyboardDidHide\n\t\t);\n\t\treturn () => {\n\t\t\tclearTimeout( onCancelTimer.current );\n\t\t\tkeyboardHideSubscription.remove();\n\t\t};\n\t}, [ onKeyboardDidHide ] );\n\n\tconst {\n\t\t'search-control__container': containerStyle,\n\t\t'search-control__inner-container': innerContainerStyle,\n\t\t'search-control__input-container': inputContainerStyle,\n\t\t'search-control__form-input': formInputStyle,\n\t\t'search-control__form-input-placeholder': placeholderStyle,\n\t\t'search-control__input-button': inputButtonStyle,\n\t\t'search-control__input-button-left': inputButtonLeftStyle,\n\t\t'search-control__input-button-right': inputButtonRightStyle,\n\t\t'search-control__cancel-button': cancelButtonStyle,\n\t\t'search-control__cancel-button-text': cancelButtonTextStyle,\n\t\t'search-control__icon': iconStyle,\n\t\t'search-control__right-icon': rightIconStyle,\n\t} = currentStyles;\n\n\tfunction renderLeftButton() {\n\t\tconst button =\n\t\t\t! isIOS && isActive ? (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={ __( 'Cancel search' ) }\n\t\t\t\t\ticon={ arrowLeftIcon }\n\t\t\t\t\tonClick={ onCancel }\n\t\t\t\t\tstyle={ iconStyle }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Icon icon={ Gridicons.search } fill={ iconStyle?.color } />\n\t\t\t);\n\n\t\treturn (\n\t\t\t<View style={ [ inputButtonStyle, inputButtonLeftStyle ] }>\n\t\t\t\t{ button }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tfunction renderRightButton() {\n\t\tlet button;\n\n\t\t// Add a View element to properly center the input placeholder via flexbox.\n\t\tif ( isIOS && ! isActive ) {\n\t\t\tbutton = <View />;\n\t\t}\n\n\t\tif ( !! value ) {\n\t\t\tbutton = (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={ __( 'Clear search' ) }\n\t\t\t\t\ticon={ isIOS ? cancelCircleFilledIcon : closeIcon }\n\t\t\t\t\tonClick={ clearInput }\n\t\t\t\t\tstyle={ [ iconStyle, rightIconStyle ] }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<View style={ [ inputButtonStyle, inputButtonRightStyle ] }>\n\t\t\t\t{ button }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tfunction renderCancel() {\n\t\tif ( ! isIOS ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\t<View style={ cancelButtonStyle }>\n\t\t\t\t<Text\n\t\t\t\t\tonPress={ onCancel }\n\t\t\t\t\tstyle={ cancelButtonTextStyle }\n\t\t\t\t\taccessible={ true }\n\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\taccessibilityLabel={ __( 'Cancel search' ) }\n\t\t\t\t\taccessibilityHint={ __( 'Cancel search' ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</Text>\n\t\t\t</View>\n\t\t);\n\t}\n\n\treturn (\n\t\t<TouchableOpacity\n\t\t\tstyle={ containerStyle }\n\t\t\tonPress={ onPress }\n\t\t\tactiveOpacity={ 1 }\n\t\t>\n\t\t\t<View style={ innerContainerStyle }>\n\t\t\t\t<View style={ inputContainerStyle }>\n\t\t\t\t\t{ renderLeftButton() }\n\t\t\t\t\t<TextInput\n\t\t\t\t\t\tref={ inputRef }\n\t\t\t\t\t\tstyle={ formInputStyle }\n\t\t\t\t\t\tplaceholderTextColor={ placeholderStyle?.color }\n\t\t\t\t\t\tonChangeText={ onChange }\n\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\t/>\n\t\t\t\t\t{ renderRightButton() }\n\t\t\t\t</View>\n\t\t\t\t{ isActive && renderCancel() }\n\t\t\t</View>\n\t\t</TouchableOpacity>\n\t);\n}\n\nexport default SearchControl;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,SAAS,EACTC,IAAI,EACJC,IAAI,EACJC,gBAAgB,EAChBC,QAAQ,EACRC,cAAc,EACdC,QAAQ,QACF,cAAc;;AAErB;AACA;AACA;AACA,SACCC,QAAQ,EACRC,MAAM,EACNC,OAAO,EACPC,SAAS,EACTC,WAAW,QACL,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,EAAEC,SAAS,QAAQ,uBAAuB;AACzD,SACCC,IAAI,EACJC,kBAAkB,IAAIC,sBAAsB,EAC5CC,SAAS,IAAIC,aAAa,EAC1BC,KAAK,IAAIC,SAAS,QACZ,kBAAkB;;AAEzB;AACA;AACA;AACA,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,cAAc,MAAM,uBAAuB;;AAElD;AACA,MAAMC,UAAU,GAAG;EAAE,GAAGF;AAAU,CAAC;AACnC,KAAM,MAAMG,QAAQ,IAAIF,cAAc,EAAG;EACxCC,UAAU,CAAEC,QAAQ,CAAE,GAAG;IACxB,GAAGD,UAAU,CAAEC,QAAQ,CAAE;IACzB,GAAGF,cAAc,CAAEE,QAAQ;EAC5B,CAAC;AACF;AAEA,SAASC,oBAAoBA,CAAEC,MAAM,EAAEC,QAAQ,EAAG;EACjD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
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Shortcut component is used to display keyboard shortcuts, and it can be customized with a custom display and aria label if needed.
|
|
8
|
+
*
|
|
9
|
+
* ```jsx
|
|
10
|
+
* import { Shortcut } from '@wordpress/components';
|
|
11
|
+
*
|
|
12
|
+
* const MyShortcut = () => {
|
|
13
|
+
* return (
|
|
14
|
+
* <Shortcut shortcut={{ display: 'Ctrl + S', ariaLabel: 'Save' }} />
|
|
15
|
+
* );
|
|
16
|
+
* };
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
6
19
|
function Shortcut(props) {
|
|
7
20
|
const {
|
|
8
21
|
shortcut,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Shortcut","props","shortcut","className","displayText","ariaLabel","display","createElement"],"sources":["@wordpress/components/src/shortcut/index.tsx"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { ShortcutProps } from './types';\n\nfunction Shortcut( props: ShortcutProps ) {\n\tconst { shortcut, className } = props;\n\n\tif ( ! shortcut ) {\n\t\treturn null;\n\t}\n\n\tlet displayText;\n\tlet ariaLabel;\n\n\tif ( typeof shortcut === 'string' ) {\n\t\tdisplayText = shortcut;\n\t}\n\n\tif ( shortcut !== null && typeof shortcut === 'object' ) {\n\t\tdisplayText = shortcut.display;\n\t\tariaLabel = shortcut.ariaLabel;\n\t}\n\n\treturn (\n\t\t<span className={ className } aria-label={ ariaLabel }>\n\t\t\t{ displayText }\n\t\t</span>\n\t);\n}\n\nexport default Shortcut;\n"],"mappings":";AAAA;AACA;AACA;;AAGA,SAASA,QAAQA,CAAEC,KAAoB,EAAG;EACzC,MAAM;IAAEC,QAAQ;IAAEC;EAAU,CAAC,GAAGF,KAAK;EAErC,IAAK,CAAEC,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,IAAIE,WAAW;EACf,IAAIC,SAAS;EAEb,IAAK,OAAOH,QAAQ,KAAK,QAAQ,EAAG;IACnCE,WAAW,GAAGF,QAAQ;EACvB;EAEA,IAAKA,QAAQ,KAAK,IAAI,IAAI,OAAOA,QAAQ,KAAK,QAAQ,EAAG;IACxDE,WAAW,GAAGF,QAAQ,CAACI,OAAO;IAC9BD,SAAS,GAAGH,QAAQ,CAACG,SAAS;EAC/B;EAEA,OACCE,aAAA;IAAMJ,SAAS,EAAGA,SAAW;IAAC,cAAaE;EAAW,GACnDD,WACG,CAAC;AAET;AAEA,eAAeJ,QAAQ"}
|
|
1
|
+
{"version":3,"names":["Shortcut","props","shortcut","className","displayText","ariaLabel","display","createElement"],"sources":["@wordpress/components/src/shortcut/index.tsx"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { ShortcutProps } from './types';\n\n/**\n * Shortcut component is used to display keyboard shortcuts, and it can be customized with a custom display and aria label if needed.\n *\n * ```jsx\n * import { Shortcut } from '@wordpress/components';\n *\n * const MyShortcut = () => {\n * \treturn (\n * \t\t<Shortcut shortcut={{ display: 'Ctrl + S', ariaLabel: 'Save' }} />\n * \t);\n * };\n * ```\n */\nfunction Shortcut( props: ShortcutProps ) {\n\tconst { shortcut, className } = props;\n\n\tif ( ! shortcut ) {\n\t\treturn null;\n\t}\n\n\tlet displayText;\n\tlet ariaLabel;\n\n\tif ( typeof shortcut === 'string' ) {\n\t\tdisplayText = shortcut;\n\t}\n\n\tif ( shortcut !== null && typeof shortcut === 'object' ) {\n\t\tdisplayText = shortcut.display;\n\t\tariaLabel = shortcut.ariaLabel;\n\t}\n\n\treturn (\n\t\t<span className={ className } aria-label={ ariaLabel }>\n\t\t\t{ displayText }\n\t\t</span>\n\t);\n}\n\nexport default Shortcut;\n"],"mappings":";AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,QAAQA,CAAEC,KAAoB,EAAG;EACzC,MAAM;IAAEC,QAAQ;IAAEC;EAAU,CAAC,GAAGF,KAAK;EAErC,IAAK,CAAEC,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,IAAIE,WAAW;EACf,IAAIC,SAAS;EAEb,IAAK,OAAOH,QAAQ,KAAK,QAAQ,EAAG;IACnCE,WAAW,GAAGF,QAAQ;EACvB;EAEA,IAAKA,QAAQ,KAAK,IAAI,IAAI,OAAOA,QAAQ,KAAK,QAAQ,EAAG;IACxDE,WAAW,GAAGF,QAAQ,CAACI,OAAO;IAC9BD,SAAS,GAAGH,QAAQ,CAACG,SAAS;EAC/B;EAEA,OACCE,aAAA;IAAMJ,SAAS,EAAGA,SAAW;IAAC,cAAaE;EAAW,GACnDD,WACG,CAAC;AAET;AAEA,eAAeJ,QAAQ"}
|
|
@@ -17,7 +17,9 @@ const SlotFillContext = createContext({
|
|
|
17
17
|
updateSlot: () => {},
|
|
18
18
|
unregisterSlot: () => {},
|
|
19
19
|
registerFill: () => {},
|
|
20
|
-
unregisterFill: () => {}
|
|
20
|
+
unregisterFill: () => {},
|
|
21
|
+
// This helps the provider know if it's using the default context value or not.
|
|
22
|
+
isDefault: true
|
|
21
23
|
});
|
|
22
24
|
export default SlotFillContext;
|
|
23
25
|
//# sourceMappingURL=slot-fill-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["proxyMap","createContext","warning","SlotFillContext","slots","fills","registerSlot","SCRIPT_DEBUG","updateSlot","unregisterSlot","registerFill","unregisterFill"],"sources":["@wordpress/components/src/slot-fill/bubbles-virtually/slot-fill-context.js"],"sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport { proxyMap } from 'valtio/utils';\n/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\nimport warning from '@wordpress/warning';\n\nconst SlotFillContext = createContext( {\n\tslots: proxyMap(),\n\tfills: proxyMap(),\n\tregisterSlot: () => {\n\t\twarning(\n\t\t\t'Components must be wrapped within `SlotFillProvider`. ' +\n\t\t\t\t'See https://developer.wordpress.org/block-editor/components/slot-fill/'\n\t\t);\n\t},\n\tupdateSlot: () => {},\n\tunregisterSlot: () => {},\n\tregisterFill: () => {},\n\tunregisterFill: () => {},\n} );\n\nexport default SlotFillContext;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,cAAc;AACvC;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,OAAO,MAAM,oBAAoB;AAExC,MAAMC,eAAe,GAAGF,aAAa,CAAE;EACtCG,KAAK,EAAEJ,QAAQ,CAAC,CAAC;EACjBK,KAAK,EAAEL,QAAQ,CAAC,CAAC;EACjBM,YAAY,EAAEA,CAAA,KAAM;IACnB,OAAAC,YAAA,oBAAAA,YAAA,YAAAL,OAAO,CACN,wDAAwD,GACvD,wEACF,CAAC;EACF,CAAC;EACDM,UAAU,EAAEA,CAAA,KAAM,CAAC,CAAC;EACpBC,cAAc,EAAEA,CAAA,KAAM,CAAC,CAAC;EACxBC,YAAY,EAAEA,CAAA,KAAM,CAAC,CAAC;EACtBC,cAAc,EAAEA,CAAA,KAAM,CAAC;
|
|
1
|
+
{"version":3,"names":["proxyMap","createContext","warning","SlotFillContext","slots","fills","registerSlot","SCRIPT_DEBUG","updateSlot","unregisterSlot","registerFill","unregisterFill","isDefault"],"sources":["@wordpress/components/src/slot-fill/bubbles-virtually/slot-fill-context.js"],"sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport { proxyMap } from 'valtio/utils';\n/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\nimport warning from '@wordpress/warning';\n\nconst SlotFillContext = createContext( {\n\tslots: proxyMap(),\n\tfills: proxyMap(),\n\tregisterSlot: () => {\n\t\twarning(\n\t\t\t'Components must be wrapped within `SlotFillProvider`. ' +\n\t\t\t\t'See https://developer.wordpress.org/block-editor/components/slot-fill/'\n\t\t);\n\t},\n\tupdateSlot: () => {},\n\tunregisterSlot: () => {},\n\tregisterFill: () => {},\n\tunregisterFill: () => {},\n\n\t// This helps the provider know if it's using the default context value or not.\n\tisDefault: true,\n} );\n\nexport default SlotFillContext;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,cAAc;AACvC;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,OAAO,MAAM,oBAAoB;AAExC,MAAMC,eAAe,GAAGF,aAAa,CAAE;EACtCG,KAAK,EAAEJ,QAAQ,CAAC,CAAC;EACjBK,KAAK,EAAEL,QAAQ,CAAC,CAAC;EACjBM,YAAY,EAAEA,CAAA,KAAM;IACnB,OAAAC,YAAA,oBAAAA,YAAA,YAAAL,OAAO,CACN,wDAAwD,GACvD,wEACF,CAAC;EACF,CAAC;EACDM,UAAU,EAAEA,CAAA,KAAM,CAAC,CAAC;EACpBC,cAAc,EAAEA,CAAA,KAAM,CAAC,CAAC;EACxBC,YAAY,EAAEA,CAAA,KAAM,CAAC,CAAC;EACtBC,cAAc,EAAEA,CAAA,KAAM,CAAC,CAAC;EAExB;EACAC,SAAS,EAAE;AACZ,CAAE,CAAC;AAEH,eAAeT,eAAe"}
|
|
@@ -9,13 +9,18 @@ import { useMergeRefs } from '@wordpress/compose';
|
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
|
+
import { View } from '../../view';
|
|
12
13
|
import SlotFillContext from './slot-fill-context';
|
|
13
|
-
function Slot({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
function Slot(props, forwardedRef) {
|
|
15
|
+
const {
|
|
16
|
+
name,
|
|
17
|
+
fillProps = {},
|
|
18
|
+
as,
|
|
19
|
+
// `children` is not allowed. However, if it is passed,
|
|
20
|
+
// it will be displayed as is, so remove `children`.
|
|
21
|
+
children,
|
|
22
|
+
...restProps
|
|
23
|
+
} = props;
|
|
19
24
|
const {
|
|
20
25
|
registerSlot,
|
|
21
26
|
unregisterSlot,
|
|
@@ -38,9 +43,10 @@ function Slot({
|
|
|
38
43
|
useLayoutEffect(() => {
|
|
39
44
|
registry.updateSlot(name, fillProps);
|
|
40
45
|
});
|
|
41
|
-
return createElement(
|
|
46
|
+
return createElement(View, {
|
|
47
|
+
as: as,
|
|
42
48
|
ref: useMergeRefs([forwardedRef, ref]),
|
|
43
|
-
...
|
|
49
|
+
...restProps
|
|
44
50
|
});
|
|
45
51
|
}
|
|
46
52
|
export default forwardRef(Slot);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRef","useLayoutEffect","useContext","forwardRef","useMergeRefs","SlotFillContext","Slot","name","fillProps","as","
|
|
1
|
+
{"version":3,"names":["useRef","useLayoutEffect","useContext","forwardRef","useMergeRefs","View","SlotFillContext","Slot","props","forwardedRef","name","fillProps","as","children","restProps","registerSlot","unregisterSlot","registry","ref","updateSlot","createElement"],"sources":["@wordpress/components/src/slot-fill/bubbles-virtually/slot.js"],"sourcesContent":["// @ts-nocheck\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';\n\nfunction Slot( props, forwardedRef ) {\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 { registerSlot, unregisterSlot, ...registry } =\n\t\tuseContext( SlotFillContext );\n\tconst ref = useRef();\n\n\tuseLayoutEffect( () => {\n\t\tregisterSlot( name, ref, fillProps );\n\t\treturn () => {\n\t\t\tunregisterSlot( name, ref );\n\t\t};\n\t\t// Ignore reason: We don't want to unregister and register the slot whenever\n\t\t// `fillProps` change, which would cause the fill to be re-mounted. Instead,\n\t\t// we can just update the slot (see hook below).\n\t\t// For more context, see https://github.com/WordPress/gutenberg/pull/44403#discussion_r994415973\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ registerSlot, unregisterSlot, name ] );\n\t// fillProps may be an update that interacts with the layout, so we\n\t// useLayoutEffect.\n\tuseLayoutEffect( () => {\n\t\tregistry.updateSlot( name, fillProps );\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;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;AAEjD,SAASC,IAAIA,CAAEC,KAAK,EAAEC,YAAY,EAAG;EACpC,MAAM;IACLC,IAAI;IACJC,SAAS,GAAG,CAAC,CAAC;IACdC,EAAE;IACF;IACA;IACAC,QAAQ;IACR,GAAGC;EACJ,CAAC,GAAGN,KAAK;EAET,MAAM;IAAEO,YAAY;IAAEC,cAAc;IAAE,GAAGC;EAAS,CAAC,GAClDf,UAAU,CAAEI,eAAgB,CAAC;EAC9B,MAAMY,GAAG,GAAGlB,MAAM,CAAC,CAAC;EAEpBC,eAAe,CAAE,MAAM;IACtBc,YAAY,CAAEL,IAAI,EAAEQ,GAAG,EAAEP,SAAU,CAAC;IACpC,OAAO,MAAM;MACZK,cAAc,CAAEN,IAAI,EAAEQ,GAAI,CAAC;IAC5B,CAAC;IACD;IACA;IACA;IACA;IACA;EACD,CAAC,EAAE,CAAEH,YAAY,EAAEC,cAAc,EAAEN,IAAI,CAAG,CAAC;EAC3C;EACA;EACAT,eAAe,CAAE,MAAM;IACtBgB,QAAQ,CAACE,UAAU,CAAET,IAAI,EAAEC,SAAU,CAAC;EACvC,CAAE,CAAC;EAEH,OACCS,aAAA,CAACf,IAAI;IACJO,EAAE,EAAGA,EAAI;IACTM,GAAG,EAAGd,YAAY,CAAE,CAAEK,YAAY,EAAES,GAAG,CAAG,CAAG;IAAA,GACxCJ;EAAS,CACd,CAAC;AAEJ;AAEA,eAAeX,UAAU,CAAEI,IAAK,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { createElement, Fragment } from "@wordpress/element";
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
|
-
import { forwardRef } from '@wordpress/element';
|
|
6
|
+
import { forwardRef, useContext } from '@wordpress/element';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
@@ -14,6 +14,7 @@ import BubblesVirtuallyFill from './bubbles-virtually/fill';
|
|
|
14
14
|
import BubblesVirtuallySlot from './bubbles-virtually/slot';
|
|
15
15
|
import BubblesVirtuallySlotFillProvider from './bubbles-virtually/slot-fill-provider';
|
|
16
16
|
import SlotFillProvider from './provider';
|
|
17
|
+
import SlotFillContext from './bubbles-virtually/slot-fill-context';
|
|
17
18
|
export { default as useSlot } from './bubbles-virtually/use-slot';
|
|
18
19
|
export { default as useSlotFills } from './bubbles-virtually/use-slot-fills';
|
|
19
20
|
export function Fill(props) {
|
|
@@ -44,6 +45,10 @@ export function Provider({
|
|
|
44
45
|
children,
|
|
45
46
|
...props
|
|
46
47
|
}) {
|
|
48
|
+
const parent = useContext(SlotFillContext);
|
|
49
|
+
if (!parent.isDefault) {
|
|
50
|
+
return children;
|
|
51
|
+
}
|
|
47
52
|
return createElement(SlotFillProvider, {
|
|
48
53
|
...props
|
|
49
54
|
}, createElement(BubblesVirtuallySlotFillProvider, null, children));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","BaseFill","BaseSlot","BubblesVirtuallyFill","BubblesVirtuallySlot","BubblesVirtuallySlotFillProvider","SlotFillProvider","default","useSlot","useSlotFills","Fill","props","createElement","Fragment","Slot","bubblesVirtually","ref","Provider","children","createSlotFill","key","baseName","description","FillComponent","name","displayName","SlotComponent","__unstableName","createPrivateSlotFill","privateKey","Symbol","privateSlotFill"],"sources":["@wordpress/components/src/slot-fill/index.js"],"sourcesContent":["// @ts-nocheck\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseFill from './fill';\nimport BaseSlot from './slot';\nimport BubblesVirtuallyFill from './bubbles-virtually/fill';\nimport BubblesVirtuallySlot from './bubbles-virtually/slot';\nimport BubblesVirtuallySlotFillProvider from './bubbles-virtually/slot-fill-provider';\nimport SlotFillProvider from './provider';\nexport { default as useSlot } from './bubbles-virtually/use-slot';\nexport { default as useSlotFills } from './bubbles-virtually/use-slot-fills';\n\nexport function Fill( props ) {\n\t// We're adding both Fills here so they can register themselves before\n\t// their respective slot has been registered. Only the Fill that has a slot\n\t// will render. The other one will return null.\n\treturn (\n\t\t<>\n\t\t\t<BaseFill { ...props } />\n\t\t\t<BubblesVirtuallyFill { ...props } />\n\t\t</>\n\t);\n}\nexport const Slot = forwardRef( ( { bubblesVirtually, ...props }, ref ) => {\n\tif ( bubblesVirtually ) {\n\t\treturn <BubblesVirtuallySlot { ...props } ref={ ref } />;\n\t}\n\treturn <BaseSlot { ...props } />;\n} );\n\nexport function Provider( { children, ...props } ) {\n\treturn (\n\t\t<SlotFillProvider { ...props }>\n\t\t\t<BubblesVirtuallySlotFillProvider>\n\t\t\t\t{ children }\n\t\t\t</BubblesVirtuallySlotFillProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport function createSlotFill( key ) {\n\tconst baseName = typeof key === 'symbol' ? key.description : key;\n\tconst FillComponent = ( props ) => <Fill name={ key } { ...props } />;\n\tFillComponent.displayName = `${ baseName }Fill`;\n\n\tconst SlotComponent = ( props ) => <Slot name={ key } { ...props } />;\n\tSlotComponent.displayName = `${ baseName }Slot`;\n\tSlotComponent.__unstableName = key;\n\n\treturn {\n\t\tFill: FillComponent,\n\t\tSlot: SlotComponent,\n\t};\n}\n\nexport const createPrivateSlotFill = ( name ) => {\n\tconst privateKey = Symbol( name );\n\tconst privateSlotFill = createSlotFill( privateKey );\n\n\treturn { privateKey, ...privateSlotFill };\n};\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,oBAAoB;;
|
|
1
|
+
{"version":3,"names":["forwardRef","useContext","BaseFill","BaseSlot","BubblesVirtuallyFill","BubblesVirtuallySlot","BubblesVirtuallySlotFillProvider","SlotFillProvider","SlotFillContext","default","useSlot","useSlotFills","Fill","props","createElement","Fragment","Slot","bubblesVirtually","ref","Provider","children","parent","isDefault","createSlotFill","key","baseName","description","FillComponent","name","displayName","SlotComponent","__unstableName","createPrivateSlotFill","privateKey","Symbol","privateSlotFill"],"sources":["@wordpress/components/src/slot-fill/index.js"],"sourcesContent":["// @ts-nocheck\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseFill from './fill';\nimport BaseSlot from './slot';\nimport BubblesVirtuallyFill from './bubbles-virtually/fill';\nimport BubblesVirtuallySlot from './bubbles-virtually/slot';\nimport BubblesVirtuallySlotFillProvider from './bubbles-virtually/slot-fill-provider';\nimport SlotFillProvider from './provider';\nimport SlotFillContext from './bubbles-virtually/slot-fill-context';\nexport { default as useSlot } from './bubbles-virtually/use-slot';\nexport { default as useSlotFills } from './bubbles-virtually/use-slot-fills';\n\nexport function Fill( props ) {\n\t// We're adding both Fills here so they can register themselves before\n\t// their respective slot has been registered. Only the Fill that has a slot\n\t// will render. The other one will return null.\n\treturn (\n\t\t<>\n\t\t\t<BaseFill { ...props } />\n\t\t\t<BubblesVirtuallyFill { ...props } />\n\t\t</>\n\t);\n}\nexport const Slot = forwardRef( ( { bubblesVirtually, ...props }, ref ) => {\n\tif ( bubblesVirtually ) {\n\t\treturn <BubblesVirtuallySlot { ...props } ref={ ref } />;\n\t}\n\treturn <BaseSlot { ...props } />;\n} );\n\nexport function Provider( { children, ...props } ) {\n\tconst parent = useContext( SlotFillContext );\n\tif ( ! parent.isDefault ) {\n\t\treturn children;\n\t}\n\treturn (\n\t\t<SlotFillProvider { ...props }>\n\t\t\t<BubblesVirtuallySlotFillProvider>\n\t\t\t\t{ children }\n\t\t\t</BubblesVirtuallySlotFillProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport function createSlotFill( key ) {\n\tconst baseName = typeof key === 'symbol' ? key.description : key;\n\tconst FillComponent = ( props ) => <Fill name={ key } { ...props } />;\n\tFillComponent.displayName = `${ baseName }Fill`;\n\n\tconst SlotComponent = ( props ) => <Slot name={ key } { ...props } />;\n\tSlotComponent.displayName = `${ baseName }Slot`;\n\tSlotComponent.__unstableName = key;\n\n\treturn {\n\t\tFill: FillComponent,\n\t\tSlot: SlotComponent,\n\t};\n}\n\nexport const createPrivateSlotFill = ( name ) => {\n\tconst privateKey = Symbol( name );\n\tconst privateSlotFill = createSlotFill( privateKey );\n\n\treturn { privateKey, ...privateSlotFill };\n};\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,QAAQ;AAC7B,OAAOC,QAAQ,MAAM,QAAQ;AAC7B,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,gCAAgC,MAAM,wCAAwC;AACrF,OAAOC,gBAAgB,MAAM,YAAY;AACzC,OAAOC,eAAe,MAAM,uCAAuC;AACnE,SAASC,OAAO,IAAIC,OAAO,QAAQ,8BAA8B;AACjE,SAASD,OAAO,IAAIE,YAAY,QAAQ,oCAAoC;AAE5E,OAAO,SAASC,IAAIA,CAAEC,KAAK,EAAG;EAC7B;EACA;EACA;EACA,OACCC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACZ,QAAQ;IAAA,GAAMW;EAAK,CAAI,CAAC,EAC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AO;IACNZ,IAAI,EAAEe,aAAa;IACnBX,IAAI,EAAEc;EACP,CAAC;AACF;AAEA,OAAO,MAAME,qBAAqB,GAAKJ,IAAI,IAAM;EAChD,MAAMK,UAAU,GAAGC,MAAM,CAAEN,IAAK,CAAC;EACjC,MAAMO,eAAe,GAAGZ,cAAc,CAAEU,UAAW,CAAC;EAEpD,OAAO;IAAEA,UAAU;IAAE,GAAGE;EAAgB,CAAC;AAC1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classNames","StyledSpinner","SpinnerTrack","SpinnerIndicator","forwardRef","UnforwardedSpinner","className","props","forwardedRef","createElement","viewBox","width","height","xmlns","role","focusable","ref","cx","cy","r","vectorEffect","d","Spinner"],"sources":["@wordpress/components/src/spinner/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { StyledSpinner, SpinnerTrack, SpinnerIndicator } from './styles';\nimport type { WordPressComponentProps } from '../ui/context';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\nexport function UnforwardedSpinner(\n\t{ className, ...props }: WordPressComponentProps< {}, 'svg', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\treturn (\n\t\t<StyledSpinner\n\t\t\tclassName={ classNames( 'components-spinner', className ) }\n\t\t\tviewBox=\"0 0 100 100\"\n\t\t\twidth=\"16\"\n\t\t\theight=\"16\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\trole=\"presentation\"\n\t\t\tfocusable=\"false\"\n\t\t\t{ ...props }\n\t\t\tref={ forwardedRef }\n\t\t>\n\t\t\t{ /* Gray circular background */ }\n\t\t\t<SpinnerTrack\n\t\t\t\tcx=\"50\"\n\t\t\t\tcy=\"50\"\n\t\t\t\tr=\"50\"\n\t\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t\t/>\n\n\t\t\t{ /* Theme-colored arc */ }\n\t\t\t<SpinnerIndicator\n\t\t\t\td=\"m 50 0 a 50 50 0 0 1 50 50\"\n\t\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t\t/>\n\t\t</StyledSpinner>\n\t);\n}\n/**\n * `Spinner` is a component used to notify users that their action is being processed.\n *\n *
|
|
1
|
+
{"version":3,"names":["classNames","StyledSpinner","SpinnerTrack","SpinnerIndicator","forwardRef","UnforwardedSpinner","className","props","forwardedRef","createElement","viewBox","width","height","xmlns","role","focusable","ref","cx","cy","r","vectorEffect","d","Spinner"],"sources":["@wordpress/components/src/spinner/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { StyledSpinner, SpinnerTrack, SpinnerIndicator } from './styles';\nimport type { WordPressComponentProps } from '../ui/context';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\nexport function UnforwardedSpinner(\n\t{ className, ...props }: WordPressComponentProps< {}, 'svg', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\treturn (\n\t\t<StyledSpinner\n\t\t\tclassName={ classNames( 'components-spinner', className ) }\n\t\t\tviewBox=\"0 0 100 100\"\n\t\t\twidth=\"16\"\n\t\t\theight=\"16\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\trole=\"presentation\"\n\t\t\tfocusable=\"false\"\n\t\t\t{ ...props }\n\t\t\tref={ forwardedRef }\n\t\t>\n\t\t\t{ /* Gray circular background */ }\n\t\t\t<SpinnerTrack\n\t\t\t\tcx=\"50\"\n\t\t\t\tcy=\"50\"\n\t\t\t\tr=\"50\"\n\t\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t\t/>\n\n\t\t\t{ /* Theme-colored arc */ }\n\t\t\t<SpinnerIndicator\n\t\t\t\td=\"m 50 0 a 50 50 0 0 1 50 50\"\n\t\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t\t/>\n\t\t</StyledSpinner>\n\t);\n}\n/**\n * `Spinner` is a component used to notify users that their action is being processed.\n *\n * ```js\n * import { Spinner } from '@wordpress/components';\n *\n * function Example() {\n * return <Spinner />;\n * }\n * ```\n */\nexport const Spinner = forwardRef( UnforwardedSpinner );\nexport default Spinner;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AAGnC;AACA;AACA;AACA,SAASC,aAAa,EAAEC,YAAY,EAAEC,gBAAgB,QAAQ,UAAU;AAGxE;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAE/C,OAAO,SAASC,kBAAkBA,CACjC;EAAEC,SAAS;EAAE,GAAGC;AAAmD,CAAC,EACpEC,YAAiC,EAChC;EACD,OACCC,aAAA,CAACR,aAAa;IACbK,SAAS,EAAGN,UAAU,CAAE,oBAAoB,EAAEM,SAAU,CAAG;IAC3DI,OAAO,EAAC,aAAa;IACrBC,KAAK,EAAC,IAAI;IACVC,MAAM,EAAC,IAAI;IACXC,KAAK,EAAC,4BAA4B;IAClCC,IAAI,EAAC,cAAc;IACnBC,SAAS,EAAC,OAAO;IAAA,GACZR,KAAK;IACVS,GAAG,EAAGR;EAAc,GAGpBC,aAAA,CAACP,YAAY;IACZe,EAAE,EAAC,IAAI;IACPC,EAAE,EAAC,IAAI;IACPC,CAAC,EAAC,IAAI;IACNC,YAAY,EAAC;EAAoB,CACjC,CAAC,EAGFX,aAAA,CAACN,gBAAgB;IAChBkB,CAAC,EAAC,4BAA4B;IAC9BD,YAAY,EAAC;EAAoB,CACjC,CACa,CAAC;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,OAAO,GAAGlB,UAAU,CAAEC,kBAAmB,CAAC;AACvD,eAAeiB,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","colorVariables","Wrapper","generateThemeVariables","useCx","Theme","accent","background","className","props","cx","classes","createElement"],"sources":["@wordpress/components/src/theme/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { ThemeProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\nimport { colorVariables, Wrapper } from './styles';\nimport { generateThemeVariables } from './color-algorithms';\nimport { useCx } from '../utils';\n\n/**\n * `Theme` allows defining theme variables for components in the `@wordpress/components` package.\n *\n * Multiple `Theme` components can be nested in order to override specific theme variables.\n *\n *\n *
|
|
1
|
+
{"version":3,"names":["useMemo","colorVariables","Wrapper","generateThemeVariables","useCx","Theme","accent","background","className","props","cx","classes","createElement"],"sources":["@wordpress/components/src/theme/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { ThemeProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\nimport { colorVariables, Wrapper } from './styles';\nimport { generateThemeVariables } from './color-algorithms';\nimport { useCx } from '../utils';\n\n/**\n * `Theme` allows defining theme variables for components in the `@wordpress/components` package.\n *\n * Multiple `Theme` components can be nested in order to override specific theme variables.\n *\n *\n * ```jsx\n * const Example = () => {\n * return (\n * <Theme accent=\"red\">\n * <Button variant=\"primary\">I'm red</Button>\n * <Theme accent=\"blue\">\n * <Button variant=\"primary\">I'm blue</Button>\n * </Theme>\n * </Theme>\n * );\n * };\n * ```\n */\nfunction Theme( {\n\taccent,\n\tbackground,\n\tclassName,\n\t...props\n}: WordPressComponentProps< ThemeProps, 'div', true > ) {\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\t...colorVariables(\n\t\t\t\t\tgenerateThemeVariables( { accent, background } )\n\t\t\t\t),\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ accent, background, className, cx ]\n\t);\n\n\treturn <Wrapper className={ classes } { ...props } />;\n}\n\nexport default Theme;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;;AAGA,SAASC,cAAc,EAAEC,OAAO,QAAQ,UAAU;AAClD,SAASC,sBAAsB,QAAQ,oBAAoB;AAC3D,SAASC,KAAK,QAAQ,UAAU;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,KAAKA,CAAE;EACfC,MAAM;EACNC,UAAU;EACVC,SAAS;EACT,GAAGC;AACgD,CAAC,EAAG;EACvD,MAAMC,EAAE,GAAGN,KAAK,CAAC,CAAC;EAClB,MAAMO,OAAO,GAAGX,OAAO,CACtB,MACCU,EAAE,CACD,GAAGT,cAAc,CAChBE,sBAAsB,CAAE;IAAEG,MAAM;IAAEC;EAAW,CAAE,CAChD,CAAC,EACDC,SACD,CAAC,EACF,CAAEF,MAAM,EAAEC,UAAU,EAAEC,SAAS,EAAEE,EAAE,CACpC,CAAC;EAED,OAAOE,aAAA,CAACV,OAAO;IAACM,SAAS,EAAGG,OAAS;IAAA,GAAMF;EAAK,CAAI,CAAC;AACtD;AAEA,eAAeJ,KAAK"}
|