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

@kdujs/runtime-dom-canary

Package Overview
Dependencies
Maintainers
0
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kdujs/runtime-dom-canary - npm Package Compare versions

Comparing version 3.20240617.0 to 3.20240624.0-minor.0

55

dist/runtime-dom.cjs.js

@@ -405,7 +405,2 @@ 'use strict';

const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
function useCssVars(getter) {
return;
}
function patchStyle(el, prev, next) {

@@ -429,6 +424,2 @@ const style = el.style;

if (prev !== next) {
const cssVarText = style[CSS_VAR_TEXT];
if (cssVarText) {
next += ";" + cssVarText;
}
style.cssText = next;

@@ -633,4 +624,3 @@ }

const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
const nativeOnRE = /^on[a-z]/;
const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {

@@ -669,3 +659,3 @@ if (key === "class") {

}
if (key in el && isNativeOn(key) && shared.isFunction(value)) {
if (key in el && nativeOnRE.test(key) && shared.isFunction(value)) {
return true;

@@ -687,9 +677,3 @@ }

}
if (key === "width" || key === "height") {
const tag = el.tagName;
if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
return false;
}
}
if (isNativeOn(key) && shared.isString(value)) {
if (nativeOnRE.test(key) && shared.isString(value)) {
return false;

@@ -943,2 +927,6 @@ }

function useCssVars(getter) {
return;
}
const positionMap = /* @__PURE__ */ new WeakMap();

@@ -1118,7 +1106,2 @@ const newPositionMap = /* @__PURE__ */ new WeakMap();

return;
const elValue = number || el.type === "number" ? shared.looseToNumber(el.value) : el.value;
const newValue = value == null ? "" : value;
if (elValue === newValue) {
return;
}
if (document.activeElement === el && el.type !== "range") {

@@ -1128,7 +1111,13 @@ if (lazy) {

}
if (trim && el.value.trim() === newValue) {
if (trim && el.value.trim() === value) {
return;
}
if ((number || el.type === "number") && shared.looseToNumber(el.value) === value) {
return;
}
}
el.value = newValue;
const newValue = value == null ? "" : value;
if (el.value !== newValue) {
el.value = newValue;
}
}

@@ -1353,5 +1342,3 @@ };

const withModifiers = (fn, modifiers) => {
const cache = fn._withMods || (fn._withMods = {});
const cacheKey = modifiers.join(".");
return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
return (event, ...args) => {
for (let i = 0; i < modifiers.length; i++) {

@@ -1363,3 +1350,3 @@ const guard = modifierGuards[modifiers[i]];

return fn(event, ...args);
});
};
};

