New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

animate-presence

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

animate-presence - npm Package Compare versions

Comparing version 0.0.0-379153f to 0.0.0-4adf64f

dist/animate-presence/p-25043722.system.js

2

dist/animate-presence/animate-presence.esm.js

@@ -1,1 +0,1 @@

import{p as e,b as t}from"./p-ddf6632f.js";e().then(e=>t([["p-iwgqoyrr",[[1,"animate-presence",{__presenceKey:[1,"__presence-key"],descendants:[16],observe:[1028],orchestrate:[1],orchestrateEnter:[1,"orchestrate-enter"],orchestrateExit:[1,"orchestrate-exit"],registerChild:[64],unregisterChild:[64],exit:[64],enter:[64]},[[0,"animatePresenceExitComplete","animatePresenceExitCompleteHandler"]]]]],["p-bzzfld0s",[[4,"animated-route-switch",{group:[513],routeViewsUpdated:[16],scrollTopOffset:[2,"scroll-top-offset"],location:[16]}]]]],e));
import{p as e,b as t}from"./p-ddf6632f.js";e().then(e=>t([["p-zpelr2bd",[[1,"animate-presence",{__presenceKey:[1,"__presence-key"],descendants:[16],observe:[1028],registerChild:[64],unregisterChild:[64],exit:[64],enter:[64]},[[0,"animatePresenceExitComplete","animatePresenceExitCompleteHandler"]]]]],["p-a210pu2g",[[4,"animated-route-switch",{group:[513],routeViewsUpdated:[16],scrollTopOffset:[2,"scroll-top-offset"],location:[16]}]]]],e));

@@ -1,1 +0,1 @@

System.register(["./p-f92d870d.system.js"],(function(){"use strict";var e,t;return{setters:[function(r){e=r.p;t=r.b}],execute:function(){e().then((function(e){return t([["p-dxkrgjo6.system",[[1,"animate-presence",{__presenceKey:[1,"__presence-key"],descendants:[16],observe:[1028],orchestrate:[1],orchestrateEnter:[1,"orchestrate-enter"],orchestrateExit:[1,"orchestrate-exit"],registerChild:[64],unregisterChild:[64],exit:[64],enter:[64]},[[0,"animatePresenceExitComplete","animatePresenceExitCompleteHandler"]]]]],["p-1d1wj2w9.system",[[4,"animated-route-switch",{group:[513],routeViewsUpdated:[16],scrollTopOffset:[2,"scroll-top-offset"],location:[16]}]]]],e)}))}}}));
System.register(["./p-f92d870d.system.js"],(function(){"use strict";var e,t;return{setters:[function(s){e=s.p;t=s.b}],execute:function(){e().then((function(e){return t([["p-qctjrjic.system",[[1,"animate-presence",{__presenceKey:[1,"__presence-key"],descendants:[16],observe:[1028],registerChild:[64],unregisterChild:[64],exit:[64],enter:[64]},[[0,"animatePresenceExitComplete","animatePresenceExitCompleteHandler"]]]]],["p-6ysgg7xi.system",[[4,"animated-route-switch",{group:[513],routeViewsUpdated:[16],scrollTopOffset:[2,"scroll-top-offset"],location:[16]}]]]],e)}))}}}));

@@ -7,3 +7,3 @@ 'use strict';

require('./presence-handler-28bf26d6.js');
const index = require('./index-f1960680.js');
const index = require('./index-a7f4001b.js');

