@epa-wg/custom-element 0.0.37 → 0.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +8 -1
- package/README.md +4 -4
- package/bin/xslDtd2Ide.mjs +1 -1
- package/custom-element.js +8 -4
- package/ide/customData-dce.json +8 -8
- package/ide/web-types-dce.json +8 -8
- package/ide/web-types-xsl.json +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"permissions": {
|
|
3
3
|
"allow": [
|
|
4
|
-
"Bash(ls:*)"
|
|
4
|
+
"Bash(ls:*)",
|
|
5
|
+
"Bash(Get-ChildItem -Path \"C:\\\\aWork\\\\custom-element\" -Recurse -Force)",
|
|
6
|
+
"Bash(Select-Object -First 50 FullName)",
|
|
7
|
+
"Bash(Get-ChildItem -Path \"C:\\\\aWork\\\\custom-element\\\\components\" -Recurse -ErrorAction SilentlyContinue)",
|
|
8
|
+
"Bash(Select-Object FullName)",
|
|
9
|
+
"Bash(xargs grep *)",
|
|
10
|
+
"Bash(xargs wc *)",
|
|
11
|
+
"Bash(xargs basename *)"
|
|
5
12
|
]
|
|
6
13
|
}
|
|
7
14
|
}
|
package/README.md
CHANGED
|
@@ -343,16 +343,16 @@ within template
|
|
|
343
343
|
[slice-demo-url]: https://unpkg.com/@epa-wg/custom-element@0.0/demo/data-slices.html
|
|
344
344
|
[for-each-demo]: https://unpkg.com/@epa-wg/custom-element@0.0/demo/for-each.html
|
|
345
345
|
[hex-grid-url]: https://unpkg.com/@epa-wg/custom-element@0.0/demo/hex-grid.html
|
|
346
|
-
[hex-grid-image]: https://unpkg.com/@epa-wg/custom-element@0.0.
|
|
346
|
+
[hex-grid-image]: https://unpkg.com/@epa-wg/custom-element@0.0.38/demo/hex-grid-transform.png
|
|
347
347
|
[local-storage-demo]: https://unpkg.com/@epa-wg/custom-element@0.0/demo/local-storage.html
|
|
348
348
|
[http-request-demo]: https://unpkg.com/@epa-wg/custom-element@0.0/demo/http-request.html
|
|
349
349
|
[location-demo]: https://unpkg.com/@epa-wg/custom-element@0.0/demo/location.html
|
|
350
350
|
[github-image]: https://cdnjs.cloudflare.com/ajax/libs/octicons/8.5.0/svg/mark-github.svg
|
|
351
351
|
[npm-image]: https://img.shields.io/npm/v/@epa-wg/custom-element.svg
|
|
352
352
|
[npm-url]: https://npmjs.org/package/@epa-wg/custom-element
|
|
353
|
-
[coverage-image]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.
|
|
354
|
-
[coverage-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.
|
|
355
|
-
[storybook-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.
|
|
353
|
+
[coverage-image]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.38/coverage/src/custom-element/coverage.svg
|
|
354
|
+
[coverage-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.38/coverage/src/custom-element/index.html
|
|
355
|
+
[storybook-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.38/storybook-static/index.html?path=/story/welcome--introduction
|
|
356
356
|
[sandbox-url]: https://stackblitz.com/github/EPA-WG/custom-element?file=index.html
|
|
357
357
|
[webcomponents-url]: https://www.webcomponents.org/element/@epa-wg/custom-element
|
|
358
358
|
[webcomponents-img]: https://img.shields.io/badge/webcomponents.org-published-blue.svg
|
package/bin/xslDtd2Ide.mjs
CHANGED
|
@@ -116,7 +116,7 @@ writeFileSync( '.././ide/customData-xsl.json', JSON.stringify( vsCode, undefined
|
|
|
116
116
|
const intelliJ = {
|
|
117
117
|
"$schema": "http://json.schemastore.org/web-types",
|
|
118
118
|
"name": "@epa-wg/custom-element",
|
|
119
|
-
"version": "0.0.
|
|
119
|
+
"version": "0.0.38",
|
|
120
120
|
"js-types-syntax": "typescript",
|
|
121
121
|
"description-markup": "markdown",
|
|
122
122
|
"contributions": {
|
package/custom-element.js
CHANGED
|
@@ -297,7 +297,9 @@ createXsltFromDom( templateNode, S = 'xsl:stylesheet' )
|
|
|
297
297
|
|
|
298
298
|
sanitizeProcessor.importStylesheet( sanitizeXsl );
|
|
299
299
|
|
|
300
|
-
|
|
300
|
+
// Use a detached (no browsing context) document so Chrome does not eagerly
|
|
301
|
+
// load img/link resources from the intermediate XSLT fragment
|
|
302
|
+
const fr = sanitizeProcessor.transformToFragment(tc, document.implementation.createHTMLDocument(''))
|
|
301
303
|
, $ = (e,css) => e.querySelector(css)
|
|
302
304
|
, payload = $( xslDom, 'template[mode="payload"]');
|
|
303
305
|
if( !fr )
|
|
@@ -399,11 +401,13 @@ xhrTemplate(src)
|
|
|
399
401
|
const dom = await new Promise((resolve,reject)=>
|
|
400
402
|
{ const xhr = new XMLHttpRequest();
|
|
401
403
|
xhr.open("GET", src);
|
|
402
|
-
xhr.responseType = "document";
|
|
403
|
-
// xhr.overrideMimeType("text/xml");
|
|
404
404
|
xhr.onload = () =>
|
|
405
405
|
{ if( xhr.readyState === xhr.DONE && xhr.status === 200 )
|
|
406
|
-
|
|
406
|
+
{ const mime = xhr.getResponseHeader('content-type')?.includes('xml')
|
|
407
|
+
? 'text/xml' : 'text/html';
|
|
408
|
+
const doc = new DOMParser().parseFromString(xhr.responseText, mime);
|
|
409
|
+
resolve( mime === 'text/html' ? doc.body : doc )
|
|
410
|
+
}
|
|
407
411
|
else
|
|
408
412
|
reject(`${xhr.statusText} - ${src}`)
|
|
409
413
|
};
|
package/ide/customData-dce.json
CHANGED
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"tags": [
|
|
58
58
|
{
|
|
59
59
|
"name": "custom-element",
|
|
60
|
-
"description": "Declarative
|
|
60
|
+
"description": "Declarative Custom Element (DCE). `<custom-element tag='my-element'></custom-element>`.",
|
|
61
61
|
"attributes": [
|
|
62
62
|
{
|
|
63
63
|
"name": "hidden",
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
"references": [
|
|
174
174
|
{
|
|
175
175
|
"name": "docs",
|
|
176
|
-
"url": "https://
|
|
176
|
+
"url": "https://unpkg.com/@epa-wg/custom-element@0/demo/location-element.html"
|
|
177
177
|
}
|
|
178
178
|
]
|
|
179
179
|
},
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
"references": [
|
|
223
223
|
{
|
|
224
224
|
"name": "docs",
|
|
225
|
-
"url": "https://
|
|
225
|
+
"url": "https://unpkg.com/@epa-wg/custom-element@0/demo/http-request.html"
|
|
226
226
|
}
|
|
227
227
|
]
|
|
228
228
|
},
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
"references": [
|
|
264
264
|
{
|
|
265
265
|
"name": "docs",
|
|
266
|
-
"url": "https://
|
|
266
|
+
"url": "https://unpkg.com/@epa-wg/custom-element@0/demo/http-request.html"
|
|
267
267
|
}
|
|
268
268
|
]
|
|
269
269
|
},
|
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
"references": [
|
|
290
290
|
{
|
|
291
291
|
"name": "docs",
|
|
292
|
-
"url": "https://
|
|
292
|
+
"url": "https://unpkg.com/@epa-wg/custom-element@0/demo/local-storage.html"
|
|
293
293
|
}
|
|
294
294
|
]
|
|
295
295
|
},
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
"references": [
|
|
301
301
|
{
|
|
302
302
|
"name": "docs",
|
|
303
|
-
"url": "https://
|
|
303
|
+
"url": "https://unpkg.com/@epa-wg/custom-element@0/demo/local-storage.html"
|
|
304
304
|
}
|
|
305
305
|
]
|
|
306
306
|
},
|
|
@@ -311,7 +311,7 @@
|
|
|
311
311
|
"references": [
|
|
312
312
|
{
|
|
313
313
|
"name": "docs",
|
|
314
|
-
"url": "https://
|
|
314
|
+
"url": "https://unpkg.com/@epa-wg/custom-element@0/demo/local-storage.html"
|
|
315
315
|
}
|
|
316
316
|
]
|
|
317
317
|
},
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
"references": [
|
|
331
331
|
{
|
|
332
332
|
"name": "docs",
|
|
333
|
-
"url": "https://
|
|
333
|
+
"url": "https://unpkg.com/@epa-wg/custom-element@0/demo/local-storage.html"
|
|
334
334
|
}
|
|
335
335
|
]
|
|
336
336
|
}
|
package/ide/web-types-dce.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@epa-wg/custom-element",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.38",
|
|
5
5
|
"js-types-syntax": "typescript",
|
|
6
6
|
"description-markup": "markdown",
|
|
7
7
|
"contributions": {
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
{
|
|
106
106
|
"name": "location-element",
|
|
107
107
|
"description": "get/set window URL parts or from SRC URL",
|
|
108
|
-
"doc-url": "https://
|
|
108
|
+
"doc-url": "https://unpkg.com/@epa-wg/custom-element@0/demo/location-element.html",
|
|
109
109
|
"attributes": [
|
|
110
110
|
{
|
|
111
111
|
"name": "href",
|
|
@@ -181,13 +181,13 @@
|
|
|
181
181
|
{
|
|
182
182
|
"name": "http-request",
|
|
183
183
|
"description": "Fetches data from a URL and exposes request, response, and parsed data via the value property. Supports JSON and XML response parsing.",
|
|
184
|
-
"doc-url": "https://
|
|
184
|
+
"doc-url": "https://unpkg.com/@epa-wg/custom-element@0/demo/http-request.html",
|
|
185
185
|
"attributes": [
|
|
186
186
|
{
|
|
187
187
|
"name": "url",
|
|
188
188
|
"description": "The URL to fetch data from. When changed, triggers a new fetch request.",
|
|
189
189
|
"required": false,
|
|
190
|
-
"doc-url": "https://
|
|
190
|
+
"doc-url": "https://unpkg.com/@epa-wg/custom-element@0/demo/http-request.html",
|
|
191
191
|
"value": {
|
|
192
192
|
"type": "string"
|
|
193
193
|
}
|
|
@@ -240,7 +240,7 @@
|
|
|
240
240
|
{
|
|
241
241
|
"name": "local-storage",
|
|
242
242
|
"description": "Provides access to localStorage with reactive updates. Reads and writes values to localStorage by key.",
|
|
243
|
-
"doc-url": "https://
|
|
243
|
+
"doc-url": "https://unpkg.com/@epa-wg/custom-element@0/demo/local-storage.html",
|
|
244
244
|
"attributes": [
|
|
245
245
|
{
|
|
246
246
|
"name": "key",
|
|
@@ -255,7 +255,7 @@
|
|
|
255
255
|
"name": "type",
|
|
256
256
|
"description": "Value type: text, json, or input types (number, date). Defaults to text.",
|
|
257
257
|
"required": false,
|
|
258
|
-
"doc-url": "https://
|
|
258
|
+
"doc-url": "https://unpkg.com/@epa-wg/custom-element@0/demo/local-storage.html",
|
|
259
259
|
"value": {
|
|
260
260
|
"type": "string"
|
|
261
261
|
}
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
"name": "value",
|
|
265
265
|
"description": "Initial value to set in localStorage. If omitted, reads existing value.",
|
|
266
266
|
"required": false,
|
|
267
|
-
"doc-url": "https://
|
|
267
|
+
"doc-url": "https://unpkg.com/@epa-wg/custom-element@0/demo/local-storage.html",
|
|
268
268
|
"value": {
|
|
269
269
|
"type": "string"
|
|
270
270
|
}
|
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
"name": "live",
|
|
274
274
|
"description": "When present, monitors localStorage changes and updates reactively",
|
|
275
275
|
"required": false,
|
|
276
|
-
"doc-url": "https://
|
|
276
|
+
"doc-url": "https://unpkg.com/@epa-wg/custom-element@0/demo/local-storage.html",
|
|
277
277
|
"value": {
|
|
278
278
|
"type": "boolean"
|
|
279
279
|
}
|
package/ide/web-types-xsl.json
CHANGED
package/package.json
CHANGED