@yorozu/context-menu 0.5.6 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +9 -2
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -314,6 +314,9 @@ function animateElement(el, keyframes, options) {
|
|
|
314
314
|
return el.animate(keyframes, options);
|
|
315
315
|
}
|
|
316
316
|
//#endregion
|
|
317
|
+
//#region ../animations/src/core/motion-timing.ts
|
|
318
|
+
var MOTION_EASE_OUT = "ease-out";
|
|
319
|
+
//#endregion
|
|
317
320
|
//#region ../animations/src/core/styles.ts
|
|
318
321
|
function applyStyles(el, styles) {
|
|
319
322
|
for (let key in styles) el.style.setProperty(key, styles[key]);
|
|
@@ -321,6 +324,10 @@ function applyStyles(el, styles) {
|
|
|
321
324
|
function clearStyles(el, keys) {
|
|
322
325
|
for (let key of keys) el.style.removeProperty(key);
|
|
323
326
|
}
|
|
327
|
+
//#endregion
|
|
328
|
+
//#region ../animations/src/popover/popover.ts
|
|
329
|
+
var POPOVER_MS = 200;
|
|
330
|
+
var POPOVER_EASING = MOTION_EASE_OUT;
|
|
324
331
|
function closedFrame(scale) {
|
|
325
332
|
return {
|
|
326
333
|
transform: `scale(${scale})`,
|
|
@@ -335,8 +342,8 @@ var STYLE_KEYS = ["will-change"];
|
|
|
335
342
|
function createPopover(config) {
|
|
336
343
|
let lastOrigin = config?.origin ?? "center top";
|
|
337
344
|
let lastScale = config?.scale ?? .92;
|
|
338
|
-
let defaultDuration = config?.durationMs ??
|
|
339
|
-
let defaultEasing = config?.easing ??
|
|
345
|
+
let defaultDuration = config?.durationMs ?? POPOVER_MS;
|
|
346
|
+
let defaultEasing = config?.easing ?? POPOVER_EASING;
|
|
340
347
|
let current = null;
|
|
341
348
|
let stopCurrent = () => {
|
|
342
349
|
if (!current) return;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yorozu/context-menu",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.31",
|
|
5
5
|
"description": "framework-agnostic pointer-menu placement, motion, and session",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@yorozu/animations": "^0.
|
|
8
|
+
"@yorozu/animations": "^1.0.31"
|
|
9
9
|
},
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|