@@ -55,3 +55,3 @@ const hold = (el) => async (cb) => {

async componentWillLoad() {
var _a, _b, _c, _d, _e, _f, _g, _h;
var _a, _b;
index.injectGlobalStyle();

@@ -62,11 +62,2 @@ this.ancestor = this.getClosestParent();

}
if (typeof this.orchestrate === 'undefined') {
this.orchestrate = (_d = (_c = this.ancestor) === null || _c === void 0 ? void 0 : _c.orchestrate, (_d !== null && _d !== void 0 ? _d : 'sequential'));
}
if (typeof this.orchestrateEnter === 'undefined') {
this.orchestrateEnter = (_f = (_e = this.ancestor) === null || _e === void 0 ? void 0 : _e.orchestrateEnter, (_f !== null && _f !== void 0 ? _f : this.orchestrate));
}
if (typeof this.orchestrateExit === 'undefined') {
this.orchestrateExit = (_h = (_g = this.ancestor) === null || _g === void 0 ? void 0 : _g.orchestrateExit, (_h !== null && _h !== void 0 ? _h : this.orchestrate));
}
Array.from(this.element.children).map((el, i) => {

@@ -105,3 +96,3 @@ index.setCustomProperties(el, { i });

index.setCustomProperties(el, { i });
const enter = () => index.presence(el, {
await index.presence(el, {
afterSelf: async () => {

@@ -113,42 +104,27 @@ delete el.dataset.initial;

});
if (this.orchestrateEnter === 'sequential') {
await enter();
await index.enterChildren(el);
}
else if (this.orchestrateEnter === 'parallel') {
await Promise.all([enter(), index.enterChildren(el)]);
}
return Promise.resolve();
return index.enterChildren(el);
}
async exitNode(el, method = 'remove', i = 0) {
const exit = () => {
delete el.dataset.willExit;
index.setCustomProperties(el, { i });
const event = new CustomEvent('animatePresenceExit', {
bubbles: true,
detail: {
i,
hold: hold(el),
},
});
el.dispatchEvent(event);
el.dataset.exit = '';
return index.presence(el, {
afterSelf: () => {
if (method === 'remove') {
el.remove();
}
else if (method === 'hide') {
el.style.setProperty('visibility', 'hidden');
}
},
});
};
if (this.orchestrateExit === 'sequential') {
await index.exitChildren(el);
await exit();
}
else if (this.orchestrateExit === 'parallel') {
await Promise.all([index.exitChildren(el), exit()]);
}
await index.exitChildren(el);
delete el.dataset.willExit;
index.setCustomProperties(el, { i });
const event = new CustomEvent('animatePresenceExit', {
bubbles: true,
detail: {
i,
hold: hold(el),
},
});
el.dispatchEvent(event);
el.dataset.exit = '';
await index.presence(el, {
afterSelf: () => {
if (method === 'remove') {
el.remove();
}
else if (method === 'hide') {
el.style.setProperty('visibility', 'hidden');
}
},
});
return Promise.resolve();

@@ -155,0 +131,0 @@ }

@@ -6,3 +6,3 @@ 'use strict';

core.patchBrowser().then(options => {
return core.bootstrapLazy([["animate-presence.cjs",[[1,"animate-presence",{"__presenceKey":[1,"__presence-key"],"descendants":[16],"observe":[1028],"orchestrate":[1],"orchestrateEnter":[1,"orchestrate-enter"],"orchestrateExit":[1,"orchestrate-exit"],"registerChild":[64],"unregisterChild":[64],"exit":[64],"enter":[64]},[[0,"animatePresenceExitComplete","animatePresenceExitCompleteHandler"]]]]],["animated-route-switch.cjs",[[4,"animated-route-switch",{"group":[513],"routeViewsUpdated":[16],"scrollTopOffset":[2,"scroll-top-offset"],"location":[16]}]]]], options);
return core.bootstrapLazy([["animate-presence.cjs",[[1,"animate-presence",{"__presenceKey":[1,"__presence-key"],"descendants":[16],"observe":[1028],"registerChild":[64],"unregisterChild":[64],"exit":[64],"enter":[64]},[[0,"animatePresenceExitComplete","animatePresenceExitCompleteHandler"]]]]],["animated-route-switch.cjs",[[4,"animated-route-switch",{"group":[513],"routeViewsUpdated":[16],"scrollTopOffset":[2,"scroll-top-offset"],"location":[16]}]]]], options);
});

@@ -7,3 +7,3 @@ 'use strict';

require('./presence-handler-28bf26d6.js');
const index = require('./index-f1960680.js');
const index = require('./index-a7f4001b.js');

@@ -10,0 +10,0 @@ /**

@@ -9,3 +9,3 @@ 'use strict';

return core.patchEsm().then(() => {
core.bootstrapLazy([["animate-presence.cjs",[[1,"animate-presence",{"__presenceKey":[1,"__presence-key"],"descendants":[16],"observe":[1028],"orchestrate":[1],"orchestrateEnter":[1,"orchestrate-enter"],"orchestrateExit":[1,"orchestrate-exit"],"registerChild":[64],"unregisterChild":[64],"exit":[64],"enter":[64]},[[0,"animatePresenceExitComplete","animatePresenceExitCompleteHandler"]]]]],["animated-route-switch.cjs",[[4,"animated-route-switch",{"group":[513],"routeViewsUpdated":[16],"scrollTopOffset":[2,"scroll-top-offset"],"location":[16]}]]]], options);
core.bootstrapLazy([["animate-presence.cjs",[[1,"animate-presence",{"__presenceKey":[1,"__presence-key"],"descendants":[16],"observe":[1028],"registerChild":[64],"unregisterChild":[64],"exit":[64],"enter":[64]},[[0,"animatePresenceExitComplete","animatePresenceExitCompleteHandler"]]]]],["animated-route-switch.cjs",[[4,"animated-route-switch",{"group":[513],"routeViewsUpdated":[16],"scrollTopOffset":[2,"scroll-top-offset"],"location":[16]}]]]], options);
});

@@ -12,0 +12,0 @@ };

@@ -44,3 +44,3 @@ import { h, Host } from "@stencil/core";

async componentWillLoad() {
var _a, _b, _c, _d, _e, _f, _g, _h;
var _a, _b;
injectGlobalStyle();

@@ -51,11 +51,2 @@ this.ancestor = this.getClosestParent();

}
if (typeof this.orchestrate === 'undefined') {
this.orchestrate = (_d = (_c = this.ancestor) === null || _c === void 0 ? void 0 : _c.orchestrate, (_d !== null && _d !== void 0 ? _d : 'sequential'));
}
if (typeof this.orchestrateEnter === 'undefined') {
this.orchestrateEnter = (_f = (_e = this.ancestor) === null || _e === void 0 ? void 0 : _e.orchestrateEnter, (_f !== null && _f !== void 0 ? _f : this.orchestrate));
}
if (typeof this.orchestrateExit === 'undefined') {
this.orchestrateExit = (_h = (_g = this.ancestor) === null || _g === void 0 ? void 0 : _g.orchestrateExit, (_h !== null && _h !== void 0 ? _h : this.orchestrate));
}
Array.from(this.element.children).map((el, i) => {

@@ -94,3 +85,3 @@ setCustomProperties(el, { i });

setCustomProperties(el, { i });
const enter = () => presence(el, {
await presence(el, {
afterSelf: async () => {

@@ -102,42 +93,27 @@ delete el.dataset.initial;

});
if (this.orchestrateEnter === 'sequential') {
await enter();
await enterChildren(el);
}
else if (this.orchestrateEnter === 'parallel') {
await Promise.all([enter(), enterChildren(el)]);
}
return Promise.resolve();
return enterChildren(el);
}
async exitNode(el, method = 'remove', i = 0) {
const exit = () => {
delete el.dataset.willExit;
setCustomProperties(el, { i });
const event = new CustomEvent('animatePresenceExit', {
bubbles: true,
detail: {
i,
hold: hold(el),
},
});
el.dispatchEvent(event);
el.dataset.exit = '';
return presence(el, {
afterSelf: () => {
if (method === 'remove') {
el.remove();
}
else if (method === 'hide') {
el.style.setProperty('visibility', 'hidden');
}
},
});
};
if (this.orchestrateExit === 'sequential') {
await exitChildren(el);
await exit();
}
else if (this.orchestrateExit === 'parallel') {
await Promise.all([exitChildren(el), exit()]);
}
await exitChildren(el);
delete el.dataset.willExit;
setCustomProperties(el, { i });
const event = new CustomEvent('animatePresenceExit', {
bubbles: true,
detail: {
i,
hold: hold(el),
},
});
el.dispatchEvent(event);
el.dataset.exit = '';
await presence(el, {
afterSelf: () => {
if (method === 'remove') {
el.remove();
}
else if (method === 'hide') {
el.style.setProperty('visibility', 'hidden');
}
},
});
return Promise.resolve();

@@ -317,53 +293,2 @@ }

"reflect": false
},
"orchestrate": {
"type": "string",
"mutable": false,
"complexType": {
"original": "'sequential' | 'parallel'",
"resolved": "\"parallel\" | \"sequential\"",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Changes the behavior of nested `<animate-presence>` elements.\n\n`sequential` (default) will enter from the top-down and exit from the bottom-up.\n\n`parallel` will trigger all entrances and exits in parallel\n\nNote: `<animate-presence>` elements which are children of a parent `<animate-presence>` element will inherit this value,"
},
"attribute": "orchestrate",
"reflect": false
},
"orchestrateEnter": {
"type": "string",
"mutable": false,
"complexType": {
"original": "'sequential' | 'parallel'",
"resolved": "\"parallel\" | \"sequential\"",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "orchestrate-enter",
"reflect": false
},
"orchestrateExit": {
"type": "string",
"mutable": false,
"complexType": {
"original": "'sequential' | 'parallel'",
"resolved": "\"parallel\" | \"sequential\"",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "orchestrate-exit",
"reflect": false
}

@@ -370,0 +295,0 @@ }; }

@@ -24,4 +24,3 @@ export * from './presence-handler';

if (typeof element.getAnimations !== 'undefined') {
Promise.all(element.getAnimations().map(anim => anim.finished))
.then(() => {
Promise.all(element.getAnimations().map(anim => anim.finished)).then(() => {
var _a;

@@ -31,4 +30,3 @@ (_a = afterSelf) === null || _a === void 0 ? void 0 : _a();

return;
})
.catch(() => { });
});
}

@@ -35,0 +33,0 @@ else {

@@ -46,6 +46,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

import './presence-handler-a532ff81.js';
import { c as closest, i as injectGlobalStyle, s as setCustomProperties, p as presence, e as enterChildren, a as exitChildren, b as isHTMLElement, h as hasData } from './index-3c9d6eb2.js';
import { c as closest, i as injectGlobalStyle, s as setCustomProperties, p as presence, e as enterChildren, a as exitChildren, b as isHTMLElement, h as hasData } from './index-5c6ab6b0.js';
var hold = function (el) { return function (cb) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_j) {
switch (_j.label) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:

@@ -60,3 +60,3 @@ el.dataset.hold = '';

case 1:
_j.sent();
_c.sent();
delete el.dataset.hold;

@@ -104,4 +104,4 @@ return [2 /*return*/];

return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c, _d, _e, _f, _g, _h;
return __generator(this, function (_j) {
var _a, _b;
return __generator(this, function (_c) {
injectGlobalStyle();

@@ -112,11 +112,2 @@ this.ancestor = this.getClosestParent();

}
if (typeof this.orchestrate === 'undefined') {
this.orchestrate = (_d = (_c = this.ancestor) === null || _c === void 0 ? void 0 : _c.orchestrate, (_d !== null && _d !== void 0 ? _d : 'sequential'));
}
if (typeof this.orchestrateEnter === 'undefined') {
this.orchestrateEnter = (_f = (_e = this.ancestor) === null || _e === void 0 ? void 0 : _e.orchestrateEnter, (_f !== null && _f !== void 0 ? _f : this.orchestrate));
}
if (typeof this.orchestrateExit === 'undefined') {
this.orchestrateExit = (_h = (_g = this.ancestor) === null || _g === void 0 ? void 0 : _g.orchestrateExit, (_h !== null && _h !== void 0 ? _h : this.orchestrate));
}
Array.from(this.element.children).map(function (el, i) {

@@ -134,3 +125,3 @@ setCustomProperties(el, { i: i });

var _a;
return __generator(this, function (_j) {
return __generator(this, function (_c) {
this.observeChanged();

@@ -148,3 +139,3 @@ (_a = this.ancestor) === null || _a === void 0 ? void 0 : _a.registerChild(this.element);

var _a;
return __generator(this, function (_j) {
return __generator(this, function (_c) {
this.removeMO();

@@ -160,6 +151,6 @@ (_a = this.ancestor) === null || _a === void 0 ? void 0 : _a.unregisterChild(this.__presenceKey);

return __awaiter(this, void 0, void 0, function () {
var event, enter;
var event;
var _this = this;
return __generator(this, function (_j) {
switch (_j.label) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:

@@ -178,27 +169,15 @@ delete el.dataset.exit;

setCustomProperties(el, { i: i });
enter = function () { return presence(el, {
afterSelf: function () { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_j) {
delete el.dataset.initial;
delete el.dataset.enter;
el.style.removeProperty('--i');
return [2 /*return*/];
});
}); },
}); };
if (!(this.orchestrateEnter === 'sequential')) return [3 /*break*/, 3];
return [4 /*yield*/, enter()];
return [4 /*yield*/, presence(el, {
afterSelf: function () { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_c) {
delete el.dataset.initial;
delete el.dataset.enter;
el.style.removeProperty('--i');
return [2 /*return*/];
});
}); },
})];
case 1:
_j.sent();
return [4 /*yield*/, enterChildren(el)];
case 2:
_j.sent();
return [3 /*break*/, 5];
case 3:
if (!(this.orchestrateEnter === 'parallel')) return [3 /*break*/, 5];
return [4 /*yield*/, Promise.all([enter(), enterChildren(el)])];
case 4:
_j.sent();
_j.label = 5;
case 5: return [2 /*return*/, Promise.resolve()];
_c.sent();
return [2 /*return*/, enterChildren(el)];
}

@@ -212,19 +191,20 @@ });

return __awaiter(this, void 0, void 0, function () {
var exit;
return __generator(this, function (_j) {
switch (_j.label) {
case 0:
exit = function () {
delete el.dataset.willExit;
setCustomProperties(el, { i: i });
var event = new CustomEvent('animatePresenceExit', {
bubbles: true,
detail: {
i: i,
hold: hold(el),
},
});
el.dispatchEvent(event);
el.dataset.exit = '';
return presence(el, {
var event;
return __generator(this, function (_c) {
switch (_c.label) {
case 0: return [4 /*yield*/, exitChildren(el)];
case 1:
_c.sent();
delete el.dataset.willExit;
setCustomProperties(el, { i: i });
event = new CustomEvent('animatePresenceExit', {
bubbles: true,
detail: {
i: i,
hold: hold(el),
},
});
el.dispatchEvent(event);
el.dataset.exit = '';
return [4 /*yield*/, presence(el, {
afterSelf: function () {

@@ -238,19 +218,6 @@ if (method === 'remove') {

},
});
};
if (!(this.orchestrateExit === 'sequential')) return [3 /*break*/, 3];
return [4 /*yield*/, exitChildren(el)];
case 1:
_j.sent();
return [4 /*yield*/, exit()];
})];
case 2:
_j.sent();
return [3 /*break*/, 5];
case 3:
if (!(this.orchestrateExit === 'parallel')) return [3 /*break*/, 5];
return [4 /*yield*/, Promise.all([exitChildren(el), exit()])];
case 4:
_j.sent();
_j.label = 5;
case 5: return [2 /*return*/, Promise.resolve()];
_c.sent();
return [2 /*return*/, Promise.resolve()];
}

@@ -262,3 +229,3 @@ });

return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_j) {
return __generator(this, function (_c) {
if (!isHTMLElement(node))

@@ -280,3 +247,3 @@ return [2 /*return*/];

return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_j) {
return __generator(this, function (_c) {
if (!isHTMLElement(node))

@@ -301,4 +268,4 @@ return [2 /*return*/];

var i = 0;
for (var _i = 0, _j = records.reverse(); _i < _j.length; _i++) {
var record = _j[_i];
for (var _i = 0, _c = records.reverse(); _i < _c.length; _i++) {
var record = _c[_i];
if (record.addedNodes.length === 1) {

@@ -331,3 +298,3 @@ this.handleEnter(record.addedNodes[0], record, records.length - 1 - i);

var key;
return __generator(this, function (_j) {
return __generator(this, function (_c) {
key = el.__presenceKey;

@@ -345,3 +312,3 @@ // Remove existing elements with same key to handle HMR

return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_j) {
return __generator(this, function (_c) {
this.descendants = this.descendants.filter(function (el) { return el.__presenceKey !== key; });

@@ -363,4 +330,4 @@ return [2 /*return*/];

var _this = this;
return __generator(this, function (_j) {
switch (_j.label) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:

@@ -374,3 +341,3 @@ if (this.didExit || this.willExit)

case 1:
_j.sent();
_c.sent();
this.didExit = true;

@@ -392,4 +359,4 @@ this.willExit = false;

var _this = this;
return __generator(this, function (_j) {
switch (_j.label) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:

@@ -403,6 +370,6 @@ this.didExit = false;

case 1:
_j.sent();
_c.sent();
return [4 /*yield*/, enterChildren(this.element)];
case 2:
_j.sent();
_c.sent();
this.didEnter = true;

@@ -409,0 +376,0 @@ this.willEnter = false;

@@ -39,3 +39,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

import './presence-handler-a532ff81.js';
import { a as exitChildren, e as enterChildren } from './index-3c9d6eb2.js';
import { a as exitChildren, e as enterChildren } from './index-5c6ab6b0.js';
/**

@@ -42,0 +42,0 @@ * TS adaption of https://github.com/pillarjs/path-to-regexp/blob/master/index.js

import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './core-91d54087.js';
import './presence-handler-a532ff81.js';
import { c as closest, i as injectGlobalStyle, s as setCustomProperties, p as presence, e as enterChildren, a as exitChildren, b as isHTMLElement, h as hasData } from './index-3c9d6eb2.js';
import { c as closest, i as injectGlobalStyle, s as setCustomProperties, p as presence, e as enterChildren, a as exitChildren, b as isHTMLElement, h as hasData } from './index-5c6ab6b0.js';

@@ -50,3 +50,3 @@ const hold = (el) => async (cb) => {

async componentWillLoad() {
var _a, _b, _c, _d, _e, _f, _g, _h;
var _a, _b;
injectGlobalStyle();

@@ -57,11 +57,2 @@ this.ancestor = this.getClosestParent();

}
if (typeof this.orchestrate === 'undefined') {
this.orchestrate = (_d = (_c = this.ancestor) === null || _c === void 0 ? void 0 : _c.orchestrate, (_d !== null && _d !== void 0 ? _d : 'sequential'));
}
if (typeof this.orchestrateEnter === 'undefined') {
this.orchestrateEnter = (_f = (_e = this.ancestor) === null || _e === void 0 ? void 0 : _e.orchestrateEnter, (_f !== null && _f !== void 0 ? _f : this.orchestrate));
}
if (typeof this.orchestrateExit === 'undefined') {
this.orchestrateExit = (_h = (_g = this.ancestor) === null || _g === void 0 ? void 0 : _g.orchestrateExit, (_h !== null && _h !== void 0 ? _h : this.orchestrate));
}
Array.from(this.element.children).map((el, i) => {

@@ -100,3 +91,3 @@ setCustomProperties(el, { i });

setCustomProperties(el, { i });
const enter = () => presence(el, {
await presence(el, {
afterSelf: async () => {

@@ -108,42 +99,27 @@ delete el.dataset.initial;

});
if (this.orchestrateEnter === 'sequential') {
await enter();
await enterChildren(el);
}
else if (this.orchestrateEnter === 'parallel') {
await Promise.all([enter(), enterChildren(el)]);
}
return Promise.resolve();
return enterChildren(el);
}
async exitNode(el, method = 'remove', i = 0) {
const exit = () => {
delete el.dataset.willExit;
setCustomProperties(el, { i });
const event = new CustomEvent('animatePresenceExit', {
bubbles: true,
detail: {
i,
hold: hold(el),
},
});
el.dispatchEvent(event);
el.dataset.exit = '';
return presence(el, {
afterSelf: () => {
if (method === 'remove') {
el.remove();
}
else if (method === 'hide') {
el.style.setProperty('visibility', 'hidden');
}
},
});
};
if (this.orchestrateExit === 'sequential') {
await exitChildren(el);
await exit();
}
else if (this.orchestrateExit === 'parallel') {
await Promise.all([exitChildren(el), exit()]);
}
await exitChildren(el);
delete el.dataset.willExit;
setCustomProperties(el, { i });
const event = new CustomEvent('animatePresenceExit', {
bubbles: true,
detail: {
i,
hold: hold(el),
},
});
el.dispatchEvent(event);
el.dataset.exit = '';
await presence(el, {
afterSelf: () => {
if (method === 'remove') {
el.remove();
}
else if (method === 'hide') {
el.style.setProperty('visibility', 'hidden');
}
},
});
return Promise.resolve();

@@ -150,0 +126,0 @@ }

import { r as registerInstance, d as getContext, h, g as getElement } from './core-91d54087.js';
import './presence-handler-a532ff81.js';
import { a as exitChildren, e as enterChildren } from './index-3c9d6eb2.js';
import { a as exitChildren, e as enterChildren } from './index-5c6ab6b0.js';

@@ -5,0 +5,0 @@ /**

@@ -30,8 +30,2 @@ /* eslint-disable */

'observe': boolean;
/**
* Changes the behavior of nested `<animate-presence>` elements. `sequential` (default) will enter from the top-down and exit from the bottom-up. `parallel` will trigger all entrances and exits in parallel Note: `<animate-presence>` elements which are children of a parent `<animate-presence>` element will inherit this value,
*/
'orchestrate': 'sequential' | 'parallel';
'orchestrateEnter': 'sequential' | 'parallel';
'orchestrateExit': 'sequential' | 'parallel';
'registerChild': (el: HTMLAnimatePresenceElement) => Promise<void>;

@@ -86,8 +80,2 @@ 'unregisterChild': (key: string) => Promise<void>;

'onAnimatePresenceExitComplete'?: (event: CustomEvent<void>) => void;
/**
* Changes the behavior of nested `<animate-presence>` elements. `sequential` (default) will enter from the top-down and exit from the bottom-up. `parallel` will trigger all entrances and exits in parallel Note: `<animate-presence>` elements which are children of a parent `<animate-presence>` element will inherit this value,
*/
'orchestrate'?: 'sequential' | 'parallel';
'orchestrateEnter'?: 'sequential' | 'parallel';
'orchestrateExit'?: 'sequential' | 'parallel';
}

@@ -94,0 +82,0 @@ interface AnimatedRouteSwitch {

@@ -21,14 +21,2 @@ import { EventEmitter } from '../../stencil.core';

observe: boolean;
/**
* Changes the behavior of nested `<animate-presence>` elements.
*
* `sequential` (default) will enter from the top-down and exit from the bottom-up.
*
* `parallel` will trigger all entrances and exits in parallel
*
* Note: `<animate-presence>` elements which are children of a parent `<animate-presence>` element will inherit this value,
*/
orchestrate: 'sequential' | 'parallel';
orchestrateEnter: 'sequential' | 'parallel';
orchestrateExit: 'sequential' | 'parallel';
observeChanged(): void;

@@ -35,0 +23,0 @@ private mo;

{
"name": "animate-presence",
"version": "0.0.0-379153f",
"version": "0.0.0-4adf64f",
"description": "Effortless element entrance/exit animations",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc