Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

index-scrollbar

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

index-scrollbar - npm Package Compare versions

Comparing version 1.0.10 to 1.0.11-beta.0

dist/index-scrollbar/p-6a1351c1.entry.js

68

dist/cjs/index-scrollbar.cjs.entry.js

@@ -158,38 +158,34 @@ 'use strict';

//Check if there is enough free space for letters
this._lettersShortened = height / letterSize < newAlphabet.length;
if (this._lettersShortened) {
const numHiddenLetters = newAlphabet.length - Math.floor(height / letterSize);
if (numHiddenLetters === newAlphabet.length)
newAlphabet = [];
//determine how many letters to hide
const hiddenHalves = this.getNumHiddenHalves(numHiddenLetters, newAlphabet.length) + 1;
// (this.magnifyDividers || numHiddenLetters > newAlphabet.length - 2 ? 1 : 0);
//split alphabet into two halves
let alphabet1 = newAlphabet.slice(0, Math.ceil(newAlphabet.length / 2));
let alphabet2 = newAlphabet.slice(Math.floor(newAlphabet.length / 2)).reverse();
for (let i = 0; i < hiddenHalves; i++) {
alphabet1 = alphabet1.filter((_, i) => i % 2 === 0);
alphabet2 = alphabet2.filter((_, i) => i % 2 === 0);
}
//insert dots between letters
alphabet1 = alphabet1.reduce((prev, curr, i) => {
if (i > 0) {
if (this.overflowDivider)
prev.push(this.overflowDivider);
}
prev.push(curr);
return prev;
}, []);
alphabet2 = alphabet2.reduce((prev, curr, i) => {
if (i > 0) {
if (this.overflowDivider)
prev.push(this.overflowDivider);
}
prev.push(curr);
return prev;
}, []);
if (this.alphabet.length % 2 === 0 && this.overflowDivider)
alphabet1.push(this.overflowDivider);
newAlphabet = alphabet1.concat(alphabet2.reverse());
}
// this._lettersShortened = height / letterSize < newAlphabet.length;
// if (this._lettersShortened) {
// const numHiddenLetters = newAlphabet.length - Math.floor(height / letterSize);
// if (numHiddenLetters === newAlphabet.length) newAlphabet = [];
// //determine how many letters to hide
// const hiddenHalves = this.getNumHiddenHalves(numHiddenLetters, newAlphabet.length) + 1;
// // (this.magnifyDividers || numHiddenLetters > newAlphabet.length - 2 ? 1 : 0);
// //split alphabet into two halves
// let alphabet1 = newAlphabet.slice(0, Math.ceil(newAlphabet.length / 2));
// let alphabet2 = newAlphabet.slice(Math.floor(newAlphabet.length / 2)).reverse();
// for (let i = 0; i < hiddenHalves; i++) {
// alphabet1 = alphabet1.filter((_, i) => i % 2 === 0);
// alphabet2 = alphabet2.filter((_, i) => i % 2 === 0);
// }
// //insert dots between letters
// alphabet1 = alphabet1.reduce((prev, curr, i) => {
// if (i > 0) {
// if (this.overflowDivider) prev.push(this.overflowDivider);
// }
// prev.push(curr);
// return prev;
// }, []);
// alphabet2 = alphabet2.reduce((prev, curr, i) => {
// if (i > 0) {
// if (this.overflowDivider) prev.push(this.overflowDivider);
// }
// prev.push(curr);
// return prev;
// }, []);
// if (this.alphabet.length % 2 === 0 && this.overflowDivider) alphabet1.push(this.overflowDivider);
// newAlphabet = alphabet1.concat(alphabet2.reverse());
// }
this.visibleLetters = newAlphabet;

@@ -196,0 +192,0 @@ }

@@ -148,38 +148,34 @@ import { Component, Host, h, Prop, Event, Element, State, Watch } from '@stencil/core';

