@aarsteinmedia/dotlottie-player 2.2.9 → 2.2.10

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/dist/cjs/index.js CHANGED
@@ -294,129 +294,9 @@ const addExt = (ext, str)=>{
294
294
  return `${prefix ?? `:${s4()}`}-${s4()}`;
295
295
  };
296
296
 
297
- var name = "@aarsteinmedia/dotlottie-player";
298
- var version = "2.2.9";
299
- var description = "Web Component for playing Lottie animations in your web app. Previously @johanaarstein/dotlottie-player";
300
- var exports$1 = {
301
- ".": {
302
- "import": "./dist/esm/index.js",
303
- node: "./dist/esm/index.js",
304
- require: "./dist/cjs/index.js",
305
- types: "./dist/index.d.ts"
306
- }
307
- };
308
- var main = "./dist/esm/index.js";
309
- var unpkg = "./dist/index.js";
310
- var module$1 = "./dist/esm/index.js";
311
- var types = "./dist/index.d.ts";
312
- var type = "module";
313
- var homepage = "https://www.aarstein.media/en/dotlottie-player";
314
- var repository = {
315
- url: "https://github.com/aarsteinmedia/dotlottie-player.git",
316
- type: "git"
317
- };
318
- var bugs = "https://github.com/aarsteinmedia/dotlottie-player/issues";
319
- var author = {
320
- name: "Johan Martin Aarstein",
321
- email: "johan@aarstein.media",
322
- url: "https://www.aarstein.media",
323
- organization: "Aarstein Media"
324
- };
325
- var license = "GPL-2.0-or-later";
326
- var scripts = {
327
- build: "pnpm cleanup && rollup -c",
328
- "build:types": "pnpm cleanup:types && tsc",
329
- "build:cem": "npx cem analyze --config 'cem.config.mjs'",
330
- prod: "pnpm build:types && pnpm build && pnpm build:cem",
331
- dev: "pnpm cleanup && rollup -c --watch",
332
- lint: "tsc && eslint . --ext .ts,.js",
333
- "lint:fix": "eslint . --ext .ts,.js --fix",
334
- "cleanup:types": "shx rm -rf types && shx mkdir types",
335
- cleanup: "shx rm -rf dist && shx mkdir dist"
336
- };
337
- var dependencies = {
338
- fflate: "^0.8.1",
339
- lit: "^2.8.0",
340
- "lottie-web": "^5.12.2"
341
- };
342
- var peerDependencies = {
343
- "@types/react": ">= 16.0.0"
344
- };
345
- var devDependencies = {
346
- "@custom-elements-manifest/analyzer": "^0.6.9",
347
- "@rollup/plugin-commonjs": "^25.0.7",
348
- "@rollup/plugin-json": "^6.1.0",
349
- "@rollup/plugin-node-resolve": "^15.2.3",
350
- "@rollup/plugin-replace": "^5.0.5",
351
- "@swc/core": "^1.3.101",
352
- "@types/node": "^20.10.5",
353
- "@typescript-eslint/eslint-plugin": "^5.62.0",
354
- "@typescript-eslint/parser": "^5.62.0",
355
- eslint: "^8.56.0",
356
- "eslint-plugin-lit": "^1.11.0",
357
- rollup: "^3.29.4",
358
- "rollup-plugin-dts": "^6.1.0",
359
- "rollup-plugin-html-literals": "^1.1.8",
360
- "rollup-plugin-summary": "^2.0.0",
361
- "rollup-plugin-swc3": "^0.9.1",
362
- shx: "^0.3.4",
363
- "ts-lit-plugin": "^1.2.1",
364
- typescript: "^5.3.3"
365
- };
366
- var customElements = "dist/custom-elements.json";
367
- var files = [
368
- "dist",
369
- "README.md"
370
- ];
371
- var keywords = [
372
- "lottie",
373
- "dotlottie",
374
- "animation",
375
- "web component",
376
- "component",
377
- "lit-element",
378
- "svg",
379
- "vector",
380
- "player"
381
- ];
382
- var publishConfig = {
383
- access: "public"
384
- };
385
- var engines = {
386
- node: ">= 7.6.0"
387
- };
388
- var funding = {
389
- type: "paypal",
390
- url: "https://www.paypal.com/donate/?hosted_button_id=E7C7DMN8KSQ6A"
391
- };
392
- var pkg = {
393
- name: name,
394
- version: version,
395
- description: description,
396
- exports: exports$1,
397
- main: main,
398
- unpkg: unpkg,
399
- module: module$1,
400
- types: types,
401
- type: type,
402
- homepage: homepage,
403
- repository: repository,
404
- bugs: bugs,
405
- author: author,
406
- license: license,
407
- scripts: scripts,
408
- dependencies: dependencies,
409
- peerDependencies: peerDependencies,
410
- devDependencies: devDependencies,
411
- customElements: customElements,
412
- files: files,
413
- keywords: keywords,
414
- publishConfig: publishConfig,
415
- engines: engines,
416
- funding: funding
417
- };
297
+ var name="@aarsteinmedia/dotlottie-player";var version="2.2.10";var description="Web Component for playing Lottie animations in your web app. Previously @johanaarstein/dotlottie-player";var exports$1={".":{"import":"./dist/esm/index.js",node:"./dist/esm/index.js",require:"./dist/cjs/index.js",types:"./dist/index.d.ts"}};var main="./dist/esm/index.js";var unpkg="./dist/index.js";var module$1="./dist/esm/index.js";var types="./dist/index.d.ts";var type="module";var homepage="https://www.aarstein.media/en/dotlottie-player";var repository={url:"https://github.com/aarsteinmedia/dotlottie-player.git",type:"git"};var bugs="https://github.com/aarsteinmedia/dotlottie-player/issues";var author={name:"Johan Martin Aarstein",email:"johan@aarstein.media",url:"https://www.aarstein.media",organization:"Aarstein Media"};var license="GPL-2.0-or-later";var scripts={build:"rimraf ./dist && rollup -c","build:types":"rimraf ./types && tsc","build:cem":"npx cem analyze --config 'cem.config.mjs'",prod:"pnpm build:types && pnpm build && pnpm build:cem",dev:"rollup -c -w --environment NODE_ENV:development",lint:"tsc && eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix"};var dependencies={fflate:"^0.8.1",lit:"^2.8.0","lottie-web":"^5.12.2"};var peerDependencies={"@types/react":">= 16.0.0"};var devDependencies={"@custom-elements-manifest/analyzer":"^0.6.9","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-replace":"^5.0.5","@swc/core":"^1.3.101","@types/node":"^20.10.5","@typescript-eslint/eslint-plugin":"^5.62.0","@typescript-eslint/parser":"^5.62.0",autoprefixer:"^10.4.16","esbuild-sass-plugin":"^2.16.1",eslint:"^8.56.0","eslint-plugin-lit":"^1.11.0","postcss-flexbugs-fixes":"^5.0.2",rimraf:"^5.0.5",rollup:"^3.29.4","rollup-plugin-dts":"^6.1.0","rollup-plugin-html-literals":"^1.1.8","rollup-plugin-livereload":"^2.0.5","rollup-plugin-postcss":"^4.0.2","rollup-plugin-postcss-lit":"^2.1.0","rollup-plugin-serve":"^1.1.1","rollup-plugin-summary":"^2.0.0","rollup-plugin-swc3":"^0.9.1",sass:"^1.69.6","ts-lit-plugin":"^1.2.1",typescript:"^5.3.3"};var customElements="dist/custom-elements.json";var files=["dist","README.md"];var keywords=["lottie","dotlottie","animation","web component","component","lit-element","svg","vector","player"];var publishConfig={access:"public"};var engines={node:">= 8.17.0"};var funding={type:"paypal",url:"https://www.paypal.com/donate/?hosted_button_id=E7C7DMN8KSQ6A"};var pkg = {name:name,version:version,description:description,exports:exports$1,main:main,unpkg:unpkg,module:module$1,types:types,type:type,homepage:homepage,repository:repository,bugs:bugs,author:author,license:license,scripts:scripts,dependencies:dependencies,peerDependencies:peerDependencies,devDependencies:devDependencies,customElements:customElements,files:files,keywords:keywords,publishConfig:publishConfig,engines:engines,funding:funding};
418
298
 
