@wordpress/components 25.9.1 → 25.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/build/alignment-matrix-control/cell.js +8 -5
- package/build/alignment-matrix-control/cell.js.map +1 -1
- package/build/alignment-matrix-control/index.js +27 -43
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/alignment-matrix-control/utils.js +29 -9
- package/build/alignment-matrix-control/utils.js.map +1 -1
- package/build/autocomplete/index.js +104 -52
- package/build/autocomplete/index.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker-option.js +20 -39
- package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker.js +11 -32
- package/build/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build/circular-option-picker/types.js.map +1 -1
- package/build/color-palette/index.js +7 -2
- package/build/color-palette/index.js.map +1 -1
- package/build/color-picker/component.js +12 -2
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/picker.js +77 -1
- package/build/color-picker/picker.js.map +1 -1
- package/build/color-picker/styles.js +8 -8
- package/build/color-picker/styles.js.map +1 -1
- package/build/color-picker/types.js.map +1 -1
- package/build/composite/v2.js +43 -0
- package/build/composite/v2.js.map +1 -0
- package/build/confirm-dialog/component.js +74 -8
- package/build/confirm-dialog/component.js.map +1 -1
- package/build/confirm-dialog/types.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.js +13 -4
- package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build/dropdown-menu-v2-ariakit/index.js +217 -0
- package/build/dropdown-menu-v2-ariakit/index.js.map +1 -0
- package/build/dropdown-menu-v2-ariakit/styles.js +157 -0
- package/build/dropdown-menu-v2-ariakit/styles.js.map +1 -0
- package/build/dropdown-menu-v2-ariakit/types.js +6 -0
- package/build/dropdown-menu-v2-ariakit/types.js.map +1 -0
- package/build/font-size-picker/utils.js +1 -1
- package/build/font-size-picker/utils.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +23 -23
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/mobile/global-styles-context/utils.native.js +1 -1
- package/build/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build/modal/index.js +45 -16
- package/build/modal/index.js.map +1 -1
- package/build/palette-edit/index.js +4 -0
- package/build/palette-edit/index.js.map +1 -1
- package/build/popover/index.js +34 -6
- package/build/popover/index.js.map +1 -1
- package/build/private-apis.js +18 -2
- package/build/private-apis.js.map +1 -1
- package/build/progress-bar/styles.js +5 -5
- package/build/progress-bar/styles.js.map +1 -1
- package/build/sandbox/index.js +1 -1
- package/build/sandbox/index.js.map +1 -1
- package/build/sandbox/index.native.js +1 -1
- package/build/sandbox/index.native.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +8 -8
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build/tabs/context.js +16 -0
- package/build/tabs/context.js.map +1 -0
- package/build/tabs/index.js +147 -0
- package/build/tabs/index.js.map +1 -0
- package/build/tabs/styles.js +38 -0
- package/build/tabs/styles.js.map +1 -0
- package/build/tabs/tab.js +46 -0
- package/build/tabs/tab.js.map +1 -0
- package/build/tabs/tablist.js +47 -0
- package/build/tabs/tablist.js.map +1 -0
- package/build/tabs/tabpanel.js +48 -0
- package/build/tabs/tabpanel.js.map +1 -0
- package/build/tabs/types.js +6 -0
- package/build/tabs/types.js.map +1 -0
- package/build/text/component.js +7 -6
- package/build/text/component.js.map +1 -1
- package/build/text/hook.js +6 -15
- package/build/text/hook.js.map +1 -1
- package/build/text/index.js.map +1 -1
- package/build/text/styles.js +7 -7
- package/build/text/styles.js.map +1 -1
- package/build/text/types.js.map +1 -1
- package/build/text/utils.js +17 -33
- package/build/text/utils.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js +1 -0
- package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build/toolbar/toolbar/index.js +17 -10
- package/build/toolbar/toolbar/index.js.map +1 -1
- package/build/toolbar/toolbar/types.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +2 -2
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/tools-panel/types.js.map +1 -1
- package/build/tooltip/index.js +2 -2
- package/build/tooltip/index.js.map +1 -1
- package/build/unit-control/utils.js +108 -0
- package/build/unit-control/utils.js.map +1 -1
- package/build/utils/unit-values.js +1 -1
- package/build/utils/unit-values.js.map +1 -1
- package/build-module/alignment-matrix-control/cell.js +7 -4
- package/build-module/alignment-matrix-control/cell.js.map +1 -1
- package/build-module/alignment-matrix-control/index.js +27 -43
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/alignment-matrix-control/utils.js +29 -8
- package/build-module/alignment-matrix-control/utils.js.map +1 -1
- package/build-module/autocomplete/index.js +104 -52
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-option.js +20 -39
- package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker.js +10 -31
- package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build-module/circular-option-picker/types.js.map +1 -1
- package/build-module/color-palette/index.js +7 -2
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-picker/component.js +13 -3
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/picker.js +78 -2
- package/build-module/color-picker/picker.js.map +1 -1
- package/build-module/color-picker/styles.js +8 -8
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/color-picker/types.js.map +1 -1
- package/build-module/composite/v2.js +15 -0
- package/build-module/composite/v2.js.map +1 -0
- package/build-module/confirm-dialog/component.js +72 -7
- package/build-module/confirm-dialog/component.js.map +1 -1
- package/build-module/confirm-dialog/types.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +13 -4
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/dropdown-menu-v2-ariakit/index.js +199 -0
- package/build-module/dropdown-menu-v2-ariakit/index.js.map +1 -0
- package/build-module/dropdown-menu-v2-ariakit/styles.js +136 -0
- package/build-module/dropdown-menu-v2-ariakit/styles.js.map +1 -0
- package/build-module/dropdown-menu-v2-ariakit/types.js +2 -0
- package/build-module/dropdown-menu-v2-ariakit/types.js.map +1 -0
- package/build-module/font-size-picker/utils.js +1 -1
- package/build-module/font-size-picker/utils.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +23 -23
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js +2 -2
- package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build-module/modal/index.js +47 -18
- package/build-module/modal/index.js.map +1 -1
- package/build-module/palette-edit/index.js +4 -0
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/popover/index.js +34 -6
- package/build-module/popover/index.js.map +1 -1
- package/build-module/private-apis.js +18 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/progress-bar/styles.js +5 -5
- package/build-module/progress-bar/styles.js.map +1 -1
- package/build-module/sandbox/index.js +1 -1
- package/build-module/sandbox/index.js.map +1 -1
- package/build-module/sandbox/index.native.js +1 -1
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +8 -8
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build-module/tabs/context.js +12 -0
- package/build-module/tabs/context.js.map +1 -0
- package/build-module/tabs/index.js +142 -0
- package/build-module/tabs/index.js.map +1 -0
- package/build-module/tabs/styles.js +36 -0
- package/build-module/tabs/styles.js.map +1 -0
- package/build-module/tabs/tab.js +43 -0
- package/build-module/tabs/tab.js.map +1 -0
- package/build-module/tabs/tablist.js +41 -0
- package/build-module/tabs/tablist.js.map +1 -0
- package/build-module/tabs/tabpanel.js +43 -0
- package/build-module/tabs/tabpanel.js.map +1 -0
- package/build-module/tabs/types.js +2 -0
- package/build-module/tabs/types.js.map +1 -0
- package/build-module/text/component.js +6 -6
- package/build-module/text/component.js.map +1 -1
- package/build-module/text/hook.js +11 -19
- package/build-module/text/hook.js.map +1 -1
- package/build-module/text/index.js.map +1 -1
- package/build-module/text/styles.js +7 -7
- package/build-module/text/styles.js.map +1 -1
- package/build-module/text/types.js.map +1 -1
- package/build-module/text/utils.js +17 -10
- package/build-module/text/utils.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +1 -0
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build-module/toolbar/toolbar/index.js +18 -11
- package/build-module/toolbar/toolbar/index.js.map +1 -1
- package/build-module/toolbar/toolbar/types.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +2 -2
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/tools-panel/types.js.map +1 -1
- package/build-module/tooltip/index.js +2 -2
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/unit-control/utils.js +108 -0
- package/build-module/unit-control/utils.js.map +1 -1
- package/build-module/utils/unit-values.js +1 -1
- package/build-module/utils/unit-values.js.map +1 -1
- package/build-style/style-rtl.css +17 -5
- package/build-style/style.css +17 -5
- package/build-types/alignment-matrix-control/cell.d.ts +1 -1
- package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/utils.d.ts +9 -9
- package/build-types/alignment-matrix-control/utils.d.ts.map +1 -1
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
- package/build-types/circular-option-picker/types.d.ts +4 -6
- package/build-types/circular-option-picker/types.d.ts.map +1 -1
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-picker/component.d.ts.map +1 -1
- package/build-types/color-picker/picker.d.ts +1 -1
- package/build-types/color-picker/picker.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/color-picker/types.d.ts +3 -0
- package/build-types/color-picker/types.d.ts.map +1 -1
- package/build-types/composite/v2.d.ts +12 -0
- package/build-types/composite/v2.d.ts.map +1 -0
- package/build-types/confirm-dialog/component.d.ts +70 -29
- package/build-types/confirm-dialog/component.d.ts.map +1 -1
- package/build-types/confirm-dialog/stories/index.story.d.ts +11 -0
- package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -0
- package/build-types/confirm-dialog/test/index.d.ts +2 -0
- package/build-types/confirm-dialog/test/index.d.ts.map +1 -0
- package/build-types/confirm-dialog/types.d.ts +32 -10
- package/build-types/confirm-dialog/types.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2-ariakit/index.d.ts +11 -0
- package/build-types/dropdown-menu-v2-ariakit/index.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2-ariakit/stories/index.story.d.ts +16 -0
- package/build-types/dropdown-menu-v2-ariakit/stories/index.story.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2-ariakit/styles.d.ts +88 -0
- package/build-types/dropdown-menu-v2-ariakit/styles.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2-ariakit/test/index.d.ts +2 -0
- package/build-types/dropdown-menu-v2-ariakit/test/index.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2-ariakit/types.d.ts +174 -0
- package/build-types/dropdown-menu-v2-ariakit/types.d.ts.map +1 -0
- package/build-types/font-size-picker/utils.d.ts.map +1 -1
- package/build-types/heading/stories/index.story.d.ts.map +1 -1
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/palette-edit/index.d.ts.map +1 -1
- package/build-types/popover/index.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/stories/e2e/index.story.d.ts +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/progress-bar/styles.d.ts.map +1 -1
- package/build-types/sandbox/index.d.ts.map +1 -1
- package/build-types/tabs/context.d.ts +8 -0
- package/build-types/tabs/context.d.ts.map +1 -0
- package/build-types/tabs/index.d.ts +13 -0
- package/build-types/tabs/index.d.ts.map +1 -0
- package/build-types/tabs/stories/index.story.d.ts +20 -0
- package/build-types/tabs/stories/index.story.d.ts.map +1 -0
- package/build-types/tabs/styles.d.ts +17 -0
- package/build-types/tabs/styles.d.ts.map +1 -0
- package/build-types/tabs/tab.d.ts +10 -0
- package/build-types/tabs/tab.d.ts.map +1 -0
- package/build-types/tabs/tablist.d.ts +7 -0
- package/build-types/tabs/tablist.d.ts.map +1 -0
- package/build-types/tabs/tabpanel.d.ts +7 -0
- package/build-types/tabs/tabpanel.d.ts.map +1 -0
- package/build-types/tabs/test/index.d.ts +2 -0
- package/build-types/tabs/test/index.d.ts.map +1 -0
- package/build-types/tabs/types.d.ts +134 -0
- package/build-types/tabs/types.d.ts.map +1 -0
- package/build-types/text/component.d.ts +4 -2
- package/build-types/text/component.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +171 -165
- package/build-types/text/hook.d.ts.map +1 -1
- package/build-types/text/index.d.ts +2 -2
- package/build-types/text/index.d.ts.map +1 -1
- package/build-types/text/stories/index.story.d.ts +21 -0
- package/build-types/text/stories/index.story.d.ts.map +1 -0
- package/build-types/text/styles.d.ts +7 -7
- package/build-types/text/styles.d.ts.map +1 -1
- package/build-types/text/types.d.ts +1 -1
- package/build-types/text/types.d.ts.map +1 -1
- package/build-types/text/utils.d.ts +56 -61
- package/build-types/text/utils.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/toolbar/stories/index.story.d.ts +5 -0
- package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
- package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar/types.d.ts +10 -0
- package/build-types/toolbar/toolbar/types.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tools-panel/types.d.ts +2 -0
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/unit-control/utils.d.ts.map +1 -1
- package/package.json +21 -20
- package/src/alignment-matrix-control/cell.tsx +6 -2
- package/src/alignment-matrix-control/index.tsx +31 -54
- package/src/alignment-matrix-control/stories/index.story.tsx +3 -7
- package/src/alignment-matrix-control/test/index.tsx +117 -18
- package/src/alignment-matrix-control/utils.tsx +33 -9
- package/src/autocomplete/index.tsx +136 -77
- package/src/button/style.scss +1 -2
- package/src/circular-option-picker/circular-option-picker-option.tsx +24 -38
- package/src/circular-option-picker/circular-option-picker.tsx +11 -28
- package/src/circular-option-picker/types.ts +6 -5
- package/src/color-palette/index.tsx +6 -1
- package/src/color-picker/component.tsx +25 -3
- package/src/color-picker/picker.tsx +96 -2
- package/src/color-picker/styles.ts +0 -1
- package/src/color-picker/types.ts +3 -0
- package/src/composite/v2.ts +22 -0
- package/src/confirm-dialog/README.md +1 -1
- package/src/confirm-dialog/component.tsx +79 -13
- package/src/confirm-dialog/stories/{index.story.js → index.story.tsx} +26 -24
- package/src/confirm-dialog/test/{index.js → index.tsx} +3 -3
- package/src/confirm-dialog/types.ts +32 -12
- package/src/custom-gradient-picker/gradient-bar/control-points.tsx +32 -25
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +8 -8
- package/src/dropdown-menu-v2-ariakit/README.md +324 -0
- package/src/dropdown-menu-v2-ariakit/index.tsx +318 -0
- package/src/dropdown-menu-v2-ariakit/stories/index.story.tsx +506 -0
- package/src/dropdown-menu-v2-ariakit/styles.ts +297 -0
- package/src/dropdown-menu-v2-ariakit/test/index.tsx +1139 -0
- package/src/dropdown-menu-v2-ariakit/types.ts +186 -0
- package/src/font-size-picker/utils.ts +2 -1
- package/src/heading/stories/index.story.tsx +2 -4
- package/src/input-control/styles/input-control-styles.tsx +2 -2
- package/src/mobile/global-styles-context/utils.native.js +2 -2
- package/src/modal/index.tsx +58 -22
- package/src/modal/test/index.tsx +29 -0
- package/src/notice/style.scss +0 -1
- package/src/palette-edit/index.tsx +4 -0
- package/src/popover/index.tsx +99 -57
- package/src/popover/style.scss +9 -0
- package/src/private-apis.ts +31 -1
- package/src/progress-bar/styles.ts +19 -4
- package/src/sandbox/index.native.js +1 -1
- package/src/sandbox/index.tsx +3 -1
- package/src/select-control/styles/select-control-styles.ts +2 -2
- package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +1 -1
- package/src/tabs/README.md +242 -0
- package/src/tabs/context.ts +13 -0
- package/src/tabs/index.tsx +167 -0
- package/src/tabs/stories/index.story.tsx +352 -0
- package/src/tabs/styles.ts +103 -0
- package/src/tabs/tab.tsx +39 -0
- package/src/tabs/tablist.tsx +40 -0
- package/src/tabs/tabpanel.tsx +42 -0
- package/src/tabs/test/index.tsx +1133 -0
- package/src/tabs/types.ts +142 -0
- package/src/text/README.md +2 -2
- package/src/text/{component.js → component.tsx} +10 -6
- package/src/text/{hook.js → hook.ts} +12 -15
- package/src/text/stories/index.story.tsx +80 -0
- package/src/text/types.ts +1 -6
- package/src/text/{utils.js → utils.ts} +40 -14
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +16 -0
- package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +1 -0
- package/src/toolbar/stories/index.story.tsx +15 -0
- package/src/toolbar/test/index.tsx +8 -0
- package/src/toolbar/toolbar/README.md +9 -0
- package/src/toolbar/toolbar/index.tsx +21 -12
- package/src/toolbar/toolbar/style.scss +9 -0
- package/src/toolbar/toolbar/types.ts +10 -0
- package/src/tools-panel/tools-panel/README.md +3 -0
- package/src/tools-panel/tools-panel-item/hook.ts +4 -6
- package/src/tools-panel/types.ts +2 -0
- package/src/tooltip/index.tsx +2 -3
- package/src/unit-control/utils.ts +124 -0
- package/src/utils/unit-values.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/src/text/stories/index.story.js +0 -53
- /package/src/text/{index.js → index.ts} +0 -0
- /package/src/text/{styles.js → styles.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 25.11.0 (2023-11-02)
|
|
6
|
+
|
|
7
|
+
### Enhancements
|
|
8
|
+
|
|
9
|
+
- `InputControl`/`SelectControl`: update `height`/`min-height` to `32px` instead of `30px` to align with modern sizing scale ([#55490](https://github.com/WordPress/gutenberg/pull/55490)).
|
|
10
|
+
|
|
11
|
+
### Bug Fix
|
|
12
|
+
|
|
13
|
+
- `Autocomplete`: Add `aria-live` announcements for Mac and IOS Voiceover to fix lack of support for `aria-owns` ([#54902](https://github.com/WordPress/gutenberg/pull/54902)).
|
|
14
|
+
|
|
15
|
+
### Internal
|
|
16
|
+
|
|
17
|
+
- Introduce experimental new version of `DropdownMenu` based on `ariakit` ([#54939](https://github.com/WordPress/gutenberg/pull/54939))
|
|
18
|
+
|
|
19
|
+
## 25.10.0 (2023-10-18)
|
|
20
|
+
|
|
21
|
+
### Enhancements
|
|
22
|
+
|
|
23
|
+
- `ProgressBar`: use text color to ensure enough contrast against background ([#55285](https://github.com/WordPress/gutenberg/pull/55285)).
|
|
24
|
+
- `Notice`: Remove margins from `Notice` component ([#54800](https://github.com/WordPress/gutenberg/pull/54800)).
|
|
25
|
+
- Allow using CSS level 4 viewport-relative units ([54415](https://github.com/WordPress/gutenberg/pull/54415))
|
|
26
|
+
- `ToolsPanel`: do not apply the `className` to prop to `ToolsPanelItem` components when rendered as placeholders ([#55207](https://github.com/WordPress/gutenberg/pull/55207)).
|
|
27
|
+
- `GradientPicker`: remove overflow styles and padding from `ColorPicker` popovers ([#55265](https://github.com/WordPress/gutenberg/pull/55265)).
|
|
28
|
+
- `Tabs`: Expose via private APIs ([#55327](https://github.com/WordPress/gutenberg/pull/55327)).
|
|
29
|
+
- `ColorPalette`/`ToggleGroupControl/ToggleGroupControlOptionBase`: add `type="button"` attribute to native `<button>`s ([#55125](https://github.com/WordPress/gutenberg/pull/55125)).
|
|
30
|
+
|
|
31
|
+
### Bug Fix
|
|
32
|
+
|
|
33
|
+
- Render a "mouse event trap" when using a `ColorPicker` inside a `Popover` to prevent issues when rendering on top of `iframes` ([#55149](https://github.com/WordPress/gutenberg/pull/55149)).
|
|
34
|
+
- `Modal`: fix closing when contained iframe is focused ([#51602](https://github.com/WordPress/gutenberg/pull/51602)).
|
|
35
|
+
- `Autocomplete`: Fix disappearing results issue when using multiple triggers inline ([#55301](https://github.com/WordPress/gutenberg/pull/55301))
|
|
36
|
+
|
|
37
|
+
### Internal
|
|
38
|
+
|
|
39
|
+
- Update `@ariakit/react` to version `0.3.5` ([#55365](https://github.com/WordPress/gutenberg/pull/55365))
|
|
40
|
+
- `ConfirmDialog`: Migrate to TypeScript. ([#54954](https://github.com/WordPress/gutenberg/pull/54954)).
|
|
41
|
+
|
|
42
|
+
### New Features
|
|
43
|
+
|
|
44
|
+
- `Toolbar`: add new `variant` prop for 'unstyled' option ([#55139](https://github.com/WordPress/gutenberg/pull/55139)).
|
|
45
|
+
|
|
5
46
|
## 25.9.0 (2023-10-05)
|
|
6
47
|
|
|
7
48
|
### Enhancements
|
|
@@ -13,6 +54,7 @@
|
|
|
13
54
|
- `InputControl`, `NumberControl`, `UnitControl`, `SelectControl`, `CustomSelectControl`, `TreeSelect`: Add opt-in prop for next 40px default size, superseding the `__next36pxDefaultSize` prop ([#53819](https://github.com/WordPress/gutenberg/pull/53819)).
|
|
14
55
|
- `Modal`: add a new `size` prop to support preset widths, including a `fill` option to eventually replace the `isFullScreen` prop ([#54471](https://github.com/WordPress/gutenberg/pull/54471)).
|
|
15
56
|
- Wrapped `TextareaControl` in a `forwardRef` call ([#54975](https://github.com/WordPress/gutenberg/pull/54975)).
|
|
57
|
+
- `Composite`/`AlignmentMatrixControl`/`CircularOptionPicker`: Starts the `Composite` migration from `reakit` to `ariakit` ([#54225](https://github.com/WordPress/gutenberg/pull/54225)).
|
|
16
58
|
|
|
17
59
|
### Bug Fix
|
|
18
60
|
|
|
@@ -23,6 +65,7 @@
|
|
|
23
65
|
- `Button`: Remove `aria-selected` CSS selector from styling 'active' buttons ([#54931](https://github.com/WordPress/gutenberg/pull/54931)).
|
|
24
66
|
- `Popover`: Apply the CSS in JS styles properly for components used within popovers. ([#54912](https://github.com/WordPress/gutenberg/pull/54912))
|
|
25
67
|
- `Button`: Remove hover styles when `aria-disabled` is set to `true` for the secondary variant. ([#54978](https://github.com/WordPress/gutenberg/pull/54978))
|
|
68
|
+
- `Button`: Revert toggled style selector to use a class instead of attributes ([#55065](https://github.com/WordPress/gutenberg/pull/55065)).
|
|
26
69
|
|
|
27
70
|
### Internal
|
|
28
71
|
|
|
@@ -34,6 +77,11 @@
|
|
|
34
77
|
- `SlotFill`: Migrate to TypeScript and Convert to Functional Component `<Slot bubblesVirtually />`. ([#51350](https://github.com/WordPress/gutenberg/pull/51350)).
|
|
35
78
|
- `Components`: move `ui/utils` to `utils` and remove `ui/` folder ([#54922](https://github.com/WordPress/gutenberg/pull/54922)).
|
|
36
79
|
- Ensure `@types/` dependencies used by final type files are included in the main dependency field ([#50231](https://github.com/WordPress/gutenberg/pull/50231)).
|
|
80
|
+
- `Text`: Migrate to TypeScript. ([#54953](https://github.com/WordPress/gutenberg/pull/54953)).
|
|
81
|
+
|
|
82
|
+
### Experimental
|
|
83
|
+
|
|
84
|
+
- Introduce `Tabs`, an experimental v2 of `TabPanel`: ([#53960](https://github.com/WordPress/gutenberg/pull/53960)).
|
|
37
85
|
|
|
38
86
|
## 25.8.0 (2023-09-20)
|
|
39
87
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = Cell;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var
|
|
9
|
+
var _v = require("../composite/v2");
|
|
10
10
|
var _tooltip = _interopRequireDefault(require("../tooltip"));
|
|
11
11
|
var _visuallyHidden = require("../visually-hidden");
|
|
12
12
|
var _utils = require("./utils");
|
|
@@ -20,6 +20,7 @@ var _alignmentMatrixControlStyles = require("./styles/alignment-matrix-control-s
|
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
function Cell({
|
|
23
|
+
id,
|
|
23
24
|
isActive = false,
|
|
24
25
|
value,
|
|
25
26
|
...props
|
|
@@ -27,10 +28,12 @@ function Cell({
|
|
|
27
28
|
const tooltipText = _utils.ALIGNMENT_LABEL[value];
|
|
28
29
|
return (0, _react.createElement)(_tooltip.default, {
|
|
29
30
|
text: tooltipText
|
|
30
|
-
}, (0, _react.createElement)(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
}, (0, _react.createElement)(_v.CompositeItem, {
|
|
32
|
+
id: id,
|
|
33
|
+
render: (0, _react.createElement)(_alignmentMatrixControlStyles.Cell, {
|
|
34
|
+
...props,
|
|
35
|
+
role: "gridcell"
|
|
36
|
+
})
|
|
34
37
|
}, (0, _react.createElement)(_visuallyHidden.VisuallyHidden, null, value), (0, _react.createElement)(_alignmentMatrixControlStyles.Point, {
|
|
35
38
|
isActive: isActive,
|
|
36
39
|
role: "presentation"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_v","require","_tooltip","_interopRequireDefault","_visuallyHidden","_utils","_alignmentMatrixControlStyles","Cell","id","isActive","value","props","tooltipText","ALIGNMENT_LABEL","_react","createElement","default","text","CompositeItem","render","role","VisuallyHidden","Point"],"sources":["@wordpress/components/src/alignment-matrix-control/cell.tsx"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { CompositeItem } from '../composite/v2';\nimport Tooltip from '../tooltip';\nimport { VisuallyHidden } from '../visually-hidden';\n\n/**\n * Internal dependencies\n */\nimport { ALIGNMENT_LABEL } from './utils';\nimport {\n\tCell as CellView,\n\tPoint,\n} from './styles/alignment-matrix-control-styles';\nimport type { AlignmentMatrixControlCellProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nexport default function Cell( {\n\tid,\n\tisActive = false,\n\tvalue,\n\t...props\n}: WordPressComponentProps< AlignmentMatrixControlCellProps, 'span', false > ) {\n\tconst tooltipText = ALIGNMENT_LABEL[ value ];\n\n\treturn (\n\t\t<Tooltip text={ tooltipText }>\n\t\t\t<CompositeItem\n\t\t\t\tid={ id }\n\t\t\t\trender={ <CellView { ...props } role=\"gridcell\" /> }\n\t\t\t>\n\t\t\t\t{ /* VoiceOver needs a text content to be rendered within grid cell,\n\t\t\totherwise it'll announce the content as \"blank\". So we use a visually\n\t\t\thidden element instead of aria-label. */ }\n\t\t\t\t<VisuallyHidden>{ value }</VisuallyHidden>\n\t\t\t\t<Point isActive={ isActive } role=\"presentation\" />\n\t\t\t</CompositeItem>\n\t\t</Tooltip>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,EAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,6BAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAKA;AACA;AACA;;AASe,SAASM,IAAIA,CAAE;EAC7BC,EAAE;EACFC,QAAQ,GAAG,KAAK;EAChBC,KAAK;EACL,GAAGC;AACuE,CAAC,EAAG;EAC9E,MAAMC,WAAW,GAAGC,sBAAe,CAAEH,KAAK,CAAE;EAE5C,OACC,IAAAI,MAAA,CAAAC,aAAA,EAACb,QAAA,CAAAc,OAAO;IAACC,IAAI,EAAGL;EAAa,GAC5B,IAAAE,MAAA,CAAAC,aAAA,EAACf,EAAA,CAAAkB,aAAa;IACbV,EAAE,EAAGA,EAAI;IACTW,MAAM,EAAG,IAAAL,MAAA,CAAAC,aAAA,EAACT,6BAAA,CAAAC,IAAQ;MAAA,GAAMI,KAAK;MAAGS,IAAI,EAAC;IAAU,CAAE;EAAG,GAKpD,IAAAN,MAAA,CAAAC,aAAA,EAACX,eAAA,CAAAiB,cAAc,QAAGX,KAAuB,CAAC,EAC1C,IAAAI,MAAA,CAAAC,aAAA,EAACT,6BAAA,CAAAgB,KAAK;IAACb,QAAQ,EAAGA,QAAU;IAACW,IAAI,EAAC;EAAc,CAAE,CACpC,CACP,CAAC;AAEZ"}
|
|
@@ -10,9 +10,8 @@ var _react = require("react");
|
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _i18n = require("@wordpress/i18n");
|
|
12
12
|
var _compose = require("@wordpress/compose");
|
|
13
|
-
var _element = require("@wordpress/element");
|
|
14
13
|
var _cell = _interopRequireDefault(require("./cell"));
|
|
15
|
-
var
|
|
14
|
+
var _v = require("../composite/v2");
|
|
16
15
|
var _alignmentMatrixControlStyles = require("./styles/alignment-matrix-control-styles");
|
|
17
16
|
var _icon = _interopRequireDefault(require("./icon"));
|
|
18
17
|
var _utils = require("./utils");
|
|
@@ -28,12 +27,6 @@ var _utils = require("./utils");
|
|
|
28
27
|
* Internal dependencies
|
|
29
28
|
*/
|
|
30
29
|
|
|
31
|
-
const noop = () => {};
|
|
32
|
-
function useBaseId(id) {
|
|
33
|
-
const instanceId = (0, _compose.useInstanceId)(AlignmentMatrixControl, 'alignment-matrix-control');
|
|
34
|
-
return id || instanceId;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
30
|
/**
|
|
38
31
|
*
|
|
39
32
|
* AlignmentMatrixControl components enable adjustments to horizontal and vertical alignments for UI.
|
|
@@ -60,54 +53,45 @@ function AlignmentMatrixControl({
|
|
|
60
53
|
label = (0, _i18n.__)('Alignment Matrix Control'),
|
|
61
54
|
defaultValue = 'center center',
|
|
62
55
|
value,
|
|
63
|
-
onChange
|
|
56
|
+
onChange,
|
|
64
57
|
width = 92,
|
|
65
58
|
...props
|
|
66
59
|
}) {
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
60
|
+
const baseId = (0, _compose.useInstanceId)(AlignmentMatrixControl, 'alignment-matrix-control', id);
|
|
61
|
+
const compositeStore = (0, _v.useCompositeStore)({
|
|
62
|
+
defaultActiveId: (0, _utils.getItemId)(baseId, defaultValue),
|
|
63
|
+
activeId: (0, _utils.getItemId)(baseId, value),
|
|
64
|
+
setActiveId: nextActiveId => {
|
|
65
|
+
const nextValue = (0, _utils.getItemValue)(baseId, nextActiveId);
|
|
66
|
+
if (nextValue) onChange?.(nextValue);
|
|
67
|
+
},
|
|
73
68
|
rtl: (0, _i18n.isRTL)()
|
|
74
69
|
});
|
|
75
|
-
const
|
|
76
|
-
onChange(nextValue);
|
|
77
|
-
};
|
|
78
|
-
const {
|
|
79
|
-
setCurrentId
|
|
80
|
-
} = composite;
|
|
81
|
-
(0, _element.useEffect)(() => {
|
|
82
|
-
if (typeof value !== 'undefined') {
|
|
83
|
-
setCurrentId((0, _utils.getItemId)(baseId, value));
|
|
84
|
-
}
|
|
85
|
-
}, [value, setCurrentId, baseId]);
|
|
70
|
+
const activeId = compositeStore.useState('activeId');
|
|
86
71
|
const classes = (0, _classnames.default)('component-alignment-matrix-control', className);
|
|
87
|
-
return (0, _react.createElement)(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
72
|
+
return (0, _react.createElement)(_v.Composite, {
|
|
73
|
+
store: compositeStore,
|
|
74
|
+
render: (0, _react.createElement)(_alignmentMatrixControlStyles.Root, {
|
|
75
|
+
...props,
|
|
76
|
+
"aria-label": label,
|
|
77
|
+
className: classes,
|
|
78
|
+
id: baseId,
|
|
79
|
+
role: "grid",
|
|
80
|
+
size: width
|
|
81
|
+
})
|
|
82
|
+
}, _utils.GRID.map((cells, index) => (0, _react.createElement)(_v.CompositeRow, {
|
|
83
|
+
render: (0, _react.createElement)(_alignmentMatrixControlStyles.Row, {
|
|
84
|
+
role: "row"
|
|
85
|
+
}),
|
|
99
86
|
key: index
|
|
100
87
|
}, cells.map(cell => {
|
|
101
88
|
const cellId = (0, _utils.getItemId)(baseId, cell);
|
|
102
|
-
const isActive =
|
|
89
|
+
const isActive = cellId === activeId;
|
|
103
90
|
return (0, _react.createElement)(_cell.default, {
|
|
104
|
-
...composite,
|
|
105
91
|
id: cellId,
|
|
106
92
|
isActive: isActive,
|
|
107
93
|
key: cell,
|
|
108
|
-
value: cell
|
|
109
|
-
onFocus: () => handleOnChange(cell),
|
|
110
|
-
tabIndex: isActive ? 0 : -1
|
|
94
|
+
value: cell
|
|
111
95
|
});
|
|
112
96
|
}))));
|
|
113
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_i18n","_compose","
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_i18n","_compose","_cell","_v","_alignmentMatrixControlStyles","_icon","_utils","AlignmentMatrixControl","className","id","label","__","defaultValue","value","onChange","width","props","baseId","useInstanceId","compositeStore","useCompositeStore","defaultActiveId","getItemId","activeId","setActiveId","nextActiveId","nextValue","getItemValue","rtl","isRTL","useState","classes","classnames","_react","createElement","Composite","store","render","Root","role","size","GRID","map","cells","index","CompositeRow","Row","key","cell","cellId","isActive","default","Icon","AlignmentMatrixControlIcon","_default","exports"],"sources":["@wordpress/components/src/alignment-matrix-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Cell from './cell';\nimport { Composite, CompositeRow, useCompositeStore } from '../composite/v2';\nimport { Root, Row } from './styles/alignment-matrix-control-styles';\nimport AlignmentMatrixControlIcon from './icon';\nimport { GRID, getItemId, getItemValue } from './utils';\nimport type { WordPressComponentProps } from '../context';\nimport type { AlignmentMatrixControlProps } from './types';\n\n/**\n *\n * AlignmentMatrixControl components enable adjustments to horizontal and vertical alignments for UI.\n *\n * ```jsx\n * import { __experimentalAlignmentMatrixControl as AlignmentMatrixControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * \tconst [ alignment, setAlignment ] = useState( 'center center' );\n *\n * \treturn (\n * \t\t<AlignmentMatrixControl\n * \t\t\tvalue={ alignment }\n * \t\t\tonChange={ setAlignment }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nexport function AlignmentMatrixControl( {\n\tclassName,\n\tid,\n\tlabel = __( 'Alignment Matrix Control' ),\n\tdefaultValue = 'center center',\n\tvalue,\n\tonChange,\n\twidth = 92,\n\t...props\n}: WordPressComponentProps< AlignmentMatrixControlProps, 'div', false > ) {\n\tconst baseId = useInstanceId(\n\t\tAlignmentMatrixControl,\n\t\t'alignment-matrix-control',\n\t\tid\n\t);\n\n\tconst compositeStore = useCompositeStore( {\n\t\tdefaultActiveId: getItemId( baseId, defaultValue ),\n\t\tactiveId: getItemId( baseId, value ),\n\t\tsetActiveId: ( nextActiveId ) => {\n\t\t\tconst nextValue = getItemValue( baseId, nextActiveId );\n\t\t\tif ( nextValue ) onChange?.( nextValue );\n\t\t},\n\t\trtl: isRTL(),\n\t} );\n\n\tconst activeId = compositeStore.useState( 'activeId' );\n\n\tconst classes = classnames(\n\t\t'component-alignment-matrix-control',\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<Composite\n\t\t\tstore={ compositeStore }\n\t\t\trender={\n\t\t\t\t<Root\n\t\t\t\t\t{ ...props }\n\t\t\t\t\taria-label={ label }\n\t\t\t\t\tclassName={ classes }\n\t\t\t\t\tid={ baseId }\n\t\t\t\t\trole=\"grid\"\n\t\t\t\t\tsize={ width }\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t{ GRID.map( ( cells, index ) => (\n\t\t\t\t<CompositeRow render={ <Row role=\"row\" /> } key={ index }>\n\t\t\t\t\t{ cells.map( ( cell ) => {\n\t\t\t\t\t\tconst cellId = getItemId( baseId, cell );\n\t\t\t\t\t\tconst isActive = cellId === activeId;\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Cell\n\t\t\t\t\t\t\t\tid={ cellId }\n\t\t\t\t\t\t\t\tisActive={ isActive }\n\t\t\t\t\t\t\t\tkey={ cell }\n\t\t\t\t\t\t\t\tvalue={ cell }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</CompositeRow>\n\t\t\t) ) }\n\t\t</Composite>\n\t);\n}\n\nAlignmentMatrixControl.Icon = AlignmentMatrixControlIcon;\n\nexport default AlignmentMatrixControl;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,EAAA,GAAAJ,OAAA;AACA,IAAAK,6BAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,sBAAsBA,CAAE;EACvCC,SAAS;EACTC,EAAE;EACFC,KAAK,GAAG,IAAAC,QAAE,EAAE,0BAA2B,CAAC;EACxCC,YAAY,GAAG,eAAe;EAC9BC,KAAK;EACLC,QAAQ;EACRC,KAAK,GAAG,EAAE;EACV,GAAGC;AACkE,CAAC,EAAG;EACzE,MAAMC,MAAM,GAAG,IAAAC,sBAAa,EAC3BX,sBAAsB,EACtB,0BAA0B,EAC1BE,EACD,CAAC;EAED,MAAMU,cAAc,GAAG,IAAAC,oBAAiB,EAAE;IACzCC,eAAe,EAAE,IAAAC,gBAAS,EAAEL,MAAM,EAAEL,YAAa,CAAC;IAClDW,QAAQ,EAAE,IAAAD,gBAAS,EAAEL,MAAM,EAAEJ,KAAM,CAAC;IACpCW,WAAW,EAAIC,YAAY,IAAM;MAChC,MAAMC,SAAS,GAAG,IAAAC,mBAAY,EAAEV,MAAM,EAAEQ,YAAa,CAAC;MACtD,IAAKC,SAAS,EAAGZ,QAAQ,GAAIY,SAAU,CAAC;IACzC,CAAC;IACDE,GAAG,EAAE,IAAAC,WAAK,EAAC;EACZ,CAAE,CAAC;EAEH,MAAMN,QAAQ,GAAGJ,cAAc,CAACW,QAAQ,CAAE,UAAW,CAAC;EAEtD,MAAMC,OAAO,GAAG,IAAAC,mBAAU,EACzB,oCAAoC,EACpCxB,SACD,CAAC;EAED,OACC,IAAAyB,MAAA,CAAAC,aAAA,EAAC/B,EAAA,CAAAgC,SAAS;IACTC,KAAK,EAAGjB,cAAgB;IACxBkB,MAAM,EACL,IAAAJ,MAAA,CAAAC,aAAA,EAAC9B,6BAAA,CAAAkC,IAAI;MAAA,GACCtB,KAAK;MACV,cAAaN,KAAO;MACpBF,SAAS,EAAGuB,OAAS;MACrBtB,EAAE,EAAGQ,MAAQ;MACbsB,IAAI,EAAC,MAAM;MACXC,IAAI,EAAGzB;IAAO,CACd;EACD,GAEC0B,WAAI,CAACC,GAAG,CAAE,CAAEC,KAAK,EAAEC,KAAK,KACzB,IAAAX,MAAA,CAAAC,aAAA,EAAC/B,EAAA,CAAA0C,YAAY;IAACR,MAAM,EAAG,IAAAJ,MAAA,CAAAC,aAAA,EAAC9B,6BAAA,CAAA0C,GAAG;MAACP,IAAI,EAAC;IAAK,CAAE,CAAG;IAACQ,GAAG,EAAGH;EAAO,GACtDD,KAAK,CAACD,GAAG,CAAIM,IAAI,IAAM;IACxB,MAAMC,MAAM,GAAG,IAAA3B,gBAAS,EAAEL,MAAM,EAAE+B,IAAK,CAAC;IACxC,MAAME,QAAQ,GAAGD,MAAM,KAAK1B,QAAQ;IAEpC,OACC,IAAAU,MAAA,CAAAC,aAAA,EAAChC,KAAA,CAAAiD,OAAI;MACJ1C,EAAE,EAAGwC,MAAQ;MACbC,QAAQ,EAAGA,QAAU;MACrBH,GAAG,EAAGC,IAAM;MACZnC,KAAK,EAAGmC;IAAM,CACd,CAAC;EAEJ,CAAE,CACW,CACb,CACQ,CAAC;AAEd;AAEAzC,sBAAsB,CAAC6C,IAAI,GAAGC,aAA0B;AAAC,IAAAC,QAAA,GAE1C/C,sBAAsB;AAAAgD,OAAA,CAAAJ,OAAA,GAAAG,QAAA"}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.GRID = exports.ALIGNMENT_LABEL = exports.ALIGNMENTS = void 0;
|
|
7
7
|
exports.getAlignmentIndex = getAlignmentIndex;
|
|
8
8
|
exports.getItemId = getItemId;
|
|
9
|
-
exports.
|
|
9
|
+
exports.getItemValue = getItemValue;
|
|
10
10
|
var _i18n = require("@wordpress/i18n");
|
|
11
11
|
/**
|
|
12
12
|
* WordPress dependencies
|
|
@@ -34,16 +34,21 @@ exports.ALIGNMENT_LABEL = ALIGNMENT_LABEL;
|
|
|
34
34
|
const ALIGNMENTS = GRID.flat();
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* Normalizes and transforms an incoming value to better match the alignment values
|
|
38
38
|
*
|
|
39
39
|
* @param value An alignment value to parse.
|
|
40
40
|
*
|
|
41
41
|
* @return The parsed value.
|
|
42
42
|
*/
|
|
43
43
|
exports.ALIGNMENTS = ALIGNMENTS;
|
|
44
|
-
function
|
|
45
|
-
const
|
|
46
|
-
|
|
44
|
+
function normalize(value) {
|
|
45
|
+
const normalized = value === 'center' ? 'center center' : value;
|
|
46
|
+
|
|
47
|
+
// Strictly speaking, this could be `string | null | undefined`,
|
|
48
|
+
// but will be validated shortly, so we're typecasting to an
|
|
49
|
+
// `AlignmentMatrixControlValue` to keep TypeScript happy.
|
|
50
|
+
const transformed = normalized?.replace('-', ' ');
|
|
51
|
+
return ALIGNMENTS.includes(transformed) ? transformed : undefined;
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
/**
|
|
@@ -55,8 +60,22 @@ function transformValue(value) {
|
|
|
55
60
|
* @return The item id.
|
|
56
61
|
*/
|
|
57
62
|
function getItemId(prefixId, value) {
|
|
58
|
-
const
|
|
59
|
-
return
|
|
63
|
+
const normalized = normalize(value);
|
|
64
|
+
if (!normalized) return;
|
|
65
|
+
const id = normalized.replace(' ', '-');
|
|
66
|
+
return `${prefixId}-${id}`;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Extracts an item value from its ID
|
|
71
|
+
*
|
|
72
|
+
* @param prefixId An ID prefix to remove
|
|
73
|
+
* @param id An item ID
|
|
74
|
+
* @return The item value
|
|
75
|
+
*/
|
|
76
|
+
function getItemValue(prefixId, id) {
|
|
77
|
+
const value = id?.replace(prefixId + '-', '');
|
|
78
|
+
return normalize(value);
|
|
60
79
|
}
|
|
61
80
|
|
|
62
81
|
/**
|
|
@@ -67,8 +86,9 @@ function getItemId(prefixId, value) {
|
|
|
67
86
|
* @return The index of a matching alignment.
|
|
68
87
|
*/
|
|
69
88
|
function getAlignmentIndex(alignment = 'center') {
|
|
70
|
-
const
|
|
71
|
-
|
|
89
|
+
const normalized = normalize(alignment);
|
|
90
|
+
if (!normalized) return undefined;
|
|
91
|
+
const index = ALIGNMENTS.indexOf(normalized);
|
|
72
92
|
return index > -1 ? index : undefined;
|
|
73
93
|
}
|
|
74
94
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","GRID","exports","ALIGNMENT_LABEL","__","center","ALIGNMENTS","flat","
|
|
1
|
+
{"version":3,"names":["_i18n","require","GRID","exports","ALIGNMENT_LABEL","__","center","ALIGNMENTS","flat","normalize","value","normalized","transformed","replace","includes","undefined","getItemId","prefixId","id","getItemValue","getAlignmentIndex","alignment","index","indexOf"],"sources":["@wordpress/components/src/alignment-matrix-control/utils.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { AlignmentMatrixControlValue } from './types';\n\nexport const GRID: AlignmentMatrixControlValue[][] = [\n\t[ 'top left', 'top center', 'top right' ],\n\t[ 'center left', 'center center', 'center right' ],\n\t[ 'bottom left', 'bottom center', 'bottom right' ],\n];\n\n// Stored as map as i18n __() only accepts strings (not variables)\nexport const ALIGNMENT_LABEL: Record< AlignmentMatrixControlValue, string > = {\n\t'top left': __( 'Top Left' ),\n\t'top center': __( 'Top Center' ),\n\t'top right': __( 'Top Right' ),\n\t'center left': __( 'Center Left' ),\n\t'center center': __( 'Center' ),\n\tcenter: __( 'Center' ),\n\t'center right': __( 'Center Right' ),\n\t'bottom left': __( 'Bottom Left' ),\n\t'bottom center': __( 'Bottom Center' ),\n\t'bottom right': __( 'Bottom Right' ),\n};\n\n// Transforms GRID into a flat Array of values.\nexport const ALIGNMENTS = GRID.flat();\n\n/**\n * Normalizes and transforms an incoming value to better match the alignment values\n *\n * @param value An alignment value to parse.\n *\n * @return The parsed value.\n */\nfunction normalize( value?: string | null ) {\n\tconst normalized = value === 'center' ? 'center center' : value;\n\n\t// Strictly speaking, this could be `string | null | undefined`,\n\t// but will be validated shortly, so we're typecasting to an\n\t// `AlignmentMatrixControlValue` to keep TypeScript happy.\n\tconst transformed = normalized?.replace(\n\t\t'-',\n\t\t' '\n\t) as AlignmentMatrixControlValue;\n\n\treturn ALIGNMENTS.includes( transformed ) ? transformed : undefined;\n}\n\n/**\n * Creates an item ID based on a prefix ID and an alignment value.\n *\n * @param prefixId An ID to prefix.\n * @param value An alignment value.\n *\n * @return The item id.\n */\nexport function getItemId(\n\tprefixId: string,\n\tvalue?: AlignmentMatrixControlValue\n) {\n\tconst normalized = normalize( value );\n\tif ( ! normalized ) return;\n\n\tconst id = normalized.replace( ' ', '-' );\n\treturn `${ prefixId }-${ id }`;\n}\n\n/**\n * Extracts an item value from its ID\n *\n * @param prefixId An ID prefix to remove\n * @param id An item ID\n * @return The item value\n */\nexport function getItemValue( prefixId: string, id?: string | null ) {\n\tconst value = id?.replace( prefixId + '-', '' );\n\treturn normalize( value );\n}\n\n/**\n * Retrieves the alignment index from a value.\n *\n * @param alignment Value to check.\n *\n * @return The index of a matching alignment.\n */\nexport function getAlignmentIndex(\n\talignment: AlignmentMatrixControlValue = 'center'\n) {\n\tconst normalized = normalize( alignment );\n\tif ( ! normalized ) return undefined;\n\n\tconst index = ALIGNMENTS.indexOf( normalized );\n\treturn index > -1 ? index : undefined;\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAQO,MAAMC,IAAqC,GAAG,CACpD,CAAE,UAAU,EAAE,YAAY,EAAE,WAAW,CAAE,EACzC,CAAE,aAAa,EAAE,eAAe,EAAE,cAAc,CAAE,EAClD,CAAE,aAAa,EAAE,eAAe,EAAE,cAAc,CAAE,CAClD;;AAED;AAAAC,OAAA,CAAAD,IAAA,GAAAA,IAAA;AACO,MAAME,eAA8D,GAAG;EAC7E,UAAU,EAAE,IAAAC,QAAE,EAAE,UAAW,CAAC;EAC5B,YAAY,EAAE,IAAAA,QAAE,EAAE,YAAa,CAAC;EAChC,WAAW,EAAE,IAAAA,QAAE,EAAE,WAAY,CAAC;EAC9B,aAAa,EAAE,IAAAA,QAAE,EAAE,aAAc,CAAC;EAClC,eAAe,EAAE,IAAAA,QAAE,EAAE,QAAS,CAAC;EAC/BC,MAAM,EAAE,IAAAD,QAAE,EAAE,QAAS,CAAC;EACtB,cAAc,EAAE,IAAAA,QAAE,EAAE,cAAe,CAAC;EACpC,aAAa,EAAE,IAAAA,QAAE,EAAE,aAAc,CAAC;EAClC,eAAe,EAAE,IAAAA,QAAE,EAAE,eAAgB,CAAC;EACtC,cAAc,EAAE,IAAAA,QAAE,EAAE,cAAe;AACpC,CAAC;;AAED;AAAAF,OAAA,CAAAC,eAAA,GAAAA,eAAA;AACO,MAAMG,UAAU,GAAGL,IAAI,CAACM,IAAI,CAAC,CAAC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AANAL,OAAA,CAAAI,UAAA,GAAAA,UAAA;AAOA,SAASE,SAASA,CAAEC,KAAqB,EAAG;EAC3C,MAAMC,UAAU,GAAGD,KAAK,KAAK,QAAQ,GAAG,eAAe,GAAGA,KAAK;;EAE/D;EACA;EACA;EACA,MAAME,WAAW,GAAGD,UAAU,EAAEE,OAAO,CACtC,GAAG,EACH,GACD,CAAgC;EAEhC,OAAON,UAAU,CAACO,QAAQ,CAAEF,WAAY,CAAC,GAAGA,WAAW,GAAGG,SAAS;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,SAASA,CACxBC,QAAgB,EAChBP,KAAmC,EAClC;EACD,MAAMC,UAAU,GAAGF,SAAS,CAAEC,KAAM,CAAC;EACrC,IAAK,CAAEC,UAAU,EAAG;EAEpB,MAAMO,EAAE,GAAGP,UAAU,CAACE,OAAO,CAAE,GAAG,EAAE,GAAI,CAAC;EACzC,OAAQ,GAAGI,QAAU,IAAIC,EAAI,EAAC;AAC/B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAAEF,QAAgB,EAAEC,EAAkB,EAAG;EACpE,MAAMR,KAAK,GAAGQ,EAAE,EAAEL,OAAO,CAAEI,QAAQ,GAAG,GAAG,EAAE,EAAG,CAAC;EAC/C,OAAOR,SAAS,CAAEC,KAAM,CAAC;AAC1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASU,iBAAiBA,CAChCC,SAAsC,GAAG,QAAQ,EAChD;EACD,MAAMV,UAAU,GAAGF,SAAS,CAAEY,SAAU,CAAC;EACzC,IAAK,CAAEV,UAAU,EAAG,OAAOI,SAAS;EAEpC,MAAMO,KAAK,GAAGf,UAAU,CAACgB,OAAO,CAAEZ,UAAW,CAAC;EAC9C,OAAOW,KAAK,GAAG,CAAC,CAAC,GAAGA,KAAK,GAAGP,SAAS;AACtC"}
|
|
@@ -12,6 +12,8 @@ var _removeAccents = _interopRequireDefault(require("remove-accents"));
|
|
|
12
12
|
var _element = require("@wordpress/element");
|
|
13
13
|
var _compose = require("@wordpress/compose");
|
|
14
14
|
var _richText = require("@wordpress/rich-text");
|
|
15
|
+
var _a11y = require("@wordpress/a11y");
|
|
16
|
+
var _keycodes = require("@wordpress/keycodes");
|
|
15
17
|
var _autocompleterUi = require("./autocompleter-ui");
|
|
16
18
|
var _strings = require("../utils/strings");
|
|
17
19
|
/**
|
|
@@ -26,6 +28,33 @@ var _strings = require("../utils/strings");
|
|
|
26
28
|
* Internal dependencies
|
|
27
29
|
*/
|
|
28
30
|
|
|
31
|
+
const getNodeText = node => {
|
|
32
|
+
if (node === null) {
|
|
33
|
+
return '';
|
|
34
|
+
}
|
|
35
|
+
switch (typeof node) {
|
|
36
|
+
case 'string':
|
|
37
|
+
case 'number':
|
|
38
|
+
return node.toString();
|
|
39
|
+
break;
|
|
40
|
+
case 'boolean':
|
|
41
|
+
return '';
|
|
42
|
+
break;
|
|
43
|
+
case 'object':
|
|
44
|
+
{
|
|
45
|
+
if (node instanceof Array) {
|
|
46
|
+
return node.map(getNodeText).join('');
|
|
47
|
+
}
|
|
48
|
+
if ('props' in node) {
|
|
49
|
+
return getNodeText(node.props.children);
|
|
50
|
+
}
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
default:
|
|
54
|
+
return '';
|
|
55
|
+
}
|
|
56
|
+
return '';
|
|
57
|
+
};
|
|
29
58
|
const EMPTY_FILTERED_OPTIONS = [];
|
|
30
59
|
function useAutocomplete({
|
|
31
60
|
record,
|
|
@@ -118,11 +147,24 @@ function useAutocomplete({
|
|
|
118
147
|
}
|
|
119
148
|
switch (event.key) {
|
|
120
149
|
case 'ArrowUp':
|
|
121
|
-
|
|
122
|
-
|
|
150
|
+
{
|
|
151
|
+
const newIndex = (selectedIndex === 0 ? filteredOptions.length : selectedIndex) - 1;
|
|
152
|
+
setSelectedIndex(newIndex);
|
|
153
|
+
// See the related PR as to why this is necessary: https://github.com/WordPress/gutenberg/pull/54902.
|
|
154
|
+
if ((0, _keycodes.isAppleOS)()) {
|
|
155
|
+
(0, _a11y.speak)(getNodeText(filteredOptions[newIndex].label), 'assertive');
|
|
156
|
+
}
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
123
159
|
case 'ArrowDown':
|
|
124
|
-
|
|
125
|
-
|
|
160
|
+
{
|
|
161
|
+
const newIndex = (selectedIndex + 1) % filteredOptions.length;
|
|
162
|
+
setSelectedIndex(newIndex);
|
|
163
|
+
if ((0, _keycodes.isAppleOS)()) {
|
|
164
|
+
(0, _a11y.speak)(getNodeText(filteredOptions[newIndex].label), 'assertive');
|
|
165
|
+
}
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
126
168
|
case 'Escape':
|
|
127
169
|
setAutocompleter(null);
|
|
128
170
|
setAutocompleterUI(null);
|
|
@@ -158,58 +200,68 @@ function useAutocomplete({
|
|
|
158
200
|
if (autocompleter) reset();
|
|
159
201
|
return;
|
|
160
202
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const textWithoutTrigger = textContent.slice(index + triggerPrefix.length);
|
|
170
|
-
const tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit.
|
|
171
|
-
// This is a final barrier to prevent the effect from completing with
|
|
172
|
-
// an extremely long string, which causes the editor to slow-down
|
|
173
|
-
// significantly. This could happen, for example, if `matchingWhileBackspacing`
|
|
174
|
-
// is true and one of the "words" end up being too long. If that's the case,
|
|
175
|
-
// it will be caught by this guard.
|
|
176
|
-
if (tooDistantFromTrigger) return false;
|
|
177
|
-
const mismatch = filteredOptions.length === 0;
|
|
178
|
-
const wordsFromTrigger = textWithoutTrigger.split(/\s/);
|
|
179
|
-
// We need to allow the effect to run when not backspacing and if there
|
|
180
|
-
// was a mismatch. i.e when typing a trigger + the match string or when
|
|
181
|
-
// clicking in an existing trigger word on the page. We do that if we
|
|
182
|
-
// detect that we have one word from trigger in the current textual context.
|
|
183
|
-
//
|
|
184
|
-
// Ex.: "Some text @a" <-- "@a" will be detected as the trigger word and
|
|
185
|
-
// allow the effect to run. It will run until there's a mismatch.
|
|
186
|
-
const hasOneTriggerWord = wordsFromTrigger.length === 1;
|
|
187
|
-
// This is used to allow the effect to run when backspacing and if
|
|
188
|
-
// "touching" a word that "belongs" to a trigger. We consider a "trigger
|
|
189
|
-
// word" any word up to the limit of 3 from the trigger character.
|
|
190
|
-
// Anything beyond that is ignored if there's a mismatch. This allows
|
|
191
|
-
// us to "escape" a mismatch when backspacing, but still imposing some
|
|
192
|
-
// sane limits.
|
|
193
|
-
//
|
|
194
|
-
// Ex: "Some text @marcelo sekkkk" <--- "kkkk" caused a mismatch, but
|
|
195
|
-
// if the user presses backspace here, it will show the completion popup again.
|
|
196
|
-
const matchingWhileBackspacing = backspacing.current && textWithoutTrigger.split(/\s/).length <= 3;
|
|
197
|
-
if (mismatch && !(matchingWhileBackspacing || hasOneTriggerWord)) {
|
|
198
|
-
return false;
|
|
199
|
-
}
|
|
200
|
-
const textAfterSelection = (0, _richText.getTextContent)((0, _richText.slice)(record, undefined, (0, _richText.getTextContent)(record).length));
|
|
201
|
-
if (allowContext && !allowContext(textContent.slice(0, index), textAfterSelection)) {
|
|
202
|
-
return false;
|
|
203
|
-
}
|
|
204
|
-
if (/^\s/.test(textWithoutTrigger) || /\s\s+$/.test(textWithoutTrigger)) {
|
|
205
|
-
return false;
|
|
206
|
-
}
|
|
207
|
-
return /[\u0000-\uFFFF]*$/.test(textWithoutTrigger);
|
|
208
|
-
});
|
|
203
|
+
|
|
204
|
+
// Find the completer with the highest triggerPrefix index in the
|
|
205
|
+
// textContent.
|
|
206
|
+
const completer = completers.reduce((lastTrigger, currentCompleter) => {
|
|
207
|
+
const triggerIndex = textContent.lastIndexOf(currentCompleter.triggerPrefix);
|
|
208
|
+
const lastTriggerIndex = lastTrigger !== null ? textContent.lastIndexOf(lastTrigger.triggerPrefix) : -1;
|
|
209
|
+
return triggerIndex > lastTriggerIndex ? currentCompleter : lastTrigger;
|
|
210
|
+
}, null);
|
|
209
211
|
if (!completer) {
|
|
210
212
|
if (autocompleter) reset();
|
|
211
213
|
return;
|
|
212
214
|
}
|
|
215
|
+
const {
|
|
216
|
+
allowContext,
|
|
217
|
+
triggerPrefix
|
|
218
|
+
} = completer;
|
|
219
|
+
const triggerIndex = textContent.lastIndexOf(triggerPrefix);
|
|
220
|
+
const textWithoutTrigger = textContent.slice(triggerIndex + triggerPrefix.length);
|
|
221
|
+
const tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit.
|
|
222
|
+
// This is a final barrier to prevent the effect from completing with
|
|
223
|
+
// an extremely long string, which causes the editor to slow-down
|
|
224
|
+
// significantly. This could happen, for example, if `matchingWhileBackspacing`
|
|
225
|
+
// is true and one of the "words" end up being too long. If that's the case,
|
|
226
|
+
// it will be caught by this guard.
|
|
227
|
+
if (tooDistantFromTrigger) return;
|
|
228
|
+
const mismatch = filteredOptions.length === 0;
|
|
229
|
+
const wordsFromTrigger = textWithoutTrigger.split(/\s/);
|
|
230
|
+
// We need to allow the effect to run when not backspacing and if there
|
|
231
|
+
// was a mismatch. i.e when typing a trigger + the match string or when
|
|
232
|
+
// clicking in an existing trigger word on the page. We do that if we
|
|
233
|
+
// detect that we have one word from trigger in the current textual context.
|
|
234
|
+
//
|
|
235
|
+
// Ex.: "Some text @a" <-- "@a" will be detected as the trigger word and
|
|
236
|
+
// allow the effect to run. It will run until there's a mismatch.
|
|
237
|
+
const hasOneTriggerWord = wordsFromTrigger.length === 1;
|
|
238
|
+
// This is used to allow the effect to run when backspacing and if
|
|
239
|
+
// "touching" a word that "belongs" to a trigger. We consider a "trigger
|
|
240
|
+
// word" any word up to the limit of 3 from the trigger character.
|
|
241
|
+
// Anything beyond that is ignored if there's a mismatch. This allows
|
|
242
|
+
// us to "escape" a mismatch when backspacing, but still imposing some
|
|
243
|
+
// sane limits.
|
|
244
|
+
//
|
|
245
|
+
// Ex: "Some text @marcelo sekkkk" <--- "kkkk" caused a mismatch, but
|
|
246
|
+
// if the user presses backspace here, it will show the completion popup again.
|
|
247
|
+
const matchingWhileBackspacing = backspacing.current && wordsFromTrigger.length <= 3;
|
|
248
|
+
if (mismatch && !(matchingWhileBackspacing || hasOneTriggerWord)) {
|
|
249
|
+
if (autocompleter) reset();
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const textAfterSelection = (0, _richText.getTextContent)((0, _richText.slice)(record, undefined, (0, _richText.getTextContent)(record).length));
|
|
253
|
+
if (allowContext && !allowContext(textContent.slice(0, triggerIndex), textAfterSelection)) {
|
|
254
|
+
if (autocompleter) reset();
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
if (/^\s/.test(textWithoutTrigger) || /\s\s+$/.test(textWithoutTrigger)) {
|
|
258
|
+
if (autocompleter) reset();
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
if (!/[\u0000-\uFFFF]*$/.test(textWithoutTrigger)) {
|
|
262
|
+
if (autocompleter) reset();
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
213
265
|
const safeTrigger = (0, _strings.escapeRegExp)(completer.triggerPrefix);
|
|
214
266
|
const text = (0, _removeAccents.default)(textContent);
|
|
215
267
|
const match = text.slice(text.lastIndexOf(completer.triggerPrefix)).match(new RegExp(`${safeTrigger}([\u0000-\uFFFF]*)$`));
|