Comparing version 4.3.4 to 4.3.5
@@ -487,2 +487,10 @@ 'use strict'; | ||
*/ | ||
getElementById(id) { | ||
return getElementById(this, new RegExp(`^${id}$`)); | ||
} | ||
/** | ||
* @param {string} tagName | ||
* @returns {import("./element.js").default[]} | ||
*/ | ||
getElementsByTagName(tagName) { | ||
@@ -537,2 +545,14 @@ return getElementsByTagName(this, new RegExp(`^${tagName}$`, 'i')); | ||
const getElementById = ({ [childNodes]: nodes }, re) => { | ||
for (const node of nodes) { | ||
if (node[nodeType] === ELEMENT_NODE) { | ||
if (re.test(node.id)) | ||
return node; | ||
const element = getElementById(node, re); | ||
if (element) return element; | ||
} | ||
} | ||
return null; | ||
}; | ||
const getElementsByTagName = ({ [childNodes]: nodes }, re) => { | ||
@@ -539,0 +559,0 @@ const elements = []; |
'use strict'; | ||
const { effect } = require('@preact/signals-core'); | ||
(m => Object.keys(m).map(k => k !== 'default' && (exports[k] = m[k]))) | ||
(require('@preact/signals-core')); | ||
const { reactive } = require('../reactive.js'); | ||
(m => { | ||
@@ -15,3 +12,6 @@ exports.Hole = m.Hole; | ||
})(require('../reactive.js')); | ||
const { effect } = require('@preact/signals-core'); | ||
const { reactive } = require('../reactive.js'); | ||
const render = reactive(effect); | ||
exports.render = render; |
'use strict'; | ||
const { effect } = require('@webreflection/signal'); | ||
(m => Object.keys(m).map(k => k !== 'default' && (exports[k] = m[k]))) | ||
(require('@webreflection/signal')); | ||
const { reactive } = require('../reactive.js'); | ||
(m => { | ||
@@ -15,3 +12,6 @@ exports.Hole = m.Hole; | ||
})(require('../reactive.js')); | ||
const { effect } = require('@webreflection/signal'); | ||
const { reactive } = require('../reactive.js'); | ||
const render = reactive(effect); | ||
exports.render = render; |
@@ -486,2 +486,10 @@ import { ELEMENT_NODE, TEXT_NODE } from 'domconstants/constants'; | ||
*/ | ||
getElementById(id) { | ||
return getElementById(this, new RegExp(`^${id}$`)); | ||
} | ||
/** | ||
* @param {string} tagName | ||
* @returns {import("./element.js").default[]} | ||
*/ | ||
getElementsByTagName(tagName) { | ||
@@ -536,2 +544,14 @@ return getElementsByTagName(this, new RegExp(`^${tagName}$`, 'i')); | ||
const getElementById = ({ [childNodes]: nodes }, re) => { | ||
for (const node of nodes) { | ||
if (node[nodeType] === ELEMENT_NODE) { | ||
if (re.test(node.id)) | ||
return node; | ||
const element = getElementById(node, re); | ||
if (element) return element; | ||
} | ||
} | ||
return null; | ||
}; | ||
const getElementsByTagName = ({ [childNodes]: nodes }, re) => { | ||
@@ -538,0 +558,0 @@ const elements = []; |
@@ -1,6 +0,6 @@ | ||
import { effect } from '@preact/signals-core'; | ||
export * from '@preact/signals-core'; | ||
export { Hole, html, svg, htmlFor, svgFor, attr } from '../reactive.js'; | ||
import { effect } from '@preact/signals-core'; | ||
import { reactive } from '../reactive.js'; | ||
export { Hole, html, svg, htmlFor, svgFor, attr } from '../reactive.js'; | ||
export const render = reactive(effect); |
@@ -1,6 +0,6 @@ | ||
import { effect } from '@webreflection/signal'; | ||
export * from '@webreflection/signal'; | ||
export { Hole, html, svg, htmlFor, svgFor, attr } from '../reactive.js'; | ||
import { effect } from '@webreflection/signal'; | ||
import { reactive } from '../reactive.js'; | ||
export { Hole, html, svg, htmlFor, svgFor, attr } from '../reactive.js'; | ||
export const render = reactive(effect); |
{ | ||
"name": "uhtml", | ||
"version": "4.3.4", | ||
"version": "4.3.5", | ||
"description": "A micro HTML/SVG render", | ||
@@ -5,0 +5,0 @@ "main": "./cjs/index.js", |
@@ -273,2 +273,7 @@ /** @typedef {Function?} DOMLevel0Listener */ | ||
*/ | ||
getElementById(id: any): import("./element.js").default[]; | ||
/** | ||
* @param {string} tagName | ||
* @returns {import("./element.js").default[]} | ||
*/ | ||
getElementsByTagName(tagName: string): import("./element.js").default[]; | ||
@@ -275,0 +280,0 @@ /** |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
393786
7921