@wordpress/components 28.6.0 → 28.8.1-next.1f6eadc42.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 +109 -0
- package/CONTRIBUTING.md +42 -19
- package/build/alignment-matrix-control/cell.js +4 -7
- package/build/alignment-matrix-control/cell.js.map +1 -1
- package/build/alignment-matrix-control/icon.js +31 -19
- package/build/alignment-matrix-control/icon.js.map +1 -1
- package/build/alignment-matrix-control/index.js +55 -51
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/alignment-matrix-control/styles.js +73 -0
- package/build/alignment-matrix-control/styles.js.map +1 -0
- package/build/alignment-matrix-control/types.js.map +1 -1
- package/build/angle-picker-control/angle-circle.js +9 -9
- package/build/angle-picker-control/angle-circle.js.map +1 -1
- package/build/border-control/border-control/component.js +18 -13
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/box-control/utils.js +1 -1
- package/build/box-control/utils.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker-option.js +15 -9
- package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker.js +15 -12
- package/build/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build/circular-option-picker/types.js.map +1 -1
- package/build/clipboard-button/index.js +6 -6
- package/build/clipboard-button/index.js.map +1 -1
- package/build/color-palette/utils.js +1 -2
- package/build/color-palette/utils.js.map +1 -1
- package/build/color-picker/color-copy-button.js +8 -8
- package/build/color-picker/color-copy-button.js.map +1 -1
- package/build/color-picker/hex-input.js +8 -8
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/color-picker/input-with-slider.js +8 -8
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/color-picker/styles.js +8 -8
- package/build/color-picker/styles.js.map +1 -1
- package/build/combobox-control/types.js.map +1 -1
- package/build/composite/context.js +1 -1
- package/build/composite/context.js.map +1 -1
- package/build/composite/group-label.js +33 -0
- package/build/composite/group-label.js.map +1 -0
- package/build/composite/group.js +33 -0
- package/build/composite/group.js.map +1 -0
- package/build/composite/hover.js +33 -0
- package/build/composite/hover.js.map +1 -0
- package/build/composite/index.js +63 -118
- package/build/composite/index.js.map +1 -1
- package/build/composite/item.js +33 -0
- package/build/composite/item.js.map +1 -0
- package/build/composite/legacy/index.js +59 -7
- package/build/composite/legacy/index.js.map +1 -1
- package/build/composite/row.js +33 -0
- package/build/composite/row.js.map +1 -0
- package/build/composite/typeahead.js +33 -0
- package/build/composite/typeahead.js.map +1 -0
- package/build/composite/types.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.js +8 -8
- package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build/custom-select-control-v2/styles.js +12 -14
- package/build/custom-select-control-v2/styles.js.map +1 -1
- package/build/date-time/date/index.js +1 -1
- package/build/date-time/date/index.js.map +1 -1
- package/build/date-time/date/styles.js +37 -26
- package/build/date-time/date/styles.js.map +1 -1
- package/build/date-time/date/use-lilius/index.js +163 -0
- package/build/date-time/date/use-lilius/index.js.map +1 -0
- package/build/date-time/time/time-input/index.js +17 -19
- package/build/date-time/time/time-input/index.js.map +1 -1
- package/build/dimension-control/index.js +6 -1
- package/build/dimension-control/index.js.map +1 -1
- package/build/draggable/index.js +4 -4
- package/build/draggable/index.js.map +1 -1
- package/build/dropdown-menu-v2/checkbox-item.js +69 -0
- package/build/dropdown-menu-v2/checkbox-item.js.map +1 -0
- package/build/dropdown-menu-v2/context.js +17 -0
- package/build/dropdown-menu-v2/context.js.map +1 -0
- package/build/dropdown-menu-v2/group-label.js +40 -0
- package/build/dropdown-menu-v2/group-label.js.map +1 -0
- package/build/dropdown-menu-v2/group.js +29 -0
- package/build/dropdown-menu-v2/group.js.map +1 -0
- package/build/dropdown-menu-v2/index.js +58 -146
- package/build/dropdown-menu-v2/index.js.map +1 -1
- package/build/dropdown-menu-v2/item-help-text.js +27 -0
- package/build/dropdown-menu-v2/item-help-text.js.map +1 -0
- package/build/dropdown-menu-v2/item-label.js +27 -0
- package/build/dropdown-menu-v2/item-label.js.map +1 -0
- package/build/dropdown-menu-v2/item.js +53 -0
- package/build/dropdown-menu-v2/item.js.map +1 -0
- package/build/dropdown-menu-v2/radio-item.js +79 -0
- package/build/dropdown-menu-v2/radio-item.js.map +1 -0
- package/build/dropdown-menu-v2/separator.js +30 -0
- package/build/dropdown-menu-v2/separator.js.map +1 -0
- package/build/dropdown-menu-v2/styles.js +54 -78
- package/build/dropdown-menu-v2/styles.js.map +1 -1
- package/build/dropdown-menu-v2/types.js.map +1 -1
- package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js +27 -0
- package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
- package/build/focal-point-picker/styles/focal-point-style.js +7 -2
- package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build/form-token-field/types.js.map +1 -1
- package/build/index.js +13 -0
- package/build/index.js.map +1 -1
- package/build/input-control/index.js +2 -2
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js +5 -10
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/input-prefix-wrapper.js +3 -3
- package/build/input-control/input-prefix-wrapper.js.map +1 -1
- package/build/input-control/input-suffix-wrapper.js +2 -3
- package/build/input-control/input-suffix-wrapper.js.map +1 -1
- package/build/input-control/reducer/reducer.js +8 -8
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +75 -45
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/input-control/types.js.map +1 -1
- package/build/input-control/utils.js +3 -3
- package/build/input-control/utils.js.map +1 -1
- package/build/item-group/styles.js +10 -10
- package/build/item-group/styles.js.map +1 -1
- package/build/modal/index.js +16 -9
- package/build/modal/index.js.map +1 -1
- package/build/navigation/index.js +4 -4
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/styles/navigation-styles.js +13 -13
- package/build/navigation/styles/navigation-styles.js.map +1 -1
- package/build/navigator/index.js +12 -13
- package/build/navigator/index.js.map +1 -1
- package/build/navigator/navigator-back-button/hook.js +2 -2
- package/build/navigator/navigator-back-button/hook.js.map +1 -1
- package/build/navigator/navigator-button/hook.js +2 -2
- package/build/navigator/navigator-button/hook.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +99 -67
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +5 -0
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/navigator/navigator-to-parent-button/component.js +2 -2
- package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
- package/build/navigator/types.js.map +1 -1
- package/build/navigator/use-navigator.js +1 -2
- package/build/navigator/use-navigator.js.map +1 -1
- package/build/palette-edit/index.js +2 -2
- package/build/palette-edit/index.js.map +1 -1
- package/build/private-apis.js +1 -14
- package/build/private-apis.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +30 -30
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +12 -12
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/fill.js +4 -4
- package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build/slot-fill/index.js +1 -0
- package/build/slot-fill/index.js.map +1 -1
- package/build/snackbar/index.js +4 -4
- package/build/snackbar/index.js.map +1 -1
- package/build/tabs/index.js +4 -4
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/styles.js +3 -3
- package/build/tabs/styles.js.map +1 -1
- package/build/tabs/tablist.js +5 -4
- package/build/tabs/tablist.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/utils.js +6 -6
- package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +6 -6
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +7 -7
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/utils/config-values.js +6 -4
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/element-rect.js +73 -105
- package/build/utils/element-rect.js.map +1 -1
- package/build/utils/hooks/use-update-effect.js +4 -4
- package/build/utils/hooks/use-update-effect.js.map +1 -1
- package/build-module/alignment-matrix-control/cell.js +2 -5
- package/build-module/alignment-matrix-control/cell.js.map +1 -1
- package/build-module/alignment-matrix-control/icon.js +31 -19
- package/build-module/alignment-matrix-control/icon.js.map +1 -1
- package/build-module/alignment-matrix-control/index.js +55 -50
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/alignment-matrix-control/styles.js +70 -0
- package/build-module/alignment-matrix-control/styles.js.map +1 -0
- package/build-module/alignment-matrix-control/types.js.map +1 -1
- package/build-module/angle-picker-control/angle-circle.js +9 -9
- package/build-module/angle-picker-control/angle-circle.js.map +1 -1
- package/build-module/border-control/border-control/component.js +18 -13
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/box-control/utils.js +1 -1
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-option.js +16 -10
- package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker.js +16 -13
- package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build-module/circular-option-picker/types.js.map +1 -1
- package/build-module/clipboard-button/index.js +6 -6
- package/build-module/clipboard-button/index.js.map +1 -1
- package/build-module/color-palette/utils.js +1 -2
- package/build-module/color-palette/utils.js.map +1 -1
- package/build-module/color-picker/color-copy-button.js +8 -8
- package/build-module/color-picker/color-copy-button.js.map +1 -1
- package/build-module/color-picker/hex-input.js +7 -8
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +7 -8
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/color-picker/styles.js +8 -8
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/combobox-control/types.js.map +1 -1
- package/build-module/composite/context.js +1 -1
- package/build-module/composite/context.js.map +1 -1
- package/build-module/composite/group-label.js +25 -0
- package/build-module/composite/group-label.js.map +1 -0
- package/build-module/composite/group.js +25 -0
- package/build-module/composite/group.js.map +1 -0
- package/build-module/composite/hover.js +25 -0
- package/build-module/composite/hover.js.map +1 -0
- package/build-module/composite/index.js +64 -118
- package/build-module/composite/index.js.map +1 -1
- package/build-module/composite/item.js +25 -0
- package/build-module/composite/item.js.map +1 -0
- package/build-module/composite/legacy/index.js +57 -8
- package/build-module/composite/legacy/index.js.map +1 -1
- package/build-module/composite/row.js +25 -0
- package/build-module/composite/row.js.map +1 -0
- package/build-module/composite/typeahead.js +25 -0
- package/build-module/composite/typeahead.js.map +1 -0
- package/build-module/composite/types.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +8 -8
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-select-control-v2/styles.js +12 -14
- package/build-module/custom-select-control-v2/styles.js.map +1 -1
- package/build-module/date-time/date/index.js +1 -2
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/date-time/date/styles.js +33 -26
- package/build-module/date-time/date/styles.js.map +1 -1
- package/build-module/date-time/date/use-lilius/index.js +158 -0
- package/build-module/date-time/date/use-lilius/index.js.map +1 -0
- package/build-module/date-time/time/time-input/index.js +17 -19
- package/build-module/date-time/time/time-input/index.js.map +1 -1
- package/build-module/dimension-control/index.js +6 -1
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/draggable/index.js +4 -4
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/dropdown-menu-v2/checkbox-item.js +62 -0
- package/build-module/dropdown-menu-v2/checkbox-item.js.map +1 -0
- package/build-module/dropdown-menu-v2/context.js +11 -0
- package/build-module/dropdown-menu-v2/context.js.map +1 -0
- package/build-module/dropdown-menu-v2/group-label.js +32 -0
- package/build-module/dropdown-menu-v2/group-label.js.map +1 -0
- package/build-module/dropdown-menu-v2/group.js +21 -0
- package/build-module/dropdown-menu-v2/group.js.map +1 -0
- package/build-module/dropdown-menu-v2/index.js +57 -144
- package/build-module/dropdown-menu-v2/index.js.map +1 -1
- package/build-module/dropdown-menu-v2/item-help-text.js +19 -0
- package/build-module/dropdown-menu-v2/item-help-text.js.map +1 -0
- package/build-module/dropdown-menu-v2/item-label.js +19 -0
- package/build-module/dropdown-menu-v2/item-label.js.map +1 -0
- package/build-module/dropdown-menu-v2/item.js +46 -0
- package/build-module/dropdown-menu-v2/item.js.map +1 -0
- package/build-module/dropdown-menu-v2/radio-item.js +72 -0
- package/build-module/dropdown-menu-v2/radio-item.js.map +1 -0
- package/build-module/dropdown-menu-v2/separator.js +22 -0
- package/build-module/dropdown-menu-v2/separator.js.map +1 -0
- package/build-module/dropdown-menu-v2/styles.js +54 -78
- package/build-module/dropdown-menu-v2/styles.js.map +1 -1
- package/build-module/dropdown-menu-v2/types.js.map +1 -1
- package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js +20 -0
- package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
- package/build-module/focal-point-picker/styles/focal-point-style.js +6 -2
- package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build-module/form-token-field/types.js.map +1 -1
- package/build-module/index.js +3 -1
- package/build-module/index.js.map +1 -1
- package/build-module/input-control/index.js +2 -2
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js +6 -11
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/input-prefix-wrapper.js +4 -3
- package/build-module/input-control/input-prefix-wrapper.js.map +1 -1
- package/build-module/input-control/input-suffix-wrapper.js +3 -3
- package/build-module/input-control/input-suffix-wrapper.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js +8 -8
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +74 -44
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/input-control/types.js.map +1 -1
- package/build-module/input-control/utils.js +3 -3
- package/build-module/input-control/utils.js.map +1 -1
- package/build-module/item-group/styles.js +10 -10
- package/build-module/item-group/styles.js.map +1 -1
- package/build-module/modal/index.js +17 -9
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigation/index.js +4 -4
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/styles/navigation-styles.js +14 -14
- package/build-module/navigation/styles/navigation-styles.js.map +1 -1
- package/build-module/navigator/index.js +6 -6
- package/build-module/navigator/index.js.map +1 -1
- package/build-module/navigator/navigator-back-button/hook.js +1 -1
- package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-button/hook.js +1 -1
- package/build-module/navigator/navigator-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +99 -67
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +4 -0
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/navigator/navigator-to-parent-button/component.js +1 -1
- package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -1
- package/build-module/navigator/types.js.map +1 -1
- package/build-module/navigator/use-navigator.js +1 -2
- package/build-module/navigator/use-navigator.js.map +1 -1
- package/build-module/palette-edit/index.js +2 -2
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/private-apis.js +1 -14
- package/build-module/private-apis.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +31 -31
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +5 -5
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +13 -13
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/fill.js +4 -4
- package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build-module/slot-fill/index.js +1 -0
- package/build-module/slot-fill/index.js.map +1 -1
- package/build-module/snackbar/index.js +4 -4
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/tabs/index.js +4 -4
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/styles.js +4 -4
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/tabs/tablist.js +5 -4
- package/build-module/tabs/tablist.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/utils.js +6 -6
- package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +6 -6
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +7 -7
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/utils/config-values.js +6 -4
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/element-rect.js +74 -105
- package/build-module/utils/element-rect.js.map +1 -1
- package/build-module/utils/hooks/use-update-effect.js +4 -4
- package/build-module/utils/hooks/use-update-effect.js.map +1 -1
- package/build-style/style-rtl.css +12 -27
- package/build-style/style.css +12 -27
- package/build-types/alignment-matrix-control/cell.d.ts +1 -1
- package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/icon.d.ts +1 -1
- package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/index.d.ts +16 -6
- package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/{styles/alignment-matrix-control-styles.d.ts → styles.d.ts} +9 -10
- package/build-types/alignment-matrix-control/styles.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/types.d.ts +12 -1
- package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
- package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/utils.d.ts +1 -1
- package/build-types/box-control/utils.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
- package/build-types/circular-option-picker/types.d.ts +2 -2
- package/build-types/circular-option-picker/types.d.ts.map +1 -1
- package/build-types/color-palette/utils.d.ts.map +1 -1
- package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
- package/build-types/color-picker/hex-input.d.ts.map +1 -1
- package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/combobox-control/types.d.ts +1 -0
- package/build-types/combobox-control/types.d.ts.map +1 -1
- package/build-types/composite/context.d.ts.map +1 -1
- package/build-types/composite/group-label.d.ts +3 -0
- package/build-types/composite/group-label.d.ts.map +1 -0
- package/build-types/composite/group.d.ts +3 -0
- package/build-types/composite/group.d.ts.map +1 -0
- package/build-types/composite/hover.d.ts +3 -0
- package/build-types/composite/hover.d.ts.map +1 -0
- package/build-types/composite/index.d.ts +63 -47
- package/build-types/composite/index.d.ts.map +1 -1
- package/build-types/composite/item.d.ts +3 -0
- package/build-types/composite/item.d.ts.map +1 -0
- package/build-types/composite/legacy/index.d.ts +23 -3
- package/build-types/composite/legacy/index.d.ts.map +1 -1
- package/build-types/composite/legacy/stories/index.story.d.ts.map +1 -1
- package/build-types/composite/row.d.ts +3 -0
- package/build-types/composite/row.d.ts.map +1 -0
- package/build-types/composite/stories/index.story.d.ts +9 -8
- package/build-types/composite/stories/index.story.d.ts.map +1 -1
- package/build-types/composite/typeahead.d.ts +3 -0
- package/build-types/composite/typeahead.d.ts.map +1 -0
- package/build-types/composite/types.d.ts +12 -11
- package/build-types/composite/types.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts +0 -3
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts.map +1 -1
- package/build-types/date-time/date/test/use-lilius.d.ts +2 -0
- package/build-types/date-time/date/test/use-lilius.d.ts.map +1 -0
- package/build-types/date-time/date/use-lilius/index.d.ts +169 -0
- package/build-types/date-time/date/use-lilius/index.d.ts.map +1 -0
- package/build-types/date-time/time/time-input/index.d.ts.map +1 -1
- package/build-types/dimension-control/index.d.ts +1 -1
- package/build-types/dimension-control/index.d.ts.map +1 -1
- package/build-types/dimension-control/stories/index.story.d.ts +5 -0
- package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/checkbox-item.d.ts +3 -0
- package/build-types/dropdown-menu-v2/checkbox-item.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/context.d.ts +6 -0
- package/build-types/dropdown-menu-v2/context.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/group-label.d.ts +3 -0
- package/build-types/dropdown-menu-v2/group-label.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/group.d.ts +3 -0
- package/build-types/dropdown-menu-v2/group.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/index.d.ts +39 -18
- package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/item-help-text.d.ts +6 -0
- package/build-types/dropdown-menu-v2/item-help-text.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/item-label.d.ts +6 -0
- package/build-types/dropdown-menu-v2/item-label.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/item.d.ts +3 -0
- package/build-types/dropdown-menu-v2/item.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/radio-item.d.ts +3 -0
- package/build-types/dropdown-menu-v2/radio-item.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/separator.d.ts +3 -0
- package/build-types/dropdown-menu-v2/separator.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts +10 -10
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/styles.d.ts +14 -6
- package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/types.d.ts +6 -0
- package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts +8 -0
- package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts.map +1 -0
- package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
- package/build-types/form-token-field/types.d.ts +1 -0
- package/build-types/form-token-field/types.d.ts.map +1 -1
- package/build-types/index.d.ts +4 -1
- package/build-types/index.d.ts.map +1 -1
- package/build-types/input-control/input-base.d.ts.map +1 -1
- package/build-types/input-control/input-prefix-wrapper.d.ts +2 -2
- package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -1
- package/build-types/input-control/input-suffix-wrapper.d.ts +2 -2
- package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -1
- package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
- package/build-types/input-control/stories/index.story.d.ts +9 -0
- package/build-types/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts +15 -9
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +23 -6
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/modal/stories/index.story.d.ts +3 -0
- package/build-types/modal/stories/index.story.d.ts.map +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
- package/build-types/navigator/index.d.ts +6 -6
- package/build-types/navigator/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/stories/index.story.d.ts +1 -1
- package/build-types/navigator/stories/index.story.d.ts.map +1 -1
- package/build-types/navigator/types.d.ts +3 -1
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/navigator/use-navigator.d.ts +1 -2
- package/build-types/navigator/use-navigator.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/slot-fill/index.d.ts +3 -0
- package/build-types/slot-fill/index.d.ts.map +1 -1
- package/build-types/tabs/index.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/tabs/tablist.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +3 -3
- package/build-types/utils/element-rect.d.ts +32 -74
- package/build-types/utils/element-rect.d.ts.map +1 -1
- package/package.json +19 -20
- package/src/alignment-matrix-control/README.md +1 -5
- package/src/alignment-matrix-control/cell.tsx +3 -9
- package/src/alignment-matrix-control/icon.tsx +48 -30
- package/src/alignment-matrix-control/index.tsx +60 -50
- package/src/alignment-matrix-control/stories/index.story.tsx +3 -12
- package/src/alignment-matrix-control/styles.ts +113 -0
- package/src/alignment-matrix-control/types.ts +12 -1
- package/src/angle-picker-control/angle-circle.tsx +11 -9
- package/src/border-control/border-control/component.tsx +23 -16
- package/src/box-control/utils.ts +1 -1
- package/src/circular-option-picker/circular-option-picker-option.tsx +16 -19
- package/src/circular-option-picker/circular-option-picker.tsx +26 -12
- package/src/circular-option-picker/types.ts +2 -2
- package/src/clipboard-button/index.tsx +6 -6
- package/src/color-palette/test/utils.ts +21 -2
- package/src/color-palette/utils.ts +1 -3
- package/src/color-picker/color-copy-button.tsx +10 -8
- package/src/color-picker/hex-input.tsx +6 -10
- package/src/color-picker/input-with-slider.tsx +6 -10
- package/src/color-picker/styles.ts +1 -1
- package/src/combobox-control/types.ts +1 -0
- package/src/composite/README.md +5 -24
- package/src/composite/{context.ts → context.tsx} +1 -2
- package/src/composite/group-label.tsx +30 -0
- package/src/composite/group.tsx +30 -0
- package/src/composite/hover.tsx +30 -0
- package/src/composite/index.tsx +71 -166
- package/src/composite/item.tsx +30 -0
- package/src/composite/legacy/index.tsx +73 -11
- package/src/composite/legacy/stories/index.story.tsx +2 -1
- package/src/composite/legacy/test/index.tsx +57 -1
- package/src/composite/row.tsx +30 -0
- package/src/composite/stories/index.story.tsx +254 -365
- package/src/composite/typeahead.tsx +30 -0
- package/src/composite/types.ts +14 -16
- package/src/custom-gradient-picker/gradient-bar/control-points.tsx +10 -10
- package/src/custom-gradient-picker/style.scss +2 -21
- package/src/custom-select-control-v2/styles.ts +4 -4
- package/src/date-time/date/index.tsx +1 -1
- package/src/date-time/date/styles.ts +33 -13
- package/src/date-time/date/test/use-lilius.ts +417 -0
- package/src/date-time/date/use-lilius/index.ts +394 -0
- package/src/date-time/time/test/index.tsx +3 -6
- package/src/date-time/time/time-input/index.tsx +25 -25
- package/src/date-time/time/time-input/test/index.tsx +6 -7
- package/src/dimension-control/README.md +4 -0
- package/src/dimension-control/index.tsx +7 -1
- package/src/dimension-control/stories/index.story.tsx +7 -2
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +16 -16
- package/src/dimension-control/test/index.test.js +1 -0
- package/src/draggable/index.tsx +4 -4
- package/src/dropdown-menu-v2/README.md +73 -60
- package/src/dropdown-menu-v2/checkbox-item.tsx +63 -0
- package/src/dropdown-menu-v2/context.tsx +13 -0
- package/src/dropdown-menu-v2/group-label.tsx +37 -0
- package/src/dropdown-menu-v2/group.tsx +26 -0
- package/src/dropdown-menu-v2/index.tsx +57 -197
- package/src/dropdown-menu-v2/item-help-text.tsx +23 -0
- package/src/dropdown-menu-v2/item-label.tsx +23 -0
- package/src/dropdown-menu-v2/item.tsx +50 -0
- package/src/dropdown-menu-v2/radio-item.tsx +70 -0
- package/src/dropdown-menu-v2/separator.tsx +27 -0
- package/src/dropdown-menu-v2/stories/index.story.tsx +295 -262
- package/src/dropdown-menu-v2/styles.ts +102 -66
- package/src/dropdown-menu-v2/test/index.tsx +159 -132
- package/src/dropdown-menu-v2/types.ts +7 -0
- package/src/dropdown-menu-v2/use-temporary-focus-visible-fix.ts +22 -0
- package/src/focal-point-picker/styles/focal-point-style.ts +6 -1
- package/src/form-toggle/style.scss +1 -1
- package/src/form-token-field/style.scss +2 -3
- package/src/form-token-field/types.ts +1 -0
- package/src/index.ts +6 -1
- package/src/input-control/index.tsx +2 -2
- package/src/input-control/input-base.tsx +4 -14
- package/src/input-control/input-prefix-wrapper.tsx +8 -4
- package/src/input-control/input-suffix-wrapper.tsx +4 -6
- package/src/input-control/reducer/reducer.ts +13 -10
- package/src/input-control/stories/index.story.tsx +31 -12
- package/src/input-control/styles/input-control-styles.tsx +42 -11
- package/src/input-control/types.ts +23 -7
- package/src/input-control/utils.ts +3 -3
- package/src/item-group/styles.ts +3 -3
- package/src/item-group/test/__snapshots__/index.js.snap +3 -3
- package/src/modal/index.tsx +21 -12
- package/src/modal/stories/index.story.tsx +8 -14
- package/src/modal/style.scss +5 -9
- package/src/navigation/index.tsx +4 -4
- package/src/navigation/styles/navigation-styles.tsx +3 -3
- package/src/navigator/index.ts +6 -6
- package/src/navigator/navigator-back-button/hook.ts +1 -1
- package/src/navigator/navigator-button/hook.ts +1 -1
- package/src/navigator/navigator-provider/README.md +2 -3
- package/src/navigator/navigator-provider/component.tsx +97 -82
- package/src/navigator/navigator-screen/component.tsx +7 -0
- package/src/navigator/navigator-to-parent-button/component.tsx +1 -1
- package/src/navigator/stories/index.story.tsx +82 -253
- package/src/navigator/test/index.tsx +8 -0
- package/src/navigator/types.ts +3 -1
- package/src/navigator/use-navigator.ts +1 -3
- package/src/palette-edit/index.tsx +2 -2
- package/src/popover/style.scss +2 -1
- package/src/private-apis.ts +1 -23
- package/src/range-control/styles/range-control-styles.ts +7 -7
- package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +2 -2
- package/src/resizable-box/style.scss +2 -2
- package/src/select-control/README.md +2 -2
- package/src/select-control/styles/select-control-styles.ts +5 -5
- package/src/slot-fill/bubbles-virtually/fill.tsx +4 -4
- package/src/slot-fill/index.tsx +1 -0
- package/src/snackbar/index.tsx +4 -4
- package/src/tab-panel/style.scss +0 -1
- package/src/tabs/index.tsx +8 -4
- package/src/tabs/styles.ts +42 -14
- package/src/tabs/tablist.tsx +5 -4
- package/src/text-control/style.scss +3 -2
- package/src/toggle-group-control/toggle-group-control/utils.ts +7 -7
- package/src/tools-panel/tools-panel/hook.ts +6 -6
- package/src/unit-control/styles/unit-control-styles.ts +2 -1
- package/src/utils/config-values.js +6 -4
- package/src/utils/element-rect.ts +93 -130
- package/src/utils/hooks/use-update-effect.js +4 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -66
- package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -77
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
- package/build/navigator/navigator-back-button/index.js +0 -14
- package/build/navigator/navigator-back-button/index.js.map +0 -1
- package/build/navigator/navigator-button/index.js +0 -14
- package/build/navigator/navigator-button/index.js.map +0 -1
- package/build/navigator/navigator-provider/index.js +0 -14
- package/build/navigator/navigator-provider/index.js.map +0 -1
- package/build/navigator/navigator-screen/index.js +0 -14
- package/build/navigator/navigator-screen/index.js.map +0 -1
- package/build/navigator/navigator-to-parent-button/index.js +0 -14
- package/build/navigator/navigator-to-parent-button/index.js.map +0 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -63
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -72
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
- package/build-module/navigator/navigator-back-button/index.js +0 -2
- package/build-module/navigator/navigator-back-button/index.js.map +0 -1
- package/build-module/navigator/navigator-button/index.js +0 -2
- package/build-module/navigator/navigator-button/index.js.map +0 -1
- package/build-module/navigator/navigator-provider/index.js +0 -2
- package/build-module/navigator/navigator-provider/index.js.map +0 -1
- package/build-module/navigator/navigator-screen/index.js +0 -2
- package/build-module/navigator/navigator-screen/index.js.map +0 -1
- package/build-module/navigator/navigator-to-parent-button/index.js +0 -2
- package/build-module/navigator/navigator-to-parent-button/index.js.map +0 -1
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +0 -18
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts.map +0 -1
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +0 -1
- package/build-types/composite/stories/utils.d.ts +0 -29
- package/build-types/composite/stories/utils.d.ts.map +0 -1
- package/build-types/navigator/navigator-back-button/index.d.ts +0 -2
- package/build-types/navigator/navigator-back-button/index.d.ts.map +0 -1
- package/build-types/navigator/navigator-button/index.d.ts +0 -2
- package/build-types/navigator/navigator-button/index.d.ts.map +0 -1
- package/build-types/navigator/navigator-provider/index.d.ts +0 -2
- package/build-types/navigator/navigator-provider/index.d.ts.map +0 -1
- package/build-types/navigator/navigator-screen/index.d.ts +0 -2
- package/build-types/navigator/navigator-screen/index.d.ts.map +0 -1
- package/build-types/navigator/navigator-to-parent-button/index.d.ts +0 -2
- package/build-types/navigator/navigator-to-parent-button/index.d.ts.map +0 -1
- package/src/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.ts +0 -77
- package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +0 -102
- package/src/composite/stories/utils.tsx +0 -76
- package/src/navigator/navigator-back-button/index.ts +0 -1
- package/src/navigator/navigator-button/index.ts +0 -1
- package/src/navigator/navigator-provider/index.ts +0 -1
- package/src/navigator/navigator-screen/index.ts +0 -1
- package/src/navigator/navigator-to-parent-button/index.ts +0 -1
|
@@ -2,98 +2,13 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { useLayoutEffect, useRef, useState } from '@wordpress/element';
|
|
6
|
+
import { useResizeObserver } from '@wordpress/compose';
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
8
9
|
*/
|
|
9
10
|
import { useEvent } from './hooks/use-event';
|
|
10
11
|
|
|
11
|
-
/**
|
|
12
|
-
* `useTrackElementRectUpdates` options.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Tracks an element's "rect" (size and position) and fires `onRect` for all
|
|
17
|
-
* of its discrete values. The element can be changed dynamically and **it
|
|
18
|
-
* must not be stored in a ref**. Instead, it should be stored in a React
|
|
19
|
-
* state or equivalent.
|
|
20
|
-
*
|
|
21
|
-
* By default, `onRect` is called initially for the target element (including
|
|
22
|
-
* when the target element changes), not only on size or position updates.
|
|
23
|
-
* This allows consumers of the hook to always be in sync with all rect values
|
|
24
|
-
* of the target element throughout its lifetime. This behavior can be
|
|
25
|
-
* disabled by setting the `fireOnElementInit` option to `false`.
|
|
26
|
-
*
|
|
27
|
-
* Under the hood, it sets up a `ResizeObserver` that tracks the element. The
|
|
28
|
-
* target element can be changed dynamically, and the observer will be
|
|
29
|
-
* updated accordingly.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
*
|
|
33
|
-
* ```tsx
|
|
34
|
-
* const [ targetElement, setTargetElement ] = useState< HTMLElement | null >();
|
|
35
|
-
*
|
|
36
|
-
* useTrackElementRectUpdates( targetElement, ( element ) => {
|
|
37
|
-
* console.log( 'Element resized:', element );
|
|
38
|
-
* } );
|
|
39
|
-
*
|
|
40
|
-
* <div ref={ setTargetElement } />;
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
export function useTrackElementRectUpdates(
|
|
44
|
-
/**
|
|
45
|
-
* The target element to observe. It can be changed dynamically.
|
|
46
|
-
*/
|
|
47
|
-
targetElement,
|
|
48
|
-
/**
|
|
49
|
-
* Callback to fire when the element is resized. It will also be
|
|
50
|
-
* called when the observer is set up, unless `fireOnElementInit` is
|
|
51
|
-
* set to `false`.
|
|
52
|
-
*/
|
|
53
|
-
onRect, {
|
|
54
|
-
fireOnElementInit = true
|
|
55
|
-
} = {}) {
|
|
56
|
-
const onRectEvent = useEvent(onRect);
|
|
57
|
-
const observedElementRef = useRef();
|
|
58
|
-
const resizeObserverRef = useRef();
|
|
59
|
-
|
|
60
|
-
// TODO: could this be a layout effect?
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
if (targetElement === observedElementRef.current) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
observedElementRef.current = targetElement;
|
|
66
|
-
|
|
67
|
-
// Set up a ResizeObserver.
|
|
68
|
-
if (!resizeObserverRef.current) {
|
|
69
|
-
resizeObserverRef.current = new ResizeObserver(entries => {
|
|
70
|
-
if (observedElementRef.current) {
|
|
71
|
-
onRectEvent(observedElementRef.current, entries);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
const {
|
|
76
|
-
current: resizeObserver
|
|
77
|
-
} = resizeObserverRef;
|
|
78
|
-
|
|
79
|
-
// Observe new element.
|
|
80
|
-
if (targetElement) {
|
|
81
|
-
if (fireOnElementInit) {
|
|
82
|
-
// TODO: investigate if this can be removed,
|
|
83
|
-
// see: https://stackoverflow.com/a/60026394
|
|
84
|
-
onRectEvent(targetElement);
|
|
85
|
-
}
|
|
86
|
-
resizeObserver.observe(targetElement);
|
|
87
|
-
}
|
|
88
|
-
return () => {
|
|
89
|
-
// Unobserve previous element.
|
|
90
|
-
if (observedElementRef.current) {
|
|
91
|
-
resizeObserver.unobserve(observedElementRef.current);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
}, [fireOnElementInit, onRectEvent, targetElement]);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
12
|
/**
|
|
98
13
|
* The position and dimensions of an element, relative to its offset parent.
|
|
99
14
|
*/
|
|
@@ -102,44 +17,98 @@ onRect, {
|
|
|
102
17
|
* An `ElementOffsetRect` object with all values set to zero.
|
|
103
18
|
*/
|
|
104
19
|
export const NULL_ELEMENT_OFFSET_RECT = {
|
|
105
|
-
left: 0,
|
|
106
20
|
top: 0,
|
|
21
|
+
right: 0,
|
|
22
|
+
bottom: 0,
|
|
23
|
+
left: 0,
|
|
107
24
|
width: 0,
|
|
108
25
|
height: 0
|
|
109
26
|
};
|
|
110
27
|
|
|
111
28
|
/**
|
|
112
29
|
* Returns the position and dimensions of an element, relative to its offset
|
|
113
|
-
* parent
|
|
114
|
-
*
|
|
30
|
+
* parent, with subpixel precision. Values reflect the real measures before any
|
|
31
|
+
* potential scaling distortions along the X and Y axes.
|
|
115
32
|
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
33
|
+
* Useful in contexts where plain `getBoundingClientRect` calls or `ResizeObserver`
|
|
34
|
+
* entries are not suitable, such as when the element is transformed, and when
|
|
35
|
+
* `element.offset<Top|Left|Width|Height>` methods are not precise enough.
|
|
36
|
+
*
|
|
37
|
+
* **Note:** in some contexts, like when the scale is 0, this method will fail
|
|
38
|
+
* because it's impossible to calculate a scaling ratio. When that happens, it
|
|
39
|
+
* will return `undefined`.
|
|
120
40
|
*/
|
|
121
41
|
export function getElementOffsetRect(element) {
|
|
42
|
+
var _element$offsetParent;
|
|
43
|
+
// Position and dimension values computed with `getBoundingClientRect` have
|
|
44
|
+
// subpixel precision, but are affected by distortions since they represent
|
|
45
|
+
// the "real" measures, or in other words, the actual final values as rendered
|
|
46
|
+
// by the browser.
|
|
47
|
+
const rect = element.getBoundingClientRect();
|
|
48
|
+
if (rect.width === 0 || rect.height === 0) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const offsetParentRect = (_element$offsetParent = element.offsetParent?.getBoundingClientRect()) !== null && _element$offsetParent !== void 0 ? _element$offsetParent : NULL_ELEMENT_OFFSET_RECT;
|
|
52
|
+
|
|
53
|
+
// Computed widths and heights have subpixel precision, and are not affected
|
|
54
|
+
// by distortions.
|
|
55
|
+
const computedWidth = parseFloat(getComputedStyle(element).width);
|
|
56
|
+
const computedHeight = parseFloat(getComputedStyle(element).height);
|
|
57
|
+
|
|
58
|
+
// We can obtain the current scale factor for the element by comparing "computed"
|
|
59
|
+
// dimensions with the "real" ones.
|
|
60
|
+
const scaleX = computedWidth / rect.width;
|
|
61
|
+
const scaleY = computedHeight / rect.height;
|
|
122
62
|
return {
|
|
123
|
-
//
|
|
124
|
-
//
|
|
125
|
-
//
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
//
|
|
131
|
-
width:
|
|
132
|
-
height:
|
|
63
|
+
// To obtain the adjusted values for the position:
|
|
64
|
+
// 1. Compute the element's position relative to the offset parent.
|
|
65
|
+
// 2. Correct for the scale factor.
|
|
66
|
+
top: (rect.top - offsetParentRect?.top) * scaleY,
|
|
67
|
+
right: (offsetParentRect?.right - rect.right) * scaleX,
|
|
68
|
+
bottom: (offsetParentRect?.bottom - rect.bottom) * scaleY,
|
|
69
|
+
left: (rect.left - offsetParentRect?.left) * scaleX,
|
|
70
|
+
// Computed dimensions don't need any adjustments.
|
|
71
|
+
width: computedWidth,
|
|
72
|
+
height: computedHeight
|
|
133
73
|
};
|
|
134
74
|
}
|
|
75
|
+
const POLL_RATE = 100;
|
|
135
76
|
|
|
136
77
|
/**
|
|
137
78
|
* Tracks the position and dimensions of an element, relative to its offset
|
|
138
79
|
* parent. The element can be changed dynamically.
|
|
80
|
+
*
|
|
81
|
+
* **Note:** sometimes, the measurement will fail (see `getElementOffsetRect`'s
|
|
82
|
+
* documentation for more details). When that happens, this hook will attempt
|
|
83
|
+
* to measure again after a frame, and if that fails, it will poll every 100
|
|
84
|
+
* milliseconds until it succeeds.
|
|
139
85
|
*/
|
|
140
86
|
export function useTrackElementOffsetRect(targetElement) {
|
|
141
87
|
const [indicatorPosition, setIndicatorPosition] = useState(NULL_ELEMENT_OFFSET_RECT);
|
|
142
|
-
|
|
88
|
+
const intervalRef = useRef();
|
|
89
|
+
const measure = useEvent(() => {
|
|
90
|
+
if (targetElement) {
|
|
91
|
+
const elementOffsetRect = getElementOffsetRect(targetElement);
|
|
92
|
+
if (elementOffsetRect) {
|
|
93
|
+
setIndicatorPosition(elementOffsetRect);
|
|
94
|
+
clearInterval(intervalRef.current);
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
clearInterval(intervalRef.current);
|
|
99
|
+
}
|
|
100
|
+
return false;
|
|
101
|
+
});
|
|
102
|
+
const setElement = useResizeObserver(() => {
|
|
103
|
+
if (!measure()) {
|
|
104
|
+
requestAnimationFrame(() => {
|
|
105
|
+
if (!measure()) {
|
|
106
|
+
intervalRef.current = setInterval(measure, POLL_RATE);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
useLayoutEffect(() => setElement(targetElement), [setElement, targetElement]);
|
|
143
112
|
return indicatorPosition;
|
|
144
113
|
}
|
|
145
114
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["useLayoutEffect","useRef","useState","useResizeObserver","useEvent","NULL_ELEMENT_OFFSET_RECT","top","right","bottom","left","width","height","getElementOffsetRect","element","_element$offsetParent","rect","getBoundingClientRect","offsetParentRect","offsetParent","computedWidth","parseFloat","getComputedStyle","computedHeight","scaleX","scaleY","POLL_RATE","useTrackElementOffsetRect","targetElement","indicatorPosition","setIndicatorPosition","intervalRef","measure","elementOffsetRect","clearInterval","current","setElement","requestAnimationFrame","setInterval"],"sources":["@wordpress/components/src/utils/element-rect.ts"],"sourcesContent":["/* eslint-disable jsdoc/require-param */\n/**\n * WordPress dependencies\n */\nimport { useLayoutEffect, useRef, useState } from '@wordpress/element';\nimport { useResizeObserver } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport { useEvent } from './hooks/use-event';\n\n/**\n * The position and dimensions of an element, relative to its offset parent.\n */\nexport type ElementOffsetRect = {\n\t/**\n\t * The distance from the top edge of the offset parent to the top edge of\n\t * the element.\n\t */\n\ttop: number;\n\t/**\n\t * The distance from the right edge of the offset parent to the right edge\n\t * of the element.\n\t */\n\tright: number;\n\t/**\n\t * The distance from the bottom edge of the offset parent to the bottom edge\n\t * of the element.\n\t */\n\tbottom: number;\n\t/**\n\t * The distance from the left edge of the offset parent to the left edge of\n\t * the element.\n\t */\n\tleft: number;\n\t/**\n\t * The width of the element.\n\t */\n\twidth: number;\n\t/**\n\t * The height of the element.\n\t */\n\theight: number;\n};\n\n/**\n * An `ElementOffsetRect` object with all values set to zero.\n */\nexport const NULL_ELEMENT_OFFSET_RECT = {\n\ttop: 0,\n\tright: 0,\n\tbottom: 0,\n\tleft: 0,\n\twidth: 0,\n\theight: 0,\n} satisfies ElementOffsetRect;\n\n/**\n * Returns the position and dimensions of an element, relative to its offset\n * parent, with subpixel precision. Values reflect the real measures before any\n * potential scaling distortions along the X and Y axes.\n *\n * Useful in contexts where plain `getBoundingClientRect` calls or `ResizeObserver`\n * entries are not suitable, such as when the element is transformed, and when\n * `element.offset<Top|Left|Width|Height>` methods are not precise enough.\n *\n * **Note:** in some contexts, like when the scale is 0, this method will fail\n * because it's impossible to calculate a scaling ratio. When that happens, it\n * will return `undefined`.\n */\nexport function getElementOffsetRect(\n\telement: HTMLElement\n): ElementOffsetRect | undefined {\n\t// Position and dimension values computed with `getBoundingClientRect` have\n\t// subpixel precision, but are affected by distortions since they represent\n\t// the \"real\" measures, or in other words, the actual final values as rendered\n\t// by the browser.\n\tconst rect = element.getBoundingClientRect();\n\tif ( rect.width === 0 || rect.height === 0 ) {\n\t\treturn;\n\t}\n\tconst offsetParentRect =\n\t\telement.offsetParent?.getBoundingClientRect() ??\n\t\tNULL_ELEMENT_OFFSET_RECT;\n\n\t// Computed widths and heights have subpixel precision, and are not affected\n\t// by distortions.\n\tconst computedWidth = parseFloat( getComputedStyle( element ).width );\n\tconst computedHeight = parseFloat( getComputedStyle( element ).height );\n\n\t// We can obtain the current scale factor for the element by comparing \"computed\"\n\t// dimensions with the \"real\" ones.\n\tconst scaleX = computedWidth / rect.width;\n\tconst scaleY = computedHeight / rect.height;\n\n\treturn {\n\t\t// To obtain the adjusted values for the position:\n\t\t// 1. Compute the element's position relative to the offset parent.\n\t\t// 2. Correct for the scale factor.\n\t\ttop: ( rect.top - offsetParentRect?.top ) * scaleY,\n\t\tright: ( offsetParentRect?.right - rect.right ) * scaleX,\n\t\tbottom: ( offsetParentRect?.bottom - rect.bottom ) * scaleY,\n\t\tleft: ( rect.left - offsetParentRect?.left ) * scaleX,\n\t\t// Computed dimensions don't need any adjustments.\n\t\twidth: computedWidth,\n\t\theight: computedHeight,\n\t};\n}\n\nconst POLL_RATE = 100;\n\n/**\n * Tracks the position and dimensions of an element, relative to its offset\n * parent. The element can be changed dynamically.\n *\n * **Note:** sometimes, the measurement will fail (see `getElementOffsetRect`'s\n * documentation for more details). When that happens, this hook will attempt\n * to measure again after a frame, and if that fails, it will poll every 100\n * milliseconds until it succeeds.\n */\nexport function useTrackElementOffsetRect(\n\ttargetElement: HTMLElement | undefined | null\n) {\n\tconst [ indicatorPosition, setIndicatorPosition ] =\n\t\tuseState< ElementOffsetRect >( NULL_ELEMENT_OFFSET_RECT );\n\tconst intervalRef = useRef< ReturnType< typeof setInterval > >();\n\n\tconst measure = useEvent( () => {\n\t\tif ( targetElement ) {\n\t\t\tconst elementOffsetRect = getElementOffsetRect( targetElement );\n\t\t\tif ( elementOffsetRect ) {\n\t\t\t\tsetIndicatorPosition( elementOffsetRect );\n\t\t\t\tclearInterval( intervalRef.current );\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\tclearInterval( intervalRef.current );\n\t\t}\n\t\treturn false;\n\t} );\n\n\tconst setElement = useResizeObserver( () => {\n\t\tif ( ! measure() ) {\n\t\t\trequestAnimationFrame( () => {\n\t\t\t\tif ( ! measure() ) {\n\t\t\t\t\tintervalRef.current = setInterval( measure, POLL_RATE );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\n\tuseLayoutEffect(\n\t\t() => setElement( targetElement ),\n\t\t[ setElement, targetElement ]\n\t);\n\n\treturn indicatorPosition;\n}\n\n/* eslint-enable jsdoc/require-param */\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SAASA,eAAe,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AACtE,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD;AACA;AACA;AACA,SAASC,QAAQ,QAAQ,mBAAmB;;AAE5C;AACA;AACA;;AAgCA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAG;EACvCC,GAAG,EAAE,CAAC;EACNC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTC,IAAI,EAAE,CAAC;EACPC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE;AACT,CAA6B;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CACnCC,OAAoB,EACY;EAAA,IAAAC,qBAAA;EAChC;EACA;EACA;EACA;EACA,MAAMC,IAAI,GAAGF,OAAO,CAACG,qBAAqB,CAAC,CAAC;EAC5C,IAAKD,IAAI,CAACL,KAAK,KAAK,CAAC,IAAIK,IAAI,CAACJ,MAAM,KAAK,CAAC,EAAG;IAC5C;EACD;EACA,MAAMM,gBAAgB,IAAAH,qBAAA,GACrBD,OAAO,CAACK,YAAY,EAAEF,qBAAqB,CAAC,CAAC,cAAAF,qBAAA,cAAAA,qBAAA,GAC7CT,wBAAwB;;EAEzB;EACA;EACA,MAAMc,aAAa,GAAGC,UAAU,CAAEC,gBAAgB,CAAER,OAAQ,CAAC,CAACH,KAAM,CAAC;EACrE,MAAMY,cAAc,GAAGF,UAAU,CAAEC,gBAAgB,CAAER,OAAQ,CAAC,CAACF,MAAO,CAAC;;EAEvE;EACA;EACA,MAAMY,MAAM,GAAGJ,aAAa,GAAGJ,IAAI,CAACL,KAAK;EACzC,MAAMc,MAAM,GAAGF,cAAc,GAAGP,IAAI,CAACJ,MAAM;EAE3C,OAAO;IACN;IACA;IACA;IACAL,GAAG,EAAE,CAAES,IAAI,CAACT,GAAG,GAAGW,gBAAgB,EAAEX,GAAG,IAAKkB,MAAM;IAClDjB,KAAK,EAAE,CAAEU,gBAAgB,EAAEV,KAAK,GAAGQ,IAAI,CAACR,KAAK,IAAKgB,MAAM;IACxDf,MAAM,EAAE,CAAES,gBAAgB,EAAET,MAAM,GAAGO,IAAI,CAACP,MAAM,IAAKgB,MAAM;IAC3Df,IAAI,EAAE,CAAEM,IAAI,CAACN,IAAI,GAAGQ,gBAAgB,EAAER,IAAI,IAAKc,MAAM;IACrD;IACAb,KAAK,EAAES,aAAa;IACpBR,MAAM,EAAEW;EACT,CAAC;AACF;AAEA,MAAMG,SAAS,GAAG,GAAG;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CACxCC,aAA6C,EAC5C;EACD,MAAM,CAAEC,iBAAiB,EAAEC,oBAAoB,CAAE,GAChD3B,QAAQ,CAAuBG,wBAAyB,CAAC;EAC1D,MAAMyB,WAAW,GAAG7B,MAAM,CAAqC,CAAC;EAEhE,MAAM8B,OAAO,GAAG3B,QAAQ,CAAE,MAAM;IAC/B,IAAKuB,aAAa,EAAG;MACpB,MAAMK,iBAAiB,GAAGpB,oBAAoB,CAAEe,aAAc,CAAC;MAC/D,IAAKK,iBAAiB,EAAG;QACxBH,oBAAoB,CAAEG,iBAAkB,CAAC;QACzCC,aAAa,CAAEH,WAAW,CAACI,OAAQ,CAAC;QACpC,OAAO,IAAI;MACZ;IACD,CAAC,MAAM;MACND,aAAa,CAAEH,WAAW,CAACI,OAAQ,CAAC;IACrC;IACA,OAAO,KAAK;EACb,CAAE,CAAC;EAEH,MAAMC,UAAU,GAAGhC,iBAAiB,CAAE,MAAM;IAC3C,IAAK,CAAE4B,OAAO,CAAC,CAAC,EAAG;MAClBK,qBAAqB,CAAE,MAAM;QAC5B,IAAK,CAAEL,OAAO,CAAC,CAAC,EAAG;UAClBD,WAAW,CAACI,OAAO,GAAGG,WAAW,CAAEN,OAAO,EAAEN,SAAU,CAAC;QACxD;MACD,CAAE,CAAC;IACJ;EACD,CAAE,CAAC;EAEHzB,eAAe,CACd,MAAMmC,UAAU,CAAER,aAAc,CAAC,EACjC,CAAEQ,UAAU,EAAER,aAAa,CAC5B,CAAC;EAED,OAAOC,iBAAiB;AACzB;;AAEA","ignoreList":[]}
|
|
@@ -12,12 +12,12 @@ import { useRef, useEffect } from '@wordpress/element';
|
|
|
12
12
|
* @param {import('react').DependencyList} deps
|
|
13
13
|
*/
|
|
14
14
|
function useUpdateEffect(effect, deps) {
|
|
15
|
-
const
|
|
15
|
+
const mountedRef = useRef(false);
|
|
16
16
|
useEffect(() => {
|
|
17
|
-
if (
|
|
17
|
+
if (mountedRef.current) {
|
|
18
18
|
return effect();
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
mountedRef.current = true;
|
|
21
21
|
return undefined;
|
|
22
22
|
// Disable reasons:
|
|
23
23
|
// 1. This hook needs to pass a dep list that isn't an array literal
|
|
@@ -26,7 +26,7 @@ function useUpdateEffect(effect, deps) {
|
|
|
26
26
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27
27
|
}, deps);
|
|
28
28
|
useEffect(() => () => {
|
|
29
|
-
|
|
29
|
+
mountedRef.current = false;
|
|
30
30
|
}, []);
|
|
31
31
|
}
|
|
32
32
|
export default useUpdateEffect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRef","useEffect","useUpdateEffect","effect","deps","
|
|
1
|
+
{"version":3,"names":["useRef","useEffect","useUpdateEffect","effect","deps","mountedRef","current","undefined"],"sources":["@wordpress/components/src/utils/hooks/use-update-effect.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\n\n/**\n * A `React.useEffect` that will not run on the first render.\n * Source:\n * https://github.com/ariakit/ariakit/blob/main/packages/ariakit-react-core/src/utils/hooks.ts\n *\n * @param {import('react').EffectCallback} effect\n * @param {import('react').DependencyList} deps\n */\nfunction useUpdateEffect( effect, deps ) {\n\tconst mountedRef = useRef( false );\n\tuseEffect( () => {\n\t\tif ( mountedRef.current ) {\n\t\t\treturn effect();\n\t\t}\n\t\tmountedRef.current = true;\n\t\treturn undefined;\n\t\t// Disable reasons:\n\t\t// 1. This hook needs to pass a dep list that isn't an array literal\n\t\t// 2. `effect` is missing from the array, and will need to be added carefully to avoid additional warnings\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, deps );\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tmountedRef.current = false;\n\t\t},\n\t\t[]\n\t);\n}\n\nexport default useUpdateEffect;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CAAEC,MAAM,EAAEC,IAAI,EAAG;EACxC,MAAMC,UAAU,GAAGL,MAAM,CAAE,KAAM,CAAC;EAClCC,SAAS,CAAE,MAAM;IAChB,IAAKI,UAAU,CAACC,OAAO,EAAG;MACzB,OAAOH,MAAM,CAAC,CAAC;IAChB;IACAE,UAAU,CAACC,OAAO,GAAG,IAAI;IACzB,OAAOC,SAAS;IAChB;IACA;IACA;IACA;IACA;EACD,CAAC,EAAEH,IAAK,CAAC;EAETH,SAAS,CACR,MAAM,MAAM;IACXI,UAAU,CAACC,OAAO,GAAG,KAAK;EAC3B,CAAC,EACD,EACD,CAAC;AACF;AAEA,eAAeJ,eAAe","ignoreList":[]}
|
|
@@ -1052,18 +1052,6 @@ input.components-combobox-control__input[type=text]:focus {
|
|
|
1052
1052
|
height: 20px;
|
|
1053
1053
|
}
|
|
1054
1054
|
|
|
1055
|
-
.components-custom-gradient-picker .components-custom-gradient-picker__toolbar {
|
|
1056
|
-
border: none;
|
|
1057
|
-
}
|
|
1058
|
-
.components-custom-gradient-picker .components-custom-gradient-picker__toolbar > div + div {
|
|
1059
|
-
margin-right: 1px;
|
|
1060
|
-
}
|
|
1061
|
-
.components-custom-gradient-picker .components-custom-gradient-picker__toolbar button.is-pressed > svg {
|
|
1062
|
-
background: #fff;
|
|
1063
|
-
border: 1px solid #949494;
|
|
1064
|
-
border-radius: 2px;
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1067
1055
|
.components-custom-gradient-picker__ui-line {
|
|
1068
1056
|
position: relative;
|
|
1069
1057
|
z-index: 0;
|
|
@@ -1539,7 +1527,6 @@ body.is-dragging-components-draggable {
|
|
|
1539
1527
|
}
|
|
1540
1528
|
.components-form-token-field__token.is-borderless.is-error .components-form-token-field__token-text {
|
|
1541
1529
|
color: #cc1818;
|
|
1542
|
-
border-radius: 0 4px 4px 0;
|
|
1543
1530
|
padding: 0 6px 0 4px;
|
|
1544
1531
|
}
|
|
1545
1532
|
.components-form-token-field__token.is-borderless.is-validating .components-form-token-field__token-text {
|
|
@@ -1569,7 +1556,7 @@ body.is-dragging-components-draggable {
|
|
|
1569
1556
|
}
|
|
1570
1557
|
|
|
1571
1558
|
.components-form-token-field__token-text {
|
|
1572
|
-
border-radius: 0
|
|
1559
|
+
border-radius: 0 1px 1px 0;
|
|
1573
1560
|
padding: 0 8px 0 0;
|
|
1574
1561
|
white-space: nowrap;
|
|
1575
1562
|
overflow: hidden;
|
|
@@ -1578,7 +1565,7 @@ body.is-dragging-components-draggable {
|
|
|
1578
1565
|
|
|
1579
1566
|
.components-form-token-field__remove-token.components-button {
|
|
1580
1567
|
cursor: pointer;
|
|
1581
|
-
border-radius:
|
|
1568
|
+
border-radius: 1px 0 0 1px;
|
|
1582
1569
|
padding: 0 2px;
|
|
1583
1570
|
color: #1e1e1e;
|
|
1584
1571
|
line-height: 10px;
|
|
@@ -1885,7 +1872,7 @@ body.is-dragging-components-draggable {
|
|
|
1885
1872
|
background-color: rgba(0, 0, 0, 0.35);
|
|
1886
1873
|
z-index: 100000;
|
|
1887
1874
|
display: flex;
|
|
1888
|
-
animation: edit-post__fade-in-animation 0.
|
|
1875
|
+
animation: edit-post__fade-in-animation 0.08s linear 0s;
|
|
1889
1876
|
animation-fill-mode: forwards;
|
|
1890
1877
|
}
|
|
1891
1878
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -1904,7 +1891,7 @@ body.is-dragging-components-draggable {
|
|
|
1904
1891
|
border-radius: 8px 8px 0 0;
|
|
1905
1892
|
overflow: hidden;
|
|
1906
1893
|
display: flex;
|
|
1907
|
-
animation: components-modal__appear-animation 0.
|
|
1894
|
+
animation: components-modal__appear-animation 0.26s cubic-bezier(0.29, 0, 0, 1);
|
|
1908
1895
|
animation-fill-mode: forwards;
|
|
1909
1896
|
}
|
|
1910
1897
|
.components-modal__frame *,
|
|
@@ -1970,10 +1957,12 @@ body.is-dragging-components-draggable {
|
|
|
1970
1957
|
|
|
1971
1958
|
@keyframes components-modal__appear-animation {
|
|
1972
1959
|
from {
|
|
1973
|
-
|
|
1960
|
+
opacity: 0;
|
|
1961
|
+
transform: scale(0.9);
|
|
1974
1962
|
}
|
|
1975
1963
|
to {
|
|
1976
|
-
|
|
1964
|
+
opacity: 1;
|
|
1965
|
+
transform: scale(1);
|
|
1977
1966
|
}
|
|
1978
1967
|
}
|
|
1979
1968
|
.components-modal__header {
|
|
@@ -1999,10 +1988,6 @@ body.is-dragging-components-draggable {
|
|
|
1999
1988
|
line-height: 1;
|
|
2000
1989
|
margin: 0;
|
|
2001
1990
|
}
|
|
2002
|
-
.components-modal__header .components-button {
|
|
2003
|
-
position: relative;
|
|
2004
|
-
right: 8px;
|
|
2005
|
-
}
|
|
2006
1991
|
.components-modal__content.has-scrolled-content:not(.hide-header) .components-modal__header {
|
|
2007
1992
|
border-bottom-color: #ddd;
|
|
2008
1993
|
}
|
|
@@ -2524,6 +2509,7 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
|
|
|
2524
2509
|
}
|
|
2525
2510
|
.is-alternate .components-popover__content {
|
|
2526
2511
|
box-shadow: 0 0 0 1px #1e1e1e;
|
|
2512
|
+
border-radius: 2px;
|
|
2527
2513
|
}
|
|
2528
2514
|
.is-unstyled .components-popover__content {
|
|
2529
2515
|
background: none;
|
|
@@ -2789,7 +2775,7 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
|
|
|
2789
2775
|
|
|
2790
2776
|
.components-resizable-box__side-handle::before {
|
|
2791
2777
|
display: block;
|
|
2792
|
-
border-radius:
|
|
2778
|
+
border-radius: 9999px;
|
|
2793
2779
|
content: "";
|
|
2794
2780
|
width: 3px;
|
|
2795
2781
|
height: 3px;
|
|
@@ -3123,7 +3109,6 @@ body.lockscroll {
|
|
|
3123
3109
|
outline: none;
|
|
3124
3110
|
}
|
|
3125
3111
|
.components-tab-panel__tab-content:focus-visible {
|
|
3126
|
-
border-radius: 2px;
|
|
3127
3112
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
|
|
3128
3113
|
outline: 2px solid transparent;
|
|
3129
3114
|
outline-offset: 0;
|
|
@@ -3278,8 +3263,8 @@ body.lockscroll {
|
|
|
3278
3263
|
.components-text-control__input[type=month].is-next-40px-default-size,
|
|
3279
3264
|
.components-text-control__input[type=number].is-next-40px-default-size {
|
|
3280
3265
|
height: 40px;
|
|
3281
|
-
padding-right:
|
|
3282
|
-
padding-left:
|
|
3266
|
+
padding-right: 12px;
|
|
3267
|
+
padding-left: 12px;
|
|
3283
3268
|
}
|
|
3284
3269
|
|
|
3285
3270
|
.components-tip {
|
package/build-style/style.css
CHANGED
|
@@ -1057,18 +1057,6 @@ input.components-combobox-control__input[type=text]:focus {
|
|
|
1057
1057
|
height: 20px;
|
|
1058
1058
|
}
|
|
1059
1059
|
|
|
1060
|
-
.components-custom-gradient-picker .components-custom-gradient-picker__toolbar {
|
|
1061
|
-
border: none;
|
|
1062
|
-
}
|
|
1063
|
-
.components-custom-gradient-picker .components-custom-gradient-picker__toolbar > div + div {
|
|
1064
|
-
margin-left: 1px;
|
|
1065
|
-
}
|
|
1066
|
-
.components-custom-gradient-picker .components-custom-gradient-picker__toolbar button.is-pressed > svg {
|
|
1067
|
-
background: #fff;
|
|
1068
|
-
border: 1px solid #949494;
|
|
1069
|
-
border-radius: 2px;
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
1060
|
.components-custom-gradient-picker__ui-line {
|
|
1073
1061
|
position: relative;
|
|
1074
1062
|
z-index: 0;
|
|
@@ -1544,7 +1532,6 @@ body.is-dragging-components-draggable {
|
|
|
1544
1532
|
}
|
|
1545
1533
|
.components-form-token-field__token.is-borderless.is-error .components-form-token-field__token-text {
|
|
1546
1534
|
color: #cc1818;
|
|
1547
|
-
border-radius: 4px 0 0 4px;
|
|
1548
1535
|
padding: 0 4px 0 6px;
|
|
1549
1536
|
}
|
|
1550
1537
|
.components-form-token-field__token.is-borderless.is-validating .components-form-token-field__token-text {
|
|
@@ -1574,7 +1561,7 @@ body.is-dragging-components-draggable {
|
|
|
1574
1561
|
}
|
|
1575
1562
|
|
|
1576
1563
|
.components-form-token-field__token-text {
|
|
1577
|
-
border-radius:
|
|
1564
|
+
border-radius: 1px 0 0 1px;
|
|
1578
1565
|
padding: 0 0 0 8px;
|
|
1579
1566
|
white-space: nowrap;
|
|
1580
1567
|
overflow: hidden;
|
|
@@ -1583,7 +1570,7 @@ body.is-dragging-components-draggable {
|
|
|
1583
1570
|
|
|
1584
1571
|
.components-form-token-field__remove-token.components-button {
|
|
1585
1572
|
cursor: pointer;
|
|
1586
|
-
border-radius: 0
|
|
1573
|
+
border-radius: 0 1px 1px 0;
|
|
1587
1574
|
padding: 0 2px;
|
|
1588
1575
|
color: #1e1e1e;
|
|
1589
1576
|
line-height: 10px;
|
|
@@ -1890,7 +1877,7 @@ body.is-dragging-components-draggable {
|
|
|
1890
1877
|
background-color: rgba(0, 0, 0, 0.35);
|
|
1891
1878
|
z-index: 100000;
|
|
1892
1879
|
display: flex;
|
|
1893
|
-
animation: edit-post__fade-in-animation 0.
|
|
1880
|
+
animation: edit-post__fade-in-animation 0.08s linear 0s;
|
|
1894
1881
|
animation-fill-mode: forwards;
|
|
1895
1882
|
}
|
|
1896
1883
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -1909,7 +1896,7 @@ body.is-dragging-components-draggable {
|
|
|
1909
1896
|
border-radius: 8px 8px 0 0;
|
|
1910
1897
|
overflow: hidden;
|
|
1911
1898
|
display: flex;
|
|
1912
|
-
animation: components-modal__appear-animation 0.
|
|
1899
|
+
animation: components-modal__appear-animation 0.26s cubic-bezier(0.29, 0, 0, 1);
|
|
1913
1900
|
animation-fill-mode: forwards;
|
|
1914
1901
|
}
|
|
1915
1902
|
.components-modal__frame *,
|
|
@@ -1975,10 +1962,12 @@ body.is-dragging-components-draggable {
|
|
|
1975
1962
|
|
|
1976
1963
|
@keyframes components-modal__appear-animation {
|
|
1977
1964
|
from {
|
|
1978
|
-
|
|
1965
|
+
opacity: 0;
|
|
1966
|
+
transform: scale(0.9);
|
|
1979
1967
|
}
|
|
1980
1968
|
to {
|
|
1981
|
-
|
|
1969
|
+
opacity: 1;
|
|
1970
|
+
transform: scale(1);
|
|
1982
1971
|
}
|
|
1983
1972
|
}
|
|
1984
1973
|
.components-modal__header {
|
|
@@ -2004,10 +1993,6 @@ body.is-dragging-components-draggable {
|
|
|
2004
1993
|
line-height: 1;
|
|
2005
1994
|
margin: 0;
|
|
2006
1995
|
}
|
|
2007
|
-
.components-modal__header .components-button {
|
|
2008
|
-
position: relative;
|
|
2009
|
-
left: 8px;
|
|
2010
|
-
}
|
|
2011
1996
|
.components-modal__content.has-scrolled-content:not(.hide-header) .components-modal__header {
|
|
2012
1997
|
border-bottom-color: #ddd;
|
|
2013
1998
|
}
|
|
@@ -2531,6 +2516,7 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
|
|
|
2531
2516
|
}
|
|
2532
2517
|
.is-alternate .components-popover__content {
|
|
2533
2518
|
box-shadow: 0 0 0 1px #1e1e1e;
|
|
2519
|
+
border-radius: 2px;
|
|
2534
2520
|
}
|
|
2535
2521
|
.is-unstyled .components-popover__content {
|
|
2536
2522
|
background: none;
|
|
@@ -2798,7 +2784,7 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
|
|
|
2798
2784
|
|
|
2799
2785
|
.components-resizable-box__side-handle::before {
|
|
2800
2786
|
display: block;
|
|
2801
|
-
border-radius:
|
|
2787
|
+
border-radius: 9999px;
|
|
2802
2788
|
content: "";
|
|
2803
2789
|
width: 3px;
|
|
2804
2790
|
height: 3px;
|
|
@@ -3135,7 +3121,6 @@ body.lockscroll {
|
|
|
3135
3121
|
outline: none;
|
|
3136
3122
|
}
|
|
3137
3123
|
.components-tab-panel__tab-content:focus-visible {
|
|
3138
|
-
border-radius: 2px;
|
|
3139
3124
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
|
|
3140
3125
|
outline: 2px solid transparent;
|
|
3141
3126
|
outline-offset: 0;
|
|
@@ -3290,8 +3275,8 @@ body.lockscroll {
|
|
|
3290
3275
|
.components-text-control__input[type=month].is-next-40px-default-size,
|
|
3291
3276
|
.components-text-control__input[type=number].is-next-40px-default-size {
|
|
3292
3277
|
height: 40px;
|
|
3293
|
-
padding-left:
|
|
3294
|
-
padding-right:
|
|
3278
|
+
padding-left: 12px;
|
|
3279
|
+
padding-right: 12px;
|
|
3295
3280
|
}
|
|
3296
3281
|
|
|
3297
3282
|
.components-tip {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AlignmentMatrixControlCellProps } from './types';
|
|
2
2
|
import type { WordPressComponentProps } from '../context';
|
|
3
|
-
export default function Cell({ id,
|
|
3
|
+
export default function Cell({ id, value, ...props }: WordPressComponentProps<AlignmentMatrixControlCellProps, 'span', false>): import("react").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=cell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../src/alignment-matrix-control/cell.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../src/alignment-matrix-control/cell.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,CAAC,OAAO,UAAU,IAAI,CAAE,EAC7B,EAAE,EACF,KAAK,EACL,GAAG,KAAK,EACR,EAAE,uBAAuB,CAAE,+BAA+B,EAAE,MAAM,EAAE,KAAK,CAAE,+BAe3E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AlignmentMatrixControlIconProps } from './types';
|
|
2
2
|
import type { WordPressComponentProps } from '../context';
|
|
3
|
-
declare function AlignmentMatrixControlIcon({ className, disablePointerEvents, size, style, value, ...props }: WordPressComponentProps<AlignmentMatrixControlIconProps, '
|
|
3
|
+
declare function AlignmentMatrixControlIcon({ className, disablePointerEvents, size, width, height, style, value, ...props }: WordPressComponentProps<AlignmentMatrixControlIconProps, 'svg', false>): import("react").JSX.Element;
|
|
4
4
|
export default AlignmentMatrixControlIcon;
|
|
5
5
|
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/alignment-matrix-control/icon.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/alignment-matrix-control/icon.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAQ1D,iBAAS,0BAA0B,CAAE,EACpC,SAAS,EACT,oBAA2B,EAC3B,IAAI,EACJ,KAAK,EACL,MAAM,EACN,KAAU,EACV,KAAgB,EAChB,GAAG,KAAK,EACR,EAAE,uBAAuB,CAAE,+BAA+B,EAAE,KAAK,EAAE,KAAK,CAAE,+BA6C1E;AAED,eAAe,0BAA0B,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import AlignmentMatrixControlIcon from './icon';
|
|
2
2
|
import type { WordPressComponentProps } from '../context';
|
|
3
3
|
import type { AlignmentMatrixControlProps } from './types';
|
|
4
|
+
declare function UnforwardedAlignmentMatrixControl({ className, id, label, defaultValue, value, onChange, width, ...props }: WordPressComponentProps<AlignmentMatrixControlProps, 'div', false>): import("react").JSX.Element;
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
6
|
* AlignmentMatrixControl components enable adjustments to horizontal and vertical alignments for UI.
|
|
7
7
|
*
|
|
8
8
|
* ```jsx
|
|
9
|
-
* import {
|
|
9
|
+
* import { AlignmentMatrixControl } from '@wordpress/components';
|
|
10
10
|
* import { useState } from '@wordpress/element';
|
|
11
11
|
*
|
|
12
12
|
* const Example = () => {
|
|
@@ -21,9 +21,19 @@ import type { AlignmentMatrixControlProps } from './types';
|
|
|
21
21
|
* };
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
export declare
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
export declare const AlignmentMatrixControl: typeof UnforwardedAlignmentMatrixControl & {
|
|
25
|
+
/**
|
|
26
|
+
* Render an alignment matrix as an icon.
|
|
27
|
+
*
|
|
28
|
+
* ```jsx
|
|
29
|
+
* import { AlignmentMatrixControl } from '@wordpress/components';
|
|
30
|
+
*
|
|
31
|
+
* <Icon icon={<AlignmentMatrixControl.Icon value="top left" />} />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
Icon: typeof AlignmentMatrixControlIcon & {
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
28
38
|
export default AlignmentMatrixControl;
|
|
29
39
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/alignment-matrix-control/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,0BAA0B,MAAM,QAAQ,CAAC;AAEhD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/alignment-matrix-control/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,0BAA0B,MAAM,QAAQ,CAAC;AAEhD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,iBAAS,iCAAiC,CAAE,EAC3C,SAAS,EACT,EAAE,EACF,KAAwC,EACxC,YAA8B,EAC9B,KAAK,EACL,QAAQ,EACR,KAAU,EACV,GAAG,KAAK,EACR,EAAE,uBAAuB,CAAE,2BAA2B,EAAE,KAAK,EAAE,KAAK,CAAE,+BAmDtE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,sBAAsB;IAGjC;;;;;;;;OAQG;;;;CAKJ,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|