1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00

npm update

This commit is contained in:
Daniel Neto 2023-08-12 10:32:47 -03:00
parent 0cdd3e9fee
commit 4696ba952f
1437 changed files with 32727 additions and 1248226 deletions

View file

@ -1,98 +1,8 @@
import * as _codemirror_state from '@codemirror/state';
import { EditorState, TransactionSpec, Transaction, StateCommand, Facet, Extension, StateEffect } from '@codemirror/state';
import { EditorView, KeyBinding, Command } from '@codemirror/view';
import { EditorView, Rect, KeyBinding, Command } from '@codemirror/view';
import * as _lezer_common from '@lezer/common';
interface CompletionConfig {
/**
When enabled (defaults to true), autocompletion will start
whenever the user types something that can be completed.
*/
activateOnTyping?: boolean;
/**
By default, when completion opens, the first option is selected
and can be confirmed with
[`acceptCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.acceptCompletion). When this
is set to false, the completion widget starts with no completion
selected, and the user has to explicitly move to a completion
before you can confirm one.
*/
selectOnOpen?: boolean;
/**
Override the completion sources used. By default, they will be
taken from the `"autocomplete"` [language
data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt) (which should hold
[completion sources](https://codemirror.net/6/docs/ref/#autocomplete.CompletionSource) or arrays
of [completions](https://codemirror.net/6/docs/ref/#autocomplete.Completion)).
*/
override?: readonly CompletionSource[] | null;
/**
Determines whether the completion tooltip is closed when the
editor loses focus. Defaults to true.
*/
closeOnBlur?: boolean;
/**
The maximum number of options to render to the DOM.
*/
maxRenderedOptions?: number;
/**
Set this to false to disable the [default completion
keymap](https://codemirror.net/6/docs/ref/#autocomplete.completionKeymap). (This requires you to
add bindings to control completion yourself. The bindings should
probably have a higher precedence than other bindings for the
same keys.)
*/
defaultKeymap?: boolean;
/**
By default, completions are shown below the cursor when there is
space. Setting this to true will make the extension put the
completions above the cursor when possible.
*/
aboveCursor?: boolean;
/**
When given, this may return an additional CSS class to add to
the completion dialog element.
*/
tooltipClass?: (state: EditorState) => string;
/**
This can be used to add additional CSS classes to completion
options.
*/
optionClass?: (completion: Completion) => string;
/**
By default, the library will render icons based on the
completion's [type](https://codemirror.net/6/docs/ref/#autocomplete.Completion.type) in front of
each option. Set this to false to turn that off.
*/
icons?: boolean;
/**
This option can be used to inject additional content into
options. The `render` function will be called for each visible
completion, and should produce a DOM node to show. `position`
determines where in the DOM the result appears, relative to
other added widgets and the standard content. The default icons
have position 20, the label position 50, and the detail position
80.
*/
addToOptions?: {
render: (completion: Completion, state: EditorState) => Node | null;
position: number;
}[];
/**
The comparison function to use when sorting completions with the same
match score. Defaults to using
[`localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare).
*/
compareCompletions?: (a: Completion, b: Completion) => number;
/**
By default, commands relating to an open completion only take
effect 75 milliseconds after the completion opened, so that key
presses made before the user is aware of the tooltip don't go to
the tooltip. This option can be used to configure that delay.
*/
interactionDelay?: number;
}
/**
Objects type used to represent individual completions.
*/
@ -104,6 +14,13 @@ interface Completion {
*/
label: string;
/**
An optional override for the completion's visible label. When
using this, matched characters will only be highlighted if you
provide a [`getMatch`](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult.getMatch)
function.
*/
displayLabel?: string;
/**
An optional short piece of information to show (with a different
style) after the label.
*/
@ -113,7 +30,7 @@ interface Completion {
a plain string or a function that'll render the DOM structure to
show when invoked.
*/
info?: string | ((completion: Completion) => (Node | null | Promise<Node | null>));
info?: string | ((completion: Completion) => CompletionInfo | Promise<CompletionInfo>);
/**
How to apply the completion. The default is to replace it with
its [label](https://codemirror.net/6/docs/ref/#autocomplete.Completion.label). When this holds a
@ -143,6 +60,49 @@ interface Completion {
down the list, a positive number moves it up.
*/
boost?: number;
/**
Can be used to divide the completion list into sections.
Completions in a given section (matched by name) will be grouped
together, with a heading above them. Options without section
will appear above all sections. A string value is equivalent to
a `{name}` object.
*/
section?: string | CompletionSection;
}
/**
The type returned from
[`Completion.info`](https://codemirror.net/6/docs/ref/#autocomplete.Completion.info). May be a DOM
node, null to indicate there is no info, or an object with an
optional `destroy` method that cleans up the node.
*/
declare type CompletionInfo = Node | null | {
dom: Node;
destroy?(): void;
};
/**
Object used to describe a completion
[section](https://codemirror.net/6/docs/ref/#autocomplete.Completion.section). It is recommended to
create a shared object used by all the completions in a given
section.
*/
interface CompletionSection {
/**
The name of the section. If no `render` method is present, this
will be displayed above the options.
*/
name: string;
/**
An optional function that renders the section header. Since the
headers are shown inside a list, you should make sure the
resulting element has a `display: list-item` style.
*/
header?: (section: CompletionSection) => HTMLElement;
/**
By default, sections are ordered alphabetically by name. To
specify an explicit order, `rank` can be used. Sections with a
lower rank will be shown above sections with a higher rank.
*/
rank?: number;
}
/**
An instance of this is passed to completion source functions.
@ -277,12 +237,15 @@ interface CompletionResult {
filter?: boolean;
/**
When [`filter`](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult.filter) is set to
`false`, this may be provided to compute the ranges on the label
that match the input. Should return an array of numbers where
each pair of adjacent numbers provide the start and end of a
range.
`false` or a completion has a
[`displayLabel`](https://codemirror.net/6/docs/ref/#autocomplete.Completion.displayLabel), this
may be provided to compute the ranges on the label that match
the input. Should return an array of numbers where each pair of
adjacent numbers provide the start and end of a range. The
second argument, the match found by the library, is only passed
when `filter` isn't `false`.
*/
getMatch?: (completion: Completion) => readonly number[];
getMatch?: (completion: Completion, matched?: readonly number[]) => readonly number[];
/**
Synchronously update the completion result after typing or
deletion. If given, this should not do any expensive work, since
@ -305,6 +268,109 @@ selection range that has the same text in front of it.
*/
declare function insertCompletionText(state: EditorState, text: string, from: number, to: number): TransactionSpec;
interface CompletionConfig {
/**
When enabled (defaults to true), autocompletion will start
whenever the user types something that can be completed.
*/
activateOnTyping?: boolean;
/**
By default, when completion opens, the first option is selected
and can be confirmed with
[`acceptCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.acceptCompletion). When this
is set to false, the completion widget starts with no completion
selected, and the user has to explicitly move to a completion
before you can confirm one.
*/
selectOnOpen?: boolean;
/**
Override the completion sources used. By default, they will be
taken from the `"autocomplete"` [language
data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt) (which should hold
[completion sources](https://codemirror.net/6/docs/ref/#autocomplete.CompletionSource) or arrays
of [completions](https://codemirror.net/6/docs/ref/#autocomplete.Completion)).
*/
override?: readonly CompletionSource[] | null;
/**
Determines whether the completion tooltip is closed when the
editor loses focus. Defaults to true.
*/
closeOnBlur?: boolean;
/**
The maximum number of options to render to the DOM.
*/
maxRenderedOptions?: number;
/**
Set this to false to disable the [default completion
keymap](https://codemirror.net/6/docs/ref/#autocomplete.completionKeymap). (This requires you to
add bindings to control completion yourself. The bindings should
probably have a higher precedence than other bindings for the
same keys.)
*/
defaultKeymap?: boolean;
/**
By default, completions are shown below the cursor when there is
space. Setting this to true will make the extension put the
completions above the cursor when possible.
*/
aboveCursor?: boolean;
/**
When given, this may return an additional CSS class to add to
the completion dialog element.
*/
tooltipClass?: (state: EditorState) => string;
/**
This can be used to add additional CSS classes to completion
options.
*/
optionClass?: (completion: Completion) => string;
/**
By default, the library will render icons based on the
completion's [type](https://codemirror.net/6/docs/ref/#autocomplete.Completion.type) in front of
each option. Set this to false to turn that off.
*/
icons?: boolean;
/**
This option can be used to inject additional content into
options. The `render` function will be called for each visible
completion, and should produce a DOM node to show. `position`
determines where in the DOM the result appears, relative to
other added widgets and the standard content. The default icons
have position 20, the label position 50, and the detail position
80.
*/
addToOptions?: {
render: (completion: Completion, state: EditorState) => Node | null;
position: number;
}[];
/**
By default, [info](https://codemirror.net/6/docs/ref/#autocomplet.Completion.info) tooltips are
placed to the side of the selected. This option can be used to
override that. It will be given rectangles for the list of
completions, the selected option, the info element, and the
availble [tooltip space](https://codemirror.net/6/docs/ref/#view.tooltips^config.tooltipSpace),
and should return style and/or class strings for the info
element.
*/
positionInfo?: (view: EditorView, list: Rect, option: Rect, info: Rect, space: Rect) => {
style?: string;
class?: string;
};
/**
The comparison function to use when sorting completions with the same
match score. Defaults to using
[`localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare).
*/
compareCompletions?: (a: Completion, b: Completion) => number;
/**
By default, commands relating to an open completion only take
effect 75 milliseconds after the completion opened, so that key
presses made before the user is aware of the tooltip don't go to
the tooltip. This option can be used to configure that delay.
*/
interactionDelay?: number;
}
/**
Convert a snippet template to a function that can
[apply](https://codemirror.net/6/docs/ref/#autocomplete.Completion.apply) it. Snippets are written
@ -338,7 +404,7 @@ interpreted as indicating a placeholder.
declare function snippet(template: string): (editor: {
state: EditorState;
dispatch: (tr: Transaction) => void;
}, _completion: Completion, from: number, to: number) => void;
}, completion: Completion | null, from: number, to: number) => void;
/**
A command that clears the active snippet, if any.
*/
@ -352,6 +418,16 @@ Move to the previous snippet field, if available.
*/
declare const prevSnippetField: StateCommand;
/**
Check if there is an active snippet with a next field for
`nextSnippetField` to move to.
*/
declare function hasNextSnippetField(state: EditorState): boolean;
/**
Returns true if there is an active snippet and a previous field
for `prevSnippetField` to move to.
*/
declare function hasPrevSnippetField(state: EditorState): boolean;
/**
A facet that can be used to configure the key bindings used by
snippets. The default binds Tab to
[`nextSnippetField`](https://codemirror.net/6/docs/ref/#autocomplete.nextSnippetField), Shift-Tab to
@ -488,4 +564,4 @@ the currently selected completion.
*/
declare function setSelectedCompletion(index: number): StateEffect<unknown>;
export { CloseBracketConfig, Completion, CompletionContext, CompletionResult, CompletionSource, acceptCompletion, autocompletion, clearSnippet, closeBrackets, closeBracketsKeymap, closeCompletion, completeAnyWord, completeFromList, completionKeymap, completionStatus, currentCompletions, deleteBracketPair, ifIn, ifNotIn, insertBracket, insertCompletionText, moveCompletionSelection, nextSnippetField, pickedCompletion, prevSnippetField, selectedCompletion, selectedCompletionIndex, setSelectedCompletion, snippet, snippetCompletion, snippetKeymap, startCompletion };
export { CloseBracketConfig, Completion, CompletionContext, CompletionInfo, CompletionResult, CompletionSection, CompletionSource, acceptCompletion, autocompletion, clearSnippet, closeBrackets, closeBracketsKeymap, closeCompletion, completeAnyWord, completeFromList, completionKeymap, completionStatus, currentCompletions, deleteBracketPair, hasNextSnippetField, hasPrevSnippetField, ifIn, ifNotIn, insertBracket, insertCompletionText, moveCompletionSelection, nextSnippetField, pickedCompletion, prevSnippetField, selectedCompletion, selectedCompletionIndex, setSelectedCompletion, snippet, snippetCompletion, snippetKeymap, startCompletion };