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

@vtmn/svelte

Package Overview
Dependencies
Maintainers
2
Versions
341
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vtmn/svelte - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

167

dist/VtmnButton.js

@@ -75,116 +75,7 @@ (function (global, factory) {

}
// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM
// at the end of hydration without touching the remaining nodes.
let is_hydrating = false;
function start_hydrating() {
is_hydrating = true;
}
function end_hydrating() {
is_hydrating = false;
}
function upper_bound(low, high, key, value) {
// Return first index of value larger than input value in the range [low, high)
while (low < high) {
const mid = low + ((high - low) >> 1);
if (key(mid) <= value) {
low = mid + 1;
}
else {
high = mid;
}
}
return low;
}
function init_hydrate(target) {
if (target.hydrate_init)
return;
target.hydrate_init = true;
// We know that all children have claim_order values since the unclaimed have been detached
const children = target.childNodes;
/*
* Reorder claimed children optimally.
* We can reorder claimed children optimally by finding the longest subsequence of
* nodes that are already claimed in order and only moving the rest. The longest
* subsequence subsequence of nodes that are claimed in order can be found by
* computing the longest increasing subsequence of .claim_order values.
*
* This algorithm is optimal in generating the least amount of reorder operations
* possible.
*
* Proof:
* We know that, given a set of reordering operations, the nodes that do not move
* always form an increasing subsequence, since they do not move among each other
* meaning that they must be already ordered among each other. Thus, the maximal
* set of nodes that do not move form a longest increasing subsequence.
*/
// Compute longest increasing subsequence
// m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j
const m = new Int32Array(children.length + 1);
// Predecessor indices + 1
const p = new Int32Array(children.length);
m[0] = -1;
let longest = 0;
for (let i = 0; i < children.length; i++) {
const current = children[i].claim_order;
// Find the largest subsequence length such that it ends in a value less than our current value
// upper_bound returns first greater value, so we subtract one
const seqLen = upper_bound(1, longest + 1, idx => children[m[idx]].claim_order, current) - 1;
p[i] = m[seqLen] + 1;
const newLen = seqLen + 1;
// We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.
m[newLen] = i;
longest = Math.max(newLen, longest);
}
// The longest increasing subsequence of nodes (initially reversed)
const lis = [];
// The rest of the nodes, nodes that will be moved
const toMove = [];
let last = children.length - 1;
for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {
lis.push(children[cur - 1]);
for (; last >= cur; last--) {
toMove.push(children[last]);
}
last--;
}
for (; last >= 0; last--) {
toMove.push(children[last]);
}
lis.reverse();
// We sort the nodes being moved to guarantee that their insertion order matches the claim order
toMove.sort((a, b) => a.claim_order - b.claim_order);
// Finally, we move the nodes
for (let i = 0, j = 0; i < toMove.length; i++) {
while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {
j++;
}
const anchor = j < lis.length ? lis[j] : null;
target.insertBefore(toMove[i], anchor);
}
}
function append(target, node) {
if (is_hydrating) {
init_hydrate(target);
if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentElement !== target))) {
target.actual_end_child = target.firstChild;
}
if (node !== target.actual_end_child) {
target.insertBefore(node, target.actual_end_child);
}
else {
target.actual_end_child = node.nextSibling;
}
}
else if (node.parentNode !== target) {
target.appendChild(node);
}
target.appendChild(node);
}
function insert(target, node, anchor) {
if (is_hydrating && !anchor) {
append(target, node);
}
else if (node.parentNode !== target || (anchor && node.nextSibling !== anchor)) {
target.insertBefore(node, anchor || null);
}
target.insertBefore(node, anchor || null);
}

