@github/text-expander-element
Advanced tools
+5
-1
@@ -776,3 +776,7 @@ const ctrlBindings = !!navigator.userAgent.match(/Macintosh/); | ||
| const provide = (result) => providers.push(result); | ||
| const canceled = !this.expander.dispatchEvent(new CustomEvent('text-expander-change', { cancelable: true, detail: { provide, text: match.text, key: match.key } })); | ||
| const changeEvent = new CustomEvent('text-expander-change', { | ||
| cancelable: true, | ||
| detail: { provide, text: match.text, key: match.key } | ||
| }); | ||
| const canceled = !this.expander.dispatchEvent(changeEvent); | ||
| if (canceled) | ||
@@ -779,0 +783,0 @@ return; |
+5
-1
@@ -606,3 +606,7 @@ import Combobox from '@github/combobox-nav'; | ||
| const provide = (result) => providers.push(result); | ||
| const canceled = !this.expander.dispatchEvent(new CustomEvent('text-expander-change', { cancelable: true, detail: { provide, text: match.text, key: match.key } })); | ||
| const changeEvent = new CustomEvent('text-expander-change', { | ||
| cancelable: true, | ||
| detail: { provide, text: match.text, key: match.key } | ||
| }); | ||
| const canceled = !this.expander.dispatchEvent(changeEvent); | ||
| if (canceled) | ||
@@ -609,0 +613,0 @@ return; |
@@ -1,7 +0,23 @@ | ||
| type Key = { | ||
| export type TextExpanderMatch = { | ||
| text: string; | ||
| key: string; | ||
| position: number; | ||
| }; | ||
| export type TextExpanderResult = { | ||
| fragment?: HTMLElement; | ||
| matched: boolean; | ||
| }; | ||
| export type TextExpanderKey = { | ||
| key: string; | ||
| multiWord: boolean; | ||
| }; | ||
| export type TextExpanderChangeEvent = Event & { | ||
| detail?: { | ||
| key: string; | ||
| text: string; | ||
| provide: (result: Promise<TextExpanderResult> | TextExpanderResult) => void; | ||
| }; | ||
| }; | ||
| export default class TextExpanderElement extends HTMLElement { | ||
| get keys(): Key[]; | ||
| get keys(): TextExpanderKey[]; | ||
| set keys(value: string); | ||
@@ -12,2 +28,1 @@ connectedCallback(): void; | ||
| } | ||
| export {}; |
@@ -172,3 +172,7 @@ import Combobox from '@github/combobox-nav'; | ||
| const provide = (result) => providers.push(result); | ||
| const canceled = !this.expander.dispatchEvent(new CustomEvent('text-expander-change', { cancelable: true, detail: { provide, text: match.text, key: match.key } })); | ||
| const changeEvent = new CustomEvent('text-expander-change', { | ||
| cancelable: true, | ||
| detail: { provide, text: match.text, key: match.key } | ||
| }); | ||
| const canceled = !this.expander.dispatchEvent(changeEvent); | ||
| if (canceled) | ||
@@ -175,0 +179,0 @@ return; |
+1
-1
| { | ||
| "name": "@github/text-expander-element", | ||
| "version": "2.8.0", | ||
| "version": "2.9.0", | ||
| "description": "Activates a suggestion menu to expand text snippets as you type.", | ||
@@ -5,0 +5,0 @@ "repository": "github/text-expander-element", |
+1
-1
@@ -110,3 +110,3 @@ # <text-expander> element | ||
| **`text-expander-dectivate`** is fired just before the menu is goind to be unassigned and removed from the DOM. This is useful for removing classes or running cleanup like removing from caches. | ||
| **`text-expander-deactivate`** is fired just before the menu is going to be unassigned and removed from the DOM. This is useful for removing classes or running cleanup like removing from caches. | ||
@@ -113,0 +113,0 @@ ## Browser support |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
79597
0.79%1811
1.51%