419
- var styles = lit.css`*{box-sizing:border-box}:host{--lottie-player-toolbar-height:35px;--lottie-player-toolbar-background-color:#FFF;--lottie-player-toolbar-icon-color:#000;--lottie-player-toolbar-icon-hover-color:#000;--lottie-player-toolbar-icon-active-color:#4285f4;--lottie-player-seeker-track-color:rgba(0, 0, 0, 0.2);--lottie-player-seeker-thumb-color:#4285f4;--lottie-player-seeker-display:block;display:block;width:100%;height:100%}@media (prefers-color-scheme:dark){:host{--lottie-player-toolbar-background-color:#000;--lottie-player-toolbar-icon-color:#FFF;--lottie-player-toolbar-icon-hover-color:#FFF;--lottie-player-seeker-track-color:rgba(255, 255, 255, 0.6)}}.main{display:flex;flex-direction:column;height:100%;width:100%;margin:0}.animation{width:100%;height:100%;display:flex}[data-controls=true] .animation{height:calc(100% - 35px)}.animation-container{position:relative}.popover{position:absolute;right:5px;bottom:40px;background-color:var(--lottie-player-toolbar-background-color);border-radius:5px;padding:10px 15px;border:solid 2px var(--lottie-player-toolbar-icon-color);animation:fadeIn .2s ease-in-out}.popover::before{content:"";right:10px;border:7px solid transparent;border-top-color:transparent;margin-right:-7px;height:0;width:0;position:absolute;pointer-events:none;top:100%;border-top-color:var(--lottie-player-toolbar-icon-color)}.toolbar{display:flex;align-items:center;justify-items:center;background:var(--lottie-player-toolbar-background-color);margin:0;height:35px;padding:5px;border-radius:5px;gap:5px}.toolbar.has-error{pointer-events:none;opacity:.5}.toolbar button{cursor:pointer;fill:var(--lottie-player-toolbar-icon-color);color:var(--lottie-player-toolbar-icon-color);display:flex;background:0 0;border:0;padding:0;outline:0;height:100%;margin:0;align-items:center;gap:5px;opacity:.9}.toolbar button:hover{opacity:1}.toolbar button[data-active=true]{opacity:1;fill:var(--lottie-player-toolbar-icon-active-color)}.toolbar button:disabled{opacity:.5}.toolbar button:focus{outline:0}.toolbar button svg{pointer-events:none}.toolbar button svg>*{fill:inherit}.toolbar button.disabled svg{display:none}.progress-container{position:relative;width:100%}.progress-container.simple{margin-right:12px}.seeker,.seeker::-webkit-slider-runnable-track,.seeker::-webkit-slider-thumb,progress{-webkit-appearance:none;appearance:none;outline:0}.seeker{width:100%;height:20px;border-radius:3px;border:0;cursor:pointer;background-color:transparent;display:var(--lottie-player-seeker-display);color:var(--lottie-player-seeker-thumb-color);margin:0;padding:7.5px 0;position:relative;z-index:1}progress{position:absolute;width:100%;height:5px;border-radius:3px;border:0;top:0;left:0;margin:7.5px 0;background-color:var(--lottie-player-seeker-track-color);pointer-events:none}::-moz-progress-bar{background-color:var(--lottie-player-seeker-thumb-color)}::-webkit-progress-inner-element{border-radius:3px;overflow:hidden}::-webkit-slider-runnable-track{background-color:transparent}::-webkit-progress-value{background-color:var(--lottie-player-seeker-thumb-color)}.seeker::-webkit-slider-thumb{height:15px;width:15px;border-radius:50%;border:0;background-color:var(--lottie-player-seeker-thumb-color);cursor:pointer;transition:transform .2s ease-in-out;transform:scale(0)}.seeker:focus::-webkit-slider-thumb,.seeker:hover::-webkit-slider-thumb{transform:scale(1)}.seeker::-moz-range-progress{background-color:var(--lottie-player-seeker-thumb-color);height:5px;border-radius:3px}.seeker::-moz-range-thumb{height:15px;width:15px;border-radius:50%;background-color:var(--lottie-player-seeker-thumb-color);border:0;cursor:pointer;transition:transform .2s ease-in-out;transform:scale(0)}.seeker:focus::-moz-range-thumb,.seeker:hover::-moz-range-thumb{transform:scale(1)}.seeker::-ms-track{width:100%;height:5px;cursor:pointer;background:0 0;border-color:transparent;color:transparent}.seeker::-ms-fill-upper{background:var(--lottie-player-seeker-track-color);border-radius:3px}.seeker::-ms-fill-lower{background-color:var(--lottie-player-seeker-thumb-color);border-radius:3px}.seeker::-ms-thumb{border:0;height:15px;width:15px;border-radius:50%;background:var(--lottie-player-seeker-thumb-color);cursor:pointer;transition:transform .2s ease-in-out;transform:scale(0)}.seeker:focus::-ms-thumb,.seeker:hover::-ms-thumb{transform:scale(1)}.seeker:focus::-ms-fill-lower{background:var(--lottie-player-seeker-track-color)}.seeker:focus::-ms-fill-upper{background:var(--lottie-player-seeker-track-color)}.error{display:flex;margin:auto;justify-content:center;height:100%;align-items:center}.error svg{width:100%;height:auto}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}`;
299
+ var css_248z = lit.css`*{box-sizing:border-box}:host{--lottie-player-toolbar-height:35px;--lottie-player-toolbar-background-color:#FFF;--lottie-player-toolbar-icon-color:#000;--lottie-player-toolbar-icon-hover-color:#000;--lottie-player-toolbar-icon-active-color:#4285f4;--lottie-player-seeker-track-color:rgba(0, 0, 0, 0.2);--lottie-player-seeker-thumb-color:#4285f4;--lottie-player-seeker-display:block;display:block;width:100%;height:100%}@media (prefers-color-scheme:dark){:host{--lottie-player-toolbar-background-color:#000;--lottie-player-toolbar-icon-color:#FFF;--lottie-player-toolbar-icon-hover-color:#FFF;--lottie-player-seeker-track-color:rgba(255, 255, 255, 0.6)}}.main{display:flex;flex-direction:column;height:100%;width:100%;margin:0;padding:0}.animation{width:100%;height:100%;display:flex}[data-controls=true] .animation{height:calc(100% - 35px)}.animation-container{position:relative}.popover{position:absolute;right:5px;bottom:40px;background-color:var(--lottie-player-toolbar-background-color);border-radius:5px;padding:10px 15px;border:solid 2px var(--lottie-player-toolbar-icon-color);animation:fadeIn .2s ease-in-out}.popover::before{content:"";right:10px;border:7px solid transparent;border-top-color:transparent;margin-right:-7px;height:0;width:0;position:absolute;pointer-events:none;top:100%;border-top-color:var(--lottie-player-toolbar-icon-color)}.toolbar{display:flex;align-items:center;justify-items:center;background:var(--lottie-player-toolbar-background-color);margin:0;height:35px;padding:5px;border-radius:5px;gap:5px}.toolbar.has-error{pointer-events:none;opacity:.5}.toolbar button{cursor:pointer;fill:var(--lottie-player-toolbar-icon-color);color:var(--lottie-player-toolbar-icon-color);display:flex;background:0 0;border:0;padding:0;outline:0;height:100%;margin:0;align-items:center;gap:5px;opacity:.9}.toolbar button:hover{opacity:1}.toolbar button[data-active=true]{opacity:1;fill:var(--lottie-player-toolbar-icon-active-color)}.toolbar button:disabled{opacity:.5}.toolbar button:focus{outline:0}.toolbar button svg{pointer-events:none}.toolbar button svg>*{fill:inherit}.toolbar button.disabled svg{display:none}.progress-container{position:relative;width:100%}.progress-container.simple{margin-right:12px}.seeker{-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0}.seeker::-webkit-slider-runnable-track,.seeker::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;outline:0}progress{-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0}.seeker{width:100%;height:20px;border-radius:3px;border:0;cursor:pointer;background-color:transparent;display:var(--lottie-player-seeker-display);color:var(--lottie-player-seeker-thumb-color);margin:0;padding:7.5px 0;position:relative;z-index:1}progress{position:absolute;width:100%;height:5px;border-radius:3px;border:0;top:0;left:0;margin:7.5px 0;background-color:var(--lottie-player-seeker-track-color);pointer-events:none}::-moz-progress-bar{background-color:var(--lottie-player-seeker-thumb-color)}::-webkit-progress-inner-element{border-radius:3px;overflow:hidden}::-webkit-slider-runnable-track{background-color:transparent}::-webkit-progress-value{background-color:var(--lottie-player-seeker-thumb-color)}.seeker::-webkit-slider-thumb{height:15px;width:15px;border-radius:50%;border:0;background-color:var(--lottie-player-seeker-thumb-color);cursor:pointer;-webkit-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;transform:scale(0)}.seeker:focus::-webkit-slider-thumb,.seeker:hover::-webkit-slider-thumb{transform:scale(1)}.seeker::-moz-range-progress{background-color:var(--lottie-player-seeker-thumb-color);height:5px;border-radius:3px}.seeker::-moz-range-thumb{height:15px;width:15px;border-radius:50%;background-color:var(--lottie-player-seeker-thumb-color);border:0;cursor:pointer;-moz-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;transform:scale(0)}.seeker:focus::-moz-range-thumb,.seeker:hover::-moz-range-thumb{transform:scale(1)}.seeker::-ms-track{width:100%;height:5px;cursor:pointer;background:0 0;border-color:transparent;color:transparent}.seeker::-ms-fill-upper{background:var(--lottie-player-seeker-track-color);border-radius:3px}.seeker::-ms-fill-lower{background-color:var(--lottie-player-seeker-thumb-color);border-radius:3px}.seeker::-ms-thumb{border:0;height:15px;width:15px;border-radius:50%;background:var(--lottie-player-seeker-thumb-color);cursor:pointer;-ms-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;transform:scale(0)}.seeker:hover::-ms-thumb{transform:scale(1)}.seeker:focus::-ms-thumb{transform:scale(1)}.seeker:focus::-ms-fill-lower,.seeker:focus::-ms-fill-upper{background:var(--lottie-player-seeker-track-color)}.error{display:flex;margin:auto;justify-content:center;height:100%;align-items:center}.error svg{width:100%;height:auto}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}`;
420
300
 
