@wordpress/components 28.10.0 → 28.12.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 +61 -0
- package/build/autocomplete/autocompleter-ui.js +2 -6
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.native.js +2 -4
- package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build/autocomplete/index.js +4 -5
- package/build/autocomplete/index.js.map +1 -1
- package/build/base-control/types.js.map +1 -1
- package/build/border-box-control/border-box-control/component.js +1 -0
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control/hook.js +6 -0
- package/build/border-box-control/border-box-control/hook.js.map +1 -1
- package/build/border-control/border-control/component.js +1 -0
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control/hook.js +6 -0
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +13 -13
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/color-palette/index.js +1 -1
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/index.native.js +1 -2
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-picker/index.native.js +0 -1
- package/build/color-picker/index.native.js.map +1 -1
- package/build/composite/legacy/index.js +5 -2
- package/build/composite/legacy/index.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.js +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build/date-time/date/index.js +0 -1
- package/build/date-time/date/index.js.map +1 -1
- package/build/font-size-picker/index.native.js +6 -6
- package/build/font-size-picker/index.native.js.map +1 -1
- package/build/form-file-upload/index.js +5 -1
- package/build/form-file-upload/index.js.map +1 -1
- package/build/form-token-field/index.js +0 -3
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +7 -3
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/form-token-field/token.js +1 -0
- package/build/form-token-field/token.js.map +1 -1
- package/build/guide/page-control.js +1 -0
- package/build/guide/page-control.js.map +1 -1
- package/build/{dropdown-menu-v2 → menu}/checkbox-item.js +8 -8
- package/build/menu/checkbox-item.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/context.js +2 -2
- package/build/menu/context.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/group-label.js +5 -5
- package/build/menu/group-label.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/group.js +5 -5
- package/build/menu/group.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/index.js +38 -38
- package/build/menu/index.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/item-help-text.js +3 -3
- package/build/menu/item-help-text.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/item-label.js +3 -3
- package/build/menu/item-label.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/item.js +7 -7
- package/build/menu/item.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/radio-item.js +8 -8
- package/build/menu/radio-item.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/separator.js +6 -6
- package/build/menu/separator.js.map +1 -0
- package/build/menu/styles.js +150 -0
- package/build/menu/styles.js.map +1 -0
- package/build/menu/types.js.map +1 -0
- package/build/menu/use-temporary-focus-visible-fix.js.map +1 -0
- package/build/menu-item/index.js +1 -0
- package/build/menu-item/index.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -5
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build/mobile/bottom-sheet/range-cell.native.js +1 -1
- package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
- package/build/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet-select-control/index.native.js +2 -2
- package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build/mobile/color-settings/index.native.js +1 -3
- package/build/mobile/color-settings/index.native.js.map +1 -1
- package/build/mobile/color-settings/picker-screen.native.js +1 -3
- package/build/mobile/color-settings/picker-screen.native.js.map +1 -1
- package/build/mobile/image/index.native.js +1 -3
- package/build/mobile/image/index.native.js.map +1 -1
- package/build/mobile/keyboard-avoiding-view/index.ios.js +1 -3
- package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build/mobile/link-picker/link-picker-results.native.js +2 -5
- package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build/mobile/link-picker/link-picker-screen.native.js +1 -3
- package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
- package/build/mobile/link-settings/index.native.js +6 -18
- package/build/mobile/link-settings/index.native.js.map +1 -1
- package/build/mobile/link-settings/link-settings-screen.native.js +1 -3
- package/build/mobile/link-settings/link-settings-screen.native.js.map +1 -1
- package/build/mobile/segmented-control/index.native.js +2 -6
- package/build/mobile/segmented-control/index.native.js.map +1 -1
- package/build/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
- package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
- package/build/navigation/index.js +1 -2
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/item/use-navigation-tree-item.js +2 -2
- package/build/navigation/item/use-navigation-tree-item.js.map +1 -1
- package/build/navigation/menu/menu-title-search.js +2 -2
- package/build/navigation/menu/menu-title-search.js.map +1 -1
- package/build/navigation/menu/use-navigation-tree-menu.js +2 -2
- package/build/navigation/menu/use-navigation-tree-menu.js.map +1 -1
- package/build/notice/index.js +2 -0
- package/build/notice/index.js.map +1 -1
- package/build/palette-edit/index.js +9 -2
- package/build/palette-edit/index.js.map +1 -1
- package/build/palette-edit/styles.js +13 -28
- package/build/palette-edit/styles.js.map +1 -1
- package/build/panel/body.js +1 -0
- package/build/panel/body.js.map +1 -1
- package/build/popover/index.js +4 -1
- package/build/popover/index.js.map +1 -1
- package/build/private-apis.js +4 -4
- package/build/private-apis.js.map +1 -1
- package/build/radio-group/index.js +3 -1
- package/build/radio-group/index.js.map +1 -1
- package/build/radio-group/radio.js +6 -0
- package/build/radio-group/radio.js.map +1 -1
- package/build/radio-group/types.js.map +1 -1
- package/build/sandbox/index.js +3 -6
- package/build/sandbox/index.js.map +1 -1
- package/build/sandbox/index.native.js +1 -3
- package/build/sandbox/index.native.js.map +1 -1
- package/build/search-control/index.native.js +1 -3
- package/build/search-control/index.native.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot.js +1 -2
- package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build/slot-fill/fill.js +3 -6
- package/build/slot-fill/fill.js.map +1 -1
- package/build/snackbar/index.js +2 -1
- package/build/snackbar/index.js.map +1 -1
- package/build/spacer/hook.js +5 -3
- package/build/spacer/hook.js.map +1 -1
- package/build/tab-panel/index.js +4 -1
- package/build/tab-panel/index.js.map +1 -1
- package/build/tabs/index.js +48 -113
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/styles.js +12 -12
- package/build/tabs/styles.js.map +1 -1
- package/build/tabs/tab.js +23 -6
- package/build/tabs/tab.js.map +1 -1
- package/build/tabs/tablist.js +37 -14
- package/build/tabs/tablist.js.map +1 -1
- package/build/tabs/types.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +3 -2
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toolbar/toolbar/index.js +3 -0
- package/build/toolbar/toolbar/index.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +1 -1
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +0 -2
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/tooltip/index.native.js +5 -15
- package/build/tooltip/index.native.js.map +1 -1
- package/build/unit-control/index.native.js +2 -6
- package/build/unit-control/index.native.js.map +1 -1
- package/build/utils/deprecated-36px-size.js +27 -0
- package/build/utils/deprecated-36px-size.js.map +1 -0
- package/build/utils/element-rect.js +13 -2
- package/build/utils/element-rect.js.map +1 -1
- package/build/utils/hooks/use-animated-offset-rect.js +3 -2
- package/build/utils/hooks/use-animated-offset-rect.js.map +1 -1
- package/build/utils/hooks/use-update-effect.js +0 -2
- package/build/utils/hooks/use-update-effect.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +2 -6
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.native.js +2 -4
- package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build-module/autocomplete/index.js +4 -5
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/base-control/types.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js +1 -0
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control/hook.js +6 -0
- package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
- package/build-module/border-control/border-control/component.js +1 -0
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control/hook.js +7 -0
- package/build-module/border-control/border-control/hook.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +13 -13
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/color-palette/index.js +1 -1
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +1 -2
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-picker/index.native.js +0 -1
- package/build-module/color-picker/index.native.js.map +1 -1
- package/build-module/composite/legacy/index.js +5 -2
- package/build-module/composite/legacy/index.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/date-time/date/index.js +0 -1
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/font-size-picker/index.native.js +7 -7
- package/build-module/font-size-picker/index.native.js.map +1 -1
- package/build-module/form-file-upload/index.js +5 -1
- package/build-module/form-file-upload/index.js.map +1 -1
- package/build-module/form-token-field/index.js +0 -3
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +7 -3
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/form-token-field/token.js +1 -0
- package/build-module/form-token-field/token.js.map +1 -1
- package/build-module/guide/page-control.js +1 -0
- package/build-module/guide/page-control.js.map +1 -1
- package/build-module/{dropdown-menu-v2 → menu}/checkbox-item.js +8 -8
- package/build-module/menu/checkbox-item.js.map +1 -0
- package/build-module/{dropdown-menu-v2 → menu}/context.js +1 -1
- package/build-module/menu/context.js.map +1 -0
- package/build-module/{dropdown-menu-v2 → menu}/group-label.js +5 -5
- package/build-module/menu/group-label.js.map +1 -0
- package/build-module/menu/group.js +21 -0
- package/build-module/menu/group.js.map +1 -0
- package/build-module/{dropdown-menu-v2 → menu}/index.js +46 -46
- package/build-module/menu/index.js.map +1 -0
- package/build-module/{dropdown-menu-v2 → menu}/item-help-text.js +2 -2
- package/build-module/menu/item-help-text.js.map +1 -0
- package/build-module/{dropdown-menu-v2 → menu}/item-label.js +2 -2
- package/build-module/menu/item-label.js.map +1 -0
- package/build-module/{dropdown-menu-v2 → menu}/item.js +7 -7
- package/build-module/menu/item.js.map +1 -0
- package/build-module/{dropdown-menu-v2 → menu}/radio-item.js +8 -8
- package/build-module/menu/radio-item.js.map +1 -0
- package/build-module/menu/separator.js +22 -0
- package/build-module/menu/separator.js.map +1 -0
- package/build-module/menu/styles.js +143 -0
- package/build-module/menu/styles.js.map +1 -0
- package/build-module/menu/types.js.map +1 -0
- package/build-module/menu/use-temporary-focus-visible-fix.js.map +1 -0
- package/build-module/menu-item/index.js +1 -0
- package/build-module/menu-item/index.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -5
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-cell.native.js +1 -1
- package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
- package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-select-control/index.native.js +2 -2
- package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js +1 -3
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/picker-screen.native.js +1 -3
- package/build-module/mobile/color-settings/picker-screen.native.js.map +1 -1
- package/build-module/mobile/image/index.native.js +1 -3
- package/build-module/mobile/image/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js +1 -3
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build-module/mobile/link-picker/link-picker-results.native.js +2 -5
- package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build-module/mobile/link-picker/link-picker-screen.native.js +1 -3
- package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
- package/build-module/mobile/link-settings/index.native.js +6 -18
- package/build-module/mobile/link-settings/index.native.js.map +1 -1
- package/build-module/mobile/link-settings/link-settings-screen.native.js +1 -3
- package/build-module/mobile/link-settings/link-settings-screen.native.js.map +1 -1
- package/build-module/mobile/segmented-control/index.native.js +2 -6
- package/build-module/mobile/segmented-control/index.native.js.map +1 -1
- package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
- package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
- package/build-module/navigation/index.js +1 -2
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/item/use-navigation-tree-item.js +2 -2
- package/build-module/navigation/item/use-navigation-tree-item.js.map +1 -1
- package/build-module/navigation/menu/menu-title-search.js +2 -2
- package/build-module/navigation/menu/menu-title-search.js.map +1 -1
- package/build-module/navigation/menu/use-navigation-tree-menu.js +2 -2
- package/build-module/navigation/menu/use-navigation-tree-menu.js.map +1 -1
- package/build-module/notice/index.js +2 -0
- package/build-module/notice/index.js.map +1 -1
- package/build-module/palette-edit/index.js +11 -4
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/palette-edit/styles.js +13 -29
- package/build-module/palette-edit/styles.js.map +1 -1
- package/build-module/panel/body.js +1 -0
- package/build-module/panel/body.js.map +1 -1
- package/build-module/popover/index.js +4 -1
- package/build-module/popover/index.js.map +1 -1
- package/build-module/private-apis.js +3 -3
- package/build-module/private-apis.js.map +1 -1
- package/build-module/radio-group/index.js +3 -1
- package/build-module/radio-group/index.js.map +1 -1
- package/build-module/radio-group/radio.js +6 -0
- package/build-module/radio-group/radio.js.map +1 -1
- package/build-module/radio-group/types.js.map +1 -1
- package/build-module/sandbox/index.js +3 -6
- package/build-module/sandbox/index.js.map +1 -1
- package/build-module/sandbox/index.native.js +1 -3
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/search-control/index.native.js +1 -3
- package/build-module/search-control/index.native.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot.js +1 -2
- package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build-module/slot-fill/fill.js +3 -6
- package/build-module/slot-fill/fill.js.map +1 -1
- package/build-module/snackbar/index.js +2 -1
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/spacer/hook.js +5 -3
- package/build-module/spacer/hook.js.map +1 -1
- package/build-module/tab-panel/index.js +4 -1
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/tabs/index.js +47 -112
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/styles.js +11 -11
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/tabs/tab.js +21 -6
- package/build-module/tabs/tab.js.map +1 -1
- package/build-module/tabs/tablist.js +37 -14
- package/build-module/tabs/tablist.js.map +1 -1
- package/build-module/tabs/types.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +3 -2
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toolbar/toolbar/index.js +3 -0
- package/build-module/toolbar/toolbar/index.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +0 -2
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/tooltip/index.native.js +5 -15
- package/build-module/tooltip/index.native.js.map +1 -1
- package/build-module/unit-control/index.native.js +2 -6
- package/build-module/unit-control/index.native.js.map +1 -1
- package/build-module/utils/deprecated-36px-size.js +19 -0
- package/build-module/utils/deprecated-36px-size.js.map +1 -0
- package/build-module/utils/element-rect.js +13 -2
- package/build-module/utils/element-rect.js.map +1 -1
- package/build-module/utils/hooks/use-animated-offset-rect.js +3 -2
- package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -1
- package/build-module/utils/hooks/use-update-effect.js +0 -2
- package/build-module/utils/hooks/use-update-effect.js.map +1 -1
- package/build-style/style-rtl.css +21 -35
- package/build-style/style.css +21 -35
- package/build-types/animate/stories/index.story.d.ts.map +1 -1
- package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/base-control/stories/index.story.d.ts.map +1 -1
- package/build-types/base-control/types.d.ts +3 -0
- package/build-types/base-control/types.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/component.d.ts +1 -0
- package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts +1 -0
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/border-control/stories/index.story.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts.map +1 -1
- package/build-types/card/stories/index.story.d.ts.map +1 -1
- package/build-types/composite/legacy/index.d.ts.map +1 -1
- package/build-types/composite/stories/index.story.d.ts.map +1 -1
- package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/disabled/stories/index.story.d.ts.map +1 -1
- package/build-types/draggable/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
- package/build-types/external-link/stories/index.story.d.ts.map +1 -1
- package/build-types/form-file-upload/index.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
- package/build-types/form-token-field/token.d.ts.map +1 -1
- package/build-types/guide/page-control.d.ts.map +1 -1
- package/build-types/heading/stories/index.story.d.ts.map +1 -1
- package/build-types/item-group/stories/index.story.d.ts +1 -1
- package/build-types/item-group/stories/index.story.d.ts.map +1 -1
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
- package/build-types/lock-unlock.d.ts +2 -2
- package/build-types/menu/checkbox-item.d.ts +3 -0
- package/build-types/menu/checkbox-item.d.ts.map +1 -0
- package/build-types/menu/context.d.ts +6 -0
- package/build-types/menu/context.d.ts.map +1 -0
- package/build-types/menu/group-label.d.ts +3 -0
- package/build-types/menu/group-label.d.ts.map +1 -0
- package/build-types/menu/group.d.ts +3 -0
- package/build-types/menu/group.d.ts.map +1 -0
- package/build-types/menu/index.d.ts +40 -0
- package/build-types/menu/index.d.ts.map +1 -0
- package/build-types/{dropdown-menu-v2 → menu}/item-help-text.d.ts +1 -1
- package/build-types/menu/item-help-text.d.ts.map +1 -0
- package/build-types/{dropdown-menu-v2 → menu}/item-label.d.ts +1 -1
- package/build-types/menu/item-label.d.ts.map +1 -0
- package/build-types/menu/item.d.ts +3 -0
- package/build-types/menu/item.d.ts.map +1 -0
- package/build-types/menu/radio-item.d.ts +3 -0
- package/build-types/menu/radio-item.d.ts.map +1 -0
- package/build-types/menu/separator.d.ts +3 -0
- package/build-types/menu/separator.d.ts.map +1 -0
- package/build-types/menu/stories/index.story.d.ts +16 -0
- package/build-types/menu/stories/index.story.d.ts.map +1 -0
- package/build-types/{dropdown-menu-v2 → menu}/styles.d.ts +13 -13
- package/build-types/menu/styles.d.ts.map +1 -0
- package/build-types/menu/test/index.d.ts.map +1 -0
- package/build-types/{dropdown-menu-v2 → menu}/types.d.ts +22 -21
- package/build-types/menu/types.d.ts.map +1 -0
- package/build-types/menu/use-temporary-focus-visible-fix.d.ts.map +1 -0
- package/build-types/menu-item/index.d.ts.map +1 -1
- package/build-types/modal/stories/index.story.d.ts.map +1 -1
- 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.map +1 -1
- package/build-types/navigation/index.d.ts.map +1 -1
- package/build-types/navigator/stories/index.story.d.ts.map +1 -1
- package/build-types/notice/index.d.ts.map +1 -1
- package/build-types/notice/stories/index.story.d.ts.map +1 -1
- package/build-types/palette-edit/index.d.ts.map +1 -1
- package/build-types/palette-edit/styles.d.ts +0 -256
- package/build-types/palette-edit/styles.d.ts.map +1 -1
- package/build-types/panel/body.d.ts.map +1 -1
- package/build-types/panel/stories/index.story.d.ts.map +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/stories/index.story.d.ts.map +1 -1
- package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
- package/build-types/radio-group/index.d.ts.map +1 -1
- package/build-types/radio-group/radio.d.ts +4 -2
- package/build-types/radio-group/radio.d.ts.map +1 -1
- package/build-types/radio-group/stories/index.story.d.ts.map +1 -1
- package/build-types/radio-group/types.d.ts +5 -1
- package/build-types/radio-group/types.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
- package/build-types/sandbox/index.d.ts.map +1 -1
- package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
- package/build-types/scroll-lock/stories/index.story.d.ts.map +1 -1
- package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
- package/build-types/slot-fill/fill.d.ts.map +1 -1
- package/build-types/slot-fill/stories/index.story.d.ts.map +1 -1
- package/build-types/snackbar/index.d.ts.map +1 -1
- package/build-types/snackbar/stories/index.story.d.ts.map +1 -1
- package/build-types/snackbar/stories/list.story.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts.map +1 -1
- package/build-types/spinner/stories/index.story.d.ts.map +1 -1
- package/build-types/tab-panel/index.d.ts.map +1 -1
- package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/index.d.ts +21 -8
- package/build-types/tabs/index.d.ts.map +1 -1
- package/build-types/tabs/stories/index.story.d.ts +1 -1
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts +6 -3
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/tabs/tab.d.ts +0 -3
- package/build-types/tabs/tab.d.ts.map +1 -1
- package/build-types/tabs/tablist.d.ts.map +1 -1
- package/build-types/tabs/types.d.ts +85 -48
- package/build-types/tabs/types.d.ts.map +1 -1
- package/build-types/text/stories/index.story.d.ts.map +1 -1
- package/build-types/text-highlight/stories/index.story.d.ts.map +1 -1
- package/build-types/theme/stories/index.story.d.ts.map +1 -1
- package/build-types/tip/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
- package/build-types/truncate/stories/index.story.d.ts.map +1 -1
- package/build-types/utils/deprecated-36px-size.d.ts +6 -0
- package/build-types/utils/deprecated-36px-size.d.ts.map +1 -0
- package/build-types/utils/element-rect.d.ts +1 -1
- package/build-types/utils/element-rect.d.ts.map +1 -1
- package/build-types/utils/hooks/use-animated-offset-rect.d.ts +8 -1
- package/build-types/utils/hooks/use-animated-offset-rect.d.ts.map +1 -1
- package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
- package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
- package/package.json +21 -20
- package/src/alignment-matrix-control/README.md +1 -2
- package/src/angle-picker-control/README.md +1 -2
- package/src/animate/stories/index.story.tsx +2 -1
- package/src/autocomplete/autocompleter-ui.native.js +2 -4
- package/src/autocomplete/autocompleter-ui.tsx +2 -6
- package/src/autocomplete/index.tsx +4 -5
- package/src/base-control/README.md +58 -47
- package/src/base-control/docs-manifest.json +12 -0
- package/src/base-control/stories/index.story.tsx +4 -0
- package/src/base-control/types.ts +3 -0
- package/src/border-box-control/border-box-control/README.md +1 -0
- package/src/border-box-control/border-box-control/component.tsx +1 -0
- package/src/border-box-control/border-box-control/hook.ts +7 -0
- package/src/border-box-control/stories/index.story.tsx +1 -0
- package/src/border-box-control/test/index.tsx +1 -0
- package/src/border-control/border-control/README.md +1 -0
- package/src/border-control/border-control/component.tsx +1 -0
- package/src/border-control/border-control/hook.ts +7 -1
- package/src/border-control/border-control-dropdown/component.tsx +25 -13
- package/src/border-control/stories/index.story.tsx +1 -0
- package/src/border-control/test/index.js +1 -0
- package/src/button/stories/index.story.tsx +2 -1
- package/src/card/stories/index.story.tsx +2 -1
- package/src/color-palette/index.native.js +1 -2
- package/src/color-palette/index.tsx +1 -1
- package/src/color-palette/style.scss +2 -4
- package/src/color-picker/index.native.js +0 -1
- package/src/composite/legacy/index.tsx +5 -2
- package/src/composite/stories/index.story.tsx +2 -1
- package/src/confirm-dialog/stories/index.story.tsx +2 -1
- package/src/custom-gradient-picker/gradient-bar/control-points.tsx +1 -1
- package/src/date-time/date/index.tsx +0 -1
- package/src/disabled/stories/index.story.tsx +2 -1
- package/src/draggable/stories/index.story.tsx +2 -1
- package/src/dropdown/stories/index.story.tsx +2 -1
- package/src/external-link/stories/index.story.tsx +2 -1
- package/src/font-size-picker/index.native.js +7 -7
- package/src/form-file-upload/index.tsx +7 -1
- package/src/form-token-field/index.tsx +0 -3
- package/src/form-token-field/style.scss +12 -13
- package/src/form-token-field/suggestions-list.tsx +6 -0
- package/src/form-token-field/token.tsx +1 -0
- package/src/guide/page-control.tsx +1 -0
- package/src/guide/style.scss +4 -6
- package/src/heading/stories/index.story.tsx +2 -1
- package/src/item-group/stories/index.story.tsx +8 -4
- package/src/keyboard-shortcuts/stories/index.story.tsx +2 -1
- package/src/{dropdown-menu-v2 → menu}/README.md +34 -34
- package/src/{dropdown-menu-v2 → menu}/checkbox-item.tsx +14 -14
- package/src/menu/context.tsx +13 -0
- package/src/{dropdown-menu-v2 → menu}/group-label.tsx +8 -8
- package/src/menu/group.tsx +26 -0
- package/src/{dropdown-menu-v2 → menu}/index.tsx +65 -70
- package/src/{dropdown-menu-v2 → menu}/item-help-text.tsx +3 -7
- package/src/{dropdown-menu-v2 → menu}/item-label.tsx +3 -7
- package/src/{dropdown-menu-v2 → menu}/item.tsx +13 -13
- package/src/{dropdown-menu-v2 → menu}/radio-item.tsx +14 -14
- package/src/menu/separator.tsx +27 -0
- package/src/menu/stories/index.story.tsx +543 -0
- package/src/{dropdown-menu-v2 → menu}/styles.ts +17 -17
- package/src/{dropdown-menu-v2 → menu}/test/index.tsx +145 -225
- package/src/{dropdown-menu-v2 → menu}/types.ts +24 -23
- package/src/menu-item/index.tsx +1 -0
- package/src/menu-item/test/__snapshots__/index.js.snap +4 -4
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -5
- package/src/mobile/bottom-sheet/range-cell.native.js +1 -1
- package/src/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
- package/src/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
- package/src/mobile/bottom-sheet-select-control/index.native.js +2 -2
- package/src/mobile/color-settings/index.native.js +1 -3
- package/src/mobile/color-settings/picker-screen.native.js +1 -3
- package/src/mobile/image/index.native.js +1 -3
- package/src/mobile/keyboard-avoiding-view/index.ios.js +1 -3
- package/src/mobile/link-picker/link-picker-results.native.js +2 -5
- package/src/mobile/link-picker/link-picker-screen.native.js +1 -3
- package/src/mobile/link-settings/index.native.js +6 -18
- package/src/mobile/link-settings/link-settings-screen.native.js +1 -3
- package/src/mobile/segmented-control/index.native.js +2 -6
- package/src/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
- package/src/modal/stories/index.story.tsx +2 -1
- package/src/navigable-container/stories/navigable-menu.story.tsx +2 -1
- package/src/navigable-container/stories/tabbable-container.story.tsx +2 -1
- package/src/navigation/index.tsx +1 -2
- package/src/navigation/item/use-navigation-tree-item.tsx +2 -2
- package/src/navigation/menu/menu-title-search.tsx +2 -2
- package/src/navigation/menu/use-navigation-tree-menu.tsx +2 -2
- package/src/navigator/stories/index.story.tsx +2 -1
- package/src/notice/index.tsx +2 -0
- package/src/notice/stories/index.story.tsx +7 -2
- package/src/notice/test/__snapshots__/index.tsx.snap +4 -4
- package/src/palette-edit/index.tsx +9 -5
- package/src/palette-edit/styles.ts +1 -67
- package/src/panel/body.tsx +1 -0
- package/src/panel/stories/index.story.tsx +2 -1
- package/src/popover/index.tsx +3 -0
- package/src/popover/stories/index.story.tsx +2 -1
- package/src/private-apis.ts +3 -3
- package/src/progress-bar/stories/index.story.tsx +2 -1
- package/src/radio-group/README.md +8 -8
- package/src/radio-group/index.tsx +2 -0
- package/src/radio-group/radio.tsx +7 -0
- package/src/radio-group/stories/index.story.tsx +16 -4
- package/src/radio-group/types.ts +6 -1
- package/src/resizable-box/stories/index.story.tsx +2 -1
- package/src/sandbox/index.native.js +1 -3
- package/src/sandbox/index.tsx +3 -6
- package/src/sandbox/stories/index.story.tsx +2 -1
- package/src/scroll-lock/stories/index.story.tsx +2 -1
- package/src/search-control/index.native.js +1 -3
- package/src/shortcut/stories/index.story.tsx +2 -1
- package/src/slot-fill/bubbles-virtually/slot.tsx +1 -2
- package/src/slot-fill/fill.ts +3 -6
- package/src/slot-fill/stories/index.story.tsx +2 -1
- package/src/snackbar/index.tsx +2 -1
- package/src/snackbar/stories/index.story.tsx +2 -1
- package/src/snackbar/stories/list.story.tsx +2 -1
- package/src/snackbar/style.scss +7 -16
- package/src/spacer/hook.ts +3 -2
- package/src/spinner/stories/index.story.tsx +2 -1
- package/src/tab-panel/index.tsx +3 -0
- package/src/tab-panel/stories/index.story.tsx +2 -1
- package/src/tab-panel/style.scss +1 -3
- package/src/tabs/README.md +63 -21
- package/src/tabs/index.tsx +112 -189
- package/src/tabs/stories/index.story.tsx +5 -2
- package/src/tabs/styles.ts +13 -5
- package/src/tabs/tab.tsx +23 -3
- package/src/tabs/tablist.tsx +44 -17
- package/src/tabs/test/index.tsx +131 -118
- package/src/tabs/types.ts +89 -49
- package/src/text/stories/index.story.tsx +2 -1
- package/src/text-highlight/stories/index.story.tsx +2 -1
- package/src/theme/stories/index.story.tsx +2 -1
- package/src/tip/stories/index.story.tsx +2 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +2 -1
- package/src/toolbar/toolbar/index.tsx +3 -0
- package/src/tools-panel/tools-panel-header/component.tsx +1 -1
- package/src/tools-panel/tools-panel-item/hook.ts +0 -2
- package/src/tooltip/index.native.js +5 -15
- package/src/tooltip/stories/index.story.tsx +2 -1
- package/src/tree-grid/stories/index.story.tsx +2 -1
- package/src/truncate/stories/index.story.tsx +2 -1
- package/src/unit-control/index.native.js +2 -6
- package/src/utils/deprecated-36px-size.ts +27 -0
- package/src/utils/element-rect.ts +14 -2
- package/src/utils/hooks/use-animated-offset-rect.ts +13 -1
- package/src/utils/hooks/use-update-effect.js +0 -2
- package/src/visually-hidden/stories/index.story.tsx +2 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/dropdown-menu-v2/checkbox-item.js.map +0 -1
- package/build/dropdown-menu-v2/context.js.map +0 -1
- package/build/dropdown-menu-v2/group-label.js.map +0 -1
- package/build/dropdown-menu-v2/group.js.map +0 -1
- package/build/dropdown-menu-v2/index.js.map +0 -1
- package/build/dropdown-menu-v2/item-help-text.js.map +0 -1
- package/build/dropdown-menu-v2/item-label.js.map +0 -1
- package/build/dropdown-menu-v2/item.js.map +0 -1
- package/build/dropdown-menu-v2/radio-item.js.map +0 -1
- package/build/dropdown-menu-v2/separator.js.map +0 -1
- package/build/dropdown-menu-v2/styles.js +0 -150
- package/build/dropdown-menu-v2/styles.js.map +0 -1
- package/build/dropdown-menu-v2/types.js.map +0 -1
- package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +0 -1
- package/build-module/dropdown-menu-v2/checkbox-item.js.map +0 -1
- package/build-module/dropdown-menu-v2/context.js.map +0 -1
- package/build-module/dropdown-menu-v2/group-label.js.map +0 -1
- package/build-module/dropdown-menu-v2/group.js +0 -21
- package/build-module/dropdown-menu-v2/group.js.map +0 -1
- package/build-module/dropdown-menu-v2/index.js.map +0 -1
- package/build-module/dropdown-menu-v2/item-help-text.js.map +0 -1
- package/build-module/dropdown-menu-v2/item-label.js.map +0 -1
- package/build-module/dropdown-menu-v2/item.js.map +0 -1
- package/build-module/dropdown-menu-v2/radio-item.js.map +0 -1
- package/build-module/dropdown-menu-v2/separator.js +0 -22
- package/build-module/dropdown-menu-v2/separator.js.map +0 -1
- package/build-module/dropdown-menu-v2/styles.js +0 -143
- package/build-module/dropdown-menu-v2/styles.js.map +0 -1
- package/build-module/dropdown-menu-v2/types.js.map +0 -1
- package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +0 -1
- package/build-types/dropdown-menu-v2/checkbox-item.d.ts +0 -3
- package/build-types/dropdown-menu-v2/checkbox-item.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/context.d.ts +0 -6
- package/build-types/dropdown-menu-v2/context.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/group-label.d.ts +0 -3
- package/build-types/dropdown-menu-v2/group-label.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/group.d.ts +0 -3
- package/build-types/dropdown-menu-v2/group.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/index.d.ts +0 -40
- package/build-types/dropdown-menu-v2/index.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/item-help-text.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/item-label.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/item.d.ts +0 -3
- package/build-types/dropdown-menu-v2/item.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/radio-item.d.ts +0 -3
- package/build-types/dropdown-menu-v2/radio-item.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/separator.d.ts +0 -3
- package/build-types/dropdown-menu-v2/separator.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts +0 -16
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/styles.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/test/index.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/types.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts.map +0 -1
- package/src/dropdown-menu-v2/context.tsx +0 -13
- package/src/dropdown-menu-v2/group.tsx +0 -26
- package/src/dropdown-menu-v2/separator.tsx +0 -27
- package/src/dropdown-menu-v2/stories/index.story.tsx +0 -639
- /package/build/{dropdown-menu-v2 → menu}/types.js +0 -0
- /package/build/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.js +0 -0
- /package/build-module/{dropdown-menu-v2 → menu}/types.js +0 -0
- /package/build-module/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.js +0 -0
- /package/build-types/{dropdown-menu-v2 → menu}/test/index.d.ts +0 -0
- /package/build-types/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.d.ts +0 -0
- /package/src/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Ariakit","css","COLORS","font","rtl","CONFIG","space","Icon","Truncate","ANIMATION_PARAMS","SCALE_AMOUNT_OUTER","SCALE_AMOUNT_CONTENT","DURATION","IN","OUT","EASING","CONTENT_WRAPPER_PADDING","ITEM_PADDING_BLOCK","ITEM_PADDING_INLINE","DEFAULT_BORDER_COLOR","theme","gray","DIVIDER_COLOR","LIGHTER_TEXT_COLOR","LIGHT_BACKGROUND_COLOR","TOOLBAR_VARIANT_BORDER_COLOR","foreground","DEFAULT_BOX_SHADOW","borderWidth","elevationMedium","TOOLBAR_VARIANT_BOX_SHADOW","GRID_TEMPLATE_COLS","MenuPopoverOuterWrapper","_styled","process","env","NODE_ENV","target","label","ui","background","radiusMedium","props","variant","MenuPopoverInnerWrapper","baseItem","radiusSmall","textDisabled","accent","white","MenuItem","MenuCheckboxItem","MenuItemCheckbox","MenuRadioItem","MenuItemRadio","ItemPrefixWrapper","MenuItemContentWrapper","MenuItemChildrenWrapper","ItemSuffixWrapper","MenuGroup","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","MenuGroupLabel","MenuSeparator","SubmenuChevronIcon","transform","MenuItemLabel","MenuItemHelpText"],"sources":["@wordpress/components/src/menu/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, font, rtl, CONFIG } from '../utils';\nimport { space } from '../utils/space';\nimport Icon from '../icon';\nimport { Truncate } from '../truncate';\nimport type { MenuContext } from './types';\n\nconst ANIMATION_PARAMS = {\n\tSCALE_AMOUNT_OUTER: 0.82,\n\tSCALE_AMOUNT_CONTENT: 0.9,\n\tDURATION: {\n\t\tIN: '400ms',\n\t\tOUT: '200ms',\n\t},\n\tEASING: 'cubic-bezier(0.33, 0, 0, 1)',\n};\n\nconst CONTENT_WRAPPER_PADDING = space( 1 );\nconst ITEM_PADDING_BLOCK = space( 2 );\nconst ITEM_PADDING_INLINE = space( 3 );\n\n// TODO:\n// - border color and divider color are different from COLORS.theme variables\n// - lighter text color is not defined in COLORS.theme, should it be?\n// - lighter background color is not defined in COLORS.theme, should it be?\nconst DEFAULT_BORDER_COLOR = COLORS.theme.gray[ 300 ];\nconst DIVIDER_COLOR = COLORS.theme.gray[ 200 ];\nconst LIGHTER_TEXT_COLOR = COLORS.theme.gray[ 700 ];\nconst LIGHT_BACKGROUND_COLOR = COLORS.theme.gray[ 100 ];\nconst TOOLBAR_VARIANT_BORDER_COLOR = COLORS.theme.foreground;\nconst DEFAULT_BOX_SHADOW = `0 0 0 ${ CONFIG.borderWidth } ${ DEFAULT_BORDER_COLOR }, ${ CONFIG.elevationMedium }`;\nconst TOOLBAR_VARIANT_BOX_SHADOW = `0 0 0 ${ CONFIG.borderWidth } ${ TOOLBAR_VARIANT_BORDER_COLOR }`;\n\nconst GRID_TEMPLATE_COLS = 'minmax( 0, max-content ) 1fr';\n\nexport const MenuPopoverOuterWrapper = styled.div<\n\tPick< MenuContext, 'variant' >\n>`\n\tposition: relative;\n\n\tbackground-color: ${ COLORS.ui.background };\n\tborder-radius: ${ CONFIG.radiusMedium };\n\t${ ( props ) => css`\n\t\tbox-shadow: ${ props.variant === 'toolbar'\n\t\t\t? TOOLBAR_VARIANT_BOX_SHADOW\n\t\t\t: DEFAULT_BOX_SHADOW };\n\t` }\n\n\toverflow: hidden;\n\n\t/* Open/close animation (outer wrapper) */\n\t@media not ( prefers-reduced-motion ) {\n\t\ttransition-property: transform, opacity;\n\t\ttransition-timing-function: ${ ANIMATION_PARAMS.EASING };\n\t\ttransition-duration: ${ ANIMATION_PARAMS.DURATION.IN };\n\t\twill-change: transform, opacity;\n\n\t\t/* Regardless of the side, fade in and out. */\n\t\topacity: 0;\n\t\t&:has( [data-enter] ) {\n\t\t\topacity: 1;\n\t\t}\n\n\t\t&:has( [data-leave] ) {\n\t\t\ttransition-duration: ${ ANIMATION_PARAMS.DURATION.OUT };\n\t\t}\n\n\t\t/* For menus opening on top and bottom side, animate the scale Y too. */\n\t\t&:has( [data-side='bottom'] ),\n\t\t&:has( [data-side='top'] ) {\n\t\t\ttransform: scaleY( ${ ANIMATION_PARAMS.SCALE_AMOUNT_OUTER } );\n\t\t}\n\t\t&:has( [data-side='bottom'] ) {\n\t\t\ttransform-origin: top;\n\t\t}\n\t\t&:has( [data-side='top'] ) {\n\t\t\ttransform-origin: bottom;\n\t\t}\n\t\t&:has( [data-enter][data-side='bottom'] ),\n\t\t&:has( [data-enter][data-side='top'] ),\n\t\t/* Do not animate the scaleY when closing the menu */\n\t\t&:has( [data-leave][data-side='bottom'] ),\n\t\t&:has( [data-leave][data-side='top'] ) {\n\t\t\ttransform: scaleY( 1 );\n\t\t}\n\t}\n`;\n\nexport const MenuPopoverInnerWrapper = styled.div`\n\tposition: relative;\n\t/* Same as popover component */\n\t/* TODO: is there a way to read the sass variable? */\n\tz-index: 1000000;\n\n\tdisplay: grid;\n\tgrid-template-columns: ${ GRID_TEMPLATE_COLS };\n\tgrid-template-rows: auto;\n\n\tbox-sizing: border-box;\n\tmin-width: 160px;\n\tmax-width: 320px;\n\tmax-height: var( --popover-available-height );\n\n\tpadding: ${ CONTENT_WRAPPER_PADDING };\n\n\toverscroll-behavior: contain;\n\toverflow: auto;\n\n\t/* Only visible in Windows High Contrast mode */\n\toutline: 2px solid transparent !important;\n\n\t/* Open/close animation (inner content wrapper) */\n\t@media not ( prefers-reduced-motion ) {\n\t\ttransition: inherit;\n\t\ttransform-origin: inherit;\n\n\t\t/*\n\t\t * For menus opening on top and bottom side, animate the scale Y too.\n\t\t * The content scales at a different rate than the outer container:\n\t\t * - first, counter the outer scale factor by doing \"1 / scaleAmountOuter\"\n\t\t * - then, apply the content scale factor.\n\t\t */\n\t\t&[data-side='bottom'],\n\t\t&[data-side='top'] {\n\t\t\ttransform: scaleY(\n\t\t\t\tcalc(\n\t\t\t\t\t1 / ${ ANIMATION_PARAMS.SCALE_AMOUNT_OUTER } *\n\t\t\t\t\t\t${ ANIMATION_PARAMS.SCALE_AMOUNT_CONTENT }\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t&[data-enter][data-side='bottom'],\n\t\t&[data-enter][data-side='top'],\n\t\t/* Do not animate the scaleY when closing the menu */\n\t\t&[data-leave][data-side='bottom'],\n\t\t&[data-leave][data-side='top'] {\n\t\t\ttransform: scaleY( 1 );\n\t\t}\n\t}\n`;\n\nconst baseItem = css`\n\tall: unset;\n\n\tposition: relative;\n\tmin-height: ${ space( 10 ) };\n\tbox-sizing: border-box;\n\n\t/* Occupy the width of all grid columns (ie. full width) */\n\tgrid-column: 1 / -1;\n\n\tdisplay: grid;\n\tgrid-template-columns: ${ GRID_TEMPLATE_COLS };\n\talign-items: center;\n\n\t@supports ( grid-template-columns: subgrid ) {\n\t\t/*\n\t\t * Define a grid layout which inherits the same columns configuration\n\t\t * from the parent layout (ie. subgrid). This allows the menu\n\t\t * to synchronize the indentation of all its items.\n\t\t */\n\t\tgrid-template-columns: subgrid;\n\t}\n\n\tfont-size: ${ font( 'default.fontSize' ) };\n\tfont-family: inherit;\n\tfont-weight: normal;\n\tline-height: 20px;\n\n\tcolor: ${ COLORS.theme.foreground };\n\tborder-radius: ${ CONFIG.radiusSmall };\n\n\tpadding-block: ${ ITEM_PADDING_BLOCK };\n\tpadding-inline: ${ ITEM_PADDING_INLINE };\n\n\t/*\n\t * Make sure that, when an item is scrolled into view (eg. while using the\n\t * keyboard to move focus), the whole item comes into view\n\t */\n\tscroll-margin: ${ CONTENT_WRAPPER_PADDING };\n\n\tuser-select: none;\n\toutline: none;\n\n\t&[aria-disabled='true'] {\n\t\tcolor: ${ COLORS.ui.textDisabled };\n\t\tcursor: not-allowed;\n\t}\n\n\t/* Active item (including hover) */\n\t&[data-active-item]:not( [data-focus-visible] ):not(\n\t\t\t[aria-disabled='true']\n\t\t) {\n\t\tbackground-color: ${ COLORS.theme.accent };\n\t\tcolor: ${ COLORS.white };\n\t}\n\n\t/* Keyboard focus (focus-visible) */\n\t&[data-focus-visible] {\n\t\tbox-shadow: 0 0 0 1.5px ${ COLORS.theme.accent };\n\n\t\t/* Only visible in Windows High Contrast mode */\n\t\toutline: 2px solid transparent;\n\t}\n\n\t/* Active (ie. pressed, mouse down) */\n\t&:active,\n\t&[data-active] {\n\t\t/* TODO: should there be a visual active state? */\n\t}\n\n\t/* When the item is the trigger of an open submenu */\n\t${ MenuPopoverInnerWrapper }:not(:focus) &:not(:focus)[aria-expanded=\"true\"] {\n\t\tbackground-color: ${ LIGHT_BACKGROUND_COLOR };\n\t\tcolor: ${ COLORS.theme.foreground };\n\t}\n\n\tsvg {\n\t\tfill: currentColor;\n\t}\n`;\n\nexport const MenuItem = styled( Ariakit.MenuItem )`\n\t${ baseItem };\n`;\n\nexport const MenuCheckboxItem = styled( Ariakit.MenuItemCheckbox )`\n\t${ baseItem };\n`;\n\nexport const MenuRadioItem = styled( Ariakit.MenuItemRadio )`\n\t${ baseItem };\n`;\n\nexport const ItemPrefixWrapper = styled.span`\n\t/* Always occupy the first column, even when auto-collapsing */\n\tgrid-column: 1;\n\n\t/*\n\t * Even when the item is not checked, occupy the same screen space to avoid\n\t * the space collapside when no items are checked.\n\t */\n\t${ MenuCheckboxItem } > &,\n\t${ MenuRadioItem } > & {\n\t\t/* Same width as the check icons */\n\t\tmin-width: ${ space( 6 ) };\n\t}\n\n\t${ MenuCheckboxItem } > &,\n\t${ MenuRadioItem } > &,\n\t&:not( :empty ) {\n\t\tmargin-inline-end: ${ space( 2 ) };\n\t}\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\n\tcolor: ${ LIGHTER_TEXT_COLOR };\n\n\t/*\n\t* When the parent menu item is active, except when it's a non-focused/hovered\n\t* submenu trigger (in that case, color should not be inherited)\n\t*/\n\t[data-active-item]:not( [data-focus-visible] ) > &,\n\t/* When the parent menu item is disabled */\n\t[aria-disabled='true'] > & {\n\t\tcolor: inherit;\n\t}\n`;\n\nexport const MenuItemContentWrapper = styled.div`\n\t/*\n\t * Always occupy the second column, since the first column\n\t * is taken by the prefix wrapper (when displayed).\n\t */\n\tgrid-column: 2;\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: ${ space( 3 ) };\n\n\tpointer-events: none;\n`;\n\nexport const MenuItemChildrenWrapper = styled.div`\n\tflex: 1;\n\n\tdisplay: inline-flex;\n\tflex-direction: column;\n\tgap: ${ space( 1 ) };\n`;\n\nexport const ItemSuffixWrapper = styled.span`\n\tflex: 0 1 fit-content;\n\tmin-width: 0;\n\twidth: fit-content;\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: ${ space( 3 ) };\n\n\tcolor: ${ LIGHTER_TEXT_COLOR };\n\n\t/*\n\t * When the parent menu item is active, except when it's a non-focused/hovered\n\t * submenu trigger (in that case, color should not be inherited)\n\t */\n\t[data-active-item]:not( [data-focus-visible] ) *:not(${ MenuPopoverInnerWrapper }) &,\n\t/* When the parent menu item is disabled */\n\t[aria-disabled='true'] *:not(${ MenuPopoverInnerWrapper }) & {\n\t\tcolor: inherit;\n\t}\n`;\n\nexport const MenuGroup = styled( Ariakit.MenuGroup )`\n\t/* Ignore this element when calculating the layout. Useful for subgrid */\n\tdisplay: contents;\n`;\n\nexport const MenuGroupLabel = styled( Ariakit.MenuGroupLabel )`\n\t/* Occupy the width of all grid columns (ie. full width) */\n\tgrid-column: 1 / -1;\n\n\tpadding-block-start: ${ space( 3 ) };\n\tpadding-block-end: ${ space( 2 ) };\n\tpadding-inline: ${ ITEM_PADDING_INLINE };\n`;\n\nexport const MenuSeparator = styled( Ariakit.MenuSeparator )<\n\tPick< MenuContext, 'variant' >\n>`\n\t/* Occupy the width of all grid columns (ie. full width) */\n\tgrid-column: 1 / -1;\n\n\tborder: none;\n\theight: ${ CONFIG.borderWidth };\n\tbackground-color: ${ ( props ) =>\n\t\tprops.variant === 'toolbar'\n\t\t\t? TOOLBAR_VARIANT_BORDER_COLOR\n\t\t\t: DIVIDER_COLOR };\n\t/* Align with menu items' content */\n\tmargin-block: ${ space( 2 ) };\n\tmargin-inline: ${ ITEM_PADDING_INLINE };\n\n\t/* Only visible in Windows High Contrast mode */\n\toutline: 2px solid transparent;\n`;\n\nexport const SubmenuChevronIcon = styled( Icon )`\n\twidth: ${ space( 1.5 ) };\n\t${ rtl(\n\t\t{\n\t\t\ttransform: `scaleX(1)`,\n\t\t},\n\t\t{\n\t\t\ttransform: `scaleX(-1)`,\n\t\t}\n\t) };\n`;\n\nexport const MenuItemLabel = styled( Truncate )`\n\tfont-size: ${ font( 'default.fontSize' ) };\n\tline-height: 20px;\n\tcolor: inherit;\n`;\n\nexport const MenuItemHelpText = styled( Truncate )`\n\tfont-size: ${ font( 'helpText.fontSize' ) };\n\tline-height: 16px;\n\tcolor: ${ LIGHTER_TEXT_COLOR };\n\tword-break: break-all;\n\n\t[data-active-item]:not( [data-focus-visible] )\n\t\t*:not( ${ MenuPopoverInnerWrapper } )\n\t\t&,\n\t[aria-disabled='true'] *:not( ${ MenuPopoverInnerWrapper } ) & {\n\t\tcolor: inherit;\n\t}\n`;\n"],"mappings":";;AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,SAASC,GAAG,QAAQ,gBAAgB;AAGpC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,IAAI,EAAEC,GAAG,EAAEC,MAAM,QAAQ,UAAU;AACpD,SAASC,KAAK,QAAQ,gBAAgB;AACtC,OAAOC,IAAI,MAAM,SAAS;AAC1B,SAASC,QAAQ,QAAQ,aAAa;AAGtC,MAAMC,gBAAgB,GAAG;EACxBC,kBAAkB,EAAE,IAAI;EACxBC,oBAAoB,EAAE,GAAG;EACzBC,QAAQ,EAAE;IACTC,EAAE,EAAE,OAAO;I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B,GAC5BH,aAAa,oBAEAhB,KAAK,CAAE,CAAE,CAAC,qBACTY,mBAAmB,uCAAAgB,OAAA,CAAAC,GAAA,CAAAC,QAAA,4idAIrC;AAED,OAAO,MAAM+B,kBAAkB,gBAAGlC,OAAA,CAAQ1B,IAAI,EAAA2B,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,WACrChC,KAAK,CAAE,GAAI,CAAC,OACnBF,GAAG,CACL;EACCgE,SAAS,EAAE;AACZ,CAAC,EACD;EACCA,SAAS,EAAE;AACZ,CACD,CAAC,SAAAlC,OAAA,CAAAC,GAAA,CAAAC,QAAA,4idACD;AAED,OAAO,MAAMiC,aAAa,gBAAGpC,OAAA,CAAQzB,QAAQ,EAAA0B,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,eAChCnC,IAAI,CAAE,kBAAmB,CAAC,wCAAA+B,OAAA,CAAAC,GAAA,CAAAC,QAAA,4idAGxC;AAED,OAAO,MAAMkC,gBAAgB,gBAAGrC,OAAA,CAAQzB,QAAQ,EAAA0B,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,eACnCnC,IAAI,CAAE,mBAAoB,CAAC,8BAE/BoB,kBAAkB,kFAIjBqB,uBAAuB,yCAEDA,uBAAuB,4BAAAV,OAAA,CAAAC,GAAA,CAAAC,QAAA,4idAGxD","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/menu/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type * as Ariakit from '@ariakit/react';\nimport type { Placement } from '@floating-ui/react-dom';\n\nexport interface MenuContext {\n\t/**\n\t * The ariakit store shared across all Menu subcomponents.\n\t */\n\tstore: Ariakit.MenuStore;\n\t/**\n\t * The variant used by the underlying menu popover.\n\t */\n\tvariant?: 'toolbar';\n}\n\nexport interface MenuProps {\n\t/**\n\t * The button triggering the menu popover.\n\t */\n\ttrigger: React.ReactElement;\n\t/**\n\t * The contents of the menu (ie. one or more menu items).\n\t */\n\tchildren?: React.ReactNode;\n\t/**\n\t * The open state of the menu popover when it is initially rendered. Use when\n\t * not wanting to control its open state.\n\t *\n\t * @default false\n\t */\n\tdefaultOpen?: boolean;\n\t/**\n\t * The controlled open state of the menu popover. Must be used in conjunction\n\t * with `onOpenChange`.\n\t */\n\topen?: boolean;\n\t/**\n\t * Event handler called when the open state of the menu popover changes.\n\t */\n\tonOpenChange?: ( open: boolean ) => void;\n\t/**\n\t * The modality of the menu popover. When set to true, interaction with\n\t * outside elements will be disabled and only menu content will be visible to\n\t * screen readers.\n\t *\n\t * @default true\n\t */\n\tmodal?: boolean;\n\t/**\n\t * The placement of the menu popover.\n\t *\n\t * @default 'bottom-start' for root-level menus, 'right-start' for nested menus\n\t */\n\tplacement?: Placement;\n\t/**\n\t * The distance between the popover and the anchor element.\n\t *\n\t * @default 8 for root-level menus, 16 for nested menus\n\t */\n\tgutter?: number;\n\t/**\n\t * The skidding of the popover along the anchor element. Can be set to\n\t * negative values to make the popover shift to the opposite side.\n\t *\n\t * @default 0 for root-level menus, -8 for nested menus\n\t */\n\tshift?: number;\n\t/**\n\t * Determines whether the menu popover will be hidden when the user presses\n\t * the Escape key.\n\t *\n\t * @default `( event ) => { event.preventDefault(); return true; }`\n\t */\n\thideOnEscape?:\n\t\t| boolean\n\t\t| ( (\n\t\t\t\tevent: KeyboardEvent | React.KeyboardEvent< Element >\n\t\t ) => boolean );\n}\n\nexport interface MenuGroupProps {\n\t/**\n\t * The contents of the menu group (ie. an optional menu group label and one\n\t * or more menu items).\n\t */\n\tchildren: React.ReactNode;\n}\n\nexport interface MenuGroupLabelProps {\n\t/**\n\t * The contents of the menu group label.\n\t */\n\tchildren: React.ReactNode;\n}\n\nexport interface MenuItemProps {\n\t/**\n\t * The contents of the menu item.\n\t */\n\tchildren: React.ReactNode;\n\t/**\n\t * The contents of the menu item's prefix.\n\t */\n\tprefix?: React.ReactNode;\n\t/**\n\t * The contents of the menu item's suffix.\n\t */\n\tsuffix?: React.ReactNode;\n\t/**\n\t * Whether to hide the menu popover when the menu item is clicked.\n\t *\n\t * @default true\n\t */\n\thideOnClick?: boolean;\n\t/**\n\t * Determines if the element is disabled.\n\t */\n\tdisabled?: boolean;\n}\n\nexport interface MenuCheckboxItemProps\n\textends Omit< MenuItemProps, 'prefix' | 'hideOnClick' > {\n\t/**\n\t * Whether to hide the menu popover when the menu item is clicked.\n\t *\n\t * @default false\n\t */\n\thideOnClick?: boolean;\n\t/**\n\t * The checkbox menu item's name.\n\t */\n\tname: string;\n\t/**\n\t * The checkbox item's value, useful when using multiple checkbox menu items\n\t * associated to the same `name`.\n\t */\n\tvalue?: string;\n\t/**\n\t * The controlled checked state of the checkbox menu item.\n\t */\n\tchecked?: boolean;\n\t/**\n\t * The checked state of the checkbox menu item when it is initially rendered.\n\t * Use when not wanting to control its checked state.\n\t */\n\tdefaultChecked?: boolean;\n\t/**\n\t * Event handler called when the checked state of the checkbox menu item changes.\n\t */\n\tonChange?: ( event: React.ChangeEvent< HTMLInputElement > ) => void;\n}\n\nexport interface MenuRadioItemProps\n\textends Omit< MenuItemProps, 'prefix' | 'hideOnClick' > {\n\t/**\n\t * Whether to hide the menu popover when the menu item is clicked.\n\t *\n\t * @default false\n\t */\n\thideOnClick?: boolean;\n\t/**\n\t * The radio item's name.\n\t */\n\tname: string;\n\t/**\n\t * The radio item's value.\n\t */\n\tvalue: string | number;\n\t/**\n\t * The controlled checked state of the radio menu item.\n\t */\n\tchecked?: boolean;\n\t/**\n\t * The checked state of the radio menu item when it is initially rendered.\n\t * Use when not wanting to control its checked state.\n\t */\n\tdefaultChecked?: boolean;\n\t/**\n\t * Event handler called when the checked radio menu item changes.\n\t */\n\tonChange?: ( event: React.ChangeEvent< HTMLInputElement > ) => void;\n}\n\nexport interface MenuSeparatorProps {}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","flushSync","useTemporaryFocusVisibleFix","onBlur","onBlurProp","focusVisible","setFocusVisible","undefined","onFocusVisible","event"],"sources":["@wordpress/components/src/menu/use-temporary-focus-visible-fix.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, flushSync } from '@wordpress/element';\n\nexport function useTemporaryFocusVisibleFix( {\n\tonBlur: onBlurProp,\n}: {\n\tonBlur?: React.FocusEventHandler< HTMLDivElement >;\n} ) {\n\tconst [ focusVisible, setFocusVisible ] = useState( false );\n\treturn {\n\t\t'data-focus-visible': focusVisible || undefined,\n\t\tonFocusVisible: () => {\n\t\t\tflushSync( () => setFocusVisible( true ) );\n\t\t},\n\t\tonBlur: ( ( event ) => {\n\t\t\tonBlurProp?.( event );\n\t\t\tsetFocusVisible( false );\n\t\t} ) as React.FocusEventHandler< HTMLDivElement >,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AAExD,OAAO,SAASC,2BAA2BA,CAAE;EAC5CC,MAAM,EAAEC;AAGT,CAAC,EAAG;EACH,MAAM,CAAEC,YAAY,EAAEC,eAAe,CAAE,GAAGN,QAAQ,CAAE,KAAM,CAAC;EAC3D,OAAO;IACN,oBAAoB,EAAEK,YAAY,IAAIE,SAAS;IAC/CC,cAAc,EAAEA,CAAA,KAAM;MACrBP,SAAS,CAAE,MAAMK,eAAe,CAAE,IAAK,CAAE,CAAC;IAC3C,CAAC;IACDH,MAAM,EAAMM,KAAK,IAAM;MACtBL,UAAU,GAAIK,KAAM,CAAC;MACrBH,eAAe,CAAE,KAAM,CAAC;IACzB;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","cloneElement","forwardRef","Shortcut","Button","Icon","jsx","_jsx","jsxs","_jsxs","UnforwardedMenuItem","props","ref","children","info","className","icon","iconPosition","shortcut","isSelected","role","suffix","buttonProps","undefined","MenuItem"],"sources":["@wordpress/components/src/menu-item/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { cloneElement, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Shortcut from '../shortcut';\nimport Button from '../button';\nimport Icon from '../icon';\nimport type { WordPressComponentProps } from '../context';\nimport type { MenuItemProps } from './types';\n\nfunction UnforwardedMenuItem(\n\tprops: WordPressComponentProps< MenuItemProps, 'button', false >,\n\tref: ForwardedRef< HTMLButtonElement >\n) {\n\tlet {\n\t\tchildren,\n\t\tinfo,\n\t\tclassName,\n\t\ticon,\n\t\ticonPosition = 'right',\n\t\tshortcut,\n\t\tisSelected,\n\t\trole = 'menuitem',\n\t\tsuffix,\n\t\t...buttonProps\n\t} = props;\n\n\tclassName = clsx( 'components-menu-item__button', className );\n\n\tif ( info ) {\n\t\tchildren = (\n\t\t\t<span className=\"components-menu-item__info-wrapper\">\n\t\t\t\t<span className=\"components-menu-item__item\">{ children }</span>\n\t\t\t\t<span className=\"components-menu-item__info\">{ info }</span>\n\t\t\t</span>\n\t\t);\n\t}\n\n\tif ( icon && typeof icon !== 'string' ) {\n\t\ticon = cloneElement( icon, {\n\t\t\tclassName: clsx( 'components-menu-items__item-icon', {\n\t\t\t\t'has-icon-right': iconPosition === 'right',\n\t\t\t} ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\tref={ ref }\n\t\t\t// Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked\n\t\t\taria-checked={\n\t\t\t\trole === 'menuitemcheckbox' || role === 'menuitemradio'\n\t\t\t\t\t? isSelected\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\trole={ role }\n\t\t\ticon={ iconPosition === 'left' ? icon : undefined }\n\t\t\tclassName={ className }\n\t\t\t{ ...buttonProps }\n\t\t>\n\t\t\t<span className=\"components-menu-item__item\">{ children }</span>\n\t\t\t{ ! suffix && (\n\t\t\t\t<Shortcut\n\t\t\t\t\tclassName=\"components-menu-item__shortcut\"\n\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ ! suffix && icon && iconPosition === 'right' && (\n\t\t\t\t<Icon icon={ icon } />\n\t\t\t) }\n\t\t\t{ suffix }\n\t\t</Button>\n\t);\n}\n\n/**\n * MenuItem is a component which renders a button intended to be used in combination with the `DropdownMenu` component.\n *\n * ```jsx\n * import { MenuItem } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyMenuItem = () => {\n * \tconst [ isActive, setIsActive ] = useState( true );\n *\n * \treturn (\n * \t\t<MenuItem\n * \t\t\ticon={ isActive ? 'yes' : 'no' }\n * \t\t\tisSelected={ isActive }\n * \t\t\trole=\"menuitemcheckbox\"\n * \t\t\tonClick={ () => setIsActive( ( state ) => ! state ) }\n * \t\t>\n * \t\t\tToggle\n * \t\t</MenuItem>\n * \t);\n * };\n * ```\n */\nexport const MenuItem = forwardRef( UnforwardedMenuItem );\n\nexport default MenuItem;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,YAAY,EAAEC,UAAU,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,IAAI,MAAM,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAI3B,SAASC,mBAAmBA,CAC3BC,KAAgE,EAChEC,GAAsC,EACrC;EACD,IAAI;IACHC,QAAQ;IACRC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,YAAY,GAAG,OAAO;IACtBC,QAAQ;IACRC,UAAU;IACVC,IAAI,GAAG,UAAU;IACjBC,MAAM;IACN,GAAGC;EACJ,CAAC,GAAGX,KAAK;EAETI,SAAS,GAAGf,IAAI,CAAE,8BAA8B,EAAEe,SAAU,CAAC;EAE7D,IAAKD,IAAI,EAAG;IACXD,QAAQ,gBACPJ,KAAA;MAAMM,SAAS,EAAC,oCAAoC;MAAAF,QAAA,gBACnDN,IAAA;QAAMQ,SAAS,EAAC,4BAA4B;QAAAF,QAAA,EAAGA;MAAQ,CAAQ,CAAC,eAChEN,IAAA;QAAMQ,SAAS,EAAC,4BAA4B;QAAAF,QAAA,EAAGC;MAAI,CAAQ,CAAC;IAAA,CACvD,CACN;EACF;EAEA,IAAKE,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAG;IACvCA,IAAI,GAAGf,YAAY,CAAEe,IAAI,EAAE;MAC1BD,SAAS,EAAEf,IAAI,CAAE,kCAAkC,EAAE;QACpD,gBAAgB,EAAEiB,YAAY,KAAK;MACpC,CAAE;IACH,CAAE,CAAC;EACJ;EAEA,oBACCR,KAAA,CAACL,MAAM;
|
|
1
|
+
{"version":3,"names":["clsx","cloneElement","forwardRef","Shortcut","Button","Icon","jsx","_jsx","jsxs","_jsxs","UnforwardedMenuItem","props","ref","children","info","className","icon","iconPosition","shortcut","isSelected","role","suffix","buttonProps","__next40pxDefaultSize","undefined","MenuItem"],"sources":["@wordpress/components/src/menu-item/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { cloneElement, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Shortcut from '../shortcut';\nimport Button from '../button';\nimport Icon from '../icon';\nimport type { WordPressComponentProps } from '../context';\nimport type { MenuItemProps } from './types';\n\nfunction UnforwardedMenuItem(\n\tprops: WordPressComponentProps< MenuItemProps, 'button', false >,\n\tref: ForwardedRef< HTMLButtonElement >\n) {\n\tlet {\n\t\tchildren,\n\t\tinfo,\n\t\tclassName,\n\t\ticon,\n\t\ticonPosition = 'right',\n\t\tshortcut,\n\t\tisSelected,\n\t\trole = 'menuitem',\n\t\tsuffix,\n\t\t...buttonProps\n\t} = props;\n\n\tclassName = clsx( 'components-menu-item__button', className );\n\n\tif ( info ) {\n\t\tchildren = (\n\t\t\t<span className=\"components-menu-item__info-wrapper\">\n\t\t\t\t<span className=\"components-menu-item__item\">{ children }</span>\n\t\t\t\t<span className=\"components-menu-item__info\">{ info }</span>\n\t\t\t</span>\n\t\t);\n\t}\n\n\tif ( icon && typeof icon !== 'string' ) {\n\t\ticon = cloneElement( icon, {\n\t\t\tclassName: clsx( 'components-menu-items__item-icon', {\n\t\t\t\t'has-icon-right': iconPosition === 'right',\n\t\t\t} ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tref={ ref }\n\t\t\t// Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked\n\t\t\taria-checked={\n\t\t\t\trole === 'menuitemcheckbox' || role === 'menuitemradio'\n\t\t\t\t\t? isSelected\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\trole={ role }\n\t\t\ticon={ iconPosition === 'left' ? icon : undefined }\n\t\t\tclassName={ className }\n\t\t\t{ ...buttonProps }\n\t\t>\n\t\t\t<span className=\"components-menu-item__item\">{ children }</span>\n\t\t\t{ ! suffix && (\n\t\t\t\t<Shortcut\n\t\t\t\t\tclassName=\"components-menu-item__shortcut\"\n\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ ! suffix && icon && iconPosition === 'right' && (\n\t\t\t\t<Icon icon={ icon } />\n\t\t\t) }\n\t\t\t{ suffix }\n\t\t</Button>\n\t);\n}\n\n/**\n * MenuItem is a component which renders a button intended to be used in combination with the `DropdownMenu` component.\n *\n * ```jsx\n * import { MenuItem } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyMenuItem = () => {\n * \tconst [ isActive, setIsActive ] = useState( true );\n *\n * \treturn (\n * \t\t<MenuItem\n * \t\t\ticon={ isActive ? 'yes' : 'no' }\n * \t\t\tisSelected={ isActive }\n * \t\t\trole=\"menuitemcheckbox\"\n * \t\t\tonClick={ () => setIsActive( ( state ) => ! state ) }\n * \t\t>\n * \t\t\tToggle\n * \t\t</MenuItem>\n * \t);\n * };\n * ```\n */\nexport const MenuItem = forwardRef( UnforwardedMenuItem );\n\nexport default MenuItem;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,YAAY,EAAEC,UAAU,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,IAAI,MAAM,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAI3B,SAASC,mBAAmBA,CAC3BC,KAAgE,EAChEC,GAAsC,EACrC;EACD,IAAI;IACHC,QAAQ;IACRC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,YAAY,GAAG,OAAO;IACtBC,QAAQ;IACRC,UAAU;IACVC,IAAI,GAAG,UAAU;IACjBC,MAAM;IACN,GAAGC;EACJ,CAAC,GAAGX,KAAK;EAETI,SAAS,GAAGf,IAAI,CAAE,8BAA8B,EAAEe,SAAU,CAAC;EAE7D,IAAKD,IAAI,EAAG;IACXD,QAAQ,gBACPJ,KAAA;MAAMM,SAAS,EAAC,oCAAoC;MAAAF,QAAA,gBACnDN,IAAA;QAAMQ,SAAS,EAAC,4BAA4B;QAAAF,QAAA,EAAGA;MAAQ,CAAQ,CAAC,eAChEN,IAAA;QAAMQ,SAAS,EAAC,4BAA4B;QAAAF,QAAA,EAAGC;MAAI,CAAQ,CAAC;IAAA,CACvD,CACN;EACF;EAEA,IAAKE,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAG;IACvCA,IAAI,GAAGf,YAAY,CAAEe,IAAI,EAAE;MAC1BD,SAAS,EAAEf,IAAI,CAAE,kCAAkC,EAAE;QACpD,gBAAgB,EAAEiB,YAAY,KAAK;MACpC,CAAE;IACH,CAAE,CAAC;EACJ;EAEA,oBACCR,KAAA,CAACL,MAAM;IACNmB,qBAAqB;IACrBX,GAAG,EAAGA;IACN;IAAA;IACA,gBACCQ,IAAI,KAAK,kBAAkB,IAAIA,IAAI,KAAK,eAAe,GACpDD,UAAU,GACVK,SACH;IACDJ,IAAI,EAAGA,IAAM;IACbJ,IAAI,EAAGC,YAAY,KAAK,MAAM,GAAGD,IAAI,GAAGQ,SAAW;IACnDT,SAAS,EAAGA,SAAW;IAAA,GAClBO,WAAW;IAAAT,QAAA,gBAEhBN,IAAA;MAAMQ,SAAS,EAAC,4BAA4B;MAAAF,QAAA,EAAGA;IAAQ,CAAQ,CAAC,EAC9D,CAAEQ,MAAM,iBACTd,IAAA,CAACJ,QAAQ;MACRY,SAAS,EAAC,gCAAgC;MAC1CG,QAAQ,EAAGA;IAAU,CACrB,CACD,EACC,CAAEG,MAAM,IAAIL,IAAI,IAAIC,YAAY,KAAK,OAAO,iBAC7CV,IAAA,CAACF,IAAI;MAACW,IAAI,EAAGA;IAAM,CAAE,CACrB,EACCK,MAAM;EAAA,CACD,CAAC;AAEX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,QAAQ,GAAGvB,UAAU,CAAEQ,mBAAoB,CAAC;AAEzD,eAAee,QAAQ","ignoreList":[]}
|
package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js
CHANGED
|
@@ -63,9 +63,9 @@ const BottomSheetNavigationScreen = ({
|
|
|
63
63
|
* callbacks triggered based upon which screen is currently active.
|
|
64
64
|
*
|
|
65
65
|
* Related: https://github.com/WordPress/gutenberg/pull/36328#discussion_r768897546
|
|
66
|
+
*
|
|
67
|
+
* Also see https://github.com/WordPress/gutenberg/pull/41166.
|
|
66
68
|
*/
|
|
67
|
-
// see https://github.com/WordPress/gutenberg/pull/41166
|
|
68
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
69
69
|
}, []));
|
|
70
70
|
useFocusEffect(useCallback(() => {
|
|
71
71
|
if (fullScreen) {
|
|
@@ -111,9 +111,7 @@ const BottomSheetNavigationScreen = ({
|
|
|
111
111
|
})
|
|
112
112
|
})
|
|
113
113
|
});
|
|
114
|
-
//
|
|
115
|
-
// see https://github.com/WordPress/gutenberg/pull/41166
|
|
116
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
114
|
+
// See https://github.com/WordPress/gutenberg/pull/41166
|
|
117
115
|
}, [children, isFocused, safeAreaBottomInset, listProps, name, isScrollable, isNested, onLayout]);
|
|
118
116
|
};
|
|
119
117
|
export default BottomSheetNavigationScreen;
|
package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useIsFocused","useNavigation","useFocusEffect","ScrollView","TouchableHighlight","useWindowDimensions","View","useRef","useCallback","useContext","useMemo","BottomSheetNavigationContext","BottomSheetContext","styles","jsx","_jsx","jsxs","_jsxs","BottomSheetNavigationScreen","children","fullScreen","isScrollable","isNested","name","navigation","maxHeight","isFocused","onHandleHardwareButtonPress","shouldEnableBottomSheetMaxHeight","setIsFullScreen","listProps","safeAreaBottomInset","height","windowHeight","setHeight","canGoBack","goBack","current","onLayout","nativeEvent","layout","testID","accessible","style","scrollableContent","paddingBottom"],"sources":["@wordpress/components/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tuseIsFocused,\n\tuseNavigation,\n\tuseFocusEffect,\n} from '@react-navigation/native';\nimport {\n\tScrollView,\n\tTouchableHighlight,\n\tuseWindowDimensions,\n\tView,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\n\nimport { useRef, useCallback, useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { BottomSheetNavigationContext } from './bottom-sheet-navigation-context';\nimport { BottomSheetContext } from '../bottom-sheet-context';\nimport styles from './styles.scss';\n\nconst BottomSheetNavigationScreen = ( {\n\tchildren,\n\tfullScreen,\n\tisScrollable,\n\tisNested,\n\tname,\n} ) => {\n\tconst navigation = useNavigation();\n\tconst maxHeight = useRef( 0 );\n\tconst isFocused = useIsFocused();\n\tconst {\n\t\tonHandleHardwareButtonPress,\n\t\tshouldEnableBottomSheetMaxHeight,\n\t\tsetIsFullScreen,\n\t\tlistProps,\n\t\tsafeAreaBottomInset,\n\t} = useContext( BottomSheetContext );\n\tconst { height: windowHeight } = useWindowDimensions();\n\n\tconst { setHeight } = useContext( BottomSheetNavigationContext );\n\n\tuseFocusEffect(\n\t\tuseCallback( () => {\n\t\t\tonHandleHardwareButtonPress( () => {\n\t\t\t\tif ( navigation.canGoBack() ) {\n\t\t\t\t\tshouldEnableBottomSheetMaxHeight( true );\n\t\t\t\t\tnavigation.goBack();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tonHandleHardwareButtonPress( null );\n\t\t\t\treturn false;\n\t\t\t} );\n\t\t\t/**\n\t\t\t * TODO: onHandleHardwareButtonPress stores a single value, which means\n\t\t\t * future invocations from sibling screens can replace the callback for\n\t\t\t * the currently active screen. Currently, the empty dependency array\n\t\t\t * passed to useCallback here is what prevents erroneous callback\n\t\t\t * replacements, but leveraging memoization to achieve this is brittle and\n\t\t\t * explicitly discouraged in the React documentation.\n\t\t\t * https://react.dev/reference/react/useMemo\n\t\t\t *\n\t\t\t * Ideally, we refactor onHandleHardwareButtonPress to manage multiple\n\t\t\t * callbacks triggered based upon which screen is currently active.\n\t\t\t *\n\t\t\t * Related: https://github.com/WordPress/gutenberg/pull/36328#discussion_r768897546\n\t\t\t
|
|
1
|
+
{"version":3,"names":["useIsFocused","useNavigation","useFocusEffect","ScrollView","TouchableHighlight","useWindowDimensions","View","useRef","useCallback","useContext","useMemo","BottomSheetNavigationContext","BottomSheetContext","styles","jsx","_jsx","jsxs","_jsxs","BottomSheetNavigationScreen","children","fullScreen","isScrollable","isNested","name","navigation","maxHeight","isFocused","onHandleHardwareButtonPress","shouldEnableBottomSheetMaxHeight","setIsFullScreen","listProps","safeAreaBottomInset","height","windowHeight","setHeight","canGoBack","goBack","current","onLayout","nativeEvent","layout","testID","accessible","style","scrollableContent","paddingBottom"],"sources":["@wordpress/components/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tuseIsFocused,\n\tuseNavigation,\n\tuseFocusEffect,\n} from '@react-navigation/native';\nimport {\n\tScrollView,\n\tTouchableHighlight,\n\tuseWindowDimensions,\n\tView,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\n\nimport { useRef, useCallback, useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { BottomSheetNavigationContext } from './bottom-sheet-navigation-context';\nimport { BottomSheetContext } from '../bottom-sheet-context';\nimport styles from './styles.scss';\n\nconst BottomSheetNavigationScreen = ( {\n\tchildren,\n\tfullScreen,\n\tisScrollable,\n\tisNested,\n\tname,\n} ) => {\n\tconst navigation = useNavigation();\n\tconst maxHeight = useRef( 0 );\n\tconst isFocused = useIsFocused();\n\tconst {\n\t\tonHandleHardwareButtonPress,\n\t\tshouldEnableBottomSheetMaxHeight,\n\t\tsetIsFullScreen,\n\t\tlistProps,\n\t\tsafeAreaBottomInset,\n\t} = useContext( BottomSheetContext );\n\tconst { height: windowHeight } = useWindowDimensions();\n\n\tconst { setHeight } = useContext( BottomSheetNavigationContext );\n\n\tuseFocusEffect(\n\t\tuseCallback( () => {\n\t\t\tonHandleHardwareButtonPress( () => {\n\t\t\t\tif ( navigation.canGoBack() ) {\n\t\t\t\t\tshouldEnableBottomSheetMaxHeight( true );\n\t\t\t\t\tnavigation.goBack();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tonHandleHardwareButtonPress( null );\n\t\t\t\treturn false;\n\t\t\t} );\n\t\t\t/**\n\t\t\t * TODO: onHandleHardwareButtonPress stores a single value, which means\n\t\t\t * future invocations from sibling screens can replace the callback for\n\t\t\t * the currently active screen. Currently, the empty dependency array\n\t\t\t * passed to useCallback here is what prevents erroneous callback\n\t\t\t * replacements, but leveraging memoization to achieve this is brittle and\n\t\t\t * explicitly discouraged in the React documentation.\n\t\t\t * https://react.dev/reference/react/useMemo\n\t\t\t *\n\t\t\t * Ideally, we refactor onHandleHardwareButtonPress to manage multiple\n\t\t\t * callbacks triggered based upon which screen is currently active.\n\t\t\t *\n\t\t\t * Related: https://github.com/WordPress/gutenberg/pull/36328#discussion_r768897546\n\t\t\t *\n\t\t\t * Also see https://github.com/WordPress/gutenberg/pull/41166.\n\t\t\t */\n\t\t}, [] )\n\t);\n\n\tuseFocusEffect(\n\t\tuseCallback( () => {\n\t\t\tif ( fullScreen ) {\n\t\t\t\tsetHeight( windowHeight );\n\t\t\t\tsetIsFullScreen( true );\n\t\t\t} else if ( maxHeight.current !== 0 ) {\n\t\t\t\tsetIsFullScreen( false );\n\t\t\t\tsetHeight( maxHeight.current );\n\t\t\t}\n\t\t\treturn () => {};\n\t\t}, [ fullScreen, setHeight, setIsFullScreen, windowHeight ] )\n\t);\n\n\tconst onLayout = ( { nativeEvent } ) => {\n\t\tif ( fullScreen ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { height } = nativeEvent.layout;\n\t\tif ( maxHeight.current !== height && isFocused ) {\n\t\t\tmaxHeight.current = height;\n\t\t\tsetHeight( height );\n\t\t}\n\t};\n\n\treturn useMemo( () => {\n\t\treturn isScrollable || isNested ? (\n\t\t\t<View\n\t\t\t\tonLayout={ onLayout }\n\t\t\t\ttestID={ `navigation-screen-${ name }` }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t) : (\n\t\t\t<ScrollView { ...listProps }>\n\t\t\t\t<TouchableHighlight accessible={ false }>\n\t\t\t\t\t<View\n\t\t\t\t\t\tonLayout={ onLayout }\n\t\t\t\t\t\ttestID={ `navigation-screen-${ name }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t{ ! isNested && (\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\tsafeAreaBottomInset ||\n\t\t\t\t\t\t\t\t\t\tstyles.scrollableContent.paddingBottom,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableHighlight>\n\t\t\t</ScrollView>\n\t\t);\n\t\t// See https://github.com/WordPress/gutenberg/pull/41166\n\t}, [\n\t\tchildren,\n\t\tisFocused,\n\t\tsafeAreaBottomInset,\n\t\tlistProps,\n\t\tname,\n\t\tisScrollable,\n\t\tisNested,\n\t\tonLayout,\n\t] );\n};\n\nexport default BottomSheetNavigationScreen;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,YAAY,EACZC,aAAa,EACbC,cAAc,QACR,0BAA0B;AACjC,SACCC,UAAU,EACVC,kBAAkB,EAClBC,mBAAmB,EACnBC,IAAI,QACE,cAAc;;AAErB;AACA;AACA;;AAEA,SAASC,MAAM,EAAEC,WAAW,EAAEC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;;AAE7E;AACA;AACA;AACA,SAASC,4BAA4B,QAAQ,mCAAmC;AAChF,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,OAAOC,MAAM,MAAM,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnC,MA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etRangeCell extends Component {
|
|
|
179
179
|
return openUnitPicker ? __('double-tap to change unit') : '';
|
|
180
180
|
};
|
|
181
181
|
const getAccessibilityLabel = () => {
|
|
182
|
-
return sprintf(/* translators: accessibility text. Inform about current value.
|
|
182
|
+
return sprintf(/* translators: accessibility text. Inform about current value. 1: Control label. 2: setting label (example: width). 3: Current value. 4: value measurement unit (example: pixels) */
|
|
183
183
|
__('%1$s. %2$s is %3$s %4$s.'), cellProps.label, settingLabel, toFixed(value, decimalNum), unitLabel);
|
|
184
184
|
};
|
|
185
185
|
const containerStyle = [styles.container, isIOS ? styles.containerIOS : styles.containerAndroid];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","AccessibilityInfo","View","Slider","__","sprintf","Component","withPreferredColorScheme","Cell","LockIcon","styles","RangeTextInput","toFixed","jsx","_jsx","jsxs","_jsxs","isIOS","OS","BottomSheetRangeCell","constructor","props","onSliderChange","bind","onCompleteSliderChange","onTextInputChange","a11yIncrementValue","a11yDecrementValue","a11yUpdateValue","value","defaultValue","minimumValue","initialValue","Number","state","inputValue","sliderValue","componentWillUnmount","clearTimeout","timeoutAnnounceValue","decimalNum","onChange","setState","nextValue","onComplete","step","maximumValue","newValue","undefined","announceValue","label","unitLabel","setTimeout","announceForAccessibility","render","disabled","preferredColorScheme","minimumTrackTintColor","maximumTrackTintColor","thumbTintColor","preview","cellContainerStyle","shouldDisplayTextInput","settingLabel","openUnitPicker","children","cellProps","getAccessibilityHint","getAccessibilityLabel","containerStyle","container","containerIOS","containerAndroid","accessible","accessibilityRole","accessibilityActions","name","onAccessibilityAction","event","nativeEvent","actionName","accessibilityLabel","accessibilityHint","importantForAccessibility","cellContainerStyles","cellRowContainerStyle","leftAlign","editable","activeOpacity","valueStyle","showLockIcon","style","testID","onValueChange","onSlidingComplete","ref","slider","sliderRef","sliderIOS","sliderAndroid","min","max"],"sources":["@wordpress/components/src/mobile/bottom-sheet/range-cell.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, AccessibilityInfo, View } from 'react-native';\nimport Slider from '@react-native-community/slider';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Cell from './cell';\nimport LockIcon from './lock-icon';\nimport styles from './range-cell.scss';\nimport RangeTextInput from './range-text-input';\nimport { toFixed } from '../utils';\n\nconst isIOS = Platform.OS === 'ios';\n\nclass BottomSheetRangeCell extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.onSliderChange = this.onSliderChange.bind( this );\n\t\tthis.onCompleteSliderChange = this.onCompleteSliderChange.bind( this );\n\t\tthis.onTextInputChange = this.onTextInputChange.bind( this );\n\t\tthis.a11yIncrementValue = this.a11yIncrementValue.bind( this );\n\t\tthis.a11yDecrementValue = this.a11yDecrementValue.bind( this );\n\t\tthis.a11yUpdateValue = this.a11yUpdateValue.bind( this );\n\n\t\tconst { value, defaultValue, minimumValue } = props;\n\t\tconst initialValue = Number( value || defaultValue || minimumValue );\n\n\t\tthis.state = {\n\t\t\tinputValue: initialValue,\n\t\t\tsliderValue: initialValue,\n\t\t};\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timeoutAnnounceValue );\n\t}\n\n\tonSliderChange( initialValue ) {\n\t\tconst { decimalNum, onChange } = this.props;\n\t\tinitialValue = toFixed( initialValue, decimalNum );\n\t\tthis.setState( { inputValue: initialValue } );\n\t\tonChange( initialValue );\n\t}\n\n\tonTextInputChange( nextValue ) {\n\t\tconst { onChange, onComplete } = this.props;\n\t\tthis.setState( {\n\t\t\tsliderValue: nextValue,\n\t\t} );\n\t\tonChange( nextValue );\n\t\tif ( onComplete ) {\n\t\t\tonComplete( nextValue );\n\t\t}\n\t}\n\n\tonCompleteSliderChange( nextValue ) {\n\t\tconst { decimalNum, onComplete } = this.props;\n\t\tnextValue = toFixed( nextValue, decimalNum );\n\t\tif ( onComplete ) {\n\t\t\tonComplete( nextValue );\n\t\t}\n\t}\n\n\t/*\n\t * Only used with screenreaders like VoiceOver and TalkBack. Increments the\n\t * value of this setting programmatically.\n\t */\n\ta11yIncrementValue() {\n\t\tconst { step = 5, maximumValue, decimalNum } = this.props;\n\t\tconst { inputValue } = this.state;\n\n\t\tconst newValue = toFixed( inputValue + step, decimalNum );\n\n\t\tif ( newValue <= maximumValue || maximumValue === undefined ) {\n\t\t\tthis.a11yUpdateValue( newValue );\n\t\t}\n\t}\n\n\t/*\n\t * Only used with screenreaders like VoiceOver and TalkBack. Decrements the\n\t * value of this setting programmatically.\n\t */\n\ta11yDecrementValue() {\n\t\tconst { step = 5, minimumValue, decimalNum } = this.props;\n\t\tconst { sliderValue } = this.state;\n\n\t\tconst newValue = toFixed( sliderValue - step, decimalNum );\n\n\t\tif ( newValue >= minimumValue ) {\n\t\t\tthis.a11yUpdateValue( newValue );\n\t\t}\n\t}\n\n\ta11yUpdateValue( newValue ) {\n\t\tconst { onChange, onComplete } = this.props;\n\t\tthis.setState( {\n\t\t\tsliderValue: newValue,\n\t\t\tinputValue: newValue,\n\t\t} );\n\t\tonChange( newValue );\n\t\tif ( onComplete ) {\n\t\t\tonComplete( newValue );\n\t\t}\n\t\tthis.announceValue( newValue );\n\t}\n\n\t/*\n\t * Only used with screenreaders like VoiceOver and TalkBack.\n\t */\n\tannounceValue( value ) {\n\t\tconst { label, unitLabel = '' } = this.props;\n\n\t\tif ( isIOS ) {\n\t\t\t// On Android it triggers the accessibilityLabel with the value change, but\n\t\t\t// on iOS we need to do this manually.\n\t\t\tclearTimeout( this.timeoutAnnounceValue );\n\t\t\tthis.timeoutAnnounceValue = setTimeout( () => {\n\t\t\t\tAccessibilityInfo.announceForAccessibility(\n\t\t\t\t\t`${ value } ${ unitLabel }, ${ label }`\n\t\t\t\t);\n\t\t\t}, 300 );\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tminimumValue = 0,\n\t\t\tmaximumValue = 10,\n\t\t\tdisabled,\n\t\t\tstep = 1,\n\t\t\tpreferredColorScheme,\n\t\t\tminimumTrackTintColor = preferredColorScheme === 'light'\n\t\t\t\t? '#00669b'\n\t\t\t\t: '#5198d9',\n\t\t\tmaximumTrackTintColor = isIOS ? '#e9eff3' : '#909090',\n\t\t\tthumbTintColor = ! isIOS && '#00669b',\n\t\t\tpreview,\n\t\t\tcellContainerStyle,\n\t\t\tshouldDisplayTextInput = true,\n\t\t\tunitLabel = '',\n\t\t\tsettingLabel = 'Value',\n\t\t\topenUnitPicker,\n\t\t\tchildren,\n\t\t\tdecimalNum,\n\t\t\t...cellProps\n\t\t} = this.props;\n\n\t\tconst { inputValue, sliderValue } = this.state;\n\n\t\tconst getAccessibilityHint = () => {\n\t\t\treturn openUnitPicker ? __( 'double-tap to change unit' ) : '';\n\t\t};\n\n\t\tconst getAccessibilityLabel = () => {\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: accessibility text. Inform about current value. %1$s: Control label %2$s: setting label (example: width), %3$s: Current value. %4$s: value measurement unit (example: pixels) */\n\t\t\t\t__( '%1$s. %2$s is %3$s %4$s.' ),\n\t\t\t\tcellProps.label,\n\t\t\t\tsettingLabel,\n\t\t\t\ttoFixed( value, decimalNum ),\n\t\t\t\tunitLabel\n\t\t\t);\n\t\t};\n\n\t\tconst containerStyle = [\n\t\t\tstyles.container,\n\t\t\tisIOS ? styles.containerIOS : styles.containerAndroid,\n\t\t];\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\taccessible\n\t\t\t\taccessibilityRole=\"adjustable\"\n\t\t\t\taccessibilityActions={ [\n\t\t\t\t\t{ name: 'increment' },\n\t\t\t\t\t{ name: 'decrement' },\n\t\t\t\t\t{ name: 'activate' },\n\t\t\t\t] }\n\t\t\t\tonAccessibilityAction={ ( event ) => {\n\t\t\t\t\tswitch ( event.nativeEvent.actionName ) {\n\t\t\t\t\t\tcase 'increment':\n\t\t\t\t\t\t\tthis.a11yIncrementValue();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'decrement':\n\t\t\t\t\t\t\tthis.a11yDecrementValue();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'activate':\n\t\t\t\t\t\t\tif ( openUnitPicker ) {\n\t\t\t\t\t\t\t\topenUnitPicker();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t\taccessibilityLabel={ getAccessibilityLabel() }\n\t\t\t\taccessibilityHint={ getAccessibilityHint() }\n\t\t\t>\n\t\t\t\t<View importantForAccessibility=\"no-hide-descendants\">\n\t\t\t\t\t<Cell\n\t\t\t\t\t\t{ ...cellProps }\n\t\t\t\t\t\tcellContainerStyle={ [\n\t\t\t\t\t\t\tstyles.cellContainerStyles,\n\t\t\t\t\t\t\tcellContainerStyle,\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tcellRowContainerStyle={ containerStyle }\n\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\teditable={ false }\n\t\t\t\t\t\tactiveOpacity={ 1 }\n\t\t\t\t\t\taccessible={ false }\n\t\t\t\t\t\tvalueStyle={ styles.valueStyle }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tshowLockIcon={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ containerStyle }>\n\t\t\t\t\t\t\t{ preview }\n\t\t\t\t\t\t\t<Slider\n\t\t\t\t\t\t\t\ttestID={ `Slider ${ cellProps.label }` }\n\t\t\t\t\t\t\t\tvalue={ sliderValue }\n\t\t\t\t\t\t\t\tdefaultValue={ defaultValue }\n\t\t\t\t\t\t\t\tdisabled={ disabled && ! isIOS }\n\t\t\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t\t\tminimumValue={ minimumValue }\n\t\t\t\t\t\t\t\tmaximumValue={ maximumValue }\n\t\t\t\t\t\t\t\tminimumTrackTintColor={ minimumTrackTintColor }\n\t\t\t\t\t\t\t\tmaximumTrackTintColor={ maximumTrackTintColor }\n\t\t\t\t\t\t\t\tthumbTintColor={ thumbTintColor }\n\t\t\t\t\t\t\t\tonValueChange={ this.onSliderChange }\n\t\t\t\t\t\t\t\tonSlidingComplete={\n\t\t\t\t\t\t\t\t\tthis.onCompleteSliderChange\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tref={ ( slider ) => {\n\t\t\t\t\t\t\t\t\tthis.sliderRef = slider;\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\tisIOS\n\t\t\t\t\t\t\t\t\t\t? styles.sliderIOS\n\t\t\t\t\t\t\t\t\t\t: styles.sliderAndroid\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ shouldDisplayTextInput && (\n\t\t\t\t\t\t\t\t<RangeTextInput\n\t\t\t\t\t\t\t\t\tlabel={ cellProps.label }\n\t\t\t\t\t\t\t\t\tonChange={ this.onTextInputChange }\n\t\t\t\t\t\t\t\t\tdefaultValue={ `${ inputValue }` }\n\t\t\t\t\t\t\t\t\tvalue={ inputValue }\n\t\t\t\t\t\t\t\t\tmin={ minimumValue }\n\t\t\t\t\t\t\t\t\tmax={ maximumValue }\n\t\t\t\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t\t\t\tdecimalNum={ decimalNum }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t\t</RangeTextInput>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ disabled && <LockIcon /> }\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</Cell>\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default withPreferredColorScheme( BottomSheetRangeCell );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,iBAAiB,EAAEC,I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IAAM;cACbd,YAAY,EAAGA,YAAc;cAC7Be,YAAY,EAAGA,YAAc;cAC7BW,qBAAqB,EAAGA,qBAAuB;cAC/CC,qBAAqB,EAAGA,qBAAuB;cAC/CC,cAAc,EAAGA,cAAgB;cACjCkC,aAAa,EAAG,IAAI,CAACvE,cAAgB;cACrCwE,iBAAiB,EAChB,IAAI,CAACtE,sBACL;cACDuE,GAAG,EAAKC,MAAM,IAAM;gBACnB,IAAI,CAACC,SAAS,GAAGD,MAAM;cACxB,CAAG;cACHL,KAAK,EACJ1E,KAAK,GACFP,MAAM,CAACwF,SAAS,GAChBxF,MAAM,CAACyF;YACV,CACD,CAAC,EACArC,sBAAsB,iBACvBhD,IAAA,CAACH,cAAc;cACduC,KAAK,EAAGgB,SAAS,CAAChB,KAAO;cACzBT,QAAQ,EAAG,IAAI,CAAChB,iBAAmB;cACnCK,YAAY,EAAG,GAAIK,UAAU,EAAK;cAClCN,KAAK,EAAGM,UAAY;cACpBiE,GAAG,EAAGrE,YAAc;cACpBsE,GAAG,EAAGvD,YAAc;cACpBD,IAAI,EAAGA,IAAM;cACbL,UAAU,EAAGA,UAAY;cAAAyB,QAAA,EAEvBA;YAAQ,CACK,CAChB,EACCV,QAAQ,iBAAIzC,IAAA,CAACL,QAAQ,IAAE,CAAC;UAAA,CACrB;QAAC,CACF;MAAC,CACF;IAAC,CACF,CAAC;EAET;AACD;AAEA,eAAeF,wBAAwB,CAAEY,oBAAqB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Platform","AccessibilityInfo","View","Slider","__","sprintf","Component","withPreferredColorScheme","Cell","LockIcon","styles","RangeTextInput","toFixed","jsx","_jsx","jsxs","_jsxs","isIOS","OS","BottomSheetRangeCell","constructor","props","onSliderChange","bind","onCompleteSliderChange","onTextInputChange","a11yIncrementValue","a11yDecrementValue","a11yUpdateValue","value","defaultValue","minimumValue","initialValue","Number","state","inputValue","sliderValue","componentWillUnmount","clearTimeout","timeoutAnnounceValue","decimalNum","onChange","setState","nextValue","onComplete","step","maximumValue","newValue","undefined","announceValue","label","unitLabel","setTimeout","announceForAccessibility","render","disabled","preferredColorScheme","minimumTrackTintColor","maximumTrackTintColor","thumbTintColor","preview","cellContainerStyle","shouldDisplayTextInput","settingLabel","openUnitPicker","children","cellProps","getAccessibilityHint","getAccessibilityLabel","containerStyle","container","containerIOS","containerAndroid","accessible","accessibilityRole","accessibilityActions","name","onAccessibilityAction","event","nativeEvent","actionName","accessibilityLabel","accessibilityHint","importantForAccessibility","cellContainerStyles","cellRowContainerStyle","leftAlign","editable","activeOpacity","valueStyle","showLockIcon","style","testID","onValueChange","onSlidingComplete","ref","slider","sliderRef","sliderIOS","sliderAndroid","min","max"],"sources":["@wordpress/components/src/mobile/bottom-sheet/range-cell.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, AccessibilityInfo, View } from 'react-native';\nimport Slider from '@react-native-community/slider';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Cell from './cell';\nimport LockIcon from './lock-icon';\nimport styles from './range-cell.scss';\nimport RangeTextInput from './range-text-input';\nimport { toFixed } from '../utils';\n\nconst isIOS = Platform.OS === 'ios';\n\nclass BottomSheetRangeCell extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.onSliderChange = this.onSliderChange.bind( this );\n\t\tthis.onCompleteSliderChange = this.onCompleteSliderChange.bind( this );\n\t\tthis.onTextInputChange = this.onTextInputChange.bind( this );\n\t\tthis.a11yIncrementValue = this.a11yIncrementValue.bind( this );\n\t\tthis.a11yDecrementValue = this.a11yDecrementValue.bind( this );\n\t\tthis.a11yUpdateValue = this.a11yUpdateValue.bind( this );\n\n\t\tconst { value, defaultValue, minimumValue } = props;\n\t\tconst initialValue = Number( value || defaultValue || minimumValue );\n\n\t\tthis.state = {\n\t\t\tinputValue: initialValue,\n\t\t\tsliderValue: initialValue,\n\t\t};\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timeoutAnnounceValue );\n\t}\n\n\tonSliderChange( initialValue ) {\n\t\tconst { decimalNum, onChange } = this.props;\n\t\tinitialValue = toFixed( initialValue, decimalNum );\n\t\tthis.setState( { inputValue: initialValue } );\n\t\tonChange( initialValue );\n\t}\n\n\tonTextInputChange( nextValue ) {\n\t\tconst { onChange, onComplete } = this.props;\n\t\tthis.setState( {\n\t\t\tsliderValue: nextValue,\n\t\t} );\n\t\tonChange( nextValue );\n\t\tif ( onComplete ) {\n\t\t\tonComplete( nextValue );\n\t\t}\n\t}\n\n\tonCompleteSliderChange( nextValue ) {\n\t\tconst { decimalNum, onComplete } = this.props;\n\t\tnextValue = toFixed( nextValue, decimalNum );\n\t\tif ( onComplete ) {\n\t\t\tonComplete( nextValue );\n\t\t}\n\t}\n\n\t/*\n\t * Only used with screenreaders like VoiceOver and TalkBack. Increments the\n\t * value of this setting programmatically.\n\t */\n\ta11yIncrementValue() {\n\t\tconst { step = 5, maximumValue, decimalNum } = this.props;\n\t\tconst { inputValue } = this.state;\n\n\t\tconst newValue = toFixed( inputValue + step, decimalNum );\n\n\t\tif ( newValue <= maximumValue || maximumValue === undefined ) {\n\t\t\tthis.a11yUpdateValue( newValue );\n\t\t}\n\t}\n\n\t/*\n\t * Only used with screenreaders like VoiceOver and TalkBack. Decrements the\n\t * value of this setting programmatically.\n\t */\n\ta11yDecrementValue() {\n\t\tconst { step = 5, minimumValue, decimalNum } = this.props;\n\t\tconst { sliderValue } = this.state;\n\n\t\tconst newValue = toFixed( sliderValue - step, decimalNum );\n\n\t\tif ( newValue >= minimumValue ) {\n\t\t\tthis.a11yUpdateValue( newValue );\n\t\t}\n\t}\n\n\ta11yUpdateValue( newValue ) {\n\t\tconst { onChange, onComplete } = this.props;\n\t\tthis.setState( {\n\t\t\tsliderValue: newValue,\n\t\t\tinputValue: newValue,\n\t\t} );\n\t\tonChange( newValue );\n\t\tif ( onComplete ) {\n\t\t\tonComplete( newValue );\n\t\t}\n\t\tthis.announceValue( newValue );\n\t}\n\n\t/*\n\t * Only used with screenreaders like VoiceOver and TalkBack.\n\t */\n\tannounceValue( value ) {\n\t\tconst { label, unitLabel = '' } = this.props;\n\n\t\tif ( isIOS ) {\n\t\t\t// On Android it triggers the accessibilityLabel with the value change, but\n\t\t\t// on iOS we need to do this manually.\n\t\t\tclearTimeout( this.timeoutAnnounceValue );\n\t\t\tthis.timeoutAnnounceValue = setTimeout( () => {\n\t\t\t\tAccessibilityInfo.announceForAccessibility(\n\t\t\t\t\t`${ value } ${ unitLabel }, ${ label }`\n\t\t\t\t);\n\t\t\t}, 300 );\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tminimumValue = 0,\n\t\t\tmaximumValue = 10,\n\t\t\tdisabled,\n\t\t\tstep = 1,\n\t\t\tpreferredColorScheme,\n\t\t\tminimumTrackTintColor = preferredColorScheme === 'light'\n\t\t\t\t? '#00669b'\n\t\t\t\t: '#5198d9',\n\t\t\tmaximumTrackTintColor = isIOS ? '#e9eff3' : '#909090',\n\t\t\tthumbTintColor = ! isIOS && '#00669b',\n\t\t\tpreview,\n\t\t\tcellContainerStyle,\n\t\t\tshouldDisplayTextInput = true,\n\t\t\tunitLabel = '',\n\t\t\tsettingLabel = 'Value',\n\t\t\topenUnitPicker,\n\t\t\tchildren,\n\t\t\tdecimalNum,\n\t\t\t...cellProps\n\t\t} = this.props;\n\n\t\tconst { inputValue, sliderValue } = this.state;\n\n\t\tconst getAccessibilityHint = () => {\n\t\t\treturn openUnitPicker ? __( 'double-tap to change unit' ) : '';\n\t\t};\n\n\t\tconst getAccessibilityLabel = () => {\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: accessibility text. Inform about current value. 1: Control label. 2: setting label (example: width). 3: Current value. 4: value measurement unit (example: pixels) */\n\t\t\t\t__( '%1$s. %2$s is %3$s %4$s.' ),\n\t\t\t\tcellProps.label,\n\t\t\t\tsettingLabel,\n\t\t\t\ttoFixed( value, decimalNum ),\n\t\t\t\tunitLabel\n\t\t\t);\n\t\t};\n\n\t\tconst containerStyle = [\n\t\t\tstyles.container,\n\t\t\tisIOS ? styles.containerIOS : styles.containerAndroid,\n\t\t];\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\taccessible\n\t\t\t\taccessibilityRole=\"adjustable\"\n\t\t\t\taccessibilityActions={ [\n\t\t\t\t\t{ name: 'increment' },\n\t\t\t\t\t{ name: 'decrement' },\n\t\t\t\t\t{ name: 'activate' },\n\t\t\t\t] }\n\t\t\t\tonAccessibilityAction={ ( event ) => {\n\t\t\t\t\tswitch ( event.nativeEvent.actionName ) {\n\t\t\t\t\t\tcase 'increment':\n\t\t\t\t\t\t\tthis.a11yIncrementValue();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'decrement':\n\t\t\t\t\t\t\tthis.a11yDecrementValue();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'activate':\n\t\t\t\t\t\t\tif ( openUnitPicker ) {\n\t\t\t\t\t\t\t\topenUnitPicker();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t\taccessibilityLabel={ getAccessibilityLabel() }\n\t\t\t\taccessibilityHint={ getAccessibilityHint() }\n\t\t\t>\n\t\t\t\t<View importantForAccessibility=\"no-hide-descendants\">\n\t\t\t\t\t<Cell\n\t\t\t\t\t\t{ ...cellProps }\n\t\t\t\t\t\tcellContainerStyle={ [\n\t\t\t\t\t\t\tstyles.cellContainerStyles,\n\t\t\t\t\t\t\tcellContainerStyle,\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tcellRowContainerStyle={ containerStyle }\n\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\teditable={ false }\n\t\t\t\t\t\tactiveOpacity={ 1 }\n\t\t\t\t\t\taccessible={ false }\n\t\t\t\t\t\tvalueStyle={ styles.valueStyle }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tshowLockIcon={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ containerStyle }>\n\t\t\t\t\t\t\t{ preview }\n\t\t\t\t\t\t\t<Slider\n\t\t\t\t\t\t\t\ttestID={ `Slider ${ cellProps.label }` }\n\t\t\t\t\t\t\t\tvalue={ sliderValue }\n\t\t\t\t\t\t\t\tdefaultValue={ defaultValue }\n\t\t\t\t\t\t\t\tdisabled={ disabled && ! isIOS }\n\t\t\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t\t\tminimumValue={ minimumValue }\n\t\t\t\t\t\t\t\tmaximumValue={ maximumValue }\n\t\t\t\t\t\t\t\tminimumTrackTintColor={ minimumTrackTintColor }\n\t\t\t\t\t\t\t\tmaximumTrackTintColor={ maximumTrackTintColor }\n\t\t\t\t\t\t\t\tthumbTintColor={ thumbTintColor }\n\t\t\t\t\t\t\t\tonValueChange={ this.onSliderChange }\n\t\t\t\t\t\t\t\tonSlidingComplete={\n\t\t\t\t\t\t\t\t\tthis.onCompleteSliderChange\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tref={ ( slider ) => {\n\t\t\t\t\t\t\t\t\tthis.sliderRef = slider;\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\tisIOS\n\t\t\t\t\t\t\t\t\t\t? styles.sliderIOS\n\t\t\t\t\t\t\t\t\t\t: styles.sliderAndroid\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ shouldDisplayTextInput && (\n\t\t\t\t\t\t\t\t<RangeTextInput\n\t\t\t\t\t\t\t\t\tlabel={ cellProps.label }\n\t\t\t\t\t\t\t\t\tonChange={ this.onTextInputChange }\n\t\t\t\t\t\t\t\t\tdefaultValue={ `${ inputValue }` }\n\t\t\t\t\t\t\t\t\tvalue={ inputValue }\n\t\t\t\t\t\t\t\t\tmin={ minimumValue }\n\t\t\t\t\t\t\t\t\tmax={ maximumValue }\n\t\t\t\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t\t\t\tdecimalNum={ decimalNum }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t\t</RangeTextInput>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ disabled && <LockIcon /> }\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</Cell>\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default withPreferredColorScheme( BottomSheetRangeCell );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,iBAAiB,EAAEC,IAAI,QAAQ,cAAc;AAChE,OAAOC,MAAM,MAAM,gCAAgC;;AAEnD;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,OAAOC,IAAI,MAAM,QAAQ;AACzB,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,MAAM,MAAM,mBAAmB;AACtC,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,SAASC,OAAO,QAAQ,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnC,MAAMC,KAAK,GAAGjB,QAAQ,CAACkB,EAAE,KAAK,KAAK;AAEnC,MAAMC,oBAAoB,SAASb,SAAS,CAAC;EAC5Cc,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAEA,KAAM,CAAC;IACd,IAAI,CAACC,cAAc,GAAG,IAAI,CAACA,cAAc,CAACC,IAAI,CAAE,IAAK,CAAC;IACtD,IAAI,CAACC,sBAAsB,GAAG,IAAI,CAACA,sBAAsB,CAACD,IAA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ACK,CAChB,EACCV,QAAQ,iBAAIzC,IAAA,CAACL,QAAQ,IAAE,CAAC;UAAA,CACrB;QAAC,CACF;MAAC,CACF;IAAC,CACF,CAAC;EAET;AACD;AAEA,eAAeF,wBAAwB,CAAEY,oBAAqB,CAAC","ignoreList":[]}
|
|
@@ -151,7 +151,7 @@ class BottomSheetStepperCell extends Component {
|
|
|
151
151
|
const getAccessibilityHint = () => {
|
|
152
152
|
return openUnitPicker ? __('double-tap to change unit') : '';
|
|
153
153
|
};
|
|
154
|
-
const accessibilityLabel = sprintf(/* translators: accessibility text. Inform about current value.
|
|
154
|
+
const accessibilityLabel = sprintf(/* translators: accessibility text. Inform about current value. 1: Control label. 2: setting label (example: width). 3: Current value. 4: value measurement unit (example: pixels) */
|
|
155
155
|
__('%1$s. %2$s is %3$s %4$s.'), label, settingLabel, value, unitLabel);
|
|
156
156
|
const containerStyle = [styles.rowContainer, isIOS ? styles.containerIOS : styles.containerAndroid];
|
|
157
157
|
return /*#__PURE__*/_jsx(View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AccessibilityInfo","View","Platform","__","sprintf","Component","withPreferredColorScheme","Cell","Stepper","styles","RangeTextInput","toFixed","jsx","_jsx","jsxs","_jsxs","STEP_DELAY","DEFAULT_STEP","isIOS","OS","BottomSheetStepperCell","constructor","props","announceValue","bind","onDecrementValue","onDecrementValuePressIn","onIncrementValue","onIncrementValuePressIn","onPressOut","value","defaultValue","min","initialValue","state","inputValue","stepperValue","componentWillUnmount","clearTimeout","timeout","clearInterval","interval","timeoutAnnounceValue","step","max","onChange","decimalNum","newValue","parseInt","undefined","setState","setTimeout","startPressInterval","callback","speed","counter","setInterval","label","unitLabel","announceForAccessibility","render","settingLabel","icon","separatorType","children","shouldDisplayTextInput","preview","openUnitPicker","cellContainerStyle","disabled","isMinValue","isMaxValue","labelStyle","cellLabel","cellLabelNoIcon","getAccessibilityHint","accessibilityLabel","containerStyle","rowContainer","containerIOS","containerAndroid","accessible","accessibilityRole","accessibilityHint","accessibilityActions","name","onAccessibilityAction","event","nativeEvent","actionName","importantForAccessibility","columnContainer","cellRowContainerStyle","cellRowStyles","editable","leftAlign","style","onPressInDecrement","onPressInIncrement","defaultProps"],"sources":["@wordpress/components/src/mobile/bottom-sheet/stepper-cell/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { AccessibilityInfo, View, Platform } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Cell from '../cell';\nimport Stepper from './stepper';\nimport styles from './style.scss';\nimport RangeTextInput from '../range-text-input';\nimport { toFixed } from '../../utils';\n\nconst STEP_DELAY = 200;\nconst DEFAULT_STEP = 1;\n\nconst isIOS = Platform.OS === 'ios';\n\nclass BottomSheetStepperCell extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.announceValue = this.announceValue.bind( this );\n\t\tthis.onDecrementValue = this.onDecrementValue.bind( this );\n\t\tthis.onDecrementValuePressIn =\n\t\t\tthis.onDecrementValuePressIn.bind( this );\n\t\tthis.onIncrementValue = this.onIncrementValue.bind( this );\n\t\tthis.onIncrementValuePressIn =\n\t\t\tthis.onIncrementValuePressIn.bind( this );\n\t\tthis.onPressOut = this.onPressOut.bind( this );\n\n\t\tconst { value, defaultValue, min } = props;\n\n\t\tconst initialValue = value || defaultValue || min;\n\n\t\tthis.state = {\n\t\t\tinputValue: initialValue,\n\t\t\tstepperValue: initialValue,\n\t\t};\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timeout );\n\t\tclearInterval( this.interval );\n\t\tclearTimeout( this.timeoutAnnounceValue );\n\t}\n\n\tonIncrementValue() {\n\t\tconst { step, max, onChange, value, decimalNum } = this.props;\n\t\tlet newValue = toFixed( value + step, decimalNum );\n\t\tnewValue =\n\t\t\tparseInt( newValue ) === newValue ? parseInt( newValue ) : newValue;\n\t\tif ( newValue <= max || max === undefined ) {\n\t\t\tonChange( newValue );\n\t\t\tthis.setState( {\n\t\t\t\tinputValue: newValue,\n\t\t\t} );\n\t\t\tthis.announceValue( newValue );\n\t\t}\n\t}\n\n\tonDecrementValue() {\n\t\tconst { step, min, onChange, value, decimalNum } = this.props;\n\t\tlet newValue = toFixed( value - step, decimalNum );\n\t\tnewValue =\n\t\t\tparseInt( newValue ) === newValue ? parseInt( newValue ) : newValue;\n\t\tif ( newValue >= min ) {\n\t\t\tonChange( newValue );\n\t\t\tthis.setState( {\n\t\t\t\tinputValue: newValue,\n\t\t\t} );\n\t\t\tthis.announceValue( newValue );\n\t\t}\n\t}\n\n\tonIncrementValuePressIn() {\n\t\tthis.onIncrementValue();\n\t\tthis.timeout = setTimeout( () => {\n\t\t\tthis.startPressInterval( this.onIncrementValue );\n\t\t}, 500 );\n\t}\n\n\tonDecrementValuePressIn() {\n\t\tthis.onDecrementValue();\n\t\tthis.timeout = setTimeout( () => {\n\t\t\tthis.startPressInterval( this.onDecrementValue );\n\t\t}, 500 );\n\t}\n\n\tonPressOut() {\n\t\tclearTimeout( this.timeout );\n\t\tclearInterval( this.interval );\n\t}\n\n\tstartPressInterval( callback, speed = STEP_DELAY ) {\n\t\tlet counter = 0;\n\t\tthis.interval = setInterval( () => {\n\t\t\tcallback();\n\t\t\tcounter += 1;\n\n\t\t\tif ( counter === 10 ) {\n\t\t\t\tclearInterval( this.interval );\n\t\t\t\tthis.startPressInterval( callback, speed / 2 );\n\t\t\t}\n\t\t}, speed );\n\t}\n\n\tannounceValue( value ) {\n\t\tconst { label, unitLabel = '' } = this.props;\n\n\t\tif ( isIOS ) {\n\t\t\t// On Android it triggers the accessibilityLabel with the value change\n\t\t\tclearTimeout( this.timeoutAnnounceValue );\n\t\t\tthis.timeoutAnnounceValue = setTimeout( () => {\n\t\t\t\tAccessibilityInfo.announceForAccessibility(\n\t\t\t\t\t`${ value } ${ unitLabel } ${ label }`\n\t\t\t\t);\n\t\t\t}, 300 );\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tlabel,\n\t\t\tsettingLabel = 'Value',\n\t\t\tunitLabel = '',\n\t\t\ticon,\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tvalue,\n\t\t\tseparatorType,\n\t\t\tchildren,\n\t\t\tshouldDisplayTextInput = false,\n\t\t\tpreview,\n\t\t\tonChange,\n\t\t\topenUnitPicker,\n\t\t\tdecimalNum,\n\t\t\tcellContainerStyle,\n\t\t\tdisabled,\n\t\t} = this.props;\n\t\tconst { inputValue } = this.state;\n\t\tconst isMinValue = value === min;\n\t\tconst isMaxValue = value === max;\n\t\tconst labelStyle = [\n\t\t\tstyles.cellLabel,\n\t\t\t! icon ? styles.cellLabelNoIcon : {},\n\t\t];\n\n\t\tconst getAccessibilityHint = () => {\n\t\t\treturn openUnitPicker ? __( 'double-tap to change unit' ) : '';\n\t\t};\n\n\t\tconst accessibilityLabel = sprintf(\n\t\t\t/* translators: accessibility text. Inform about current value. %1$s: Control label %2$s: setting label (example: width), %3$s: Current value. %4$s: value measurement unit (example: pixels) */\n\t\t\t__( '%1$s. %2$s is %3$s %4$s.' ),\n\t\t\tlabel,\n\t\t\tsettingLabel,\n\t\t\tvalue,\n\t\t\tunitLabel\n\t\t);\n\n\t\tconst containerStyle = [\n\t\t\tstyles.rowContainer,\n\t\t\tisIOS ? styles.containerIOS : styles.containerAndroid,\n\t\t];\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\taccessible\n\t\t\t\taccessibilityRole=\"adjustable\"\n\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t\taccessibilityHint={ getAccessibilityHint() }\n\t\t\t\taccessibilityActions={ [\n\t\t\t\t\t{ name: 'increment' },\n\t\t\t\t\t{ name: 'decrement' },\n\t\t\t\t\t{ name: 'activate' },\n\t\t\t\t] }\n\t\t\t\tonAccessibilityAction={ ( event ) => {\n\t\t\t\t\tswitch ( event.nativeEvent.actionName ) {\n\t\t\t\t\t\tcase 'increment':\n\t\t\t\t\t\t\tthis.onIncrementValue();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'decrement':\n\t\t\t\t\t\t\tthis.onDecrementValue();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'activate':\n\t\t\t\t\t\t\tif ( openUnitPicker ) {\n\t\t\t\t\t\t\t\topenUnitPicker();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<View importantForAccessibility=\"no-hide-descendants\">\n\t\t\t\t\t<Cell\n\t\t\t\t\t\taccessible={ false }\n\t\t\t\t\t\tcellContainerStyle={ [\n\t\t\t\t\t\t\tstyles.cellContainerStyle,\n\t\t\t\t\t\t\tpreview && styles.columnContainer,\n\t\t\t\t\t\t\tcellContainerStyle,\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tcellRowContainerStyle={\n\t\t\t\t\t\t\tpreview ? containerStyle : styles.cellRowStyles\n\t\t\t\t\t\t}\n\t\t\t\t\t\teditable={ false }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tlabelStyle={ labelStyle }\n\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\tseparatorType={ separatorType }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ preview && containerStyle }>\n\t\t\t\t\t\t\t{ preview }\n\t\t\t\t\t\t\t<Stepper\n\t\t\t\t\t\t\t\tisMaxValue={ isMaxValue }\n\t\t\t\t\t\t\t\tisMinValue={ isMinValue }\n\t\t\t\t\t\t\t\tonPressInDecrement={\n\t\t\t\t\t\t\t\t\tthis.onDecrementValuePressIn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonPressInIncrement={\n\t\t\t\t\t\t\t\t\tthis.onIncrementValuePressIn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonPressOut={ this.onPressOut }\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tshouldDisplayTextInput={\n\t\t\t\t\t\t\t\t\tshouldDisplayTextInput\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ shouldDisplayTextInput && (\n\t\t\t\t\t\t\t\t\t<RangeTextInput\n\t\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\t\t\tdefaultValue={ `${ inputValue }` }\n\t\t\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\t\t\t\tdecimalNum={ decimalNum }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t\t\t</RangeTextInput>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</Stepper>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</Cell>\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nBottomSheetStepperCell.defaultProps = {\n\tstep: DEFAULT_STEP,\n};\n\nexport default withPreferredColorScheme( BottomSheetStepperCell );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;;AAEhE;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,cAAc,MAAM,qBAAqB;AAChD,SAASC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d,YAAY,EAAG,GAAII,UAAU,EAAK;gBAClCL,KAAK,EAAGA,KAAO;gBACfE,GAAG,EAAGA,GAAK;gBACXW,IAAI,EAAG,CAAG;gBACVG,UAAU,EAAGA,UAAY;gBAAAkB,QAAA,EAEvBA;cAAQ,CACK;YAChB,CACO,CAAC;UAAA,CACL;QAAC,CACF;MAAC,CACF;IAAC,CACF,CAAC;EAET;AACD;AAEA5C,sBAAsB,CAAC+E,YAAY,GAAG;EACrCxD,IAAI,EAAE1B;AACP,CAAC;AAED,eAAeX,wBAAwB,CAAEc,sBAAuB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["AccessibilityInfo","View","Platform","__","sprintf","Component","withPreferredColorScheme","Cell","Stepper","styles","RangeTextInput","toFixed","jsx","_jsx","jsxs","_jsxs","STEP_DELAY","DEFAULT_STEP","isIOS","OS","BottomSheetStepperCell","constructor","props","announceValue","bind","onDecrementValue","onDecrementValuePressIn","onIncrementValue","onIncrementValuePressIn","onPressOut","value","defaultValue","min","initialValue","state","inputValue","stepperValue","componentWillUnmount","clearTimeout","timeout","clearInterval","interval","timeoutAnnounceValue","step","max","onChange","decimalNum","newValue","parseInt","undefined","setState","setTimeout","startPressInterval","callback","speed","counter","setInterval","label","unitLabel","announceForAccessibility","render","settingLabel","icon","separatorType","children","shouldDisplayTextInput","preview","openUnitPicker","cellContainerStyle","disabled","isMinValue","isMaxValue","labelStyle","cellLabel","cellLabelNoIcon","getAccessibilityHint","accessibilityLabel","containerStyle","rowContainer","containerIOS","containerAndroid","accessible","accessibilityRole","accessibilityHint","accessibilityActions","name","onAccessibilityAction","event","nativeEvent","actionName","importantForAccessibility","columnContainer","cellRowContainerStyle","cellRowStyles","editable","leftAlign","style","onPressInDecrement","onPressInIncrement","defaultProps"],"sources":["@wordpress/components/src/mobile/bottom-sheet/stepper-cell/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { AccessibilityInfo, View, Platform } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Cell from '../cell';\nimport Stepper from './stepper';\nimport styles from './style.scss';\nimport RangeTextInput from '../range-text-input';\nimport { toFixed } from '../../utils';\n\nconst STEP_DELAY = 200;\nconst DEFAULT_STEP = 1;\n\nconst isIOS = Platform.OS === 'ios';\n\nclass BottomSheetStepperCell extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.announceValue = this.announceValue.bind( this );\n\t\tthis.onDecrementValue = this.onDecrementValue.bind( this );\n\t\tthis.onDecrementValuePressIn =\n\t\t\tthis.onDecrementValuePressIn.bind( this );\n\t\tthis.onIncrementValue = this.onIncrementValue.bind( this );\n\t\tthis.onIncrementValuePressIn =\n\t\t\tthis.onIncrementValuePressIn.bind( this );\n\t\tthis.onPressOut = this.onPressOut.bind( this );\n\n\t\tconst { value, defaultValue, min } = props;\n\n\t\tconst initialValue = value || defaultValue || min;\n\n\t\tthis.state = {\n\t\t\tinputValue: initialValue,\n\t\t\tstepperValue: initialValue,\n\t\t};\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timeout );\n\t\tclearInterval( this.interval );\n\t\tclearTimeout( this.timeoutAnnounceValue );\n\t}\n\n\tonIncrementValue() {\n\t\tconst { step, max, onChange, value, decimalNum } = this.props;\n\t\tlet newValue = toFixed( value + step, decimalNum );\n\t\tnewValue =\n\t\t\tparseInt( newValue ) === newValue ? parseInt( newValue ) : newValue;\n\t\tif ( newValue <= max || max === undefined ) {\n\t\t\tonChange( newValue );\n\t\t\tthis.setState( {\n\t\t\t\tinputValue: newValue,\n\t\t\t} );\n\t\t\tthis.announceValue( newValue );\n\t\t}\n\t}\n\n\tonDecrementValue() {\n\t\tconst { step, min, onChange, value, decimalNum } = this.props;\n\t\tlet newValue = toFixed( value - step, decimalNum );\n\t\tnewValue =\n\t\t\tparseInt( newValue ) === newValue ? parseInt( newValue ) : newValue;\n\t\tif ( newValue >= min ) {\n\t\t\tonChange( newValue );\n\t\t\tthis.setState( {\n\t\t\t\tinputValue: newValue,\n\t\t\t} );\n\t\t\tthis.announceValue( newValue );\n\t\t}\n\t}\n\n\tonIncrementValuePressIn() {\n\t\tthis.onIncrementValue();\n\t\tthis.timeout = setTimeout( () => {\n\t\t\tthis.startPressInterval( this.onIncrementValue );\n\t\t}, 500 );\n\t}\n\n\tonDecrementValuePressIn() {\n\t\tthis.onDecrementValue();\n\t\tthis.timeout = setTimeout( () => {\n\t\t\tthis.startPressInterval( this.onDecrementValue );\n\t\t}, 500 );\n\t}\n\n\tonPressOut() {\n\t\tclearTimeout( this.timeout );\n\t\tclearInterval( this.interval );\n\t}\n\n\tstartPressInterval( callback, speed = STEP_DELAY ) {\n\t\tlet counter = 0;\n\t\tthis.interval = setInterval( () => {\n\t\t\tcallback();\n\t\t\tcounter += 1;\n\n\t\t\tif ( counter === 10 ) {\n\t\t\t\tclearInterval( this.interval );\n\t\t\t\tthis.startPressInterval( callback, speed / 2 );\n\t\t\t}\n\t\t}, speed );\n\t}\n\n\tannounceValue( value ) {\n\t\tconst { label, unitLabel = '' } = this.props;\n\n\t\tif ( isIOS ) {\n\t\t\t// On Android it triggers the accessibilityLabel with the value change\n\t\t\tclearTimeout( this.timeoutAnnounceValue );\n\t\t\tthis.timeoutAnnounceValue = setTimeout( () => {\n\t\t\t\tAccessibilityInfo.announceForAccessibility(\n\t\t\t\t\t`${ value } ${ unitLabel } ${ label }`\n\t\t\t\t);\n\t\t\t}, 300 );\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tlabel,\n\t\t\tsettingLabel = 'Value',\n\t\t\tunitLabel = '',\n\t\t\ticon,\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tvalue,\n\t\t\tseparatorType,\n\t\t\tchildren,\n\t\t\tshouldDisplayTextInput = false,\n\t\t\tpreview,\n\t\t\tonChange,\n\t\t\topenUnitPicker,\n\t\t\tdecimalNum,\n\t\t\tcellContainerStyle,\n\t\t\tdisabled,\n\t\t} = this.props;\n\t\tconst { inputValue } = this.state;\n\t\tconst isMinValue = value === min;\n\t\tconst isMaxValue = value === max;\n\t\tconst labelStyle = [\n\t\t\tstyles.cellLabel,\n\t\t\t! icon ? styles.cellLabelNoIcon : {},\n\t\t];\n\n\t\tconst getAccessibilityHint = () => {\n\t\t\treturn openUnitPicker ? __( 'double-tap to change unit' ) : '';\n\t\t};\n\n\t\tconst accessibilityLabel = sprintf(\n\t\t\t/* translators: accessibility text. Inform about current value. 1: Control label. 2: setting label (example: width). 3: Current value. 4: value measurement unit (example: pixels) */\n\t\t\t__( '%1$s. %2$s is %3$s %4$s.' ),\n\t\t\tlabel,\n\t\t\tsettingLabel,\n\t\t\tvalue,\n\t\t\tunitLabel\n\t\t);\n\n\t\tconst containerStyle = [\n\t\t\tstyles.rowContainer,\n\t\t\tisIOS ? styles.containerIOS : styles.containerAndroid,\n\t\t];\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\taccessible\n\t\t\t\taccessibilityRole=\"adjustable\"\n\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t\taccessibilityHint={ getAccessibilityHint() }\n\t\t\t\taccessibilityActions={ [\n\t\t\t\t\t{ name: 'increment' },\n\t\t\t\t\t{ name: 'decrement' },\n\t\t\t\t\t{ name: 'activate' },\n\t\t\t\t] }\n\t\t\t\tonAccessibilityAction={ ( event ) => {\n\t\t\t\t\tswitch ( event.nativeEvent.actionName ) {\n\t\t\t\t\t\tcase 'increment':\n\t\t\t\t\t\t\tthis.onIncrementValue();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'decrement':\n\t\t\t\t\t\t\tthis.onDecrementValue();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'activate':\n\t\t\t\t\t\t\tif ( openUnitPicker ) {\n\t\t\t\t\t\t\t\topenUnitPicker();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<View importantForAccessibility=\"no-hide-descendants\">\n\t\t\t\t\t<Cell\n\t\t\t\t\t\taccessible={ false }\n\t\t\t\t\t\tcellContainerStyle={ [\n\t\t\t\t\t\t\tstyles.cellContainerStyle,\n\t\t\t\t\t\t\tpreview && styles.columnContainer,\n\t\t\t\t\t\t\tcellContainerStyle,\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tcellRowContainerStyle={\n\t\t\t\t\t\t\tpreview ? containerStyle : styles.cellRowStyles\n\t\t\t\t\t\t}\n\t\t\t\t\t\teditable={ false }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tlabelStyle={ labelStyle }\n\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\tseparatorType={ separatorType }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ preview && containerStyle }>\n\t\t\t\t\t\t\t{ preview }\n\t\t\t\t\t\t\t<Stepper\n\t\t\t\t\t\t\t\tisMaxValue={ isMaxValue }\n\t\t\t\t\t\t\t\tisMinValue={ isMinValue }\n\t\t\t\t\t\t\t\tonPressInDecrement={\n\t\t\t\t\t\t\t\t\tthis.onDecrementValuePressIn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonPressInIncrement={\n\t\t\t\t\t\t\t\t\tthis.onIncrementValuePressIn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonPressOut={ this.onPressOut }\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tshouldDisplayTextInput={\n\t\t\t\t\t\t\t\t\tshouldDisplayTextInput\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ shouldDisplayTextInput && (\n\t\t\t\t\t\t\t\t\t<RangeTextInput\n\t\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\t\t\tdefaultValue={ `${ inputValue }` }\n\t\t\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\t\t\t\tdecimalNum={ decimalNum }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t\t\t</RangeTextInput>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</Stepper>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</Cell>\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nBottomSheetStepperCell.defaultProps = {\n\tstep: DEFAULT_STEP,\n};\n\nexport default withPreferredColorScheme( BottomSheetStepperCell );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;;AAEhE;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,cAAc,MAAM,qBAAqB;AAChD,SAASC,OAAO,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEtC,MAAMC,UAAU,GAAG,GAAG;AACtB,MAAMC,YAAY,GAAG,CAAC;AAEtB,MAAMC,KAAK,GAAGhB,QAAQ,CAACiB,EAAE,KAAK,KAAK;AAEnC,MAAMC,sBAAsB,SAASf,SAAS,CAAC;EAC9CgB,WAAWA,CAAEC,KAAK,EAAG;IACp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G;EACrCxD,IAAI,EAAE1B;AACP,CAAC;AAED,eAAeX,wBAAwB,CAAEc,sBAAuB,CAAC","ignoreList":[]}
|
|
@@ -31,9 +31,7 @@ const BottomSheetSubSheet = ({
|
|
|
31
31
|
if (showSheet) {
|
|
32
32
|
setIsFullScreen(isFullScreen);
|
|
33
33
|
}
|
|
34
|
-
//
|
|
35
|
-
// see https://github.com/WordPress/gutenberg/pull/41166
|
|
36
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34
|
+
// See https://github.com/WordPress/gutenberg/pull/41166
|
|
37
35
|
}, [showSheet, isFullScreen]);
|
|
38
36
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
39
37
|
children: [showSheet && /*#__PURE__*/_jsx(Fill, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SafeAreaView","Children","useEffect","useContext","BottomSheetContext","createSlotFill","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Fill","Slot","BottomSheetSubSheet","children","navigationButton","showSheet","isFullScreen","setIsFullScreen","count","screenName"],"sources":["@wordpress/components/src/mobile/bottom-sheet/sub-sheet/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { SafeAreaView } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Children, useEffect, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { BottomSheetContext } from '../bottom-sheet-context';\nimport { createSlotFill } from '../../../slot-fill';\n\nconst { Fill, Slot } = createSlotFill( 'BottomSheetSubSheet' );\n\nconst BottomSheetSubSheet = ( {\n\tchildren,\n\tnavigationButton,\n\tshowSheet,\n\tisFullScreen,\n} ) => {\n\tconst { setIsFullScreen } = useContext( BottomSheetContext );\n\n\tuseEffect( () => {\n\t\tif ( showSheet ) {\n\t\t\tsetIsFullScreen( isFullScreen );\n\t\t}\n\t\t//
|
|
1
|
+
{"version":3,"names":["SafeAreaView","Children","useEffect","useContext","BottomSheetContext","createSlotFill","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Fill","Slot","BottomSheetSubSheet","children","navigationButton","showSheet","isFullScreen","setIsFullScreen","count","screenName"],"sources":["@wordpress/components/src/mobile/bottom-sheet/sub-sheet/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { SafeAreaView } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Children, useEffect, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { BottomSheetContext } from '../bottom-sheet-context';\nimport { createSlotFill } from '../../../slot-fill';\n\nconst { Fill, Slot } = createSlotFill( 'BottomSheetSubSheet' );\n\nconst BottomSheetSubSheet = ( {\n\tchildren,\n\tnavigationButton,\n\tshowSheet,\n\tisFullScreen,\n} ) => {\n\tconst { setIsFullScreen } = useContext( BottomSheetContext );\n\n\tuseEffect( () => {\n\t\tif ( showSheet ) {\n\t\t\tsetIsFullScreen( isFullScreen );\n\t\t}\n\t\t// See https://github.com/WordPress/gutenberg/pull/41166\n\t}, [ showSheet, isFullScreen ] );\n\n\treturn (\n\t\t<>\n\t\t\t{ showSheet && (\n\t\t\t\t<Fill>\n\t\t\t\t\t<SafeAreaView>{ children }</SafeAreaView>\n\t\t\t\t</Fill>\n\t\t\t) }\n\t\t\t{ Children.count( children ) > 0 && navigationButton }\n\t\t</>\n\t);\n};\n\nBottomSheetSubSheet.Slot = Slot;\nBottomSheetSubSheet.screenName = 'BottomSheetSubSheet';\n\nexport default BottomSheetSubSheet;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,cAAc;;AAE3C;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,QAAQ,oBAAoB;;AAEpE;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,cAAc,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEpD,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGR,cAAc,CAAE,qBAAsB,CAAC;AAE9D,MAAMS,mBAAmB,GAAGA,CAAE;EAC7BC,QAAQ;EACRC,gBAAgB;EAChBC,SAAS;EACTC;AACD,CAAC,KAAM;EACN,MAAM;IAAEC;EAAgB,CAAC,GAAGhB,UAAU,CAAEC,kBAAmB,CAAC;EAE5DF,SAAS,CAAE,MAAM;IAChB,IAAKe,SAAS,EAAG;MAChBE,eAAe,CAAED,YAAa,CAAC;IAChC;IACA;EACD,CAAC,EAAE,CAAED,SAAS,EAAEC,YAAY,CAAG,CAAC;EAEhC,oBACCP,KAAA,CAAAF,SAAA;IAAAM,QAAA,GACGE,SAAS,iBACVV,IAAA,CAACK,IAAI;MAAAG,QAAA,eACJR,IAAA,CAACP,YAAY;QAAAe,QAAA,EAAGA;MAAQ,CAAgB;IAAC,CACpC,CACN,EACCd,QAAQ,CAACmB,KAAK,CAAEL,QAAS,CAAC,GAAG,CAAC,IAAIC,gBAAgB;EAAA,CACnD,CAAC;AAEL,CAAC;AAEDF,mBAAmB,CAACD,IAAI,GAAGA,IAAI;AAC/BC,mBAAmB,CAACO,UAAU,GAAG,qBAAqB;AAEtD,eAAeP,mBAAmB","ignoreList":[]}
|
|
@@ -55,7 +55,7 @@ const BottomSheetSelectControl = ({
|
|
|
55
55
|
onPress: openSubSheet,
|
|
56
56
|
accessibilityRole: "button",
|
|
57
57
|
accessibilityLabel: sprintf(
|
|
58
|
-
// translators:
|
|
58
|
+
// translators: 1: Select control button label e.g. "Button width". 2: Select control option value e.g: "Auto, 25%".
|
|
59
59
|
__('%1$s. Currently selected: %2$s'), label, selectedOption.label),
|
|
60
60
|
accessibilityHint: sprintf(
|
|
61
61
|
// translators: %s: Select control button label e.g. "Button width"
|
|
@@ -84,7 +84,7 @@ const BottomSheetSelectControl = ({
|
|
|
84
84
|
leftAlign: true,
|
|
85
85
|
accessibilityRole: "button",
|
|
86
86
|
accessibilityLabel: item.value === selectedValue ? sprintf(
|
|
87
|
-
// translators: %s:
|
|
87
|
+
// translators: %s: The selected option.
|
|
88
88
|
__('Selected: %s'), item.label) : item.label,
|
|
89
89
|
accessibilityHint: __('Double tap to select'),
|
|
90
90
|
children: item.value === selectedValue && /*#__PURE__*/_jsx(Icon, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","useNavigation","useState","Icon","chevronRight","check","__","sprintf","styles","BottomSheet","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","EMPTY_OPTION","label","BottomSheetSelectControl","icon","options","items","onChange","value","selectedValue","disabled","_items$find","showSubSheet","setShowSubSheet","navigation","onChangeValue","goBack","selectedOption","find","option","openSubSheet","navigate","SubSheet","screenName","navigationButton","Cell","separatorType","onPress","accessibilityRole","accessibilityLabel","accessibilityHint","children","showSheet","NavBar","BackButton","Heading","style","selectControl","map","item","index","customActionButton","leftAlign"],"sources":["@wordpress/components/src/mobile/bottom-sheet-select-control/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useNavigation } from '@react-navigation/native';\nimport { useState } from '@wordpress/element';\nimport { Icon, chevronRight, check } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport BottomSheet from '../bottom-sheet';\n\nconst EMPTY_OPTION = {\n\tlabel: '',\n};\n\nconst BottomSheetSelectControl = ( {\n\tlabel,\n\ticon,\n\toptions: items,\n\tonChange,\n\tvalue: selectedValue,\n\tdisabled,\n} ) => {\n\tconst [ showSubSheet, setShowSubSheet ] = useState( false );\n\tconst navigation = useNavigation();\n\n\tconst onChangeValue = ( value ) => {\n\t\treturn () => {\n\t\t\tgoBack();\n\t\t\tonChange( value );\n\t\t};\n\t};\n\n\tconst selectedOption =\n\t\titems.find( ( option ) => option.value === selectedValue ) ??\n\t\tEMPTY_OPTION;\n\n\tconst goBack = () => {\n\t\tsetShowSubSheet( false );\n\t\tnavigation.goBack();\n\t};\n\n\tconst openSubSheet = () => {\n\t\tnavigation.navigate( BottomSheet.SubSheet.screenName );\n\t\tsetShowSubSheet( true );\n\t};\n\n\treturn (\n\t\t<BottomSheet.SubSheet\n\t\t\tnavigationButton={\n\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tseparatorType=\"none\"\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tvalue={ selectedOption.label }\n\t\t\t\t\tonPress={ openSubSheet }\n\t\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\t\taccessibilityLabel={ sprintf(\n\t\t\t\t\t\t// translators:
|
|
1
|
+
{"version":3,"names":["View","useNavigation","useState","Icon","chevronRight","check","__","sprintf","styles","BottomSheet","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","EMPTY_OPTION","label","BottomSheetSelectControl","icon","options","items","onChange","value","selectedValue","disabled","_items$find","showSubSheet","setShowSubSheet","navigation","onChangeValue","goBack","selectedOption","find","option","openSubSheet","navigate","SubSheet","screenName","navigationButton","Cell","separatorType","onPress","accessibilityRole","accessibilityLabel","accessibilityHint","children","showSheet","NavBar","BackButton","Heading","style","selectControl","map","item","index","customActionButton","leftAlign"],"sources":["@wordpress/components/src/mobile/bottom-sheet-select-control/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useNavigation } from '@react-navigation/native';\nimport { useState } from '@wordpress/element';\nimport { Icon, chevronRight, check } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport BottomSheet from '../bottom-sheet';\n\nconst EMPTY_OPTION = {\n\tlabel: '',\n};\n\nconst BottomSheetSelectControl = ( {\n\tlabel,\n\ticon,\n\toptions: items,\n\tonChange,\n\tvalue: selectedValue,\n\tdisabled,\n} ) => {\n\tconst [ showSubSheet, setShowSubSheet ] = useState( false );\n\tconst navigation = useNavigation();\n\n\tconst onChangeValue = ( value ) => {\n\t\treturn () => {\n\t\t\tgoBack();\n\t\t\tonChange( value );\n\t\t};\n\t};\n\n\tconst selectedOption =\n\t\titems.find( ( option ) => option.value === selectedValue ) ??\n\t\tEMPTY_OPTION;\n\n\tconst goBack = () => {\n\t\tsetShowSubSheet( false );\n\t\tnavigation.goBack();\n\t};\n\n\tconst openSubSheet = () => {\n\t\tnavigation.navigate( BottomSheet.SubSheet.screenName );\n\t\tsetShowSubSheet( true );\n\t};\n\n\treturn (\n\t\t<BottomSheet.SubSheet\n\t\t\tnavigationButton={\n\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tseparatorType=\"none\"\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tvalue={ selectedOption.label }\n\t\t\t\t\tonPress={ openSubSheet }\n\t\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\t\taccessibilityLabel={ sprintf(\n\t\t\t\t\t\t// translators: 1: Select control button label e.g. \"Button width\". 2: Select control option value e.g: \"Auto, 25%\".\n\t\t\t\t\t\t__( '%1$s. Currently selected: %2$s' ),\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tselectedOption.label\n\t\t\t\t\t) }\n\t\t\t\t\taccessibilityHint={ sprintf(\n\t\t\t\t\t\t// translators: %s: Select control button label e.g. \"Button width\"\n\t\t\t\t\t\t__( 'Navigates to select %s' ),\n\t\t\t\t\t\tlabel\n\t\t\t\t\t) }\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t>\n\t\t\t\t\t{ disabled ? null : <Icon icon={ chevronRight } /> }\n\t\t\t\t</BottomSheet.Cell>\n\t\t\t}\n\t\t\tshowSheet={ showSubSheet }\n\t\t>\n\t\t\t<>\n\t\t\t\t<BottomSheet.NavBar>\n\t\t\t\t\t<BottomSheet.NavBar.BackButton onPress={ goBack } />\n\t\t\t\t\t<BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</BottomSheet.NavBar.Heading>\n\t\t\t\t</BottomSheet.NavBar>\n\t\t\t\t<View style={ styles.selectControl }>\n\t\t\t\t\t{ items.map( ( item, index ) => (\n\t\t\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\t\t\tcustomActionButton\n\t\t\t\t\t\t\tseparatorType=\"none\"\n\t\t\t\t\t\t\tlabel={ item.label }\n\t\t\t\t\t\t\ticon={ item.icon }\n\t\t\t\t\t\t\tonPress={ onChangeValue( item.value ) }\n\t\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\t\t\t\taccessibilityLabel={\n\t\t\t\t\t\t\t\titem.value === selectedValue\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// translators: %s: The selected option.\n\t\t\t\t\t\t\t\t\t\t\t__( 'Selected: %s' ),\n\t\t\t\t\t\t\t\t\t\t\titem.label\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: item.label\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taccessibilityHint={ __( 'Double tap to select' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.value === selectedValue && (\n\t\t\t\t\t\t\t\t<Icon icon={ check }></Icon>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BottomSheet.Cell>\n\t\t\t\t\t) ) }\n\t\t\t\t</View>\n\t\t\t</>\n\t\t</BottomSheet.SubSheet>\n\t);\n};\n\nexport default BottomSheetSelectControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;;AAEnC;AACA;AACA;AACA,SAASC,aAAa,QAAQ,0BAA0B;AACxD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,IAAI,EAAEC,YAAY,EAAEC,KAAK,QAAQ,kBAAkB;AAC5D,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBA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C,QAAQ;UAC1BC,kBAAkB,EACjBU,IAAI,CAAC/B,KAAK,KAAKC,aAAa,GACzBjB,OAAO;UACP;UACAD,EAAE,CAAE,cAAe,CAAC,EACpBgD,IAAI,CAACrC,KACL,CAAC,GACDqC,IAAI,CAACrC,KACR;UACD4B,iBAAiB,EAAGvC,EAAE,CAAE,sBAAuB,CAAG;UAAAwC,QAAA,EAEhDQ,IAAI,CAAC/B,KAAK,KAAKC,aAAa,iBAC7Bb,IAAA,CAACR,IAAI;YAACgB,IAAI,EAAGd;UAAO,CAAO;QAC3B,GAfKkD,KAgBW,CACjB;MAAC,CACE,CAAC;IAAA,CACN;EAAC,CACkB,CAAC;AAEzB,CAAC;AAED,eAAerC,wBAAwB","ignoreList":[]}
|
|
@@ -33,9 +33,7 @@ const ColorSettingsMemo = memo(({
|
|
|
33
33
|
useEffect(() => {
|
|
34
34
|
shouldEnableBottomSheetMaxHeight(true);
|
|
35
35
|
onHandleClosingBottomSheet(null);
|
|
36
|
-
//
|
|
37
|
-
// see https://github.com/WordPress/gutenberg/pull/41166
|
|
38
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
|
+
// See https://github.com/WordPress/gutenberg/pull/41166
|
|
39
37
|
}, []);
|
|
40
38
|
return /*#__PURE__*/_jsxs(BottomSheet.NavigationContainer, {
|
|
41
39
|
children: [/*#__PURE__*/_jsx(BottomSheet.NavigationScreen, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRoute","memo","useEffect","useContext","PickerScreen","GradientPickerScreen","PaletteScreen","BottomSheet","BottomSheetContext","colorsUtils","jsx","_jsx","jsxs","_jsxs","ColorSettingsMemo","defaultSettings","onHandleClosingBottomSheet","shouldEnableBottomSheetMaxHeight","onColorChange","colorValue","gradientValue","onGradientChange","onColorCleared","label","hideNavigation","NavigationContainer","children","NavigationScreen","name","screens","palette","initialParams","picker","gradientPicker","ColorSettings","props","route","params"],"sources":["@wordpress/components/src/mobile/color-settings/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { useRoute } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { memo, useEffect, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport PickerScreen from './picker-screen';\nimport GradientPickerScreen from './gradient-picker-screen';\nimport PaletteScreen from './palette.screen';\nimport BottomSheet from '../bottom-sheet';\nimport { BottomSheetContext } from '../bottom-sheet/bottom-sheet-context';\n\nimport { colorsUtils } from './utils';\n\nconst ColorSettingsMemo = memo(\n\t( {\n\t\tdefaultSettings,\n\t\tonHandleClosingBottomSheet,\n\t\tshouldEnableBottomSheetMaxHeight,\n\t\tonColorChange,\n\t\tcolorValue,\n\t\tgradientValue,\n\t\tonGradientChange,\n\t\tonColorCleared,\n\t\tlabel,\n\t\thideNavigation,\n\t} ) => {\n\t\tuseEffect( () => {\n\t\t\tshouldEnableBottomSheetMaxHeight( true );\n\t\t\tonHandleClosingBottomSheet( null );\n\t\t\t//
|
|
1
|
+
{"version":3,"names":["useRoute","memo","useEffect","useContext","PickerScreen","GradientPickerScreen","PaletteScreen","BottomSheet","BottomSheetContext","colorsUtils","jsx","_jsx","jsxs","_jsxs","ColorSettingsMemo","defaultSettings","onHandleClosingBottomSheet","shouldEnableBottomSheetMaxHeight","onColorChange","colorValue","gradientValue","onGradientChange","onColorCleared","label","hideNavigation","NavigationContainer","children","NavigationScreen","name","screens","palette","initialParams","picker","gradientPicker","ColorSettings","props","route","params"],"sources":["@wordpress/components/src/mobile/color-settings/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { useRoute } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { memo, useEffect, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport PickerScreen from './picker-screen';\nimport GradientPickerScreen from './gradient-picker-screen';\nimport PaletteScreen from './palette.screen';\nimport BottomSheet from '../bottom-sheet';\nimport { BottomSheetContext } from '../bottom-sheet/bottom-sheet-context';\n\nimport { colorsUtils } from './utils';\n\nconst ColorSettingsMemo = memo(\n\t( {\n\t\tdefaultSettings,\n\t\tonHandleClosingBottomSheet,\n\t\tshouldEnableBottomSheetMaxHeight,\n\t\tonColorChange,\n\t\tcolorValue,\n\t\tgradientValue,\n\t\tonGradientChange,\n\t\tonColorCleared,\n\t\tlabel,\n\t\thideNavigation,\n\t} ) => {\n\t\tuseEffect( () => {\n\t\t\tshouldEnableBottomSheetMaxHeight( true );\n\t\t\tonHandleClosingBottomSheet( null );\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/41166\n\t\t}, [] );\n\t\treturn (\n\t\t\t<BottomSheet.NavigationContainer>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ colorsUtils.screens.palette }\n\t\t\t\t\tinitialParams={ {\n\t\t\t\t\t\tdefaultSettings,\n\t\t\t\t\t\tonColorChange,\n\t\t\t\t\t\tcolorValue,\n\t\t\t\t\t\tgradientValue,\n\t\t\t\t\t\tonGradientChange,\n\t\t\t\t\t\tonColorCleared,\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\thideNavigation,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<PaletteScreen />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ colorsUtils.screens.picker }\n\t\t\t\t>\n\t\t\t\t\t<PickerScreen />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ colorsUtils.screens.gradientPicker }\n\t\t\t\t>\n\t\t\t\t\t<GradientPickerScreen />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t</BottomSheet.NavigationContainer>\n\t\t);\n\t}\n);\nfunction ColorSettings( props ) {\n\tconst route = useRoute();\n\tconst { onHandleClosingBottomSheet, shouldEnableBottomSheetMaxHeight } =\n\t\tuseContext( BottomSheetContext );\n\n\treturn (\n\t\t<ColorSettingsMemo\n\t\t\tonHandleClosingBottomSheet={ onHandleClosingBottomSheet }\n\t\t\tshouldEnableBottomSheetMaxHeight={\n\t\t\t\tshouldEnableBottomSheetMaxHeight\n\t\t\t}\n\t\t\t{ ...props }\n\t\t\t{ ...route.params }\n\t\t/>\n\t);\n}\n\nexport default ColorSettings;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,0BAA0B;;AAEnD;AACA;AACA;AACA,SAASC,IAAI,EAAEC,SAAS,EAAEC,UAAU,QAAQ,oBAAoB;;AAEhE;AACA;AACA;AACA,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,WAAW,MAAM,iBAAiB;AACzC,SAASC,kBAAkB,QAAQ,sCAAsC;AAEzE,SAASC,WAAW,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEtC,MAAMC,iBAAiB,GAAGb,IAAI,CAC7B,CAAE;EACDc,eAAe;EACfC,0BAA0B;EAC1BC,gCAAgC;EAChCC,aAAa;EACbC,UAAU;EACVC,aAAa;EACbC,gBAAgB;EAChBC,cAAc;EACdC,KAAK;EACLC;AACD,CAAC,KAAM;EACNtB,SAAS,CAAE,MAAM;IAChBe,gCAAgC,CAAE,IAAK,CAAC;IACxCD,0BAA0B,CAAE,IAAK,CAAC;IAClC;EACD,CAAC,EAAE,EAAG,CAAC;EACP,oBACCH,KAAA,CAACN,WAAW,CAACkB,mBAAmB;IAAAC,QAAA,gBAC/Bf,IAAA,CAACJ,WAAW,CAACoB,gBAAgB;MAC5BC,IAAI,EAAGnB,WAAW,CAACoB,OAAO,CAACC,OAAS;MACpCC,aAAa,EAAG;QACfhB,eAAe;QACfG,aAAa;QACbC,UAAU;QACVC,aAAa;QACbC,gBAAgB;QAChBC,cAAc;QACdC,KAAK;QACLC;MACD,CAAG;MAAAE,QAAA,eAEHf,IAAA,CAACL,aAAa,IAAE;IAAC,CACY,CAAC,eAC/BK,IAAA,CAACJ,WAAW,CAACoB,gBAAgB;MAC5BC,IAAI,EAAGnB,WAAW,CAACoB,OAAO,CAACG,MAAQ;MAAAN,QAAA,eAEnCf,IAAA,CAACP,YAAY,IAAE;IAAC,CACa,CAAC,eAC/BO,IAAA,CAACJ,WAAW,CAACoB,gBAAgB;MAC5BC,IAAI,EAAGnB,WAAW,CAACoB,OAAO,CAACI,cAAgB;MAAAP,QAAA,eAE3Cf,IAAA,CAACN,oBAAoB,IAAE;IAAC,CACK,CAAC;EAAA,CACC,CAAC;AAEpC,CACD,CAAC;AACD,SAAS6B,aAAaA,CAAEC,KAAK,EAAG;EAC/B,MAAMC,KAAK,GAAGpC,QAAQ,CAAC,CAAC;EACxB,MAAM;IAAEgB,0BAA0B;IAAEC;EAAiC,CAAC,GACrEd,UAAU,CAAEK,kBAAmB,CAAC;EAEjC,oBACCG,IAAA,CAACG,iBAAiB;IACjBE,0BAA0B,EAAGA,0BAA4B;IACzDC,gCAAgC,EAC/BA,gCACA;IAAA,GACIkB,KAAK;IAAA,GACLC,KAAK,CAACC;EAAM,CACjB,CAAC;AAEJ;AAEA,eAAeH,aAAa","ignoreList":[]}
|
|
@@ -43,9 +43,7 @@ const PickerScreen = () => {
|
|
|
43
43
|
shouldEnableBottomSheetScroll: shouldEnableBottomSheetScroll,
|
|
44
44
|
onHandleHardwareButtonPress: onHandleHardwareButtonPress
|
|
45
45
|
});
|
|
46
|
-
//
|
|
47
|
-
// see https://github.com/WordPress/gutenberg/pull/41166
|
|
48
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
|
+
// See https://github.com/WordPress/gutenberg/pull/41166
|
|
49
47
|
}, [setColor, currentValue, isGradientColor, onShouldEnableInnerHandling, shouldEnableBottomSheetMaxHeight, onHandleClosingBottomSheet, isBottomSheetContentScrolling, shouldEnableBottomSheetScroll, onHandleHardwareButtonPress]);
|
|
50
48
|
};
|
|
51
49
|
export default PickerScreen;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRoute","useNavigation","useContext","useMemo","ColorPicker","BottomSheetContext","jsx","_jsx","PickerScreen","route","navigation","onShouldEnableInnerHandling","shouldEnableBottomSheetMaxHeight","onHandleClosingBottomSheet","isBottomSheetContentScrolling","shouldEnableBottomSheetScroll","onHandleHardwareButtonPress","setColor","currentValue","isGradientColor","params","activeColor","onNavigationBack","goBack"],"sources":["@wordpress/components/src/mobile/color-settings/picker-screen.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { useRoute, useNavigation } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ColorPicker } from '../../color-picker';\nimport { BottomSheetContext } from '../bottom-sheet/bottom-sheet-context';\n\nconst PickerScreen = () => {\n\tconst route = useRoute();\n\tconst navigation = useNavigation();\n\tconst {\n\t\tonShouldEnableInnerHandling,\n\t\tshouldEnableBottomSheetMaxHeight,\n\t\tonHandleClosingBottomSheet,\n\t\tisBottomSheetContentScrolling,\n\t\tshouldEnableBottomSheetScroll,\n\t\tonHandleHardwareButtonPress,\n\t} = useContext( BottomSheetContext );\n\tconst { setColor, currentValue, isGradientColor } = route.params;\n\treturn useMemo( () => {\n\t\treturn (\n\t\t\t<ColorPicker\n\t\t\t\tonShouldEnableInnerHandling={ onShouldEnableInnerHandling }\n\t\t\t\tshouldEnableBottomSheetMaxHeight={\n\t\t\t\t\tshouldEnableBottomSheetMaxHeight\n\t\t\t\t}\n\t\t\t\tsetColor={ setColor }\n\t\t\t\tactiveColor={ currentValue }\n\t\t\t\tisGradientColor={ isGradientColor }\n\t\t\t\tonNavigationBack={ navigation.goBack }\n\t\t\t\tonHandleClosingBottomSheet={ onHandleClosingBottomSheet }\n\t\t\t\tisBottomSheetContentScrolling={ isBottomSheetContentScrolling }\n\t\t\t\tshouldEnableBottomSheetScroll={ shouldEnableBottomSheetScroll }\n\t\t\t\tonHandleHardwareButtonPress={ onHandleHardwareButtonPress }\n\t\t\t/>\n\t\t);\n\t\t//
|
|
1
|
+
{"version":3,"names":["useRoute","useNavigation","useContext","useMemo","ColorPicker","BottomSheetContext","jsx","_jsx","PickerScreen","route","navigation","onShouldEnableInnerHandling","shouldEnableBottomSheetMaxHeight","onHandleClosingBottomSheet","isBottomSheetContentScrolling","shouldEnableBottomSheetScroll","onHandleHardwareButtonPress","setColor","currentValue","isGradientColor","params","activeColor","onNavigationBack","goBack"],"sources":["@wordpress/components/src/mobile/color-settings/picker-screen.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { useRoute, useNavigation } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ColorPicker } from '../../color-picker';\nimport { BottomSheetContext } from '../bottom-sheet/bottom-sheet-context';\n\nconst PickerScreen = () => {\n\tconst route = useRoute();\n\tconst navigation = useNavigation();\n\tconst {\n\t\tonShouldEnableInnerHandling,\n\t\tshouldEnableBottomSheetMaxHeight,\n\t\tonHandleClosingBottomSheet,\n\t\tisBottomSheetContentScrolling,\n\t\tshouldEnableBottomSheetScroll,\n\t\tonHandleHardwareButtonPress,\n\t} = useContext( BottomSheetContext );\n\tconst { setColor, currentValue, isGradientColor } = route.params;\n\treturn useMemo( () => {\n\t\treturn (\n\t\t\t<ColorPicker\n\t\t\t\tonShouldEnableInnerHandling={ onShouldEnableInnerHandling }\n\t\t\t\tshouldEnableBottomSheetMaxHeight={\n\t\t\t\t\tshouldEnableBottomSheetMaxHeight\n\t\t\t\t}\n\t\t\t\tsetColor={ setColor }\n\t\t\t\tactiveColor={ currentValue }\n\t\t\t\tisGradientColor={ isGradientColor }\n\t\t\t\tonNavigationBack={ navigation.goBack }\n\t\t\t\tonHandleClosingBottomSheet={ onHandleClosingBottomSheet }\n\t\t\t\tisBottomSheetContentScrolling={ isBottomSheetContentScrolling }\n\t\t\t\tshouldEnableBottomSheetScroll={ shouldEnableBottomSheetScroll }\n\t\t\t\tonHandleHardwareButtonPress={ onHandleHardwareButtonPress }\n\t\t\t/>\n\t\t);\n\t\t// See https://github.com/WordPress/gutenberg/pull/41166\n\t}, [\n\t\tsetColor,\n\t\tcurrentValue,\n\t\tisGradientColor,\n\t\tonShouldEnableInnerHandling,\n\t\tshouldEnableBottomSheetMaxHeight,\n\t\tonHandleClosingBottomSheet,\n\t\tisBottomSheetContentScrolling,\n\t\tshouldEnableBottomSheetScroll,\n\t\tonHandleHardwareButtonPress,\n\t] );\n};\n\nexport default PickerScreen;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,aAAa,QAAQ,0BAA0B;;AAElE;AACA;AACA;AACA,SAASC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,kBAAkB,QAAQ,sCAAsC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE1E,MAAMC,YAAY,GAAGA,CAAA,KAAM;EAC1B,MAAMC,KAAK,GAAGT,QAAQ,CAAC,CAAC;EACxB,MAAMU,UAAU,GAAGT,aAAa,CAAC,CAAC;EAClC,MAAM;IACLU,2BAA2B;IAC3BC,gCAAgC;IAChCC,0BAA0B;IAC1BC,6BAA6B;IAC7BC,6BAA6B;IAC7BC;EACD,CAAC,GAAGd,UAAU,CAAEG,kBAAmB,CAAC;EACpC,MAAM;IAAEY,QAAQ;IAAEC,YAAY;IAAEC;EAAgB,CAAC,GAAGV,KAAK,CAACW,MAAM;EAChE,OAAOjB,OAAO,CAAE,MAAM;IACrB,oBACCI,IAAA,CAACH,WAAW;MACXO,2BAA2B,EAAGA,2BAA6B;MAC3DC,gCAAgC,EAC/BA,gCACA;MACDK,QAAQ,EAAGA,QAAU;MACrBI,WAAW,EAAGH,YAAc;MAC5BC,eAAe,EAAGA,eAAiB;MACnCG,gBAAgB,EAAGZ,UAAU,CAACa,MAAQ;MACtCV,0BAA0B,EAAGA,0BAA4B;MACzDC,6BAA6B,EAAGA,6BAA+B;MAC/DC,6BAA6B,EAAGA,6BAA+B;MAC/DC,2BAA2B,EAAGA;IAA6B,CAC3D,CAAC;IAEH;EACD,CAAC,EAAE,CACFC,QAAQ,EACRC,YAAY,EACZC,eAAe,EACfR,2BAA2B,EAC3BC,gCAAgC,EAChCC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,6BAA6B,EAC7BC,2BAA2B,CAC1B,CAAC;AACJ,CAAC;AAED,eAAeR,YAAY","ignoreList":[]}
|
|
@@ -102,9 +102,7 @@ const ImageComponent = ({
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
return () => isCurrent = false;
|
|
105
|
-
//
|
|
106
|
-
// see https://github.com/WordPress/gutenberg/pull/41166
|
|
107
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
105
|
+
// See https://github.com/WordPress/gutenberg/pull/41166
|
|
108
106
|
}, [url]);
|
|
109
107
|
const onContainerLayout = event => {
|
|
110
108
|
const {
|