@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
|
@@ -1,10 +1,94 @@
|
|
|
1
1
|
// packages/components/src/tools-panel/tools-panel-item/hook.ts
|
|
2
|
+
import clsx from "clsx";
|
|
2
3
|
import { usePrevious } from "@wordpress/compose";
|
|
3
|
-
import { useCallback, useEffect, useLayoutEffect
|
|
4
|
-
|
|
4
|
+
import { useCallback, useEffect, useLayoutEffect } from "@wordpress/element";
|
|
5
|
+
|
|
6
|
+
// packages/style-runtime/src/index.ts
|
|
7
|
+
var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
|
|
8
|
+
function getRuntime() {
|
|
9
|
+
const globalScope = globalThis;
|
|
10
|
+
if (globalScope.__wpStyleRuntime) {
|
|
11
|
+
return globalScope.__wpStyleRuntime;
|
|
12
|
+
}
|
|
13
|
+
globalScope.__wpStyleRuntime = {
|
|
14
|
+
documents: /* @__PURE__ */ new Map(),
|
|
15
|
+
styles: /* @__PURE__ */ new Map(),
|
|
16
|
+
injectedStyles: /* @__PURE__ */ new WeakMap()
|
|
17
|
+
};
|
|
18
|
+
if (typeof document !== "undefined") {
|
|
19
|
+
registerDocument(document);
|
|
20
|
+
}
|
|
21
|
+
return globalScope.__wpStyleRuntime;
|
|
22
|
+
}
|
|
23
|
+
function documentContainsStyleHash(targetDocument, hash) {
|
|
24
|
+
if (!targetDocument.head) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {
|
|
28
|
+
if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
function injectStyle(targetDocument, hash, css) {
|
|
35
|
+
if (!targetDocument.head) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const runtime = getRuntime();
|
|
39
|
+
let injectedStyles = runtime.injectedStyles.get(targetDocument);
|
|
40
|
+
if (!injectedStyles) {
|
|
41
|
+
injectedStyles = /* @__PURE__ */ new Set();
|
|
42
|
+
runtime.injectedStyles.set(targetDocument, injectedStyles);
|
|
43
|
+
}
|
|
44
|
+
if (injectedStyles.has(hash)) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (documentContainsStyleHash(targetDocument, hash)) {
|
|
48
|
+
injectedStyles.add(hash);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const style = targetDocument.createElement("style");
|
|
52
|
+
style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
|
|
53
|
+
style.appendChild(targetDocument.createTextNode(css));
|
|
54
|
+
targetDocument.head.appendChild(style);
|
|
55
|
+
injectedStyles.add(hash);
|
|
56
|
+
}
|
|
57
|
+
function registerDocument(targetDocument) {
|
|
58
|
+
const runtime = getRuntime();
|
|
59
|
+
runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);
|
|
60
|
+
for (const [hash, css] of runtime.styles) {
|
|
61
|
+
injectStyle(targetDocument, hash, css);
|
|
62
|
+
}
|
|
63
|
+
return () => {
|
|
64
|
+
const count = runtime.documents.get(targetDocument);
|
|
65
|
+
if (count === void 0) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (count <= 1) {
|
|
69
|
+
runtime.documents.delete(targetDocument);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
runtime.documents.set(targetDocument, count - 1);
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function registerStyle(hash, css) {
|
|
76
|
+
const runtime = getRuntime();
|
|
77
|
+
runtime.styles.set(hash, css);
|
|
78
|
+
for (const targetDocument of runtime.documents.keys()) {
|
|
79
|
+
injectStyle(targetDocument, hash, css);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// packages/components/src/tools-panel/style.module.scss
|
|
84
|
+
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
|
|
85
|
+
registerStyle("29b739f451", "._62d714739f4dc308__tools-panel{border-top:1px solid #ddd;margin-top:-1px;padding:16px}._40db7f4f897b683d__tools-panel-with-inner-wrapper>div:not(:first-of-type){column-gap:16px;display:grid;grid-column:1/-1;grid-template-columns:repeat(2,minmax(0,1fr));row-gap:16px}._95a15674966f30a3__tools-panel-hidden-inner-wrapper>div:not(:first-of-type){display:none}._322a049b9b7d8674__tools-panel-header{gap:8px;grid-column:1/-1}._322a049b9b7d8674__tools-panel-header .components-dropdown-menu{line-height:0;margin:-4px 0}._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header .components-dropdown-menu__toggle{min-width:24px;padding:0}.b92a382d3b30104d__tools-panel-heading.b92a382d3b30104d__tools-panel-heading{font-size:inherit;line-height:normal;margin:0}._8005d68fffa9db91__tools-panel-item{grid-column:1/-1}._8005d68fffa9db91__tools-panel-item>div,._8005d68fffa9db91__tools-panel-item>fieldset{margin-bottom:0;max-width:100%;padding-bottom:0}._8005d68fffa9db91__tools-panel-item .components-base-control__help,._8005d68fffa9db91__tools-panel-item._8005d68fffa9db91__tools-panel-item .components-base-control,._8005d68fffa9db91__tools-panel-item._8005d68fffa9db91__tools-panel-item .components-base-control .components-base-control__field:last-child{margin-bottom:0}._4f55e1a6e373746e__tools-panel-item-placeholder{display:none}.d40032517bff9e12__dropdown-menu{min-width:200px}.f135b96aa96ca6bb__reset-label{color:var(--wp-components-color-accent-darker-10,var(--wp-admin-theme-color-darker-10,#2145e6));font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:1.4;margin-inline-start:12px;text-transform:uppercase}._69b138dfa5570d9c__default-controls-item{color:#1e1e1e}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true]{color:#757575;opacity:1}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true]:hover{color:#757575}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true] .f135b96aa96ca6bb__reset-label{opacity:.3}");
|
|
86
|
+
}
|
|
87
|
+
var style_module_default = { "tools-panel": "_62d714739f4dc308__tools-panel", "tools-panel-with-inner-wrapper": "_40db7f4f897b683d__tools-panel-with-inner-wrapper", "tools-panel-hidden-inner-wrapper": "_95a15674966f30a3__tools-panel-hidden-inner-wrapper", "tools-panel-header": "_322a049b9b7d8674__tools-panel-header", "tools-panel-heading": "b92a382d3b30104d__tools-panel-heading", "tools-panel-item": "_8005d68fffa9db91__tools-panel-item", "tools-panel-item-placeholder": "_4f55e1a6e373746e__tools-panel-item-placeholder", "dropdown-menu": "d40032517bff9e12__dropdown-menu", "reset-label": "f135b96aa96ca6bb__reset-label", "default-controls-item": "_69b138dfa5570d9c__default-controls-item" };
|
|
88
|
+
|
|
89
|
+
// packages/components/src/tools-panel/tools-panel-item/hook.ts
|
|
5
90
|
import { useToolsPanelContext } from "../context.mjs";
|
|
6
91
|
import { useContextSystem } from "../../context/index.mjs";
|
|
7
|
-
import { useCx } from "../../utils/hooks/use-cx.mjs";
|
|
8
92
|
var noop = () => {
|
|
9
93
|
};
|
|
10
94
|
function useToolsPanelItem(props) {
|
|
@@ -86,13 +170,8 @@ function useToolsPanelItem(props) {
|
|
|
86
170
|
}
|
|
87
171
|
}, [hasMatchingPanel, isMenuItemChecked, isRegistered, isResetting, isValueSet, wasMenuItemChecked, onSelect, onDeselect]);
|
|
88
172
|
const isShown = isShownByDefault ? menuItems?.[menuGroup]?.[label] !== void 0 : isMenuItemChecked;
|
|
89
|
-
const
|
|
90
|
-
const classes =
|
|
91
|
-
const shouldApplyPlaceholderStyles = shouldRenderPlaceholder && !isShown;
|
|
92
|
-
const firstItemStyle = firstDisplayedItem === label && __experimentalFirstVisibleItemClass;
|
|
93
|
-
const lastItemStyle = lastDisplayedItem === label && __experimentalLastVisibleItemClass;
|
|
94
|
-
return cx(styles.ToolsPanelItem, shouldApplyPlaceholderStyles && styles.ToolsPanelItemPlaceholder, !shouldApplyPlaceholderStyles && className, firstItemStyle, lastItemStyle);
|
|
95
|
-
}, [isShown, shouldRenderPlaceholder, className, cx, firstDisplayedItem, lastDisplayedItem, __experimentalFirstVisibleItemClass, __experimentalLastVisibleItemClass, label]);
|
|
173
|
+
const shouldApplyPlaceholderStyles = shouldRenderPlaceholder && !isShown;
|
|
174
|
+
const classes = clsx(style_module_default["tools-panel-item"], shouldApplyPlaceholderStyles && style_module_default["tools-panel-item-placeholder"], !shouldApplyPlaceholderStyles && className, firstDisplayedItem === label && __experimentalFirstVisibleItemClass, lastDisplayedItem === label && __experimentalLastVisibleItemClass);
|
|
96
175
|
return {
|
|
97
176
|
...otherProps,
|
|
98
177
|
isShown,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/tools-panel/tools-panel-item/hook.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { usePrevious } from '@wordpress/compose';\nimport { useCallback, useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport * as styles from '../styles';\nimport { useToolsPanelContext } from '../context';\nimport { useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks/use-cx';\nconst noop = () => {};\nexport function useToolsPanelItem(props) {\n const {\n className,\n hasValue,\n isShownByDefault = false,\n label,\n panelId,\n resetAllFilter = noop,\n onDeselect,\n onSelect,\n ...otherProps\n } = useContextSystem(props, 'ToolsPanelItem');\n const {\n panelId: currentPanelId,\n menuItems,\n registerResetAllFilter,\n deregisterResetAllFilter,\n registerPanelItem,\n deregisterPanelItem,\n flagItemCustomization,\n isResetting,\n shouldRenderPlaceholderItems: shouldRenderPlaceholder,\n firstDisplayedItem,\n lastDisplayedItem,\n __experimentalFirstVisibleItemClass,\n __experimentalLastVisibleItemClass\n } = useToolsPanelContext();\n\n // hasValue is a new function on every render, so do not add it as a\n // dependency to the useCallback hook! If needed, we should use a ref.\n const hasValueCallback = useCallback(hasValue, [panelId]);\n // resetAllFilter is a new function on every render, so do not add it as a\n // dependency to the useCallback hook! If needed, we should use a ref.\n const resetAllFilterCallback = useCallback(resetAllFilter, [panelId]);\n const previousPanelId = usePrevious(currentPanelId);\n const hasMatchingPanel = currentPanelId === panelId || currentPanelId === null;\n\n // Registering the panel item allows the panel to include it in its\n // automatically generated menu and determine its initial checked status.\n //\n // This is performed in a layout effect to ensure that the panel item\n // is registered before it is rendered preventing a rendering glitch.\n // See: https://github.com/WordPress/gutenberg/issues/56470\n useLayoutEffect(() => {\n if (hasMatchingPanel && previousPanelId !== null) {\n registerPanelItem({\n hasValue: hasValueCallback,\n isShownByDefault,\n label,\n panelId\n });\n }\n return () => {\n if (previousPanelId === null && !!currentPanelId || currentPanelId === panelId) {\n deregisterPanelItem(label);\n }\n };\n }, [currentPanelId, hasMatchingPanel, isShownByDefault, label, hasValueCallback, panelId, previousPanelId, registerPanelItem, deregisterPanelItem]);\n useEffect(() => {\n if (hasMatchingPanel) {\n registerResetAllFilter(resetAllFilterCallback);\n }\n return () => {\n if (hasMatchingPanel) {\n deregisterResetAllFilter(resetAllFilterCallback);\n }\n };\n }, [registerResetAllFilter, deregisterResetAllFilter, resetAllFilterCallback, hasMatchingPanel]);\n\n // Note: `label` is used as a key when building menu item state in\n // `ToolsPanel`.\n const menuGroup = isShownByDefault ? 'default' : 'optional';\n const isMenuItemChecked = menuItems?.[menuGroup]?.[label];\n const wasMenuItemChecked = usePrevious(isMenuItemChecked);\n const isRegistered = menuItems?.[menuGroup]?.[label] !== undefined;\n const isValueSet = hasValue();\n // Notify the panel when an item's value has changed except for optional\n // items without value because the item should not cause itself to hide.\n useEffect(() => {\n if (!isShownByDefault && !isValueSet) {\n return;\n }\n flagItemCustomization(isValueSet, label, menuGroup);\n }, [isValueSet, menuGroup, label, flagItemCustomization, isShownByDefault]);\n\n // Determine if the panel item's corresponding menu is being toggled and\n // trigger appropriate callback if it is.\n useEffect(() => {\n // We check whether this item is currently registered as items rendered\n // via fills can persist through the parent panel being remounted.\n // See: https://github.com/WordPress/gutenberg/pull/45673\n if (!isRegistered || isResetting || !hasMatchingPanel) {\n return;\n }\n if (isMenuItemChecked && !isValueSet && !wasMenuItemChecked) {\n onSelect?.();\n }\n if (!isMenuItemChecked && isValueSet && wasMenuItemChecked) {\n onDeselect?.();\n }\n }, [hasMatchingPanel, isMenuItemChecked, isRegistered, isResetting, isValueSet, wasMenuItemChecked, onSelect, onDeselect]);\n\n // The item is shown if it is a default control regardless of whether it\n // has a value. Optional items are shown when they are checked or have\n // a value.\n const isShown = isShownByDefault ? menuItems?.[menuGroup]?.[label] !== undefined : isMenuItemChecked;\n const cx = useCx();\n const classes = useMemo(() => {\n const shouldApplyPlaceholderStyles = shouldRenderPlaceholder && !isShown;\n const firstItemStyle = firstDisplayedItem === label && __experimentalFirstVisibleItemClass;\n const lastItemStyle = lastDisplayedItem === label && __experimentalLastVisibleItemClass;\n return cx(styles.ToolsPanelItem, shouldApplyPlaceholderStyles && styles.ToolsPanelItemPlaceholder, !shouldApplyPlaceholderStyles && className, firstItemStyle, lastItemStyle);\n }, [isShown, shouldRenderPlaceholder, className, cx, firstDisplayedItem, lastDisplayedItem, __experimentalFirstVisibleItemClass, __experimentalLastVisibleItemClass, label]);\n return {\n ...otherProps,\n isShown,\n shouldRenderPlaceholder,\n className: classes\n };\n}"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,mBAAmB;AAC5B,SAAS,aAAa,WAAW,
|
|
3
|
+
"sources": ["../../../src/tools-panel/tools-panel-item/hook.ts", "../../../../style-runtime/src/index.ts", "../../../src/tools-panel/style.module.scss"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { usePrevious } from '@wordpress/compose';\nimport { useCallback, useEffect, useLayoutEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from '../style.module.scss';\nimport { useToolsPanelContext } from '../context';\nimport { useContextSystem } from '../../context';\nconst noop = () => {};\nexport function useToolsPanelItem(props) {\n const {\n className,\n hasValue,\n isShownByDefault = false,\n label,\n panelId,\n resetAllFilter = noop,\n onDeselect,\n onSelect,\n ...otherProps\n } = useContextSystem(props, 'ToolsPanelItem');\n const {\n panelId: currentPanelId,\n menuItems,\n registerResetAllFilter,\n deregisterResetAllFilter,\n registerPanelItem,\n deregisterPanelItem,\n flagItemCustomization,\n isResetting,\n shouldRenderPlaceholderItems: shouldRenderPlaceholder,\n firstDisplayedItem,\n lastDisplayedItem,\n __experimentalFirstVisibleItemClass,\n __experimentalLastVisibleItemClass\n } = useToolsPanelContext();\n\n // hasValue is a new function on every render, so do not add it as a\n // dependency to the useCallback hook! If needed, we should use a ref.\n const hasValueCallback = useCallback(hasValue, [panelId]);\n // resetAllFilter is a new function on every render, so do not add it as a\n // dependency to the useCallback hook! If needed, we should use a ref.\n const resetAllFilterCallback = useCallback(resetAllFilter, [panelId]);\n const previousPanelId = usePrevious(currentPanelId);\n const hasMatchingPanel = currentPanelId === panelId || currentPanelId === null;\n\n // Registering the panel item allows the panel to include it in its\n // automatically generated menu and determine its initial checked status.\n //\n // This is performed in a layout effect to ensure that the panel item\n // is registered before it is rendered preventing a rendering glitch.\n // See: https://github.com/WordPress/gutenberg/issues/56470\n useLayoutEffect(() => {\n if (hasMatchingPanel && previousPanelId !== null) {\n registerPanelItem({\n hasValue: hasValueCallback,\n isShownByDefault,\n label,\n panelId\n });\n }\n return () => {\n if (previousPanelId === null && !!currentPanelId || currentPanelId === panelId) {\n deregisterPanelItem(label);\n }\n };\n }, [currentPanelId, hasMatchingPanel, isShownByDefault, label, hasValueCallback, panelId, previousPanelId, registerPanelItem, deregisterPanelItem]);\n useEffect(() => {\n if (hasMatchingPanel) {\n registerResetAllFilter(resetAllFilterCallback);\n }\n return () => {\n if (hasMatchingPanel) {\n deregisterResetAllFilter(resetAllFilterCallback);\n }\n };\n }, [registerResetAllFilter, deregisterResetAllFilter, resetAllFilterCallback, hasMatchingPanel]);\n\n // Note: `label` is used as a key when building menu item state in\n // `ToolsPanel`.\n const menuGroup = isShownByDefault ? 'default' : 'optional';\n const isMenuItemChecked = menuItems?.[menuGroup]?.[label];\n const wasMenuItemChecked = usePrevious(isMenuItemChecked);\n const isRegistered = menuItems?.[menuGroup]?.[label] !== undefined;\n const isValueSet = hasValue();\n // Notify the panel when an item's value has changed except for optional\n // items without value because the item should not cause itself to hide.\n useEffect(() => {\n if (!isShownByDefault && !isValueSet) {\n return;\n }\n flagItemCustomization(isValueSet, label, menuGroup);\n }, [isValueSet, menuGroup, label, flagItemCustomization, isShownByDefault]);\n\n // Determine if the panel item's corresponding menu is being toggled and\n // trigger appropriate callback if it is.\n useEffect(() => {\n // We check whether this item is currently registered as items rendered\n // via fills can persist through the parent panel being remounted.\n // See: https://github.com/WordPress/gutenberg/pull/45673\n if (!isRegistered || isResetting || !hasMatchingPanel) {\n return;\n }\n if (isMenuItemChecked && !isValueSet && !wasMenuItemChecked) {\n onSelect?.();\n }\n if (!isMenuItemChecked && isValueSet && wasMenuItemChecked) {\n onDeselect?.();\n }\n }, [hasMatchingPanel, isMenuItemChecked, isRegistered, isResetting, isValueSet, wasMenuItemChecked, onSelect, onDeselect]);\n\n // The item is shown if it is a default control regardless of whether it\n // has a value. Optional items are shown when they are checked or have\n // a value.\n const isShown = isShownByDefault ? menuItems?.[menuGroup]?.[label] !== undefined : isMenuItemChecked;\n const shouldApplyPlaceholderStyles = shouldRenderPlaceholder && !isShown;\n const classes = clsx(styles['tools-panel-item'], shouldApplyPlaceholderStyles && styles['tools-panel-item-placeholder'], !shouldApplyPlaceholderStyles && className, firstDisplayedItem === label && __experimentalFirstVisibleItemClass, lastDisplayedItem === label && __experimentalLastVisibleItemClass);\n return {\n ...otherProps,\n isShown,\n shouldRenderPlaceholder,\n className: classes\n };\n}", "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(\"29b739f451\", \"._62d714739f4dc308__tools-panel{border-top:1px solid #ddd;margin-top:-1px;padding:16px}._40db7f4f897b683d__tools-panel-with-inner-wrapper>div:not(:first-of-type){column-gap:16px;display:grid;grid-column:1/-1;grid-template-columns:repeat(2,minmax(0,1fr));row-gap:16px}._95a15674966f30a3__tools-panel-hidden-inner-wrapper>div:not(:first-of-type){display:none}._322a049b9b7d8674__tools-panel-header{gap:8px;grid-column:1/-1}._322a049b9b7d8674__tools-panel-header .components-dropdown-menu{line-height:0;margin:-4px 0}._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header .components-dropdown-menu__toggle{min-width:24px;padding:0}.b92a382d3b30104d__tools-panel-heading.b92a382d3b30104d__tools-panel-heading{font-size:inherit;line-height:normal;margin:0}._8005d68fffa9db91__tools-panel-item{grid-column:1/-1}._8005d68fffa9db91__tools-panel-item>div,._8005d68fffa9db91__tools-panel-item>fieldset{margin-bottom:0;max-width:100%;padding-bottom:0}._8005d68fffa9db91__tools-panel-item .components-base-control__help,._8005d68fffa9db91__tools-panel-item._8005d68fffa9db91__tools-panel-item .components-base-control,._8005d68fffa9db91__tools-panel-item._8005d68fffa9db91__tools-panel-item .components-base-control .components-base-control__field:last-child{margin-bottom:0}._4f55e1a6e373746e__tools-panel-item-placeholder{display:none}.d40032517bff9e12__dropdown-menu{min-width:200px}.f135b96aa96ca6bb__reset-label{color:var(--wp-components-color-accent-darker-10,var(--wp-admin-theme-color-darker-10,#2145e6));font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:1.4;margin-inline-start:12px;text-transform:uppercase}._69b138dfa5570d9c__default-controls-item{color:#1e1e1e}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true]{color:#757575;opacity:1}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true]:hover{color:#757575}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true] .f135b96aa96ca6bb__reset-label{opacity:.3}\");\n}\nexport default {\"tools-panel\":\"_62d714739f4dc308__tools-panel\",\"tools-panel-with-inner-wrapper\":\"_40db7f4f897b683d__tools-panel-with-inner-wrapper\",\"tools-panel-hidden-inner-wrapper\":\"_95a15674966f30a3__tools-panel-hidden-inner-wrapper\",\"tools-panel-header\":\"_322a049b9b7d8674__tools-panel-header\",\"tools-panel-heading\":\"b92a382d3b30104d__tools-panel-heading\",\"tools-panel-item\":\"_8005d68fffa9db91__tools-panel-item\",\"tools-panel-item-placeholder\":\"_4f55e1a6e373746e__tools-panel-item-placeholder\",\"dropdown-menu\":\"d40032517bff9e12__dropdown-menu\",\"reset-label\":\"f135b96aa96ca6bb__reset-label\",\"default-controls-item\":\"_69b138dfa5570d9c__default-controls-item\"};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/unit-control/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\n\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef, useMemo, useRef, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\n\nimport { ValueInput } from './styles/unit-control-styles';\nimport UnitSelectControl from './unit-select-control';\nimport { CSS_UNITS, getParsedQuantityAndUnit, getUnitsWithCurrentUnit, getValidParsedQuantityAndUnit } from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport { escapeRegExp } from '../utils/strings';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction UnforwardedUnitControl(unitControlProps, forwardedRef) {\n const {\n __unstableStateReducer,\n autoComplete = 'off',\n // @ts-expect-error Ensure that children is omitted from restProps\n children,\n className,\n disabled = false,\n disableUnits = false,\n isPressEnterToChange = false,\n isResetValueOnUnitChange = false,\n isUnitSelectTabbable = true,\n label,\n onChange: onChangeProp,\n onUnitChange,\n size = 'default',\n unit: unitProp,\n units: unitsProp = CSS_UNITS,\n value: valueProp,\n onFocus: onFocusProp,\n ...props\n } = unitControlProps;\n if ('unit' in unitControlProps) {\n deprecated('UnitControl unit prop', {\n since: '5.6',\n hint: 'The unit should be provided within the `value` prop.',\n version: '6.2'\n });\n }\n\n // The `value` prop, in theory, should not be `null`, but the following line\n // ensures it fallback to `undefined` in case a consumer of `UnitControl`\n // still passes `null` as a `value`.\n const nonNullValueProp = valueProp ?? undefined;\n const [units, reFirstCharacterOfUnits] = useMemo(() => {\n const list = getUnitsWithCurrentUnit(nonNullValueProp, unitProp, unitsProp);\n const [{\n value: firstUnitValue = ''\n } = {}, ...rest] = list;\n const firstCharacters = rest.reduce((carry, {\n value\n }) => {\n const first = escapeRegExp(value?.substring(0, 1) || '');\n return carry.includes(first) ? carry : `${carry}|${first}`;\n }, escapeRegExp(firstUnitValue.substring(0, 1)));\n return [list, new RegExp(`^(?:${firstCharacters})$`, 'i')];\n }, [nonNullValueProp, unitProp, unitsProp]);\n const [parsedQuantity, parsedUnit] = getParsedQuantityAndUnit(nonNullValueProp, unitProp, units);\n const [unit, setUnit] = useControlledState(units.length === 1 ? units[0].value : unitProp, {\n initial: parsedUnit,\n fallback: ''\n });\n useEffect(() => {\n if (parsedUnit !== undefined) {\n setUnit(parsedUnit);\n }\n }, [parsedUnit, setUnit]);\n const classes = clsx('components-unit-control',\n // This class is added for legacy purposes to maintain it on the outer\n // wrapper. See: https://github.com/WordPress/gutenberg/pull/45139\n 'components-unit-control-wrapper', className);\n const handleOnQuantityChange = (nextQuantityValue, changeProps) => {\n if (nextQuantityValue === '' || typeof nextQuantityValue === 'undefined' || nextQuantityValue === null) {\n onChangeProp?.('', changeProps);\n return;\n }\n\n /*\n * Customizing the onChange callback.\n * This allows as to broadcast a combined value+unit to onChange.\n */\n const onChangeValue = getValidParsedQuantityAndUnit(nextQuantityValue, units, parsedQuantity, unit).join('');\n onChangeProp?.(onChangeValue, changeProps);\n };\n const handleOnUnitChange = (nextUnitValue, changeProps) => {\n const {\n data\n } = changeProps;\n let nextValue = `${parsedQuantity ?? ''}${nextUnitValue}`;\n if (isResetValueOnUnitChange && data?.default !== undefined) {\n nextValue = `${data.default}${nextUnitValue}`;\n }\n onChangeProp?.(nextValue, changeProps);\n onUnitChange?.(nextUnitValue, changeProps);\n setUnit(nextUnitValue);\n };\n let handleOnKeyDown;\n if (!disableUnits && isUnitSelectTabbable && units.length) {\n handleOnKeyDown = event => {\n props.onKeyDown?.(event);\n // Unless the meta or ctrl key was pressed (to avoid interfering with\n // shortcuts, e.g. pastes), move focus to the unit select if a key\n // matches the first character of a unit.\n if (!event.metaKey && !event.ctrlKey && reFirstCharacterOfUnits.test(event.key)) {\n refInputSuffix.current?.focus();\n }\n };\n }\n const refInputSuffix = useRef(null);\n const inputSuffix = !disableUnits ? /*#__PURE__*/_jsx(UnitSelectControl, {\n ref: refInputSuffix,\n \"aria-label\": __('Select unit'),\n disabled: disabled,\n isUnitSelectTabbable: isUnitSelectTabbable,\n onChange: handleOnUnitChange,\n size: ['small', 'compact'].includes(size) ? 'small' : 'default',\n unit: unit,\n units: units,\n onFocus: onFocusProp,\n onBlur: unitControlProps.onBlur\n }) : null;\n let step = props.step;\n\n /*\n * If no step prop has been passed, lookup the active unit and\n * try to get step from `units`, or default to a value of `1`\n */\n if (!step && units) {\n const activeUnit = units.find(option => option.value === unit);\n step = activeUnit?.step ?? 1;\n }\n return /*#__PURE__*/_jsx(ValueInput, {\n ...props,\n
|
|
5
|
-
"mappings": ";AAIA,OAAO,UAAU;AAKjB,OAAO,gBAAgB;AACvB,SAAS,YAAY,SAAS,QAAQ,iBAAiB;AACvD,SAAS,UAAU;AAMnB,SAAS,kBAAkB;AAC3B,OAAO,uBAAuB;AAC9B,SAAS,WAAW,0BAA0B,yBAAyB,qCAAqC;AAC5G,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAC7B,SAAS,OAAO,YAAY;
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\n\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef, useMemo, useRef, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\n\nimport { ValueInput } from './styles/unit-control-styles';\nimport UnitSelectControl from './unit-select-control';\nimport { CSS_UNITS, getParsedQuantityAndUnit, getUnitsWithCurrentUnit, getValidParsedQuantityAndUnit } from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport { escapeRegExp } from '../utils/strings';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction UnforwardedUnitControl(unitControlProps, forwardedRef) {\n const {\n __unstableStateReducer,\n autoComplete = 'off',\n // @ts-expect-error Ensure that children is omitted from restProps\n children,\n className,\n disabled = false,\n disableUnits = false,\n isPressEnterToChange = false,\n isResetValueOnUnitChange = false,\n isUnitSelectTabbable = true,\n label,\n onChange: onChangeProp,\n onUnitChange,\n size = 'default',\n unit: unitProp,\n units: unitsProp = CSS_UNITS,\n value: valueProp,\n onFocus: onFocusProp,\n ...props\n } = unitControlProps;\n if ('unit' in unitControlProps) {\n deprecated('UnitControl unit prop', {\n since: '5.6',\n hint: 'The unit should be provided within the `value` prop.',\n version: '6.2'\n });\n }\n\n // The `value` prop, in theory, should not be `null`, but the following line\n // ensures it fallback to `undefined` in case a consumer of `UnitControl`\n // still passes `null` as a `value`.\n const nonNullValueProp = valueProp ?? undefined;\n const [units, reFirstCharacterOfUnits] = useMemo(() => {\n const list = getUnitsWithCurrentUnit(nonNullValueProp, unitProp, unitsProp);\n const [{\n value: firstUnitValue = ''\n } = {}, ...rest] = list;\n const firstCharacters = rest.reduce((carry, {\n value\n }) => {\n const first = escapeRegExp(value?.substring(0, 1) || '');\n return carry.includes(first) ? carry : `${carry}|${first}`;\n }, escapeRegExp(firstUnitValue.substring(0, 1)));\n return [list, new RegExp(`^(?:${firstCharacters})$`, 'i')];\n }, [nonNullValueProp, unitProp, unitsProp]);\n const [parsedQuantity, parsedUnit] = getParsedQuantityAndUnit(nonNullValueProp, unitProp, units);\n const [unit, setUnit] = useControlledState(units.length === 1 ? units[0].value : unitProp, {\n initial: parsedUnit,\n fallback: ''\n });\n useEffect(() => {\n if (parsedUnit !== undefined) {\n setUnit(parsedUnit);\n }\n }, [parsedUnit, setUnit]);\n const classes = clsx('components-unit-control',\n // This class is added for legacy purposes to maintain it on the outer\n // wrapper. See: https://github.com/WordPress/gutenberg/pull/45139\n 'components-unit-control-wrapper', className);\n const handleOnQuantityChange = (nextQuantityValue, changeProps) => {\n if (nextQuantityValue === '' || typeof nextQuantityValue === 'undefined' || nextQuantityValue === null) {\n onChangeProp?.('', changeProps);\n return;\n }\n\n /*\n * Customizing the onChange callback.\n * This allows as to broadcast a combined value+unit to onChange.\n */\n const onChangeValue = getValidParsedQuantityAndUnit(nextQuantityValue, units, parsedQuantity, unit).join('');\n onChangeProp?.(onChangeValue, changeProps);\n };\n const handleOnUnitChange = (nextUnitValue, changeProps) => {\n const {\n data\n } = changeProps;\n let nextValue = `${parsedQuantity ?? ''}${nextUnitValue}`;\n if (isResetValueOnUnitChange && data?.default !== undefined) {\n nextValue = `${data.default}${nextUnitValue}`;\n }\n onChangeProp?.(nextValue, changeProps);\n onUnitChange?.(nextUnitValue, changeProps);\n setUnit(nextUnitValue);\n };\n let handleOnKeyDown;\n if (!disableUnits && isUnitSelectTabbable && units.length) {\n handleOnKeyDown = event => {\n props.onKeyDown?.(event);\n // Unless the meta or ctrl key was pressed (to avoid interfering with\n // shortcuts, e.g. pastes), move focus to the unit select if a key\n // matches the first character of a unit.\n if (!event.metaKey && !event.ctrlKey && reFirstCharacterOfUnits.test(event.key)) {\n refInputSuffix.current?.focus();\n }\n };\n }\n const refInputSuffix = useRef(null);\n const inputSuffix = !disableUnits ? /*#__PURE__*/_jsx(UnitSelectControl, {\n ref: refInputSuffix,\n \"aria-label\": __('Select unit'),\n disabled: disabled,\n isUnitSelectTabbable: isUnitSelectTabbable,\n onChange: handleOnUnitChange,\n size: ['small', 'compact'].includes(size) ? 'small' : 'default',\n unit: unit,\n units: units,\n onFocus: onFocusProp,\n onBlur: unitControlProps.onBlur\n }) : null;\n let step = props.step;\n\n /*\n * If no step prop has been passed, lookup the active unit and\n * try to get step from `units`, or default to a value of `1`\n */\n if (!step && units) {\n const activeUnit = units.find(option => option.value === unit);\n step = activeUnit?.step ?? 1;\n }\n return /*#__PURE__*/_jsx(ValueInput, {\n ...props,\n autoComplete: autoComplete,\n className: classes,\n disabled: disabled,\n spinControls: \"none\",\n isPressEnterToChange: isPressEnterToChange,\n label: label,\n onKeyDown: handleOnKeyDown,\n onChange: handleOnQuantityChange,\n ref: forwardedRef,\n size: size,\n suffix: inputSuffix,\n type: isPressEnterToChange ? 'text' : 'number',\n value: parsedQuantity ?? '',\n step: step,\n onFocus: onFocusProp,\n __unstableStateReducer: __unstableStateReducer\n });\n}\n\n/**\n * `UnitControl` allows the user to set a numeric quantity as well as a unit (e.g. `px`).\n *\n *\n * ```jsx\n * import { __experimentalUnitControl as UnitControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '10px' );\n *\n * return <UnitControl onChange={ setValue } value={ value } />;\n * };\n * ```\n */\nexport const UnitControl = forwardRef(UnforwardedUnitControl);\nUnitControl.displayName = 'UnitControl';\nexport { parseQuantityAndUnitFromRawValue, useCustomUnits } from './utils';\nexport default UnitControl;"],
|
|
5
|
+
"mappings": ";AAIA,OAAO,UAAU;AAKjB,OAAO,gBAAgB;AACvB,SAAS,YAAY,SAAS,QAAQ,iBAAiB;AACvD,SAAS,UAAU;AAMnB,SAAS,kBAAkB;AAC3B,OAAO,uBAAuB;AAC9B,SAAS,WAAW,0BAA0B,yBAAyB,qCAAqC;AAC5G,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAC7B,SAAS,OAAO,YAAY;AAgK5B,SAAS,kCAAkC,sBAAsB;AA/JjE,SAAS,uBAAuB,kBAAkB,cAAc;AAC9D,QAAM;AAAA,IACJ;AAAA,IACA,eAAe;AAAA;AAAA,IAEf;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,2BAA2B;AAAA,IAC3B,uBAAuB;AAAA,IACvB;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO,YAAY;AAAA,IACnB,OAAO;AAAA,IACP,SAAS;AAAA,IACT,GAAG;AAAA,EACL,IAAI;AACJ,MAAI,UAAU,kBAAkB;AAC9B,eAAW,yBAAyB;AAAA,MAClC,OAAO;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,IACX,CAAC;AAAA,EACH;AAKA,QAAM,mBAAmB,aAAa;AACtC,QAAM,CAAC,OAAO,uBAAuB,IAAI,QAAQ,MAAM;AACrD,UAAM,OAAO,wBAAwB,kBAAkB,UAAU,SAAS;AAC1E,UAAM,CAAC;AAAA,MACL,OAAO,iBAAiB;AAAA,IAC1B,IAAI,CAAC,GAAG,GAAG,IAAI,IAAI;AACnB,UAAM,kBAAkB,KAAK,OAAO,CAAC,OAAO;AAAA,MAC1C;AAAA,IACF,MAAM;AACJ,YAAM,QAAQ,aAAa,OAAO,UAAU,GAAG,CAAC,KAAK,EAAE;AACvD,aAAO,MAAM,SAAS,KAAK,IAAI,QAAQ,GAAG,KAAK,IAAI,KAAK;AAAA,IAC1D,GAAG,aAAa,eAAe,UAAU,GAAG,CAAC,CAAC,CAAC;AAC/C,WAAO,CAAC,MAAM,IAAI,OAAO,OAAO,eAAe,MAAM,GAAG,CAAC;AAAA,EAC3D,GAAG,CAAC,kBAAkB,UAAU,SAAS,CAAC;AAC1C,QAAM,CAAC,gBAAgB,UAAU,IAAI,yBAAyB,kBAAkB,UAAU,KAAK;AAC/F,QAAM,CAAC,MAAM,OAAO,IAAI,mBAAmB,MAAM,WAAW,IAAI,MAAM,CAAC,EAAE,QAAQ,UAAU;AAAA,IACzF,SAAS;AAAA,IACT,UAAU;AAAA,EACZ,CAAC;AACD,YAAU,MAAM;AACd,QAAI,eAAe,QAAW;AAC5B,cAAQ,UAAU;AAAA,IACpB;AAAA,EACF,GAAG,CAAC,YAAY,OAAO,CAAC;AACxB,QAAM,UAAU;AAAA,IAAK;AAAA;AAAA;AAAA,IAGrB;AAAA,IAAmC;AAAA,EAAS;AAC5C,QAAM,yBAAyB,CAAC,mBAAmB,gBAAgB;AACjE,QAAI,sBAAsB,MAAM,OAAO,sBAAsB,eAAe,sBAAsB,MAAM;AACtG,qBAAe,IAAI,WAAW;AAC9B;AAAA,IACF;AAMA,UAAM,gBAAgB,8BAA8B,mBAAmB,OAAO,gBAAgB,IAAI,EAAE,KAAK,EAAE;AAC3G,mBAAe,eAAe,WAAW;AAAA,EAC3C;AACA,QAAM,qBAAqB,CAAC,eAAe,gBAAgB;AACzD,UAAM;AAAA,MACJ;AAAA,IACF,IAAI;AACJ,QAAI,YAAY,GAAG,kBAAkB,EAAE,GAAG,aAAa;AACvD,QAAI,4BAA4B,MAAM,YAAY,QAAW;AAC3D,kBAAY,GAAG,KAAK,OAAO,GAAG,aAAa;AAAA,IAC7C;AACA,mBAAe,WAAW,WAAW;AACrC,mBAAe,eAAe,WAAW;AACzC,YAAQ,aAAa;AAAA,EACvB;AACA,MAAI;AACJ,MAAI,CAAC,gBAAgB,wBAAwB,MAAM,QAAQ;AACzD,sBAAkB,WAAS;AACzB,YAAM,YAAY,KAAK;AAIvB,UAAI,CAAC,MAAM,WAAW,CAAC,MAAM,WAAW,wBAAwB,KAAK,MAAM,GAAG,GAAG;AAC/E,uBAAe,SAAS,MAAM;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AACA,QAAM,iBAAiB,OAAO,IAAI;AAClC,QAAM,cAAc,CAAC,eAA4B,qBAAK,mBAAmB;AAAA,IACvE,KAAK;AAAA,IACL,cAAc,GAAG,aAAa;AAAA,IAC9B;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV,MAAM,CAAC,SAAS,SAAS,EAAE,SAAS,IAAI,IAAI,UAAU;AAAA,IACtD;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,QAAQ,iBAAiB;AAAA,EAC3B,CAAC,IAAI;AACL,MAAI,OAAO,MAAM;AAMjB,MAAI,CAAC,QAAQ,OAAO;AAClB,UAAM,aAAa,MAAM,KAAK,YAAU,OAAO,UAAU,IAAI;AAC7D,WAAO,YAAY,QAAQ;AAAA,EAC7B;AACA,SAAoB,qBAAK,YAAY;AAAA,IACnC,GAAG;AAAA,IACH;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,UAAU;AAAA,IACV,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,IACR,MAAM,uBAAuB,SAAS;AAAA,IACtC,OAAO,kBAAkB;AAAA,IACzB;AAAA,IACA,SAAS;AAAA,IACT;AAAA,EACF,CAAC;AACH;AAiBO,IAAM,cAAc,WAAW,sBAAsB;AAC5D,YAAY,cAAc;AAE1B,IAAO,uBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// packages/components/src/utils/base-label.ts
|
|
2
2
|
import { css } from "@emotion/react";
|
|
3
3
|
import CONFIG from "./config-values.mjs";
|
|
4
|
-
var baseLabelTypography = /* @__PURE__ */ css("font-size:11px;font-weight:", CONFIG.
|
|
4
|
+
var baseLabelTypography = /* @__PURE__ */ css("font-size:11px;font-weight:", CONFIG.fontWeightEmphasis, ";line-height:1.4;text-transform:uppercase;" + (process.env.NODE_ENV === "production" ? "" : ";label:baseLabelTypography;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2UtbGFiZWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBWXNDIiwiZmlsZSI6ImJhc2UtbGFiZWwudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBDT05GSUcgZnJvbSAnLi9jb25maWctdmFsdWVzLmpzJztcblxuLy8gVGhpcyBpcyBhIHZlcnkgbG93LWxldmVsIG1peGluIHdoaWNoIHlvdSBzaG91bGRuJ3QgaGF2ZSB0byB1c2UgZGlyZWN0bHkuXG4vLyBUcnkgdG8gdXNlIEJhc2VDb250cm9sJ3MgU3R5bGVkTGFiZWwgb3IgQmFzZUNvbnRyb2wuVmlzdWFsTGFiZWwgaWYgeW91IGNhbi5cbmV4cG9ydCBjb25zdCBiYXNlTGFiZWxUeXBvZ3JhcGh5ID0gY3NzYFxuXHRmb250LXNpemU6IDExcHg7XG5cdGZvbnQtd2VpZ2h0OiAkeyBDT05GSUcuZm9udFdlaWdodEVtcGhhc2lzIH07XG5cdGxpbmUtaGVpZ2h0OiAxLjQ7XG5cdHRleHQtdHJhbnNmb3JtOiB1cHBlcmNhc2U7XG5gO1xuIl19 */");
|
|
5
5
|
export {
|
|
6
6
|
baseLabelTypography
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/base-label.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport CONFIG from './config-values.js';\n\n// This is a very low-level mixin which you shouldn't have to use directly.\n// Try to use BaseControl's StyledLabel or BaseControl.VisualLabel if you can.\nexport const baseLabelTypography = /*#__PURE__*/css(\"font-size:11px;font-weight:\", CONFIG.
|
|
5
|
-
"mappings": ";AAGA,SAAS,WAAW;AAKpB,OAAO,YAAY;AAIZ,IAAM,sBAAmC,oBAAI,+BAA+B,OAAO,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport CONFIG from './config-values.js';\n\n// This is a very low-level mixin which you shouldn't have to use directly.\n// Try to use BaseControl's StyledLabel or BaseControl.VisualLabel if you can.\nexport const baseLabelTypography = /*#__PURE__*/css(\"font-size:11px;font-weight:\", CONFIG.fontWeightEmphasis, \";line-height:1.4;text-transform:uppercase;\" + (process.env.NODE_ENV === \"production\" ? \"\" : \";label:baseLabelTypography;\"), process.env.NODE_ENV === \"production\" ? \"\" : \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2UtbGFiZWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBWXNDIiwiZmlsZSI6ImJhc2UtbGFiZWwudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBDT05GSUcgZnJvbSAnLi9jb25maWctdmFsdWVzLmpzJztcblxuLy8gVGhpcyBpcyBhIHZlcnkgbG93LWxldmVsIG1peGluIHdoaWNoIHlvdSBzaG91bGRuJ3QgaGF2ZSB0byB1c2UgZGlyZWN0bHkuXG4vLyBUcnkgdG8gdXNlIEJhc2VDb250cm9sJ3MgU3R5bGVkTGFiZWwgb3IgQmFzZUNvbnRyb2wuVmlzdWFsTGFiZWwgaWYgeW91IGNhbi5cbmV4cG9ydCBjb25zdCBiYXNlTGFiZWxUeXBvZ3JhcGh5ID0gY3NzYFxuXHRmb250LXNpemU6IDExcHg7XG5cdGZvbnQtd2VpZ2h0OiAkeyBDT05GSUcuZm9udFdlaWdodEVtcGhhc2lzIH07XG5cdGxpbmUtaGVpZ2h0OiAxLjQ7XG5cdHRleHQtdHJhbnNmb3JtOiB1cHBlcmNhc2U7XG5gO1xuIl19 */\");"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,WAAW;AAKpB,OAAO,YAAY;AAIZ,IAAM,sBAAmC,oBAAI,+BAA+B,OAAO,oBAAoB,gDAAgD,QAAQ,IAAI,aAAa,eAAe,KAAK,gCAAgC,QAAQ,IAAI,aAAa,eAAe,KAAK,61BAA61B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -43,9 +43,7 @@ var config_values_default = Object.assign({}, CONTROL_PROPS, {
|
|
|
43
43
|
fontSizeXSmall: "calc(0.75 * 13px)",
|
|
44
44
|
fontLineHeightBase: "1.4",
|
|
45
45
|
fontWeight: "normal",
|
|
46
|
-
|
|
47
|
-
// ensures fallback to 400 (instead of 600)
|
|
48
|
-
fontWeightHeading: "600",
|
|
46
|
+
fontWeightEmphasis: "600",
|
|
49
47
|
gridBase: "4px",
|
|
50
48
|
elevationXSmall: `0 1px 1px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02), 0 3px 3px rgba(0, 0, 0, 0.02), 0 4px 4px rgba(0, 0, 0, 0.01)`,
|
|
51
49
|
elevationSmall: `0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02)`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/config-values.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport { COLORS } from './colors-values';\nconst CONTROL_HEIGHT = '36px';\nconst CONTROL_PROPS = {\n // These values should be shared with TextControl.\n controlPaddingX: 12,\n controlPaddingXSmall: 8,\n controlPaddingXLarge: 12 * 1.3334,\n // TODO: Deprecate\n\n controlBoxShadowFocus: `0 0 0 0.5px ${COLORS.theme.accent}`,\n controlHeight: CONTROL_HEIGHT,\n controlHeightXSmall: `calc( ${CONTROL_HEIGHT} * 0.6 )`,\n controlHeightSmall: `calc( ${CONTROL_HEIGHT} * 0.8 )`,\n controlHeightLarge: `calc( ${CONTROL_HEIGHT} * 1.2 )`,\n controlHeightXLarge: `calc( ${CONTROL_HEIGHT} * 1.4 )`\n};\n\n// Using Object.assign to avoid creating circular references when emitting\n// TypeScript type declarations.\nexport default Object.assign({}, CONTROL_PROPS, {\n colorDivider: 'rgba(0, 0, 0, 0.1)',\n colorScrollbarThumb: 'rgba(0, 0, 0, 0.2)',\n colorScrollbarThumbHover: 'rgba(0, 0, 0, 0.5)',\n colorScrollbarTrack: 'rgba(0, 0, 0, 0.04)',\n elevationIntensity: 1,\n radiusXSmall: '1px',\n radiusSmall: '2px',\n radiusMedium: '4px',\n radiusLarge: '8px',\n radiusFull: '9999px',\n radiusRound: '50%',\n borderWidth: '1px',\n borderWidthFocus: '1.5px',\n borderWidthTab: '4px',\n spinnerSize: 16,\n fontSize: '13px',\n fontSizeH1: 'calc(2.44 * 13px)',\n fontSizeH2: 'calc(1.95 * 13px)',\n fontSizeH3: 'calc(1.56 * 13px)',\n fontSizeH4: 'calc(1.25 * 13px)',\n fontSizeH5: '13px',\n fontSizeH6: 'calc(0.8 * 13px)',\n fontSizeInputMobile: '16px',\n fontSizeMobile: '15px',\n fontSizeSmall: 'calc(0.92 * 13px)',\n fontSizeXSmall: 'calc(0.75 * 13px)',\n fontLineHeightBase: '1.4',\n fontWeight: 'normal',\n
|
|
5
|
-
"mappings": ";AAGA,SAAS,cAAc;AACvB,IAAM,iBAAiB;AACvB,IAAM,gBAAgB;AAAA;AAAA,EAEpB,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,sBAAsB,KAAK;AAAA;AAAA,EAG3B,uBAAuB,eAAe,OAAO,MAAM,MAAM;AAAA,EACzD,eAAe;AAAA,EACf,qBAAqB,SAAS,cAAc;AAAA,EAC5C,oBAAoB,SAAS,cAAc;AAAA,EAC3C,oBAAoB,SAAS,cAAc;AAAA,EAC3C,qBAAqB,SAAS,cAAc;AAC9C;AAIA,IAAO,wBAAQ,OAAO,OAAO,CAAC,GAAG,eAAe;AAAA,EAC9C,cAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,0BAA0B;AAAA,EAC1B,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,cAAc;AAAA,EACd,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,qBAAqB;AAAA,EACrB,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,YAAY;AAAA,EACZ,
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport { COLORS } from './colors-values';\nconst CONTROL_HEIGHT = '36px';\nconst CONTROL_PROPS = {\n // These values should be shared with TextControl.\n controlPaddingX: 12,\n controlPaddingXSmall: 8,\n controlPaddingXLarge: 12 * 1.3334,\n // TODO: Deprecate\n\n controlBoxShadowFocus: `0 0 0 0.5px ${COLORS.theme.accent}`,\n controlHeight: CONTROL_HEIGHT,\n controlHeightXSmall: `calc( ${CONTROL_HEIGHT} * 0.6 )`,\n controlHeightSmall: `calc( ${CONTROL_HEIGHT} * 0.8 )`,\n controlHeightLarge: `calc( ${CONTROL_HEIGHT} * 1.2 )`,\n controlHeightXLarge: `calc( ${CONTROL_HEIGHT} * 1.4 )`\n};\n\n// Using Object.assign to avoid creating circular references when emitting\n// TypeScript type declarations.\nexport default Object.assign({}, CONTROL_PROPS, {\n colorDivider: 'rgba(0, 0, 0, 0.1)',\n colorScrollbarThumb: 'rgba(0, 0, 0, 0.2)',\n colorScrollbarThumbHover: 'rgba(0, 0, 0, 0.5)',\n colorScrollbarTrack: 'rgba(0, 0, 0, 0.04)',\n elevationIntensity: 1,\n radiusXSmall: '1px',\n radiusSmall: '2px',\n radiusMedium: '4px',\n radiusLarge: '8px',\n radiusFull: '9999px',\n radiusRound: '50%',\n borderWidth: '1px',\n borderWidthFocus: '1.5px',\n borderWidthTab: '4px',\n spinnerSize: 16,\n fontSize: '13px',\n fontSizeH1: 'calc(2.44 * 13px)',\n fontSizeH2: 'calc(1.95 * 13px)',\n fontSizeH3: 'calc(1.56 * 13px)',\n fontSizeH4: 'calc(1.25 * 13px)',\n fontSizeH5: '13px',\n fontSizeH6: 'calc(0.8 * 13px)',\n fontSizeInputMobile: '16px',\n fontSizeMobile: '15px',\n fontSizeSmall: 'calc(0.92 * 13px)',\n fontSizeXSmall: 'calc(0.75 * 13px)',\n fontLineHeightBase: '1.4',\n fontWeight: 'normal',\n fontWeightEmphasis: '600',\n gridBase: '4px',\n elevationXSmall: `0 1px 1px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02), 0 3px 3px rgba(0, 0, 0, 0.02), 0 4px 4px rgba(0, 0, 0, 0.01)`,\n elevationSmall: `0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02)`,\n elevationMedium: `0 2px 3px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.04), 0 12px 12px rgba(0, 0, 0, 0.03), 0 16px 16px rgba(0, 0, 0, 0.02)`,\n elevationLarge: `0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02)`,\n surfaceBorderColor: 'rgba(0, 0, 0, 0.1)',\n surfaceColor: COLORS.white,\n // Modal exit animation: `use-modal-exit-animation` parses this for the\n // `animationend` timeout race; keep the numeric duration equal to the WPDS\n // `motion-duration-md` token on `.components-modal__frame` in modal/style.scss.\n transitionDuration: '200ms',\n transitionDurationFast: '160ms',\n transitionDurationFaster: '120ms',\n transitionDurationFastest: '100ms',\n transitionTimingFunction: 'cubic-bezier(0.08, 0.52, 0.52, 1)',\n transitionTimingFunctionControl: 'cubic-bezier(0.12, 0.8, 0.32, 1)'\n});"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,cAAc;AACvB,IAAM,iBAAiB;AACvB,IAAM,gBAAgB;AAAA;AAAA,EAEpB,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,sBAAsB,KAAK;AAAA;AAAA,EAG3B,uBAAuB,eAAe,OAAO,MAAM,MAAM;AAAA,EACzD,eAAe;AAAA,EACf,qBAAqB,SAAS,cAAc;AAAA,EAC5C,oBAAoB,SAAS,cAAc;AAAA,EAC3C,oBAAoB,SAAS,cAAc;AAAA,EAC3C,qBAAqB,SAAS,cAAc;AAC9C;AAIA,IAAO,wBAAQ,OAAO,OAAO,CAAC,GAAG,eAAe;AAAA,EAC9C,cAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,0BAA0B;AAAA,EAC1B,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,cAAc;AAAA,EACd,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,qBAAqB;AAAA,EACrB,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,cAAc,OAAO;AAAA;AAAA;AAAA;AAAA,EAIrB,oBAAoB;AAAA,EACpB,wBAAwB;AAAA,EACxB,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,0BAA0B;AAAA,EAC1B,iCAAiC;AACnC,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// packages/components/src/utils/font-values.js
|
|
2
2
|
var font_values_default = {
|
|
3
|
-
"default.fontFamily": "-apple-system,
|
|
3
|
+
"default.fontFamily": "-apple-system, system-ui, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif",
|
|
4
4
|
"default.fontSize": "13px",
|
|
5
5
|
"helpText.fontSize": "12px",
|
|
6
6
|
mobileTextMinFontSize: "16px"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/font-values.js"],
|
|
4
|
-
"sourcesContent": ["export default {\n 'default.fontFamily': \"-apple-system,
|
|
4
|
+
"sourcesContent": ["export default {\n 'default.fontFamily': \"-apple-system, system-ui, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif\",\n 'default.fontSize': '13px',\n 'helpText.fontSize': '12px',\n mobileTextMinFontSize: '16px'\n};"],
|
|
5
5
|
"mappings": ";AAAA,IAAO,sBAAQ;AAAA,EACb,sBAAsB;AAAA,EACtB,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,uBAAuB;AACzB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// packages/components/src/validated-form-controls/components/content-editable-control.tsx
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { forwardRef, useRef } from "@wordpress/element";
|
|
4
|
+
import { ControlWithError } from "../control-with-error.mjs";
|
|
5
|
+
import ContentEditableControl from "../../content-editable-control/index.mjs";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
var UnforwardedValidatedContentEditableControl = ({
|
|
8
|
+
required,
|
|
9
|
+
customValidity,
|
|
10
|
+
markWhenOptional,
|
|
11
|
+
value,
|
|
12
|
+
className,
|
|
13
|
+
...restProps
|
|
14
|
+
}, forwardedRef) => {
|
|
15
|
+
const validityTargetRef = useRef(null);
|
|
16
|
+
return /* @__PURE__ */ _jsxs("div", {
|
|
17
|
+
className: "components-validated-control__wrapper-with-error-delegate",
|
|
18
|
+
children: [/* @__PURE__ */ _jsx(ControlWithError, {
|
|
19
|
+
required,
|
|
20
|
+
markWhenOptional,
|
|
21
|
+
customValidity,
|
|
22
|
+
getValidityTarget: () => validityTargetRef.current,
|
|
23
|
+
children: /* @__PURE__ */ _jsx(ContentEditableControl, {
|
|
24
|
+
ref: forwardedRef,
|
|
25
|
+
className: clsx("components-validated-control__content-editable", className),
|
|
26
|
+
"aria-invalid": customValidity?.type === "invalid" || void 0,
|
|
27
|
+
...restProps
|
|
28
|
+
})
|
|
29
|
+
}), /* @__PURE__ */ _jsx("input", {
|
|
30
|
+
className: "components-validated-control__error-delegate",
|
|
31
|
+
type: "text",
|
|
32
|
+
ref: validityTargetRef,
|
|
33
|
+
required,
|
|
34
|
+
value: value?.trim() ?? "",
|
|
35
|
+
tabIndex: -1,
|
|
36
|
+
onChange: () => {
|
|
37
|
+
},
|
|
38
|
+
onFocus: (e) => {
|
|
39
|
+
e.target.previousElementSibling?.querySelector('[role="textbox"]')?.focus();
|
|
40
|
+
}
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var ValidatedContentEditableControl = forwardRef(UnforwardedValidatedContentEditableControl);
|
|
45
|
+
ValidatedContentEditableControl.displayName = "ValidatedContentEditableControl";
|
|
46
|
+
export {
|
|
47
|
+
ValidatedContentEditableControl
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=content-editable-control.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/validated-form-controls/components/content-editable-control.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport ContentEditableControl from '../../content-editable-control';\n\n/**\n * A `contentEditable` field does not participate in the Constraint Validation\n * API, so — like `ValidatedToggleGroupControl` — the validity state lives on a\n * visually hidden delegate input that mirrors whether the field has content.\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst UnforwardedValidatedContentEditableControl = ({\n required,\n customValidity,\n markWhenOptional,\n value,\n className,\n ...restProps\n}, forwardedRef) => {\n const validityTargetRef = useRef(null);\n return /*#__PURE__*/_jsxs(\"div\", {\n className: \"components-validated-control__wrapper-with-error-delegate\",\n children: [/*#__PURE__*/_jsx(ControlWithError, {\n required: required,\n markWhenOptional: markWhenOptional,\n customValidity: customValidity,\n getValidityTarget: () => validityTargetRef.current,\n children: /*#__PURE__*/_jsx(ContentEditableControl, {\n ref: forwardedRef,\n className: clsx('components-validated-control__content-editable', className),\n \"aria-invalid\": customValidity?.type === 'invalid' || undefined,\n ...restProps\n })\n }), /*#__PURE__*/_jsx(\"input\", {\n className: \"components-validated-control__error-delegate\",\n type: \"text\",\n ref: validityTargetRef,\n required: required\n // Whitespace-only content reads as empty, matching how a\n // text-oriented form field is expected to validate `required`.\n ,\n value: value?.trim() ?? '',\n tabIndex: -1,\n onChange: () => {},\n onFocus: e => {\n e.target.previousElementSibling?.querySelector('[role=\"textbox\"]')?.focus();\n }\n })]\n });\n};\nexport const ValidatedContentEditableControl = forwardRef(UnforwardedValidatedContentEditableControl);\nValidatedContentEditableControl.displayName = 'ValidatedContentEditableControl';"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,YAAY,cAAc;AAKnC,SAAS,wBAAwB;AACjC,OAAO,4BAA4B;AAOnC,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,IAAM,6CAA6C,CAAC;AAAA,EAClD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG,iBAAiB;AAClB,QAAM,oBAAoB,OAAO,IAAI;AACrC,SAAoB,sBAAM,OAAO;AAAA,IAC/B,WAAW;AAAA,IACX,UAAU,CAAc,qBAAK,kBAAkB;AAAA,MAC7C;AAAA,MACA;AAAA,MACA;AAAA,MACA,mBAAmB,MAAM,kBAAkB;AAAA,MAC3C,UAAuB,qBAAK,wBAAwB;AAAA,QAClD,KAAK;AAAA,QACL,WAAW,KAAK,kDAAkD,SAAS;AAAA,QAC3E,gBAAgB,gBAAgB,SAAS,aAAa;AAAA,QACtD,GAAG;AAAA,MACL,CAAC;AAAA,IACH,CAAC,GAAgB,qBAAK,SAAS;AAAA,MAC7B,WAAW;AAAA,MACX,MAAM;AAAA,MACN,KAAK;AAAA,MACL;AAAA,MAIA,OAAO,OAAO,KAAK,KAAK;AAAA,MACxB,UAAU;AAAA,MACV,UAAU,MAAM;AAAA,MAAC;AAAA,MACjB,SAAS,OAAK;AACZ,UAAE,OAAO,wBAAwB,cAAc,kBAAkB,GAAG,MAAM;AAAA,MAC5E;AAAA,IACF,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACO,IAAM,kCAAkC,WAAW,0CAA0C;AACpG,gCAAgC,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -7,6 +7,7 @@ export * from "./input-control.mjs";
|
|
|
7
7
|
export * from "./number-control.mjs";
|
|
8
8
|
export * from "./radio-control.mjs";
|
|
9
9
|
export * from "./range-control.mjs";
|
|
10
|
+
export * from "./content-editable-control.mjs";
|
|
10
11
|
export * from "./select-control.mjs";
|
|
11
12
|
export * from "./text-control.mjs";
|
|
12
13
|
export * from "./textarea-control.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/validated-form-controls/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './checkbox-control';\nexport * from './combobox-control';\nexport * from './custom-select-control';\nexport * from './form-token-field';\nexport * from './input-control';\nexport * from './number-control';\nexport * from './radio-control';\nexport * from './range-control';\nexport * from './select-control';\nexport * from './text-control';\nexport * from './textarea-control';\nexport * from './toggle-control';\nexport * from './toggle-group-control';"],
|
|
5
|
-
"mappings": ";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
4
|
+
"sourcesContent": ["export * from './checkbox-control';\nexport * from './combobox-control';\nexport * from './custom-select-control';\nexport * from './form-token-field';\nexport * from './input-control';\nexport * from './number-control';\nexport * from './radio-control';\nexport * from './range-control';\nexport * from './content-editable-control';\nexport * from './select-control';\nexport * from './text-control';\nexport * from './textarea-control';\nexport * from './toggle-control';\nexport * from './toggle-group-control';"],
|
|
5
|
+
"mappings": ";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/validated-form-controls/components/input-control.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport InputControl from '../../input-control';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst UnforwardedValidatedInputControl = ({\n required,\n customValidity,\n markWhenOptional,\n ...restProps\n}, forwardedRef) => {\n const validityTargetRef = useRef(null);\n const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);\n return /*#__PURE__*/_jsx(ControlWithError, {\n required: required,\n markWhenOptional: markWhenOptional,\n customValidity: customValidity,\n getValidityTarget: () => validityTargetRef.current,\n children: /*#__PURE__*/_jsx(InputControl, {\n
|
|
5
|
-
"mappings": ";AAGA,SAAS,YAAY,cAAc;AACnC,SAAS,oBAAoB;AAK7B,SAAS,wBAAwB;AACjC,OAAO,kBAAkB;AACzB,SAAS,OAAO,YAAY;AAC5B,IAAM,mCAAmC,CAAC;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG,iBAAiB;AAClB,QAAM,oBAAoB,OAAO,IAAI;AACrC,QAAM,aAAa,aAAa,CAAC,cAAc,iBAAiB,CAAC;AACjE,SAAoB,qBAAK,kBAAkB;AAAA,IACzC;AAAA,IACA;AAAA,IACA;AAAA,IACA,mBAAmB,MAAM,kBAAkB;AAAA,IAC3C,UAAuB,qBAAK,cAAc;AAAA,MACxC,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport InputControl from '../../input-control';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst UnforwardedValidatedInputControl = ({\n required,\n customValidity,\n markWhenOptional,\n ...restProps\n}, forwardedRef) => {\n const validityTargetRef = useRef(null);\n const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);\n return /*#__PURE__*/_jsx(ControlWithError, {\n required: required,\n markWhenOptional: markWhenOptional,\n customValidity: customValidity,\n getValidityTarget: () => validityTargetRef.current,\n children: /*#__PURE__*/_jsx(InputControl, {\n ref: mergedRefs,\n ...restProps\n })\n });\n};\nexport const ValidatedInputControl = forwardRef(UnforwardedValidatedInputControl);\nValidatedInputControl.displayName = 'ValidatedInputControl';"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,YAAY,cAAc;AACnC,SAAS,oBAAoB;AAK7B,SAAS,wBAAwB;AACjC,OAAO,kBAAkB;AACzB,SAAS,OAAO,YAAY;AAC5B,IAAM,mCAAmC,CAAC;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG,iBAAiB;AAClB,QAAM,oBAAoB,OAAO,IAAI;AACrC,QAAM,aAAa,aAAa,CAAC,cAAc,iBAAiB,CAAC;AACjE,SAAoB,qBAAK,kBAAkB;AAAA,IACzC;AAAA,IACA;AAAA,IACA;AAAA,IACA,mBAAmB,MAAM,kBAAkB;AAAA,IAC3C,UAAuB,qBAAK,cAAc;AAAA,MACxC,KAAK;AAAA,MACL,GAAG;AAAA,IACL,CAAC;AAAA,EACH,CAAC;AACH;AACO,IAAM,wBAAwB,WAAW,gCAAgC;AAChF,sBAAsB,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/validated-form-controls/components/number-control.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport NumberControl from '../../number-control';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst UnforwardedValidatedNumberControl = ({\n required,\n customValidity,\n markWhenOptional,\n ...restProps\n}, forwardedRef) => {\n const validityTargetRef = useRef(null);\n const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);\n return /*#__PURE__*/_jsx(ControlWithError, {\n required: required,\n markWhenOptional: markWhenOptional,\n customValidity: customValidity,\n getValidityTarget: () => validityTargetRef.current,\n children: /*#__PURE__*/_jsx(NumberControl, {\n
|
|
5
|
-
"mappings": ";AAGA,SAAS,YAAY,cAAc;AACnC,SAAS,oBAAoB;AAK7B,SAAS,wBAAwB;AACjC,OAAO,mBAAmB;AAC1B,SAAS,OAAO,YAAY;AAC5B,IAAM,oCAAoC,CAAC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG,iBAAiB;AAClB,QAAM,oBAAoB,OAAO,IAAI;AACrC,QAAM,aAAa,aAAa,CAAC,cAAc,iBAAiB,CAAC;AACjE,SAAoB,qBAAK,kBAAkB;AAAA,IACzC;AAAA,IACA;AAAA,IACA;AAAA,IACA,mBAAmB,MAAM,kBAAkB;AAAA,IAC3C,UAAuB,qBAAK,eAAe;AAAA,MACzC,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport NumberControl from '../../number-control';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst UnforwardedValidatedNumberControl = ({\n required,\n customValidity,\n markWhenOptional,\n ...restProps\n}, forwardedRef) => {\n const validityTargetRef = useRef(null);\n const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);\n return /*#__PURE__*/_jsx(ControlWithError, {\n required: required,\n markWhenOptional: markWhenOptional,\n customValidity: customValidity,\n getValidityTarget: () => validityTargetRef.current,\n children: /*#__PURE__*/_jsx(NumberControl, {\n ref: mergedRefs,\n ...restProps\n })\n });\n};\nexport const ValidatedNumberControl = forwardRef(UnforwardedValidatedNumberControl);\nValidatedNumberControl.displayName = 'ValidatedNumberControl';"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,YAAY,cAAc;AACnC,SAAS,oBAAoB;AAK7B,SAAS,wBAAwB;AACjC,OAAO,mBAAmB;AAC1B,SAAS,OAAO,YAAY;AAC5B,IAAM,oCAAoC,CAAC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG,iBAAiB;AAClB,QAAM,oBAAoB,OAAO,IAAI;AACrC,QAAM,aAAa,aAAa,CAAC,cAAc,iBAAiB,CAAC;AACjE,SAAoB,qBAAK,kBAAkB;AAAA,IACzC;AAAA,IACA;AAAA,IACA;AAAA,IACA,mBAAmB,MAAM,kBAAkB;AAAA,IAC3C,UAAuB,qBAAK,eAAe;AAAA,MACzC,KAAK;AAAA,MACL,GAAG;AAAA,IACL,CAAC;AAAA,EACH,CAAC;AACH;AACO,IAAM,yBAAyB,WAAW,iCAAiC;AAClF,uBAAuB,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -46,6 +46,9 @@ function UnforwardedControlWithError({
|
|
|
46
46
|
const validityTarget = getValidityTarget();
|
|
47
47
|
const suppressNativePopover = (event) => {
|
|
48
48
|
event.preventDefault();
|
|
49
|
+
if (!event.isTrusted) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
49
52
|
const target = event.target;
|
|
50
53
|
const firstErrorInForm = Array.from(target.form?.elements ?? []).find((el) => !el.validity.valid);
|
|
51
54
|
if (!target.form || firstErrorInForm === target) {
|
|
@@ -161,10 +164,7 @@ function UnforwardedControlWithError({
|
|
|
161
164
|
children: [cloneElement(children, {
|
|
162
165
|
label: appendRequiredIndicator(children.props.label, required, markWhenOptional),
|
|
163
166
|
required
|
|
164
|
-
}),
|
|
165
|
-
"aria-live": "polite",
|
|
166
|
-
children: visibleMessage
|
|
167
|
-
})]
|
|
167
|
+
}), visibleMessage]
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
var ControlWithError = forwardRef(UnforwardedControlWithError);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/validated-form-controls/control-with-error.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { cloneElement, forwardRef, useEffect, useId, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport { ValidityIndicator } from './validity-indicator';\nimport { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nfunction appendRequiredIndicator(label, required, markWhenOptional) {\n let suffix;\n if (required && !markWhenOptional) {\n suffix = `(${__('Required')})`;\n } else if (!required && markWhenOptional) {\n suffix = `(${__('Optional')})`;\n }\n if (!suffix) {\n return label;\n }\n if (typeof label === 'string') {\n return `${label} ${suffix}`;\n }\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [label, \" \", suffix]\n });\n}\nconst VALIDITY_VISIBLE_ATTRIBUTE = 'data-validity-visible';\nconst className = 'components-validated-control';\n\n/**\n * HTML elements that support the Constraint Validation API.\n *\n * Here, we exclude HTMLButtonElement because although it does technically support the API,\n * normal buttons are actually exempted from any validation.\n * @see https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Form_validation\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/willValidate\n */\n\nfunction UnforwardedControlWithError({\n required,\n markWhenOptional,\n customValidity,\n getValidityTarget,\n children\n}, forwardedRef) {\n const [errorMessage, setErrorMessage] = useState();\n const [statusMessage, setStatusMessage] = useState();\n const [showMessage, setShowMessage] = useState(false);\n const [isTouched, setIsTouched] = useState(false);\n\n // Ensure that error messages are visible when an `invalid` event is triggered,\n // e.g. when a form is submitted or reportValidity() is called.\n useEffect(() => {\n const validityTarget = getValidityTarget();\n const handler = () => {\n setShowMessage(true);\n validityTarget?.setAttribute(VALIDITY_VISIBLE_ATTRIBUTE, '');\n };\n validityTarget?.addEventListener('invalid', handler);\n return () => validityTarget?.removeEventListener('invalid', handler);\n }, [getValidityTarget]);\n\n // Suppress the native error popover, while keeping the focus behavior intact.\n useEffect(() => {\n const validityTarget = getValidityTarget();\n const suppressNativePopover = event => {\n event.preventDefault();\n const target = event.target;\n const firstErrorInForm = Array.from(target.form?.elements ?? []).find(el => !el.validity.valid);\n if (!target.form || firstErrorInForm === target) {\n target.focus();\n }\n };\n\n // Radio inputs need special handling because all radio inputs with the\n // same `name` will be marked as invalid. Without this handling, the last radio option\n // will be focused with an unsuppressed native popover.\n const radioSibilings = validityTarget?.type === 'radio' && validityTarget?.name ? Array.from(validityTarget?.closest(`.${className}`)?.querySelectorAll(`input[type=\"radio\"][name=\"${validityTarget?.name}\"]`) ?? []).filter(sibling => sibling !== validityTarget) : [];\n validityTarget?.addEventListener('invalid', suppressNativePopover);\n radioSibilings.forEach(sibling => sibling.addEventListener('invalid', suppressNativePopover));\n return () => {\n validityTarget?.removeEventListener('invalid', suppressNativePopover);\n radioSibilings.forEach(sibling => sibling.removeEventListener('invalid', suppressNativePopover));\n };\n }, [getValidityTarget]);\n\n // Handle validity messages.\n useEffect(() => {\n const validityTarget = getValidityTarget();\n if (!customValidity?.type) {\n validityTarget?.setCustomValidity('');\n setErrorMessage(validityTarget?.validationMessage);\n setStatusMessage(undefined);\n return;\n }\n switch (customValidity.type) {\n case 'validating':\n {\n validityTarget?.setCustomValidity('');\n setErrorMessage(undefined);\n setStatusMessage({\n type: 'validating',\n message: customValidity.message\n });\n break;\n }\n case 'valid':\n {\n validityTarget?.setCustomValidity('');\n setErrorMessage(validityTarget?.validationMessage);\n setStatusMessage({\n type: 'valid',\n message: customValidity.message\n });\n break;\n }\n case 'invalid':\n {\n validityTarget?.setCustomValidity(customValidity.message ?? '');\n setErrorMessage(validityTarget?.validationMessage);\n setStatusMessage(undefined);\n break;\n }\n }\n }, [customValidity, getValidityTarget]);\n\n // Show messages if field has been touched (i.e. has blurred at least once),\n // or validation has been triggered by the consumer/user.\n useEffect(() => {\n if (!isTouched || showMessage) {\n return;\n }\n if (customValidity?.type === 'validating') {\n // Don't show validating indicators for quick calls that take less than 1 sec.\n const timer = setTimeout(() => {\n setShowMessage(true);\n }, 1000);\n return () => clearTimeout(timer);\n }\n setShowMessage(true);\n }, [isTouched, customValidity?.type, showMessage]);\n\n // Mark blurred fields as touched.\n const onBlur = event => {\n if (isTouched) {\n return;\n }\n\n // Only consider \"blurred from the component\" if focus has fully left the wrapping div.\n // This prevents unnecessary blurs from components with multiple focusable elements.\n if (!event.relatedTarget || !event.currentTarget.contains(event.relatedTarget)) {\n setIsTouched(true);\n getValidityTarget()?.setAttribute(VALIDITY_VISIBLE_ATTRIBUTE, '');\n }\n };\n const messageId = useId();\n const message = (() => {\n if (errorMessage) {\n return /*#__PURE__*/_jsx(ValidityIndicator, {\n id: messageId,\n type: \"invalid\",\n message: errorMessage\n });\n }\n if (statusMessage?.type) {\n return /*#__PURE__*/_jsx(ValidityIndicator, {\n id: messageId,\n type: statusMessage.type,\n message: statusMessage.message\n });\n }\n return null;\n })();\n const visibleMessage = showMessage ? message : null;\n\n // Imperatively manage `aria-describedby` on the validity target so we\n // merge with any value the child control sets internally (e.g. from a\n // `help` prop), rather than competing with it at the props level.\n useEffect(() => {\n const target = getValidityTarget();\n if (!target) {\n return;\n }\n function setDescribedBy(el, shouldAdd) {\n const ids = (el.getAttribute('aria-describedby') ?? '').split(' ').filter(id => id && id !== messageId);\n if (shouldAdd) {\n ids.push(messageId);\n }\n if (ids.length) {\n el.setAttribute('aria-describedby', ids.join(' '));\n } else {\n el.removeAttribute('aria-describedby');\n }\n }\n setDescribedBy(target, !!visibleMessage);\n return () => setDescribedBy(target, false);\n }, [visibleMessage, messageId, getValidityTarget]);\n return /*#__PURE__*/_jsxs(\"div\", {\n className: className,\n ref: forwardedRef,\n onBlur: onBlur,\n children: [cloneElement(children, {\n label: appendRequiredIndicator(children.props.label, required, markWhenOptional),\n required\n }),
|
|
5
|
-
"mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,cAAc,YAAY,WAAW,OAAO,gBAAgB;AAMrE,SAAS,yBAAyB;AAClC,SAAS,YAAY,WAAW,QAAQ,OAAO,OAAO,YAAY;AAClE,SAAS,wBAAwB,OAAO,UAAU,kBAAkB;AAClE,MAAI;AACJ,MAAI,YAAY,CAAC,kBAAkB;AACjC,aAAS,IAAI,GAAG,UAAU,CAAC;AAAA,EAC7B,WAAW,CAAC,YAAY,kBAAkB;AACxC,aAAS,IAAI,GAAG,UAAU,CAAC;AAAA,EAC7B;AACA,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,EACT;AACA,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,GAAG,KAAK,IAAI,MAAM;AAAA,EAC3B;AACA,SAAoB,sBAAM,WAAW;AAAA,IACnC,UAAU,CAAC,OAAO,KAAK,MAAM;AAAA,EAC/B,CAAC;AACH;AACA,IAAM,6BAA6B;AACnC,IAAM,YAAY;AAWlB,SAAS,4BAA4B;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG,cAAc;AACf,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS;AACjD,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS;AACnD,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AACpD,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAIhD,YAAU,MAAM;AACd,UAAM,iBAAiB,kBAAkB;AACzC,UAAM,UAAU,MAAM;AACpB,qBAAe,IAAI;AACnB,sBAAgB,aAAa,4BAA4B,EAAE;AAAA,IAC7D;AACA,oBAAgB,iBAAiB,WAAW,OAAO;AACnD,WAAO,MAAM,gBAAgB,oBAAoB,WAAW,OAAO;AAAA,EACrE,GAAG,CAAC,iBAAiB,CAAC;AAGtB,YAAU,MAAM;AACd,UAAM,iBAAiB,kBAAkB;AACzC,UAAM,wBAAwB,WAAS;AACrC,YAAM,eAAe;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { cloneElement, forwardRef, useEffect, useId, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport { ValidityIndicator } from './validity-indicator';\nimport { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nfunction appendRequiredIndicator(label, required, markWhenOptional) {\n let suffix;\n if (required && !markWhenOptional) {\n suffix = `(${__('Required')})`;\n } else if (!required && markWhenOptional) {\n suffix = `(${__('Optional')})`;\n }\n if (!suffix) {\n return label;\n }\n if (typeof label === 'string') {\n return `${label} ${suffix}`;\n }\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [label, \" \", suffix]\n });\n}\nconst VALIDITY_VISIBLE_ATTRIBUTE = 'data-validity-visible';\nconst className = 'components-validated-control';\n\n/**\n * HTML elements that support the Constraint Validation API.\n *\n * Here, we exclude HTMLButtonElement because although it does technically support the API,\n * normal buttons are actually exempted from any validation.\n * @see https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Form_validation\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/willValidate\n */\n\nfunction UnforwardedControlWithError({\n required,\n markWhenOptional,\n customValidity,\n getValidityTarget,\n children\n}, forwardedRef) {\n const [errorMessage, setErrorMessage] = useState();\n const [statusMessage, setStatusMessage] = useState();\n const [showMessage, setShowMessage] = useState(false);\n const [isTouched, setIsTouched] = useState(false);\n\n // Ensure that error messages are visible when an `invalid` event is triggered,\n // e.g. when a form is submitted or reportValidity() is called.\n useEffect(() => {\n const validityTarget = getValidityTarget();\n const handler = () => {\n setShowMessage(true);\n validityTarget?.setAttribute(VALIDITY_VISIBLE_ATTRIBUTE, '');\n };\n validityTarget?.addEventListener('invalid', handler);\n return () => validityTarget?.removeEventListener('invalid', handler);\n }, [getValidityTarget]);\n\n // Suppress the native error popover, while keeping the focus behavior intact.\n useEffect(() => {\n const validityTarget = getValidityTarget();\n const suppressNativePopover = event => {\n event.preventDefault();\n\n // Only trusted `invalid` events (a form submission or a\n // `reportValidity()` call) mirror the native focus behavior.\n // Consumers may dispatch a synthetic `invalid` event to reveal\n // this control's error message without disturbing the user's\n // place in the form, so it must not move focus.\n if (!event.isTrusted) {\n return;\n }\n const target = event.target;\n const firstErrorInForm = Array.from(target.form?.elements ?? []).find(el => !el.validity.valid);\n if (!target.form || firstErrorInForm === target) {\n target.focus();\n }\n };\n\n // Radio inputs need special handling because all radio inputs with the\n // same `name` will be marked as invalid. Without this handling, the last radio option\n // will be focused with an unsuppressed native popover.\n const radioSibilings = validityTarget?.type === 'radio' && validityTarget?.name ? Array.from(validityTarget?.closest(`.${className}`)?.querySelectorAll(`input[type=\"radio\"][name=\"${validityTarget?.name}\"]`) ?? []).filter(sibling => sibling !== validityTarget) : [];\n validityTarget?.addEventListener('invalid', suppressNativePopover);\n radioSibilings.forEach(sibling => sibling.addEventListener('invalid', suppressNativePopover));\n return () => {\n validityTarget?.removeEventListener('invalid', suppressNativePopover);\n radioSibilings.forEach(sibling => sibling.removeEventListener('invalid', suppressNativePopover));\n };\n }, [getValidityTarget]);\n\n // Handle validity messages.\n useEffect(() => {\n const validityTarget = getValidityTarget();\n if (!customValidity?.type) {\n validityTarget?.setCustomValidity('');\n setErrorMessage(validityTarget?.validationMessage);\n setStatusMessage(undefined);\n return;\n }\n switch (customValidity.type) {\n case 'validating':\n {\n validityTarget?.setCustomValidity('');\n setErrorMessage(undefined);\n setStatusMessage({\n type: 'validating',\n message: customValidity.message\n });\n break;\n }\n case 'valid':\n {\n validityTarget?.setCustomValidity('');\n setErrorMessage(validityTarget?.validationMessage);\n setStatusMessage({\n type: 'valid',\n message: customValidity.message\n });\n break;\n }\n case 'invalid':\n {\n validityTarget?.setCustomValidity(customValidity.message ?? '');\n setErrorMessage(validityTarget?.validationMessage);\n setStatusMessage(undefined);\n break;\n }\n }\n }, [customValidity, getValidityTarget]);\n\n // Show messages if field has been touched (i.e. has blurred at least once),\n // or validation has been triggered by the consumer/user.\n useEffect(() => {\n if (!isTouched || showMessage) {\n return;\n }\n if (customValidity?.type === 'validating') {\n // Don't show validating indicators for quick calls that take less than 1 sec.\n const timer = setTimeout(() => {\n setShowMessage(true);\n }, 1000);\n return () => clearTimeout(timer);\n }\n setShowMessage(true);\n }, [isTouched, customValidity?.type, showMessage]);\n\n // Mark blurred fields as touched.\n const onBlur = event => {\n if (isTouched) {\n return;\n }\n\n // Only consider \"blurred from the component\" if focus has fully left the wrapping div.\n // This prevents unnecessary blurs from components with multiple focusable elements.\n if (!event.relatedTarget || !event.currentTarget.contains(event.relatedTarget)) {\n setIsTouched(true);\n getValidityTarget()?.setAttribute(VALIDITY_VISIBLE_ATTRIBUTE, '');\n }\n };\n const messageId = useId();\n const message = (() => {\n if (errorMessage) {\n return /*#__PURE__*/_jsx(ValidityIndicator, {\n id: messageId,\n type: \"invalid\",\n message: errorMessage\n });\n }\n if (statusMessage?.type) {\n return /*#__PURE__*/_jsx(ValidityIndicator, {\n id: messageId,\n type: statusMessage.type,\n message: statusMessage.message\n });\n }\n return null;\n })();\n const visibleMessage = showMessage ? message : null;\n\n // Imperatively manage `aria-describedby` on the validity target so we\n // merge with any value the child control sets internally (e.g. from a\n // `help` prop), rather than competing with it at the props level.\n useEffect(() => {\n const target = getValidityTarget();\n if (!target) {\n return;\n }\n function setDescribedBy(el, shouldAdd) {\n const ids = (el.getAttribute('aria-describedby') ?? '').split(' ').filter(id => id && id !== messageId);\n if (shouldAdd) {\n ids.push(messageId);\n }\n if (ids.length) {\n el.setAttribute('aria-describedby', ids.join(' '));\n } else {\n el.removeAttribute('aria-describedby');\n }\n }\n setDescribedBy(target, !!visibleMessage);\n return () => setDescribedBy(target, false);\n }, [visibleMessage, messageId, getValidityTarget]);\n return /*#__PURE__*/_jsxs(\"div\", {\n className: className,\n ref: forwardedRef,\n onBlur: onBlur,\n children: [cloneElement(children, {\n label: appendRequiredIndicator(children.props.label, required, markWhenOptional),\n required\n }), visibleMessage]\n });\n}\nexport const ControlWithError = forwardRef(UnforwardedControlWithError);\nControlWithError.displayName = 'ControlWithError';"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|