@graph-paper/core
Advanced tools
Comparing version 0.0.0-alpha.6 to 0.0.0-alpha.7
import { tooltip } from "./tooltip"; | ||
import { forwardEvents } from "./forwardEvents"; | ||
export { tooltip }; | ||
export { tooltip, forwardEvents }; |
@@ -1,2 +0,2 @@ | ||
/* eslint-disable import/prefer-default-export */ | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import { listen } from "svelte/internal"; | ||
@@ -10,2 +10,3 @@ import { placeElement } from "../utils/float-placement"; | ||
distance: 4, | ||
visible: true, | ||
}; | ||
@@ -22,2 +23,5 @@ | ||
let { visible } = options; | ||
let entered = false; | ||
function setLocation() { | ||
@@ -37,16 +41,24 @@ const [left, top] = placeElement({ | ||
function append() { | ||
if (el.textContent.length && options.text) { | ||
el.textContent = options.text; | ||
document.body.appendChild(el); | ||
el.style.opacity = "0"; | ||
function updateElement(newText, isVisible) { | ||
el.textContent = newText; | ||
document.body.appendChild(el); | ||
el.style.opacity = "0"; | ||
if (isVisible && entered) { | ||
setTimeout(() => { | ||
el.style.opacity = "1"; | ||
visible = true; | ||
}); | ||
setLocation(); | ||
} | ||
setLocation(); | ||
} | ||
function append() { | ||
entered = true; | ||
if (el.textContent.length && options.text) { | ||
updateElement(options.text, visible); | ||
} | ||
} | ||
function remove() { | ||
entered = false; | ||
el.remove(); | ||
@@ -64,6 +76,7 @@ } | ||
}, | ||
update(args) { | ||
el.textContent = args.text; | ||
update(newArgs) { | ||
visible = newArgs.visible === undefined || newArgs.visible; | ||
updateElement(newArgs.text, visible); | ||
}, | ||
}; | ||
} |
import "./style.css"; | ||
export * from "./base.js"; | ||
export { default } from "./base.js"; |
{ | ||
"name": "@graph-paper/core", | ||
"version": "0.0.0-alpha.6", | ||
"version": "0.0.0-alpha.7", | ||
"description": "__DESCRIPTION_FORTHCOMING__", | ||
"author": "hamilton <hamilton.ulmer@gmail.com>", | ||
"author": "Hamilton Ulmer <hamilton.ulmer@gmail.com>", | ||
"homepage": "", | ||
@@ -18,3 +18,3 @@ "license": "MPL-2.0", | ||
}, | ||
"gitHead": "c6c560ce4670955b065b379082b1cd7f4253d0a7" | ||
"gitHead": "55a013e4c616ff83ba670879b20e3ee8b78df7f5" | ||
} |
// taken from d3-array | ||
function compare(a, b) { | ||
// eslint-disable-next-line no-nested-ternary | ||
return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; | ||
@@ -14,4 +15,4 @@ } | ||
const mid = (lo + hi) >>> 1; // eslint-disable-line | ||
if (compare(+data[mid][key], value) < 0) lo = mid + 1; | ||
else hi = mid; | ||
if (compare(+data[mid][key], value) < 0) lo = mid + 1; // eslint-disable-line | ||
else hi = mid; // eslint-disable-line | ||
} | ||
@@ -18,0 +19,0 @@ return lo; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47645
1176