@@ -412,3 +303,3 @@ function detach(node) {

}
function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {
function init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {
const parent_component = current_component;

@@ -434,4 +325,6 @@ set_current_component(component);

dirty,
skip_bound: false
skip_bound: false,
root: options.target || parent_component.$$.root
};
append_styles && append_styles($$.root);
let ready = false;

@@ -457,3 +350,2 @@ $$.ctx = instance

if (options.hydrate) {
start_hydrating();
const nodes = children(options.target);

@@ -471,3 +363,2 @@ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion

mount_component(component, options.target, options.anchor, options.customElement);
end_hydrating();
flush();

@@ -503,3 +394,3 @@ }

/* src/components/VtmnButton.svelte generated by Svelte v3.38.3 */
/* src/components/VtmnButton.svelte generated by Svelte v3.40.1 */

@@ -643,13 +534,13 @@ function create_if_block_2(ctx) {

class: button_class_value = [
"vtmn-btn",
'vtmn-btn',
`vtmn-btn_variant--${/*variant*/ ctx[0]}`,
`vtmn-btn_size--${/*size*/ ctx[1]}`,
!/*iconAlone*/ ctx[4] && /*iconLeft*/ ctx[2]
? "vtmn-btn--icon-left"
: "",
? 'vtmn-btn--icon-left'
: '',
!/*iconAlone*/ ctx[4] && /*iconRight*/ ctx[3]
? "vtmn-btn--icon-right"
: "",
/*iconAlone*/ ctx[4] ? "vtmn-btn--icon-alone" : ""
].join(" ")
? 'vtmn-btn--icon-right'
: '',
/*iconAlone*/ ctx[4] ? 'vtmn-btn--icon-alone' : ''
].join(' ')
},

@@ -740,13 +631,13 @@ /*$$props*/ ctx[5]

(!current || dirty & /*variant, size, iconAlone, iconLeft, iconRight*/ 31 && button_class_value !== (button_class_value = [
"vtmn-btn",
'vtmn-btn',
`vtmn-btn_variant--${/*variant*/ ctx[0]}`,
`vtmn-btn_size--${/*size*/ ctx[1]}`,
!/*iconAlone*/ ctx[4] && /*iconLeft*/ ctx[2]
? "vtmn-btn--icon-left"
: "",
? 'vtmn-btn--icon-left'
: '',
!/*iconAlone*/ ctx[4] && /*iconRight*/ ctx[3]
? "vtmn-btn--icon-right"
: "",
/*iconAlone*/ ctx[4] ? "vtmn-btn--icon-alone" : ""
].join(" "))) && { class: button_class_value },
? 'vtmn-btn--icon-right'
: '',
/*iconAlone*/ ctx[4] ? 'vtmn-btn--icon-alone' : ''
].join(' '))) && { class: button_class_value },
dirty & /*$$props*/ 32 && /*$$props*/ ctx[5]

@@ -775,4 +666,4 @@ ]));

let { $$slots: slots = {}, $$scope } = $$props;
let { variant = "primary" } = $$props;
let { size = "medium" } = $$props;
let { variant = 'primary' } = $$props;
let { size = 'medium' } = $$props;
let { iconLeft } = $$props;

@@ -784,8 +675,8 @@ let { iconRight } = $$props;

$$invalidate(5, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
if ("variant" in $$new_props) $$invalidate(0, variant = $$new_props.variant);
if ("size" in $$new_props) $$invalidate(1, size = $$new_props.size);
if ("iconLeft" in $$new_props) $$invalidate(2, iconLeft = $$new_props.iconLeft);
if ("iconRight" in $$new_props) $$invalidate(3, iconRight = $$new_props.iconRight);
if ("iconAlone" in $$new_props) $$invalidate(4, iconAlone = $$new_props.iconAlone);
if ("$$scope" in $$new_props) $$invalidate(6, $$scope = $$new_props.$$scope);
if ('variant' in $$new_props) $$invalidate(0, variant = $$new_props.variant);
if ('size' in $$new_props) $$invalidate(1, size = $$new_props.size);
if ('iconLeft' in $$new_props) $$invalidate(2, iconLeft = $$new_props.iconLeft);
if ('iconRight' in $$new_props) $$invalidate(3, iconRight = $$new_props.iconRight);
if ('iconAlone' in $$new_props) $$invalidate(4, iconAlone = $$new_props.iconAlone);
if ('$$scope' in $$new_props) $$invalidate(6, $$scope = $$new_props.$$scope);
};

@@ -792,0 +683,0 @@

