typed-dom
Advanced tools
Comparing version 0.0.334 to 0.0.335
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.334 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.335 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -3,0 +3,0 @@ if(typeof exports === 'object' && typeof module === 'object') |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.334 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.335 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -89,3 +89,3 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
// @ts-ignore | ||
var global = globalThis; | ||
var global = (/* unused pure expression or super */ null && (globalThis)); | ||
@@ -92,0 +92,0 @@ /***/ }) |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.334 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.335 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -239,3 +239,3 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
// @ts-ignore | ||
var global = globalThis; | ||
var global = (/* unused pure expression or super */ null && (globalThis)); | ||
@@ -878,4 +878,4 @@ /***/ }), | ||
const source = child.element.innerHTML; | ||
if (!source.includes(':scope')) return; | ||
const style = source.replace(/(^|[>~+,}/])(\s*):scope(?!\w)(?=\s*[A-Za-z#.:[>~+,{/])/g, (...$) => `${$[1]}${$[2]}${this.query}`); | ||
if (!source.includes('$scope')) return; | ||
const style = source.replace(/(^|[>~+,}/])(\s*)\$scope(?!\w)(?=\s*[A-Za-z#.:[>~+,{/])/g, (...$) => `${$[1]}${$[2]}${this.query}`); | ||
if (style === source) return; | ||
@@ -882,0 +882,0 @@ child.element.textContent = style; |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.334 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.335 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -3,0 +3,0 @@ if(typeof exports === 'object' && typeof module === 'object') |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.334 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.335 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -239,3 +239,3 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
// @ts-ignore | ||
var global = globalThis; | ||
var global = (/* unused pure expression or super */ null && (globalThis)); | ||
@@ -878,4 +878,4 @@ /***/ }), | ||
const source = child.element.innerHTML; | ||
if (!source.includes(':scope')) return; | ||
const style = source.replace(/(^|[>~+,}/])(\s*):scope(?!\w)(?=\s*[A-Za-z#.:[>~+,{/])/g, (...$) => `${$[1]}${$[2]}${this.query}`); | ||
if (!source.includes('$scope')) return; | ||
const style = source.replace(/(^|[>~+,}/])(\s*)\$scope(?!\w)(?=\s*[A-Za-z#.:[>~+,{/])/g, (...$) => `${$[1]}${$[2]}${this.query}`); | ||
if (style === source) return; | ||
@@ -882,0 +882,0 @@ child.element.textContent = style; |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.334 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.335 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -3,0 +3,0 @@ if(typeof exports === 'object' && typeof module === 'object') |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.334 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.335 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -3,0 +3,0 @@ if(typeof exports === 'object' && typeof module === 'object') |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.334 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.335 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -3,0 +3,0 @@ if(typeof exports === 'object' && typeof module === 'object') |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.334 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.335 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -89,3 +89,3 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
// @ts-ignore | ||
var global = globalThis; | ||
var global = (/* unused pure expression or super */ null && (globalThis)); | ||
@@ -92,0 +92,0 @@ /***/ }) |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.334 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.335 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -239,3 +239,3 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
// @ts-ignore | ||
var global = globalThis; | ||
var global = (/* unused pure expression or super */ null && (globalThis)); | ||
@@ -878,4 +878,4 @@ /***/ }), | ||
const source = child.element.innerHTML; | ||
if (!source.includes(':scope')) return; | ||
const style = source.replace(/(^|[>~+,}/])(\s*):scope(?!\w)(?=\s*[A-Za-z#.:[>~+,{/])/g, (...$) => `${$[1]}${$[2]}${this.query}`); | ||
if (!source.includes('$scope')) return; | ||
const style = source.replace(/(^|[>~+,}/])(\s*)\$scope(?!\w)(?=\s*[A-Za-z#.:[>~+,{/])/g, (...$) => `${$[1]}${$[2]}${this.query}`); | ||
if (style === source) return; | ||
@@ -882,0 +882,0 @@ child.element.textContent = style; |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.334 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.335 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -3,0 +3,0 @@ if(typeof exports === 'object' && typeof module === 'object') |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.334 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.335 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -239,3 +239,3 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
// @ts-ignore | ||
var global = globalThis; | ||
var global = (/* unused pure expression or super */ null && (globalThis)); | ||
@@ -878,4 +878,4 @@ /***/ }), | ||
const source = child.element.innerHTML; | ||
if (!source.includes(':scope')) return; | ||
const style = source.replace(/(^|[>~+,}/])(\s*):scope(?!\w)(?=\s*[A-Za-z#.:[>~+,{/])/g, (...$) => `${$[1]}${$[2]}${this.query}`); | ||
if (!source.includes('$scope')) return; | ||
const style = source.replace(/(^|[>~+,}/])(\s*)\$scope(?!\w)(?=\s*[A-Za-z#.:[>~+,{/])/g, (...$) => `${$[1]}${$[2]}${this.query}`); | ||
if (style === source) return; | ||
@@ -882,0 +882,0 @@ child.element.textContent = style; |
{ | ||
"name": "typed-dom", | ||
"version": "0.0.334", | ||
"version": "0.0.335", | ||
"description": "A value-level and type-level DOM builder.", | ||
@@ -36,3 +36,3 @@ "private": false, | ||
"dependencies": { | ||
"typed-query-selector": "^2.10.0" | ||
"typed-query-selector": "^2.10.1" | ||
}, | ||
@@ -43,10 +43,10 @@ "devDependencies": { | ||
"@types/power-assert": "1.5.8", | ||
"@typescript-eslint/parser": "^5.59.0", | ||
"@typescript-eslint/parser": "^5.59.7", | ||
"babel-loader": "^9.1.2", | ||
"babel-plugin-unassert": "^3.2.0", | ||
"concurrently": "^8.0.1", | ||
"eslint": "^8.39.0", | ||
"eslint": "^8.41.0", | ||
"eslint-plugin-redos": "^4.4.5", | ||
"eslint-webpack-plugin": "^4.0.1", | ||
"glob": "^10.2.1", | ||
"glob": "^10.2.6", | ||
"i18next": "~22.3.0", | ||
@@ -60,9 +60,9 @@ "karma": "^6.4.2", | ||
"mocha": "^10.2.0", | ||
"npm-check-updates": "^16.10.9", | ||
"spica": "0.0.721", | ||
"ts-loader": "^9.4.2", | ||
"npm-check-updates": "^16.10.12", | ||
"spica": "0.0.727", | ||
"ts-loader": "^9.4.3", | ||
"typescript": "5.0.4", | ||
"webpack": "^5.80.0", | ||
"webpack-cli": "^5.0.2", | ||
"webpack-merge": "^5.8.0" | ||
"webpack": "^5.84.1", | ||
"webpack-cli": "^5.1.1", | ||
"webpack-merge": "^5.9.0" | ||
}, | ||
@@ -69,0 +69,0 @@ "scripts": { |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.334 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.335 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -3,0 +3,0 @@ if(typeof exports === 'object' && typeof module === 'object') |
@@ -1,2 +0,2 @@ | ||
/*! typed-dom v0.0.334 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! typed-dom v0.0.335 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -3,0 +3,0 @@ if(typeof exports === 'object' && typeof module === 'object') |
@@ -36,3 +36,3 @@ # typed-dom | ||
Build a Typed-DOM component with styling. | ||
`:scope` selectors are replaced with `:host`, `#<id>`, or `.<generated-id>`. | ||
`$scope` selectors are replaced with `:host`, `#<id>`, or `.<generated-id>`. | ||
@@ -43,3 +43,3 @@ ```ts | ||
const dom = HTML.article({ | ||
style: HTML.style(':scope { color: red; }'), | ||
style: HTML.style('$scope { color: red; }'), | ||
title: HTML.h1('Title'), | ||
@@ -149,3 +149,3 @@ content: HTML.ul([ | ||
private readonly dom = HTML.section({ | ||
style: HTML.style(':scope { color: red; }'), | ||
style: HTML.style('$scope { color: red; }'), | ||
content: HTML.ul([ | ||
@@ -174,3 +174,3 @@ HTML.li('item'), | ||
private readonly dom = Shadow.section({ | ||
style: HTML.style(':scope { color: red; }'), | ||
style: HTML.style('$scope { color: red; }'), | ||
content: HTML.ul([ | ||
@@ -214,3 +214,3 @@ HTML.li('item'), | ||
private readonly dom = Shadow.section({ onconnect: '' }, { | ||
style: HTML.style(':scope { color: red; }'), | ||
style: HTML.style('$scope { color: red; }'), | ||
content: HTML.p(''), | ||
@@ -217,0 +217,0 @@ }); |
@@ -146,5 +146,5 @@ import { isArray } from 'spica/alias'; | ||
const source = child.element.innerHTML; | ||
if (!source.includes(':scope')) return; | ||
if (!source.includes('$scope')) return; | ||
const style = source.replace( | ||
/(^|[>~+,}/])(\s*):scope(?!\w)(?=\s*[A-Za-z#.:[>~+,{/])/g, | ||
/(^|[>~+,}/])(\s*)\$scope(?!\w)(?=\s*[A-Za-z#.:[>~+,{/])/g, | ||
(...$) => `${$[1]}${$[2]}${this.query}`); | ||
@@ -151,0 +151,0 @@ assert(!this.$query || style !== source); |
@@ -337,25 +337,25 @@ import { Shadow, HTML, SVG, El, Attrs, shadow, frag, html, define } from '../../index'; | ||
const template = [ | ||
':scope{}', | ||
':scope:empty {}', | ||
':scope[id] {}', | ||
':scope#id {}', | ||
':scope.class {}', | ||
':scope div {}', | ||
':scope>div {}', | ||
':scope,:scope {}', | ||
':scope{}:scope{}', | ||
':scope/* */ {}', | ||
'/* */:scope {}', | ||
' :scope {}', | ||
'$scope{}', | ||
'$scope:empty {}', | ||
'$scope[id] {}', | ||
'$scope#id {}', | ||
'$scope.class {}', | ||
'$scope div {}', | ||
'$scope>div {}', | ||
'$scope,$scope {}', | ||
'$scope{}$scope{}', | ||
'$scope/* */ {}', | ||
'/* */$scope {}', | ||
' $scope {}', | ||
].join('\n'); | ||
const id = 'id'; | ||
const style = template.replace(/\:scope/g, `#${id}`); | ||
const style = template.replace(/\$scope/g, `#${id}`); | ||
assert(HTML.div({ id }, [HTML.style(template)]).children[0].element.innerHTML === style); | ||
assert(HTML.div({ id }, { style: HTML.style(template) }).children.style.element.innerHTML === style); | ||
assert(HTML.div([HTML.style(':scope {}')]).element.className.match(/^rnd-\w+$/)); | ||
assert(Shadow.div([HTML.style(':scope {}')]).element.outerHTML === '<div></div>'); | ||
assert(Shadow.div([HTML.style(':scope {}')]).children[0].element.innerHTML === ':host {}'); | ||
assert(Shadow.div([HTML.style('/* :scope */:scope/* :scope */{content:" :scope "}')]).children[0].element.innerHTML === '/* :scope */:host/* :scope */{content:" :scope "}'); | ||
assert(HTML.div([HTML.style('$scope {}')]).element.className.match(/^rnd-\w+$/)); | ||
assert(Shadow.div([HTML.style('$scope {}')]).element.outerHTML === '<div></div>'); | ||
assert(Shadow.div([HTML.style('$scope {}')]).children[0].element.innerHTML === ':host {}'); | ||
assert(Shadow.div([HTML.style('/* $scope */$scope/* $scope */{content:" $scope "}')]).children[0].element.innerHTML === '/* $scope */:host/* $scope */{content:" $scope "}'); | ||
assert(HTML.div([HTML.style('<script>')]).children[0].element.children.length === 0); | ||
assert(HTML.div([HTML.style(':scope{}<script>')]).children[0].element.children.length === 0); | ||
assert(HTML.div([HTML.style('$scope{}<script>')]).children[0].element.children.length === 0); | ||
}); | ||
@@ -584,3 +584,3 @@ | ||
private readonly dom = HTML.section({ | ||
style: HTML.style(':scope { color: red; }'), | ||
style: HTML.style('$scope { color: red; }'), | ||
content: HTML.ul([ | ||
@@ -621,3 +621,3 @@ HTML.li('item'), | ||
private readonly dom = Shadow.section({ | ||
style: HTML.style(':scope { color: red; }'), | ||
style: HTML.style('$scope { color: red; }'), | ||
content: HTML.ul([ | ||
@@ -664,3 +664,3 @@ HTML.li('item'), | ||
private readonly dom = Shadow.section({ onconnect: '' }, { | ||
style: HTML.style(':scope { color: red; }'), | ||
style: HTML.style('$scope { color: red; }'), | ||
content: HTML.p(''), | ||
@@ -667,0 +667,0 @@ }); |
@@ -76,3 +76,3 @@ const path = require('path'); | ||
return merge(config, { | ||
entry: glob.sync('./!(node_modules)/**/*.ts', { absolute: true }), | ||
entry: glob.sync('./!(node_modules)/**/*.ts', { absolute: true }).sort(), | ||
plugins: [ | ||
@@ -108,3 +108,3 @@ new ESLintPlugin({ | ||
ignore: './**/*.test.ts', | ||
}).map(path => [path.match(/[\w.]+(?=\.)/)[0], path])), | ||
}).map(path => [path.match(/[\w.]+(?=\.)/)[0], path]).sort()), | ||
output: { | ||
@@ -111,0 +111,0 @@ filename: '[name].js', |
Sorry, the diff of this file is too big to display
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
670275
Updatedtyped-query-selector@^2.10.1