streetui 2.5.0 → 2.7.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,4 +1,4 @@
1
- import { C as CompiledApplication } from './hydration-diagnostics-j2ged4cF.js';
1
+ import { C as CompiledApplication } from './hydration-diagnostics-Bh0-5vdC.js';
2
2
 
3
3
  /**
4
4
  * The interface the runtime uses to communicate with the renderer.
@@ -1,4 +1,4 @@
1
- import { C as CompiledApplication } from './hydration-diagnostics-j2ged4cF.cjs';
1
+ import { C as CompiledApplication } from './hydration-diagnostics-Bh0-5vdC.cjs';
2
2
 
3
3
  /**
4
4
  * The interface the runtime uses to communicate with the renderer.
@@ -1,4 +1,4 @@
1
- import { G as GraphNode, R as ReadonlySignal, C as CompiledApplication, i as ApplicationGraph, j as HydrationDiagnosticSink } from './hydration-diagnostics-j2ged4cF.js';
1
+ import { G as GraphNode, R as ReadonlySignal, C as CompiledApplication, i as ApplicationGraph, j as HydrationDiagnosticSink } from './hydration-diagnostics-Bh0-5vdC.js';
2
2
 
3
3
  /**
4
4
  * Application and component lifecycle primitives.
@@ -1,4 +1,4 @@
1
- import { G as GraphNode, R as ReadonlySignal, C as CompiledApplication, i as ApplicationGraph, j as HydrationDiagnosticSink } from './hydration-diagnostics-j2ged4cF.cjs';
1
+ import { G as GraphNode, R as ReadonlySignal, C as CompiledApplication, i as ApplicationGraph, j as HydrationDiagnosticSink } from './hydration-diagnostics-Bh0-5vdC.cjs';
2
2
 
3
3
  /**
4
4
  * Application and component lifecycle primitives.
package/dist/server.cjs CHANGED
@@ -151,6 +151,13 @@ function applyProp(dom, element, name, value) {
151
151
  }
152
152
  return;
153
153
  }
154
+ if (name.startsWith("style.")) {
155
+ const el = element;
156
+ const prop = name.slice("style.".length);
157
+ if (value === null || value === void 0) el.style.removeProperty(prop);
158
+ else el.style.setProperty(prop, String(value));
159
+ return;
160
+ }
154
161
  if (value === null || value === void 0 || value === false) {
155
162
  dom.removeAttribute(element, name);
156
163
  return;
@@ -718,6 +725,11 @@ var TAG_MAP = {
718
725
  "list-item": "li",
719
726
  image: "img",
720
727
  link: "a",
728
+ // A `code()` node renders as a semantic `<pre>` outer element; the mount/
729
+ // hydrate branches add a single inner `<code>` holding the escaped source
730
+ // (mirrors how `text` renders `<span>` + an inner text node). One graph
731
+ // node → one outer element preserves positional hydration.
732
+ code: "pre",
721
733
  component: "div",
722
734
  slot: "div",
723
735
  fragment: "div",
@@ -1462,6 +1474,23 @@ function mountNode(ctx, graphNode, parentDom) {
1462
1474
  dom.appendChild(parentDom, el2);
1463
1475
  return instance2;
1464
1476
  }
1477
+ if (graphNode.type === "code") {
1478
+ const source = String(graphNode.getProp("text") ?? "");
1479
+ const pre = dom.createElement("pre");
1480
+ const codeEl = dom.createElement("code");
1481
+ const textNode = dom.createTextNode(source);
1482
+ dom.appendChild(codeEl, textNode);
1483
+ dom.appendChild(pre, codeEl);
1484
+ applyNodeProps(ctx, graphNode, pre);
1485
+ const instance2 = new NodeInstance(graphNode, pre);
1486
+ ctx.instances.set(graphNode.id, instance2);
1487
+ wireEvents(dom, graph, graphNode, pre, instance2);
1488
+ if (graphNode.stateRefs.length !== 0) {
1489
+ wireSignalBindings(ctx, graphNode, instance2, textUpdate(dom, pre, textNode));
1490
+ }
1491
+ dom.appendChild(parentDom, pre);
1492
+ return instance2;
1493
+ }
1465
1494
  if (graphNode.type === "link") {
1466
1495
  const el2 = dom.createElement("a");
1467
1496
  const href = graphNode.getProp("href");
@@ -1919,7 +1948,7 @@ function renderToString(compiled, options = {}) {
1919
1948
  }
1920
1949
 
1921
1950
  // src/version.ts
1922
- var VERSION = "2.5.0";
1951
+ var VERSION = "2.7.0";
1923
1952
  // Annotate the CommonJS export names for ESM import in node:
1924
1953
  0 && (module.exports = {
1925
1954
  STATE_MARKER_ATTR,