@@ -75,116 +75,4 @@ (function (global, factory) {

}
// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM
// at the end of hydration without touching the remaining nodes.
let is_hydrating = false;
function start_hydrating() {
is_hydrating = true;
}
function end_hydrating() {
is_hydrating = false;
}
function upper_bound(low, high, key, value) {
// Return first index of value larger than input value in the range [low, high)
while (low < high) {
const mid = low + ((high - low) >> 1);
if (key(mid) <= value) {
low = mid + 1;
}
else {
high = mid;
}
}
return low;
}
function init_hydrate(target) {
if (target.hydrate_init)
return;
target.hydrate_init = true;
// We know that all children have claim_order values since the unclaimed have been detached
const children = target.childNodes;
/*
* Reorder claimed children optimally.
* We can reorder claimed children optimally by finding the longest subsequence of
* nodes that are already claimed in order and only moving the rest. The longest
* subsequence subsequence of nodes that are claimed in order can be found by
* computing the longest increasing subsequence of .claim_order values.
*
* This algorithm is optimal in generating the least amount of reorder operations
* possible.
*
* Proof:
* We know that, given a set of reordering operations, the nodes that do not move
* always form an increasing subsequence, since they do not move among each other
* meaning that they must be already ordered among each other. Thus, the maximal
* set of nodes that do not move form a longest increasing subsequence.
*/
// Compute longest increasing subsequence
// m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j
const m = new Int32Array(children.length + 1);
// Predecessor indices + 1
const p = new Int32Array(children.length);
m[0] = -1;
let longest = 0;
for (let i = 0; i < children.length; i++) {
const current = children[i].claim_order;
// Find the largest subsequence length such that it ends in a value less than our current value
// upper_bound returns first greater value, so we subtract one
const seqLen = upper_bound(1, longest + 1, idx => children[m[idx]].claim_order, current) - 1;
p[i] = m[seqLen] + 1;
const newLen = seqLen + 1;
// We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.
m[newLen] = i;
longest = Math.max(newLen, longest);
}
// The longest increasing subsequence of nodes (initially reversed)
const lis = [];
// The rest of the nodes, nodes that will be moved
const toMove = [];
let last = children.length - 1;
for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {
lis.push(children[cur - 1]);
for (; last >= cur; last--) {
toMove.push(children[last]);
}
last--;
}
for (; last >= 0; last--) {
toMove.push(children[last]);
}
lis.reverse();
// We sort the nodes being moved to guarantee that their insertion order matches the claim order
toMove.sort((a, b) => a.claim_order - b.claim_order);
// Finally, we move the nodes
for (let i = 0, j = 0; i < toMove.length; i++) {
while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {
j++;
}
const anchor = j < lis.length ? lis[j] : null;
target.insertBefore(toMove[i], anchor);
}
}
function append(target, node) {
if (is_hydrating) {
init_hydrate(target);
if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentElement !== target))) {
target.actual_end_child = target.firstChild;
}
if (node !== target.actual_end_child) {
target.insertBefore(node, target.actual_end_child);
}
else {
target.actual_end_child = node.nextSibling;
}
}
else if (node.parentNode !== target) {
target.appendChild(node);
}
}
function insert(target, node, anchor) {
if (is_hydrating && !anchor) {
append(target, node);
}
else if (node.parentNode !== target || (anchor && node.nextSibling !== anchor)) {
target.insertBefore(node, anchor || null);
}
target.insertBefore(node, anchor || null);
}

@@ -393,3 +281,3 @@ function detach(node) {

}
function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {
function init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {
const parent_component = current_component;

@@ -415,4 +303,6 @@ set_current_component(component);

dirty,
skip_bound: false
skip_bound: false,
root: options.target || parent_component.$$.root
};
append_styles && append_styles($$.root);
let ready = false;

@@ -438,3 +328,2 @@ $$.ctx = instance

if (options.hydrate) {
start_hydrating();
const nodes = children(options.target);

@@ -452,3 +341,2 @@ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion

mount_component(component, options.target, options.anchor, options.customElement);
end_hydrating();
flush();

@@ -484,3 +372,3 @@ }

/* src/components/VtmnLink.svelte generated by Svelte v3.38.3 */
/* src/components/VtmnLink.svelte generated by Svelte v3.40.1 */

@@ -497,7 +385,7 @@ function create_fragment(ctx) {

class: a_class_value = [
"vtmn-link",
'vtmn-link',
`vtmn-link_size--${/*size*/ ctx[0]}`,
/*standalone*/ ctx[1] && "vtmn-link--standalone",
/*standalone*/ ctx[1] && /*iconAlong*/ ctx[2] && "vtmn-link--icon-along"
].filter(Boolean).join(" ")
/*standalone*/ ctx[1] && 'vtmn-link--standalone',
/*standalone*/ ctx[1] && /*iconAlong*/ ctx[2] && 'vtmn-link--icon-along'
].filter(Boolean).join(' ')
},

@@ -537,7 +425,7 @@ /*$$props*/ ctx[3]