@@ -1376,5 +1363,3 @@ const keyNames = {

const withKeys = (fn, modifiers) => {
const cache = fn._withKeys || (fn._withKeys = {});
const cacheKey = modifiers.join(".");
return cache[cacheKey] || (cache[cacheKey] = (event) => {
return (event) => {
if (!("key" in event)) {

@@ -1387,3 +1372,3 @@ return;

}
});
};
};

@@ -1471,3 +1456,3 @@

- For kdu-cli: see https://kdujs-cli.web.app/guide/webpack.html#modifying-options-of-a-loader
- For lahm: pass it via @lahmjs/plugin-kdu options.`;
- For wite: pass it via @witejs/plugin-kdu options.`;
Object.defineProperty(app.config, "compilerOptions", {

@@ -1474,0 +1459,0 @@ get() {

@@ -402,7 +402,2 @@ 'use strict';

const CSS_VAR_TEXT = Symbol("");
function useCssVars(getter) {
return;
}
function patchStyle(el, prev, next) {

@@ -426,6 +421,2 @@ const style = el.style;

if (prev !== next) {
const cssVarText = style[CSS_VAR_TEXT];
if (cssVarText) {
next += ";" + cssVarText;
}
style.cssText = next;

@@ -616,4 +607,3 @@ }

const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
const nativeOnRE = /^on[a-z]/;
const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {

@@ -652,3 +642,3 @@ if (key === "class") {

}
if (key in el && isNativeOn(key) && shared.isFunction(value)) {
if (key in el && nativeOnRE.test(key) && shared.isFunction(value)) {
return true;

@@ -670,9 +660,3 @@ }

}
if (key === "width" || key === "height") {
const tag = el.tagName;
if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
return false;
}
}
if (isNativeOn(key) && shared.isString(value)) {
if (nativeOnRE.test(key) && shared.isString(value)) {
return false;

@@ -904,2 +888,6 @@ }

function useCssVars(getter) {
return;
}
const positionMap = /* @__PURE__ */ new WeakMap();

@@ -1077,7 +1065,2 @@ const newPositionMap = /* @__PURE__ */ new WeakMap();

return;
const elValue = number || el.type === "number" ? shared.looseToNumber(el.value) : el.value;
const newValue = value == null ? "" : value;
if (elValue === newValue) {
return;
}
if (document.activeElement === el && el.type !== "range") {

@@ -1087,7 +1070,13 @@ if (lazy) {

}
if (trim && el.value.trim() === newValue) {
if (trim && el.value.trim() === value) {
return;
}
if ((number || el.type === "number") && shared.looseToNumber(el.value) === value) {
return;
}
}
el.value = newValue;
const newValue = value == null ? "" : value;
if (el.value !== newValue) {
el.value = newValue;
}
}

@@ -1309,5 +1298,3 @@ };

const withModifiers = (fn, modifiers) => {
const cache = fn._withMods || (fn._withMods = {});
const cacheKey = modifiers.join(".");
return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
return (event, ...args) => {
for (let i = 0; i < modifiers.length; i++) {

@@ -1319,3 +1306,3 @@ const guard = modifierGuards[modifiers[i]];

return fn(event, ...args);
});
};
};

@@ -1332,5 +1319,3 @@ const keyNames = {

const withKeys = (fn, modifiers) => {
const cache = fn._withKeys || (fn._withKeys = {});
const cacheKey = modifiers.join(".");
return cache[cacheKey] || (cache[cacheKey] = (event) => {
return (event) => {
if (!("key" in event)) {

@@ -1343,3 +1328,3 @@ return;

}
});
};
};

@@ -1346,0 +1331,0 @@

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

import { SetupContext, RenderFunction, ComputedOptions, MethodOptions, ComponentOptionsMixin, EmitsOptions, ComponentInjectOptions, SlotsType, ComponentOptionsWithoutProps, ComponentOptionsWithArrayProps, ComponentPropsOptions, ComponentOptionsWithObjectProps, ExtractPropTypes, DefineComponent, RootHydrateFunction, ConcreteComponent, BaseTransitionProps, FunctionalComponent, ObjectDirective, KNodeRef, RootRenderFunction, CreateAppFunction } from '@kdujs/runtime-core';
import { SetupContext, RenderFunction, ComputedOptions, MethodOptions, ComponentOptionsMixin, EmitsOptions, ComponentInjectOptions, SlotsType, ComponentOptionsWithoutProps, ComponentOptionsWithArrayProps, ComponentPropsOptions, ComponentOptionsWithObjectProps, ExtractPropTypes, ComponentPublicInstance, RootHydrateFunction, ConcreteComponent, BaseTransitionProps, FunctionalComponent, ObjectDirective, KNodeRef, RootRenderFunction, CreateAppFunction } from '@kdujs/runtime-core';
export * from '@kdujs/runtime-core';

@@ -20,3 +20,5 @@ import * as CSS from 'csstype';

}): KduElementConstructor<ExtractPropTypes<PropsOptions>>;
export declare function defineCustomElement<P>(options: DefineComponent<P, any, any, any>): KduElementConstructor<ExtractPropTypes<P>>;
export declare function defineCustomElement(options: {
new (...args: any[]): ComponentPublicInstance;
}): KduElementConstructor;
/*! #__NO_SIDE_EFFECTS__ */

@@ -106,15 +108,7 @@ export declare const defineSSRCustomElement: typeof defineCustomElement;

*/
export declare const withModifiers: <T extends (event: Event, ...args: unknown[]) => any>(fn: T & {
_withMods?: {
[key: string]: T;
} | undefined;
}, modifiers: string[]) => T;
export declare const withModifiers: (fn: Function, modifiers: string[]) => (event: Event, ...args: unknown[]) => any;
/**
* @private
*/
export declare const withKeys: <T extends (event: KeyboardEvent) => any>(fn: T & {
_withKeys?: {
[k: string]: T;
} | undefined;
}, modifiers: string[]) => T;
export declare const withKeys: (fn: Function, modifiers: string[]) => (event: KeyboardEvent) => any;

@@ -282,3 +276,3 @@ declare const kShowOldKey: unique symbol;

*/
'aria-relevant'?: 'additions' | 'additions removals' | 'additions text' | 'all' | 'removals' | 'removals additions' | 'removals text' | 'text' | 'text additions' | 'text removals';
'aria-relevant'?: 'additions' | 'additions text' | 'all' | 'removals' | 'text';
/** Indicates that user input is required on the element before a form may be submitted. */

@@ -327,3 +321,3 @@ 'aria-required'?: Booleanish;

}
export type StyleValue = false | null | undefined | string | CSSProperties | Array<StyleValue>;
export type StyleValue = string | CSSProperties | Array<StyleValue>;
export interface HTMLAttributes extends AriaAttributes, EventHandlers<Events> {

@@ -334,3 +328,3 @@ innerHTML?: string;

accesskey?: string;
contenteditable?: Booleanish | 'inherit' | 'plaintext-only';
contenteditable?: Booleanish | 'inherit';
contextmenu?: string;

@@ -425,3 +419,3 @@ dir?: string;

type?: 'submit' | 'reset' | 'button';
value?: string | ReadonlyArray<string> | number;
value?: string | string[] | number;
}

@@ -440,7 +434,6 @@ export interface CanvasHTMLAttributes extends HTMLAttributes {

export interface DataHTMLAttributes extends HTMLAttributes {
value?: string | ReadonlyArray<string> | number;
value?: string | string[] | number;
}
export interface DetailsHTMLAttributes extends HTMLAttributes {
open?: Booleanish;
onToggle?: Event;
}

@@ -482,8 +475,5 @@ export interface DelHTMLAttributes extends HTMLAttributes {

allowtransparency?: Booleanish;
/** @deprecated */
frameborder?: Numberish;
height?: Numberish;
/** @deprecated */
marginheight?: Numberish;
/** @deprecated */
marginwidth?: Numberish;

@@ -493,3 +483,2 @@ name?: string;

sandbox?: string;
/** @deprecated */
scrolling?: string;

@@ -506,3 +495,2 @@ seamless?: Booleanish;

height?: Numberish;
loading?: 'eager' | 'lazy';
referrerpolicy?: HTMLAttributeReferrerPolicy;

@@ -514,2 +502,3 @@ sizes?: string;

width?: Numberish;
loading?: 'lazy' | 'eager';
}

@@ -530,3 +519,2 @@ export interface InsHTMLAttributes extends HTMLAttributes {

disabled?: Booleanish;
enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
form?: string;

@@ -572,3 +560,3 @@ formaction?: string;

export interface LiHTMLAttributes extends HTMLAttributes {
value?: string | ReadonlyArray<string> | number;
value?: string | string[] | number;
}

@@ -586,3 +574,2 @@ export interface LinkHTMLAttributes extends HTMLAttributes {

type?: string;
charset?: string;
}

@@ -620,3 +607,3 @@ export interface MapHTMLAttributes extends HTMLAttributes {

optimum?: Numberish;
value?: string | ReadonlyArray<string> | number;
value?: string | string[] | number;
}

@@ -659,11 +646,10 @@ export interface QuoteHTMLAttributes extends HTMLAttributes {

name?: string;
value?: string | ReadonlyArray<string> | number;
value?: string | string[] | number;
}
export interface ProgressHTMLAttributes extends HTMLAttributes {
max?: Numberish;
value?: string | ReadonlyArray<string> | number;
value?: string | string[] | number;
}
export interface ScriptHTMLAttributes extends HTMLAttributes {
async?: Booleanish;
/** @deprecated */
charset?: string;

@@ -707,3 +693,2 @@ crossorigin?: string;

summary?: string;
width?: Numberish;
}

@@ -724,3 +709,3 @@ export interface TextareaHTMLAttributes extends HTMLAttributes {

rows?: Numberish;
value?: string | ReadonlyArray<string> | number;
value?: string | string[] | number;
wrap?: string;

@@ -734,5 +719,2 @@ }

scope?: string;
abbr?: string;
height?: Numberish;
width?: Numberish;
valign?: 'top' | 'middle' | 'bottom' | 'baseline';

@@ -746,3 +728,2 @@ }

scope?: string;
abbr?: string;
}

@@ -765,3 +746,2 @@ export interface TimeHTMLAttributes extends HTMLAttributes {

disablePictureInPicture?: Booleanish;
disableRemotePlayback?: Booleanish;
}

@@ -809,3 +789,2 @@ export interface WebViewHTMLAttributes extends HTMLAttributes {

tabindex?: Numberish;
crossOrigin?: 'anonymous' | 'use-credentials' | '';
'accent-height'?: Numberish;

@@ -1041,3 +1020,2 @@ accumulate?: 'none' | 'sum';

xmlns?: string;
xmlnsXlink?: string;
y1?: Numberish;

@@ -1044,0 +1022,0 @@ y2?: Numberish;

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

import { h, BaseTransition, BaseTransitionPropsValidators, assertNumber, getCurrentInstance, warn, watchPostEffect, onMounted, onUnmounted, Fragment, Static, camelize, callWithAsyncErrorHandling, defineComponent, nextTick, createKNode, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, isRuntimeOnly, createRenderer, createHydrationRenderer } from '@kdujs/runtime-core';
import { h, BaseTransition, BaseTransitionPropsValidators, assertNumber, warn, camelize, callWithAsyncErrorHandling, defineComponent, nextTick, createKNode, getCurrentInstance, watchPostEffect, onMounted, onUnmounted, Fragment, Static, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, isRuntimeOnly, createRenderer, createHydrationRenderer } from '@kdujs/runtime-core';
export * from '@kdujs/runtime-core';

@@ -402,65 +402,2 @@ import { extend, isObject, toNumber, isArray, isString, hyphenate, capitalize, isSpecialBooleanAttr, includeBooleanAttr, isOn, isModelListener, isFunction, camelize as camelize$1, EMPTY_OBJ, looseToNumber, looseIndexOf, isSet, looseEqual, invokeArrayFns, isHTMLTag, isSVGTag } from '@kdujs/shared';

const CSS_VAR_TEXT = Symbol(!!(process.env.NODE_ENV !== "production") ? "CSS_VAR_TEXT" : "");
function useCssVars(getter) {
const instance = getCurrentInstance();
if (!instance) {
!!(process.env.NODE_ENV !== "production") && warn(`useCssVars is called without current active component instance.`);
return;
}
const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
Array.from(
document.querySelectorAll(`[data-k-owner="${instance.uid}"]`)
).forEach((node) => setVarsOnNode(node, vars));
};
const setVars = () => {
const vars = getter(instance.proxy);
setVarsOnKNode(instance.subTree, vars);
updateTeleports(vars);
};
watchPostEffect(setVars);
onMounted(() => {
const ob = new MutationObserver(setVars);
ob.observe(instance.subTree.el.parentNode, { childList: true });
onUnmounted(() => ob.disconnect());
});
}
function setVarsOnKNode(knode, vars) {
if (knode.shapeFlag & 128) {
const suspense = knode.suspense;
knode = suspense.activeBranch;
if (suspense.pendingBranch && !suspense.isHydrating) {
suspense.effects.push(() => {
setVarsOnKNode(suspense.activeBranch, vars);
});
}
}
while (knode.component) {
knode = knode.component.subTree;
}
if (knode.shapeFlag & 1 && knode.el) {
setVarsOnNode(knode.el, vars);
} else if (knode.type === Fragment) {
knode.children.forEach((c) => setVarsOnKNode(c, vars));
} else if (knode.type === Static) {
let { el, anchor } = knode;
while (el) {
setVarsOnNode(el, vars);
if (el === anchor)
break;
el = el.nextSibling;
}
}
}
function setVarsOnNode(el, vars) {
if (el.nodeType === 1) {
const style = el.style;
let cssText = "";
for (const key in vars) {
style.setProperty(`--${key}`, vars[key]);
cssText += `--${key}: ${vars[key]};`;
}
style[CSS_VAR_TEXT] = cssText;
}
}
function patchStyle(el, prev, next) {

@@ -484,6 +421,2 @@ const style = el.style;

if (prev !== next) {
const cssVarText = style[CSS_VAR_TEXT];
if (cssVarText) {
next += ";" + cssVarText;
}
style.cssText = next;

@@ -688,4 +621,3 @@ }

const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
const nativeOnRE = /^on[a-z]/;
const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {

@@ -724,3 +656,3 @@ if (key === "class") {

}
if (key in el && isNativeOn(key) && isFunction(value)) {
if (key in el && nativeOnRE.test(key) && isFunction(value)) {
return true;

@@ -742,9 +674,3 @@ }

}
if (key === "width" || key === "height") {
const tag = el.tagName;
if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
return false;
}
}
if (isNativeOn(key) && isString(value)) {
if (nativeOnRE.test(key) && isString(value)) {
return false;

@@ -998,2 +924,61 @@ }

function useCssVars(getter) {
const instance = getCurrentInstance();
if (!instance) {
!!(process.env.NODE_ENV !== "production") && warn(`useCssVars is called without current active component instance.`);
return;
}
const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
Array.from(
document.querySelectorAll(`[data-k-owner="${instance.uid}"]`)
).forEach((node) => setVarsOnNode(node, vars));
};
const setVars = () => {
const vars = getter(instance.proxy);
setVarsOnKNode(instance.subTree, vars);
updateTeleports(vars);
};
watchPostEffect(setVars);
onMounted(() => {
const ob = new MutationObserver(setVars);
ob.observe(instance.subTree.el.parentNode, { childList: true });
onUnmounted(() => ob.disconnect());
});
}
function setVarsOnKNode(knode, vars) {
if (knode.shapeFlag & 128) {
const suspense = knode.suspense;
knode = suspense.activeBranch;
if (suspense.pendingBranch && !suspense.isHydrating) {
suspense.effects.push(() => {
setVarsOnKNode(suspense.activeBranch, vars);
});
}
}
while (knode.component) {
knode = knode.component.subTree;
}
if (knode.shapeFlag & 1 && knode.el) {
setVarsOnNode(knode.el, vars);
} else if (knode.type === Fragment) {
knode.children.forEach((c) => setVarsOnKNode(c, vars));
} else if (knode.type === Static) {
let { el, anchor } = knode;
while (el) {
setVarsOnNode(el, vars);
if (el === anchor)
break;
el = el.nextSibling;
}
}
}
function setVarsOnNode(el, vars) {
if (el.nodeType === 1) {
const style = el.style;
for (const key in vars) {
style.setProperty(`--${key}`, vars[key]);
}
}
}
const positionMap = /* @__PURE__ */ new WeakMap();

@@ -1173,7 +1158,2 @@ const newPositionMap = /* @__PURE__ */ new WeakMap();

return;
const elValue = number || el.type === "number" ? looseToNumber(el.value) : el.value;
const newValue = value == null ? "" : value;
if (elValue === newValue) {
return;
}
if (document.activeElement === el && el.type !== "range") {

@@ -1183,7 +1163,13 @@ if (lazy) {

}
if (trim && el.value.trim() === newValue) {
if (trim && el.value.trim() === value) {
return;
}
if ((number || el.type === "number") && looseToNumber(el.value) === value) {
return;
}
}
el.value = newValue;
const newValue = value == null ? "" : value;
if (el.value !== newValue) {
el.value = newValue;
}
}

@@ -1408,5 +1394,3 @@ };

const withModifiers = (fn, modifiers) => {
const cache = fn._withMods || (fn._withMods = {});
const cacheKey = modifiers.join(".");
return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
return (event, ...args) => {
for (let i = 0; i < modifiers.length; i++) {

@@ -1418,3 +1402,3 @@ const guard = modifierGuards[modifiers[i]];

return fn(event, ...args);
});
};
};

@@ -1431,5 +1415,3 @@ const keyNames = {

const withKeys = (fn, modifiers) => {
const cache = fn._withKeys || (fn._withKeys = {});
const cacheKey = modifiers.join(".");
return cache[cacheKey] || (cache[cacheKey] = (event) => {
return (event) => {
if (!("key" in event)) {

@@ -1442,3 +1424,3 @@ return;

}
});
};
};

@@ -1526,3 +1508,3 @@

- For kdu-cli: see https://kdujs-cli.web.app/guide/webpack.html#modifying-options-of-a-loader
- For lahm: pass it via @lahmjs/plugin-kdu options.`;
- For wite: pass it via @witejs/plugin-kdu options.`;
Object.defineProperty(app.config, "compilerOptions", {

@@ -1529,0 +1511,0 @@ get() {

{
"name": "@kdujs/runtime-dom-canary",
"version": "3.20240617.0",
"version": "3.20240624.0-minor.0",
"description": "@kdujs/runtime-dom",

@@ -38,6 +38,6 @@ "main": "index.js",

"dependencies": {
"@kdujs/shared": "npm:@kdujs/shared-canary@3.20240617.0",
"@kdujs/runtime-core": "npm:@kdujs/runtime-core-canary@3.20240617.0",
"csstype": "^3.1.3"
"@kdujs/shared": "npm:@kdujs/shared-canary@3.20240624.0-minor.0",
"@kdujs/runtime-core": "npm:@kdujs/runtime-core-canary@3.20240624.0-minor.0",
"csstype": "^3.1.2"
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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