@wordpress/components 28.9.0 → 28.11.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 +57 -0
- package/build/alignment-matrix-control/icon.js.map +1 -1
- package/build/alignment-matrix-control/types.js.map +1 -1
- package/build/alignment-matrix-control/utils.js.map +1 -1
- package/build/angle-picker-control/angle-circle.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +5 -9
- 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/get-default-use-items.js.map +1 -1
- package/build/autocomplete/index.js +5 -5
- package/build/autocomplete/index.js.map +1 -1
- package/build/base-control/hooks.js.map +1 -1
- package/build/base-control/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-box-control/styles.js.map +1 -1
- package/build/border-box-control/utils.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 +12 -12
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/styles.js.map +1 -1
- package/build/box-control/axial-input-controls.js.map +1 -1
- package/build/box-control/icon.js.map +1 -1
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/input-controls.js.map +1 -1
- package/build/button/index.native.js +1 -1
- package/build/button/index.native.js.map +1 -1
- package/build/card/card/component.js +1 -1
- package/build/card/card/component.js.map +1 -1
- package/build/card/styles.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 +3 -3
- 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/color-picker/styles.js.map +1 -1
- package/build/combobox-control/index.js +1 -1
- package/build/combobox-control/index.js.map +1 -1
- package/build/composite/legacy/index.js +5 -2
- package/build/composite/legacy/index.js.map +1 -1
- package/build/context/context-connect.js +1 -0
- package/build/context/context-connect.js.map +1 -1
- package/build/context/context-system-provider.js +1 -1
- package/build/context/context-system-provider.js.map +1 -1
- package/build/context/get-styled-class-name-from-key.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/custom-gradient-picker/index.js.map +1 -1
- package/build/custom-gradient-picker/serializer.js.map +1 -1
- package/build/custom-gradient-picker/utils.js.map +1 -1
- package/build/custom-select-control-v2/styles.js.map +1 -1
- package/build/dashicon/index.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/date-time/date/styles.js.map +1 -1
- package/build/date-time/time/timezone.js.map +1 -1
- package/build/draggable/index.js.map +1 -1
- package/build/drop-zone/index.js +1 -2
- package/build/drop-zone/index.js.map +1 -1
- package/build/duotone-picker/color-list-picker/index.js.map +1 -1
- package/build/duotone-picker/utils.js.map +1 -1
- package/build/elevation/hook.js.map +1 -1
- package/build/external-link/index.js +20 -23
- package/build/external-link/index.js.map +1 -1
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/focal-point-picker/index.native.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build/font-size-picker/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-token-field/index.js +2 -4
- 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-input.js.map +1 -1
- package/build/form-token-field/token.js +1 -1
- package/build/form-token-field/token.js.map +1 -1
- package/build/gradient-picker/index.js.map +1 -1
- package/build/grid/hook.js.map +1 -1
- package/build/guide/page-control.js +1 -1
- package/build/guide/page-control.js.map +1 -1
- package/build/h-stack/hook.js.map +1 -1
- package/build/heading/hook.js.map +1 -1
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/item-group/styles.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-group/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/cell.native.js +4 -4
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/index.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/range-text-input.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/switch-cell.native.js +4 -4
- package/build/mobile/bottom-sheet/switch-cell.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/cycle-select-control/index.native.js.map +1 -1
- package/build/mobile/gradient/index.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/index.native.js +1 -1
- package/build/mobile/link-picker/index.native.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/picker/index.android.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/get-px-from-css-unit.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/modal/aria-helper.js +2 -1
- package/build/modal/aria-helper.js.map +1 -1
- package/build/modal/index.js +2 -1
- package/build/modal/index.js.map +1 -1
- package/build/modal/use-modal-exit-animation.js.map +1 -1
- package/build/navigation/group/index.js.map +1 -1
- package/build/navigation/index.js +1 -2
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/item/base.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/index.js.map +1 -1
- package/build/navigation/menu/menu-title-search.js +4 -4
- package/build/navigation/menu/menu-title-search.js.map +1 -1
- package/build/navigation/menu/menu-title.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/navigation/styles/navigation-styles.js.map +1 -1
- package/build/navigator/navigator/component.js.map +1 -1
- package/build/navigator/navigator-button/hook.js.map +1 -1
- package/build/number-control/styles/number-control-styles.js.map +1 -1
- package/build/palette-edit/index.js +29 -4
- 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/popover/index.js +1 -1
- package/build/popover/index.js.map +1 -1
- package/build/popover/overlay-middlewares.js.map +1 -1
- package/build/popover/utils.js.map +1 -1
- package/build/private-apis.js +4 -4
- package/build/private-apis.js.map +1 -1
- package/build/progress-bar/index.js.map +1 -1
- package/build/progress-bar/styles.js.map +1 -1
- package/build/query-controls/index.js.map +1 -1
- package/build/query-controls/index.native.js.map +1 -1
- package/build/radio-control/index.js.map +1 -1
- package/build/radio-control/index.native.js.map +1 -1
- package/build/radio-group/index.js +3 -1
- package/build/radio-group/index.js.map +1 -1
- package/build/range-control/index.js.map +1 -1
- package/build/range-control/index.native.js.map +1 -1
- package/build/range-control/rail.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +32 -32
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/range-control/tooltip.js +1 -1
- package/build/range-control/tooltip.js.map +1 -1
- package/build/range-control/utils.js.map +1 -1
- package/build/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build/responsive-wrapper/index.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.js +6 -0
- package/build/search-control/index.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/search-control/types.js.map +1 -1
- package/build/select-control/index.js.map +1 -1
- package/build/select-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/slot-fill/index.js.map +1 -1
- package/build/spacer/hook.js +5 -3
- package/build/spacer/hook.js.map +1 -1
- package/build/spinner/styles.js.map +1 -1
- package/build/style-provider/index.js +1 -0
- package/build/style-provider/index.js.map +1 -1
- package/build/surface/hook.js.map +1 -1
- package/build/surface/styles.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 +31 -13
- package/build/tabs/styles.js.map +1 -1
- package/build/tabs/tab.js +30 -8
- package/build/tabs/tab.js.map +1 -1
- package/build/tabs/tablist.js +67 -56
- package/build/tabs/tablist.js.map +1 -1
- package/build/tabs/tabpanel.js.map +1 -1
- package/build/tabs/types.js.map +1 -1
- package/build/text/get-line-height.js.map +1 -1
- package/build/text/styles/text-mixins.native.js.map +1 -1
- package/build/text/utils.js.map +1 -1
- package/build/text-control/index.native.js.map +1 -1
- package/build/text-highlight/index.js.map +1 -1
- package/build/textarea-control/index.js.map +1 -1
- package/build/theme/color-algorithms.js.map +1 -1
- package/build/theme/styles.js.map +1 -1
- package/build/toggle-control/index.js.map +1 -1
- package/build/toggle-control/index.native.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js +9 -1
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +4 -61
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js +10 -10
- package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build/toggle-group-control/types.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/styles.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.js +5 -1
- package/build/tooltip/index.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.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/unit-control/utils.js.map +1 -1
- package/build/utils/breakpoint.js.map +1 -1
- package/build/utils/colors-values.js.map +1 -1
- package/build/utils/config-values.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/font-size.js.map +1 -1
- package/build/utils/hooks/use-animated-offset-rect.js +81 -0
- package/build/utils/hooks/use-animated-offset-rect.js.map +1 -0
- package/build/utils/hooks/use-cx.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/utils/math.js +2 -2
- package/build/utils/math.js.map +1 -1
- package/build/utils/space.js.map +1 -1
- package/build/utils/unit-values.js.map +1 -1
- package/build/utils/use-responsive-value.js.map +1 -1
- package/build-module/alignment-matrix-control/cell.js +1 -2
- package/build-module/alignment-matrix-control/cell.js.map +1 -1
- package/build-module/alignment-matrix-control/icon.js.map +1 -1
- package/build-module/alignment-matrix-control/types.js.map +1 -1
- package/build-module/alignment-matrix-control/utils.js.map +1 -1
- package/build-module/angle-picker-control/angle-circle.js.map +1 -1
- package/build-module/angle-picker-control/index.js +1 -2
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +6 -12
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.native.js +3 -6
- package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build-module/autocomplete/get-default-use-items.js.map +1 -1
- package/build-module/autocomplete/index.js +6 -8
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/base-control/hooks.js.map +1 -1
- package/build-module/base-control/index.js +1 -2
- package/build-module/base-control/index.js.map +1 -1
- package/build-module/base-control/index.native.js +1 -2
- package/build-module/base-control/index.native.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 +2 -2
- 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-box-control/border-box-control-split-controls/component.js +1 -2
- package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build-module/border-box-control/styles.js.map +1 -1
- package/build-module/border-box-control/utils.js.map +1 -1
- package/build-module/border-control/border-control/component.js +2 -2
- 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 -15
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/styles.js.map +1 -1
- package/build-module/box-control/all-input-control.js +1 -3
- package/build-module/box-control/all-input-control.js.map +1 -1
- package/build-module/box-control/axial-input-controls.js +1 -3
- package/build-module/box-control/axial-input-controls.js.map +1 -1
- package/build-module/box-control/icon.js +1 -2
- package/build-module/box-control/icon.js.map +1 -1
- package/build-module/box-control/index.js +1 -2
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-controls.js +1 -3
- package/build-module/box-control/input-controls.js.map +1 -1
- package/build-module/button/index.js +1 -3
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/index.native.js +2 -3
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/card/card/component.js +2 -3
- package/build-module/card/card/component.js.map +1 -1
- package/build-module/card/styles.js.map +1 -1
- package/build-module/checkbox-control/index.js +1 -2
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-option.js +1 -2
- package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker.js +1 -2
- package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build-module/color-indicator/index.native.js +1 -2
- package/build-module/color-indicator/index.native.js.map +1 -1
- package/build-module/color-palette/index.js +2 -3
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +4 -6
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-picker/component.js +1 -2
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/hsl-input.js +1 -3
- package/build-module/color-picker/hsl-input.js.map +1 -1
- package/build-module/color-picker/hsv-color-picker.native.js +1 -2
- package/build-module/color-picker/hsv-color-picker.native.js.map +1 -1
- package/build-module/color-picker/hue-picker.native.js +1 -2
- package/build-module/color-picker/hue-picker.native.js.map +1 -1
- package/build-module/color-picker/index.native.js +1 -4
- package/build-module/color-picker/index.native.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +1 -2
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/color-picker/rgb-input.js +1 -3
- package/build-module/color-picker/rgb-input.js.map +1 -1
- package/build-module/color-picker/saturation-picker.native.js +1 -2
- package/build-module/color-picker/saturation-picker.native.js.map +1 -1
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/combobox-control/index.js +2 -3
- package/build-module/combobox-control/index.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/confirm-dialog/component.js +1 -3
- package/build-module/confirm-dialog/component.js.map +1 -1
- package/build-module/context/context-connect.js +1 -0
- package/build-module/context/context-connect.js.map +1 -1
- package/build-module/context/context-system-provider.js +1 -1
- package/build-module/context/context-system-provider.js.map +1 -1
- package/build-module/context/get-styled-class-name-from-key.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +2 -4
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -2
- package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +1 -2
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/custom-gradient-picker/index.native.js +1 -3
- package/build-module/custom-gradient-picker/index.native.js.map +1 -1
- package/build-module/custom-gradient-picker/serializer.js.map +1 -1
- package/build-module/custom-gradient-picker/utils.js.map +1 -1
- package/build-module/custom-select-control/index.js +1 -3
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/custom-select-control-v2/custom-select.js +1 -2
- package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
- package/build-module/custom-select-control-v2/item.js +1 -2
- package/build-module/custom-select-control-v2/item.js.map +1 -1
- package/build-module/custom-select-control-v2/styles.js.map +1 -1
- package/build-module/dashicon/index.js.map +1 -1
- package/build-module/date-time/date/index.js +1 -3
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/date-time/date/styles.js.map +1 -1
- package/build-module/date-time/date-time/index.js +1 -3
- package/build-module/date-time/date-time/index.js.map +1 -1
- package/build-module/date-time/time/index.js +1 -2
- package/build-module/date-time/time/index.js.map +1 -1
- package/build-module/date-time/time/time-input/index.js +1 -2
- package/build-module/date-time/time/time-input/index.js.map +1 -1
- package/build-module/date-time/time/timezone.js.map +1 -1
- package/build-module/dimension-control/index.js +1 -3
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/draggable/index.js +1 -3
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/drop-zone/index.js +2 -4
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/dropdown/index.js +1 -2
- package/build-module/dropdown/index.js.map +1 -1
- package/build-module/dropdown/index.native.js +1 -2
- package/build-module/dropdown/index.native.js.map +1 -1
- package/build-module/dropdown-menu/index.js +1 -2
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/dropdown-menu/index.native.js +1 -2
- package/build-module/dropdown-menu/index.native.js.map +1 -1
- package/build-module/duotone-picker/color-list-picker/index.js +1 -3
- package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
- package/build-module/duotone-picker/duotone-picker.js +1 -2
- package/build-module/duotone-picker/duotone-picker.js.map +1 -1
- package/build-module/duotone-picker/utils.js.map +1 -1
- package/build-module/elevation/hook.js.map +1 -1
- package/build-module/external-link/index.js +21 -25
- package/build-module/external-link/index.js.map +1 -1
- package/build-module/external-link/index.native.js +1 -2
- package/build-module/external-link/index.native.js.map +1 -1
- package/build-module/focal-point-picker/controls.js +1 -2
- package/build-module/focal-point-picker/controls.js.map +1 -1
- package/build-module/focal-point-picker/focal-point.native.js +1 -2
- package/build-module/focal-point-picker/focal-point.native.js.map +1 -1
- package/build-module/focal-point-picker/grid.js +1 -2
- package/build-module/focal-point-picker/grid.js.map +1 -1
- package/build-module/focal-point-picker/index.js +1 -2
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/focal-point-picker/index.native.js +1 -2
- package/build-module/focal-point-picker/index.native.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build-module/focal-point-picker/tooltip/index.native.js +1 -2
- package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build-module/font-size-picker/index.js +1 -2
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/index.native.js +8 -10
- package/build-module/font-size-picker/index.native.js.map +1 -1
- package/build-module/form-file-upload/index.js +1 -2
- package/build-module/form-file-upload/index.js.map +1 -1
- package/build-module/form-toggle/index.js +1 -2
- package/build-module/form-toggle/index.js.map +1 -1
- package/build-module/form-token-field/index.js +3 -6
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +8 -5
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/form-token-field/token-input.js.map +1 -1
- package/build-module/form-token-field/token.js +2 -3
- package/build-module/form-token-field/token.js.map +1 -1
- package/build-module/gradient-picker/index.js +1 -2
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/grid/hook.js.map +1 -1
- package/build-module/guide/index.js +1 -2
- package/build-module/guide/index.js.map +1 -1
- package/build-module/guide/page-control.js +1 -1
- package/build-module/guide/page-control.js.map +1 -1
- package/build-module/h-stack/hook.js.map +1 -1
- package/build-module/heading/hook.js.map +1 -1
- package/build-module/higher-order/with-fallback-styles/index.js +3 -4
- package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js +1 -2
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/item-group/styles.js.map +1 -1
- package/build-module/keyboard-shortcuts/index.js +1 -3
- package/build-module/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/{dropdown-menu-v2 → menu}/checkbox-item.js +9 -10
- 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 +47 -49
- 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 +8 -9
- package/build-module/menu/item.js.map +1 -0
- package/build-module/{dropdown-menu-v2 → menu}/radio-item.js +9 -10
- 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-group/index.js +1 -2
- package/build-module/menu-group/index.js.map +1 -1
- package/build-module/menu-item/index.js +1 -2
- package/build-module/menu-item/index.js.map +1 -1
- package/build-module/menu-items-choice/index.js +1 -2
- package/build-module/menu-items-choice/index.js.map +1 -1
- package/build-module/mobile/badge/index.native.js +1 -3
- package/build-module/mobile/badge/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +4 -7
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js +5 -6
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/color-cell.native.js +1 -2
- package/build-module/mobile/bottom-sheet/color-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js +1 -3
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -2
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -2
- package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-cell.native.js +2 -3
- package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-text-input.native.js +1 -2
- package/build-module/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +2 -3
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js +1 -2
- package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js +1 -2
- package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js.map +1 -1
- package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js +2 -6
- package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/switch-cell.native.js +4 -4
- package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-select-control/index.native.js +3 -5
- package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-text-control/index.native.js +1 -3
- package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/gradient-picker-screen.native.js +1 -2
- package/build-module/mobile/color-settings/gradient-picker-screen.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js +2 -5
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +1 -3
- package/build-module/mobile/color-settings/palette.screen.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/cycle-select-control/index.native.js.map +1 -1
- package/build-module/mobile/focal-point-settings-panel/index.native.js +1 -2
- package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
- package/build-module/mobile/gradient/index.native.js +1 -2
- package/build-module/mobile/gradient/index.native.js.map +1 -1
- package/build-module/mobile/html-text-input/index.native.js +1 -2
- package/build-module/mobile/html-text-input/index.native.js.map +1 -1
- package/build-module/mobile/image/icon-retry.native.js +1 -2
- package/build-module/mobile/image/icon-retry.native.js.map +1 -1
- package/build-module/mobile/image/image-editing-button.native.js +1 -2
- package/build-module/mobile/image/image-editing-button.native.js.map +1 -1
- package/build-module/mobile/image/index.native.js +2 -6
- package/build-module/mobile/image/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js +2 -5
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build-module/mobile/link-picker/index.native.js +2 -3
- package/build-module/mobile/link-picker/index.native.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 +7 -21
- package/build-module/mobile/link-settings/index.native.js.map +1 -1
- package/build-module/mobile/link-settings/link-settings-navigation.native.js +1 -2
- package/build-module/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
- package/build-module/mobile/link-settings/link-settings-screen.native.js +1 -3
- package/build-module/mobile/link-settings/link-settings-screen.native.js.map +1 -1
- package/build-module/mobile/picker/index.android.js +1 -2
- package/build-module/mobile/picker/index.android.js.map +1 -1
- package/build-module/mobile/segmented-control/index.native.js +3 -8
- package/build-module/mobile/segmented-control/index.native.js.map +1 -1
- package/build-module/mobile/utils/get-px-from-css-unit.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/modal/aria-helper.js +2 -1
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/modal/index.js +3 -4
- package/build-module/modal/index.js.map +1 -1
- package/build-module/modal/use-modal-exit-animation.js.map +1 -1
- package/build-module/navigation/back-button/index.js +1 -2
- package/build-module/navigation/back-button/index.js.map +1 -1
- package/build-module/navigation/group/index.js +1 -2
- package/build-module/navigation/group/index.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/base-content.js +1 -3
- package/build-module/navigation/item/base-content.js.map +1 -1
- package/build-module/navigation/item/base.js.map +1 -1
- package/build-module/navigation/item/index.js +1 -2
- package/build-module/navigation/item/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/index.js +1 -2
- package/build-module/navigation/menu/index.js.map +1 -1
- package/build-module/navigation/menu/menu-title-search.js +4 -4
- package/build-module/navigation/menu/menu-title-search.js.map +1 -1
- package/build-module/navigation/menu/menu-title.js +1 -2
- package/build-module/navigation/menu/menu-title.js.map +1 -1
- package/build-module/navigation/menu/search-no-results-found.js +1 -2
- package/build-module/navigation/menu/search-no-results-found.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/navigation/styles/navigation-styles.js.map +1 -1
- package/build-module/navigator/navigator/component.js.map +1 -1
- package/build-module/navigator/navigator-button/hook.js.map +1 -1
- package/build-module/notice/index.js +1 -2
- package/build-module/notice/index.js.map +1 -1
- package/build-module/notice/index.native.js +1 -3
- package/build-module/notice/index.native.js.map +1 -1
- package/build-module/number-control/index.js +1 -3
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/number-control/styles/number-control-styles.js.map +1 -1
- package/build-module/palette-edit/index.js +31 -9
- 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/actions.native.js +1 -2
- package/build-module/panel/actions.native.js.map +1 -1
- package/build-module/panel/body.js +1 -2
- package/build-module/panel/body.js.map +1 -1
- package/build-module/panel/body.native.js +1 -2
- package/build-module/panel/body.native.js.map +1 -1
- package/build-module/panel/header.js +1 -2
- package/build-module/panel/header.js.map +1 -1
- package/build-module/panel/index.js +1 -2
- package/build-module/panel/index.js.map +1 -1
- package/build-module/placeholder/index.js +1 -2
- package/build-module/placeholder/index.js.map +1 -1
- package/build-module/popover/index.js +2 -4
- package/build-module/popover/index.js.map +1 -1
- package/build-module/popover/overlay-middlewares.js.map +1 -1
- package/build-module/popover/utils.js.map +1 -1
- package/build-module/private-apis.js +3 -3
- package/build-module/private-apis.js.map +1 -1
- package/build-module/progress-bar/index.js +1 -2
- package/build-module/progress-bar/index.js.map +1 -1
- package/build-module/progress-bar/styles.js.map +1 -1
- package/build-module/query-controls/index.js.map +1 -1
- package/build-module/query-controls/index.native.js +1 -3
- package/build-module/query-controls/index.native.js.map +1 -1
- package/build-module/radio-control/index.js +1 -2
- package/build-module/radio-control/index.js.map +1 -1
- package/build-module/radio-control/index.native.js +1 -2
- package/build-module/radio-control/index.native.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/range-control/index.js +1 -2
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/range-control/index.native.js.map +1 -1
- package/build-module/range-control/mark.js +1 -3
- package/build-module/range-control/mark.js.map +1 -1
- package/build-module/range-control/rail.js +1 -3
- package/build-module/range-control/rail.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +32 -32
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/range-control/tooltip.js +1 -1
- package/build-module/range-control/tooltip.js.map +1 -1
- package/build-module/range-control/utils.js.map +1 -1
- package/build-module/resizable-box/index.js +1 -2
- package/build-module/resizable-box/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/index.js +1 -2
- package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build-module/responsive-wrapper/index.js.map +1 -1
- package/build-module/sandbox/index.js +4 -8
- package/build-module/sandbox/index.js.map +1 -1
- package/build-module/sandbox/index.native.js +2 -5
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/search-control/index.js +6 -0
- package/build-module/search-control/index.js.map +1 -1
- package/build-module/search-control/index.native.js +2 -5
- package/build-module/search-control/index.native.js.map +1 -1
- package/build-module/search-control/types.js.map +1 -1
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-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/slot-fill/index.js +1 -3
- package/build-module/slot-fill/index.js.map +1 -1
- package/build-module/slot-fill/slot.js +1 -2
- package/build-module/slot-fill/slot.js.map +1 -1
- package/build-module/snackbar/index.js +1 -2
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/snackbar/list.js +1 -2
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/spacer/hook.js +5 -3
- package/build-module/spacer/hook.js.map +1 -1
- package/build-module/spinner/index.js +1 -2
- package/build-module/spinner/index.js.map +1 -1
- package/build-module/spinner/styles.js.map +1 -1
- package/build-module/style-provider/index.js +1 -0
- package/build-module/style-provider/index.js.map +1 -1
- package/build-module/surface/hook.js.map +1 -1
- package/build-module/surface/styles.js.map +1 -1
- package/build-module/tab-panel/index.js +5 -3
- 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 +29 -7
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/tabs/tab.js +30 -10
- package/build-module/tabs/tab.js.map +1 -1
- package/build-module/tabs/tablist.js +67 -56
- package/build-module/tabs/tablist.js.map +1 -1
- package/build-module/tabs/tabpanel.js.map +1 -1
- package/build-module/tabs/types.js.map +1 -1
- package/build-module/text/get-line-height.js.map +1 -1
- package/build-module/text/styles/text-mixins.native.js.map +1 -1
- package/build-module/text/utils.js.map +1 -1
- package/build-module/text-control/index.native.js.map +1 -1
- package/build-module/text-highlight/index.js +1 -2
- package/build-module/text-highlight/index.js.map +1 -1
- package/build-module/textarea-control/index.js.map +1 -1
- package/build-module/theme/color-algorithms.js.map +1 -1
- package/build-module/theme/styles.js.map +1 -1
- package/build-module/tip/index.js +1 -2
- package/build-module/tip/index.js.map +1 -1
- package/build-module/toggle-control/index.js +1 -2
- package/build-module/toggle-control/index.js.map +1 -1
- package/build-module/toggle-control/index.native.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +10 -2
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +6 -66
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +11 -12
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build-module/toggle-group-control/types.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/toolbar/toolbar-button/toolbar-button-container.native.js +2 -2
- package/build-module/toolbar/toolbar-button/toolbar-button-container.native.js.map +1 -1
- package/build-module/toolbar/toolbar-group/index.js +1 -2
- package/build-module/toolbar/toolbar-group/index.js.map +1 -1
- package/build-module/tools-panel/styles.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +1 -2
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +2 -4
- 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.js +6 -3
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tooltip/index.native.js +6 -18
- package/build-module/tooltip/index.native.js.map +1 -1
- package/build-module/tree-grid/cell.js +1 -2
- package/build-module/tree-grid/cell.js.map +1 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/index.native.js +3 -9
- package/build-module/unit-control/index.native.js.map +1 -1
- package/build-module/unit-control/utils.js.map +1 -1
- package/build-module/utils/breakpoint.js.map +1 -1
- package/build-module/utils/colors-values.js.map +1 -1
- package/build-module/utils/config-values.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/font-size.js.map +1 -1
- package/build-module/utils/hooks/use-animated-offset-rect.js +75 -0
- package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -0
- package/build-module/utils/hooks/use-cx.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-module/utils/math.js +2 -2
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/space.js.map +1 -1
- package/build-module/utils/unit-values.js.map +1 -1
- package/build-module/utils/use-responsive-value.js.map +1 -1
- package/build-style/style-rtl.css +14 -11
- package/build-style/style.css +14 -11
- package/build-types/alignment-matrix-control/types.d.ts +2 -0
- package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
- 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/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/drop-zone/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/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/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/modal/aria-helper.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/palette-edit/index.d.ts +3 -0
- 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/stories/index.story.d.ts.map +1 -1
- package/build-types/radio-group/index.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.story.d.ts.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/search-control/index.d.ts.map +1 -1
- package/build-types/search-control/stories/index.story.d.ts +0 -8
- package/build-types/search-control/stories/index.story.d.ts.map +1 -1
- package/build-types/search-control/types.d.ts +3 -0
- package/build-types/search-control/types.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/spacer/hook.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 +13 -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/theme/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/types.d.ts +1 -0
- package/build-types/toggle-group-control/types.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/index.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 +69 -0
- package/build-types/utils/hooks/use-animated-offset-rect.d.ts.map +1 -0
- 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/schemas/docs-manifest.json +38 -0
- package/src/alignment-matrix-control/README.md +45 -36
- package/src/alignment-matrix-control/docs-manifest.json +12 -0
- package/src/alignment-matrix-control/types.ts +2 -0
- package/src/angle-picker-control/README.md +35 -23
- package/src/angle-picker-control/docs-manifest.json +5 -0
- 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 +24 -12
- 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/button/style.scss +5 -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/composite/test/index.tsx +629 -38
- 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/drop-zone/index.tsx +1 -2
- package/src/drop-zone/style.scss +1 -1
- package/src/font-size-picker/index.native.js +7 -7
- package/src/form-token-field/index.tsx +0 -3
- package/src/form-token-field/style.scss +4 -1
- package/src/form-token-field/suggestions-list.tsx +6 -0
- 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 +542 -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/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/aria-helper.ts +1 -0
- 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/palette-edit/index.tsx +34 -10
- package/src/palette-edit/styles.ts +1 -67
- package/src/palette-edit/test/index.tsx +50 -1
- package/src/panel/stories/index.story.tsx +2 -1
- package/src/private-apis.ts +3 -3
- package/src/radio-group/index.tsx +2 -0
- package/src/range-control/styles/range-control-styles.ts +19 -10
- package/src/range-control/tooltip.tsx +1 -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/README.md +2 -0
- package/src/search-control/index.native.js +1 -3
- package/src/search-control/index.tsx +7 -0
- package/src/search-control/stories/index.story.tsx +0 -15
- package/src/search-control/test/index.tsx +4 -1
- package/src/search-control/types.ts +3 -0
- 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/spacer/hook.ts +3 -2
- 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 +123 -46
- package/src/tabs/tab.tsx +31 -5
- package/src/tabs/tablist.tsx +74 -59
- package/src/tabs/test/index.tsx +131 -118
- package/src/tabs/types.ts +89 -49
- package/src/theme/stories/index.story.tsx +2 -1
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +6 -6
- package/src/toggle-group-control/test/index.tsx +39 -0
- package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +11 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +4 -98
- package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +15 -15
- package/src/toggle-group-control/types.ts +1 -0
- 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/index.tsx +8 -1
- package/src/tooltip/test/index.tsx +78 -0
- package/src/unit-control/index.native.js +2 -6
- package/src/utils/deprecated-36px-size.ts +24 -0
- package/src/utils/element-rect.ts +14 -2
- package/src/utils/hooks/use-animated-offset-rect.ts +119 -0
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_warning","_interopRequireDefault","_constants","_getStyledClassNameFromKey","contextConnect","Component","namespace","_contextConnect","forwardsRef","contextConnectWithoutRef","options","WrappedComponent","forwardRef","globalThis","SCRIPT_DEBUG","warn","mergedNamespace","CONNECT_STATIC_NAMESPACE","Array","isArray","Object","assign","Set","displayName","selector","getStyledClassNameFromKey","getConnectNamespace","namespaces","type","hasConnectNamespace","match","includes","some","result"],"sources":["@wordpress/components/src/context/context-connect.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, ReactChild, ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { CONNECT_STATIC_NAMESPACE } from './constants';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport type { WordPressComponentFromProps } from '.';\n\ntype AcceptsTwoArgs<\n\tF extends ( ...args: any ) => any,\n\tErrorMessage = never,\n> = Parameters< F >[ 'length' ] extends 2 ? {} : ErrorMessage;\n\ntype ContextConnectOptions = {\n\tforwardsRef?: boolean;\n};\n\n/**\n * Forwards ref (React.ForwardRef) and \"Connects\" (or registers) a component\n * within the Context system under a specified namespace.\n *\n * @param Component The component to register into the Context system.\n * @param namespace The namespace to register the component under.\n * @return The connected WordPressComponent\n */\nexport function contextConnect<\n\tC extends ( props: any, ref: ForwardedRef< any > ) => JSX.Element | null,\n>(\n\tComponent: C &\n\t\tAcceptsTwoArgs<\n\t\t\tC,\n\t\t\t'Warning: Your component function does not take a ref as the second argument. Did you mean to use `contextConnectWithoutRef`?'\n\t\t>,\n\tnamespace: string\n) {\n\treturn _contextConnect( Component, namespace, { forwardsRef: true } );\n}\n\n/**\n * \"Connects\" (or registers) a component within the Context system under a specified namespace.\n * Does not forward a ref.\n *\n * @param Component The component to register into the Context system.\n * @param namespace The namespace to register the component under.\n * @return The connected WordPressComponent\n */\nexport function contextConnectWithoutRef< P >(\n\tComponent: ( props: P ) => JSX.Element | null,\n\tnamespace: string\n) {\n\treturn _contextConnect( Component, namespace );\n}\n\n// This is an (experimental) evolution of the initial connect() HOC.\n// The hope is that we can improve render performance by removing functional\n// component wrappers.\nfunction _contextConnect<\n\tC extends ( props: any, ref: ForwardedRef< any > ) => JSX.Element | null,\n\tO extends ContextConnectOptions,\n>(\n\tComponent: C,\n\tnamespace: string,\n\toptions?: O\n): WordPressComponentFromProps<\n\tParameters< C >[ 0 ],\n\tO[ 'forwardsRef' ] extends true ? true : false\n> {\n\tconst WrappedComponent = options?.forwardsRef\n\t\t? forwardRef< any, Parameters< C >[ 0 ] >( Component )\n\t\t: Component;\n\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'contextConnect: Please provide a namespace' );\n\t}\n\n\t// @ts-expect-error internal property\n\tlet mergedNamespace = WrappedComponent[ CONNECT_STATIC_NAMESPACE ] || [\n\t\tnamespace,\n\t];\n\n\t/**\n\t * Consolidate (merge) namespaces before attaching it to the WrappedComponent.\n\t */\n\tif ( Array.isArray( namespace ) ) {\n\t\tmergedNamespace = [ ...mergedNamespace, ...namespace ];\n\t}\n\tif ( typeof namespace === 'string' ) {\n\t\tmergedNamespace = [ ...mergedNamespace, namespace ];\n\t}\n\n\t// @ts-expect-error We can't rely on inferred types here because of the\n\t// `as` prop polymorphism we're handling in https://github.com/WordPress/gutenberg/blob/4f3a11243c365f94892e479bff0b922ccc4ccda3/packages/components/src/context/wordpress-component.ts#L32-L33\n\treturn Object.assign( WrappedComponent, {\n\t\t[ CONNECT_STATIC_NAMESPACE ]: [ ...new Set( mergedNamespace ) ],\n\t\tdisplayName: namespace,\n\t\tselector: `.${ getStyledClassNameFromKey( namespace ) }`,\n\t} );\n}\n\n/**\n * Attempts to retrieve the connected namespace from a component.\n *\n * @param Component The component to retrieve a namespace from.\n * @return The connected namespaces.\n */\nexport function getConnectNamespace(\n\tComponent: ReactChild | undefined | {}\n): string[] {\n\tif ( ! Component ) {\n\t\treturn [];\n\t}\n\n\tlet namespaces = [];\n\n\t// @ts-ignore internal property\n\tif ( Component[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore internal property\n\t\tnamespaces = Component[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\t// @ts-ignore\n\tif ( Component.type && Component.type[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore\n\t\tnamespaces = Component.type[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\treturn namespaces;\n}\n\n/**\n * Checks to see if a component is connected within the Context system.\n *\n * @param Component The component to retrieve a namespace from.\n * @param match The namespace to check.\n */\nexport function hasConnectNamespace(\n\tComponent: ReactNode,\n\tmatch: string[] | string\n): boolean {\n\tif ( ! Component ) {\n\t\treturn false;\n\t}\n\n\tif ( typeof match === 'string' ) {\n\t\treturn getConnectNamespace( Component ).includes( match );\n\t}\n\tif ( Array.isArray( match ) ) {\n\t\treturn match.some( ( result ) =>\n\t\t\tgetConnectNamespace( Component ).includes( result )\n\t\t);\n\t}\n\n\treturn false;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_warning","_interopRequireDefault","_constants","_getStyledClassNameFromKey","contextConnect","Component","namespace","_contextConnect","forwardsRef","contextConnectWithoutRef","options","WrappedComponent","forwardRef","globalThis","SCRIPT_DEBUG","warn","mergedNamespace","CONNECT_STATIC_NAMESPACE","Array","isArray","Object","assign","Set","displayName","selector","getStyledClassNameFromKey","getConnectNamespace","namespaces","type","hasConnectNamespace","match","includes","some","result"],"sources":["@wordpress/components/src/context/context-connect.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, ReactChild, ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { CONNECT_STATIC_NAMESPACE } from './constants';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport type { WordPressComponentFromProps } from '.';\n\ntype AcceptsTwoArgs<\n\tF extends ( ...args: any ) => any,\n\tErrorMessage = never,\n> = Parameters< F >[ 'length' ] extends 2 ? {} : ErrorMessage;\n\ntype ContextConnectOptions = {\n\tforwardsRef?: boolean;\n};\n\n/**\n * Forwards ref (React.ForwardRef) and \"Connects\" (or registers) a component\n * within the Context system under a specified namespace.\n *\n * @param Component The component to register into the Context system.\n * @param namespace The namespace to register the component under.\n * @return The connected WordPressComponent\n */\nexport function contextConnect<\n\tC extends ( props: any, ref: ForwardedRef< any > ) => JSX.Element | null,\n>(\n\tComponent: C &\n\t\tAcceptsTwoArgs<\n\t\t\tC,\n\t\t\t'Warning: Your component function does not take a ref as the second argument. Did you mean to use `contextConnectWithoutRef`?'\n\t\t>,\n\tnamespace: string\n) {\n\treturn _contextConnect( Component, namespace, { forwardsRef: true } );\n}\n\n/**\n * \"Connects\" (or registers) a component within the Context system under a specified namespace.\n * Does not forward a ref.\n *\n * @param Component The component to register into the Context system.\n * @param namespace The namespace to register the component under.\n * @return The connected WordPressComponent\n */\nexport function contextConnectWithoutRef< P >(\n\tComponent: ( props: P ) => JSX.Element | null,\n\tnamespace: string\n) {\n\treturn _contextConnect( Component, namespace );\n}\n\n// This is an (experimental) evolution of the initial connect() HOC.\n// The hope is that we can improve render performance by removing functional\n// component wrappers.\nfunction _contextConnect<\n\tC extends ( props: any, ref: ForwardedRef< any > ) => JSX.Element | null,\n\tO extends ContextConnectOptions,\n>(\n\tComponent: C,\n\tnamespace: string,\n\toptions?: O\n): WordPressComponentFromProps<\n\tParameters< C >[ 0 ],\n\tO[ 'forwardsRef' ] extends true ? true : false\n> {\n\tconst WrappedComponent = options?.forwardsRef\n\t\t? forwardRef< any, Parameters< C >[ 0 ] >( Component )\n\t\t: Component;\n\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'contextConnect: Please provide a namespace' );\n\t}\n\n\t// @ts-expect-error internal property\n\tlet mergedNamespace = WrappedComponent[ CONNECT_STATIC_NAMESPACE ] || [\n\t\tnamespace,\n\t];\n\n\t/**\n\t * Consolidate (merge) namespaces before attaching it to the WrappedComponent.\n\t */\n\tif ( Array.isArray( namespace ) ) {\n\t\tmergedNamespace = [ ...mergedNamespace, ...namespace ];\n\t}\n\tif ( typeof namespace === 'string' ) {\n\t\tmergedNamespace = [ ...mergedNamespace, namespace ];\n\t}\n\n\t// @ts-expect-error We can't rely on inferred types here because of the\n\t// `as` prop polymorphism we're handling in https://github.com/WordPress/gutenberg/blob/4f3a11243c365f94892e479bff0b922ccc4ccda3/packages/components/src/context/wordpress-component.ts#L32-L33\n\treturn Object.assign( WrappedComponent, {\n\t\t[ CONNECT_STATIC_NAMESPACE ]: [ ...new Set( mergedNamespace ) ],\n\t\tdisplayName: namespace,\n\t\tselector: `.${ getStyledClassNameFromKey( namespace ) }`,\n\t} );\n}\n\n/**\n * Attempts to retrieve the connected namespace from a component.\n *\n * @param Component The component to retrieve a namespace from.\n * @return The connected namespaces.\n */\nexport function getConnectNamespace(\n\tComponent: ReactChild | undefined | {}\n): string[] {\n\tif ( ! Component ) {\n\t\treturn [];\n\t}\n\n\tlet namespaces = [];\n\n\t// @ts-ignore internal property\n\tif ( Component[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore internal property\n\t\tnamespaces = Component[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\t// @ts-ignore\n\tif ( Component.type && Component.type[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore\n\t\tnamespaces = Component.type[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\treturn namespaces;\n}\n\n/**\n * Checks to see if a component is connected within the Context system.\n *\n * @param Component The component to retrieve a namespace from.\n * @param match The namespace to check.\n */\nexport function hasConnectNamespace(\n\tComponent: ReactNode,\n\tmatch: string[] | string\n): boolean {\n\tif ( ! Component ) {\n\t\treturn false;\n\t}\n\n\tif ( typeof match === 'string' ) {\n\t\treturn getConnectNamespace( Component ).includes( match );\n\t}\n\tif ( Array.isArray( match ) ) {\n\t\treturn match.some( ( result ) =>\n\t\t\tgetConnectNamespace( Component ).includes( result )\n\t\t);\n\t}\n\n\treturn false;\n}\n"],"mappings":";;;;;;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,0BAAA,G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AAK,IAAAC,oDAAyB,EAAEnB,SAAU,CAAC;EACtD,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASoB,mBAAmBA,CAClCrB,SAAsC,EAC3B;EACX,IAAK,CAAEA,SAAS,EAAG;IAClB,OAAO,EAAE;EACV;EAEA,IAAIsB,UAAU,GAAG,EAAE;;EAEnB;EACA,IAAKtB,SAAS,CAAEY,mCAAwB,CAAE,EAAG;IAC5C;IACAU,UAAU,GAAGtB,SAAS,CAAEY,mCAAwB,CAAE;EACnD;;EAEA;EACA,IAAKZ,SAAS,CAACuB,IAAI,IAAIvB,SAAS,CAACuB,IAAI,CAAEX,mCAAwB,CAAE,EAAG;IACnE;IACAU,UAAU,GAAGtB,SAAS,CAACuB,IAAI,CAAEX,mCAAwB,CAAE;EACxD;EAEA,OAAOU,UAAU;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,mBAAmBA,CAClCxB,SAAoB,EACpByB,KAAwB,EACd;EACV,IAAK,CAAEzB,SAAS,EAAG;IAClB,OAAO,KAAK;EACb;EAEA,IAAK,OAAOyB,KAAK,KAAK,QAAQ,EAAG;IAChC,OAAOJ,mBAAmB,CAAErB,SAAU,CAAC,CAAC0B,QAAQ,CAAED,KAAM,CAAC;EAC1D;EACA,IAAKZ,KAAK,CAACC,OAAO,CAAEW,KAAM,CAAC,EAAG;IAC7B,OAAOA,KAAK,CAACE,IAAI,CAAIC,MAAM,IAC1BP,mBAAmB,CAAErB,SAAU,CAAC,CAAC0B,QAAQ,CAAEE,MAAO,CACnD,CAAC;EACF;EAEA,OAAO,KAAK;AACb","ignoreList":[]}
|
|
@@ -24,7 +24,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
24
24
|
* Internal dependencies
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
const ComponentsContext = exports.ComponentsContext = (0, _element.createContext)(
|
|
27
|
+
const ComponentsContext = exports.ComponentsContext = (0, _element.createContext)(/** @type {Record<string, any>} */{});
|
|
28
28
|
const useComponentsContext = () => (0, _element.useContext)(ComponentsContext);
|
|
29
29
|
|
|
30
30
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_deepmerge","_interopRequireDefault","require","_es","_isPlainObject","_element","_warning","_utils","_jsxRuntime","ComponentsContext","exports","createContext","useComponentsContext","useContext","useContextSystemBridge","value","parentContext","valueRef","useRef","useUpdateEffect","fastDeepEqual","current","globalThis","SCRIPT_DEBUG","warn","JSON","stringify","config","useMemo","deepmerge","isMergeableObject","isPlainObject","BaseContextSystemProvider","children","contextValue","jsx","Provider","ContextSystemProvider","memo"],"sources":["@wordpress/components/src/context/context-system-provider.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport fastDeepEqual from 'fast-deep-equal/es6';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseRef,\n\tuseMemo,\n\tmemo,\n} from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useUpdateEffect } from '../utils';\n\nexport const ComponentsContext = createContext(\n\t/** @type {Record<string, any>} */ ( {} )\n);\nexport const useComponentsContext = () => useContext( ComponentsContext );\n\n/**\n * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value.\n *\n * Note: This function will warn if it detects an un-memoized `value`\n *\n * @param {Object} props\n * @param {Record<string, any>} props.value\n * @return {Record<string, any>} The consolidated value.\n */\nfunction useContextSystemBridge( { value } ) {\n\tconst parentContext = useComponentsContext();\n\n\tconst valueRef = useRef( value );\n\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\t// Objects are equivalent.\n\t\t\tfastDeepEqual( valueRef.current, value ) &&\n\t\t\t// But not the same reference.\n\t\t\tvalueRef.current !== value\n\t\t) {\n\t\t\twarn( `Please memoize your context: ${ JSON.stringify( value ) }` );\n\t\t}\n\t}, [ value ] );\n\n\t// `parentContext` will always be memoized (i.e., the result of this hook itself)\n\t// or the default value from when the `ComponentsContext` was originally\n\t// initialized (which will never change, it's a static variable)\n\t// so this memoization will prevent `deepmerge()` from rerunning unless\n\t// the references to `value` change OR the `parentContext` has an actual material change\n\t// (because again, it's guaranteed to be memoized or a static reference to the empty object\n\t// so we know that the only changes for `parentContext` are material ones... i.e., why we\n\t// don't have to warn in the `useUpdateEffect` hook above for `parentContext` and we only\n\t// need to bother with the `value`). The `useUpdateEffect` above will ensure that we are\n\t// correctly warning when the `value` isn't being properly memoized. All of that to say\n\t// that this should be super safe to assume that `useMemo` will only run on actual\n\t// changes to the two dependencies, therefore saving us calls to `deepmerge()`!\n\tconst config = useMemo( () => {\n\t\t// Deep clone `parentContext` to avoid mutating it later.\n\t\treturn deepmerge( parentContext ?? {}, value ?? {}, {\n\t\t\tisMergeableObject: isPlainObject,\n\t\t} );\n\t}, [ parentContext, value ] );\n\n\treturn config;\n}\n\n/**\n * A Provider component that can modify props for connected components within\n * the Context system.\n *\n * @example\n * ```jsx\n * <ContextSystemProvider value={{ Button: { size: 'small' }}}>\n * <Button>...</Button>\n * </ContextSystemProvider>\n * ```\n *\n * @template {Record<string, any>} T\n * @param {Object} options\n * @param {import('react').ReactNode} options.children Children to render.\n * @param {T} options.value Props to render into connected components.\n * @return {JSX.Element} A Provider wrapped component.\n */\nconst BaseContextSystemProvider = ( { children, value } ) => {\n\tconst contextValue = useContextSystemBridge( { value } );\n\n\treturn (\n\t\t<ComponentsContext.Provider value={ contextValue }>\n\t\t\t{ children }\n\t\t</ComponentsContext.Provider>\n\t);\n};\n\nexport const ContextSystemProvider = memo( BaseContextSystemProvider );\n"],"mappings":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAOA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAA2C,IAAAM,WAAA,GAAAN,OAAA;AAtB3C;AACA;AACA;;AAKA;AACA;AACA;;AAUA;AACA;AACA;;AAGO,MAAMO,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAAE,sBAAa,
|
|
1
|
+
{"version":3,"names":["_deepmerge","_interopRequireDefault","require","_es","_isPlainObject","_element","_warning","_utils","_jsxRuntime","ComponentsContext","exports","createContext","useComponentsContext","useContext","useContextSystemBridge","value","parentContext","valueRef","useRef","useUpdateEffect","fastDeepEqual","current","globalThis","SCRIPT_DEBUG","warn","JSON","stringify","config","useMemo","deepmerge","isMergeableObject","isPlainObject","BaseContextSystemProvider","children","contextValue","jsx","Provider","ContextSystemProvider","memo"],"sources":["@wordpress/components/src/context/context-system-provider.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport fastDeepEqual from 'fast-deep-equal/es6';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseRef,\n\tuseMemo,\n\tmemo,\n} from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useUpdateEffect } from '../utils';\n\nexport const ComponentsContext = createContext(\n\t/** @type {Record<string, any>} */ ( {} )\n);\nexport const useComponentsContext = () => useContext( ComponentsContext );\n\n/**\n * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value.\n *\n * Note: This function will warn if it detects an un-memoized `value`\n *\n * @param {Object} props\n * @param {Record<string, any>} props.value\n * @return {Record<string, any>} The consolidated value.\n */\nfunction useContextSystemBridge( { value } ) {\n\tconst parentContext = useComponentsContext();\n\n\tconst valueRef = useRef( value );\n\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\t// Objects are equivalent.\n\t\t\tfastDeepEqual( valueRef.current, value ) &&\n\t\t\t// But not the same reference.\n\t\t\tvalueRef.current !== value\n\t\t) {\n\t\t\twarn( `Please memoize your context: ${ JSON.stringify( value ) }` );\n\t\t}\n\t}, [ value ] );\n\n\t// `parentContext` will always be memoized (i.e., the result of this hook itself)\n\t// or the default value from when the `ComponentsContext` was originally\n\t// initialized (which will never change, it's a static variable)\n\t// so this memoization will prevent `deepmerge()` from rerunning unless\n\t// the references to `value` change OR the `parentContext` has an actual material change\n\t// (because again, it's guaranteed to be memoized or a static reference to the empty object\n\t// so we know that the only changes for `parentContext` are material ones... i.e., why we\n\t// don't have to warn in the `useUpdateEffect` hook above for `parentContext` and we only\n\t// need to bother with the `value`). The `useUpdateEffect` above will ensure that we are\n\t// correctly warning when the `value` isn't being properly memoized. All of that to say\n\t// that this should be super safe to assume that `useMemo` will only run on actual\n\t// changes to the two dependencies, therefore saving us calls to `deepmerge()`!\n\tconst config = useMemo( () => {\n\t\t// Deep clone `parentContext` to avoid mutating it later.\n\t\treturn deepmerge( parentContext ?? {}, value ?? {}, {\n\t\t\tisMergeableObject: isPlainObject,\n\t\t} );\n\t}, [ parentContext, value ] );\n\n\treturn config;\n}\n\n/**\n * A Provider component that can modify props for connected components within\n * the Context system.\n *\n * @example\n * ```jsx\n * <ContextSystemProvider value={{ Button: { size: 'small' }}}>\n * <Button>...</Button>\n * </ContextSystemProvider>\n * ```\n *\n * @template {Record<string, any>} T\n * @param {Object} options\n * @param {import('react').ReactNode} options.children Children to render.\n * @param {T} options.value Props to render into connected components.\n * @return {JSX.Element} A Provider wrapped component.\n */\nconst BaseContextSystemProvider = ( { children, value } ) => {\n\tconst contextValue = useContextSystemBridge( { value } );\n\n\treturn (\n\t\t<ComponentsContext.Provider value={ contextValue }>\n\t\t\t{ children }\n\t\t</ComponentsContext.Provider>\n\t);\n};\n\nexport const ContextSystemProvider = memo( BaseContextSystemProvider );\n"],"mappings":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAF,sBAAA,CAAAC,OA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AAE;MACnDe,iBAAiB,EAAEC;IACpB,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEf,aAAa,EAAED,KAAK,CAAG,CAAC;EAE7B,OAAOY,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,yBAAyB,GAAGA,CAAE;EAAEC,QAAQ;EAAElB;AAAM,CAAC,KAAM;EAC5D,MAAMmB,YAAY,GAAGpB,sBAAsB,CAAE;IAAEC;EAAM,CAAE,CAAC;EAExD,oBACC,IAAAP,WAAA,CAAA2B,GAAA,EAAC1B,iBAAiB,CAAC2B,QAAQ;IAACrB,KAAK,EAAGmB,YAAc;IAAAD,QAAA,EAC/CA;EAAQ,CACiB,CAAC;AAE/B,CAAC;AAEM,MAAMI,qBAAqB,GAAA3B,OAAA,CAAA2B,qBAAA,GAAG,IAAAC,aAAI,EAAEN,yBAA0B,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_changeCase","require","_memize","_interopRequireDefault","getStyledClassName","namespace","kebab","kebabCase","getStyledClassNameFromKey","exports","memoize"],"sources":["@wordpress/components/src/context/get-styled-class-name-from-key.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { paramCase as kebabCase } from 'change-case';\nimport memoize from 'memize';\n\n/**\n * Generates the connected component CSS className based on the namespace.\n *\n * @param namespace The name of the connected component.\n * @return The generated CSS className.\n */\nfunction getStyledClassName( namespace: string ): string {\n\tconst kebab = kebabCase( namespace );\n\treturn `components-${ kebab }`;\n}\n\nexport const getStyledClassNameFromKey = memoize( getStyledClassName );\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,kBAAkBA,CAAEC,SAAiB,EAAW;EACxD,MAAMC,KAAK,GAAG,IAAAC,qBAAS,EAAEF,SAAU,CAAC;EACpC,
|
|
1
|
+
{"version":3,"names":["_changeCase","require","_memize","_interopRequireDefault","getStyledClassName","namespace","kebab","kebabCase","getStyledClassNameFromKey","exports","memoize"],"sources":["@wordpress/components/src/context/get-styled-class-name-from-key.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { paramCase as kebabCase } from 'change-case';\nimport memoize from 'memize';\n\n/**\n * Generates the connected component CSS className based on the namespace.\n *\n * @param namespace The name of the connected component.\n * @return The generated CSS className.\n */\nfunction getStyledClassName( namespace: string ): string {\n\tconst kebab = kebabCase( namespace );\n\treturn `components-${ kebab }`;\n}\n\nexport const getStyledClassNameFromKey = memoize( getStyledClassName );\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,kBAAkBA,CAAEC,SAAiB,EAAW;EACxD,MAAMC,KAAK,GAAG,IAAAC,qBAAS,EAAEF,SAAU,CAAC;EACpC,OAAO,cAAeC,KAAK,EAAG;AAC/B;AAEO,MAAME,yBAAyB,GAAAC,OAAA,CAAAD,yBAAA,GAAG,IAAAE,eAAO,EAAEN,kBAAmB,CAAC","ignoreList":[]}
|
|
@@ -43,7 +43,7 @@ function ControlPointButton({
|
|
|
43
43
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
44
44
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_button.default, {
|
|
45
45
|
"aria-label": (0, _i18n.sprintf)(
|
|
46
|
-
// translators:
|
|
46
|
+
// translators: 1: gradient position e.g: 70. 2: gradient color code e.g: rgb(52,121,151).
|
|
47
47
|
(0, _i18n.__)('Gradient control point at position %1$s%% with color code %2$s.'), position, color),
|
|
48
48
|
"aria-describedby": descriptionId,
|
|
49
49
|
"aria-haspopup": "true",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_colord","_compose","_element","_i18n","_icons","_button","_hStack","_colorPicker","_visuallyHidden","_colorPalette","_utils","_constants","_dropdownContentWrapper","_jsxRuntime","ControlPointButton","isOpen","position","color","additionalProps","instanceId","useInstanceId","descriptionId","jsxs","Fragment","children","jsx","default","sprintf","__","className","clsx","VisuallyHidden","id","GradientColorPickerDropdown","isRenderedInSidebar","props","popoverProps","useMemo","placement","offset","resize","mergedClassName","CustomColorPickerDropdown","ControlPoints","disableRemove","disableAlpha","gradientPickerDomRef","ignoreMarkerPosition","value","controlPoints","onChange","onStartControlPointChange","onStopControlPointChange","__experimentalIsRenderedInSidebar","controlPointMoveStateRef","useRef","onMouseMove","event","current","undefined","relativePosition","getHorizontalRelativeGradientPosition","clientX","initialPosition","index","significantMoveHappened","Math","abs","MINIMUM_SIGNIFICANT_MOVE","updateControlPointPosition","cleanEventListeners","window","removeEventListener","listenersActivated","cleanEventListenersRef","useEffect","map","point","onClose","renderToggle","onToggle","onClick","onMouseDown","addEventListener","onKeyDown","code","stopPropagation","clampPercent","KEYBOARD_CONTROL_POINT_VARIATION","renderContent","paddingSize","ColorPicker","enableAlpha","updateControlPointColor","colord","toRgbString","length","HStack","alignment","removeControlPoint","variant","style","left","transform","InsertPoint","onOpenInserter","onCloseInserter","insertPosition","alreadyInsertedPoint","setAlreadyInsertedPoint","useState","icon","plus","addControlPoint","updateControlPointColorByPosition","_default","exports"],"sources":["@wordpress/components/src/custom-gradient-picker/gradient-bar/control-points.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useRef, useState, useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { plus } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport { HStack } from '../../h-stack';\nimport { ColorPicker } from '../../color-picker';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport { CustomColorPickerDropdown } from '../../color-palette';\n\nimport {\n\taddControlPoint,\n\tclampPercent,\n\tremoveControlPoint,\n\tupdateControlPointColor,\n\tupdateControlPointColorByPosition,\n\tupdateControlPointPosition,\n\tgetHorizontalRelativeGradientPosition,\n} from './utils';\nimport {\n\tMINIMUM_SIGNIFICANT_MOVE,\n\tKEYBOARD_CONTROL_POINT_VARIATION,\n} from './constants';\nimport type { WordPressComponentProps } from '../../context';\nimport type {\n\tControlPointButtonProps,\n\tControlPointMoveState,\n\tControlPointsProps,\n\tInsertPointProps,\n} from '../types';\nimport type { CustomColorPickerDropdownProps } from '../../color-palette/types';\nimport DropdownContentWrapper from '../../dropdown/dropdown-content-wrapper';\n\nfunction ControlPointButton( {\n\tisOpen,\n\tposition,\n\tcolor,\n\t...additionalProps\n}: WordPressComponentProps< ControlPointButtonProps, 'button', true > ) {\n\tconst instanceId = useInstanceId( ControlPointButton );\n\tconst descriptionId = `components-custom-gradient-picker__control-point-button-description-${ instanceId }`;\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t// translators: %1$s: gradient position e.g: 70, %2$s: gradient color code e.g: rgb(52,121,151).\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Gradient control point at position %1$s%% with color code %2$s.'\n\t\t\t\t\t),\n\t\t\t\t\tposition,\n\t\t\t\t\tcolor\n\t\t\t\t) }\n\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\taria-haspopup=\"true\"\n\t\t\t\taria-expanded={ isOpen }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'components-custom-gradient-picker__control-point-button',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-active': isOpen,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\t{ ...additionalProps }\n\t\t\t/>\n\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t{ __(\n\t\t\t\t\t'Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.'\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n}\n\nfunction GradientColorPickerDropdown( {\n\tisRenderedInSidebar,\n\tclassName,\n\t...props\n}: CustomColorPickerDropdownProps ) {\n\t// Open the popover below the gradient control/insertion point\n\tconst popoverProps = useMemo(\n\t\t() =>\n\t\t\t( {\n\t\t\t\tplacement: 'bottom',\n\t\t\t\toffset: 8,\n\t\t\t\t// Disabling resize as it would otherwise cause the popover to show\n\t\t\t\t// scrollbars while dragging the color picker's handle close to the\n\t\t\t\t// popover edge.\n\t\t\t\tresize: false,\n\t\t\t} ) as const,\n\t\t[]\n\t);\n\n\tconst mergedClassName = clsx(\n\t\t'components-custom-gradient-picker__control-point-dropdown',\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<CustomColorPickerDropdown\n\t\t\tisRenderedInSidebar={ isRenderedInSidebar }\n\t\t\tpopoverProps={ popoverProps }\n\t\t\tclassName={ mergedClassName }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction ControlPoints( {\n\tdisableRemove,\n\tdisableAlpha,\n\tgradientPickerDomRef,\n\tignoreMarkerPosition,\n\tvalue: controlPoints,\n\tonChange,\n\tonStartControlPointChange,\n\tonStopControlPointChange,\n\t__experimentalIsRenderedInSidebar,\n}: ControlPointsProps ) {\n\tconst controlPointMoveStateRef = useRef< ControlPointMoveState >();\n\n\tconst onMouseMove = ( event: MouseEvent ) => {\n\t\tif (\n\t\t\tcontrolPointMoveStateRef.current === undefined ||\n\t\t\tgradientPickerDomRef.current === null\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst relativePosition = getHorizontalRelativeGradientPosition(\n\t\t\tevent.clientX,\n\t\t\tgradientPickerDomRef.current\n\t\t);\n\n\t\tconst { initialPosition, index, significantMoveHappened } =\n\t\t\tcontrolPointMoveStateRef.current;\n\n\t\tif (\n\t\t\t! significantMoveHappened &&\n\t\t\tMath.abs( initialPosition - relativePosition ) >=\n\t\t\t\tMINIMUM_SIGNIFICANT_MOVE\n\t\t) {\n\t\t\tcontrolPointMoveStateRef.current.significantMoveHappened = true;\n\t\t}\n\n\t\tonChange(\n\t\t\tupdateControlPointPosition( controlPoints, index, relativePosition )\n\t\t);\n\t};\n\n\tconst cleanEventListeners = () => {\n\t\tif (\n\t\t\twindow &&\n\t\t\twindow.removeEventListener &&\n\t\t\tcontrolPointMoveStateRef.current &&\n\t\t\tcontrolPointMoveStateRef.current.listenersActivated\n\t\t) {\n\t\t\twindow.removeEventListener( 'mousemove', onMouseMove );\n\t\t\twindow.removeEventListener( 'mouseup', cleanEventListeners );\n\t\t\tonStopControlPointChange();\n\t\t\tcontrolPointMoveStateRef.current.listenersActivated = false;\n\t\t}\n\t};\n\n\t// Adding `cleanEventListeners` to the dependency array below requires the function itself to be wrapped in a `useCallback`\n\t// This memoization would prevent the event listeners from being properly cleaned.\n\t// Instead, we'll pass a ref to the function in our `useEffect` so `cleanEventListeners` itself is no longer a dependency.\n\tconst cleanEventListenersRef = useRef< () => void >();\n\tcleanEventListenersRef.current = cleanEventListeners;\n\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tcleanEventListenersRef.current?.();\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<>\n\t\t\t{ controlPoints.map( ( point, index ) => {\n\t\t\t\tconst initialPosition = point?.position;\n\t\t\t\treturn (\n\t\t\t\t\tignoreMarkerPosition !== initialPosition && (\n\t\t\t\t\t\t<GradientColorPickerDropdown\n\t\t\t\t\t\t\tisRenderedInSidebar={\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tonClose={ onStopControlPointChange }\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t\t<ControlPointButton\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveStateRef.current &&\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveStateRef.current\n\t\t\t\t\t\t\t\t\t\t\t\t.significantMoveHappened\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t\t\t\t\t\t\tonStopControlPointChange();\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tonStartControlPointChange();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonToggle();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonMouseDown={ () => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\twindow &&\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveStateRef.current = {\n\t\t\t\t\t\t\t\t\t\t\t\tinitialPosition,\n\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\tsignificantMoveHappened: false,\n\t\t\t\t\t\t\t\t\t\t\t\tlistenersActivated: true,\n\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\tonStartControlPointChange();\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener(\n\t\t\t\t\t\t\t\t\t\t\t\t'mousemove',\n\t\t\t\t\t\t\t\t\t\t\t\tonMouseMove\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener(\n\t\t\t\t\t\t\t\t\t\t\t\t'mouseup',\n\t\t\t\t\t\t\t\t\t\t\t\tcleanEventListeners\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\t\tif ( event.code === 'ArrowLeft' ) {\n\t\t\t\t\t\t\t\t\t\t\t// Stop propagation of the key press event to avoid focus moving\n\t\t\t\t\t\t\t\t\t\t\t// to another editor area.\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointPosition(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tclampPercent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpoint.position -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tKEYBOARD_CONTROL_POINT_VARIATION\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t\tevent.code === 'ArrowRight'\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t// Stop propagation of the key press event to avoid focus moving\n\t\t\t\t\t\t\t\t\t\t\t// to another editor area.\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointPosition(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tclampPercent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpoint.position +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tKEYBOARD_CONTROL_POINT_VARIATION\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\t\t\tposition={ point.position }\n\t\t\t\t\t\t\t\t\tcolor={ point.color }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t\t\t\t\t<ColorPicker\n\t\t\t\t\t\t\t\t\t\tenableAlpha={ ! disableAlpha }\n\t\t\t\t\t\t\t\t\t\tcolor={ point.color }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( color ) => {\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointColor(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolord(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor\n\t\t\t\t\t\t\t\t\t\t\t\t\t).toRgbString()\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ ! disableRemove &&\n\t\t\t\t\t\t\t\t\t\tcontrolPoints.length > 2 && (\n\t\t\t\t\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-custom-gradient-picker__remove-control-point-wrapper\"\n\t\t\t\t\t\t\t\t\t\t\t\talignment=\"center\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveControlPoint(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Remove Control Point'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tleft: `${ point.position }%`,\n\t\t\t\t\t\t\t\ttransform: 'translateX( -50% )',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n\nfunction InsertPoint( {\n\tvalue: controlPoints,\n\tonChange,\n\tonOpenInserter,\n\tonCloseInserter,\n\tinsertPosition,\n\tdisableAlpha,\n\t__experimentalIsRenderedInSidebar,\n}: InsertPointProps ) {\n\tconst [ alreadyInsertedPoint, setAlreadyInsertedPoint ] = useState( false );\n\treturn (\n\t\t<GradientColorPickerDropdown\n\t\t\tisRenderedInSidebar={ __experimentalIsRenderedInSidebar }\n\t\t\tclassName=\"components-custom-gradient-picker__inserter\"\n\t\t\tonClose={ () => {\n\t\t\t\tonCloseInserter();\n\t\t\t} }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t\t\tonCloseInserter();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetAlreadyInsertedPoint( false );\n\t\t\t\t\t\t\tonOpenInserter();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonToggle();\n\t\t\t\t\t} }\n\t\t\t\t\tclassName=\"components-custom-gradient-picker__insert-point-dropdown\"\n\t\t\t\t\ticon={ plus }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ () => (\n\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t<ColorPicker\n\t\t\t\t\t\tenableAlpha={ ! disableAlpha }\n\t\t\t\t\t\tonChange={ ( color ) => {\n\t\t\t\t\t\t\tif ( ! alreadyInsertedPoint ) {\n\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\taddControlPoint(\n\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\tinsertPosition,\n\t\t\t\t\t\t\t\t\t\tcolord( color ).toRgbString()\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsetAlreadyInsertedPoint( true );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\tupdateControlPointColorByPosition(\n\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\tinsertPosition,\n\t\t\t\t\t\t\t\t\t\tcolord( color ).toRgbString()\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</DropdownContentWrapper>\n\t\t\t) }\n\t\t\tstyle={\n\t\t\t\tinsertPosition !== null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tleft: `${ insertPosition }%`,\n\t\t\t\t\t\t\ttransform: 'translateX( -50% )',\n\t\t\t\t\t }\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t/>\n\t);\n}\nControlPoints.InsertPoint = InsertPoint;\n\nexport default ControlPoints;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM,OAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AAEA,IAAAW,MAAA,GAAAX,OAAA;AASA,IAAAY,UAAA,GAAAZ,OAAA;AAYA,IAAAa,uBAAA,GAAAd,sBAAA,CAAAC,OAAA;AAA6E,IAAAc,WAAA,GAAAd,OAAA;AA5C7E;AACA;AACA;;AAIA;AACA;AACA;;AAMA;AACA;AACA;;AA8BA,SAASe,kBAAkBA,CAAE;EAC5BC,MAAM;EACNC,QAAQ;EACRC,KAAK;EACL,GAAGC;AACgE,CAAC,EAAG;EACvE,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEN,kBAAmB,CAAC;EACtD,MAAMO,aAAa,GAAI,uEAAuEF,UAAY,EAAC;EAC3G,oBACC,IAAAN,WAAA,CAAAS,IAAA,EAA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M;UACNG,uBAAuB,CAAE,KAAM,CAAC;UAChCJ,cAAc,CAAC,CAAC;QACjB;QACAzB,QAAQ,CAAC,CAAC;MACX,CAAG;MACHnD,SAAS,EAAC,0DAA0D;MACpEkF,IAAI,EAAGC;IAAM,CACb,CACC;IACHvB,aAAa,EAAGA,CAAA,kBACf,IAAA5E,WAAA,CAAAY,GAAA,EAACb,uBAAA,CAAAc,OAAsB;MAACgE,WAAW,EAAC,MAAM;MAAAlE,QAAA,eACzC,IAAAX,WAAA,CAAAY,GAAA,EAAClB,YAAA,CAAAoF,WAAW;QACXC,WAAW,EAAG,CAAE/C,YAAc;QAC9BK,QAAQ,EAAKjC,KAAK,IAAM;UACvB,IAAK,CAAE2F,oBAAoB,EAAG;YAC7B1D,QAAQ,CACP,IAAA+D,sBAAe,EACdhE,aAAa,EACb0D,cAAc,EACd,IAAAb,cAAM,EAAE7E,KAAM,CAAC,CAAC8E,WAAW,CAAC,CAC7B,CACD,CAAC;YACDc,uBAAuB,CAAE,IAAK,CAAC;UAChC,CAAC,MAAM;YACN3D,QAAQ,CACP,IAAAgE,wCAAiC,EAChCjE,aAAa,EACb0D,cAAc,EACd,IAAAb,cAAM,EAAE7E,KAAM,CAAC,CAAC8E,WAAW,CAAC,CAC7B,CACD,CAAC;UACF;QACD;MAAG,CACH;IAAC,CACqB,CACtB;IACHM,KAAK,EACJM,cAAc,KAAK,IAAI,GACpB;MACAL,IAAI,EAAG,GAAGK,cAAgB,GAAE;MAC5BJ,SAAS,EAAE;IACX,CAAC,GACD5C;EACH,CACD,CAAC;AAEJ;AACAhB,aAAa,CAAC6D,WAAW,GAAGA,WAAW;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAA1F,OAAA,GAEzBiB,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_colord","_compose","_element","_i18n","_icons","_button","_hStack","_colorPicker","_visuallyHidden","_colorPalette","_utils","_constants","_dropdownContentWrapper","_jsxRuntime","ControlPointButton","isOpen","position","color","additionalProps","instanceId","useInstanceId","descriptionId","jsxs","Fragment","children","jsx","default","sprintf","__","className","clsx","VisuallyHidden","id","GradientColorPickerDropdown","isRenderedInSidebar","props","popoverProps","useMemo","placement","offset","resize","mergedClassName","CustomColorPickerDropdown","ControlPoints","disableRemove","disableAlpha","gradientPickerDomRef","ignoreMarkerPosition","value","controlPoints","onChange","onStartControlPointChange","onStopControlPointChange","__experimentalIsRenderedInSidebar","controlPointMoveStateRef","useRef","onMouseMove","event","current","undefined","relativePosition","getHorizontalRelativeGradientPosition","clientX","initialPosition","index","significantMoveHappened","Math","abs","MINIMUM_SIGNIFICANT_MOVE","updateControlPointPosition","cleanEventListeners","window","removeEventListener","listenersActivated","cleanEventListenersRef","useEffect","map","point","onClose","renderToggle","onToggle","onClick","onMouseDown","addEventListener","onKeyDown","code","stopPropagation","clampPercent","KEYBOARD_CONTROL_POINT_VARIATION","renderContent","paddingSize","ColorPicker","enableAlpha","updateControlPointColor","colord","toRgbString","length","HStack","alignment","removeControlPoint","variant","style","left","transform","InsertPoint","onOpenInserter","onCloseInserter","insertPosition","alreadyInsertedPoint","setAlreadyInsertedPoint","useState","icon","plus","addControlPoint","updateControlPointColorByPosition","_default","exports"],"sources":["@wordpress/components/src/custom-gradient-picker/gradient-bar/control-points.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useRef, useState, useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { plus } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport { HStack } from '../../h-stack';\nimport { ColorPicker } from '../../color-picker';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport { CustomColorPickerDropdown } from '../../color-palette';\n\nimport {\n\taddControlPoint,\n\tclampPercent,\n\tremoveControlPoint,\n\tupdateControlPointColor,\n\tupdateControlPointColorByPosition,\n\tupdateControlPointPosition,\n\tgetHorizontalRelativeGradientPosition,\n} from './utils';\nimport {\n\tMINIMUM_SIGNIFICANT_MOVE,\n\tKEYBOARD_CONTROL_POINT_VARIATION,\n} from './constants';\nimport type { WordPressComponentProps } from '../../context';\nimport type {\n\tControlPointButtonProps,\n\tControlPointMoveState,\n\tControlPointsProps,\n\tInsertPointProps,\n} from '../types';\nimport type { CustomColorPickerDropdownProps } from '../../color-palette/types';\nimport DropdownContentWrapper from '../../dropdown/dropdown-content-wrapper';\n\nfunction ControlPointButton( {\n\tisOpen,\n\tposition,\n\tcolor,\n\t...additionalProps\n}: WordPressComponentProps< ControlPointButtonProps, 'button', true > ) {\n\tconst instanceId = useInstanceId( ControlPointButton );\n\tconst descriptionId = `components-custom-gradient-picker__control-point-button-description-${ instanceId }`;\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t// translators: 1: gradient position e.g: 70. 2: gradient color code e.g: rgb(52,121,151).\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Gradient control point at position %1$s%% with color code %2$s.'\n\t\t\t\t\t),\n\t\t\t\t\tposition,\n\t\t\t\t\tcolor\n\t\t\t\t) }\n\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\taria-haspopup=\"true\"\n\t\t\t\taria-expanded={ isOpen }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'components-custom-gradient-picker__control-point-button',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-active': isOpen,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\t{ ...additionalProps }\n\t\t\t/>\n\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t{ __(\n\t\t\t\t\t'Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.'\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n}\n\nfunction GradientColorPickerDropdown( {\n\tisRenderedInSidebar,\n\tclassName,\n\t...props\n}: CustomColorPickerDropdownProps ) {\n\t// Open the popover below the gradient control/insertion point\n\tconst popoverProps = useMemo(\n\t\t() =>\n\t\t\t( {\n\t\t\t\tplacement: 'bottom',\n\t\t\t\toffset: 8,\n\t\t\t\t// Disabling resize as it would otherwise cause the popover to show\n\t\t\t\t// scrollbars while dragging the color picker's handle close to the\n\t\t\t\t// popover edge.\n\t\t\t\tresize: false,\n\t\t\t} ) as const,\n\t\t[]\n\t);\n\n\tconst mergedClassName = clsx(\n\t\t'components-custom-gradient-picker__control-point-dropdown',\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<CustomColorPickerDropdown\n\t\t\tisRenderedInSidebar={ isRenderedInSidebar }\n\t\t\tpopoverProps={ popoverProps }\n\t\t\tclassName={ mergedClassName }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction ControlPoints( {\n\tdisableRemove,\n\tdisableAlpha,\n\tgradientPickerDomRef,\n\tignoreMarkerPosition,\n\tvalue: controlPoints,\n\tonChange,\n\tonStartControlPointChange,\n\tonStopControlPointChange,\n\t__experimentalIsRenderedInSidebar,\n}: ControlPointsProps ) {\n\tconst controlPointMoveStateRef = useRef< ControlPointMoveState >();\n\n\tconst onMouseMove = ( event: MouseEvent ) => {\n\t\tif (\n\t\t\tcontrolPointMoveStateRef.current === undefined ||\n\t\t\tgradientPickerDomRef.current === null\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst relativePosition = getHorizontalRelativeGradientPosition(\n\t\t\tevent.clientX,\n\t\t\tgradientPickerDomRef.current\n\t\t);\n\n\t\tconst { initialPosition, index, significantMoveHappened } =\n\t\t\tcontrolPointMoveStateRef.current;\n\n\t\tif (\n\t\t\t! significantMoveHappened &&\n\t\t\tMath.abs( initialPosition - relativePosition ) >=\n\t\t\t\tMINIMUM_SIGNIFICANT_MOVE\n\t\t) {\n\t\t\tcontrolPointMoveStateRef.current.significantMoveHappened = true;\n\t\t}\n\n\t\tonChange(\n\t\t\tupdateControlPointPosition( controlPoints, index, relativePosition )\n\t\t);\n\t};\n\n\tconst cleanEventListeners = () => {\n\t\tif (\n\t\t\twindow &&\n\t\t\twindow.removeEventListener &&\n\t\t\tcontrolPointMoveStateRef.current &&\n\t\t\tcontrolPointMoveStateRef.current.listenersActivated\n\t\t) {\n\t\t\twindow.removeEventListener( 'mousemove', onMouseMove );\n\t\t\twindow.removeEventListener( 'mouseup', cleanEventListeners );\n\t\t\tonStopControlPointChange();\n\t\t\tcontrolPointMoveStateRef.current.listenersActivated = false;\n\t\t}\n\t};\n\n\t// Adding `cleanEventListeners` to the dependency array below requires the function itself to be wrapped in a `useCallback`\n\t// This memoization would prevent the event listeners from being properly cleaned.\n\t// Instead, we'll pass a ref to the function in our `useEffect` so `cleanEventListeners` itself is no longer a dependency.\n\tconst cleanEventListenersRef = useRef< () => void >();\n\tcleanEventListenersRef.current = cleanEventListeners;\n\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tcleanEventListenersRef.current?.();\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<>\n\t\t\t{ controlPoints.map( ( point, index ) => {\n\t\t\t\tconst initialPosition = point?.position;\n\t\t\t\treturn (\n\t\t\t\t\tignoreMarkerPosition !== initialPosition && (\n\t\t\t\t\t\t<GradientColorPickerDropdown\n\t\t\t\t\t\t\tisRenderedInSidebar={\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tonClose={ onStopControlPointChange }\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t\t<ControlPointButton\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveStateRef.current &&\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveStateRef.current\n\t\t\t\t\t\t\t\t\t\t\t\t.significantMoveHappened\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t\t\t\t\t\t\tonStopControlPointChange();\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tonStartControlPointChange();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonToggle();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonMouseDown={ () => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\twindow &&\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveStateRef.current = {\n\t\t\t\t\t\t\t\t\t\t\t\tinitialPosition,\n\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\tsignificantMoveHappened: false,\n\t\t\t\t\t\t\t\t\t\t\t\tlistenersActivated: true,\n\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\tonStartControlPointChange();\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener(\n\t\t\t\t\t\t\t\t\t\t\t\t'mousemove',\n\t\t\t\t\t\t\t\t\t\t\t\tonMouseMove\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener(\n\t\t\t\t\t\t\t\t\t\t\t\t'mouseup',\n\t\t\t\t\t\t\t\t\t\t\t\tcleanEventListeners\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\t\tif ( event.code === 'ArrowLeft' ) {\n\t\t\t\t\t\t\t\t\t\t\t// Stop propagation of the key press event to avoid focus moving\n\t\t\t\t\t\t\t\t\t\t\t// to another editor area.\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointPosition(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tclampPercent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpoint.position -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tKEYBOARD_CONTROL_POINT_VARIATION\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t\tevent.code === 'ArrowRight'\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t// Stop propagation of the key press event to avoid focus moving\n\t\t\t\t\t\t\t\t\t\t\t// to another editor area.\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointPosition(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tclampPercent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpoint.position +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tKEYBOARD_CONTROL_POINT_VARIATION\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\t\t\tposition={ point.position }\n\t\t\t\t\t\t\t\t\tcolor={ point.color }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t\t\t\t\t<ColorPicker\n\t\t\t\t\t\t\t\t\t\tenableAlpha={ ! disableAlpha }\n\t\t\t\t\t\t\t\t\t\tcolor={ point.color }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( color ) => {\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointColor(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolord(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor\n\t\t\t\t\t\t\t\t\t\t\t\t\t).toRgbString()\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ ! disableRemove &&\n\t\t\t\t\t\t\t\t\t\tcontrolPoints.length > 2 && (\n\t\t\t\t\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-custom-gradient-picker__remove-control-point-wrapper\"\n\t\t\t\t\t\t\t\t\t\t\t\talignment=\"center\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveControlPoint(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Remove Control Point'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tleft: `${ point.position }%`,\n\t\t\t\t\t\t\t\ttransform: 'translateX( -50% )',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n\nfunction InsertPoint( {\n\tvalue: controlPoints,\n\tonChange,\n\tonOpenInserter,\n\tonCloseInserter,\n\tinsertPosition,\n\tdisableAlpha,\n\t__experimentalIsRenderedInSidebar,\n}: InsertPointProps ) {\n\tconst [ alreadyInsertedPoint, setAlreadyInsertedPoint ] = useState( false );\n\treturn (\n\t\t<GradientColorPickerDropdown\n\t\t\tisRenderedInSidebar={ __experimentalIsRenderedInSidebar }\n\t\t\tclassName=\"components-custom-gradient-picker__inserter\"\n\t\t\tonClose={ () => {\n\t\t\t\tonCloseInserter();\n\t\t\t} }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t\t\tonCloseInserter();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetAlreadyInsertedPoint( false );\n\t\t\t\t\t\t\tonOpenInserter();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonToggle();\n\t\t\t\t\t} }\n\t\t\t\t\tclassName=\"components-custom-gradient-picker__insert-point-dropdown\"\n\t\t\t\t\ticon={ plus }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ () => (\n\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t<ColorPicker\n\t\t\t\t\t\tenableAlpha={ ! disableAlpha }\n\t\t\t\t\t\tonChange={ ( color ) => {\n\t\t\t\t\t\t\tif ( ! alreadyInsertedPoint ) {\n\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\taddControlPoint(\n\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\tinsertPosition,\n\t\t\t\t\t\t\t\t\t\tcolord( color ).toRgbString()\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsetAlreadyInsertedPoint( true );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\tupdateControlPointColorByPosition(\n\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\tinsertPosition,\n\t\t\t\t\t\t\t\t\t\tcolord( color ).toRgbString()\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</DropdownContentWrapper>\n\t\t\t) }\n\t\t\tstyle={\n\t\t\t\tinsertPosition !== null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tleft: `${ insertPosition }%`,\n\t\t\t\t\t\t\ttransform: 'translateX( -50% )',\n\t\t\t\t\t }\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t/>\n\t);\n}\nControlPoints.InsertPoint = InsertPoint;\n\nexport default ControlPoints;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM,OAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AAEA,IAAAW,MAAA,GAAAX,OAAA;AASA,IAAAY,UAAA,GAAAZ,OAAA;AAYA,IAAAa,uBAAA,GAAAd,sBAAA,CAAAC,OAAA;AAA6E,IAAAc,WAAA,GAAAd,OAAA;AA5C7E;AACA;AACA;;AAIA;AACA;AACA;;AAMA;AACA;AACA;;AA8BA,SAASe,kBAAkBA,CAAE;EAC5BC,MAAM;EACNC,QAAQ;EACRC,KAAK;EACL,GAAGC;AACgE,CAAC,EAAG;EACvE,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEN,kBAAmB,CAAC;EACtD,MAAMO,aAAa,GAAG,uEAAwEF,UAAU,EAAG;EAC3G,oBACC,IAAAN,WAAA,CAAAS,IAAA,EAAAT,WAAA,CAAAU,QAAA;IAAAC,QAAA,gBACC,IAAAX,WAAA,CAAAY,GAAA,EAACpB,OAAA,CAAAqB,OAAM;MACN,cAAa,IAAAC,aAAO;MACnB;MACA,IAAAC,QAAE,EACD,iEACD,CAAC,EACDZ,QA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IACHvB,aAAa,EAAGA,CAAA,kBACf,IAAA5E,WAAA,CAAAY,GAAA,EAACb,uBAAA,CAAAc,OAAsB;MAACgE,WAAW,EAAC,MAAM;MAAAlE,QAAA,eACzC,IAAAX,WAAA,CAAAY,GAAA,EAAClB,YAAA,CAAAoF,WAAW;QACXC,WAAW,EAAG,CAAE/C,YAAc;QAC9BK,QAAQ,EAAKjC,KAAK,IAAM;UACvB,IAAK,CAAE2F,oBAAoB,EAAG;YAC7B1D,QAAQ,CACP,IAAA+D,sBAAe,EACdhE,aAAa,EACb0D,cAAc,EACd,IAAAb,cAAM,EAAE7E,KAAM,CAAC,CAAC8E,WAAW,CAAC,CAC7B,CACD,CAAC;YACDc,uBAAuB,CAAE,IAAK,CAAC;UAChC,CAAC,MAAM;YACN3D,QAAQ,CACP,IAAAgE,wCAAiC,EAChCjE,aAAa,EACb0D,cAAc,EACd,IAAAb,cAAM,EAAE7E,KAAM,CAAC,CAAC8E,WAAW,CAAC,CAC7B,CACD,CAAC;UACF;QACD;MAAG,CACH;IAAC,CACqB,CACtB;IACHM,KAAK,EACJM,cAAc,KAAK,IAAI,GACpB;MACAL,IAAI,EAAE,GAAIK,cAAc,GAAI;MAC5BJ,SAAS,EAAE;IACX,CAAC,GACD5C;EACH,CACD,CAAC;AAEJ;AACAhB,aAAa,CAAC6D,WAAW,GAAGA,WAAW;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAA1F,OAAA,GAEzBiB,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_anglePickerControl","_interopRequireDefault","_gradientBar","_flex","_selectControl","_vStack","_utils","_serializer","_constants","_customGradientPickerStyles","_jsxRuntime","GradientAnglePicker","gradientAST","hasGradient","onChange","_gradientAST$orientat","angle","orientation","value","DEFAULT_LINEAR_GRADIENT_ANGLE","onAngleChange","newAngle","serializeGradient","type","jsx","default","GradientTypePicker","onSetLinearGradient","undefined","HORIZONTAL_GRADIENT_ORIENTATION","onSetRadialGradient","restGradientAST","handleOnChange","next","__nextHasNoMarginBottom","className","label","__","labelPosition","options","GRADIENT_OPTIONS","size","CustomGradientPicker","__experimentalIsRenderedInSidebar","getGradientAstWithDefault","background","getLinearGradientRepresentation","controlPoints","colorStops","map","colorStop","color","getStopCssColor","position","parseInt","length","jsxs","VStack","spacing","children","newControlPoints","getGradientAstWithControlPoints","Flex","gap","SelectWrapper","AccessoryWrapper","_default","exports"],"sources":["@wordpress/components/src/custom-gradient-picker/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { type LinearGradientNode } from 'gradient-parser';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport AnglePickerControl from '../angle-picker-control';\nimport CustomGradientBar from './gradient-bar';\nimport { Flex } from '../flex';\nimport SelectControl from '../select-control';\nimport { VStack } from '../v-stack';\nimport {\n\tgetGradientAstWithDefault,\n\tgetLinearGradientRepresentation,\n\tgetGradientAstWithControlPoints,\n\tgetStopCssColor,\n} from './utils';\nimport { serializeGradient } from './serializer';\nimport {\n\tDEFAULT_LINEAR_GRADIENT_ANGLE,\n\tHORIZONTAL_GRADIENT_ORIENTATION,\n\tGRADIENT_OPTIONS,\n} from './constants';\nimport {\n\tAccessoryWrapper,\n\tSelectWrapper,\n} from './styles/custom-gradient-picker-styles';\nimport type {\n\tCustomGradientPickerProps,\n\tGradientAnglePickerProps,\n\tGradientTypePickerProps,\n} from './types';\n\nconst GradientAnglePicker = ( {\n\tgradientAST,\n\thasGradient,\n\tonChange,\n}: GradientAnglePickerProps ) => {\n\tconst angle =\n\t\tgradientAST?.orientation?.value ?? DEFAULT_LINEAR_GRADIENT_ANGLE;\n\tconst onAngleChange = ( newAngle: number ) => {\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...gradientAST,\n\t\t\t\torientation: {\n\t\t\t\t\ttype: 'angular',\n\t\t\t\t\tvalue: `${ newAngle }`,\n\t\t\t\t},\n\t\t\t} )\n\t\t);\n\t};\n\treturn (\n\t\t<AnglePickerControl\n\t\t\tonChange={ onAngleChange }\n\t\t\tvalue={ hasGradient ? angle : '' }\n\t\t/>\n\t);\n};\n\nconst GradientTypePicker = ( {\n\tgradientAST,\n\thasGradient,\n\tonChange,\n}: GradientTypePickerProps ) => {\n\tconst { type } = gradientAST;\n\n\tconst onSetLinearGradient = () => {\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...gradientAST,\n\t\t\t\torientation: gradientAST.orientation\n\t\t\t\t\t? undefined\n\t\t\t\t\t: HORIZONTAL_GRADIENT_ORIENTATION,\n\t\t\t\ttype: 'linear-gradient',\n\t\t\t} satisfies LinearGradientNode )\n\t\t);\n\t};\n\n\tconst onSetRadialGradient = () => {\n\t\tconst { orientation, ...restGradientAST } = gradientAST;\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...restGradientAST,\n\t\t\t\ttype: 'radial-gradient',\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst handleOnChange = ( next: string ) => {\n\t\tif ( next === 'linear-gradient' ) {\n\t\t\tonSetLinearGradient();\n\t\t}\n\t\tif ( next === 'radial-gradient' ) {\n\t\t\tonSetRadialGradient();\n\t\t}\n\t};\n\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"components-custom-gradient-picker__type-picker\"\n\t\t\tlabel={ __( 'Type' ) }\n\t\t\tlabelPosition=\"top\"\n\t\t\tonChange={ handleOnChange }\n\t\t\toptions={ GRADIENT_OPTIONS }\n\t\t\tsize=\"__unstable-large\"\n\t\t\tvalue={ hasGradient ? type : undefined }\n\t\t/>\n\t);\n};\n\n/**\n * CustomGradientPicker is a React component that renders a UI for specifying\n * linear or radial gradients. Radial gradients are displayed in the picker as\n * a slice of the gradient from the center to the outside.\n *\n * ```jsx\n * import { CustomGradientPicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyCustomGradientPicker = () => {\n * const [ gradient, setGradient ] = useState();\n *\n * return (\n * <CustomGradientPicker\n *\t\t\tvalue={ gradient }\n *\t\t\tonChange={ setGradient }\n * />\n * );\n * };\n * ```\n */\nexport function CustomGradientPicker( {\n\tvalue,\n\tonChange,\n\t__experimentalIsRenderedInSidebar = false,\n}: CustomGradientPickerProps ) {\n\tconst { gradientAST, hasGradient } = getGradientAstWithDefault( value );\n\n\t// On radial gradients the bar should display a linear gradient.\n\t// On radial gradients the bar represents a slice of the gradient from the center until the outside.\n\t// On liner gradients the bar represents the color stops from left to right independently of the angle.\n\tconst background = getLinearGradientRepresentation( gradientAST );\n\n\t// Control points color option may be hex from presets, custom colors will be rgb.\n\t// The position should always be a percentage.\n\tconst controlPoints = gradientAST.colorStops.map( ( colorStop ) => {\n\t\treturn {\n\t\t\tcolor: getStopCssColor( colorStop ),\n\t\t\t// Although it's already been checked by `hasUnsupportedLength` in `getGradientAstWithDefault`,\n\t\t\t// TypeScript doesn't know that `colorStop.length` is not undefined here.\n\t\t\t// @ts-expect-error\n\t\t\tposition: parseInt( colorStop.length.value ),\n\t\t};\n\t} );\n\n\treturn (\n\t\t<VStack spacing={ 4 } className=\"components-custom-gradient-picker\">\n\t\t\t<CustomGradientBar\n\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t}\n\t\t\t\tbackground={ background }\n\t\t\t\thasGradient={ hasGradient }\n\t\t\t\tvalue={ controlPoints }\n\t\t\t\tonChange={ ( newControlPoints ) => {\n\t\t\t\t\tonChange(\n\t\t\t\t\t\tserializeGradient(\n\t\t\t\t\t\t\tgetGradientAstWithControlPoints(\n\t\t\t\t\t\t\t\tgradientAST,\n\t\t\t\t\t\t\t\tnewControlPoints\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<Flex\n\t\t\t\tgap={ 3 }\n\t\t\t\tclassName=\"components-custom-gradient-picker__ui-line\"\n\t\t\t>\n\t\t\t\t<SelectWrapper>\n\t\t\t\t\t<GradientTypePicker\n\t\t\t\t\t\tgradientAST={ gradientAST }\n\t\t\t\t\t\thasGradient={ hasGradient }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t</SelectWrapper>\n\t\t\t\t<AccessoryWrapper>\n\t\t\t\t\t{ gradientAST.type === 'linear-gradient' && (\n\t\t\t\t\t\t<GradientAnglePicker\n\t\t\t\t\t\t\tgradientAST={ gradientAST }\n\t\t\t\t\t\t\thasGradient={ hasGradient }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</AccessoryWrapper>\n\t\t\t</Flex>\n\t\t</VStack>\n\t);\n}\n\nexport default CustomGradientPicker;\n"],"mappings":";;;;;;;;AAQA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAMA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAKA,IAAAU,2BAAA,GAAAV,OAAA;AAGgD,IAAAW,WAAA,GAAAX,OAAA;AAjChD;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AA4BA,MAAMY,mBAAmB,GAAGA,CAAE;EAC7BC,WAAW;EACXC,WAAW;EACXC;AACyB,CAAC,KAAM;EAAA,IAAAC,qBAAA;EAChC,MAAMC,KAAK,IAAAD,qBAAA,GACVH,WAAW,EAAEK,WAAW,EAAEC,KAAK,cAAAH,qBAAA,cAAAA,qBAAA,GAAII,wCAA6B;EACjE,MAAMC,aAAa,GAA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;QAClC9C,QAAQ,CACP,IAAAQ,6BAAiB,EAChB,IAAAuC,sCAA+B,EAC9BjD,WAAW,EACXgD,gBACD,CACD,CACD,CAAC;MACF;IAAG,CACH,CAAC,eACF,IAAAlD,WAAA,CAAA8C,IAAA,EAACrD,KAAA,CAAA2D,IAAI;MACJC,GAAG,EAAG,CAAG;MACT5B,SAAS,EAAC,4CAA4C;MAAAwB,QAAA,gBAEtD,IAAAjD,WAAA,CAAAc,GAAA,EAACf,2BAAA,CAAAuD,aAAa;QAAAL,QAAA,eACb,IAAAjD,WAAA,CAAAc,GAAA,EAACE,kBAAkB;UAClBd,WAAW,EAAGA,WAAa;UAC3BC,WAAW,EAAGA,WAAa;UAC3BC,QAAQ,EAAGA;QAAU,CACrB;MAAC,CACY,CAAC,eAChB,IAAAJ,WAAA,CAAAc,GAAA,EAACf,2BAAA,CAAAwD,gBAAgB;QAAAN,QAAA,EACd/C,WAAW,CAACW,IAAI,KAAK,iBAAiB,iBACvC,IAAAb,WAAA,CAAAc,GAAA,EAACb,mBAAmB;UACnBC,WAAW,EAAGA,WAAa;UAC3BC,WAAW,EAAGA,WAAa;UAC3BC,QAAQ,EAAGA;QAAU,CACrB;MACD,CACgB,CAAC;IAAA,CACd,CAAC;EAAA,CACA,CAAC;AAEX;AAAC,IAAAoD,QAAA,GAAAC,OAAA,CAAA1C,OAAA,GAEciB,oBAAoB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_anglePickerControl","_interopRequireDefault","_gradientBar","_flex","_selectControl","_vStack","_utils","_serializer","_constants","_customGradientPickerStyles","_jsxRuntime","GradientAnglePicker","gradientAST","hasGradient","onChange","_gradientAST$orientat","angle","orientation","value","DEFAULT_LINEAR_GRADIENT_ANGLE","onAngleChange","newAngle","serializeGradient","type","jsx","default","GradientTypePicker","onSetLinearGradient","undefined","HORIZONTAL_GRADIENT_ORIENTATION","onSetRadialGradient","restGradientAST","handleOnChange","next","__nextHasNoMarginBottom","className","label","__","labelPosition","options","GRADIENT_OPTIONS","size","CustomGradientPicker","__experimentalIsRenderedInSidebar","getGradientAstWithDefault","background","getLinearGradientRepresentation","controlPoints","colorStops","map","colorStop","color","getStopCssColor","position","parseInt","length","jsxs","VStack","spacing","children","newControlPoints","getGradientAstWithControlPoints","Flex","gap","SelectWrapper","AccessoryWrapper","_default","exports"],"sources":["@wordpress/components/src/custom-gradient-picker/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { type LinearGradientNode } from 'gradient-parser';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport AnglePickerControl from '../angle-picker-control';\nimport CustomGradientBar from './gradient-bar';\nimport { Flex } from '../flex';\nimport SelectControl from '../select-control';\nimport { VStack } from '../v-stack';\nimport {\n\tgetGradientAstWithDefault,\n\tgetLinearGradientRepresentation,\n\tgetGradientAstWithControlPoints,\n\tgetStopCssColor,\n} from './utils';\nimport { serializeGradient } from './serializer';\nimport {\n\tDEFAULT_LINEAR_GRADIENT_ANGLE,\n\tHORIZONTAL_GRADIENT_ORIENTATION,\n\tGRADIENT_OPTIONS,\n} from './constants';\nimport {\n\tAccessoryWrapper,\n\tSelectWrapper,\n} from './styles/custom-gradient-picker-styles';\nimport type {\n\tCustomGradientPickerProps,\n\tGradientAnglePickerProps,\n\tGradientTypePickerProps,\n} from './types';\n\nconst GradientAnglePicker = ( {\n\tgradientAST,\n\thasGradient,\n\tonChange,\n}: GradientAnglePickerProps ) => {\n\tconst angle =\n\t\tgradientAST?.orientation?.value ?? DEFAULT_LINEAR_GRADIENT_ANGLE;\n\tconst onAngleChange = ( newAngle: number ) => {\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...gradientAST,\n\t\t\t\torientation: {\n\t\t\t\t\ttype: 'angular',\n\t\t\t\t\tvalue: `${ newAngle }`,\n\t\t\t\t},\n\t\t\t} )\n\t\t);\n\t};\n\treturn (\n\t\t<AnglePickerControl\n\t\t\tonChange={ onAngleChange }\n\t\t\tvalue={ hasGradient ? angle : '' }\n\t\t/>\n\t);\n};\n\nconst GradientTypePicker = ( {\n\tgradientAST,\n\thasGradient,\n\tonChange,\n}: GradientTypePickerProps ) => {\n\tconst { type } = gradientAST;\n\n\tconst onSetLinearGradient = () => {\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...gradientAST,\n\t\t\t\torientation: gradientAST.orientation\n\t\t\t\t\t? undefined\n\t\t\t\t\t: HORIZONTAL_GRADIENT_ORIENTATION,\n\t\t\t\ttype: 'linear-gradient',\n\t\t\t} satisfies LinearGradientNode )\n\t\t);\n\t};\n\n\tconst onSetRadialGradient = () => {\n\t\tconst { orientation, ...restGradientAST } = gradientAST;\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...restGradientAST,\n\t\t\t\ttype: 'radial-gradient',\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst handleOnChange = ( next: string ) => {\n\t\tif ( next === 'linear-gradient' ) {\n\t\t\tonSetLinearGradient();\n\t\t}\n\t\tif ( next === 'radial-gradient' ) {\n\t\t\tonSetRadialGradient();\n\t\t}\n\t};\n\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"components-custom-gradient-picker__type-picker\"\n\t\t\tlabel={ __( 'Type' ) }\n\t\t\tlabelPosition=\"top\"\n\t\t\tonChange={ handleOnChange }\n\t\t\toptions={ GRADIENT_OPTIONS }\n\t\t\tsize=\"__unstable-large\"\n\t\t\tvalue={ hasGradient ? type : undefined }\n\t\t/>\n\t);\n};\n\n/**\n * CustomGradientPicker is a React component that renders a UI for specifying\n * linear or radial gradients. Radial gradients are displayed in the picker as\n * a slice of the gradient from the center to the outside.\n *\n * ```jsx\n * import { CustomGradientPicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyCustomGradientPicker = () => {\n * const [ gradient, setGradient ] = useState();\n *\n * return (\n * <CustomGradientPicker\n *\t\t\tvalue={ gradient }\n *\t\t\tonChange={ setGradient }\n * />\n * );\n * };\n * ```\n */\nexport function CustomGradientPicker( {\n\tvalue,\n\tonChange,\n\t__experimentalIsRenderedInSidebar = false,\n}: CustomGradientPickerProps ) {\n\tconst { gradientAST, hasGradient } = getGradientAstWithDefault( value );\n\n\t// On radial gradients the bar should display a linear gradient.\n\t// On radial gradients the bar represents a slice of the gradient from the center until the outside.\n\t// On liner gradients the bar represents the color stops from left to right independently of the angle.\n\tconst background = getLinearGradientRepresentation( gradientAST );\n\n\t// Control points color option may be hex from presets, custom colors will be rgb.\n\t// The position should always be a percentage.\n\tconst controlPoints = gradientAST.colorStops.map( ( colorStop ) => {\n\t\treturn {\n\t\t\tcolor: getStopCssColor( colorStop ),\n\t\t\t// Although it's already been checked by `hasUnsupportedLength` in `getGradientAstWithDefault`,\n\t\t\t// TypeScript doesn't know that `colorStop.length` is not undefined here.\n\t\t\t// @ts-expect-error\n\t\t\tposition: parseInt( colorStop.length.value ),\n\t\t};\n\t} );\n\n\treturn (\n\t\t<VStack spacing={ 4 } className=\"components-custom-gradient-picker\">\n\t\t\t<CustomGradientBar\n\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t}\n\t\t\t\tbackground={ background }\n\t\t\t\thasGradient={ hasGradient }\n\t\t\t\tvalue={ controlPoints }\n\t\t\t\tonChange={ ( newControlPoints ) => {\n\t\t\t\t\tonChange(\n\t\t\t\t\t\tserializeGradient(\n\t\t\t\t\t\t\tgetGradientAstWithControlPoints(\n\t\t\t\t\t\t\t\tgradientAST,\n\t\t\t\t\t\t\t\tnewControlPoints\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<Flex\n\t\t\t\tgap={ 3 }\n\t\t\t\tclassName=\"components-custom-gradient-picker__ui-line\"\n\t\t\t>\n\t\t\t\t<SelectWrapper>\n\t\t\t\t\t<GradientTypePicker\n\t\t\t\t\t\tgradientAST={ gradientAST }\n\t\t\t\t\t\thasGradient={ hasGradient }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t</SelectWrapper>\n\t\t\t\t<AccessoryWrapper>\n\t\t\t\t\t{ gradientAST.type === 'linear-gradient' && (\n\t\t\t\t\t\t<GradientAnglePicker\n\t\t\t\t\t\t\tgradientAST={ gradientAST }\n\t\t\t\t\t\t\thasGradient={ hasGradient }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</AccessoryWrapper>\n\t\t\t</Flex>\n\t\t</VStack>\n\t);\n}\n\nexport default CustomGradientPicker;\n"],"mappings":";;;;;;;;AAQA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAMA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAKA,IAAAU,2BAAA,GAAAV,OAAA;AAGgD,IAAAW,WAAA,GAAAX,OAAA;AAjChD;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AA4BA,MAAMY,mBAAmB,GAAGA,CAAE;EAC7BC,WAAW;EACXC,WAAW;EACXC;AACyB,CAAC,KAAM;EAAA,IAAAC,qBAAA;EAChC,MAAMC,KAAK,IAAAD,qBAAA,GACVH,WAAW,EAAEK,WAAW,EAAEC,KAAK,cAAAH,qBAAA,cAAAA,qBAAA,GAAII,wCAA6B;EACjE,MAAMC,aAAa,GAAKC,QAAgB,IAAM;IAC7CP,QAAQ,CACP,IAAAQ,6BAAiB,EAAE;MAClB,GAA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D,WAAW,EACXgD,gBACD,CACD,CACD,CAAC;MACF;IAAG,CACH,CAAC,eACF,IAAAlD,WAAA,CAAA8C,IAAA,EAACrD,KAAA,CAAA2D,IAAI;MACJC,GAAG,EAAG,CAAG;MACT5B,SAAS,EAAC,4CAA4C;MAAAwB,QAAA,gBAEtD,IAAAjD,WAAA,CAAAc,GAAA,EAACf,2BAAA,CAAAuD,aAAa;QAAAL,QAAA,eACb,IAAAjD,WAAA,CAAAc,GAAA,EAACE,kBAAkB;UAClBd,WAAW,EAAGA,WAAa;UAC3BC,WAAW,EAAGA,WAAa;UAC3BC,QAAQ,EAAGA;QAAU,CACrB;MAAC,CACY,CAAC,eAChB,IAAAJ,WAAA,CAAAc,GAAA,EAACf,2BAAA,CAAAwD,gBAAgB;QAAAN,QAAA,EACd/C,WAAW,CAACW,IAAI,KAAK,iBAAiB,iBACvC,IAAAb,WAAA,CAAAc,GAAA,EAACb,mBAAmB;UACnBC,WAAW,EAAGA,WAAa;UAC3BC,WAAW,EAAGA,WAAa;UAC3BC,QAAQ,EAAGA;QAAU,CACrB;MACD,CACgB,CAAC;IAAA,CACd,CAAC;EAAA,CACA,CAAC;AAEX;AAAC,IAAAoD,QAAA,GAAAC,OAAA,CAAA1C,OAAA,GAEciB,oBAAoB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["serializeGradientColor","type","value","join","serializeGradientPosition","position","serializeGradientColorStop","length","serializeGradientOrientation","orientation","Array","isArray","serializeGradient","colorStops","serializedOrientation","serializedColorStops","sort","colorStop1","colorStop2","getNumericStopValue","colorStop","undefined","parseInt","map","filter","Boolean"],"sources":["@wordpress/components/src/custom-gradient-picker/serializer.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type gradientParser from 'gradient-parser';\n\nexport function serializeGradientColor( {\n\ttype,\n\tvalue,\n}: gradientParser.ColorStop ) {\n\tif ( type === 'literal' ) {\n\t\treturn value;\n\t}\n\tif ( type === 'hex' ) {\n\t\treturn `#${ value }`;\n\t}\n\treturn `${ type }(${ value.join( ',' ) })`;\n}\n\nexport function serializeGradientPosition(\n\tposition: gradientParser.ColorStop[ 'length' ]\n) {\n\tif ( ! position ) {\n\t\treturn '';\n\t}\n\tconst { value, type } = position;\n\treturn `${ value }${ type }`;\n}\n\nexport function serializeGradientColorStop( {\n\ttype,\n\tvalue,\n\tlength,\n}: gradientParser.ColorStop ) {\n\treturn `${ serializeGradientColor( {\n\t\ttype,\n\t\tvalue,\n\t} as gradientParser.ColorStop ) } ${ serializeGradientPosition( length ) }`;\n}\n\nexport function serializeGradientOrientation(\n\torientation: gradientParser.GradientNode[ 'orientation' ]\n) {\n\tif (\n\t\tArray.isArray( orientation ) ||\n\t\t! orientation ||\n\t\torientation.type !== 'angular'\n\t) {\n\t\treturn;\n\t}\n\treturn `${ orientation.value }deg`;\n}\n\nexport function serializeGradient( {\n\ttype,\n\torientation,\n\tcolorStops,\n}: gradientParser.GradientNode ) {\n\tconst serializedOrientation = serializeGradientOrientation( orientation );\n\tconst serializedColorStops = colorStops\n\t\t.sort( ( colorStop1, colorStop2 ) => {\n\t\t\tconst getNumericStopValue = (\n\t\t\t\tcolorStop: gradientParser.ColorStop\n\t\t\t) => {\n\t\t\t\treturn colorStop?.length?.value === undefined\n\t\t\t\t\t? 0\n\t\t\t\t\t: parseInt( colorStop.length.value );\n\t\t\t};\n\n\t\t\treturn (\n\t\t\t\tgetNumericStopValue( colorStop1 ) -\n\t\t\t\tgetNumericStopValue( colorStop2 )\n\t\t\t);\n\t\t} )\n\t\t.map( serializeGradientColorStop );\n\treturn `${ type }(${ [ serializedOrientation, ...serializedColorStops ]\n\t\t.filter( Boolean )\n\t\t.join( ',' ) })`;\n}\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;;AAGO,SAASA,sBAAsBA,CAAE;EACvCC,IAAI;EACJC;AACyB,CAAC,EAAG;EAC7B,IAAKD,IAAI,KAAK,SAAS,EAAG;IACzB,OAAOC,KAAK;EACb;EACA,IAAKD,IAAI,KAAK,KAAK,EAAG;IACrB,
|
|
1
|
+
{"version":3,"names":["serializeGradientColor","type","value","join","serializeGradientPosition","position","serializeGradientColorStop","length","serializeGradientOrientation","orientation","Array","isArray","serializeGradient","colorStops","serializedOrientation","serializedColorStops","sort","colorStop1","colorStop2","getNumericStopValue","colorStop","undefined","parseInt","map","filter","Boolean"],"sources":["@wordpress/components/src/custom-gradient-picker/serializer.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type gradientParser from 'gradient-parser';\n\nexport function serializeGradientColor( {\n\ttype,\n\tvalue,\n}: gradientParser.ColorStop ) {\n\tif ( type === 'literal' ) {\n\t\treturn value;\n\t}\n\tif ( type === 'hex' ) {\n\t\treturn `#${ value }`;\n\t}\n\treturn `${ type }(${ value.join( ',' ) })`;\n}\n\nexport function serializeGradientPosition(\n\tposition: gradientParser.ColorStop[ 'length' ]\n) {\n\tif ( ! position ) {\n\t\treturn '';\n\t}\n\tconst { value, type } = position;\n\treturn `${ value }${ type }`;\n}\n\nexport function serializeGradientColorStop( {\n\ttype,\n\tvalue,\n\tlength,\n}: gradientParser.ColorStop ) {\n\treturn `${ serializeGradientColor( {\n\t\ttype,\n\t\tvalue,\n\t} as gradientParser.ColorStop ) } ${ serializeGradientPosition( length ) }`;\n}\n\nexport function serializeGradientOrientation(\n\torientation: gradientParser.GradientNode[ 'orientation' ]\n) {\n\tif (\n\t\tArray.isArray( orientation ) ||\n\t\t! orientation ||\n\t\torientation.type !== 'angular'\n\t) {\n\t\treturn;\n\t}\n\treturn `${ orientation.value }deg`;\n}\n\nexport function serializeGradient( {\n\ttype,\n\torientation,\n\tcolorStops,\n}: gradientParser.GradientNode ) {\n\tconst serializedOrientation = serializeGradientOrientation( orientation );\n\tconst serializedColorStops = colorStops\n\t\t.sort( ( colorStop1, colorStop2 ) => {\n\t\t\tconst getNumericStopValue = (\n\t\t\t\tcolorStop: gradientParser.ColorStop\n\t\t\t) => {\n\t\t\t\treturn colorStop?.length?.value === undefined\n\t\t\t\t\t? 0\n\t\t\t\t\t: parseInt( colorStop.length.value );\n\t\t\t};\n\n\t\t\treturn (\n\t\t\t\tgetNumericStopValue( colorStop1 ) -\n\t\t\t\tgetNumericStopValue( colorStop2 )\n\t\t\t);\n\t\t} )\n\t\t.map( serializeGradientColorStop );\n\treturn `${ type }(${ [ serializedOrientation, ...serializedColorStops ]\n\t\t.filter( Boolean )\n\t\t.join( ',' ) })`;\n}\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;;AAGO,SAASA,sBAAsBA,CAAE;EACvCC,IAAI;EACJC;AACyB,CAAC,EAAG;EAC7B,IAAKD,IAAI,KAAK,SAAS,EAAG;IACzB,OAAOC,KAAK;EACb;EACA,IAAKD,IAAI,KAAK,KAAK,EAAG;IACrB,OAAO,IAAKC,KAAK,EAAG;EACrB;EACA,OAAO,GAAID,IAAI,IAAMC,KAAK,CAACC,IAAI,CAAE,GAAI,CAAC,GAAI;AAC3C;AAEO,SAASC,yBAAyBA,CACxCC,QAA8C,EAC7C;EACD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,EAAE;EACV;EACA,MAAM;IAAEH,KAAK;IAAED;EAAK,CAAC,GAAGI,QAAQ;EAChC,OAAO,GAAIH,KAAK,GAAKD,IAAI,EAAG;AAC7B;AAEO,SAASK,0BAA0BA,CAAE;EAC3CL,IAAI;EACJC,KAAK;EACLK;AACyB,CAAC,EAAG;EAC7B,OAAO,GAAIP,sBAAsB,CAAE;IAClCC,IAAI;IACJC;EACD,CAA8B,CAAC,IAAME,yBAAyB,CAAEG,MAAO,CAAC,EAAG;AAC5E;AAEO,SAASC,4BAA4BA,CAC3CC,WAAyD,EACxD;EACD,IACCC,KAAK,CAACC,OAAO,CAAEF,WAAY,CAAC,IAC5B,CAAEA,WAAW,IACbA,WAAW,CAACR,IAAI,KAAK,SAAS,EAC7B;IACD;EACD;EACA,OAAO,GAAIQ,WAAW,CAACP,KAAK,KAAM;AACnC;AAEO,SAASU,iBAAiBA,CAAE;EAClCX,IAAI;EACJQ,WAAW;EACXI;AAC4B,CAAC,EAAG;EAChC,MAAMC,qBAAqB,GAAGN,4BAA4B,CAAEC,WAAY,CAAC;EACzE,MAAMM,oBAAoB,GAAGF,UAAU,CACrCG,IAAI,CAAE,CAAEC,UAAU,EAAEC,UAAU,KAAM;IACpC,MAAMC,mBAAmB,GACxBC,SAAmC,IAC/B;MACJ,OAAOA,SAAS,EAAEb,MAAM,EAAEL,KAAK,KAAKmB,SAAS,GAC1C,CAAC,GACDC,QAAQ,CAAEF,SAAS,CAACb,MAAM,CAACL,KAAM,CAAC;IACtC,CAAC;IAED,OACCiB,mBAAmB,CAAEF,UAAW,CAAC,GACjCE,mBAAmB,CAAED,UAAW,CAAC;EAEnC,CAAE,CAAC,CACFK,GAAG,CAAEjB,0BAA2B,CAAC;EACnC,OAAO,GAAIL,IAAI,IAAM,CAAEa,qBAAqB,EAAE,GAAGC,oBAAoB,CAAE,CACrES,MAAM,CAAEC,OAAQ,CAAC,CACjBtB,IAAI,CAAE,GAAI,CAAC,GAAI;AAClB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_gradientParser","_interopRequireDefault","require","_colord","_names","_constants","_serializer","extend","namesPlugin","getLinearGradientRepresentation","gradientAST","serializeGradient","type","orientation","HORIZONTAL_GRADIENT_ORIENTATION","colorStops","hasUnsupportedLength","item","length","undefined","getGradientAstWithDefault","value","hasGradient","valueToParse","DEFAULT_GRADIENT","gradientParser","parse","error","console","warn","Array","isArray","DIRECTIONAL_ORIENTATION_ANGLE_MAP","toString","some","step","forEach","stop","index","getGradientAstWithControlPoints","newControlPoints","map","position","color","r","g","b","a","colord","toRgb","getStopCssColor","colorStop","join"],"sources":["@wordpress/components/src/custom-gradient-picker/utils.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport gradientParser from 'gradient-parser';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * Internal dependencies\n */\nimport {\n\tDEFAULT_GRADIENT,\n\tHORIZONTAL_GRADIENT_ORIENTATION,\n\tDIRECTIONAL_ORIENTATION_ANGLE_MAP,\n} from './constants';\nimport { serializeGradient } from './serializer';\nimport type { ControlPoint } from './types';\n\nextend( [ namesPlugin ] );\n\nexport function getLinearGradientRepresentation(\n\tgradientAST: gradientParser.GradientNode\n) {\n\treturn serializeGradient( {\n\t\ttype: 'linear-gradient',\n\t\torientation: HORIZONTAL_GRADIENT_ORIENTATION,\n\t\tcolorStops: gradientAST.colorStops,\n\t} );\n}\n\nfunction hasUnsupportedLength( item: gradientParser.ColorStop ) {\n\treturn item.length === undefined || item.length.type !== '%';\n}\n\nexport function getGradientAstWithDefault( value?: string | null ) {\n\t// gradientAST will contain the gradient AST as parsed by gradient-parser npm module.\n\t// More information of its structure available at https://www.npmjs.com/package/gradient-parser#ast.\n\tlet gradientAST: gradientParser.GradientNode | undefined;\n\tlet hasGradient = !! value;\n\n\tconst valueToParse = value ?? DEFAULT_GRADIENT;\n\n\ttry {\n\t\tgradientAST = gradientParser.parse( valueToParse )[ 0 ];\n\t} catch ( error ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t'wp.components.CustomGradientPicker failed to parse the gradient with error',\n\t\t\terror\n\t\t);\n\n\t\tgradientAST = gradientParser.parse( DEFAULT_GRADIENT )[ 0 ];\n\t\thasGradient = false;\n\t}\n\n\tif (\n\t\t! Array.isArray( gradientAST.orientation ) &&\n\t\tgradientAST.orientation?.type === 'directional'\n\t) {\n\t\tgradientAST.orientation = {\n\t\t\ttype: 'angular',\n\t\t\tvalue: DIRECTIONAL_ORIENTATION_ANGLE_MAP[\n\t\t\t\tgradientAST.orientation.value\n\t\t\t].toString(),\n\t\t};\n\t}\n\n\tif ( gradientAST.colorStops.some( hasUnsupportedLength ) ) {\n\t\tconst { colorStops } = gradientAST;\n\t\tconst step = 100 / ( colorStops.length - 1 );\n\t\tcolorStops.forEach( ( stop, index ) => {\n\t\t\tstop.length = {\n\t\t\t\tvalue: `${ step * index }`,\n\t\t\t\ttype: '%',\n\t\t\t};\n\t\t} );\n\t}\n\n\treturn { gradientAST, hasGradient };\n}\n\nexport function getGradientAstWithControlPoints(\n\tgradientAST: gradientParser.GradientNode,\n\tnewControlPoints: ControlPoint[]\n) {\n\treturn {\n\t\t...gradientAST,\n\t\tcolorStops: newControlPoints.map( ( { position, color } ) => {\n\t\t\tconst { r, g, b, a } = colord( color ).toRgb();\n\t\t\treturn {\n\t\t\t\tlength: {\n\t\t\t\t\ttype: '%',\n\t\t\t\t\tvalue: position?.toString(),\n\t\t\t\t},\n\t\t\t\ttype: a < 1 ? 'rgba' : 'rgb',\n\t\t\t\tvalue:\n\t\t\t\t\ta < 1\n\t\t\t\t\t\t? [ `${ r }`, `${ g }`, `${ b }`, `${ a }` ]\n\t\t\t\t\t\t: [ `${ r }`, `${ g }`, `${ b }` ],\n\t\t\t};\n\t\t} ),\n\t} as gradientParser.GradientNode;\n}\n\nexport function getStopCssColor( colorStop: gradientParser.ColorStop ) {\n\tswitch ( colorStop.type ) {\n\t\tcase 'hex':\n\t\t\treturn `#${ colorStop.value }`;\n\t\tcase 'literal':\n\t\t\treturn colorStop.value;\n\t\tcase 'rgb':\n\t\tcase 'rgba':\n\t\t\treturn `${ colorStop.type }(${ colorStop.value.join( ',' ) })`;\n\t\tdefault:\n\t\t\t// Should be unreachable if passing an AST from gradient-parser.\n\t\t\t// See https://github.com/rafaelcaricio/gradient-parser#ast.\n\t\t\treturn 'transparent';\n\t}\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AAKA,IAAAG,UAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAfA;AACA;AACA;;AAKA;AACA;AACA;;AASA,IAAAK,cAAM,EAAE,CAAEC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AW,CAAC,GAAGL,WAAW;IAClC,MAAMyB,IAAI,GAAG,GAAG,IAAKpB,UAAU,CAACG,MAAM,GAAG,CAAC,CAAE;IAC5CH,UAAU,CAACqB,OAAO,CAAE,CAAEC,IAAI,EAAEC,KAAK,KAAM;MACtCD,IAAI,CAACnB,MAAM,GAAG;QACbG,KAAK,
|
|
1
|
+
{"version":3,"names":["_gradientParser","_interopRequireDefault","require","_colord","_names","_constants","_serializer","extend","namesPlugin","getLinearGradientRepresentation","gradientAST","serializeGradient","type","orientation","HORIZONTAL_GRADIENT_ORIENTATION","colorStops","hasUnsupportedLength","item","length","undefined","getGradientAstWithDefault","value","hasGradient","valueToParse","DEFAULT_GRADIENT","gradientParser","parse","error","console","warn","Array","isArray","DIRECTIONAL_ORIENTATION_ANGLE_MAP","toString","some","step","forEach","stop","index","getGradientAstWithControlPoints","newControlPoints","map","position","color","r","g","b","a","colord","toRgb","getStopCssColor","colorStop","join"],"sources":["@wordpress/components/src/custom-gradient-picker/utils.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport gradientParser from 'gradient-parser';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * Internal dependencies\n */\nimport {\n\tDEFAULT_GRADIENT,\n\tHORIZONTAL_GRADIENT_ORIENTATION,\n\tDIRECTIONAL_ORIENTATION_ANGLE_MAP,\n} from './constants';\nimport { serializeGradient } from './serializer';\nimport type { ControlPoint } from './types';\n\nextend( [ namesPlugin ] );\n\nexport function getLinearGradientRepresentation(\n\tgradientAST: gradientParser.GradientNode\n) {\n\treturn serializeGradient( {\n\t\ttype: 'linear-gradient',\n\t\torientation: HORIZONTAL_GRADIENT_ORIENTATION,\n\t\tcolorStops: gradientAST.colorStops,\n\t} );\n}\n\nfunction hasUnsupportedLength( item: gradientParser.ColorStop ) {\n\treturn item.length === undefined || item.length.type !== '%';\n}\n\nexport function getGradientAstWithDefault( value?: string | null ) {\n\t// gradientAST will contain the gradient AST as parsed by gradient-parser npm module.\n\t// More information of its structure available at https://www.npmjs.com/package/gradient-parser#ast.\n\tlet gradientAST: gradientParser.GradientNode | undefined;\n\tlet hasGradient = !! value;\n\n\tconst valueToParse = value ?? DEFAULT_GRADIENT;\n\n\ttry {\n\t\tgradientAST = gradientParser.parse( valueToParse )[ 0 ];\n\t} catch ( error ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t'wp.components.CustomGradientPicker failed to parse the gradient with error',\n\t\t\terror\n\t\t);\n\n\t\tgradientAST = gradientParser.parse( DEFAULT_GRADIENT )[ 0 ];\n\t\thasGradient = false;\n\t}\n\n\tif (\n\t\t! Array.isArray( gradientAST.orientation ) &&\n\t\tgradientAST.orientation?.type === 'directional'\n\t) {\n\t\tgradientAST.orientation = {\n\t\t\ttype: 'angular',\n\t\t\tvalue: DIRECTIONAL_ORIENTATION_ANGLE_MAP[\n\t\t\t\tgradientAST.orientation.value\n\t\t\t].toString(),\n\t\t};\n\t}\n\n\tif ( gradientAST.colorStops.some( hasUnsupportedLength ) ) {\n\t\tconst { colorStops } = gradientAST;\n\t\tconst step = 100 / ( colorStops.length - 1 );\n\t\tcolorStops.forEach( ( stop, index ) => {\n\t\t\tstop.length = {\n\t\t\t\tvalue: `${ step * index }`,\n\t\t\t\ttype: '%',\n\t\t\t};\n\t\t} );\n\t}\n\n\treturn { gradientAST, hasGradient };\n}\n\nexport function getGradientAstWithControlPoints(\n\tgradientAST: gradientParser.GradientNode,\n\tnewControlPoints: ControlPoint[]\n) {\n\treturn {\n\t\t...gradientAST,\n\t\tcolorStops: newControlPoints.map( ( { position, color } ) => {\n\t\t\tconst { r, g, b, a } = colord( color ).toRgb();\n\t\t\treturn {\n\t\t\t\tlength: {\n\t\t\t\t\ttype: '%',\n\t\t\t\t\tvalue: position?.toString(),\n\t\t\t\t},\n\t\t\t\ttype: a < 1 ? 'rgba' : 'rgb',\n\t\t\t\tvalue:\n\t\t\t\t\ta < 1\n\t\t\t\t\t\t? [ `${ r }`, `${ g }`, `${ b }`, `${ a }` ]\n\t\t\t\t\t\t: [ `${ r }`, `${ g }`, `${ b }` ],\n\t\t\t};\n\t\t} ),\n\t} as gradientParser.GradientNode;\n}\n\nexport function getStopCssColor( colorStop: gradientParser.ColorStop ) {\n\tswitch ( colorStop.type ) {\n\t\tcase 'hex':\n\t\t\treturn `#${ colorStop.value }`;\n\t\tcase 'literal':\n\t\t\treturn colorStop.value;\n\t\tcase 'rgb':\n\t\tcase 'rgba':\n\t\t\treturn `${ colorStop.type }(${ colorStop.value.join( ',' ) })`;\n\t\tdefault:\n\t\t\t// Should be unreachable if passing an AST from gradient-parser.\n\t\t\t// See https://github.com/rafaelcaricio/gradient-parser#ast.\n\t\t\treturn 'transparent';\n\t}\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AAKA,IAAAG,UAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAfA;AACA;AACA;;AAKA;AACA;AACA;;AASA,IAAAK,cAAM,EAAE,CAAEC,cAAW,CAAG,CAAC;AAElB,SAASC,+BAA+BA,CAC9CC,WAAwC,EACvC;EACD,OAAO,IAAAC,6BAAiB,EAAE;IACzBC,IAAI,EAAE,iBAAiB;IACvBC,WAAW,EAAEC,0CAA+B;IAC5CC,UAAU,EAAEL,WAAW,CAACK;EACzB,CAAE,CAAC;AACJ;AAEA,SAASC,oBAAoBA,CAAEC,IAA8B,EAAG;EAC/D,OAAOA,IAAI,CAACC,MAAM,KAAKC,SAAS,IAAIF,IAAI,CAACC,MAAM,CAACN,IAAI,KAAK,GAAG;AAC7D;AAEO,SAASQ,yBAAyBA,CAAEC,KAAqB,EAAG;EAClE;EACA;EACA,IAAIX,WAAoD;EACxD,IAAIY,WAAW,GAAG,CAAC,CAAED,KAAK;EAE1B,MAAME,YAAY,G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AAE,CAAE;MAAEC,QAAQ;MAAEC;IAAM,CAAC,KAAM;MAC5D,MAAM;QAAEC,CAAC;QAAEC,CAAC;QAAEC,CAAC;QAAEC;MAAE,CAAC,GAAG,IAAAC,cAAM,EAAEL,KAAM,CAAC,CAACM,KAAK,CAAC,CAAC;MAC9C,OAAO;QACN/B,MAAM,EAAE;UACPN,IAAI,EAAE,GAAG;UACTS,KAAK,EAAEqB,QAAQ,EAAET,QAAQ,CAAC;QAC3B,CAAC;QACDrB,IAAI,EAAEmC,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,KAAK;QAC5B1B,KAAK,EACJ0B,CAAC,GAAG,CAAC,GACF,CAAE,GAAIH,CAAC,EAAG,EAAE,GAAIC,CAAC,EAAG,EAAE,GAAIC,CAAC,EAAG,EAAE,GAAIC,CAAC,EAAG,CAAE,GAC1C,CAAE,GAAIH,CAAC,EAAG,EAAE,GAAIC,CAAC,EAAG,EAAE,GAAIC,CAAC,EAAG;MACnC,CAAC;IACF,CAAE;EACH,CAAC;AACF;AAEO,SAASI,eAAeA,CAAEC,SAAmC,EAAG;EACtE,QAASA,SAAS,CAACvC,IAAI;IACtB,KAAK,KAAK;MACT,OAAO,IAAKuC,SAAS,CAAC9B,KAAK,EAAG;IAC/B,KAAK,SAAS;MACb,OAAO8B,SAAS,CAAC9B,KAAK;IACvB,KAAK,KAAK;IACV,KAAK,MAAM;MACV,OAAO,GAAI8B,SAAS,CAACvC,IAAI,IAAMuC,SAAS,CAAC9B,KAAK,CAAC+B,IAAI,CAAE,GAAI,CAAC,GAAI;IAC/D;MACC;MACA;MACA,OAAO,aAAa;EACtB;AACD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_react2","_utils","_space","_selectControlStyles","_inputControlStyles","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_EMOTION_STRINGIFIED_CSS_ERROR__","ANIMATION_PARAMS","SLIDE_AMOUNT","DURATION","EASING","INLINE_PADDING","compact","CONFIG","controlPaddingXSmall","small","controlPaddingX","getSelectSize","size","heightProperty","sizes","paddingInlineStart","paddingInlineEnd","chevronIconSize","getSelectItemSize","checkmarkCorrection","Select","exports","_base","process","env","NODE_ENV","shouldForwardProp","prop","target","label","hasCustomRenderProp","css","COLORS","theme","background","foreground","truncateStyles","fontSizeStyles","inputSize","slideDownAndFade","keyframes","opacity","transform","SelectPopover","radiusSmall","elevationMedium","SelectItem","fontSize","space","gray","name","styles","map","toString","SelectedExperimentalHintWrapper","SelectedExperimentalHintItem","WithHintItemWrapper","WithHintItemHint","fontLineHeightBase","SelectedItemCheck","SelectItemCheck"],"sources":["@wordpress/components/src/custom-select-control-v2/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { css, keyframes } from '@emotion/react';\nimport styled from '@emotion/styled';\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG } from '../utils';\nimport { space } from '../utils/space';\nimport { chevronIconSize } from '../select-control/styles/select-control-styles';\nimport { fontSizeStyles } from '../input-control/styles/input-control-styles';\nimport type { CustomSelectButtonSize } from './types';\n\n// TODO: extract to common utils and apply to relevant components\nconst ANIMATION_PARAMS = {\n\tSLIDE_AMOUNT: '2px',\n\tDURATION: '400ms',\n\tEASING: 'cubic-bezier( 0.16, 1, 0.3, 1 )',\n};\n\nconst INLINE_PADDING = {\n\tcompact: CONFIG.controlPaddingXSmall,\n\tsmall: CONFIG.controlPaddingXSmall,\n\tdefault: CONFIG.controlPaddingX,\n};\n\nconst getSelectSize = (\n\tsize: NonNullable< CustomSelectButtonSize[ 'size' ] >,\n\theightProperty: 'minHeight' | 'height'\n) => {\n\tconst sizes = {\n\t\tcompact: {\n\t\t\t[ heightProperty ]: 32,\n\t\t\tpaddingInlineStart: INLINE_PADDING.compact,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.compact + chevronIconSize,\n\t\t},\n\t\tdefault: {\n\t\t\t[ heightProperty ]: 40,\n\t\t\tpaddingInlineStart: INLINE_PADDING.default,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.default + chevronIconSize,\n\t\t},\n\t\tsmall: {\n\t\t\t[ heightProperty ]: 24,\n\t\t\tpaddingInlineStart: INLINE_PADDING.small,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.small + chevronIconSize,\n\t\t},\n\t};\n\n\treturn sizes[ size ] || sizes.default;\n};\n\nconst getSelectItemSize = (\n\tsize: NonNullable< CustomSelectButtonSize[ 'size' ] >\n) => {\n\t// Used to visually align the checkmark with the chevron\n\tconst checkmarkCorrection = 6;\n\tconst sizes = {\n\t\tcompact: {\n\t\t\tpaddingInlineStart: INLINE_PADDING.compact,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.compact - checkmarkCorrection,\n\t\t},\n\t\tdefault: {\n\t\t\tpaddingInlineStart: INLINE_PADDING.default,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.default - checkmarkCorrection,\n\t\t},\n\t\tsmall: {\n\t\t\tpaddingInlineStart: INLINE_PADDING.small,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.small - checkmarkCorrection,\n\t\t},\n\t};\n\n\treturn sizes[ size ] || sizes.default;\n};\n\nexport const Select = styled( Ariakit.Select, {\n\t// Do not forward `hasCustomRenderProp` to the underlying Ariakit.Select component\n\tshouldForwardProp: ( prop ) => prop !== 'hasCustomRenderProp',\n} )(\n\t( {\n\t\tsize,\n\t\thasCustomRenderProp,\n\t}: {\n\t\tsize: NonNullable< CustomSelectButtonSize[ 'size' ] >;\n\t\thasCustomRenderProp: boolean;\n\t} ) => css`\n\t\tdisplay: block;\n\t\tbackground-color: ${ COLORS.theme.background };\n\t\tborder: none;\n\t\tcolor: ${ COLORS.theme.foreground };\n\t\tcursor: pointer;\n\t\tfont-family: inherit;\n\t\ttext-align: start;\n\t\tuser-select: none;\n\t\twidth: 100%;\n\n\t\t&[data-focus-visible] {\n\t\t\toutline: none; // handled by InputBase component\n\t\t}\n\n\t\t${ getSelectSize( size, hasCustomRenderProp ? 'minHeight' : 'height' ) }\n\t\t${ ! hasCustomRenderProp && truncateStyles }\n\t\t${ fontSizeStyles( { inputSize: size } ) }\n\t`\n);\n\nconst slideDownAndFade = keyframes( {\n\t'0%': {\n\t\topacity: 0,\n\t\ttransform: `translateY(-${ ANIMATION_PARAMS.SLIDE_AMOUNT })`,\n\t},\n\t'100%': { opacity: 1, transform: 'translateY(0)' },\n} );\n\nexport const SelectPopover = styled( Ariakit.SelectPopover )`\n\tdisplay: flex;\n\tflex-direction: column;\n\n\tbackground-color: ${ COLORS.theme.background };\n\tborder-radius: ${ CONFIG.radiusSmall };\n\tborder: 1px solid ${ COLORS.theme.foreground };\n\tbox-shadow: ${ CONFIG.elevationMedium };\n\n\t/* z-index(\".components-popover\") */\n\tz-index: 1000000;\n\n\tmax-height: min( var( --popover-available-height, 400px ), 400px );\n\toverflow: auto;\n\toverscroll-behavior: contain;\n\n\t/* The smallest size without overflowing the container. */\n\tmin-width: min-content;\n\n\t/* Animation */\n\t&[data-open] {\n\t\t@media not ( prefers-reduced-motion ) {\n\t\t\tanimation-duration: ${ ANIMATION_PARAMS.DURATION };\n\t\t\tanimation-timing-function: ${ ANIMATION_PARAMS.EASING };\n\t\t\tanimation-name: ${ slideDownAndFade };\n\t\t\twill-change: transform, opacity;\n\t\t}\n\t}\n\n\t&[data-focus-visible] {\n\t\t/* The outline will be on the trigger, rather than the popover. */\n\t\toutline: none;\n\t}\n`;\n\nexport const SelectItem = styled( Ariakit.SelectItem )(\n\t( {\n\t\tsize,\n\t}: {\n\t\tsize: NonNullable< CustomSelectButtonSize[ 'size' ] >;\n\t} ) => css`\n\t\tcursor: default;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tfont-size: ${ CONFIG.fontSize };\n\t\t// TODO: reassess line-height for non-legacy v2\n\t\tline-height: 28px;\n\t\tpadding-block: ${ space( 2 ) };\n\t\tscroll-margin: ${ space( 1 ) };\n\t\tuser-select: none;\n\n\t\t&[aria-disabled='true'] {\n\t\t\tcursor: not-allowed;\n\t\t}\n\n\t\t&[data-active-item] {\n\t\t\tbackground-color: ${ COLORS.theme.gray[ 300 ] };\n\t\t}\n\n\t\t${ getSelectItemSize( size ) }\n\t`\n);\n\nconst truncateStyles = css`\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n`;\n\nexport const SelectedExperimentalHintWrapper = styled.div`\n\t${ truncateStyles }\n`;\n\nexport const SelectedExperimentalHintItem = styled.span`\n\tcolor: ${ COLORS.theme.gray[ 600 ] };\n\tmargin-inline-start: ${ space( 2 ) };\n`;\n\nexport const WithHintItemWrapper = styled.div`\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tflex-wrap: wrap;\n\tflex: 1;\n\tcolumn-gap: ${ space( 4 ) };\n`;\n\nexport const WithHintItemHint = styled.span`\n\tcolor: ${ COLORS.theme.gray[ 600 ] };\n\ttext-align: initial;\n\tline-height: ${ CONFIG.fontLineHeightBase };\n\tpadding-inline-end: ${ space( 1 ) };\n\tmargin-block: ${ space( 1 ) };\n`;\n\nexport const SelectedItemCheck = styled( Ariakit.SelectItemCheck )`\n\tdisplay: flex;\n\talign-items: center;\n\tmargin-inline-start: ${ space( 2 ) };\n\n\t// Keep the checkmark vertically aligned at the top. Since the item text has a\n\t// 28px line height and the checkmark is 24px tall, a (28-24)/2 = 2px margin\n\t// is applied to keep the correct alignment between the text and the checkmark.\n\talign-self: start;\n\tmargin-block-start: 2px;\n\n\t// Since the checkmark's dimensions are applied with 'em' units, setting a\n\t// font size of 0 allows the space reserved for the checkmark to collapse for\n\t// items that are not selected or that don't have an associated item hint.\n\tfont-size: 0;\n\t${ WithHintItemWrapper } ~ &,\n\t&:not(:empty) {\n\t\tfont-size: 24px; // Size of checkmark icon\n\t}\n`;\n"],"mappings":";;;;;;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AClB,IAAAV,YAAK,EAAE,CAAE,CAAC,oBAChB,IAAAA,YAAK,EAAE,CAAE,CAAC,SAAAzB,OAAA,CAAAC,GAAA,CAAAC,QAAA,ojSAC3B;AAEM,MAAMkC,iBAAiB,GAAAtC,OAAA,CAAAsC,iBAAA,gBAAG,IAAArC,KAAA,CAAApC,OAAA,EAAQd,OAAO,CAACwF,eAAe,EAAArC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,yDAGzC,IAAAmB,YAAK,EAAE,CAAE,CAAC,2DAY/BQ,mBAAmB,yCAAAjC,OAAA,CAAAC,GAAA,CAAAC,QAAA,ojSAItB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_react2","_utils","_space","_selectControlStyles","_inputControlStyles","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_EMOTION_STRINGIFIED_CSS_ERROR__","ANIMATION_PARAMS","SLIDE_AMOUNT","DURATION","EASING","INLINE_PADDING","compact","CONFIG","controlPaddingXSmall","small","controlPaddingX","getSelectSize","size","heightProperty","sizes","paddingInlineStart","paddingInlineEnd","chevronIconSize","getSelectItemSize","checkmarkCorrection","Select","exports","_base","process","env","NODE_ENV","shouldForwardProp","prop","target","label","hasCustomRenderProp","css","COLORS","theme","background","foreground","truncateStyles","fontSizeStyles","inputSize","slideDownAndFade","keyframes","opacity","transform","SelectPopover","radiusSmall","elevationMedium","SelectItem","fontSize","space","gray","name","styles","map","toString","SelectedExperimentalHintWrapper","SelectedExperimentalHintItem","WithHintItemWrapper","WithHintItemHint","fontLineHeightBase","SelectedItemCheck","SelectItemCheck"],"sources":["@wordpress/components/src/custom-select-control-v2/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { css, keyframes } from '@emotion/react';\nimport styled from '@emotion/styled';\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG } from '../utils';\nimport { space } from '../utils/space';\nimport { chevronIconSize } from '../select-control/styles/select-control-styles';\nimport { fontSizeStyles } from '../input-control/styles/input-control-styles';\nimport type { CustomSelectButtonSize } from './types';\n\n// TODO: extract to common utils and apply to relevant components\nconst ANIMATION_PARAMS = {\n\tSLIDE_AMOUNT: '2px',\n\tDURATION: '400ms',\n\tEASING: 'cubic-bezier( 0.16, 1, 0.3, 1 )',\n};\n\nconst INLINE_PADDING = {\n\tcompact: CONFIG.controlPaddingXSmall,\n\tsmall: CONFIG.controlPaddingXSmall,\n\tdefault: CONFIG.controlPaddingX,\n};\n\nconst getSelectSize = (\n\tsize: NonNullable< CustomSelectButtonSize[ 'size' ] >,\n\theightProperty: 'minHeight' | 'height'\n) => {\n\tconst sizes = {\n\t\tcompact: {\n\t\t\t[ heightProperty ]: 32,\n\t\t\tpaddingInlineStart: INLINE_PADDING.compact,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.compact + chevronIconSize,\n\t\t},\n\t\tdefault: {\n\t\t\t[ heightProperty ]: 40,\n\t\t\tpaddingInlineStart: INLINE_PADDING.default,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.default + chevronIconSize,\n\t\t},\n\t\tsmall: {\n\t\t\t[ heightProperty ]: 24,\n\t\t\tpaddingInlineStart: INLINE_PADDING.small,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.small + chevronIconSize,\n\t\t},\n\t};\n\n\treturn sizes[ size ] || sizes.default;\n};\n\nconst getSelectItemSize = (\n\tsize: NonNullable< CustomSelectButtonSize[ 'size' ] >\n) => {\n\t// Used to visually align the checkmark with the chevron\n\tconst checkmarkCorrection = 6;\n\tconst sizes = {\n\t\tcompact: {\n\t\t\tpaddingInlineStart: INLINE_PADDING.compact,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.compact - checkmarkCorrection,\n\t\t},\n\t\tdefault: {\n\t\t\tpaddingInlineStart: INLINE_PADDING.default,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.default - checkmarkCorrection,\n\t\t},\n\t\tsmall: {\n\t\t\tpaddingInlineStart: INLINE_PADDING.small,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.small - checkmarkCorrection,\n\t\t},\n\t};\n\n\treturn sizes[ size ] || sizes.default;\n};\n\nexport const Select = styled( Ariakit.Select, {\n\t// Do not forward `hasCustomRenderProp` to the underlying Ariakit.Select component\n\tshouldForwardProp: ( prop ) => prop !== 'hasCustomRenderProp',\n} )(\n\t( {\n\t\tsize,\n\t\thasCustomRenderProp,\n\t}: {\n\t\tsize: NonNullable< CustomSelectButtonSize[ 'size' ] >;\n\t\thasCustomRenderProp: boolean;\n\t} ) => css`\n\t\tdisplay: block;\n\t\tbackground-color: ${ COLORS.theme.background };\n\t\tborder: none;\n\t\tcolor: ${ COLORS.theme.foreground };\n\t\tcursor: pointer;\n\t\tfont-family: inherit;\n\t\ttext-align: start;\n\t\tuser-select: none;\n\t\twidth: 100%;\n\n\t\t&[data-focus-visible] {\n\t\t\toutline: none; // handled by InputBase component\n\t\t}\n\n\t\t${ getSelectSize( size, hasCustomRenderProp ? 'minHeight' : 'height' ) }\n\t\t${ ! hasCustomRenderProp && truncateStyles }\n\t\t${ fontSizeStyles( { inputSize: size } ) }\n\t`\n);\n\nconst slideDownAndFade = keyframes( {\n\t'0%': {\n\t\topacity: 0,\n\t\ttransform: `translateY(-${ ANIMATION_PARAMS.SLIDE_AMOUNT })`,\n\t},\n\t'100%': { opacity: 1, transform: 'translateY(0)' },\n} );\n\nexport const SelectPopover = styled( Ariakit.SelectPopover )`\n\tdisplay: flex;\n\tflex-direction: column;\n\n\tbackground-color: ${ COLORS.theme.background };\n\tborder-radius: ${ CONFIG.radiusSmall };\n\tborder: 1px solid ${ COLORS.theme.foreground };\n\tbox-shadow: ${ CONFIG.elevationMedium };\n\n\t/* z-index(\".components-popover\") */\n\tz-index: 1000000;\n\n\tmax-height: min( var( --popover-available-height, 400px ), 400px );\n\toverflow: auto;\n\toverscroll-behavior: contain;\n\n\t/* The smallest size without overflowing the container. */\n\tmin-width: min-content;\n\n\t/* Animation */\n\t&[data-open] {\n\t\t@media not ( prefers-reduced-motion ) {\n\t\t\tanimation-duration: ${ ANIMATION_PARAMS.DURATION };\n\t\t\tanimation-timing-function: ${ ANIMATION_PARAMS.EASING };\n\t\t\tanimation-name: ${ slideDownAndFade };\n\t\t\twill-change: transform, opacity;\n\t\t}\n\t}\n\n\t&[data-focus-visible] {\n\t\t/* The outline will be on the trigger, rather than the popover. */\n\t\toutline: none;\n\t}\n`;\n\nexport const SelectItem = styled( Ariakit.SelectItem )(\n\t( {\n\t\tsize,\n\t}: {\n\t\tsize: NonNullable< CustomSelectButtonSize[ 'size' ] >;\n\t} ) => css`\n\t\tcursor: default;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tfont-size: ${ CONFIG.fontSize };\n\t\t// TODO: reassess line-height for non-legacy v2\n\t\tline-height: 28px;\n\t\tpadding-block: ${ space( 2 ) };\n\t\tscroll-margin: ${ space( 1 ) };\n\t\tuser-select: none;\n\n\t\t&[aria-disabled='true'] {\n\t\t\tcursor: not-allowed;\n\t\t}\n\n\t\t&[data-active-item] {\n\t\t\tbackground-color: ${ COLORS.theme.gray[ 300 ] };\n\t\t}\n\n\t\t${ getSelectItemSize( size ) }\n\t`\n);\n\nconst truncateStyles = css`\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n`;\n\nexport const SelectedExperimentalHintWrapper = styled.div`\n\t${ truncateStyles }\n`;\n\nexport const SelectedExperimentalHintItem = styled.span`\n\tcolor: ${ COLORS.theme.gray[ 600 ] };\n\tmargin-inline-start: ${ space( 2 ) };\n`;\n\nexport const WithHintItemWrapper = styled.div`\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tflex-wrap: wrap;\n\tflex: 1;\n\tcolumn-gap: ${ space( 4 ) };\n`;\n\nexport const WithHintItemHint = styled.span`\n\tcolor: ${ COLORS.theme.gray[ 600 ] };\n\ttext-align: initial;\n\tline-height: ${ CONFIG.fontLineHeightBase };\n\tpadding-inline-end: ${ space( 1 ) };\n\tmargin-block: ${ space( 1 ) };\n`;\n\nexport const SelectedItemCheck = styled( Ariakit.SelectItemCheck )`\n\tdisplay: flex;\n\talign-items: center;\n\tmargin-inline-start: ${ space( 2 ) };\n\n\t// Keep the checkmark vertically aligned at the top. Since the item text has a\n\t// 28px line height and the checkmark is 24px tall, a (28-24)/2 = 2px margin\n\t// is applied to keep the correct alignment between the text and the checkmark.\n\talign-self: start;\n\tmargin-block-start: 2px;\n\n\t// Since the checkmark's dimensions are applied with 'em' units, setting a\n\t// font size of 0 allows the space reserved for the checkmark to collapse for\n\t// items that are not selected or that don't have an associated item hint.\n\tfont-size: 0;\n\t${ WithHintItemWrapper } ~ &,\n\t&:not(:empty) {\n\t\tfont-size: 24px; // Size of checkmark icon\n\t}\n`;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AAA8E,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CA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AK,CAACgB,IAAI,CAAE,GAAG,CAAE,2BACV,IAAAD,YAAK,EAAE,CAAE,CAAC,SAAAzB,OAAA,CAAAC,GAAA,CAAAC,QAAA,ojSAClC;AAEM,MAAM+B,mBAAmB,GAAAnC,OAAA,CAAAmC,mBAAA,oBAAAlC,KAAA,CAAApC,OAAA,SAAAqC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,sGAMhB,IAAAmB,YAAK,EAAE,CAAE,CAAC,SAAAzB,OAAA,CAAAC,GAAA,CAAAC,QAAA,ojSACzB;AAEM,MAAMgC,gBAAgB,GAAApC,OAAA,CAAAoC,gBAAA,oBAAAnC,KAAA,CAAApC,OAAA,UAAAqC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,aAClBG,aAAM,CAACC,KAAK,CAACgB,IAAI,CAAE,GAAG,CAAE,sCAElB1C,aAAM,CAACmD,kBAAkB,0BAClB,IAAAV,YAAK,EAAE,CAAE,CAAC,oBAChB,IAAAA,YAAK,EAAE,CAAE,CAAC,SAAAzB,OAAA,CAAAC,GAAA,CAAAC,QAAA,ojSAC3B;AAEM,MAAMkC,iBAAiB,GAAAtC,OAAA,CAAAsC,iBAAA,gBAAG,IAAArC,KAAA,CAAApC,OAAA,EAAQd,OAAO,CAACwF,eAAe,EAAArC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,yDAGzC,IAAAmB,YAAK,EAAE,CAAE,CAAC,2DAY/BQ,mBAAmB,yCAAAjC,OAAA,CAAAC,GAAA,CAAAC,QAAA,ojSAItB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Dashicon","icon","className","size","style","extraProps","iconClass","filter","Boolean","join","sizeStyles","fontSize","width","height","styles","_jsxRuntime","jsx","_default","exports","default"],"sources":["@wordpress/components/src/dashicon/index.tsx"],"sourcesContent":["/**\n * @typedef OwnProps\n *\n * @property {import('./types').IconKey} icon Icon name\n * @property {string} [className] Class name\n * @property {number} [size] Size of the icon\n */\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport type { DashiconProps } from './types';\n\nfunction Dashicon( {\n\ticon,\n\tclassName,\n\tsize = 20,\n\tstyle = {},\n\t...extraProps\n}: WordPressComponentProps< DashiconProps, 'span', false > ) {\n\tconst iconClass = [\n\t\t'dashicon',\n\t\t'dashicons',\n\t\t'dashicons-' + icon,\n\t\tclassName,\n\t]\n\t\t.filter( Boolean )\n\t\t.join( ' ' );\n\n\t// For retro-compatibility reasons (for example if people are overriding icon size with CSS), we add inline styles just if the size is different to the default\n\tconst sizeStyles =\n\t\t// using `!=` to catch both 20 and \"20\"\n\t\t// eslint-disable-next-line eqeqeq\n\t\t20 != size\n\t\t\t? {\n\t\t\t\t\tfontSize: `${ size }px`,\n\t\t\t\t\twidth: `${ size }px`,\n\t\t\t\t\theight: `${ size }px`,\n\t\t\t }\n\t\t\t: {};\n\n\tconst styles = {\n\t\t...sizeStyles,\n\t\t...style,\n\t};\n\n\treturn <span className={ iconClass } style={ styles } { ...extraProps } />;\n}\n\nexport default Dashicon;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAIA,SAASA,QAAQA,CAAE;EAClBC,IAAI;EACJC,SAAS;EACTC,IAAI,GAAG,EAAE;EACTC,KAAK,GAAG,CAAC,CAAC;EACV,GAAGC;AACqD,CAAC,EAAG;EAC5D,MAAMC,SAAS,GAAG,CACjB,UAAU,EACV,WAAW,EACX,YAAY,GAAGL,IAAI,EACnBC,SAAS,CACT,CACCK,MAAM,CAAEC,OAAQ,CAAC,CACjBC,IAAI,CAAE,GAAI,CAAC;;EAEb;EACA,MAAMC,UAAU;EACf;EACA;EACA,EAAE,IAAIP,IAAI,GACP;IACAQ,QAAQ,
|
|
1
|
+
{"version":3,"names":["Dashicon","icon","className","size","style","extraProps","iconClass","filter","Boolean","join","sizeStyles","fontSize","width","height","styles","_jsxRuntime","jsx","_default","exports","default"],"sources":["@wordpress/components/src/dashicon/index.tsx"],"sourcesContent":["/**\n * @typedef OwnProps\n *\n * @property {import('./types').IconKey} icon Icon name\n * @property {string} [className] Class name\n * @property {number} [size] Size of the icon\n */\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport type { DashiconProps } from './types';\n\nfunction Dashicon( {\n\ticon,\n\tclassName,\n\tsize = 20,\n\tstyle = {},\n\t...extraProps\n}: WordPressComponentProps< DashiconProps, 'span', false > ) {\n\tconst iconClass = [\n\t\t'dashicon',\n\t\t'dashicons',\n\t\t'dashicons-' + icon,\n\t\tclassName,\n\t]\n\t\t.filter( Boolean )\n\t\t.join( ' ' );\n\n\t// For retro-compatibility reasons (for example if people are overriding icon size with CSS), we add inline styles just if the size is different to the default\n\tconst sizeStyles =\n\t\t// using `!=` to catch both 20 and \"20\"\n\t\t// eslint-disable-next-line eqeqeq\n\t\t20 != size\n\t\t\t? {\n\t\t\t\t\tfontSize: `${ size }px`,\n\t\t\t\t\twidth: `${ size }px`,\n\t\t\t\t\theight: `${ size }px`,\n\t\t\t }\n\t\t\t: {};\n\n\tconst styles = {\n\t\t...sizeStyles,\n\t\t...style,\n\t};\n\n\treturn <span className={ iconClass } style={ styles } { ...extraProps } />;\n}\n\nexport default Dashicon;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAIA,SAASA,QAAQA,CAAE;EAClBC,IAAI;EACJC,SAAS;EACTC,IAAI,GAAG,EAAE;EACTC,KAAK,GAAG,CAAC,CAAC;EACV,GAAGC;AACqD,CAAC,EAAG;EAC5D,MAAMC,SAAS,GAAG,CACjB,UAAU,EACV,WAAW,EACX,YAAY,GAAGL,IAAI,EACnBC,SAAS,CACT,CACCK,MAAM,CAAEC,OAAQ,CAAC,CACjBC,IAAI,CAAE,GAAI,CAAC;;EAEb;EACA,MAAMC,UAAU;EACf;EACA;EACA,EAAE,IAAIP,IAAI,GACP;IACAQ,QAAQ,EAAE,GAAIR,IAAI,IAAK;IACvBS,KAAK,EAAE,GAAIT,IAAI,IAAK;IACpBU,MAAM,EAAE,GAAIV,IAAI;EAChB,CAAC,GACD,CAAC,CAAC;EAEN,MAAMW,MAAM,GAAG;IACd,GAAGJ,UAAU;IACb,GAAGN;EACJ,CAAC;EAED,oBAAO,IAAAW,WAAA,CAAAC,GAAA;IAAMd,SAAS,EAAGI,SAAW;IAACF,KAAK,EAAGU,MAAQ;IAAA,GAAMT;EAAU,CAAI,CAAC;AAC3E;AAAC,IAAAY,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcnB,QAAQ","ignoreList":[]}
|
|
@@ -207,7 +207,6 @@ function Day({
|
|
|
207
207
|
}
|
|
208
208
|
// isFocusAllowed is not a dep as there is no point calling focus() on
|
|
209
209
|
// an already focused element.
|
|
210
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
211
210
|
}, [isFocusable]);
|
|
212
211
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.DayButton, {
|
|
213
212
|
ref: ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_dateFns","require","_i18n","_icons","_date","_element","_useLilius","_styles","_utils","_button","_interopRequireDefault","_constants","_jsxRuntime","DatePicker","currentDate","onChange","events","isInvalidDate","onMonthPreviewed","startOfWeek","weekStartsOn","date","inputToDate","Date","calendar","viewing","setSelected","setViewing","isSelected","viewPreviousMonth","viewNextMonth","useLilius","selected","startOfDay","focusable","setFocusable","useState","isFocusWithinCalendar","setIsFocusWithinCalendar","prevCurrentDate","setPrevCurrentDate","jsxs","Wrapper","className","role","__","children","Navigator","jsx","default","icon","isRTL","arrowRight","arrowLeft","variant","onClick","subMonths","format","TIMEZONELESS_FORMAT","size","NavigatorHeading","level","dateI18n","getTimezoneOffset","addMonths","Calendar","onFocus","onBlur","map","day","DayOfWeek","toString","week","index","isSameMonth","Day","column","isFocusable","isEqual","isFocusAllowed","isToday","isSameDay","isInvalid","numEvents","filter","event","length","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","onKeyDown","nextFocusable","key","addDays","subWeeks","addWeeks","endOfWeek","preventDefault","ref","useRef","useEffect","current","focus","DayButton","disabled","tabIndex","getDayLabel","hasEvents","formats","getSettings","localizedDate","sprintf","_n","_default","exports"],"sources":["@wordpress/components/src/date-time/date/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tformat,\n\tisSameDay,\n\tsubMonths,\n\taddMonths,\n\tstartOfDay,\n\tisEqual,\n\taddDays,\n\tsubWeeks,\n\taddWeeks,\n\tisSameMonth,\n\tstartOfWeek,\n\tendOfWeek,\n} from 'date-fns';\nimport type { KeyboardEventHandler } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf, isRTL } from '@wordpress/i18n';\nimport { arrowLeft, arrowRight } from '@wordpress/icons';\nimport { dateI18n, getSettings } from '@wordpress/date';\nimport { useState, useRef, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useLilius } from './use-lilius';\nimport type { DatePickerProps } from '../types';\nimport {\n\tWrapper,\n\tNavigator,\n\tNavigatorHeading,\n\tCalendar,\n\tDayOfWeek,\n\tDayButton,\n} from './styles';\nimport { inputToDate } from '../utils';\nimport Button from '../../button';\nimport { TIMEZONELESS_FORMAT } from '../constants';\n\n/**\n * DatePicker is a React component that renders a calendar for date selection.\n *\n * ```jsx\n * import { DatePicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyDatePicker = () => {\n * const [ date, setDate ] = useState( new Date() );\n *\n * return (\n * <DatePicker\n * currentDate={ date }\n * onChange={ ( newDate ) => setDate( newDate ) }\n * />\n * );\n * };\n * ```\n */\nexport function DatePicker( {\n\tcurrentDate,\n\tonChange,\n\tevents = [],\n\tisInvalidDate,\n\tonMonthPreviewed,\n\tstartOfWeek: weekStartsOn = 0,\n}: DatePickerProps ) {\n\tconst date = currentDate ? inputToDate( currentDate ) : new Date();\n\n\tconst {\n\t\tcalendar,\n\t\tviewing,\n\t\tsetSelected,\n\t\tsetViewing,\n\t\tisSelected,\n\t\tviewPreviousMonth,\n\t\tviewNextMonth,\n\t} = useLilius( {\n\t\tselected: [ startOfDay( date ) ],\n\t\tviewing: startOfDay( date ),\n\t\tweekStartsOn,\n\t} );\n\n\t// Used to implement a roving tab index. Tracks the day that receives focus\n\t// when the user tabs into the calendar.\n\tconst [ focusable, setFocusable ] = useState( startOfDay( date ) );\n\n\t// Allows us to only programmatically focus() a day when focus was already\n\t// within the calendar. This stops us stealing focus from e.g. a TimePicker\n\t// input.\n\tconst [ isFocusWithinCalendar, setIsFocusWithinCalendar ] =\n\t\tuseState( false );\n\n\t// Update internal state when currentDate prop changes.\n\tconst [ prevCurrentDate, setPrevCurrentDate ] = useState( currentDate );\n\tif ( currentDate !== prevCurrentDate ) {\n\t\tsetPrevCurrentDate( currentDate );\n\t\tsetSelected( [ startOfDay( date ) ] );\n\t\tsetViewing( startOfDay( date ) );\n\t\tsetFocusable( startOfDay( date ) );\n\t}\n\n\treturn (\n\t\t<Wrapper\n\t\t\tclassName=\"components-datetime__date\"\n\t\t\trole=\"application\"\n\t\t\taria-label={ __( 'Calendar' ) }\n\t\t>\n\t\t\t<Navigator>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ isRTL() ? arrowRight : arrowLeft }\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\taria-label={ __( 'View previous month' ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tviewPreviousMonth();\n\t\t\t\t\t\tsetFocusable( subMonths( focusable, 1 ) );\n\t\t\t\t\t\tonMonthPreviewed?.(\n\t\t\t\t\t\t\tformat(\n\t\t\t\t\t\t\t\tsubMonths( viewing, 1 ),\n\t\t\t\t\t\t\t\tTIMEZONELESS_FORMAT\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t\t<NavigatorHeading level={ 3 }>\n\t\t\t\t\t<strong>\n\t\t\t\t\t\t{ dateI18n(\n\t\t\t\t\t\t\t'F',\n\t\t\t\t\t\t\tviewing,\n\t\t\t\t\t\t\t-viewing.getTimezoneOffset()\n\t\t\t\t\t\t) }\n\t\t\t\t\t</strong>{ ' ' }\n\t\t\t\t\t{ dateI18n( 'Y', viewing, -viewing.getTimezoneOffset() ) }\n\t\t\t\t</NavigatorHeading>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ isRTL() ? arrowLeft : arrowRight }\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\taria-label={ __( 'View next month' ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tviewNextMonth();\n\t\t\t\t\t\tsetFocusable( addMonths( focusable, 1 ) );\n\t\t\t\t\t\tonMonthPreviewed?.(\n\t\t\t\t\t\t\tformat(\n\t\t\t\t\t\t\t\taddMonths( viewing, 1 ),\n\t\t\t\t\t\t\t\tTIMEZONELESS_FORMAT\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t</Navigator>\n\t\t\t<Calendar\n\t\t\t\tonFocus={ () => setIsFocusWithinCalendar( true ) }\n\t\t\t\tonBlur={ () => setIsFocusWithinCalendar( false ) }\n\t\t\t>\n\t\t\t\t{ calendar[ 0 ][ 0 ].map( ( day ) => (\n\t\t\t\t\t<DayOfWeek key={ day.toString() }>\n\t\t\t\t\t\t{ dateI18n( 'D', day, -day.getTimezoneOffset() ) }\n\t\t\t\t\t</DayOfWeek>\n\t\t\t\t) ) }\n\t\t\t\t{ calendar[ 0 ].map( ( week ) =>\n\t\t\t\t\tweek.map( ( day, index ) => {\n\t\t\t\t\t\tif ( ! isSameMonth( day, viewing ) ) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Day\n\t\t\t\t\t\t\t\tkey={ day.toString() }\n\t\t\t\t\t\t\t\tday={ day }\n\t\t\t\t\t\t\t\tcolumn={ index + 1 }\n\t\t\t\t\t\t\t\tisSelected={ isSelected( day ) }\n\t\t\t\t\t\t\t\tisFocusable={ isEqual( day, focusable ) }\n\t\t\t\t\t\t\t\tisFocusAllowed={ isFocusWithinCalendar }\n\t\t\t\t\t\t\t\tisToday={ isSameDay( day, new Date() ) }\n\t\t\t\t\t\t\t\tisInvalid={\n\t\t\t\t\t\t\t\t\tisInvalidDate ? isInvalidDate( day ) : false\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tnumEvents={\n\t\t\t\t\t\t\t\t\tevents.filter( ( event ) =>\n\t\t\t\t\t\t\t\t\t\tisSameDay( event.date, day )\n\t\t\t\t\t\t\t\t\t).length\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetSelected( [ day ] );\n\t\t\t\t\t\t\t\t\tsetFocusable( day );\n\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\tformat(\n\t\t\t\t\t\t\t\t\t\t\t// Don't change the selected date's time fields.\n\t\t\t\t\t\t\t\t\t\t\tnew Date(\n\t\t\t\t\t\t\t\t\t\t\t\tday.getFullYear(),\n\t\t\t\t\t\t\t\t\t\t\t\tday.getMonth(),\n\t\t\t\t\t\t\t\t\t\t\t\tday.getDate(),\n\t\t\t\t\t\t\t\t\t\t\t\tdate.getHours(),\n\t\t\t\t\t\t\t\t\t\t\t\tdate.getMinutes(),\n\t\t\t\t\t\t\t\t\t\t\t\tdate.getSeconds(),\n\t\t\t\t\t\t\t\t\t\t\t\tdate.getMilliseconds()\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tTIMEZONELESS_FORMAT\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\tlet nextFocusable;\n\t\t\t\t\t\t\t\t\tif ( event.key === 'ArrowLeft' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = addDays(\n\t\t\t\t\t\t\t\t\t\t\tday,\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? 1 : -1\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'ArrowRight' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = addDays(\n\t\t\t\t\t\t\t\t\t\t\tday,\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? -1 : 1\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'ArrowUp' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = subWeeks( day, 1 );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'ArrowDown' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = addWeeks( day, 1 );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'PageUp' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = subMonths( day, 1 );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'PageDown' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = addMonths( day, 1 );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'Home' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = startOfWeek( day );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'End' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = startOfDay(\n\t\t\t\t\t\t\t\t\t\t\tendOfWeek( day )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( nextFocusable ) {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tsetFocusable( nextFocusable );\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t! isSameMonth(\n\t\t\t\t\t\t\t\t\t\t\t\tnextFocusable,\n\t\t\t\t\t\t\t\t\t\t\t\tviewing\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tsetViewing( nextFocusable );\n\t\t\t\t\t\t\t\t\t\t\tonMonthPreviewed?.(\n\t\t\t\t\t\t\t\t\t\t\t\tformat(\n\t\t\t\t\t\t\t\t\t\t\t\t\tnextFocusable,\n\t\t\t\t\t\t\t\t\t\t\t\t\tTIMEZONELESS_FORMAT\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} )\n\t\t\t\t) }\n\t\t\t</Calendar>\n\t\t</Wrapper>\n\t);\n}\n\ntype DayProps = {\n\tday: Date;\n\tcolumn: number;\n\tisSelected: boolean;\n\tisFocusable: boolean;\n\tisFocusAllowed: boolean;\n\tisToday: boolean;\n\tnumEvents: number;\n\tisInvalid: boolean;\n\tonClick: () => void;\n\tonKeyDown: KeyboardEventHandler;\n};\n\nfunction Day( {\n\tday,\n\tcolumn,\n\tisSelected,\n\tisFocusable,\n\tisFocusAllowed,\n\tisToday,\n\tisInvalid,\n\tnumEvents,\n\tonClick,\n\tonKeyDown,\n}: DayProps ) {\n\tconst ref = useRef< HTMLButtonElement >();\n\n\t// Focus the day when it becomes focusable, e.g. because an arrow key is\n\t// pressed. Only do this if focus is allowed - this stops us stealing focus\n\t// from e.g. a TimePicker input.\n\tuseEffect( () => {\n\t\tif ( ref.current && isFocusable && isFocusAllowed ) {\n\t\t\tref.current.focus();\n\t\t}\n\t\t// isFocusAllowed is not a dep as there is no point calling focus() on\n\t\t// an already focused element.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ isFocusable ] );\n\n\treturn (\n\t\t<DayButton\n\t\t\tref={ ref }\n\t\t\tclassName=\"components-datetime__date__day\" // Unused, for backwards compatibility.\n\t\t\tdisabled={ isInvalid }\n\t\t\ttabIndex={ isFocusable ? 0 : -1 }\n\t\t\taria-label={ getDayLabel( day, isSelected, numEvents ) }\n\t\t\tcolumn={ column }\n\t\t\tisSelected={ isSelected }\n\t\t\tisToday={ isToday }\n\t\t\thasEvents={ numEvents > 0 }\n\t\t\tonClick={ onClick }\n\t\t\tonKeyDown={ onKeyDown }\n\t\t>\n\t\t\t{ dateI18n( 'j', day, -day.getTimezoneOffset() ) }\n\t\t</DayButton>\n\t);\n}\n\nfunction getDayLabel( date: Date, isSelected: boolean, numEvents: number ) {\n\tconst { formats } = getSettings();\n\tconst localizedDate = dateI18n(\n\t\tformats.date,\n\t\tdate,\n\t\t-date.getTimezoneOffset()\n\t);\n\tif ( isSelected && numEvents > 0 ) {\n\t\treturn sprintf(\n\t\t\t// translators: 1: The calendar date. 2: Number of events on the calendar date.\n\t\t\t_n(\n\t\t\t\t'%1$s. Selected. There is %2$d event',\n\t\t\t\t'%1$s. Selected. There are %2$d events',\n\t\t\t\tnumEvents\n\t\t\t),\n\t\t\tlocalizedDate,\n\t\t\tnumEvents\n\t\t);\n\t} else if ( isSelected ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: The calendar date.\n\t\t\t__( '%1$s. Selected' ),\n\t\t\tlocalizedDate\n\t\t);\n\t} else if ( numEvents > 0 ) {\n\t\treturn sprintf(\n\t\t\t// translators: 1: The calendar date. 2: Number of events on the calendar date.\n\t\t\t_n(\n\t\t\t\t'%1$s. There is %2$d event',\n\t\t\t\t'%1$s. There are %2$d events',\n\t\t\t\tnumEvents\n\t\t\t),\n\t\t\tlocalizedDate,\n\t\t\tnumEvents\n\t\t);\n\t}\n\treturn localizedDate;\n}\n\nexport default DatePicker;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAmBA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,UAAA,GAAAL,OAAA;AAEA,IAAAM,OAAA,GAAAN,OAAA;AAQA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAAmD,IAAAW,WAAA,GAAAX,OAAA;AA1CnD;AACA;AACA;;AAiBA;AACA;AACA;;AAMA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASY,UAAUA,CAAE;EAC3BC,WAAW;EACXC,QAAQ;EACRC,MAAM,GAAG,EAAE;EACXC,aAAa;EACbC,gBAAgB;EAChBC,WAAW,EAAEC,YAAY,GAAG;AACZ,CAAC,EAAG;EACpB,MAAMC,IAAI,GAAGP,WAAW,GAAG,IAAAQ,kBAAW,EAAER,WAAY,CAAC,GAAG,IAAIS,IAAI,CAAC,CAAC;EAElE,MAAM;IACLC,QAAQ;IACRC,OAAO;IACPC,WAAW;IACXC,UAAU;IACVC,UAAU;IACVC,iBAAiB;IACjBC;EACD,CAAC,GAAG,IAAAC,oBAAS,EAAE;I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AAC,EAAG;IAC3B,OAAO,IAAAgC,aAAO;IACb;IACA,IAAAC,QAAE,EACD,2BAA2B,EAC3B,6BAA6B,EAC7BjC,SACD,CAAC,EACD+B,aAAa,EACb/B,SACD,CAAC;EACF;EACA,OAAO+B,aAAa;AACrB;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAArE,OAAA,GAEcpC,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_dateFns","require","_i18n","_icons","_date","_element","_useLilius","_styles","_utils","_button","_interopRequireDefault","_constants","_jsxRuntime","DatePicker","currentDate","onChange","events","isInvalidDate","onMonthPreviewed","startOfWeek","weekStartsOn","date","inputToDate","Date","calendar","viewing","setSelected","setViewing","isSelected","viewPreviousMonth","viewNextMonth","useLilius","selected","startOfDay","focusable","setFocusable","useState","isFocusWithinCalendar","setIsFocusWithinCalendar","prevCurrentDate","setPrevCurrentDate","jsxs","Wrapper","className","role","__","children","Navigator","jsx","default","icon","isRTL","arrowRight","arrowLeft","variant","onClick","subMonths","format","TIMEZONELESS_FORMAT","size","NavigatorHeading","level","dateI18n","getTimezoneOffset","addMonths","Calendar","onFocus","onBlur","map","day","DayOfWeek","toString","week","index","isSameMonth","Day","column","isFocusable","isEqual","isFocusAllowed","isToday","isSameDay","isInvalid","numEvents","filter","event","length","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","onKeyDown","nextFocusable","key","addDays","subWeeks","addWeeks","endOfWeek","preventDefault","ref","useRef","useEffect","current","focus","DayButton","disabled","tabIndex","getDayLabel","hasEvents","formats","getSettings","localizedDate","sprintf","_n","_default","exports"],"sources":["@wordpress/components/src/date-time/date/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tformat,\n\tisSameDay,\n\tsubMonths,\n\taddMonths,\n\tstartOfDay,\n\tisEqual,\n\taddDays,\n\tsubWeeks,\n\taddWeeks,\n\tisSameMonth,\n\tstartOfWeek,\n\tendOfWeek,\n} from 'date-fns';\nimport type { KeyboardEventHandler } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf, isRTL } from '@wordpress/i18n';\nimport { arrowLeft, arrowRight } from '@wordpress/icons';\nimport { dateI18n, getSettings } from '@wordpress/date';\nimport { useState, useRef, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useLilius } from './use-lilius';\nimport type { DatePickerProps } from '../types';\nimport {\n\tWrapper,\n\tNavigator,\n\tNavigatorHeading,\n\tCalendar,\n\tDayOfWeek,\n\tDayButton,\n} from './styles';\nimport { inputToDate } from '../utils';\nimport Button from '../../button';\nimport { TIMEZONELESS_FORMAT } from '../constants';\n\n/**\n * DatePicker is a React component that renders a calendar for date selection.\n *\n * ```jsx\n * import { DatePicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyDatePicker = () => {\n * const [ date, setDate ] = useState( new Date() );\n *\n * return (\n * <DatePicker\n * currentDate={ date }\n * onChange={ ( newDate ) => setDate( newDate ) }\n * />\n * );\n * };\n * ```\n */\nexport function DatePicker( {\n\tcurrentDate,\n\tonChange,\n\tevents = [],\n\tisInvalidDate,\n\tonMonthPreviewed,\n\tstartOfWeek: weekStartsOn = 0,\n}: DatePickerProps ) {\n\tconst date = currentDate ? inputToDate( currentDate ) : new Date();\n\n\tconst {\n\t\tcalendar,\n\t\tviewing,\n\t\tsetSelected,\n\t\tsetViewing,\n\t\tisSelected,\n\t\tviewPreviousMonth,\n\t\tviewNextMonth,\n\t} = useLilius( {\n\t\tselected: [ startOfDay( date ) ],\n\t\tviewing: startOfDay( date ),\n\t\tweekStartsOn,\n\t} );\n\n\t// Used to implement a roving tab index. Tracks the day that receives focus\n\t// when the user tabs into the calendar.\n\tconst [ focusable, setFocusable ] = useState( startOfDay( date ) );\n\n\t// Allows us to only programmatically focus() a day when focus was already\n\t// within the calendar. This stops us stealing focus from e.g. a TimePicker\n\t// input.\n\tconst [ isFocusWithinCalendar, setIsFocusWithinCalendar ] =\n\t\tuseState( false );\n\n\t// Update internal state when currentDate prop changes.\n\tconst [ prevCurrentDate, setPrevCurrentDate ] = useState( currentDate );\n\tif ( currentDate !== prevCurrentDate ) {\n\t\tsetPrevCurrentDate( currentDate );\n\t\tsetSelected( [ startOfDay( date ) ] );\n\t\tsetViewing( startOfDay( date ) );\n\t\tsetFocusable( startOfDay( date ) );\n\t}\n\n\treturn (\n\t\t<Wrapper\n\t\t\tclassName=\"components-datetime__date\"\n\t\t\trole=\"application\"\n\t\t\taria-label={ __( 'Calendar' ) }\n\t\t>\n\t\t\t<Navigator>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ isRTL() ? arrowRight : arrowLeft }\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\taria-label={ __( 'View previous month' ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tviewPreviousMonth();\n\t\t\t\t\t\tsetFocusable( subMonths( focusable, 1 ) );\n\t\t\t\t\t\tonMonthPreviewed?.(\n\t\t\t\t\t\t\tformat(\n\t\t\t\t\t\t\t\tsubMonths( viewing, 1 ),\n\t\t\t\t\t\t\t\tTIMEZONELESS_FORMAT\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t\t<NavigatorHeading level={ 3 }>\n\t\t\t\t\t<strong>\n\t\t\t\t\t\t{ dateI18n(\n\t\t\t\t\t\t\t'F',\n\t\t\t\t\t\t\tviewing,\n\t\t\t\t\t\t\t-viewing.getTimezoneOffset()\n\t\t\t\t\t\t) }\n\t\t\t\t\t</strong>{ ' ' }\n\t\t\t\t\t{ dateI18n( 'Y', viewing, -viewing.getTimezoneOffset() ) }\n\t\t\t\t</NavigatorHeading>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ isRTL() ? arrowLeft : arrowRight }\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\taria-label={ __( 'View next month' ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tviewNextMonth();\n\t\t\t\t\t\tsetFocusable( addMonths( focusable, 1 ) );\n\t\t\t\t\t\tonMonthPreviewed?.(\n\t\t\t\t\t\t\tformat(\n\t\t\t\t\t\t\t\taddMonths( viewing, 1 ),\n\t\t\t\t\t\t\t\tTIMEZONELESS_FORMAT\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t</Navigator>\n\t\t\t<Calendar\n\t\t\t\tonFocus={ () => setIsFocusWithinCalendar( true ) }\n\t\t\t\tonBlur={ () => setIsFocusWithinCalendar( false ) }\n\t\t\t>\n\t\t\t\t{ calendar[ 0 ][ 0 ].map( ( day ) => (\n\t\t\t\t\t<DayOfWeek key={ day.toString() }>\n\t\t\t\t\t\t{ dateI18n( 'D', day, -day.getTimezoneOffset() ) }\n\t\t\t\t\t</DayOfWeek>\n\t\t\t\t) ) }\n\t\t\t\t{ calendar[ 0 ].map( ( week ) =>\n\t\t\t\t\tweek.map( ( day, index ) => {\n\t\t\t\t\t\tif ( ! isSameMonth( day, viewing ) ) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Day\n\t\t\t\t\t\t\t\tkey={ day.toString() }\n\t\t\t\t\t\t\t\tday={ day }\n\t\t\t\t\t\t\t\tcolumn={ index + 1 }\n\t\t\t\t\t\t\t\tisSelected={ isSelected( day ) }\n\t\t\t\t\t\t\t\tisFocusable={ isEqual( day, focusable ) }\n\t\t\t\t\t\t\t\tisFocusAllowed={ isFocusWithinCalendar }\n\t\t\t\t\t\t\t\tisToday={ isSameDay( day, new Date() ) }\n\t\t\t\t\t\t\t\tisInvalid={\n\t\t\t\t\t\t\t\t\tisInvalidDate ? isInvalidDate( day ) : false\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tnumEvents={\n\t\t\t\t\t\t\t\t\tevents.filter( ( event ) =>\n\t\t\t\t\t\t\t\t\t\tisSameDay( event.date, day )\n\t\t\t\t\t\t\t\t\t).length\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetSelected( [ day ] );\n\t\t\t\t\t\t\t\t\tsetFocusable( day );\n\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\tformat(\n\t\t\t\t\t\t\t\t\t\t\t// Don't change the selected date's time fields.\n\t\t\t\t\t\t\t\t\t\t\tnew Date(\n\t\t\t\t\t\t\t\t\t\t\t\tday.getFullYear(),\n\t\t\t\t\t\t\t\t\t\t\t\tday.getMonth(),\n\t\t\t\t\t\t\t\t\t\t\t\tday.getDate(),\n\t\t\t\t\t\t\t\t\t\t\t\tdate.getHours(),\n\t\t\t\t\t\t\t\t\t\t\t\tdate.getMinutes(),\n\t\t\t\t\t\t\t\t\t\t\t\tdate.getSeconds(),\n\t\t\t\t\t\t\t\t\t\t\t\tdate.getMilliseconds()\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tTIMEZONELESS_FORMAT\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\tlet nextFocusable;\n\t\t\t\t\t\t\t\t\tif ( event.key === 'ArrowLeft' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = addDays(\n\t\t\t\t\t\t\t\t\t\t\tday,\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? 1 : -1\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'ArrowRight' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = addDays(\n\t\t\t\t\t\t\t\t\t\t\tday,\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? -1 : 1\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'ArrowUp' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = subWeeks( day, 1 );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'ArrowDown' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = addWeeks( day, 1 );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'PageUp' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = subMonths( day, 1 );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'PageDown' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = addMonths( day, 1 );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'Home' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = startOfWeek( day );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'End' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = startOfDay(\n\t\t\t\t\t\t\t\t\t\t\tendOfWeek( day )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( nextFocusable ) {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tsetFocusable( nextFocusable );\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t! isSameMonth(\n\t\t\t\t\t\t\t\t\t\t\t\tnextFocusable,\n\t\t\t\t\t\t\t\t\t\t\t\tviewing\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tsetViewing( nextFocusable );\n\t\t\t\t\t\t\t\t\t\t\tonMonthPreviewed?.(\n\t\t\t\t\t\t\t\t\t\t\t\tformat(\n\t\t\t\t\t\t\t\t\t\t\t\t\tnextFocusable,\n\t\t\t\t\t\t\t\t\t\t\t\t\tTIMEZONELESS_FORMAT\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} )\n\t\t\t\t) }\n\t\t\t</Calendar>\n\t\t</Wrapper>\n\t);\n}\n\ntype DayProps = {\n\tday: Date;\n\tcolumn: number;\n\tisSelected: boolean;\n\tisFocusable: boolean;\n\tisFocusAllowed: boolean;\n\tisToday: boolean;\n\tnumEvents: number;\n\tisInvalid: boolean;\n\tonClick: () => void;\n\tonKeyDown: KeyboardEventHandler;\n};\n\nfunction Day( {\n\tday,\n\tcolumn,\n\tisSelected,\n\tisFocusable,\n\tisFocusAllowed,\n\tisToday,\n\tisInvalid,\n\tnumEvents,\n\tonClick,\n\tonKeyDown,\n}: DayProps ) {\n\tconst ref = useRef< HTMLButtonElement >();\n\n\t// Focus the day when it becomes focusable, e.g. because an arrow key is\n\t// pressed. Only do this if focus is allowed - this stops us stealing focus\n\t// from e.g. a TimePicker input.\n\tuseEffect( () => {\n\t\tif ( ref.current && isFocusable && isFocusAllowed ) {\n\t\t\tref.current.focus();\n\t\t}\n\t\t// isFocusAllowed is not a dep as there is no point calling focus() on\n\t\t// an already focused element.\n\t}, [ isFocusable ] );\n\n\treturn (\n\t\t<DayButton\n\t\t\tref={ ref }\n\t\t\tclassName=\"components-datetime__date__day\" // Unused, for backwards compatibility.\n\t\t\tdisabled={ isInvalid }\n\t\t\ttabIndex={ isFocusable ? 0 : -1 }\n\t\t\taria-label={ getDayLabel( day, isSelected, numEvents ) }\n\t\t\tcolumn={ column }\n\t\t\tisSelected={ isSelected }\n\t\t\tisToday={ isToday }\n\t\t\thasEvents={ numEvents > 0 }\n\t\t\tonClick={ onClick }\n\t\t\tonKeyDown={ onKeyDown }\n\t\t>\n\t\t\t{ dateI18n( 'j', day, -day.getTimezoneOffset() ) }\n\t\t</DayButton>\n\t);\n}\n\nfunction getDayLabel( date: Date, isSelected: boolean, numEvents: number ) {\n\tconst { formats } = getSettings();\n\tconst localizedDate = dateI18n(\n\t\tformats.date,\n\t\tdate,\n\t\t-date.getTimezoneOffset()\n\t);\n\tif ( isSelected && numEvents > 0 ) {\n\t\treturn sprintf(\n\t\t\t// translators: 1: The calendar date. 2: Number of events on the calendar date.\n\t\t\t_n(\n\t\t\t\t'%1$s. Selected. There is %2$d event',\n\t\t\t\t'%1$s. Selected. There are %2$d events',\n\t\t\t\tnumEvents\n\t\t\t),\n\t\t\tlocalizedDate,\n\t\t\tnumEvents\n\t\t);\n\t} else if ( isSelected ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: The calendar date.\n\t\t\t__( '%1$s. Selected' ),\n\t\t\tlocalizedDate\n\t\t);\n\t} else if ( numEvents > 0 ) {\n\t\treturn sprintf(\n\t\t\t// translators: 1: The calendar date. 2: Number of events on the calendar date.\n\t\t\t_n(\n\t\t\t\t'%1$s. There is %2$d event',\n\t\t\t\t'%1$s. There are %2$d events',\n\t\t\t\tnumEvents\n\t\t\t),\n\t\t\tlocalizedDate,\n\t\t\tnumEvents\n\t\t);\n\t}\n\treturn localizedDate;\n}\n\nexport default DatePicker;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAmBA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,UAAA,GAAAL,OAAA;AAEA,IAAAM,OAAA,GAAAN,OAAA;AAQA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAC,sBAAA,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