(!current || dirty & /*size, standalone, iconAlong*/ 7 && a_class_value !== (a_class_value = [
"vtmn-link",
'vtmn-link',
`vtmn-link_size--${/*size*/ ctx[0]}`,
/*standalone*/ ctx[1] && "vtmn-link--standalone",
/*standalone*/ ctx[1] && /*iconAlong*/ ctx[2] && "vtmn-link--icon-along"
].filter(Boolean).join(" "))) && { class: a_class_value },
/*standalone*/ ctx[1] && 'vtmn-link--standalone',
/*standalone*/ ctx[1] && /*iconAlong*/ ctx[2] && 'vtmn-link--icon-along'
].filter(Boolean).join(' '))) && { class: a_class_value },
dirty & /*$$props*/ 8 && /*$$props*/ ctx[3]

@@ -564,3 +452,3 @@ ]));

let { $$slots: slots = {}, $$scope } = $$props;
let { size = "medium" } = $$props;
let { size = 'medium' } = $$props;
let { standalone = false } = $$props;

@@ -571,6 +459,6 @@ let { iconAlong = false } = $$props;

$$invalidate(3, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
if ("size" in $$new_props) $$invalidate(0, size = $$new_props.size);
if ("standalone" in $$new_props) $$invalidate(1, standalone = $$new_props.standalone);
if ("iconAlong" in $$new_props) $$invalidate(2, iconAlong = $$new_props.iconAlong);
if ("$$scope" in $$new_props) $$invalidate(4, $$scope = $$new_props.$$scope);
if ('size' in $$new_props) $$invalidate(0, size = $$new_props.size);
if ('standalone' in $$new_props) $$invalidate(1, standalone = $$new_props.standalone);
if ('iconAlong' in $$new_props) $$invalidate(2, iconAlong = $$new_props.iconAlong);
if ('$$scope' in $$new_props) $$invalidate(4, $$scope = $$new_props.$$scope);
};

@@ -577,0 +465,0 @@

@@ -39,116 +39,7 @@ (function (global, factory) {

}
// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM
// at the end of hydration without touching the remaining nodes.
let is_hydrating = false;
function start_hydrating() {
is_hydrating = true;
}
function end_hydrating() {
is_hydrating = false;
}
function upper_bound(low, high, key, value) {
// Return first index of value larger than input value in the range [low, high)
while (low < high) {
const mid = low + ((high - low) >> 1);
if (key(mid) <= value) {
low = mid + 1;
}
else {
high = mid;
}
}
return low;
}
function init_hydrate(target) {
if (target.hydrate_init)
return;
target.hydrate_init = true;
// We know that all children have claim_order values since the unclaimed have been detached
const children = target.childNodes;
/*
* Reorder claimed children optimally.
* We can reorder claimed children optimally by finding the longest subsequence of
* nodes that are already claimed in order and only moving the rest. The longest
* subsequence subsequence of nodes that are claimed in order can be found by
* computing the longest increasing subsequence of .claim_order values.
*
* This algorithm is optimal in generating the least amount of reorder operations
* possible.
*
* Proof:
* We know that, given a set of reordering operations, the nodes that do not move
* always form an increasing subsequence, since they do not move among each other
* meaning that they must be already ordered among each other. Thus, the maximal
* set of nodes that do not move form a longest increasing subsequence.
*/
// Compute longest increasing subsequence
// m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j
const m = new Int32Array(children.length + 1);
// Predecessor indices + 1
const p = new Int32Array(children.length);
m[0] = -1;
let longest = 0;
for (let i = 0; i < children.length; i++) {
const current = children[i].claim_order;
// Find the largest subsequence length such that it ends in a value less than our current value
// upper_bound returns first greater value, so we subtract one
const seqLen = upper_bound(1, longest + 1, idx => children[m[idx]].claim_order, current) - 1;
p[i] = m[seqLen] + 1;
const newLen = seqLen + 1;
// We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.
m[newLen] = i;
longest = Math.max(newLen, longest);
}
// The longest increasing subsequence of nodes (initially reversed)
const lis = [];
// The rest of the nodes, nodes that will be moved
const toMove = [];
let last = children.length - 1;
for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {
lis.push(children[cur - 1]);
for (; last >= cur; last--) {
toMove.push(children[last]);
}
last--;
}
for (; last >= 0; last--) {
toMove.push(children[last]);
}
lis.reverse();
// We sort the nodes being moved to guarantee that their insertion order matches the claim order
toMove.sort((a, b) => a.claim_order - b.claim_order);
// Finally, we move the nodes
for (let i = 0, j = 0; i < toMove.length; i++) {
while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {
j++;
}
const anchor = j < lis.length ? lis[j] : null;
target.insertBefore(toMove[i], anchor);
}
}
function append(target, node) {
if (is_hydrating) {
init_hydrate(target);
if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentElement !== target))) {
target.actual_end_child = target.firstChild;
}
if (node !== target.actual_end_child) {
target.insertBefore(node, target.actual_end_child);
}
else {
target.actual_end_child = node.nextSibling;
}
}
else if (node.parentNode !== target) {
target.appendChild(node);
}
target.appendChild(node);
}
function insert(target, node, anchor) {
if (is_hydrating && !anchor) {
append(target, node);
}
else if (node.parentNode !== target || (anchor && node.nextSibling !== anchor)) {
target.insertBefore(node, anchor || null);
}
target.insertBefore(node, anchor || null);
}