//Check if there is enough free space for letters
this._lettersShortened = height / letterSize < newAlphabet.length;
if (this._lettersShortened) {
const numHiddenLetters = newAlphabet.length - Math.floor(height / letterSize);
if (numHiddenLetters === newAlphabet.length)
newAlphabet = [];
//determine how many letters to hide
const hiddenHalves = this.getNumHiddenHalves(numHiddenLetters, newAlphabet.length) + 1;
// (this.magnifyDividers || numHiddenLetters > newAlphabet.length - 2 ? 1 : 0);
//split alphabet into two halves
let alphabet1 = newAlphabet.slice(0, Math.ceil(newAlphabet.length / 2));
let alphabet2 = newAlphabet.slice(Math.floor(newAlphabet.length / 2)).reverse();
for (let i = 0; i < hiddenHalves; i++) {
alphabet1 = alphabet1.filter((_, i) => i % 2 === 0);
alphabet2 = alphabet2.filter((_, i) => i % 2 === 0);
}
//insert dots between letters
alphabet1 = alphabet1.reduce((prev, curr, i) => {
if (i > 0) {
if (this.overflowDivider)
prev.push(this.overflowDivider);
}
prev.push(curr);
return prev;
}, []);
alphabet2 = alphabet2.reduce((prev, curr, i) => {
if (i > 0) {
if (this.overflowDivider)
prev.push(this.overflowDivider);
}
prev.push(curr);
return prev;
}, []);
if (this.alphabet.length % 2 === 0 && this.overflowDivider)
alphabet1.push(this.overflowDivider);
newAlphabet = alphabet1.concat(alphabet2.reverse());
}
// this._lettersShortened = height / letterSize < newAlphabet.length;
// if (this._lettersShortened) {
// const numHiddenLetters = newAlphabet.length - Math.floor(height / letterSize);
// if (numHiddenLetters === newAlphabet.length) newAlphabet = [];
// //determine how many letters to hide
// const hiddenHalves = this.getNumHiddenHalves(numHiddenLetters, newAlphabet.length) + 1;
// // (this.magnifyDividers || numHiddenLetters > newAlphabet.length - 2 ? 1 : 0);
// //split alphabet into two halves
// let alphabet1 = newAlphabet.slice(0, Math.ceil(newAlphabet.length / 2));
// let alphabet2 = newAlphabet.slice(Math.floor(newAlphabet.length / 2)).reverse();
// for (let i = 0; i < hiddenHalves; i++) {
// alphabet1 = alphabet1.filter((_, i) => i % 2 === 0);
// alphabet2 = alphabet2.filter((_, i) => i % 2 === 0);
// }
// //insert dots between letters
// alphabet1 = alphabet1.reduce((prev, curr, i) => {
// if (i > 0) {
// if (this.overflowDivider) prev.push(this.overflowDivider);
// }
// prev.push(curr);
// return prev;
// }, []);
// alphabet2 = alphabet2.reduce((prev, curr, i) => {
// if (i > 0) {
// if (this.overflowDivider) prev.push(this.overflowDivider);
// }
// prev.push(curr);
// return prev;
// }, []);
// if (this.alphabet.length % 2 === 0 && this.overflowDivider) alphabet1.push(this.overflowDivider);
// newAlphabet = alphabet1.concat(alphabet2.reverse());
// }
this.visibleLetters = newAlphabet;

@@ -186,0 +182,0 @@ }

@@ -156,38 +156,34 @@ import { HTMLElement, createEvent, h, Host, proxyCustomElement } from '@stencil/core/internal/client';

