@wordpress/components 37.0.1-next.v.202607070741.0 → 38.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +65 -1
- package/build/angle-picker-control/index.cjs +0 -1
- package/build/angle-picker-control/index.cjs.map +2 -2
- package/build/autocomplete/index.cjs +6 -4
- package/build/autocomplete/index.cjs.map +3 -3
- package/build/border-box-control/styles.cjs +9 -9
- package/build/border-box-control/styles.cjs.map +2 -2
- package/build/color-palette/styles.cjs +1 -1
- package/build/color-palette/styles.cjs.map +2 -2
- package/build/color-picker/component.cjs +14 -5
- package/build/color-picker/component.cjs.map +2 -2
- package/build/color-picker/hex-input.cjs +0 -1
- package/build/color-picker/hex-input.cjs.map +2 -2
- package/build/color-picker/input-with-slider.cjs +0 -1
- package/build/color-picker/input-with-slider.cjs.map +2 -2
- package/build/color-picker/picker.cjs +95 -23
- package/build/color-picker/picker.cjs.map +2 -2
- package/build/confirm-dialog/component.cjs +86 -4
- package/build/confirm-dialog/component.cjs.map +3 -3
- package/build/content-editable-control/docs-manifest.json +5 -0
- package/build/content-editable-control/index.cjs +181 -0
- package/build/content-editable-control/index.cjs.map +7 -0
- package/build/{theme → content-editable-control}/types.cjs +1 -1
- package/build/{theme → content-editable-control}/types.cjs.map +1 -1
- package/build/custom-select-control/index.cjs +1 -2
- package/build/custom-select-control/index.cjs.map +2 -2
- package/build/custom-select-control-v2/custom-select.cjs +0 -1
- package/build/custom-select-control-v2/custom-select.cjs.map +2 -2
- package/build/date-time/date-picker/styles.cjs +8 -8
- package/build/date-time/date-picker/styles.cjs.map +2 -2
- package/build/date-time/time-picker/index.cjs +0 -2
- package/build/date-time/time-picker/index.cjs.map +2 -2
- package/build/date-time/time-picker/time-input/index.cjs +0 -2
- package/build/date-time/time-picker/time-input/index.cjs.map +2 -2
- package/build/disabled/index.cjs +87 -4
- package/build/disabled/index.cjs.map +4 -4
- package/build/form-token-field/index.cjs +87 -2
- package/build/form-token-field/index.cjs.map +3 -3
- package/build/gradient-picker/index.cjs +26 -20
- package/build/gradient-picker/index.cjs.map +2 -2
- package/build/heading/hook.cjs +1 -1
- package/build/heading/hook.cjs.map +1 -1
- package/build/input-control/index.cjs +4 -14
- package/build/input-control/index.cjs.map +2 -2
- package/build/input-control/input-base.cjs +2 -6
- package/build/input-control/input-base.cjs.map +2 -2
- package/build/input-control/styles/input-control-styles.cjs +25 -39
- package/build/input-control/styles/input-control-styles.cjs.map +2 -2
- package/build/menu/group-label.cjs +2 -1
- package/build/menu/group-label.cjs.map +2 -2
- package/build/number-control/index.cjs +1 -11
- package/build/number-control/index.cjs.map +2 -2
- package/build/palette-edit/styles.cjs +9 -9
- package/build/palette-edit/styles.cjs.map +2 -2
- package/build/private-apis.cjs +3 -2
- package/build/private-apis.cjs.map +3 -3
- package/build/range-control/index.cjs +0 -2
- package/build/range-control/index.cjs.map +2 -2
- package/build/sandbox/index.cjs +96 -73
- package/build/sandbox/index.cjs.map +3 -3
- package/build/search-control/index.cjs +93 -11
- package/build/search-control/index.cjs.map +4 -4
- package/build/select-control/index.cjs +0 -2
- package/build/select-control/index.cjs.map +2 -2
- package/build/select-control/styles/select-control-styles.cjs +9 -16
- package/build/select-control/styles/select-control-styles.cjs.map +2 -2
- package/build/slot-fill/fill.cjs.map +2 -2
- package/build/spacer/hook.cjs +150 -14
- package/build/spacer/hook.cjs.map +4 -4
- package/build/toggle-group-control/toggle-group-control/component.cjs +91 -8
- package/build/toggle-group-control/toggle-group-control/component.cjs.map +4 -4
- package/build/toggle-group-control/toggle-group-control-option-base/component.cjs +98 -17
- package/build/toggle-group-control/toggle-group-control-option-base/component.cjs.map +4 -4
- package/build/tools-panel/tools-panel/component.cjs +6 -0
- package/build/tools-panel/tools-panel/component.cjs.map +2 -2
- package/build/tools-panel/tools-panel/hook.cjs +87 -11
- package/build/tools-panel/tools-panel/hook.cjs.map +4 -4
- package/build/tools-panel/tools-panel-header/component.cjs +87 -2
- package/build/tools-panel/tools-panel-header/component.cjs.map +3 -3
- package/build/tools-panel/tools-panel-header/hook.cjs +90 -20
- package/build/tools-panel/tools-panel-header/hook.cjs.map +4 -4
- package/build/tools-panel/tools-panel-item/hook.cjs +88 -9
- package/build/tools-panel/tools-panel-item/hook.cjs.map +4 -4
- package/build/unit-control/index.cjs +0 -1
- package/build/unit-control/index.cjs.map +2 -2
- package/build/utils/base-label.cjs +1 -1
- package/build/utils/base-label.cjs.map +2 -2
- package/build/utils/config-values.cjs +1 -3
- package/build/utils/config-values.cjs.map +2 -2
- package/build/utils/font-values.cjs +1 -1
- package/build/utils/font-values.cjs.map +1 -1
- package/build/validated-form-controls/components/content-editable-control.cjs +84 -0
- package/build/validated-form-controls/components/content-editable-control.cjs.map +7 -0
- package/build/validated-form-controls/components/index.cjs +2 -0
- package/build/validated-form-controls/components/index.cjs.map +2 -2
- package/build/validated-form-controls/components/input-control.cjs +0 -1
- package/build/validated-form-controls/components/input-control.cjs.map +2 -2
- package/build/validated-form-controls/components/number-control.cjs +0 -1
- package/build/validated-form-controls/components/number-control.cjs.map +2 -2
- package/build/validated-form-controls/control-with-error.cjs +4 -4
- package/build/validated-form-controls/control-with-error.cjs.map +2 -2
- package/build-module/angle-picker-control/index.mjs +0 -1
- package/build-module/angle-picker-control/index.mjs.map +2 -2
- package/build-module/autocomplete/index.mjs +8 -6
- package/build-module/autocomplete/index.mjs.map +2 -2
- package/build-module/border-box-control/styles.mjs +9 -9
- package/build-module/border-box-control/styles.mjs.map +2 -2
- package/build-module/color-palette/styles.mjs +1 -1
- package/build-module/color-palette/styles.mjs.map +2 -2
- package/build-module/color-picker/component.mjs +14 -5
- package/build-module/color-picker/component.mjs.map +2 -2
- package/build-module/color-picker/hex-input.mjs +0 -1
- package/build-module/color-picker/hex-input.mjs.map +2 -2
- package/build-module/color-picker/input-with-slider.mjs +0 -1
- package/build-module/color-picker/input-with-slider.mjs.map +2 -2
- package/build-module/color-picker/picker.mjs +96 -24
- package/build-module/color-picker/picker.mjs.map +2 -2
- package/build-module/confirm-dialog/component.mjs +86 -4
- package/build-module/confirm-dialog/component.mjs.map +3 -3
- package/build-module/content-editable-control/docs-manifest.json +5 -0
- package/build-module/content-editable-control/index.mjs +146 -0
- package/build-module/content-editable-control/index.mjs.map +7 -0
- package/build-module/custom-select-control/index.mjs +1 -2
- package/build-module/custom-select-control/index.mjs.map +2 -2
- package/build-module/custom-select-control-v2/custom-select.mjs +0 -1
- package/build-module/custom-select-control-v2/custom-select.mjs.map +2 -2
- package/build-module/date-time/date-picker/styles.mjs +8 -8
- package/build-module/date-time/date-picker/styles.mjs.map +2 -2
- package/build-module/date-time/time-picker/index.mjs +0 -2
- package/build-module/date-time/time-picker/index.mjs.map +2 -2
- package/build-module/date-time/time-picker/time-input/index.mjs +0 -2
- package/build-module/date-time/time-picker/time-input/index.mjs.map +2 -2
- package/build-module/disabled/index.mjs +87 -4
- package/build-module/disabled/index.mjs.map +3 -3
- package/build-module/form-token-field/index.mjs +88 -3
- package/build-module/form-token-field/index.mjs.map +3 -3
- package/build-module/gradient-picker/index.mjs +26 -20
- package/build-module/gradient-picker/index.mjs.map +2 -2
- package/build-module/heading/hook.mjs +1 -1
- package/build-module/heading/hook.mjs.map +1 -1
- package/build-module/input-control/index.mjs +4 -14
- package/build-module/input-control/index.mjs.map +2 -2
- package/build-module/input-control/input-base.mjs +2 -6
- package/build-module/input-control/input-base.mjs.map +2 -2
- package/build-module/input-control/styles/input-control-styles.mjs +25 -39
- package/build-module/input-control/styles/input-control-styles.mjs.map +2 -2
- package/build-module/menu/group-label.mjs +2 -1
- package/build-module/menu/group-label.mjs.map +2 -2
- package/build-module/number-control/index.mjs +1 -11
- package/build-module/number-control/index.mjs.map +2 -2
- package/build-module/palette-edit/styles.mjs +9 -9
- package/build-module/palette-edit/styles.mjs.map +2 -2
- package/build-module/private-apis.mjs +4 -3
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/range-control/index.mjs +0 -2
- package/build-module/range-control/index.mjs.map +2 -2
- package/build-module/sandbox/index.mjs +84 -72
- package/build-module/sandbox/index.mjs.map +2 -2
- package/build-module/search-control/index.mjs +93 -11
- package/build-module/search-control/index.mjs.map +3 -3
- package/build-module/select-control/index.mjs +0 -2
- package/build-module/select-control/index.mjs.map +2 -2
- package/build-module/select-control/styles/select-control-styles.mjs +9 -16
- package/build-module/select-control/styles/select-control-styles.mjs.map +2 -2
- package/build-module/slot-fill/fill.mjs.map +2 -2
- package/build-module/spacer/hook.mjs +140 -14
- package/build-module/spacer/hook.mjs.map +3 -3
- package/build-module/toggle-group-control/toggle-group-control/component.mjs +92 -9
- package/build-module/toggle-group-control/toggle-group-control/component.mjs.map +3 -3
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.mjs +99 -18
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.mjs.map +3 -3
- package/build-module/tools-panel/tools-panel/component.mjs +6 -0
- package/build-module/tools-panel/tools-panel/component.mjs.map +2 -2
- package/build-module/tools-panel/tools-panel/hook.mjs +87 -11
- package/build-module/tools-panel/tools-panel/hook.mjs.map +3 -3
- package/build-module/tools-panel/tools-panel-header/component.mjs +87 -2
- package/build-module/tools-panel/tools-panel-header/component.mjs.map +3 -3
- package/build-module/tools-panel/tools-panel-header/hook.mjs +90 -20
- package/build-module/tools-panel/tools-panel-header/hook.mjs.map +3 -3
- package/build-module/tools-panel/tools-panel-item/hook.mjs +89 -10
- package/build-module/tools-panel/tools-panel-item/hook.mjs.map +3 -3
- package/build-module/unit-control/index.mjs +0 -1
- package/build-module/unit-control/index.mjs.map +2 -2
- package/build-module/utils/base-label.mjs +1 -1
- package/build-module/utils/base-label.mjs.map +2 -2
- package/build-module/utils/config-values.mjs +1 -3
- package/build-module/utils/config-values.mjs.map +2 -2
- package/build-module/utils/font-values.mjs +1 -1
- package/build-module/utils/font-values.mjs.map +1 -1
- package/build-module/validated-form-controls/components/content-editable-control.mjs +49 -0
- package/build-module/validated-form-controls/components/content-editable-control.mjs.map +7 -0
- package/build-module/validated-form-controls/components/index.mjs +1 -0
- package/build-module/validated-form-controls/components/index.mjs.map +2 -2
- package/build-module/validated-form-controls/components/input-control.mjs +0 -1
- package/build-module/validated-form-controls/components/input-control.mjs.map +2 -2
- package/build-module/validated-form-controls/components/number-control.mjs +0 -1
- package/build-module/validated-form-controls/components/number-control.mjs.map +2 -2
- package/build-module/validated-form-controls/control-with-error.mjs +4 -4
- package/build-module/validated-form-controls/control-with-error.mjs.map +2 -2
- package/build-style/style-rtl.css +70 -81
- package/build-style/style.css +70 -81
- package/build-types/angle-picker-control/index.d.ts.map +1 -1
- package/build-types/autocomplete/autocompleter-ui.d.ts +1 -1
- package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
- package/build-types/autocomplete/index.d.ts +8 -4
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/component.d.ts +1 -3
- package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
- package/build-types/border-box-control/stories/index.story.d.ts +1 -3
- package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-box-control/styles.d.ts.map +1 -1
- package/build-types/border-box-control/types.d.ts +1 -15
- package/build-types/border-box-control/types.d.ts.map +1 -1
- package/build-types/box-control/index.d.ts +1 -1
- package/build-types/box-control/index.d.ts.map +1 -1
- package/build-types/box-control/input-control.d.ts +3 -0
- package/build-types/box-control/input-control.d.ts.map +1 -0
- package/build-types/box-control/styles/box-control-styles.d.ts +4 -8
- package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
- package/build-types/box-control/types.d.ts +1 -8
- package/build-types/box-control/types.d.ts.map +1 -1
- package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/calendar/date-range-calendar/index.d.ts +1 -1
- package/build-types/calendar/date-range-calendar/index.d.ts.map +1 -1
- package/build-types/calendar/utils/use-localization-props.d.ts +6 -2
- package/build-types/calendar/utils/use-localization-props.d.ts.map +1 -1
- package/build-types/card/context.d.ts +3 -0
- package/build-types/card/context.d.ts.map +1 -0
- package/build-types/card/styles.d.ts +3 -3
- package/build-types/card/styles.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker-actions.d.ts +1 -1
- package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker.d.ts +8 -13
- package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
- package/build-types/color-picker/component.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/picker.d.ts +17 -1
- package/build-types/color-picker/picker.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +3 -6
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/color-picker/types.d.ts +2 -0
- package/build-types/color-picker/types.d.ts.map +1 -1
- package/build-types/composite/legacy/stories/utils.d.ts.map +1 -1
- package/build-types/confirm-dialog/component.d.ts.map +1 -1
- package/build-types/content-editable-control/index.d.ts +31 -0
- package/build-types/content-editable-control/index.d.ts.map +1 -0
- package/build-types/content-editable-control/stories/index.story.d.ts +13 -0
- package/build-types/content-editable-control/stories/index.story.d.ts.map +1 -0
- package/build-types/content-editable-control/test/index.d.ts +2 -0
- package/build-types/content-editable-control/test/index.d.ts.map +1 -0
- package/build-types/content-editable-control/types.d.ts +32 -0
- package/build-types/content-editable-control/types.d.ts.map +1 -0
- package/build-types/context/context-system-provider.d.ts +21 -2
- package/build-types/context/context-system-provider.d.ts.map +1 -1
- package/build-types/context/wordpress-component.d.ts +2 -1
- package/build-types/context/wordpress-component.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts +3 -2
- package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/gradient-bar/index.d.ts +1 -1
- package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/index.d.ts +1 -1
- package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/serializer.d.ts +3 -3
- package/build-types/custom-gradient-picker/serializer.d.ts.map +1 -1
- package/build-types/custom-select-control/index.d.ts.map +1 -1
- package/build-types/custom-select-control/types.d.ts +1 -8
- package/build-types/custom-select-control/types.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/index.d.ts +2 -1
- package/build-types/custom-select-control-v2/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/item.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts +23 -0
- package/build-types/date-time/date/index.d.ts.map +1 -0
- package/build-types/date-time/date/styles.d.ts +45 -0
- package/build-types/date-time/date/styles.d.ts.map +1 -0
- package/build-types/date-time/date/test/index.d.ts +2 -0
- package/build-types/date-time/date/test/index.d.ts.map +1 -0
- 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/date-picker/index.d.ts +1 -1
- package/build-types/date-time/date-picker/index.d.ts.map +1 -1
- package/build-types/date-time/time/index.d.ts +27 -0
- package/build-types/date-time/time/index.d.ts.map +1 -0
- package/build-types/date-time/time/styles.d.ts +93 -0
- package/build-types/date-time/time/styles.d.ts.map +1 -0
- package/build-types/date-time/time/test/index.d.ts +2 -0
- package/build-types/date-time/time/test/index.d.ts.map +1 -0
- package/build-types/date-time/time/time-input/index.d.ts +4 -0
- package/build-types/date-time/time/time-input/index.d.ts.map +1 -0
- package/build-types/date-time/time/time-input/test/index.d.ts +2 -0
- package/build-types/date-time/time/time-input/test/index.d.ts.map +1 -0
- package/build-types/date-time/time/timezone.d.ts +7 -0
- package/build-types/date-time/time/timezone.d.ts.map +1 -0
- package/build-types/date-time/time-picker/index.d.ts +3 -2
- package/build-types/date-time/time-picker/index.d.ts.map +1 -1
- package/build-types/date-time/time-picker/styles.d.ts +4 -8
- package/build-types/date-time/time-picker/styles.d.ts.map +1 -1
- package/build-types/date-time/time-picker/time-input/index.d.ts +1 -1
- package/build-types/date-time/time-picker/time-input/index.d.ts.map +1 -1
- package/build-types/disabled/index.d.ts +4 -4
- package/build-types/disabled/index.d.ts.map +1 -1
- package/build-types/divider/styles.d.ts +10 -0
- package/build-types/divider/styles.d.ts.map +1 -0
- package/build-types/draggable/index.d.ts +1 -1
- package/build-types/draggable/index.d.ts.map +1 -1
- package/build-types/drop-zone/provider.d.ts +1 -1
- package/build-types/drop-zone/provider.d.ts.map +1 -1
- package/build-types/duotone-picker/color-list-picker/index.d.ts +1 -1
- package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -1
- package/build-types/duotone-picker/custom-duotone-bar.d.ts +1 -1
- package/build-types/duotone-picker/custom-duotone-bar.d.ts.map +1 -1
- package/build-types/flex/styles.d.ts +17 -0
- package/build-types/flex/styles.d.ts.map +1 -0
- package/build-types/focal-point-picker/controls.d.ts +1 -1
- package/build-types/focal-point-picker/controls.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +2 -4
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
- package/build-types/font-size-picker/index.d.ts +12 -2
- package/build-types/font-size-picker/index.d.ts.map +1 -1
- package/build-types/font-size-picker/stories/e2e/index.story.d.ts +12 -1
- package/build-types/font-size-picker/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/font-size-picker/types.d.ts +2 -15
- package/build-types/font-size-picker/types.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 +1 -1
- package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
- package/build-types/form-token-field/token.d.ts +1 -1
- package/build-types/form-token-field/token.d.ts.map +1 -1
- package/build-types/gradient-picker/index.d.ts.map +1 -1
- package/build-types/gradient-picker/stories/index.story.d.ts +1 -0
- package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/gradient-picker/test/index.d.ts +2 -0
- package/build-types/gradient-picker/test/index.d.ts.map +1 -0
- package/build-types/gradient-picker/types.d.ts +19 -4
- package/build-types/gradient-picker/types.d.ts.map +1 -1
- package/build-types/guide/index.d.ts +1 -1
- package/build-types/guide/index.d.ts.map +1 -1
- package/build-types/guide/page-control.d.ts +1 -1
- package/build-types/guide/page-control.d.ts.map +1 -1
- package/build-types/higher-order/with-fallback-styles/index.d.ts +3 -3
- package/build-types/higher-order/with-fallback-styles/index.d.ts.map +1 -1
- package/build-types/input-control/index.d.ts +0 -1
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-base.d.ts.map +1 -1
- package/build-types/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts +1 -8
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +15 -29
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/keyboard-shortcuts/index.d.ts +1 -1
- package/build-types/keyboard-shortcuts/index.d.ts.map +1 -1
- package/build-types/menu/group-label.d.ts.map +1 -1
- package/build-types/menu-items-choice/index.d.ts +1 -1
- package/build-types/menu-items-choice/index.d.ts.map +1 -1
- package/build-types/mobile/image/constants.d.ts +5 -0
- package/build-types/mobile/image/constants.d.ts.map +1 -0
- package/build-types/modal/stories/index.story.d.ts.map +1 -1
- package/build-types/navigation/back-button/index.d.ts +7 -0
- package/build-types/navigation/back-button/index.d.ts.map +1 -0
- package/build-types/navigation/constants.d.ts +3 -0
- package/build-types/navigation/constants.d.ts.map +1 -0
- package/build-types/navigation/context.d.ts +4 -0
- package/build-types/navigation/context.d.ts.map +1 -0
- package/build-types/navigation/group/context.d.ts +7 -0
- package/build-types/navigation/group/context.d.ts.map +1 -0
- package/build-types/navigation/group/index.d.ts +7 -0
- package/build-types/navigation/group/index.d.ts.map +1 -0
- package/build-types/navigation/index.d.ts +46 -0
- package/build-types/navigation/index.d.ts.map +1 -0
- package/build-types/navigation/item/base-content.d.ts +3 -0
- package/build-types/navigation/item/base-content.d.ts.map +1 -0
- package/build-types/navigation/item/base.d.ts +3 -0
- package/build-types/navigation/item/base.d.ts.map +1 -0
- package/build-types/navigation/item/index.d.ts +7 -0
- package/build-types/navigation/item/index.d.ts.map +1 -0
- package/build-types/navigation/item/use-navigation-tree-item.d.ts +3 -0
- package/build-types/navigation/item/use-navigation-tree-item.d.ts.map +1 -0
- package/build-types/navigation/menu/context.d.ts +7 -0
- package/build-types/navigation/menu/context.d.ts.map +1 -0
- package/build-types/navigation/menu/index.d.ts +7 -0
- package/build-types/navigation/menu/index.d.ts.map +1 -0
- package/build-types/navigation/menu/menu-title-search.d.ts +3 -0
- package/build-types/navigation/menu/menu-title-search.d.ts.map +1 -0
- package/build-types/navigation/menu/menu-title.d.ts +3 -0
- package/build-types/navigation/menu/menu-title.d.ts.map +1 -0
- package/build-types/navigation/menu/search-no-results-found.d.ts +3 -0
- package/build-types/navigation/menu/search-no-results-found.d.ts.map +1 -0
- package/build-types/navigation/menu/use-navigation-tree-menu.d.ts +3 -0
- package/build-types/navigation/menu/use-navigation-tree-menu.d.ts.map +1 -0
- package/build-types/navigation/stories/index.story.d.ts +23 -0
- package/build-types/navigation/stories/index.story.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/controlled-state.d.ts +7 -0
- package/build-types/navigation/stories/utils/controlled-state.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/default.d.ts +10 -0
- package/build-types/navigation/stories/utils/default.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/group.d.ts +10 -0
- package/build-types/navigation/stories/utils/group.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts +10 -0
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/more-examples.d.ts +10 -0
- package/build-types/navigation/stories/utils/more-examples.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/search.d.ts +10 -0
- package/build-types/navigation/stories/utils/search.d.ts.map +1 -0
- package/build-types/navigation/styles/navigation-styles.d.ts +55 -0
- package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -0
- package/build-types/navigation/test/index.d.ts +2 -0
- package/build-types/navigation/test/index.d.ts.map +1 -0
- package/build-types/navigation/types.d.ts +266 -0
- package/build-types/navigation/types.d.ts.map +1 -0
- package/build-types/navigation/use-create-navigation-tree.d.ts +15 -0
- package/build-types/navigation/use-create-navigation-tree.d.ts.map +1 -0
- package/build-types/navigation/use-navigation-tree-nodes.d.ts +10 -0
- package/build-types/navigation/use-navigation-tree-nodes.d.ts.map +1 -0
- package/build-types/navigation/utils.d.ts +3 -0
- package/build-types/navigation/utils.d.ts.map +1 -0
- package/build-types/navigator/navigator-screen/use-screen-animate-presence.d.ts +1 -1
- package/build-types/navigator/navigator-screen/use-screen-animate-presence.d.ts.map +1 -1
- package/build-types/notice/index.d.ts +1 -1
- package/build-types/notice/index.d.ts.map +1 -1
- package/build-types/notice/list.d.ts +1 -1
- package/build-types/notice/list.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts +1 -2
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/stories/index.story.d.ts +1 -2
- package/build-types/number-control/stories/index.story.d.ts.map +1 -1
- package/build-types/number-control/types.d.ts +0 -7
- package/build-types/number-control/types.d.ts.map +1 -1
- package/build-types/palette-edit/index.d.ts +1 -1
- package/build-types/palette-edit/index.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/query-controls/author-select.d.ts +1 -1
- package/build-types/query-controls/author-select.d.ts.map +1 -1
- package/build-types/range-control/index.d.ts +2 -4
- package/build-types/range-control/index.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +1 -2
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/range-control/types.d.ts +2 -16
- package/build-types/range-control/types.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/utils.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
- package/build-types/responsive-wrapper/index.d.ts +1 -1
- package/build-types/responsive-wrapper/index.d.ts.map +1 -1
- package/build-types/sandbox/index.d.ts +34 -0
- package/build-types/sandbox/index.d.ts.map +1 -1
- package/build-types/sandbox/types.d.ts +11 -0
- package/build-types/sandbox/types.d.ts.map +1 -1
- package/build-types/search-control/index.d.ts.map +1 -1
- package/build-types/search-control/types.d.ts +1 -1
- package/build-types/search-control/types.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/select-control/types.d.ts +9 -1
- package/build-types/select-control/types.d.ts.map +1 -1
- package/build-types/slot-fill/fill.d.ts.map +1 -1
- package/build-types/slot-fill/index.d.ts +1 -1
- package/build-types/slot-fill/index.d.ts.map +1 -1
- package/build-types/slot-fill/stories/index.story.d.ts +1 -6
- package/build-types/slot-fill/stories/index.story.d.ts.map +1 -1
- package/build-types/snackbar/list.d.ts +1 -1
- package/build-types/snackbar/list.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +2 -4
- package/build-types/spacer/hook.d.ts.map +1 -1
- package/build-types/spacer/stories/index.story.d.ts +1 -6
- package/build-types/spacer/stories/index.story.d.ts.map +1 -1
- package/build-types/surface/styles.d.ts +11 -0
- package/build-types/surface/styles.d.ts.map +1 -0
- package/build-types/text/types.d.ts +4 -4
- package/build-types/text/types.d.ts.map +1 -1
- package/build-types/text/utils.d.ts +1 -1
- package/build-types/text/utils.d.ts.map +1 -1
- package/build-types/theme/styles.d.ts +10 -0
- package/build-types/theme/styles.d.ts.map +1 -0
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts +0 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/types.d.ts +0 -7
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/build-types/tools-panel/styles.d.ts +1 -1
- package/build-types/tools-panel/styles.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tree-grid/roving-tab-index.d.ts +1 -1
- package/build-types/tree-grid/roving-tab-index.d.ts.map +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-select/types.d.ts +1 -8
- package/build-types/tree-select/types.d.ts.map +1 -1
- package/build-types/truncate/styles.d.ts +2 -0
- package/build-types/truncate/styles.d.ts.map +1 -0
- package/build-types/unit-control/index.d.ts +2 -4
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -2
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/unit-control/types.d.ts +1 -15
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +1 -2
- package/build-types/utils/hooks/use-animated-offset-rect.d.ts +1 -1
- package/build-types/utils/hooks/use-animated-offset-rect.d.ts.map +1 -1
- package/build-types/utils/hooks/use-controlled-state.d.ts +6 -0
- package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
- package/build-types/utils/hooks/use-controlled-value.d.ts +1 -1
- package/build-types/utils/hooks/use-controlled-value.d.ts.map +1 -1
- package/build-types/utils/rtl.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/content-editable-control.d.ts +16 -0
- package/build-types/validated-form-controls/components/content-editable-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/index.d.ts +1 -0
- package/build-types/validated-form-controls/components/index.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/input-control.d.ts +1 -1
- package/build-types/validated-form-controls/components/input-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/number-control.d.ts +2 -3
- package/build-types/validated-form-controls/components/number-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/range-control.d.ts +2 -4
- package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/content-editable-control.story.d.ts +9 -0
- package/build-types/validated-form-controls/components/stories/content-editable-control.story.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/stories/overview.story.d.ts +5 -0
- package/build-types/validated-form-controls/components/stories/overview.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/toggle-group-control.d.ts +1 -2
- package/build-types/validated-form-controls/components/toggle-group-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -1
- package/build-types/validated-form-controls/test/content-editable-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/content-editable-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/validity-indicator.d.ts +1 -1
- package/build-types/validated-form-controls/validity-indicator.d.ts.map +1 -1
- package/build-types/visually-hidden/test/index.d.ts +2 -0
- package/build-types/visually-hidden/test/index.d.ts.map +1 -0
- package/package.json +30 -30
- package/src/angle-picker-control/index.tsx +0 -1
- package/src/autocomplete/index.tsx +20 -11
- package/src/autocomplete/style.scss +1 -0
- package/src/badge/stories/index.story.tsx +1 -1
- package/src/base-control/README.md +2 -2
- package/src/base-control/stories/index.story.tsx +1 -1
- package/src/border-box-control/styles.ts +6 -2
- package/src/border-box-control/types.ts +4 -15
- package/src/box-control/types.ts +4 -8
- package/src/button/stories/e2e/index.story.tsx +10 -2
- package/src/button/stories/index.story.tsx +1 -1
- package/src/button/style.scss +32 -27
- package/src/button-group/style.scss +1 -6
- package/src/calendar/style.scss +1 -1
- package/src/card/stories/index.story.tsx +1 -1
- package/src/card/test/__snapshots__/index.tsx.snap +1 -1
- package/src/checkbox-control/stories/index.story.tsx +1 -1
- package/src/checkbox-control/test/__snapshots__/index.tsx.snap +1 -1
- package/src/color-indicator/test/__snapshots__/index.tsx.snap +1 -1
- package/src/color-palette/styles.ts +1 -1
- package/src/color-picker/component.tsx +23 -19
- package/src/color-picker/hex-input.tsx +0 -1
- package/src/color-picker/input-with-slider.tsx +0 -1
- package/src/color-picker/picker.tsx +144 -21
- package/src/color-picker/test/index.tsx +502 -0
- package/src/color-picker/types.ts +2 -0
- package/src/combobox-control/style.scss +2 -2
- package/src/confirm-dialog/component.tsx +2 -4
- package/src/confirm-dialog/stories/index.story.tsx +1 -1
- package/src/confirm-dialog/style.module.scss +7 -0
- package/src/confirm-dialog/test/index.tsx +5 -0
- package/src/content-editable-control/README.md +88 -0
- package/src/content-editable-control/docs-manifest.json +5 -0
- package/src/content-editable-control/index.tsx +110 -0
- package/src/content-editable-control/stories/index.story.tsx +32 -0
- package/src/content-editable-control/style.module.scss +34 -0
- package/src/content-editable-control/test/index.tsx +176 -0
- package/src/content-editable-control/types.ts +35 -0
- package/src/context/test/__snapshots__/context-system-provider.js.snap +1 -1
- package/src/context/wordpress-component.ts +7 -2
- package/src/custom-gradient-picker/test/index.tsx +111 -1
- package/src/custom-select-control/index.tsx +1 -2
- package/src/custom-select-control/stories/index.story.tsx +1 -1
- package/src/custom-select-control/test/__snapshots__/index.tsx.snap +6 -0
- package/src/custom-select-control/test/index.tsx +23 -0
- package/src/custom-select-control/types.ts +1 -8
- package/src/custom-select-control-v2/custom-select.tsx +1 -5
- package/src/custom-select-control-v2/stories/index.story.tsx +1 -1
- package/src/date-time/date-picker/styles.ts +1 -1
- package/src/date-time/time-picker/index.tsx +0 -2
- package/src/date-time/time-picker/time-input/index.tsx +0 -2
- package/src/disabled/index.tsx +7 -5
- package/src/disabled/style.module.scss +15 -0
- package/src/disabled/test/index.tsx +6 -4
- package/src/dropdown-menu/style.scss +1 -1
- package/src/elevation/stories/index.story.tsx +1 -1
- package/src/elevation/test/__snapshots__/index.tsx.snap +1 -1
- package/src/external-link/stories/index.story.tsx +1 -1
- package/src/external-link/style.scss +7 -13
- package/src/flex/stories/index.story.tsx +1 -1
- package/src/flex/test/__snapshots__/index.tsx.snap +1 -1
- package/src/font-size-picker/types.ts +6 -15
- package/src/form-toggle/test/__snapshots__/index.tsx.snap +1 -1
- package/src/form-token-field/index.tsx +5 -4
- package/src/form-token-field/style.module.scss +6 -0
- package/src/form-token-field/style.scss +2 -2
- package/src/gradient-picker/README.md +21 -3
- package/src/gradient-picker/index.tsx +43 -28
- package/src/gradient-picker/stories/index.story.tsx +41 -5
- package/src/gradient-picker/test/index.tsx +148 -0
- package/src/gradient-picker/types.ts +24 -4
- package/src/h-stack/stories/index.story.tsx +1 -1
- package/src/h-stack/test/__snapshots__/index.tsx.snap +1 -1
- package/src/heading/hook.ts +1 -1
- package/src/heading/stories/index.story.tsx +1 -1
- package/src/heading/test/__snapshots__/index.tsx.snap +1 -1
- package/src/higher-order/with-filters/test/__snapshots__/index.tsx.snap +1 -1
- package/src/icon/stories/index.story.tsx +1 -1
- package/src/input-control/README.md +0 -8
- package/src/input-control/index.tsx +4 -16
- package/src/input-control/input-base.tsx +4 -8
- package/src/input-control/stories/index.story.tsx +2 -4
- package/src/input-control/styles/input-control-styles.tsx +1 -19
- package/src/input-control/test/__snapshots__/index.js.snap +11 -0
- package/src/input-control/test/index.js +29 -7
- package/src/input-control/types.ts +15 -30
- package/src/item-group/test/__snapshots__/index.js.snap +1 -1
- package/src/menu/README.md +2 -2
- package/src/menu/group-label.tsx +2 -1
- package/src/menu-group/style.scss +1 -1
- package/src/menu-item/style.scss +1 -1
- package/src/menu-item/test/__snapshots__/index.js.snap +1 -1
- package/src/modal/stories/index.story.tsx +2 -5
- package/src/modal/style.scss +1 -1
- package/src/modal/test/index.tsx +42 -0
- package/src/notice/stories/index.story.tsx +1 -1
- package/src/notice/test/__snapshots__/index.tsx.snap +1 -1
- package/src/number-control/README.md +0 -8
- package/src/number-control/index.tsx +1 -12
- package/src/number-control/stories/index.story.tsx +1 -3
- package/src/number-control/test/index.tsx +1 -1
- package/src/number-control/types.ts +0 -7
- package/src/palette-edit/styles.ts +1 -1
- package/src/panel/stories/index.story.tsx +4 -4
- package/src/panel/style.scss +2 -5
- package/src/panel/test/__snapshots__/body.tsx.snap +1 -1
- package/src/panel/test/__snapshots__/header.tsx.snap +1 -1
- package/src/panel/test/__snapshots__/index.tsx.snap +1 -1
- package/src/panel/test/__snapshots__/row.tsx.snap +1 -1
- package/src/placeholder/style.scss +1 -1
- package/src/private-apis.ts +4 -2
- package/src/range-control/index.tsx +0 -2
- package/src/range-control/types.ts +2 -15
- package/src/sandbox/index.tsx +165 -98
- package/src/sandbox/test/index.tsx +63 -1
- package/src/sandbox/types.ts +11 -0
- package/src/scrollable/test/__snapshots__/index.tsx.snap +1 -1
- package/src/search-control/index.tsx +23 -21
- package/src/search-control/style.module.scss +16 -0
- package/src/search-control/test/index.tsx +8 -0
- package/src/search-control/types.ts +1 -1
- package/src/select-control/index.tsx +0 -2
- package/src/select-control/stories/index.story.tsx +1 -1
- package/src/select-control/styles/select-control-styles.ts +0 -7
- package/src/select-control/test/__snapshots__/select-control.tsx.snap +11 -0
- package/src/select-control/test/select-control.tsx +37 -0
- package/src/select-control/types.ts +8 -2
- package/src/shortcut/test/__snapshots__/index.tsx.snap +1 -1
- package/src/slot-fill/fill.tsx +3 -9
- package/src/slot-fill/stories/index.story.tsx +52 -10
- package/src/slot-fill/test/__snapshots__/slot.js.snap +1 -1
- package/src/slot-fill/test/slot.js +53 -11
- package/src/spacer/hook.ts +93 -77
- package/src/spacer/stories/index.story.tsx +8 -6
- package/src/spacer/style.module.scss +25 -0
- package/src/spacer/test/__snapshots__/index.tsx.snap +3 -223
- package/src/spacer/test/index.tsx +106 -110
- package/src/tab-panel/stories/index.story.tsx +1 -1
- package/src/tab-panel/style.scss +1 -1
- package/src/tabs/stories/index.story.tsx +1 -1
- package/src/text/stories/index.story.tsx +1 -1
- package/src/text/test/__snapshots__/index.tsx.snap +1 -1
- package/src/text/types.ts +5 -5
- package/src/text-control/style.scss +1 -1
- package/src/textarea-control/stories/index.story.tsx +1 -1
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +37 -715
- package/src/toggle-group-control/test/index.tsx +33 -3
- package/src/toggle-group-control/toggle-group-control/component.tsx +11 -16
- package/src/toggle-group-control/toggle-group-control/style.module.scss +63 -0
- package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +22 -24
- package/src/toggle-group-control/toggle-group-control-option-base/style.module.scss +88 -0
- package/src/toggle-group-control/types.ts +0 -7
- package/src/toolbar/toolbar-button/style.scss +1 -1
- package/src/tools-panel/style.module.scss +117 -0
- package/src/tools-panel/test/index.tsx +105 -39
- package/src/tools-panel/tools-panel/component.tsx +12 -1
- package/src/tools-panel/tools-panel/hook.ts +13 -15
- package/src/tools-panel/tools-panel-header/component.tsx +6 -2
- package/src/tools-panel/tools-panel-header/hook.ts +7 -25
- package/src/tools-panel/tools-panel-item/hook.ts +16 -34
- package/src/tooltip/stories/index.story.tsx +1 -1
- package/src/tooltip/test/index.tsx +1 -1
- package/src/tree-grid/stories/index.story.tsx +0 -2
- package/src/tree-grid/test/__snapshots__/cell.tsx.snap +1 -1
- package/src/tree-grid/test/__snapshots__/index.tsx.snap +1 -1
- package/src/tree-grid/test/__snapshots__/roving-tab-index-item.tsx.snap +1 -1
- package/src/tree-grid/test/__snapshots__/roving-tab-index.tsx.snap +1 -1
- package/src/tree-grid/test/__snapshots__/row.tsx.snap +1 -1
- package/src/tree-select/README.md +1 -1
- package/src/tree-select/types.ts +1 -8
- package/src/unit-control/index.tsx +0 -1
- package/src/unit-control/types.ts +1 -18
- package/src/utils/base-label.ts +1 -1
- package/src/utils/config-values.js +1 -2
- package/src/utils/font-values.js +1 -1
- package/src/utils/theme-variables.scss +1 -0
- package/src/v-stack/stories/index.story.tsx +1 -1
- package/src/v-stack/test/__snapshots__/index.tsx.snap +1 -1
- package/src/validated-form-controls/components/content-editable-control.tsx +88 -0
- package/src/validated-form-controls/components/index.ts +1 -0
- package/src/validated-form-controls/components/input-control.tsx +2 -10
- package/src/validated-form-controls/components/number-control.tsx +2 -10
- package/src/validated-form-controls/components/stories/content-editable-control.story.tsx +56 -0
- package/src/validated-form-controls/components/stories/overview.story.tsx +51 -0
- package/src/validated-form-controls/control-with-error.tsx +10 -1
- package/src/validated-form-controls/style.scss +9 -2
- package/src/validated-form-controls/test/content-editable-control.tsx +71 -0
- package/src/validated-form-controls/test/control-with-error.tsx +42 -0
- package/src/view/test/__snapshots__/index.js.snap +1 -1
- package/src/visually-hidden/stories/index.story.tsx +1 -1
- package/build/confirm-dialog/styles.cjs +0 -42
- package/build/confirm-dialog/styles.cjs.map +0 -7
- package/build/disabled/styles/disabled-styles.cjs +0 -42
- package/build/disabled/styles/disabled-styles.cjs.map +0 -7
- package/build/form-token-field/styles.cjs +0 -49
- package/build/form-token-field/styles.cjs.map +0 -7
- package/build/search-control/styles.cjs +0 -74
- package/build/search-control/styles.cjs.map +0 -7
- package/build/theme/color-algorithms.cjs +0 -131
- package/build/theme/color-algorithms.cjs.map +0 -7
- package/build/theme/index.cjs +0 -160
- package/build/theme/index.cjs.map +0 -7
- package/build/toggle-group-control/toggle-group-control/styles.cjs +0 -53
- package/build/toggle-group-control/toggle-group-control/styles.cjs.map +0 -7
- package/build/toggle-group-control/toggle-group-control-option-base/styles.cjs +0 -94
- package/build/toggle-group-control/toggle-group-control-option-base/styles.cjs.map +0 -7
- package/build/tools-panel/styles.cjs +0 -129
- package/build/tools-panel/styles.cjs.map +0 -7
- package/build/utils/deprecated-36px-size.cjs +0 -56
- package/build/utils/deprecated-36px-size.cjs.map +0 -7
- package/build/utils/use-deprecated-props.cjs +0 -41
- package/build/utils/use-deprecated-props.cjs.map +0 -7
- package/build-module/confirm-dialog/styles.mjs +0 -17
- package/build-module/confirm-dialog/styles.mjs.map +0 -7
- package/build-module/disabled/styles/disabled-styles.mjs +0 -17
- package/build-module/disabled/styles/disabled-styles.mjs.map +0 -7
- package/build-module/form-token-field/styles.mjs +0 -14
- package/build-module/form-token-field/styles.mjs.map +0 -7
- package/build-module/search-control/styles.mjs +0 -38
- package/build-module/search-control/styles.mjs.map +0 -7
- package/build-module/theme/color-algorithms.mjs +0 -94
- package/build-module/theme/color-algorithms.mjs.map +0 -7
- package/build-module/theme/index.mjs +0 -129
- package/build-module/theme/index.mjs.map +0 -7
- package/build-module/toggle-group-control/toggle-group-control/styles.mjs +0 -27
- package/build-module/toggle-group-control/toggle-group-control/styles.mjs.map +0 -7
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.mjs +0 -56
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.mjs.map +0 -7
- package/build-module/tools-panel/styles.mjs +0 -84
- package/build-module/tools-panel/styles.mjs.map +0 -7
- package/build-module/utils/deprecated-36px-size.mjs +0 -21
- package/build-module/utils/deprecated-36px-size.mjs.map +0 -7
- package/build-module/utils/use-deprecated-props.mjs +0 -16
- package/build-module/utils/use-deprecated-props.mjs.map +0 -7
- package/src/confirm-dialog/styles.ts +0 -18
- package/src/disabled/styles/disabled-styles.tsx +0 -23
- package/src/form-token-field/styles.ts +0 -15
- package/src/search-control/styles.ts +0 -27
- package/src/theme/README.md +0 -47
- package/src/theme/color-algorithms.ts +0 -142
- package/src/theme/index.tsx +0 -80
- package/src/theme/stories/index.story.tsx +0 -127
- package/src/theme/style.module.scss +0 -4
- package/src/theme/test/color-algorithms.ts +0 -100
- package/src/theme/test/index.tsx +0 -151
- package/src/theme/types.ts +0 -61
- package/src/toggle-group-control/toggle-group-control/styles.ts +0 -84
- package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +0 -109
- package/src/tools-panel/styles.ts +0 -176
- package/src/utils/deprecated-36px-size.ts +0 -30
- package/src/utils/use-deprecated-props.ts +0 -14
- /package/build-module/{theme → content-editable-control}/types.mjs +0 -0
- /package/build-module/{theme → content-editable-control}/types.mjs.map +0 -0
|
@@ -60,12 +60,15 @@ var UnconnectedColorPicker = (props, forwardedRef) => {
|
|
|
60
60
|
...safeColordColor.toHsl()
|
|
61
61
|
}));
|
|
62
62
|
const lastProducedHexRef = useRef(safeColordColor.toHex());
|
|
63
|
+
const isPickerInteractingRef = useRef(false);
|
|
63
64
|
useEffect(() => {
|
|
64
|
-
|
|
65
|
-
if (incomingHex === lastProducedHexRef.current) {
|
|
65
|
+
if (isPickerInteractingRef.current) {
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
lastProducedHexRef.current
|
|
68
|
+
if (safeColordColor.isEqual(lastProducedHexRef.current)) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
lastProducedHexRef.current = safeColordColor.toHex();
|
|
69
72
|
const externalHSLA = safeColordColor.toHsl();
|
|
70
73
|
setInternalHSLA((prev) => mergeHSLA(externalHSLA, prev));
|
|
71
74
|
}, [safeColordColor]);
|
|
@@ -73,7 +76,7 @@ var UnconnectedColorPicker = (props, forwardedRef) => {
|
|
|
73
76
|
setInternalHSLA(nextHSLA);
|
|
74
77
|
const previousHex = lastProducedHexRef.current;
|
|
75
78
|
const nextHex = colord(nextHSLA).toHex();
|
|
76
|
-
if (nextHex
|
|
79
|
+
if (!colord(nextHex).isEqual(previousHex)) {
|
|
77
80
|
lastProducedHexRef.current = nextHex;
|
|
78
81
|
setColor(nextHex);
|
|
79
82
|
}
|
|
@@ -116,7 +119,13 @@ var UnconnectedColorPicker = (props, forwardedRef) => {
|
|
|
116
119
|
children: [/* @__PURE__ */ _jsx(Picker, {
|
|
117
120
|
onChange: handleHSLAChange,
|
|
118
121
|
hsla: internalHSLA,
|
|
119
|
-
enableAlpha
|
|
122
|
+
enableAlpha,
|
|
123
|
+
onInteractionStart: () => {
|
|
124
|
+
isPickerInteractingRef.current = true;
|
|
125
|
+
},
|
|
126
|
+
onInteractionEnd: () => {
|
|
127
|
+
isPickerInteractingRef.current = false;
|
|
128
|
+
}
|
|
120
129
|
}), /* @__PURE__ */ _jsxs(AuxiliaryColorArtefactWrapper, {
|
|
121
130
|
children: [/* @__PURE__ */ _jsxs(AuxiliaryColorArtefactHStackHeader, {
|
|
122
131
|
justify: "space-between",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/color-picker/component.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\n\nimport { colord, extend, getFormat } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useRef, useState, useMemo } from '@wordpress/element';\nimport { useDebounce } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, contextConnect } from '../context';\nimport { ColorfulWrapper, SelectControl, AuxiliaryColorArtefactWrapper, AuxiliaryColorArtefactHStackHeader, ColorInputWrapper } from './styles';\nimport { ColorCopyButton } from './color-copy-button';\nimport { ColorInput } from './color-input';\nimport { Picker } from './picker';\nimport { useControlledValue } from '../utils/hooks';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nextend([namesPlugin]);\n\n/**\n * Merges incoming HSLA with previous state, preserving hue for achromatic\n * colors and saturation only at lightness extremes (black/white) where\n * it has no visual effect.\n */\nfunction mergeHSLA(nextHSLA, prevHSLA) {\n if (nextHSLA.s === 0) {\n if (nextHSLA.l === 0 || nextHSLA.l === 100) {\n return {\n ...nextHSLA,\n h: prevHSLA.h,\n s: prevHSLA.s\n };\n }\n return {\n ...nextHSLA,\n h: prevHSLA.h\n };\n }\n return nextHSLA;\n}\nconst options = [{\n label: 'RGB',\n value: 'rgb'\n}, {\n label: 'HSL',\n value: 'hsl'\n}, {\n label: 'Hex',\n value: 'hex'\n}];\nconst UnconnectedColorPicker = (props, forwardedRef) => {\n const {\n enableAlpha = false,\n color: colorProp,\n onChange,\n defaultValue = '#fff',\n copyFormat,\n ...divProps\n } = useContextSystem(props, 'ColorPicker');\n\n // Use a safe default value for the color and remove the possibility of `undefined`.\n const [color, setColor] = useControlledValue({\n onChange,\n value: colorProp,\n defaultValue\n });\n const safeColordColor = useMemo(() => {\n return colord(color || '');\n }, [color]);\n const debouncedSetColor = useDebounce(setColor);\n\n // Internal HSLA state preserves hue and saturation values that\n // would otherwise be lost when converting to/from hex at achromatic\n // colors (e.g. pure black or white where any H/S maps to the same hex).\n const [internalHSLA, setInternalHSLA] = useState(() => ({\n ...safeColordColor.toHsl()\n }));\n\n // Track the last hex we produced so the sync effect can\n // distinguish our own updates from external prop changes.\n const lastProducedHexRef = useRef(safeColordColor.toHex());\n\n // Sync internalHSLA when the color prop changes externally (e.g.\n // parent passes a new color that wasn't produced by our onChange).\n useEffect(() => {\n
|
|
5
|
-
"mappings": ";AAIA,SAAS,QAAQ,QAAQ,iBAAiB;AAC1C,OAAO,iBAAiB;AAKxB,SAAS,aAAa,WAAW,QAAQ,UAAU,eAAe;AAClE,SAAS,mBAAmB;AAC5B,SAAS,UAAU;AAKnB,SAAS,kBAAkB,sBAAsB;AACjD,SAAS,iBAAiB,eAAe,+BAA+B,oCAAoC,yBAAyB;AACrI,SAAS,uBAAuB;AAChC,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB,SAAS,0BAA0B;AACnC,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,OAAO,CAAC,WAAW,CAAC;AAOpB,SAAS,UAAU,UAAU,UAAU;AACrC,MAAI,SAAS,MAAM,GAAG;AACpB,QAAI,SAAS,MAAM,KAAK,SAAS,MAAM,KAAK;AAC1C,aAAO;AAAA,QACL,GAAG;AAAA,QACH,GAAG,SAAS;AAAA,QACZ,GAAG,SAAS;AAAA,MACd;AAAA,IACF;AACA,WAAO;AAAA,MACL,GAAG;AAAA,MACH,GAAG,SAAS;AAAA,IACd;AAAA,EACF;AACA,SAAO;AACT;AACA,IAAM,UAAU,CAAC;AAAA,EACf,OAAO;AAAA,EACP,OAAO;AACT,GAAG;AAAA,EACD,OAAO;AAAA,EACP,OAAO;AACT,GAAG;AAAA,EACD,OAAO;AAAA,EACP,OAAO;AACT,CAAC;AACD,IAAM,yBAAyB,CAAC,OAAO,iBAAiB;AACtD,QAAM;AAAA,IACJ,cAAc;AAAA,IACd,OAAO;AAAA,IACP;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA,GAAG;AAAA,EACL,IAAI,iBAAiB,OAAO,aAAa;AAGzC,QAAM,CAAC,OAAO,QAAQ,IAAI,mBAAmB;AAAA,IAC3C;AAAA,IACA,OAAO;AAAA,IACP;AAAA,EACF,CAAC;AACD,QAAM,kBAAkB,QAAQ,MAAM;AACpC,WAAO,OAAO,SAAS,EAAE;AAAA,EAC3B,GAAG,CAAC,KAAK,CAAC;AACV,QAAM,oBAAoB,YAAY,QAAQ;AAK9C,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,OAAO;AAAA,IACtD,GAAG,gBAAgB,MAAM;AAAA,EAC3B,EAAE;AAIF,QAAM,qBAAqB,OAAO,gBAAgB,MAAM,CAAC;AAIzD,YAAU,MAAM;AACd,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\n\nimport { colord, extend, getFormat } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useRef, useState, useMemo } from '@wordpress/element';\nimport { useDebounce } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, contextConnect } from '../context';\nimport { ColorfulWrapper, SelectControl, AuxiliaryColorArtefactWrapper, AuxiliaryColorArtefactHStackHeader, ColorInputWrapper } from './styles';\nimport { ColorCopyButton } from './color-copy-button';\nimport { ColorInput } from './color-input';\nimport { Picker } from './picker';\nimport { useControlledValue } from '../utils/hooks';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nextend([namesPlugin]);\n\n/**\n * Merges incoming HSLA with previous state, preserving hue for achromatic\n * colors and saturation only at lightness extremes (black/white) where\n * it has no visual effect.\n */\nfunction mergeHSLA(nextHSLA, prevHSLA) {\n if (nextHSLA.s === 0) {\n if (nextHSLA.l === 0 || nextHSLA.l === 100) {\n return {\n ...nextHSLA,\n h: prevHSLA.h,\n s: prevHSLA.s\n };\n }\n return {\n ...nextHSLA,\n h: prevHSLA.h\n };\n }\n return nextHSLA;\n}\nconst options = [{\n label: 'RGB',\n value: 'rgb'\n}, {\n label: 'HSL',\n value: 'hsl'\n}, {\n label: 'Hex',\n value: 'hex'\n}];\nconst UnconnectedColorPicker = (props, forwardedRef) => {\n const {\n enableAlpha = false,\n color: colorProp,\n onChange,\n defaultValue = '#fff',\n copyFormat,\n ...divProps\n } = useContextSystem(props, 'ColorPicker');\n\n // Use a safe default value for the color and remove the possibility of `undefined`.\n const [color, setColor] = useControlledValue({\n onChange,\n value: colorProp,\n defaultValue\n });\n const safeColordColor = useMemo(() => {\n return colord(color || '');\n }, [color]);\n const debouncedSetColor = useDebounce(setColor);\n\n // Internal HSLA state preserves hue and saturation values that\n // would otherwise be lost when converting to/from hex at achromatic\n // colors (e.g. pure black or white where any H/S maps to the same hex).\n const [internalHSLA, setInternalHSLA] = useState(() => ({\n ...safeColordColor.toHsl()\n }));\n\n // Track the last hex we produced so the sync effect can\n // distinguish our own updates from external prop changes.\n const lastProducedHexRef = useRef(safeColordColor.toHex());\n\n // While the user is dragging the visual picker, ignore color-prop sync\n // so delayed/stale controlled echoes cannot overwrite internalHSLA mid-drag.\n const isPickerInteractingRef = useRef(false);\n\n // Sync internalHSLA when the color prop changes externally (e.g.\n // parent passes a new color that wasn't produced by our onChange).\n useEffect(() => {\n if (isPickerInteractingRef.current) {\n return;\n }\n\n // Compare by color equality, not hex string — rgb()/rgba()\n // round-trips can differ in string form for the same color.\n if (safeColordColor.isEqual(lastProducedHexRef.current)) {\n return;\n }\n\n // Genuinely external change — sync internalHSLA.\n lastProducedHexRef.current = safeColordColor.toHex();\n const externalHSLA = safeColordColor.toHsl();\n setInternalHSLA(prev => mergeHSLA(externalHSLA, prev));\n }, [safeColordColor]);\n\n // Handler for HSL inputs (and the HSVA picker after it converts to HSLA).\n // Apply the user's HSLA, then notify the parent only when the color\n // actually changes. setColor must not run inside setInternalHSLA\n // (state updaters must be pure). Uses direct setColor (not debounced)\n // to avoid races with hex/RGB's debouncedSetColor.\n const handleHSLAChange = useCallback(nextHSLA => {\n setInternalHSLA(nextHSLA);\n const previousHex = lastProducedHexRef.current;\n const nextHex = colord(nextHSLA).toHex();\n if (!colord(nextHex).isEqual(previousHex)) {\n lastProducedHexRef.current = nextHex;\n setColor(nextHex);\n }\n }, [setColor]);\n\n // Handler for components that provide Colord values (RGB, Hex inputs).\n // Uses debouncedSetColor since the hex input fires per keystroke.\n const handleChange = useCallback(nextValue => {\n const nextHSLA = nextValue.toHsl();\n setInternalHSLA(prev => mergeHSLA(nextHSLA, prev));\n const nextHex = nextValue.toHex();\n lastProducedHexRef.current = nextHex;\n debouncedSetColor(nextHex);\n }, [debouncedSetColor]);\n const [colorType, setColorType] = useState(copyFormat || 'hex');\n\n /*\n * ! Listener intended for the CAPTURE phase\n *\n * Capture paste events over the entire color picker, looking for clipboard\n * data that could be parsed as a color. If not, let the paste event\n * propagate normally, so that individual input controls within the\n * component have a chance to handle it.\n */\n const maybeHandlePaste = useCallback(event => {\n const pastedText = event.clipboardData?.getData('text')?.trim();\n if (!pastedText) {\n return;\n }\n const parsedColor = colord(pastedText);\n if (!parsedColor.isValid()) {\n return;\n }\n\n // Apply all valid colors, even if the format isn't supported in\n // the UI (e.g. names like \"cyan\" or, in the future color spaces\n // like \"lch\" if we add the right colord plugins)\n handleChange(parsedColor);\n\n // This redundancy helps TypeScript and is safer than assertions\n const supportedFormats = {\n hex: 'hex',\n rgb: 'rgb',\n hsl: 'hsl'\n };\n const detectedFormat = String(getFormat(pastedText));\n const newColorType = supportedFormats[detectedFormat];\n if (newColorType) {\n setColorType(newColorType);\n }\n\n // Stop at capture phase; no bubbling\n event.stopPropagation();\n event.preventDefault();\n }, [handleChange, setColorType]);\n return /*#__PURE__*/_jsxs(ColorfulWrapper, {\n ref: forwardedRef,\n ...divProps,\n onPasteCapture: maybeHandlePaste,\n children: [/*#__PURE__*/_jsx(Picker, {\n onChange: handleHSLAChange,\n hsla: internalHSLA,\n enableAlpha: enableAlpha,\n onInteractionStart: () => {\n isPickerInteractingRef.current = true;\n },\n onInteractionEnd: () => {\n isPickerInteractingRef.current = false;\n }\n }), /*#__PURE__*/_jsxs(AuxiliaryColorArtefactWrapper, {\n children: [/*#__PURE__*/_jsxs(AuxiliaryColorArtefactHStackHeader, {\n justify: \"space-between\",\n children: [/*#__PURE__*/_jsx(SelectControl, {\n size: \"compact\",\n options: options,\n value: colorType,\n onChange: nextColorType => setColorType(nextColorType),\n label: __('Color format'),\n hideLabelFromVision: true,\n variant: \"minimal\"\n }), /*#__PURE__*/_jsx(ColorCopyButton, {\n color: safeColordColor,\n colorType: copyFormat || colorType\n })]\n }), /*#__PURE__*/_jsx(ColorInputWrapper, {\n direction: \"column\",\n gap: 2,\n children: /*#__PURE__*/_jsx(ColorInput, {\n colorType: colorType,\n color: safeColordColor,\n hsla: internalHSLA,\n onChange: handleChange,\n onHSLChange: handleHSLAChange,\n enableAlpha: enableAlpha\n })\n })]\n })]\n });\n};\n\n/**\n * `ColorPicker` lets users select a color from a visual color surface, or by\n * editing its hex, RGB, or HSL values.\n */\nexport const ColorPicker = contextConnect(UnconnectedColorPicker, 'ColorPicker');\nexport default ColorPicker;"],
|
|
5
|
+
"mappings": ";AAIA,SAAS,QAAQ,QAAQ,iBAAiB;AAC1C,OAAO,iBAAiB;AAKxB,SAAS,aAAa,WAAW,QAAQ,UAAU,eAAe;AAClE,SAAS,mBAAmB;AAC5B,SAAS,UAAU;AAKnB,SAAS,kBAAkB,sBAAsB;AACjD,SAAS,iBAAiB,eAAe,+BAA+B,oCAAoC,yBAAyB;AACrI,SAAS,uBAAuB;AAChC,SA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": ["/**\n * External dependencies\n */\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { InputControl } from '../input-control';\nimport { Text } from '../text';\nimport { COLORS } from '../utils/colors-values';\nimport InputControlPrefixWrapper from '../input-control/input-prefix-wrapper';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const HexInput = ({\n color,\n onChange,\n enableAlpha\n}) => {\n const handleChange = nextValue => {\n if (nextValue === undefined) {\n return;\n }\n const hexValue = nextValue.startsWith('#') ? nextValue : '#' + nextValue;\n onChange(colord(hexValue));\n };\n const stateReducer = (state, action) => {\n const nativeEvent = action.payload?.event?.nativeEvent;\n if ('insertFromPaste' !== nativeEvent?.inputType) {\n return {\n ...state\n };\n }\n const value = state.value?.startsWith('#') ? state.value.slice(1).toUpperCase() : state.value?.toUpperCase();\n return {\n ...state,\n value\n };\n };\n return /*#__PURE__*/_jsx(InputControl, {\n prefix: /*#__PURE__*/_jsx(InputControlPrefixWrapper, {\n children: /*#__PURE__*/_jsx(Text, {\n color: COLORS.theme.accent,\n lineHeight: 1,\n children: \"#\"\n })\n }),\n value: color.toHex().slice(1).toUpperCase(),\n onChange: handleChange,\n maxLength: enableAlpha ? 9 : 7,\n label: __('Hex color'),\n hideLabelFromVision: true,\n
|
|
5
|
-
"mappings": ";AAGA,SAAS,cAAc;AAKvB,SAAS,UAAU;AAKnB,SAAS,oBAAoB;AAC7B,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,OAAO,+BAA+B;AACtC,SAAS,OAAO,YAAY;AACrB,IAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,eAAa;AAChC,QAAI,cAAc,QAAW;AAC3B;AAAA,IACF;AACA,UAAM,WAAW,UAAU,WAAW,GAAG,IAAI,YAAY,MAAM;AAC/D,aAAS,OAAO,QAAQ,CAAC;AAAA,EAC3B;AACA,QAAM,eAAe,CAAC,OAAO,WAAW;AACtC,UAAM,cAAc,OAAO,SAAS,OAAO;AAC3C,QAAI,sBAAsB,aAAa,WAAW;AAChD,aAAO;AAAA,QACL,GAAG;AAAA,MACL;AAAA,IACF;AACA,UAAM,QAAQ,MAAM,OAAO,WAAW,GAAG,IAAI,MAAM,MAAM,MAAM,CAAC,EAAE,YAAY,IAAI,MAAM,OAAO,YAAY;AAC3G,WAAO;AAAA,MACL,GAAG;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACA,SAAoB,qBAAK,cAAc;AAAA,IACrC,QAAqB,qBAAK,2BAA2B;AAAA,MACnD,UAAuB,qBAAK,MAAM;AAAA,QAChC,OAAO,OAAO,MAAM;AAAA,QACpB,YAAY;AAAA,QACZ,UAAU;AAAA,MACZ,CAAC;AAAA,IACH,CAAC;AAAA,IACD,OAAO,MAAM,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY;AAAA,IAC1C,UAAU;AAAA,IACV,WAAW,cAAc,IAAI;AAAA,IAC7B,OAAO,GAAG,WAAW;AAAA,IACrB,qBAAqB;AAAA,IACrB,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { InputControl } from '../input-control';\nimport { Text } from '../text';\nimport { COLORS } from '../utils/colors-values';\nimport InputControlPrefixWrapper from '../input-control/input-prefix-wrapper';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const HexInput = ({\n color,\n onChange,\n enableAlpha\n}) => {\n const handleChange = nextValue => {\n if (nextValue === undefined) {\n return;\n }\n const hexValue = nextValue.startsWith('#') ? nextValue : '#' + nextValue;\n onChange(colord(hexValue));\n };\n const stateReducer = (state, action) => {\n const nativeEvent = action.payload?.event?.nativeEvent;\n if ('insertFromPaste' !== nativeEvent?.inputType) {\n return {\n ...state\n };\n }\n const value = state.value?.startsWith('#') ? state.value.slice(1).toUpperCase() : state.value?.toUpperCase();\n return {\n ...state,\n value\n };\n };\n return /*#__PURE__*/_jsx(InputControl, {\n prefix: /*#__PURE__*/_jsx(InputControlPrefixWrapper, {\n children: /*#__PURE__*/_jsx(Text, {\n color: COLORS.theme.accent,\n lineHeight: 1,\n children: \"#\"\n })\n }),\n value: color.toHex().slice(1).toUpperCase(),\n onChange: handleChange,\n maxLength: enableAlpha ? 9 : 7,\n label: __('Hex color'),\n hideLabelFromVision: true,\n __unstableStateReducer: stateReducer,\n __unstableInputWidth: \"9em\"\n });\n};"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,cAAc;AAKvB,SAAS,UAAU;AAKnB,SAAS,oBAAoB;AAC7B,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,OAAO,+BAA+B;AACtC,SAAS,OAAO,YAAY;AACrB,IAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,eAAa;AAChC,QAAI,cAAc,QAAW;AAC3B;AAAA,IACF;AACA,UAAM,WAAW,UAAU,WAAW,GAAG,IAAI,YAAY,MAAM;AAC/D,aAAS,OAAO,QAAQ,CAAC;AAAA,EAC3B;AACA,QAAM,eAAe,CAAC,OAAO,WAAW;AACtC,UAAM,cAAc,OAAO,SAAS,OAAO;AAC3C,QAAI,sBAAsB,aAAa,WAAW;AAChD,aAAO;AAAA,QACL,GAAG;AAAA,MACL;AAAA,IACF;AACA,UAAM,QAAQ,MAAM,OAAO,WAAW,GAAG,IAAI,MAAM,MAAM,MAAM,CAAC,EAAE,YAAY,IAAI,MAAM,OAAO,YAAY;AAC3G,WAAO;AAAA,MACL,GAAG;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACA,SAAoB,qBAAK,cAAc;AAAA,IACrC,QAAqB,qBAAK,2BAA2B;AAAA,MACnD,UAAuB,qBAAK,MAAM;AAAA,QAChC,OAAO,OAAO,MAAM;AAAA,QACpB,YAAY;AAAA,QACZ,UAAU;AAAA,MACZ,CAAC;AAAA,IACH,CAAC;AAAA,IACD,OAAO,MAAM,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY;AAAA,IAC1C,UAAU;AAAA,IACV,WAAW,cAAc,IAAI;AAAA,IAC7B,OAAO,GAAG,WAAW;AAAA,IACrB,qBAAqB;AAAA,IACrB,wBAAwB;AAAA,IACxB,sBAAsB;AAAA,EACxB,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/color-picker/input-with-slider.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport { HStack } from '../h-stack';\nimport { Text } from '../text';\nimport { RangeControl, NumberControlWrapper } from './styles';\nimport { COLORS } from '../utils/colors-values';\nimport InputControlPrefixWrapper from '../input-control/input-prefix-wrapper';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const InputWithSlider = ({\n min,\n max,\n label,\n abbreviation,\n onChange,\n value\n}) => {\n const onNumberControlChange = newValue => {\n if (!newValue) {\n onChange(0);\n return;\n }\n if (typeof newValue === 'string') {\n onChange(parseInt(newValue, 10));\n return;\n }\n onChange(newValue);\n };\n return /*#__PURE__*/_jsxs(HStack, {\n spacing: 4,\n children: [/*#__PURE__*/_jsx(NumberControlWrapper, {\n
|
|
5
|
-
"mappings": ";AAGA,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,cAAc,4BAA4B;AACnD,SAAS,cAAc;AACvB,OAAO,+BAA+B;AACtC,SAAS,OAAO,MAAM,QAAQ,aAAa;AACpC,IAAM,kBAAkB,CAAC;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,wBAAwB,cAAY;AACxC,QAAI,CAAC,UAAU;AACb,eAAS,CAAC;AACV;AAAA,IACF;AACA,QAAI,OAAO,aAAa,UAAU;AAChC,eAAS,SAAS,UAAU,EAAE,CAAC;AAC/B;AAAA,IACF;AACA,aAAS,QAAQ;AAAA,EACnB;AACA,SAAoB,sBAAM,QAAQ;AAAA,IAChC,SAAS;AAAA,IACT,UAAU,CAAc,qBAAK,sBAAsB;AAAA,MACjD
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport { HStack } from '../h-stack';\nimport { Text } from '../text';\nimport { RangeControl, NumberControlWrapper } from './styles';\nimport { COLORS } from '../utils/colors-values';\nimport InputControlPrefixWrapper from '../input-control/input-prefix-wrapper';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const InputWithSlider = ({\n min,\n max,\n label,\n abbreviation,\n onChange,\n value\n}) => {\n const onNumberControlChange = newValue => {\n if (!newValue) {\n onChange(0);\n return;\n }\n if (typeof newValue === 'string') {\n onChange(parseInt(newValue, 10));\n return;\n }\n onChange(newValue);\n };\n return /*#__PURE__*/_jsxs(HStack, {\n spacing: 4,\n children: [/*#__PURE__*/_jsx(NumberControlWrapper, {\n min: min,\n max: max,\n label: label,\n hideLabelFromVision: true,\n value: value,\n onChange: onNumberControlChange,\n prefix: /*#__PURE__*/_jsx(InputControlPrefixWrapper, {\n children: /*#__PURE__*/_jsx(Text, {\n color: COLORS.theme.accent,\n lineHeight: 1,\n children: abbreviation\n })\n }),\n spinControls: \"none\"\n }), /*#__PURE__*/_jsx(RangeControl, {\n label: label,\n hideLabelFromVision: true,\n min: min,\n max: max,\n value: value\n // @ts-expect-error\n // See: https://github.com/WordPress/gutenberg/pull/40535#issuecomment-1172418185\n ,\n onChange: onChange,\n withInputField: false\n })]\n });\n};"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,cAAc,4BAA4B;AACnD,SAAS,cAAc;AACvB,OAAO,+BAA+B;AACtC,SAAS,OAAO,MAAM,QAAQ,aAAa;AACpC,IAAM,kBAAkB,CAAC;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,wBAAwB,cAAY;AACxC,QAAI,CAAC,UAAU;AACb,eAAS,CAAC;AACV;AAAA,IACF;AACA,QAAI,OAAO,aAAa,UAAU;AAChC,eAAS,SAAS,UAAU,EAAE,CAAC;AAC/B;AAAA,IACF;AACA,aAAS,QAAQ;AAAA,EACnB;AACA,SAAoB,sBAAM,QAAQ;AAAA,IAChC,SAAS;AAAA,IACT,UAAU,CAAc,qBAAK,sBAAsB;AAAA,MACjD;AAAA,MACA;AAAA,MACA;AAAA,MACA,qBAAqB;AAAA,MACrB;AAAA,MACA,UAAU;AAAA,MACV,QAAqB,qBAAK,2BAA2B;AAAA,QACnD,UAAuB,qBAAK,MAAM;AAAA,UAChC,OAAO,OAAO,MAAM;AAAA,UACpB,YAAY;AAAA,UACZ,UAAU;AAAA,QACZ,CAAC;AAAA,MACH,CAAC;AAAA,MACD,cAAc;AAAA,IAChB,CAAC,GAAgB,qBAAK,cAAc;AAAA,MAClC;AAAA,MACA,qBAAqB;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,MAIA;AAAA,MACA,gBAAgB;AAAA,IAClB,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,38 +1,110 @@
|
|
|
1
1
|
// packages/components/src/color-picker/picker.tsx
|
|
2
|
-
import {
|
|
2
|
+
import { useEffect, useRef, useState } from "@wordpress/element";
|
|
3
|
+
import { HsvColorPicker, HsvaColorPicker } from "react-colorful";
|
|
4
|
+
import { colord } from "colord";
|
|
3
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
function toHsva(hsla) {
|
|
7
|
+
return {
|
|
8
|
+
...colord(hsla).toHsv(),
|
|
9
|
+
// HSL and HSV share the hue angle. Color conversion collapses achromatic
|
|
10
|
+
// hue to 0, but HSLA retains the user's latent hue.
|
|
11
|
+
h: hsla.h,
|
|
12
|
+
a: hsla.a
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function isSameHsla(a, b) {
|
|
16
|
+
return a.h === b.h && a.s === b.s && a.l === b.l && a.a === b.a;
|
|
17
|
+
}
|
|
18
|
+
function toHsvaFromHsla(hsla, prevHsva, prevHsla) {
|
|
19
|
+
const converted = toHsva(hsla);
|
|
20
|
+
if (hsla.l !== 0) {
|
|
21
|
+
return converted;
|
|
16
22
|
}
|
|
17
|
-
|
|
23
|
+
const saturationChanged = prevHsla !== null && prevHsla.s !== hsla.s;
|
|
24
|
+
return {
|
|
25
|
+
h: hsla.h,
|
|
26
|
+
s: saturationChanged ? hsla.s : prevHsva.s,
|
|
27
|
+
v: 0,
|
|
28
|
+
a: hsla.a
|
|
29
|
+
};
|
|
30
|
+
}
|
|
18
31
|
var Picker = ({
|
|
19
32
|
hsla,
|
|
20
33
|
enableAlpha,
|
|
21
|
-
onChange
|
|
34
|
+
onChange,
|
|
35
|
+
onInteractionStart,
|
|
36
|
+
onInteractionEnd
|
|
22
37
|
}) => {
|
|
38
|
+
const [hsva, setHsva] = useState(() => toHsva(hsla));
|
|
39
|
+
const pickerOriginHslaRef = useRef(null);
|
|
40
|
+
const prevHslaRef = useRef(hsla);
|
|
41
|
+
const isPointerInteractingRef = useRef(false);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (isPointerInteractingRef.current) {
|
|
44
|
+
prevHslaRef.current = hsla;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (pickerOriginHslaRef.current && isSameHsla(pickerOriginHslaRef.current, hsla)) {
|
|
48
|
+
prevHslaRef.current = hsla;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
pickerOriginHslaRef.current = null;
|
|
52
|
+
setHsva((prev) => toHsvaFromHsla(hsla, prev, prevHslaRef.current));
|
|
53
|
+
prevHslaRef.current = hsla;
|
|
54
|
+
}, [hsla]);
|
|
55
|
+
const pointerCaptureProps = {
|
|
56
|
+
onPointerDown({
|
|
57
|
+
currentTarget,
|
|
58
|
+
pointerId
|
|
59
|
+
}) {
|
|
60
|
+
isPointerInteractingRef.current = true;
|
|
61
|
+
onInteractionStart?.();
|
|
62
|
+
currentTarget.setPointerCapture(pointerId);
|
|
63
|
+
},
|
|
64
|
+
onPointerUp({
|
|
65
|
+
currentTarget,
|
|
66
|
+
pointerId
|
|
67
|
+
}) {
|
|
68
|
+
currentTarget.releasePointerCapture(pointerId);
|
|
69
|
+
isPointerInteractingRef.current = false;
|
|
70
|
+
onInteractionEnd?.();
|
|
71
|
+
},
|
|
72
|
+
onPointerCancel({
|
|
73
|
+
currentTarget,
|
|
74
|
+
pointerId
|
|
75
|
+
}) {
|
|
76
|
+
currentTarget.releasePointerCapture(pointerId);
|
|
77
|
+
isPointerInteractingRef.current = false;
|
|
78
|
+
onInteractionEnd?.();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const handleChange = (next) => {
|
|
82
|
+
setHsva(next);
|
|
83
|
+
const nextHsla = {
|
|
84
|
+
...colord(next).toHsl(),
|
|
85
|
+
a: next.a
|
|
86
|
+
};
|
|
87
|
+
pickerOriginHslaRef.current = nextHsla;
|
|
88
|
+
onChange(nextHsla);
|
|
89
|
+
};
|
|
23
90
|
if (enableAlpha) {
|
|
24
|
-
return /* @__PURE__ */ _jsx(
|
|
25
|
-
color:
|
|
26
|
-
onChange,
|
|
91
|
+
return /* @__PURE__ */ _jsx(HsvaColorPicker, {
|
|
92
|
+
color: hsva,
|
|
93
|
+
onChange: handleChange,
|
|
27
94
|
...pointerCaptureProps
|
|
28
95
|
});
|
|
29
96
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
97
|
+
const hsv = {
|
|
98
|
+
h: hsva.h,
|
|
99
|
+
s: hsva.s,
|
|
100
|
+
v: hsva.v
|
|
101
|
+
};
|
|
102
|
+
return /* @__PURE__ */ _jsx(HsvColorPicker, {
|
|
103
|
+
color: hsv,
|
|
104
|
+
onChange: (next) => {
|
|
105
|
+
handleChange({
|
|
106
|
+
...next,
|
|
107
|
+
a: hsva.a
|
|
36
108
|
});
|
|
37
109
|
},
|
|
38
110
|
...pointerCaptureProps
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/color-picker/picker.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport {
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\n\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { HsvColorPicker, HsvaColorPicker } from 'react-colorful';\nimport { colord } from 'colord';\n\n/**\n * Internal dependencies\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction toHsva(hsla) {\n return {\n ...colord(hsla).toHsv(),\n // HSL and HSV share the hue angle. Color conversion collapses achromatic\n // hue to 0, but HSLA retains the user's latent hue.\n h: hsla.h,\n a: hsla.a\n };\n}\nfunction isSameHsla(a, b) {\n return a.h === b.h && a.s === b.s && a.l === b.l && a.a === b.a;\n}\n\n/**\n * Convert parent HSLA into HSVA for prop sync.\n *\n * At black, RGB round-trips collapse saturation to 0. Preserve the native\n * HSVA saturation coordinate unless the HSL saturation channel itself\n * changed (sibling hue/alpha edits must not snap the pointer).\n *\n * At white, only `v: 100, s: 0` is visually white — preserving a prior\n * chromatic saturation would leave the pointer at the top-right and make\n * the first keyboard step jump from white to a saturated color.\n */\nfunction toHsvaFromHsla(hsla, prevHsva, prevHsla) {\n const converted = toHsva(hsla);\n\n // White and chromatic colors use the converted value as-is.\n if (hsla.l !== 0) {\n return converted;\n }\n const saturationChanged = prevHsla !== null && prevHsla.s !== hsla.s;\n return {\n h: hsla.h,\n s: saturationChanged ? hsla.s : prevHsva.s,\n v: 0,\n a: hsla.a\n };\n}\n\n/**\n * Visual color surface.\n *\n * Uses HSVA (react-colorful's native model) and keeps that value in local\n * state so HSLA↔hex round-trips cannot move the pointer\n * Parent ColorPicker still speaks HSLA for\n * inputs and controlled value sync; conversion happens only at the boundary.\n *\n * Prop sync from parent HSLA is suppressed for:\n * - pointer/touch drags (interaction flag), and\n * - any picker-originated update including keyboard (HSLA origin token).\n *\n * Achromatic HSL sibling edits (hue/alpha while at black) preserve native\n * HSVA saturation unless saturation itself changed. White always syncs to\n * the converted `s: 0` visual coordinate.\n */\nexport const Picker = ({\n hsla,\n enableAlpha,\n onChange,\n onInteractionStart,\n onInteractionEnd\n}) => {\n const [hsva, setHsva] = useState(() => toHsva(hsla));\n // Last HSLA emitted by this picker — skip echoing it back into HSVA.\n const pickerOriginHslaRef = useRef(null);\n // Previous parent HSLA — detect which channel changed on achromatic sync.\n const prevHslaRef = useRef(hsla);\n // Pointer/touch drag: never sync from HSLA mid-gesture (origin match alone\n // can fail across rapid frames when parent gradient state re-renders).\n const isPointerInteractingRef = useRef(false);\n useEffect(() => {\n if (isPointerInteractingRef.current) {\n // Keep prevHsla in lockstep with parent updates during the gesture\n // so a post-drag HSL sibling edit is not compared against pre-drag\n // HSLA and mistaken for a saturation change.\n prevHslaRef.current = hsla;\n return;\n }\n if (pickerOriginHslaRef.current && isSameHsla(pickerOriginHslaRef.current, hsla)) {\n prevHslaRef.current = hsla;\n return;\n }\n pickerOriginHslaRef.current = null;\n setHsva(prev => toHsvaFromHsla(hsla, prev, prevHslaRef.current));\n prevHslaRef.current = hsla;\n }, [hsla]);\n\n // Inline handlers so refs are not passed into a helper during render\n // (react-hooks/refs). Pointer capture also keeps drag working over iframes.\n const pointerCaptureProps = {\n onPointerDown({\n currentTarget,\n pointerId\n }) {\n isPointerInteractingRef.current = true;\n onInteractionStart?.();\n currentTarget.setPointerCapture(pointerId);\n },\n onPointerUp({\n currentTarget,\n pointerId\n }) {\n currentTarget.releasePointerCapture(pointerId);\n isPointerInteractingRef.current = false;\n onInteractionEnd?.();\n },\n onPointerCancel({\n currentTarget,\n pointerId\n }) {\n currentTarget.releasePointerCapture(pointerId);\n isPointerInteractingRef.current = false;\n onInteractionEnd?.();\n }\n };\n const handleChange = next => {\n setHsva(next);\n const nextHsla = {\n ...colord(next).toHsl(),\n a: next.a\n };\n pickerOriginHslaRef.current = nextHsla;\n onChange(nextHsla);\n };\n if (enableAlpha) {\n return /*#__PURE__*/_jsx(HsvaColorPicker, {\n color: hsva,\n onChange: handleChange,\n ...pointerCaptureProps\n });\n }\n\n // HsvColorPicker's equality checks enumerate own keys — never pass `a`,\n // or every parent re-render looks like an external color change and the\n // pointer jitters while dragging.\n const hsv = {\n h: hsva.h,\n s: hsva.s,\n v: hsva.v\n };\n return /*#__PURE__*/_jsx(HsvColorPicker, {\n color: hsv,\n onChange: next => {\n handleChange({\n ...next,\n a: hsva.a\n });\n },\n ...pointerCaptureProps\n });\n};"],
|
|
5
|
+
"mappings": ";AAIA,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,gBAAgB,uBAAuB;AAChD,SAAS,cAAc;AAKvB,SAAS,OAAO,YAAY;AAC5B,SAAS,OAAO,MAAM;AACpB,SAAO;AAAA,IACL,GAAG,OAAO,IAAI,EAAE,MAAM;AAAA;AAAA;AAAA,IAGtB,GAAG,KAAK;AAAA,IACR,GAAG,KAAK;AAAA,EACV;AACF;AACA,SAAS,WAAW,GAAG,GAAG;AACxB,SAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;AAChE;AAaA,SAAS,eAAe,MAAM,UAAU,UAAU;AAChD,QAAM,YAAY,OAAO,IAAI;AAG7B,MAAI,KAAK,MAAM,GAAG;AAChB,WAAO;AAAA,EACT;AACA,QAAM,oB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MACf,GAAG,OAAO,IAAI,EAAE,MAAM;AAAA,MACtB,GAAG,KAAK;AAAA,IACV;AACA,wBAAoB,UAAU;AAC9B,aAAS,QAAQ;AAAA,EACnB;AACA,MAAI,aAAa;AACf,WAAoB,qBAAK,iBAAiB;AAAA,MACxC,OAAO;AAAA,MACP,UAAU;AAAA,MACV,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAKA,QAAM,MAAM;AAAA,IACV,GAAG,KAAK;AAAA,IACR,GAAG,KAAK;AAAA,IACR,GAAG,KAAK;AAAA,EACV;AACA,SAAoB,qBAAK,gBAAgB;AAAA,IACvC,OAAO;AAAA,IACP,UAAU,UAAQ;AAChB,mBAAa;AAAA,QACX,GAAG;AAAA,QACH,GAAG,KAAK;AAAA,MACV,CAAC;AAAA,IACH;AAAA,IACA,GAAG;AAAA,EACL,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -7,8 +7,91 @@ import { Flex } from "../flex/index.mjs";
|
|
|
7
7
|
import Button from "../button/index.mjs";
|
|
8
8
|
import { Text } from "../text/index.mjs";
|
|
9
9
|
import { VStack } from "../v-stack/index.mjs";
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
|
|
11
|
+
// packages/style-runtime/src/index.ts
|
|
12
|
+
var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
|
|
13
|
+
function getRuntime() {
|
|
14
|
+
const globalScope = globalThis;
|
|
15
|
+
if (globalScope.__wpStyleRuntime) {
|
|
16
|
+
return globalScope.__wpStyleRuntime;
|
|
17
|
+
}
|
|
18
|
+
globalScope.__wpStyleRuntime = {
|
|
19
|
+
documents: /* @__PURE__ */ new Map(),
|
|
20
|
+
styles: /* @__PURE__ */ new Map(),
|
|
21
|
+
injectedStyles: /* @__PURE__ */ new WeakMap()
|
|
22
|
+
};
|
|
23
|
+
if (typeof document !== "undefined") {
|
|
24
|
+
registerDocument(document);
|
|
25
|
+
}
|
|
26
|
+
return globalScope.__wpStyleRuntime;
|
|
27
|
+
}
|
|
28
|
+
function documentContainsStyleHash(targetDocument, hash) {
|
|
29
|
+
if (!targetDocument.head) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {
|
|
33
|
+
if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
function injectStyle(targetDocument, hash, css) {
|
|
40
|
+
if (!targetDocument.head) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const runtime = getRuntime();
|
|
44
|
+
let injectedStyles = runtime.injectedStyles.get(targetDocument);
|
|
45
|
+
if (!injectedStyles) {
|
|
46
|
+
injectedStyles = /* @__PURE__ */ new Set();
|
|
47
|
+
runtime.injectedStyles.set(targetDocument, injectedStyles);
|
|
48
|
+
}
|
|
49
|
+
if (injectedStyles.has(hash)) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (documentContainsStyleHash(targetDocument, hash)) {
|
|
53
|
+
injectedStyles.add(hash);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const style = targetDocument.createElement("style");
|
|
57
|
+
style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
|
|
58
|
+
style.appendChild(targetDocument.createTextNode(css));
|
|
59
|
+
targetDocument.head.appendChild(style);
|
|
60
|
+
injectedStyles.add(hash);
|
|
61
|
+
}
|
|
62
|
+
function registerDocument(targetDocument) {
|
|
63
|
+
const runtime = getRuntime();
|
|
64
|
+
runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);
|
|
65
|
+
for (const [hash, css] of runtime.styles) {
|
|
66
|
+
injectStyle(targetDocument, hash, css);
|
|
67
|
+
}
|
|
68
|
+
return () => {
|
|
69
|
+
const count = runtime.documents.get(targetDocument);
|
|
70
|
+
if (count === void 0) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (count <= 1) {
|
|
74
|
+
runtime.documents.delete(targetDocument);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
runtime.documents.set(targetDocument, count - 1);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function registerStyle(hash, css) {
|
|
81
|
+
const runtime = getRuntime();
|
|
82
|
+
runtime.styles.set(hash, css);
|
|
83
|
+
for (const targetDocument of runtime.documents.keys()) {
|
|
84
|
+
injectStyle(targetDocument, hash, css);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// packages/components/src/confirm-dialog/style.module.scss
|
|
89
|
+
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
|
|
90
|
+
registerStyle("af7a0f28df", ".f8c6ba0dd016e6c1__wrapper.f8c6ba0dd016e6c1__wrapper{z-index:1000001}");
|
|
91
|
+
}
|
|
92
|
+
var style_module_default = { "wrapper": "f8c6ba0dd016e6c1__wrapper" };
|
|
93
|
+
|
|
94
|
+
// packages/components/src/confirm-dialog/component.tsx
|
|
12
95
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
96
|
var UnconnectedConfirmDialog = (props, forwardedRef) => {
|
|
14
97
|
const {
|
|
@@ -21,8 +104,7 @@ var UnconnectedConfirmDialog = (props, forwardedRef) => {
|
|
|
21
104
|
isBusy,
|
|
22
105
|
...otherProps
|
|
23
106
|
} = useContextSystem(props, "ConfirmDialog");
|
|
24
|
-
const
|
|
25
|
-
const wrapperClassName = cx(styles.wrapper);
|
|
107
|
+
const wrapperClassName = style_module_default.wrapper;
|
|
26
108
|
const cancelButtonRef = useRef(null);
|
|
27
109
|
const confirmButtonRef = useRef(null);
|
|
28
110
|
const [isOpen, setIsOpen] = useState();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/confirm-dialog/component.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useCallback, useEffect, useRef, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Modal from '../modal';\nimport { useContextSystem, contextConnect } from '../context';\nimport { Flex } from '../flex';\nimport Button from '../button';\nimport { Text } from '../text';\nimport { VStack } from '../v-stack';\nimport * as styles from './styles';\nimport { useCx } from '../utils/hooks/use-cx';\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nconst UnconnectedConfirmDialog = (props, forwardedRef) => {\n const {\n isOpen: isOpenProp,\n onConfirm,\n onCancel,\n children,\n confirmButtonText,\n cancelButtonText,\n isBusy,\n ...otherProps\n } = useContextSystem(props, 'ConfirmDialog');\n const cx = useCx();\n const wrapperClassName = cx(styles.wrapper);\n const cancelButtonRef = useRef(null);\n const confirmButtonRef = useRef(null);\n const [isOpen, setIsOpen] = useState();\n const [shouldSelfClose, setShouldSelfClose] = useState();\n useEffect(() => {\n // We only allow the dialog to close itself if `isOpenProp` is *not* set.\n // If `isOpenProp` is set, then it (probably) means it's controlled by a\n // parent component. In that case, `shouldSelfClose` might do more harm than\n // good, so we disable it.\n const isIsOpenSet = typeof isOpenProp !== 'undefined';\n setIsOpen(isIsOpenSet ? isOpenProp : true);\n setShouldSelfClose(!isIsOpenSet);\n }, [isOpenProp]);\n const handleEvent = useCallback(callback => event => {\n callback?.(event);\n if (shouldSelfClose) {\n setIsOpen(false);\n }\n }, [shouldSelfClose, setIsOpen]);\n const handleEnter = useCallback(event => {\n // Avoid triggering the 'confirm' action when a button is focused,\n // as this can cause a double submission.\n const isConfirmOrCancelButton = event.target === cancelButtonRef.current || event.target === confirmButtonRef.current;\n if (!isConfirmOrCancelButton && event.key === 'Enter') {\n handleEvent(onConfirm)(event);\n }\n }, [handleEvent, onConfirm]);\n const cancelLabel = cancelButtonText ?? __('Cancel');\n const confirmLabel = confirmButtonText ?? __('OK');\n return /*#__PURE__*/_jsx(_Fragment, {\n children: isOpen && /*#__PURE__*/_jsx(Modal, {\n onRequestClose: handleEvent(onCancel),\n onKeyDown: handleEnter,\n closeButtonLabel: cancelLabel,\n isDismissible: true,\n ref: forwardedRef,\n overlayClassName: wrapperClassName,\n __experimentalHideHeader: true,\n ...otherProps,\n children: /*#__PURE__*/_jsxs(VStack, {\n spacing: 8,\n children: [/*#__PURE__*/_jsx(Text, {\n children: children\n }), /*#__PURE__*/_jsxs(Flex, {\n direction: \"row\",\n justify: \"flex-end\",\n children: [/*#__PURE__*/_jsx(Button, {\n __next40pxDefaultSize: true,\n ref: cancelButtonRef,\n variant: \"tertiary\",\n onClick: handleEvent(onCancel),\n accessibleWhenDisabled: true,\n disabled: isBusy,\n children: cancelLabel\n }), /*#__PURE__*/_jsx(Button, {\n __next40pxDefaultSize: true,\n ref: confirmButtonRef,\n variant: \"primary\",\n onClick: handleEvent(onConfirm),\n accessibleWhenDisabled: true,\n disabled: isBusy,\n isBusy: isBusy,\n children: confirmLabel\n })]\n })]\n })\n })\n });\n};\n\n/**\n * `ConfirmDialog` is built of top of [`Modal`](/packages/components/src/modal/README.md)\n * and displays a confirmation dialog, with _confirm_ and _cancel_ buttons.\n * The dialog is confirmed by clicking the _confirm_ button or by pressing the `Enter` key.\n * It is cancelled (closed) by clicking the _cancel_ button, by pressing the `ESC` key, or by\n * clicking outside the dialog focus (i.e, the overlay).\n *\n * `ConfirmDialog` has two main implicit modes: controlled and uncontrolled.\n *\n * UnControlled:\n *\n * Allows the component to be used standalone, just by declaring it as part of another React's component render method:\n * - It will be automatically open (displayed) upon mounting;\n * - It will be automatically closed when clicking the _cancel_ button, by pressing the `ESC` key, or by clicking outside the dialog focus (i.e, the overlay);\n * - `onCancel` is not mandatory but can be passed. Even if passed, the dialog will still be able to close itself.\n *\n * Activating this mode is as simple as omitting the `isOpen` prop. The only mandatory prop, in this case, is the `onConfirm` callback. The message is passed as the `children`. You can pass any JSX you'd like, which allows to further format the message or include sub-component if you'd like:\n *\n * ```jsx\n * import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n *\n * function Example() {\n * \treturn (\n * \t\t<ConfirmDialog onConfirm={ () => console.debug( ' Confirmed! ' ) }>\n * \t\t\tAre you sure? <strong>This action cannot be undone!</strong>\n * \t\t</ConfirmDialog>\n * \t);\n * }\n * ```\n *\n *\n * Controlled mode:\n * Let the parent component control when the dialog is open/closed. It's activated when a\n * boolean value is passed to `isOpen`:\n * - It will not be automatically closed. You need to let it know when to open/close by updating the value of the `isOpen` prop;\n * - Both `onConfirm` and the `onCancel` callbacks are mandatory props in this mode;\n * - You'll want to update the state that controls `isOpen` by updating it from the `onCancel` and `onConfirm` callbacks.\n *\n *```jsx\n * import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * function Example() {\n * \tconst [ isOpen, setIsOpen ] = useState( true );\n *\n * \tconst handleConfirm = () => {\n * \t\tconsole.debug( 'Confirmed!' );\n * \t\tsetIsOpen( false );\n * \t};\n *\n * \tconst handleCancel = () => {\n * \t\tconsole.debug( 'Cancelled!' );\n * \t\tsetIsOpen( false );\n * \t};\n *\n * \treturn (\n * \t\t<ConfirmDialog\n * \t\t\tisOpen={ isOpen }\n * \t\t\tonConfirm={ handleConfirm }\n * \t\t\tonCancel={ handleCancel }\n * \t\t>\n * \t\t\tAre you sure? <strong>This action cannot be undone!</strong>\n * \t\t</ConfirmDialog>\n * \t);\n * }\n * ```\n */\nexport const ConfirmDialog = contextConnect(UnconnectedConfirmDialog, 'ConfirmDialog');\nexport default ConfirmDialog;"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AAKzD,OAAO,WAAW;AAClB,SAAS,kBAAkB,sBAAsB;AACjD,SAAS,YAAY;AACrB,OAAO,YAAY;AACnB,SAAS,YAAY;AACrB,SAAS,cAAc;
|
|
3
|
+
"sources": ["../../src/confirm-dialog/component.tsx", "../../../style-runtime/src/index.ts", "../../src/confirm-dialog/style.module.scss"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useCallback, useEffect, useRef, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Modal from '../modal';\nimport { useContextSystem, contextConnect } from '../context';\nimport { Flex } from '../flex';\nimport Button from '../button';\nimport { Text } from '../text';\nimport { VStack } from '../v-stack';\nimport styles from './style.module.scss';\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nconst UnconnectedConfirmDialog = (props, forwardedRef) => {\n const {\n isOpen: isOpenProp,\n onConfirm,\n onCancel,\n children,\n confirmButtonText,\n cancelButtonText,\n isBusy,\n ...otherProps\n } = useContextSystem(props, 'ConfirmDialog');\n const wrapperClassName = styles.wrapper;\n const cancelButtonRef = useRef(null);\n const confirmButtonRef = useRef(null);\n const [isOpen, setIsOpen] = useState();\n const [shouldSelfClose, setShouldSelfClose] = useState();\n useEffect(() => {\n // We only allow the dialog to close itself if `isOpenProp` is *not* set.\n // If `isOpenProp` is set, then it (probably) means it's controlled by a\n // parent component. In that case, `shouldSelfClose` might do more harm than\n // good, so we disable it.\n const isIsOpenSet = typeof isOpenProp !== 'undefined';\n setIsOpen(isIsOpenSet ? isOpenProp : true);\n setShouldSelfClose(!isIsOpenSet);\n }, [isOpenProp]);\n const handleEvent = useCallback(callback => event => {\n callback?.(event);\n if (shouldSelfClose) {\n setIsOpen(false);\n }\n }, [shouldSelfClose, setIsOpen]);\n const handleEnter = useCallback(event => {\n // Avoid triggering the 'confirm' action when a button is focused,\n // as this can cause a double submission.\n const isConfirmOrCancelButton = event.target === cancelButtonRef.current || event.target === confirmButtonRef.current;\n if (!isConfirmOrCancelButton && event.key === 'Enter') {\n handleEvent(onConfirm)(event);\n }\n }, [handleEvent, onConfirm]);\n const cancelLabel = cancelButtonText ?? __('Cancel');\n const confirmLabel = confirmButtonText ?? __('OK');\n return /*#__PURE__*/_jsx(_Fragment, {\n children: isOpen && /*#__PURE__*/_jsx(Modal, {\n onRequestClose: handleEvent(onCancel),\n onKeyDown: handleEnter,\n closeButtonLabel: cancelLabel,\n isDismissible: true,\n ref: forwardedRef,\n overlayClassName: wrapperClassName,\n __experimentalHideHeader: true,\n ...otherProps,\n children: /*#__PURE__*/_jsxs(VStack, {\n spacing: 8,\n children: [/*#__PURE__*/_jsx(Text, {\n children: children\n }), /*#__PURE__*/_jsxs(Flex, {\n direction: \"row\",\n justify: \"flex-end\",\n children: [/*#__PURE__*/_jsx(Button, {\n __next40pxDefaultSize: true,\n ref: cancelButtonRef,\n variant: \"tertiary\",\n onClick: handleEvent(onCancel),\n accessibleWhenDisabled: true,\n disabled: isBusy,\n children: cancelLabel\n }), /*#__PURE__*/_jsx(Button, {\n __next40pxDefaultSize: true,\n ref: confirmButtonRef,\n variant: \"primary\",\n onClick: handleEvent(onConfirm),\n accessibleWhenDisabled: true,\n disabled: isBusy,\n isBusy: isBusy,\n children: confirmLabel\n })]\n })]\n })\n })\n });\n};\n\n/**\n * `ConfirmDialog` is built of top of [`Modal`](/packages/components/src/modal/README.md)\n * and displays a confirmation dialog, with _confirm_ and _cancel_ buttons.\n * The dialog is confirmed by clicking the _confirm_ button or by pressing the `Enter` key.\n * It is cancelled (closed) by clicking the _cancel_ button, by pressing the `ESC` key, or by\n * clicking outside the dialog focus (i.e, the overlay).\n *\n * `ConfirmDialog` has two main implicit modes: controlled and uncontrolled.\n *\n * UnControlled:\n *\n * Allows the component to be used standalone, just by declaring it as part of another React's component render method:\n * - It will be automatically open (displayed) upon mounting;\n * - It will be automatically closed when clicking the _cancel_ button, by pressing the `ESC` key, or by clicking outside the dialog focus (i.e, the overlay);\n * - `onCancel` is not mandatory but can be passed. Even if passed, the dialog will still be able to close itself.\n *\n * Activating this mode is as simple as omitting the `isOpen` prop. The only mandatory prop, in this case, is the `onConfirm` callback. The message is passed as the `children`. You can pass any JSX you'd like, which allows to further format the message or include sub-component if you'd like:\n *\n * ```jsx\n * import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n *\n * function Example() {\n * \treturn (\n * \t\t<ConfirmDialog onConfirm={ () => console.debug( ' Confirmed! ' ) }>\n * \t\t\tAre you sure? <strong>This action cannot be undone!</strong>\n * \t\t</ConfirmDialog>\n * \t);\n * }\n * ```\n *\n *\n * Controlled mode:\n * Let the parent component control when the dialog is open/closed. It's activated when a\n * boolean value is passed to `isOpen`:\n * - It will not be automatically closed. You need to let it know when to open/close by updating the value of the `isOpen` prop;\n * - Both `onConfirm` and the `onCancel` callbacks are mandatory props in this mode;\n * - You'll want to update the state that controls `isOpen` by updating it from the `onCancel` and `onConfirm` callbacks.\n *\n *```jsx\n * import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * function Example() {\n * \tconst [ isOpen, setIsOpen ] = useState( true );\n *\n * \tconst handleConfirm = () => {\n * \t\tconsole.debug( 'Confirmed!' );\n * \t\tsetIsOpen( false );\n * \t};\n *\n * \tconst handleCancel = () => {\n * \t\tconsole.debug( 'Cancelled!' );\n * \t\tsetIsOpen( false );\n * \t};\n *\n * \treturn (\n * \t\t<ConfirmDialog\n * \t\t\tisOpen={ isOpen }\n * \t\t\tonConfirm={ handleConfirm }\n * \t\t\tonCancel={ handleCancel }\n * \t\t>\n * \t\t\tAre you sure? <strong>This action cannot be undone!</strong>\n * \t\t</ConfirmDialog>\n * \t);\n * }\n * ```\n */\nexport const ConfirmDialog = contextConnect(UnconnectedConfirmDialog, 'ConfirmDialog');\nexport default ConfirmDialog;", "const STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n const globalScope = globalThis;\n if (globalScope.__wpStyleRuntime) {\n return globalScope.__wpStyleRuntime;\n }\n globalScope.__wpStyleRuntime = {\n documents: new Map(),\n styles: new Map(),\n injectedStyles: new WeakMap()\n };\n if (typeof document !== 'undefined') {\n registerDocument(document);\n }\n return globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(targetDocument, hash) {\n if (!targetDocument.head) {\n return false;\n }\n for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {\n if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle(targetDocument, hash, css) {\n if (!targetDocument.head) {\n return;\n }\n const runtime = getRuntime();\n let injectedStyles = runtime.injectedStyles.get(targetDocument);\n if (!injectedStyles) {\n injectedStyles = new Set();\n runtime.injectedStyles.set(targetDocument, injectedStyles);\n }\n if (injectedStyles.has(hash)) {\n return;\n }\n\n // Older generated CSS module output can still inject matching style tags\n // after this document's cache is created, so keep the DOM as the fallback\n // source of truth on cache misses.\n if (documentContainsStyleHash(targetDocument, hash)) {\n injectedStyles.add(hash);\n return;\n }\n const style = targetDocument.createElement('style');\n style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);\n style.appendChild(targetDocument.createTextNode(css));\n targetDocument.head.appendChild(style);\n injectedStyles.add(hash);\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument(targetDocument) {\n const runtime = getRuntime();\n runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);\n for (const [hash, css] of runtime.styles) {\n injectStyle(targetDocument, hash, css);\n }\n return () => {\n const count = runtime.documents.get(targetDocument);\n if (count === undefined) {\n return;\n }\n if (count <= 1) {\n runtime.documents.delete(targetDocument);\n return;\n }\n runtime.documents.set(targetDocument, count - 1);\n };\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle(hash, css) {\n const runtime = getRuntime();\n runtime.styles.set(hash, css);\n for (const targetDocument of runtime.documents.keys()) {\n injectStyle(targetDocument, hash, css);\n }\n}", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"af7a0f28df\", \".f8c6ba0dd016e6c1__wrapper.f8c6ba0dd016e6c1__wrapper{z-index:1000001}\");\n}\nexport default {\"wrapper\":\"f8c6ba0dd016e6c1__wrapper\"};\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AAKzD,OAAO,WAAW;AAClB,SAAS,kBAAkB,sBAAsB;AACjD,SAAS,YAAY;AACrB,OAAO,YAAY;AACnB,SAAS,YAAY;AACrB,SAAS,cAAc;;;ACdvB,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACpB,QAAM,cAAc;AACpB,MAAI,YAAY,kBAAkB;AAChC,WAAO,YAAY;AAAA,EACrB;AACA,cAAY,mBAAmB;AAAA,IAC7B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,gBAAgB,oBAAI,QAAQ;AAAA,EAC9B;AACA,MAAI,OA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