@@ -357,3 +248,3 @@ function detach(node) {

}
function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {
function init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {
const parent_component = current_component;

@@ -379,4 +270,6 @@ set_current_component(component);

dirty,
skip_bound: false
skip_bound: false,
root: options.target || parent_component.$$.root
};
append_styles && append_styles($$.root);
let ready = false;

@@ -402,3 +295,2 @@ $$.ctx = instance

if (options.hydrate) {
start_hydrating();
const nodes = children(options.target);

@@ -416,3 +308,2 @@ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion

mount_component(component, options.target, options.anchor, options.customElement);
end_hydrating();
flush();

@@ -448,3 +339,3 @@ }

/* src/components/VtmnTextInput.svelte generated by Svelte v3.38.3 */
/* src/components/VtmnTextInput.svelte generated by Svelte v3.40.1 */

@@ -715,11 +606,11 @@ function create_if_block_2(ctx) {

$$invalidate(9, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
if ("identifier" in $$new_props) $$invalidate(0, identifier = $$new_props.identifier);
if ("labelText" in $$new_props) $$invalidate(1, labelText = $$new_props.labelText);
if ("placeholder" in $$new_props) $$invalidate(2, placeholder = $$new_props.placeholder);
if ("disabled" in $$new_props) $$invalidate(3, disabled = $$new_props.disabled);
if ("helperText" in $$new_props) $$invalidate(4, helperText = $$new_props.helperText);
if ("multiline" in $$new_props) $$invalidate(5, multiline = $$new_props.multiline);
if ("valid" in $$new_props) $$invalidate(6, valid = $$new_props.valid);
if ("error" in $$new_props) $$invalidate(7, error = $$new_props.error);
if ("icon" in $$new_props) $$invalidate(8, icon = $$new_props.icon);
if ('identifier' in $$new_props) $$invalidate(0, identifier = $$new_props.identifier);
if ('labelText' in $$new_props) $$invalidate(1, labelText = $$new_props.labelText);
if ('placeholder' in $$new_props) $$invalidate(2, placeholder = $$new_props.placeholder);
if ('disabled' in $$new_props) $$invalidate(3, disabled = $$new_props.disabled);
if ('helperText' in $$new_props) $$invalidate(4, helperText = $$new_props.helperText);
if ('multiline' in $$new_props) $$invalidate(5, multiline = $$new_props.multiline);
if ('valid' in $$new_props) $$invalidate(6, valid = $$new_props.valid);
if ('error' in $$new_props) $$invalidate(7, error = $$new_props.error);
if ('icon' in $$new_props) $$invalidate(8, icon = $$new_props.icon);
};

@@ -726,0 +617,0 @@

7

package.json
{
"name": "@vtmn/svelte",
"version": "0.5.0",
"version": "0.5.1",
"description": "Decathlon Design System - Vitamin Svelte library",

@@ -33,3 +33,2 @@ "keywords": [

"@rollup/plugin-node-resolve": "^13.0.0",
"@vtmn/css-button": "^0.4.0",
"@vtmn/icons": "^0.3.2",

@@ -42,3 +41,3 @@ "chokidar-cli": "^2.1.0",

"rollup-plugin-svelte": "^7.1.0",
"svelte": "3.38.3",
"svelte": "3.40.1",
"svelte-preprocess": "4.7.4"

@@ -55,3 +54,3 @@ },

],
"gitHead": "49f66bc8d063367267d9cfb5c7365f3a1183b3b0"
"gitHead": "03669ad732047733785fce57d0f23deade71c11f"
}

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