Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
* @priority 8
*/
export type Props<Schemes extends BaseSchemes> = {
/** delay before hiding context menu */
/**
* delay before hiding context menu
* @deprecated Use the `delay` option of the rendering plugin preset.
*/
delay?: number
/** menu items, can be produced by preset */
items: Items<Schemes>
Expand Down Expand Up @@ -43,7 +46,7 @@
* @listens contextmenu
* @listens pointerdown
*/
export class ContextMenuPlugin<Schemes extends BaseSchemes> extends Scope<never, [Requires<Schemes> | ContextMenuExtra]> {

Check warning on line 49 in src/index.ts

View workflow job for this annotation

GitHub Actions / ci / ci

This line has a length of 122. Maximum allowed is 120

Check warning on line 49 in src/index.ts

View workflow job for this annotation

GitHub Actions / ci / ci

This line has a length of 122. Maximum allowed is 120
/**
* @param props Properties
*/
Expand All @@ -55,9 +58,9 @@
super.setParent(scope)

const area = this.parentScope<BaseAreaPlugin<Schemes, BaseArea<Schemes>>>(BaseAreaPlugin)
const container: HTMLElement = (area as any).container

Check warning on line 61 in src/index.ts

View workflow job for this annotation

GitHub Actions / ci / ci

Unsafe assignment of an `any` value

Check warning on line 61 in src/index.ts

View workflow job for this annotation

GitHub Actions / ci / ci

The 'area as any' has unsafe 'as' type assertion

Check warning on line 61 in src/index.ts

View workflow job for this annotation

GitHub Actions / ci / ci

Unexpected any. Specify a different type

Check warning on line 61 in src/index.ts

View workflow job for this annotation

GitHub Actions / ci / ci

Unsafe member access .container on an `any` value

Check warning on line 61 in src/index.ts

View workflow job for this annotation

GitHub Actions / ci / ci

The type of 'container' is 'any'

Check warning on line 61 in src/index.ts

View workflow job for this annotation

GitHub Actions / ci / ci

Unsafe assignment of an `any` value

Check warning on line 61 in src/index.ts

View workflow job for this annotation

GitHub Actions / ci / ci

The 'area as any' has unsafe 'as' type assertion

Check warning on line 61 in src/index.ts

View workflow job for this annotation

GitHub Actions / ci / ci

Unexpected any. Specify a different type

Check warning on line 61 in src/index.ts

View workflow job for this annotation

GitHub Actions / ci / ci

Unsafe member access .container on an `any` value

Check warning on line 61 in src/index.ts

View workflow job for this annotation

GitHub Actions / ci / ci

The type of 'container' is 'any'

if (!container || !(container instanceof HTMLElement)) throw new Error('container expected')

Check warning on line 63 in src/index.ts

View workflow job for this annotation

GitHub Actions / ci / ci

Unnecessary conditional, value is always falsy

Check warning on line 63 in src/index.ts

View workflow job for this annotation

GitHub Actions / ci / ci

Unnecessary conditional, value is always falsy

const element = document.createElement('div')

Expand All @@ -68,7 +71,7 @@
this.addPipe(context => {
const parent = this.parentScope()

if (!context || typeof context !== 'object' || !('type' in context)) return context

Check warning on line 74 in src/index.ts

View workflow job for this annotation

GitHub Actions / ci / ci

Unnecessary conditional, value is always falsy

Check warning on line 74 in src/index.ts

View workflow job for this annotation

GitHub Actions / ci / ci

Unnecessary conditional, value is always falsy
if (context.type === 'unmount') {
if (context.data.element === element) {
element.style.display = 'none'
Expand Down
Loading