421
301
  function _ts_decorate(decorators, target, key, desc) {
422
302
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -570,7 +450,7 @@ class DotLottiePlayer extends lit.LitElement {
570
450
  this.currentState = exports.PlayerState.Error;
571
451
  this.dispatchEvent(new CustomEvent(exports.PlayerEvents.Error));
572
452
  });
573
- if (this.container) {
453
+ if (this.container && this.hover) {
574
454
  this.container.addEventListener('mouseenter', this._mouseEnter);
575
455
  this.container.addEventListener('mouseleave', this._mouseLeave);
576
456
  }
@@ -792,14 +672,20 @@ class DotLottiePlayer extends lit.LitElement {
792
672
  if (curr?.mode !== undefined) {
793
673
  if (curr.mode === exports.PlayMode.Normal) {
794
674
  curr.mode = exports.PlayMode.Bounce;
675
+ this._isBounce = true;
795
676
  } else {
796
677
  curr.mode = exports.PlayMode.Normal;
678
+ this._isBounce = false;
797
679
  }
798
- } else if (this.mode === exports.PlayMode.Normal) {
680
+ return;
681
+ }
682
+ if (this.mode === exports.PlayMode.Normal) {
799
683
  this.mode = exports.PlayMode.Bounce;
800
- } else {
801
- this.mode = exports.PlayMode.Normal;
684
+ this._isBounce = true;
685
+ return;
802
686
  }
687
+ this.mode = exports.PlayMode.Normal;
688
+ this._isBounce = false;
803
689
  }
804
690
  _toggleSettings(flag) {
805
691
  if (flag === undefined) {
@@ -848,7 +734,7 @@ class DotLottiePlayer extends lit.LitElement {
848
734
  return createDotLottie(animations || this._animations, newManifest, `${getFilename(fileName || this.src)}.lottie`, download);
849
735
  }
850
736
  static get styles() {
851
- return styles;
737
+ return css_248z;
852
738
  }
853
739
  connectedCallback() {
854
740
  super.connectedCallback();