UNPKG

@wordpress/components

Version:
8 lines (7 loc) 18.2 kB
{ "version": 3, "sources": ["../../src/autocomplete/index.tsx"], "sourcesContent": ["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport { renderToString, useEffect, useState, useRef, useMemo } from '@wordpress/element';\nimport { useInstanceId, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { create, slice, insert, isCollapsed, getTextContent } from '@wordpress/rich-text';\nimport { speak } from '@wordpress/a11y';\nimport { isAppleOS } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { getAutoCompleterUI } from './autocompleter-ui';\nimport { escapeRegExp } from '../utils/strings';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\nimport getNodeText from '../utils/get-node-text';\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst EMPTY_FILTERED_OPTIONS = [];\n\n// Used for generating the instance ID\nconst AUTOCOMPLETE_HOOK_REFERENCE = {};\nexport function useAutocomplete({\n record,\n onChange,\n onReplace,\n completers,\n contentRef\n}) {\n const instanceId = useInstanceId(AUTOCOMPLETE_HOOK_REFERENCE);\n const [selectedIndex, setSelectedIndex] = useState(0);\n const [filteredOptions, setFilteredOptions] = useState(EMPTY_FILTERED_OPTIONS);\n const [filterValue, setFilterValue] = useState('');\n const [autocompleter, setAutocompleter] = useState(null);\n const [AutocompleterUI, setAutocompleterUI] = useState(null);\n const backspacingRef = useRef(false);\n function insertCompletion(replacement) {\n if (autocompleter === null) {\n return;\n }\n const end = record.start;\n const start = end - autocompleter.triggerPrefix.length - filterValue.length;\n const toInsert = create({\n html: renderToString(replacement)\n });\n onChange(insert(record, toInsert, start, end));\n }\n function select(option) {\n const {\n getOptionCompletion\n } = autocompleter || {};\n if (option.isDisabled) {\n return;\n }\n if (getOptionCompletion) {\n const completion = getOptionCompletion(option.value, filterValue);\n const isCompletionObject = obj => {\n return obj !== null && typeof obj === 'object' && 'action' in obj && obj.action !== undefined && 'value' in obj && obj.value !== undefined;\n };\n const completionObject = isCompletionObject(completion) ? completion : {\n action: 'insert-at-caret',\n value: completion\n };\n if ('replace' === completionObject.action) {\n onReplace([completionObject.value]);\n // When replacing, the component will unmount, so don't reset\n // state (below) on an unmounted component.\n return;\n } else if ('insert-at-caret' === completionObject.action) {\n insertCompletion(completionObject.value);\n }\n }\n\n // Reset autocomplete state after insertion rather than before\n // so insertion events don't cause the completion menu to redisplay.\n reset();\n\n // Make sure that the content remains focused after making a selection\n // and that the text cursor position is not lost.\n contentRef.current?.focus();\n }\n function reset() {\n setSelectedIndex(0);\n setFilteredOptions(EMPTY_FILTERED_OPTIONS);\n setFilterValue('');\n setAutocompleter(null);\n setAutocompleterUI(null);\n }\n\n /**\n * Load options for an autocompleter.\n *\n * @param {Array} options\n */\n function onChangeOptions(options) {\n setSelectedIndex(options.length === filteredOptions.length ? selectedIndex : 0);\n setFilteredOptions(options);\n }\n function handleKeyDown(event) {\n backspacingRef.current = event.key === 'Backspace';\n if (!autocompleter) {\n return;\n }\n if (filteredOptions.length === 0) {\n return;\n }\n if (event.defaultPrevented) {\n return;\n }\n switch (event.key) {\n case 'ArrowUp':\n {\n const newIndex = (selectedIndex === 0 ? filteredOptions.length : selectedIndex) - 1;\n setSelectedIndex(newIndex);\n // See the related PR as to why this is necessary: https://github.com/WordPress/gutenberg/pull/54902.\n if (isAppleOS()) {\n speak(getNodeText(filteredOptions[newIndex].label), 'assertive');\n }\n break;\n }\n case 'ArrowDown':\n {\n const newIndex = (selectedIndex + 1) % filteredOptions.length;\n setSelectedIndex(newIndex);\n if (isAppleOS()) {\n speak(getNodeText(filteredOptions[newIndex].label), 'assertive');\n }\n break;\n }\n case 'Escape':\n setAutocompleter(null);\n setAutocompleterUI(null);\n event.preventDefault();\n break;\n case 'Enter':\n select(filteredOptions[selectedIndex]);\n break;\n case 'ArrowLeft':\n case 'ArrowRight':\n reset();\n return;\n default:\n return;\n }\n\n // Any handled key should prevent original behavior. This relies on\n // the early return in the default case.\n event.preventDefault();\n }\n\n // textContent is a primitive (string), memoizing is not strictly necessary\n // but this is a preemptive performance improvement, since the autocompleter\n // is a potential bottleneck for the editor type metric.\n const textContent = useMemo(() => {\n if (isCollapsed(record)) {\n return getTextContent(slice(record, 0));\n }\n return '';\n }, [record]);\n useEffect(() => {\n if (!textContent) {\n if (autocompleter) {\n reset();\n }\n return;\n }\n\n // Find the completer with the highest triggerPrefix index in the\n // textContent.\n const completer = completers.reduce((lastTrigger, currentCompleter) => {\n const triggerIndex = textContent.lastIndexOf(currentCompleter.triggerPrefix);\n const lastTriggerIndex = lastTrigger !== null ? textContent.lastIndexOf(lastTrigger.triggerPrefix) : -1;\n return triggerIndex > lastTriggerIndex ? currentCompleter : lastTrigger;\n }, null);\n if (!completer) {\n if (autocompleter) {\n reset();\n }\n return;\n }\n const {\n allowContext,\n triggerPrefix\n } = completer;\n const triggerIndex = textContent.lastIndexOf(triggerPrefix);\n const textWithoutTrigger = textContent.slice(triggerIndex + triggerPrefix.length);\n const tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit.\n // This is a final barrier to prevent the effect from completing with\n // an extremely long string, which causes the editor to slow-down\n // significantly. This could happen, for example, if `matchingWhileBackspacing`\n // is true and one of the \"words\" end up being too long. If that's the case,\n // it will be caught by this guard.\n if (tooDistantFromTrigger) {\n return;\n }\n const mismatch = filteredOptions.length === 0;\n const wordsFromTrigger = textWithoutTrigger.split(/\\s/);\n // We need to allow the effect to run when not backspacing and if there\n // was a mismatch. i.e when typing a trigger + the match string or when\n // clicking in an existing trigger word on the page. We do that if we\n // detect that we have one word from trigger in the current textual context.\n //\n // Ex.: \"Some text @a\" <-- \"@a\" will be detected as the trigger word and\n // allow the effect to run. It will run until there's a mismatch.\n const hasOneTriggerWord = wordsFromTrigger.length === 1;\n // This is used to allow the effect to run when backspacing and if\n // \"touching\" a word that \"belongs\" to a trigger. We consider a \"trigger\n // word\" any word up to the limit of 3 from the trigger character.\n // Anything beyond that is ignored if there's a mismatch. This allows\n // us to \"escape\" a mismatch when backspacing, but still imposing some\n // sane limits.\n //\n // Ex: \"Some text @marcelo sekkkk\" <--- \"kkkk\" caused a mismatch, but\n // if the user presses backspace here, it will show the completion popup again.\n const matchingWhileBackspacing = backspacingRef.current && wordsFromTrigger.length <= 3;\n if (mismatch && !(matchingWhileBackspacing || hasOneTriggerWord)) {\n if (autocompleter) {\n reset();\n }\n return;\n }\n const textAfterSelection = getTextContent(slice(record, undefined, getTextContent(record).length));\n if (allowContext && !allowContext(textContent.slice(0, triggerIndex), textAfterSelection)) {\n if (autocompleter) {\n reset();\n }\n return;\n }\n if (/^\\s/.test(textWithoutTrigger) || /\\s\\s+$/.test(textWithoutTrigger)) {\n if (autocompleter) {\n reset();\n }\n return;\n }\n if (!/[\\u0000-\\uFFFF]*$/.test(textWithoutTrigger)) {\n if (autocompleter) {\n reset();\n }\n return;\n }\n const safeTrigger = escapeRegExp(completer.triggerPrefix);\n const text = removeAccents(textContent);\n const match = text.slice(text.lastIndexOf(completer.triggerPrefix)).match(new RegExp(`${safeTrigger}([\\u0000-\\uFFFF]*)$`));\n const query = match && match[1];\n setAutocompleter(completer);\n setAutocompleterUI(() => completer !== autocompleter ? getAutoCompleterUI(completer) : AutocompleterUI);\n setFilterValue(query === null ? '' : query);\n // We want to avoid introducing unexpected side effects.\n // See https://github.com/WordPress/gutenberg/pull/41820\n }, [textContent]);\n const {\n key: selectedKey = ''\n } = filteredOptions[selectedIndex] || {};\n const {\n className\n } = autocompleter || {};\n const isExpanded = !!autocompleter && filteredOptions.length > 0;\n const listBoxId = isExpanded ? `components-autocomplete-listbox-${instanceId}` : undefined;\n const activeId = isExpanded ? `components-autocomplete-item-${instanceId}-${selectedKey}` : null;\n const hasSelection = record.start !== undefined;\n const showPopover = !!textContent && hasSelection && !!AutocompleterUI;\n return {\n listBoxId,\n activeId,\n onKeyDown: withIgnoreIMEEvents(handleKeyDown),\n popover: showPopover && /*#__PURE__*/_jsx(AutocompleterUI, {\n className: className,\n filterValue: filterValue,\n instanceId: instanceId,\n listBoxId: listBoxId,\n selectedIndex: selectedIndex,\n onChangeOptions: onChangeOptions,\n onSelect: select,\n value: record,\n contentRef: contentRef,\n reset: reset\n })\n };\n}\nfunction useLastDifferentValue(value) {\n const history = useRef(new Set());\n history.current.add(value);\n\n // Keep the history size to 2.\n if (history.current.size > 2) {\n history.current.delete(Array.from(history.current)[0]);\n }\n return Array.from(history.current)[0];\n}\nexport function useAutocompleteProps(options) {\n const ref = useRef(null);\n const onKeyDownRef = useRef(undefined);\n const {\n record\n } = options;\n const previousRecord = useLastDifferentValue(record);\n const {\n popover,\n listBoxId,\n activeId,\n onKeyDown\n } = useAutocomplete({\n ...options,\n contentRef: ref\n });\n onKeyDownRef.current = onKeyDown;\n const mergedRefs = useMergeRefs([ref, useRefEffect(element => {\n function _onKeyDown(event) {\n onKeyDownRef.current?.(event);\n }\n element.addEventListener('keydown', _onKeyDown);\n return () => {\n element.removeEventListener('keydown', _onKeyDown);\n };\n }, [])]);\n\n // We only want to show the popover if the user has typed something.\n const didUserInput = record.text !== previousRecord?.text;\n if (!didUserInput) {\n return {\n ref: mergedRefs\n };\n }\n return {\n ref: mergedRefs,\n children: popover,\n 'aria-autocomplete': listBoxId ? 'list' : undefined,\n 'aria-owns': listBoxId,\n 'aria-activedescendant': activeId\n };\n}\nexport default function Autocomplete({\n children,\n isSelected,\n ...options\n}) {\n const {\n popover,\n ...props\n } = useAutocomplete(options);\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [children(props), isSelected && popover]\n });\n}"], "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,4BAA0B;AAK1B,qBAAqE;AACrE,qBAA0D;AAC1D,uBAAmE;AACnE,kBAAsB;AACtB,sBAA0B;AAK1B,8BAAmC;AACnC,qBAA6B;AAC7B,oCAAoC;AACpC,2BAAw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