//Check if there is enough free space for letters
this._lettersShortened = height / letterSize < newAlphabet.length;
if (this._lettersShortened) {
const numHiddenLetters = newAlphabet.length - Math.floor(height / letterSize);
if (numHiddenLetters === newAlphabet.length)
newAlphabet = [];
//determine how many letters to hide
const hiddenHalves = this.getNumHiddenHalves(numHiddenLetters, newAlphabet.length) + 1;
// (this.magnifyDividers || numHiddenLetters > newAlphabet.length - 2 ? 1 : 0);
//split alphabet into two halves
let alphabet1 = newAlphabet.slice(0, Math.ceil(newAlphabet.length / 2));
let alphabet2 = newAlphabet.slice(Math.floor(newAlphabet.length / 2)).reverse();
for (let i = 0; i < hiddenHalves; i++) {
alphabet1 = alphabet1.filter((_, i) => i % 2 === 0);
alphabet2 = alphabet2.filter((_, i) => i % 2 === 0);
}
//insert dots between letters
alphabet1 = alphabet1.reduce((prev, curr, i) => {
if (i > 0) {
if (this.overflowDivider)
prev.push(this.overflowDivider);
}
prev.push(curr);
return prev;
}, []);
alphabet2 = alphabet2.reduce((prev, curr, i) => {
if (i > 0) {
if (this.overflowDivider)
prev.push(this.overflowDivider);
}
prev.push(curr);
return prev;
}, []);
if (this.alphabet.length % 2 === 0 && this.overflowDivider)
alphabet1.push(this.overflowDivider);
newAlphabet = alphabet1.concat(alphabet2.reverse());
}
// this._lettersShortened = height / letterSize < newAlphabet.length;
// if (this._lettersShortened) {
// const numHiddenLetters = newAlphabet.length - Math.floor(height / letterSize);
// if (numHiddenLetters === newAlphabet.length) newAlphabet = [];
// //determine how many letters to hide
// const hiddenHalves = this.getNumHiddenHalves(numHiddenLetters, newAlphabet.length) + 1;
// // (this.magnifyDividers || numHiddenLetters > newAlphabet.length - 2 ? 1 : 0);
// //split alphabet into two halves
// let alphabet1 = newAlphabet.slice(0, Math.ceil(newAlphabet.length / 2));
// let alphabet2 = newAlphabet.slice(Math.floor(newAlphabet.length / 2)).reverse();
// for (let i = 0; i < hiddenHalves; i++) {
// alphabet1 = alphabet1.filter((_, i) => i % 2 === 0);
// alphabet2 = alphabet2.filter((_, i) => i % 2 === 0);
// }
// //insert dots between letters
// alphabet1 = alphabet1.reduce((prev, curr, i) => {
// if (i > 0) {
// if (this.overflowDivider) prev.push(this.overflowDivider);
// }
// prev.push(curr);
// return prev;
// }, []);
// alphabet2 = alphabet2.reduce((prev, curr, i) => {
// if (i > 0) {
// if (this.overflowDivider) prev.push(this.overflowDivider);
// }
// prev.push(curr);
// return prev;
// }, []);
// if (this.alphabet.length % 2 === 0 && this.overflowDivider) alphabet1.push(this.overflowDivider);
// newAlphabet = alphabet1.concat(alphabet2.reverse());
// }
this.visibleLetters = newAlphabet;

@@ -194,0 +190,0 @@ }

@@ -154,38 +154,34 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-5f889f85.js';

