streetui 1.2.0 → 1.4.0

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.
@@ -1,6 +1,6 @@
1
- import { S as StreetApp } from './compile-DsNJm9IJ.cjs';
2
- export { V as VERSION } from './compile-DsNJm9IJ.cjs';
3
- import { R as RenderHandle, H as HydrationDiagnostic } from './hydration-diagnostics-OFIDPD15.cjs';
1
+ import { S as StreetApp } from './compile-Cgx1PjG6.cjs';
2
+ export { V as VERSION } from './compile-Cgx1PjG6.cjs';
3
+ import { R as RenderHandle, H as HydrationDiagnostic } from './hydration-diagnostics-DWZZylCS.cjs';
4
4
  export * from 'streetui/diagnostics';
5
5
 
6
6
  /**
package/dist/testing.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { S as StreetApp } from './compile-DsNJm9IJ.js';
2
- export { V as VERSION } from './compile-DsNJm9IJ.js';
3
- import { R as RenderHandle, H as HydrationDiagnostic } from './hydration-diagnostics-BN1S-fbq.js';
1
+ import { S as StreetApp } from './compile-Cgx1PjG6.js';
2
+ export { V as VERSION } from './compile-Cgx1PjG6.js';
3
+ import { R as RenderHandle, H as HydrationDiagnostic } from './hydration-diagnostics-e6iDuR1D.js';
4
4
  export * from 'streetui/diagnostics';
5
5
 
6
6
  /**
package/dist/testing.js CHANGED
@@ -275,7 +275,6 @@ var BrowserDOMAdapter = class {
275
275
  return Array.from(node.childNodes);
276
276
  }
277
277
  };
278
- var browserDOMAdapter = new BrowserDOMAdapter();
279
278
 
280
279
  // ../dom/src/server-node.ts
281
280
  var ServerStyle = class {
@@ -345,11 +344,66 @@ var SERIALIZED_PROPERTIES = {
345
344
  checked: "boolean",
346
345
  selected: "boolean"
347
346
  };
347
+ var SERIALIZED_PROPERTY_ENTRIES = Object.entries(SERIALIZED_PROPERTIES);
348
+ var TEXT_SPECIAL = /[&<>]/;
349
+ var ATTR_SPECIAL = /[&<>"]/;
348
350
  function escapeHtmlText(value) {
349
- return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
351
+ if (!TEXT_SPECIAL.test(value)) return value;
352
+ let out = "";
353
+ let last = 0;
354
+ for (let i = 0; i < value.length; i++) {
355
+ let esc;
356
+ switch (value.charCodeAt(i)) {
357
+ case 38:
358
+ esc = "&amp;";
359
+ break;
360
+ // &
361
+ case 60:
362
+ esc = "&lt;";
363
+ break;
364
+ // <
365
+ case 62:
366
+ esc = "&gt;";
367
+ break;
368
+ // >
369
+ default:
370
+ continue;
371
+ }
372
+ out += value.slice(last, i) + esc;
373
+ last = i + 1;
374
+ }
375
+ return out + value.slice(last);
350
376
  }
351
377
  function escapeHtmlAttr(value) {
352
- return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
378
+ if (!ATTR_SPECIAL.test(value)) return value;
379
+ let out = "";
380
+ let last = 0;
381
+ for (let i = 0; i < value.length; i++) {
382
+ let esc;
383
+ switch (value.charCodeAt(i)) {
384
+ case 38:
385
+ esc = "&amp;";
386
+ break;
387
+ // &
388
+ case 60:
389
+ esc = "&lt;";
390
+ break;
391
+ // <
392
+ case 62:
393
+ esc = "&gt;";
394
+ break;
395
+ // >
396
+ case 34:
397
+ esc = "&quot;";
398
+ break;
399
+ // "
400
+ default:
401
+ continue;
402
+ }
403
+ out += value.slice(last, i) + esc;
404
+ last = i + 1;
405
+ }
406
+ return out + value.slice(last);
353
407
  }
354
408
  function serializeAttributes(el) {
355
409
  const parts = [];
@@ -360,7 +414,7 @@ function serializeAttributes(el) {
360
414
  parts.push(` ${name}="${escapeHtmlAttr(value)}"`);
361
415
  }
362
416
  }
363
- for (const [name, kind] of Object.entries(SERIALIZED_PROPERTIES)) {
417
+ for (const [name, kind] of SERIALIZED_PROPERTY_ENTRIES) {
364
418
  if (!el.properties.has(name)) continue;
365
419
  if (el.attributes.has(name)) continue;
366
420
  const raw = el.properties.get(name);
@@ -574,7 +628,6 @@ var ServerDOMAdapter = class {
574
628
  return serializeServerNode(asServer(node));
575
629
  }
576
630
  };
577
- var serverDOMAdapter = new ServerDOMAdapter();
578
631
 
579
632
  // ../renderer/src/render-context.ts
580
633
  function createRenderContext(dom, graph, container, hydrationDiagnostics) {
@@ -1961,7 +2014,7 @@ function formatInspection(inspection) {
1961
2014
  }
1962
2015
 
1963
2016
  // src/version.ts
1964
- var VERSION = "1.2.0";
2017
+ var VERSION = "1.4.0";
1965
2018
  export {
1966
2019
  VERSION,
1967
2020
  analyzeGraph,