@epa-wg/custom-element 0.0.33 → 0.0.35
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 +7 -0
- package/.gitignore +2 -0
- package/.idea/copilot.data.migration.agent.xml +6 -0
- package/.idea/copilot.data.migration.ask2agent.xml +6 -0
- package/README.md +4 -4
- package/bin/xslDtd2Ide.mjs +160 -160
- package/custom-element.js +31 -10
- package/demo/a.html +10 -3
- package/demo/html-template.html +5 -4
- package/demo/s.xml +1 -75
- package/demo/s.xslt +351 -72
- package/demo/s1.xml +3706 -0
- package/http-request.js +7 -0
- package/ide/customData-dce.json +123 -0
- package/ide/web-types-dce.json +128 -1
- package/ide/web-types-xsl.json +1 -1
- package/package.json +1 -1
package/http-request.js
CHANGED
|
@@ -66,6 +66,13 @@ export class HttpRequestElement extends HTMLElement
|
|
|
66
66
|
{ slice.data = await response.json();
|
|
67
67
|
update();
|
|
68
68
|
}catch(_e){}
|
|
69
|
+
if( r.headers['content-type']?.includes('xml'))
|
|
70
|
+
try
|
|
71
|
+
{ const s = await response.text();
|
|
72
|
+
const parser = new DOMParser();
|
|
73
|
+
slice.data = parser.parseFromString(s, 'application/xml')?.documentElement;
|
|
74
|
+
update();
|
|
75
|
+
}catch(_e){}
|
|
69
76
|
}
|
|
70
77
|
|
|
71
78
|
attributeChangedCallback(name, oldValue, newValue)
|
package/ide/customData-dce.json
CHANGED
|
@@ -210,6 +210,129 @@
|
|
|
210
210
|
"url": "https://unpkg.com/@epa-wg/custom-element@0/demo/module-url.html"
|
|
211
211
|
}
|
|
212
212
|
]
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"name": "http-request",
|
|
216
|
+
"description": "Fetches data from a URL and exposes request, response, and parsed data via the value property. Supports JSON and XML response parsing.",
|
|
217
|
+
"attributes": [
|
|
218
|
+
{
|
|
219
|
+
"name": "url",
|
|
220
|
+
"description": "The URL to fetch data from. When changed, triggers a new fetch request.",
|
|
221
|
+
"type": "string",
|
|
222
|
+
"references": [
|
|
223
|
+
{
|
|
224
|
+
"name": "docs",
|
|
225
|
+
"url": "https://github.com/EPA-WG/custom-element"
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"name": "method",
|
|
231
|
+
"description": "HTTP method for the request (GET, POST, etc.)",
|
|
232
|
+
"type": "string",
|
|
233
|
+
"references": [
|
|
234
|
+
{
|
|
235
|
+
"name": "MDN docs",
|
|
236
|
+
"url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods"
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"name": "header-accept",
|
|
242
|
+
"description": "Sets the Accept header for the request. Use header-* pattern for other headers.",
|
|
243
|
+
"type": "string",
|
|
244
|
+
"references": [
|
|
245
|
+
{
|
|
246
|
+
"name": "MDN docs",
|
|
247
|
+
"url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept"
|
|
248
|
+
}
|
|
249
|
+
]
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"name": "slice",
|
|
253
|
+
"description": "slice name where the fetched data would be propagated",
|
|
254
|
+
"type": "string",
|
|
255
|
+
"references": [
|
|
256
|
+
{
|
|
257
|
+
"name": "docs",
|
|
258
|
+
"url": "https://unpkg.com/@epa-wg/custom-element@0/demo/data-slices.html"
|
|
259
|
+
}
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
],
|
|
263
|
+
"references": [
|
|
264
|
+
{
|
|
265
|
+
"name": "docs",
|
|
266
|
+
"url": "https://github.com/EPA-WG/custom-element"
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"name": "local-storage",
|
|
272
|
+
"description": "Provides access to localStorage with reactive updates. Reads and writes values to localStorage by key.",
|
|
273
|
+
"attributes": [
|
|
274
|
+
{
|
|
275
|
+
"name": "key",
|
|
276
|
+
"description": "The localStorage key to read/write",
|
|
277
|
+
"type": "string",
|
|
278
|
+
"references": [
|
|
279
|
+
{
|
|
280
|
+
"name": "MDN docs",
|
|
281
|
+
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage"
|
|
282
|
+
}
|
|
283
|
+
]
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"name": "type",
|
|
287
|
+
"description": "Value type: text, json, or input types (number, date). Defaults to text.",
|
|
288
|
+
"type": "string",
|
|
289
|
+
"references": [
|
|
290
|
+
{
|
|
291
|
+
"name": "docs",
|
|
292
|
+
"url": "https://github.com/EPA-WG/custom-element"
|
|
293
|
+
}
|
|
294
|
+
]
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"name": "value",
|
|
298
|
+
"description": "Initial value to set in localStorage. If omitted, reads existing value.",
|
|
299
|
+
"type": "string",
|
|
300
|
+
"references": [
|
|
301
|
+
{
|
|
302
|
+
"name": "docs",
|
|
303
|
+
"url": "https://github.com/EPA-WG/custom-element"
|
|
304
|
+
}
|
|
305
|
+
]
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"name": "live",
|
|
309
|
+
"description": "When present, monitors localStorage changes and updates reactively",
|
|
310
|
+
"type": "boolean",
|
|
311
|
+
"references": [
|
|
312
|
+
{
|
|
313
|
+
"name": "docs",
|
|
314
|
+
"url": "https://github.com/EPA-WG/custom-element"
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"name": "slice",
|
|
320
|
+
"description": "slice name where the localStorage value would be propagated",
|
|
321
|
+
"type": "string",
|
|
322
|
+
"references": [
|
|
323
|
+
{
|
|
324
|
+
"name": "docs",
|
|
325
|
+
"url": "https://unpkg.com/@epa-wg/custom-element@0/demo/data-slices.html"
|
|
326
|
+
}
|
|
327
|
+
]
|
|
328
|
+
}
|
|
329
|
+
],
|
|
330
|
+
"references": [
|
|
331
|
+
{
|
|
332
|
+
"name": "docs",
|
|
333
|
+
"url": "https://github.com/EPA-WG/custom-element"
|
|
334
|
+
}
|
|
335
|
+
]
|
|
213
336
|
}
|
|
214
337
|
]
|
|
215
338
|
}
|
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.35",
|
|
5
5
|
"js-types-syntax": "typescript",
|
|
6
6
|
"description-markup": "markdown",
|
|
7
7
|
"contributions": {
|
|
@@ -177,6 +177,133 @@
|
|
|
177
177
|
"attributes": [
|
|
178
178
|
|
|
179
179
|
]
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "http-request",
|
|
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://github.com/EPA-WG/custom-element",
|
|
185
|
+
"attributes": [
|
|
186
|
+
{
|
|
187
|
+
"name": "url",
|
|
188
|
+
"description": "The URL to fetch data from. When changed, triggers a new fetch request.",
|
|
189
|
+
"required": false,
|
|
190
|
+
"doc-url": "https://github.com/EPA-WG/custom-element",
|
|
191
|
+
"value": {
|
|
192
|
+
"type": "string"
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "method",
|
|
197
|
+
"description": "HTTP method for the request (GET, POST, etc.)",
|
|
198
|
+
"required": false,
|
|
199
|
+
"doc-url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods",
|
|
200
|
+
"value": {
|
|
201
|
+
"type": "string"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"name": "header-accept",
|
|
206
|
+
"description": "Sets the Accept header for the request. Use header-* pattern for other headers.",
|
|
207
|
+
"required": false,
|
|
208
|
+
"doc-url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept",
|
|
209
|
+
"value": {
|
|
210
|
+
"type": "string"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"name": "slice",
|
|
215
|
+
"description": "slice name where the fetched data would be propagated",
|
|
216
|
+
"required": false,
|
|
217
|
+
"doc-url": "https://unpkg.com/@epa-wg/custom-element@0/demo/data-slices.html",
|
|
218
|
+
"value": {
|
|
219
|
+
"type": "string"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
],
|
|
223
|
+
"js": {
|
|
224
|
+
"events": [
|
|
225
|
+
{
|
|
226
|
+
"name": "change",
|
|
227
|
+
"description": "Emitted when request, response, or data changes"
|
|
228
|
+
}
|
|
229
|
+
],
|
|
230
|
+
"properties": [
|
|
231
|
+
{
|
|
232
|
+
"name": "value",
|
|
233
|
+
"type": "object",
|
|
234
|
+
"default": "{}",
|
|
235
|
+
"description": "Object containing request, response, and data properties"
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"name": "local-storage",
|
|
242
|
+
"description": "Provides access to localStorage with reactive updates. Reads and writes values to localStorage by key.",
|
|
243
|
+
"doc-url": "https://github.com/EPA-WG/custom-element",
|
|
244
|
+
"attributes": [
|
|
245
|
+
{
|
|
246
|
+
"name": "key",
|
|
247
|
+
"description": "The localStorage key to read/write",
|
|
248
|
+
"required": true,
|
|
249
|
+
"doc-url": "https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage",
|
|
250
|
+
"value": {
|
|
251
|
+
"type": "string"
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"name": "type",
|
|
256
|
+
"description": "Value type: text, json, or input types (number, date). Defaults to text.",
|
|
257
|
+
"required": false,
|
|
258
|
+
"doc-url": "https://github.com/EPA-WG/custom-element",
|
|
259
|
+
"value": {
|
|
260
|
+
"type": "string"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"name": "value",
|
|
265
|
+
"description": "Initial value to set in localStorage. If omitted, reads existing value.",
|
|
266
|
+
"required": false,
|
|
267
|
+
"doc-url": "https://github.com/EPA-WG/custom-element",
|
|
268
|
+
"value": {
|
|
269
|
+
"type": "string"
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"name": "live",
|
|
274
|
+
"description": "When present, monitors localStorage changes and updates reactively",
|
|
275
|
+
"required": false,
|
|
276
|
+
"doc-url": "https://github.com/EPA-WG/custom-element",
|
|
277
|
+
"value": {
|
|
278
|
+
"type": "boolean"
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"name": "slice",
|
|
283
|
+
"description": "slice name where the localStorage value would be propagated",
|
|
284
|
+
"required": false,
|
|
285
|
+
"doc-url": "https://unpkg.com/@epa-wg/custom-element@0/demo/data-slices.html",
|
|
286
|
+
"value": {
|
|
287
|
+
"type": "string"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
],
|
|
291
|
+
"js": {
|
|
292
|
+
"events": [
|
|
293
|
+
{
|
|
294
|
+
"name": "change",
|
|
295
|
+
"description": "Emitted when the localStorage value changes"
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
"properties": [
|
|
299
|
+
{
|
|
300
|
+
"name": "value",
|
|
301
|
+
"type": "any",
|
|
302
|
+
"default": "",
|
|
303
|
+
"description": "The current value from localStorage, parsed according to type attribute"
|
|
304
|
+
}
|
|
305
|
+
]
|
|
306
|
+
}
|
|
180
307
|
}
|
|
181
308
|
]
|
|
182
309
|
}
|
package/ide/web-types-xsl.json
CHANGED
package/package.json
CHANGED