//Check if there is enough free space for letters
this._lettersShortened = height / letterSize < newAlphabet.length;
if (this._lettersShortened) {
const numHiddenLetters = newAlphabet.length - Math.floor(height / letterSize);
if (numHiddenLetters === newAlphabet.length)
newAlphabet = [];
//determine how many letters to hide
const hiddenHalves = this.getNumHiddenHalves(numHiddenLetters, newAlphabet.length) + 1;
// (this.magnifyDividers || numHiddenLetters > newAlphabet.length - 2 ? 1 : 0);
//split alphabet into two halves
let alphabet1 = newAlphabet.slice(0, Math.ceil(newAlphabet.length / 2));
let alphabet2 = newAlphabet.slice(Math.floor(newAlphabet.length / 2)).reverse();
for (let i = 0; i < hiddenHalves; i++) {
alphabet1 = alphabet1.filter((_, i) => i % 2 === 0);
alphabet2 = alphabet2.filter((_, i) => i % 2 === 0);
}
//insert dots between letters
alphabet1 = alphabet1.reduce((prev, curr, i) => {
if (i > 0) {
if (this.overflowDivider)
prev.push(this.overflowDivider);
}
prev.push(curr);
return prev;
}, []);
alphabet2 = alphabet2.reduce((prev, curr, i) => {
if (i > 0) {
if (this.overflowDivider)
prev.push(this.overflowDivider);
}
prev.push(curr);
return prev;
}, []);
if (this.alphabet.length % 2 === 0 && this.overflowDivider)
alphabet1.push(this.overflowDivider);
newAlphabet = alphabet1.concat(alphabet2.reverse());
}
// this._lettersShortened = height / letterSize < newAlphabet.length;
// if (this._lettersShortened) {
// const numHiddenLetters = newAlphabet.length - Math.floor(height / letterSize);
// if (numHiddenLetters === newAlphabet.length) newAlphabet = [];
// //determine how many letters to hide
// const hiddenHalves = this.getNumHiddenHalves(numHiddenLetters, newAlphabet.length) + 1;
// // (this.magnifyDividers || numHiddenLetters > newAlphabet.length - 2 ? 1 : 0);
// //split alphabet into two halves
// let alphabet1 = newAlphabet.slice(0, Math.ceil(newAlphabet.length / 2));
// let alphabet2 = newAlphabet.slice(Math.floor(newAlphabet.length / 2)).reverse();
// for (let i = 0; i < hiddenHalves; i++) {
// alphabet1 = alphabet1.filter((_, i) => i % 2 === 0);
// alphabet2 = alphabet2.filter((_, i) => i % 2 === 0);
// }
// //insert dots between letters
// alphabet1 = alphabet1.reduce((prev, curr, i) => {
// if (i > 0) {
// if (this.overflowDivider) prev.push(this.overflowDivider);
// }
// prev.push(curr);
// return prev;
// }, []);
// alphabet2 = alphabet2.reduce((prev, curr, i) => {
// if (i > 0) {
// if (this.overflowDivider) prev.push(this.overflowDivider);
// }
// prev.push(curr);
// return prev;
// }, []);
// if (this.alphabet.length % 2 === 0 && this.overflowDivider) alphabet1.push(this.overflowDivider);
// newAlphabet = alphabet1.concat(alphabet2.reverse());
// }
this.visibleLetters = newAlphabet;

@@ -192,0 +188,0 @@ }

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

import{p as e,b as i}from"./p-d4d31fe4.js";(()=>{const i=import.meta.url,t={};return""!==i&&(t.resourcesUrl=new URL(".",i).href),e(t)})().then((e=>i([["p-085517c8",[[1,"index-scrollbar",{alphabet:[16],overflowDivider:[1,"overflow-divider"],validLetters:[16],disableInvalidLetters:[4,"disable-invalid-letters"],prioritizeHidingInvalidLetters:[4,"prioritize-hiding-invalid-letters"],letterMagnification:[4,"letter-magnification"],magnifyDividers:[4,"magnify-dividers"],magnificationMultiplier:[2,"magnification-multiplier"],magnificationCurve:[16],exactX:[4,"exact-x"],navigateOnHover:[4,"navigate-on-hover"],letterSpacing:[8,"letter-spacing"],offsetSizeCheckInterval:[2,"offset-size-check-interval"],_isComponentActive:[32],visibleLetters:[32],rendering:[32],_lastEmittedLetter:[32],magIndex:[32],_isInBounds:[32],visualLetterIndex:[32],letterSelected:[32]}]]]],e)));
import{p as e,b as i}from"./p-d4d31fe4.js";(()=>{const i=import.meta.url,t={};return""!==i&&(t.resourcesUrl=new URL(".",i).href),e(t)})().then((e=>i([["p-6a1351c1",[[1,"index-scrollbar",{alphabet:[16],overflowDivider:[1,"overflow-divider"],validLetters:[16],disableInvalidLetters:[4,"disable-invalid-letters"],prioritizeHidingInvalidLetters:[4,"prioritize-hiding-invalid-letters"],letterMagnification:[4,"letter-magnification"],magnifyDividers:[4,"magnify-dividers"],magnificationMultiplier:[2,"magnification-multiplier"],magnificationCurve:[16],exactX:[4,"exact-x"],navigateOnHover:[4,"navigate-on-hover"],letterSpacing:[8,"letter-spacing"],offsetSizeCheckInterval:[2,"offset-size-check-interval"],_isComponentActive:[32],visibleLetters:[32],rendering:[32],_lastEmittedLetter:[32],magIndex:[32],_isInBounds:[32],visualLetterIndex:[32],letterSelected:[32]}]]]],e)));
{
"name": "index-scrollbar",
"version": "1.0.10",
"version": "1.0.11-beta.0",
"description": "Stencil Component Starter",

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

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