You've already forked obsidian-visualiser
Rename RedrawableHTML, remove File API rate limite and fix pull job transaction.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import * as FloatingUI from "@floating-ui/dom";
|
||||
import { cancelPropagation, dom, svg, text, type Class, type NodeChildren, type RedrawableHTML } from "./dom";
|
||||
import { cancelPropagation, dom, svg, text, type Class, type NodeChildren, type HTMLElement } from "./dom";
|
||||
import { button } from "./components";
|
||||
import type { Reactive } from "./reactive";
|
||||
|
||||
@@ -10,7 +10,7 @@ export interface FloatingProperties
|
||||
arrow?: boolean;
|
||||
class?: Class;
|
||||
style?: Record<string, string | undefined | boolean | number> | string;
|
||||
viewport?: RedrawableHTML;
|
||||
viewport?: HTMLElement;
|
||||
cover?: 'width' | 'height' | 'all' | 'none';
|
||||
persistant?: boolean;
|
||||
}
|
||||
@@ -41,8 +41,8 @@ export interface ModalProperties
|
||||
onClose?: () => boolean | void;
|
||||
}
|
||||
type ModalInternals = {
|
||||
container: RedrawableHTML;
|
||||
content: RedrawableHTML;
|
||||
container: HTMLElement;
|
||||
content: HTMLElement;
|
||||
stop: Function;
|
||||
start: Function;
|
||||
show: Function;
|
||||
@@ -50,7 +50,7 @@ type ModalInternals = {
|
||||
persistant: boolean;
|
||||
};
|
||||
|
||||
export let teleport: RedrawableHTML, minimizeBox: RedrawableHTML, cache: ModalInternals[] = [], hook: VoidFunction = () => {};
|
||||
export let teleport: HTMLElement, minimizeBox: HTMLElement, cache: ModalInternals[] = [], hook: VoidFunction = () => {};
|
||||
export function init()
|
||||
{
|
||||
dispose();
|
||||
@@ -76,7 +76,7 @@ function clear()
|
||||
cache = cache.filter(e => !(!e.persistant && e.content.remove()));
|
||||
}
|
||||
|
||||
export function popper(container: RedrawableHTML, properties?: PopperProperties)
|
||||
export function popper(container: HTMLElement, properties?: PopperProperties)
|
||||
{
|
||||
let state: FloatState = 'hidden', timeout: Timer;
|
||||
const arrow = svg('svg', { class: ' group-data-[pinned]:hidden absolute fill-light-35 dark:fill-dark-35', attributes: { width: "12", height: "8", viewBox: "0 0 20 10" } }, [svg('polygon', { attributes: { points: "0,0 20,0 10,10" } })]);
|
||||
@@ -233,7 +233,7 @@ export function popper(container: RedrawableHTML, properties?: PopperProperties)
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
|
||||
function link(element: RedrawableHTML) {
|
||||
function link(element: HTMLElement) {
|
||||
(properties?.events?.show ?? ['mouseenter', 'mousemove', 'focus']).forEach((e: keyof HTMLElementEventMap) => element.addEventListener(e, show));
|
||||
(properties?.events?.hide ?? ['mouseleave', 'blur']).forEach((e: keyof HTMLElementEventMap) => element.addEventListener(e, hide));
|
||||
}
|
||||
@@ -384,7 +384,7 @@ export function contextmenu(x: number, y: number, content: NodeChildren, propert
|
||||
},
|
||||
}, content, properties);
|
||||
}
|
||||
export function tooltip(container: RedrawableHTML, txt: string | Text, placement: FloatingUI.Placement, delay?: number): RedrawableHTML
|
||||
export function tooltip(container: HTMLElement, txt: string | Text, placement: FloatingUI.Placement, delay?: number): HTMLElement
|
||||
{
|
||||
return popper(container, {
|
||||
arrow: true,
|
||||
|
||||
Reference in New Issue
Block a user