@solidjs/web 2.0.0-rc.21 → 2.0.0-rc.22

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 { createRenderEffect, createMemo, OBSERVE, enableHydration, $PROXY, untrack, runWithOwner, createRoot, getOwner, ROOT_ERROR_HOOK, flatten, flush, createComponent, omit, createOwner, createSignal, createEffect } from 'solid-js';
2
- export { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent, dynamicComponent, getOwner, merge as mergeProps, untrack } from 'solid-js';
3
- import { sharedConfig, enableServerComponentHydration, resolvedTable, viewOf, OmitView, hasStaticKeys, SOURCE_MEMO, sourceHas, SOURCE_OMIT, sourceGet, sourceKeys, SOURCE_PROXY, SOURCE_PLAIN, dynamicCore } from 'solid-js/internal';
1
+ import { createRenderEffect, createMemo, OBSERVE, enableHydration, $PROXY, untrack, runRefCallback, createRoot, getOwner, ROOT_ERROR_HOOK, flatten, flush, runWithOwner, heldRead, setSwapHook, isHidden, createComponent, omit, createOwner, createSignal, createEffect } from 'solid-js';
2
+ export { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent, dynamicComponent, getOwner, heldRead, merge as mergeProps, untrack } from 'solid-js';
3
+ import { sharedConfig, enableServerComponentHydration, hasStaticKeys, viewOf, OmitView, sourceHas, SOURCE_OMIT, sourceGet, SOURCE_MEMO, SOURCE_PROXY, SOURCE_PLAIN, sourceKeys, resolvedTable, dynamicCore } from 'solid-js/internal';
4
4
 
5
5
  const DOMWithState = {
6
6
  INPUT: {
@@ -32,6 +32,7 @@ const DOMWithState = {
32
32
  };
33
33
  const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
34
34
  const $$SLOT = /*#__PURE__*/Symbol("slot");
35
+ const $$INDEX = /*#__PURE__*/Symbol("index");
35
36
  const $$HOST = /*#__PURE__*/Symbol("host");
36
37
  const DelegatedEvents = /*#__PURE__*/new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
37
38
  const SVGElements = /*#__PURE__*/new Set([
@@ -82,32 +83,36 @@ function memo(fn) {
82
83
  }
83
84
 
84
85
  function reconcileArrays(parentNode, a, b, marker) {
85
- let active = parentNode.moveBefore && parentNode.isConnected && document.activeElement;
86
- if (active === document.body) active = null;
86
+ let bLength = b.length,
87
+ aEnd = a.length,
88
+ bEnd = bLength,
89
+ aStart = 0,
90
+ bStart = 0,
91
+ stamped,
92
+ after,
93
+ index,
94
+ anchor;
95
+ while (aStart < aEnd && a[aStart] === b[bStart]) {
96
+ aStart++;
97
+ bStart++;
98
+ }
99
+ if (aStart === aEnd && bStart === bEnd) return;
100
+ const mv = parentNode.moveBefore && parentNode.isConnected;
87
101
  const slot = marker || parentNode;
88
102
  const insert = (n, ref) => {
89
- active && n.isConnected && n.contains(active) ? parentNode.moveBefore(n, ref) : parentNode.insertBefore(n, ref);
103
+ mv && n.isConnected ? parentNode.moveBefore(n, ref) : parentNode.insertBefore(n, ref);
90
104
  if (marker || n[$$SLOT]) n[$$SLOT] = slot;
91
105
  };
92
- if (!a.length) {
106
+ if (!aEnd) {
93
107
  for (const n of b) insert(n, marker);
94
108
  return;
95
109
  }
96
- const isLive = n => {
97
- if (!n) return false;
98
- const tag = n[$$SLOT];
99
- return n.parentNode === parentNode && (!tag || tag === slot);
110
+ const isLive = n => n && n.parentNode === parentNode && (!(n = n[$$SLOT]) || n === slot);
111
+ const ref = k => {
112
+ while (k < bLength && !isLive(b[k])) k++;
113
+ return b[k] || (after && after.parentNode !== parentNode ? marker || null : after);
100
114
  };
101
- let bLength = b.length,
102
- aEnd = a.length,
103
- bEnd = bLength,
104
- aStart = 0,
105
- bStart = 0,
106
- tail = a[aEnd - 1],
107
- after = isLive(tail) ? tail.nextSibling : marker || null,
108
- map = null,
109
- anchor,
110
- anchorTag;
115
+ after = isLive(anchor = a[aEnd - 1]) ? anchor.nextSibling : marker || null;
111
116
  while (aStart < aEnd || bStart < bEnd) {
112
117
  if (a[aStart] === b[bStart]) {
113
118
  aStart++;
@@ -119,52 +124,43 @@ function reconcileArrays(parentNode, a, b, marker) {
119
124
  bEnd--;
120
125
  }
121
126
  if (aEnd === aStart) {
122
- let k = bEnd;
123
- while (k < bLength && !isLive(b[k])) k++;
124
- const node = k < bLength ? b[k] : after;
125
- while (bStart < bEnd) insert(b[bStart++], node);
126
- } else if (bEnd === bStart) {
127
- while (aStart < aEnd) {
128
- const n = a[aStart++];
129
- if ((!map || !map.has(n)) && isLive(n)) n.remove();
130
- }
131
- } else if ((anchor = a[aStart]) === b[bEnd - 1] && b[bStart] === a[aEnd - 1] && anchor.parentNode === parentNode && (!(anchorTag = anchor[$$SLOT]) || anchorTag === slot)) {
127
+ anchor = ref(bEnd);
128
+ while (bStart < bEnd) insert(b[bStart++], anchor);
129
+ } else if (!isLive(anchor = a[aStart])) aStart++;
130
+ else if (b[bStart] === a[aEnd - 1] && (
131
+ anchor === b[bEnd - 1] ||
132
+ !stamped && anchor === b[bStart + 1] && a[aStart + 1] === b[bStart + 2])) {
132
133
  do {
133
134
  insert(a[--aEnd], anchor);
134
135
  bStart++;
135
- if (aStart >= aEnd - 1 || bStart >= bEnd) break;
136
- } while (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]);
136
+ } while (aStart < aEnd - 1 && bStart < bEnd && anchor === b[bEnd - 1] && b[bStart] === a[aEnd - 1]);
137
+ } else if (bStart < bEnd && anchor === b[bEnd - 1] && a[aStart + 1] !== b[bEnd - 2] && isLive(b[bStart]) && isLive(a[aEnd - 1])) {
138
+ insert(anchor, ref(bEnd));
139
+ aStart++;
140
+ bEnd--;
137
141
  } else {
138
- if (!isLive(a[aStart])) {
139
- aStart++;
140
- continue;
141
- }
142
- if (!map) {
143
- map = new Map();
144
- let i = bStart;
145
- while (i < bEnd) map.set(b[i], i++);
142
+ if (!stamped) {
143
+ stamped = 1;
144
+ for (index = bStart; index < bEnd;) b[index][$$INDEX] = index++;
146
145
  }
147
- const index = map.get(a[aStart]);
148
- if (index != null) {
146
+ if ((index = anchor[$$INDEX]) >= 0 && b[index] === anchor) {
149
147
  if (bStart < index && index < bEnd) {
150
148
  let i = aStart,
151
- sequence = 1,
152
- t;
153
- while (++i < aEnd && i < bEnd) {
154
- if ((t = map.get(a[i])) == null || t !== index + sequence) break;
155
- sequence++;
156
- }
149
+ sequence = 1;
150
+ while (++i < aEnd && i < bEnd && a[i] === b[index + sequence]) sequence++;
157
151
  if (sequence > index - bStart) {
158
- const node = a[aStart];
159
- while (bStart < index) insert(b[bStart++], node);
152
+ while (bStart < index) insert(b[bStart++], anchor);
160
153
  } else {
161
- const newNode = b[bStart++],
162
- node = a[aStart++];
163
- active && parentNode.contains(active) ? insert(newNode, node) : parentNode.replaceChild(newNode, node);
154
+ const newNode = b[bStart++];
155
+ aStart++;
156
+ mv ? insert(newNode, anchor) : parentNode.replaceChild(newNode, anchor);
164
157
  if (marker || newNode[$$SLOT]) newNode[$$SLOT] = slot;
165
158
  }
166
159
  } else aStart++;
167
- } else a[aStart++].remove();
160
+ } else {
161
+ anchor.remove();
162
+ aStart++;
163
+ }
168
164
  }
169
165
  }
170
166
  }
@@ -422,9 +418,16 @@ function render(code, element, init, options = {}) {
422
418
  element.textContent = "";
423
419
  };
424
420
  }
421
+ let policy;
422
+ function setTrustedTypesPolicy(value) {
423
+ policy = value;
424
+ }
425
+ function trustedHTML(html) {
426
+ return policy ? policy.createHTML(html) : html;
427
+ }
425
428
  function create(html, bypassGuard, flag) {
426
429
  const t = document.createElement("template");
427
- t.innerHTML = html;
430
+ t.innerHTML = policy ? policy.createHTML(html) : html;
428
431
  const node = t.content.firstChild;
429
432
  return flag === 2 ? node.firstChild : node;
430
433
  }
@@ -529,6 +532,9 @@ function setProperty(node, name, value) {
529
532
  function setStatefulProperty(node, name, value) {
530
533
  node[name] = value;
531
534
  }
535
+ function strictHandler(fn) {
536
+ return fn();
537
+ }
532
538
  let claimHandlers = null;
533
539
  const claimAttributeSets = [];
534
540
  const CLAIM_SEAM = Symbol.for("solid.element-claims");
@@ -608,7 +614,7 @@ function className(node, value, prev) {
608
614
  return;
609
615
  }
610
616
  if (typeof value === "string") {
611
- node._$classes = undefined;
617
+ if (node._$classes) node._$classes = undefined;
612
618
  value !== prev && node.setAttribute("class", value);
613
619
  return;
614
620
  }
@@ -729,14 +735,22 @@ function spread(node, props, skipChildren, skip, name, loc) {
729
735
  }
730
736
  const prevProps = {};
731
737
  const owner = claimHandlers !== null && (node.localName === "a" || node.localName === "form") ? getOwner() : undefined;
738
+ let held = 0;
732
739
  const apply = newProps => {
733
740
  const r = newProps.ref;
734
741
  if (r !== prevProps.ref && (typeof r === "function" || Array.isArray(r))) ref(() => r, node);
742
+ spreadHeld = held;
735
743
  assign(node, newProps, true, prevProps, true);
744
+ spreadHeld = 0;
736
745
  if (owner !== undefined) claimElement(node, owner);
737
746
  };
747
+ const read = fn => () => {
748
+ const p = fn();
749
+ held = heldRead();
750
+ return p;
751
+ };
738
752
  if (Array.isArray(props)) {
739
- effect(() => collectSources({}, props, undefined, skip), apply);
753
+ effect(read(() => collectSources({}, props, undefined, skip)), apply);
740
754
  if (!skipChildren && !(skip !== undefined && skip("children"))) insert(node, () => {
741
755
  for (let i = props.length - 1; i >= 0; i--) {
742
756
  const s = resolveSource(props[i]);
@@ -745,7 +759,7 @@ function spread(node, props, skipChildren, skip, name, loc) {
745
759
  });
746
760
  return prevProps;
747
761
  }
748
- effect(() => {
762
+ const collect = () => {
749
763
  const source = resolveSource(props);
750
764
  const newProps = {};
751
765
  const table = resolvedTable(source);
@@ -755,7 +769,8 @@ function spread(node, props, skipChildren, skip, name, loc) {
755
769
  if (view instanceof OmitView) collectProps(newProps, view, SOURCE_OMIT, skip);else if (view !== undefined) collectSources(newProps, view.sources, view.kinds, skip);else collectProps(newProps, source, $PROXY in source ? SOURCE_PROXY : SOURCE_PLAIN, skip);
756
770
  }
757
771
  return newProps;
758
- }, apply);
772
+ };
773
+ effect(read(collect), apply);
759
774
  if (!skipChildren && !(skip !== undefined && skip("children"))) {
760
775
  if (typeof props !== "function" && props != null && hasStaticKeys(props)) {
761
776
  const desc = Object.getOwnPropertyDescriptor(props, "children");
@@ -843,7 +858,7 @@ function applyRef(r, element) {
843
858
  }
844
859
  function ref(fn, element) {
845
860
  const resolved = untrack(fn);
846
- runWithOwner(null, () => applyRef(resolved, element));
861
+ runRefCallback(() => applyRef(resolved, element));
847
862
  }
848
863
  function scope(fn) {
849
864
  fn.$s = true;
@@ -854,6 +869,10 @@ const SCOPE_OPTIONS = {
854
869
  };
855
870
  let hydrationRt = null;
856
871
  let selectInsert = null;
872
+ let hostRt = null;
873
+ function installHostTagging() {
874
+ hostRt = tagHost;
875
+ }
857
876
  function installHydrationRuntime() {
858
877
  hydrationRt = {
859
878
  claimInitial(parent, multi, initial) {
@@ -864,8 +883,7 @@ function installHydrationRuntime() {
864
883
  },
865
884
  reclaimRegion(current, parent, marker) {
866
885
  if (!sharedConfig.hydrating || current == null || !parent.isConnected) return current;
867
- const first = Array.isArray(current) ? current[0] : current;
868
- if (first == null || first.isConnected) return current;
886
+ if (Array.isArray(current) ? current.every(n => !n || n.isConnected) : current.isConnected) return current;
869
887
  let nodes;
870
888
  if (marker) {
871
889
  nodes = [];
@@ -939,7 +957,7 @@ function insert(parent, accessor, marker, initial, options) {
939
957
  accessor = normalize(accessor, initial, multi, true);
940
958
  if (typeof accessor !== "function") {
941
959
  insertExpression(parent, accessor, initial, marker);
942
- host && tagHost(accessor, host);
960
+ hostRt !== null && host && hostRt(accessor, host);
943
961
  return;
944
962
  }
945
963
  }
@@ -962,13 +980,13 @@ function insert(parent, accessor, marker, initial, options) {
962
980
  } : options;
963
981
  effect(() => (hydrationRt !== null && (current = hydrationRt.reclaimRegion(current, parent, marker)), normalize(value, current, multi)), inner => {
964
982
  current = insertExpression(parent, inner, current, marker);
965
- host && tagHost(current, host);
983
+ hostRt !== null && host && hostRt(current, host);
966
984
  }, innerOptions);
967
985
  return INNER_OWNED;
968
986
  }, value => {
969
987
  if (value === INNER_OWNED) return;
970
988
  current = insertExpression(parent, value, current, marker);
971
- host && tagHost(current, host);
989
+ hostRt !== null && host && hostRt(current, host);
972
990
  },
973
991
  accessor.$s ? options ? {
974
992
  ...options,
@@ -1180,6 +1198,7 @@ function initHeadRegistry() {
1180
1198
  headRegistrations = [];
1181
1199
  headOwned = new Map();
1182
1200
  headApplied = new Map();
1201
+ setSwapHook(scheduleHeadApply);
1183
1202
  const t = document.querySelector("title");
1184
1203
  headFallbackTitle = t ? t.hasAttribute("data-dh") ? t.getAttribute("data-dhf") : t.textContent : null;
1185
1204
  if (globalThis._$HY) globalThis._$HY.h = applyServerHeadOps;
@@ -1230,7 +1249,7 @@ function flushHeadRegistry() {
1230
1249
  return;
1231
1250
  }
1232
1251
  headScheduled = false;
1233
- const winners = resolveHead(headRegistrations);
1252
+ const winners = resolveHead(headRegistrations.filter(r => !isHidden(r.node)));
1234
1253
  for (const [identity, els] of headOwned) {
1235
1254
  if (winners.has(identity)) continue;
1236
1255
  headOwned.delete(identity);
@@ -1342,10 +1361,12 @@ function useHead(tags) {
1342
1361
  initHeadRegistry();
1343
1362
  const reg = {
1344
1363
  seq: -1,
1345
- tags: null
1364
+ tags: null,
1365
+ node: null
1346
1366
  };
1347
1367
  const uid = ++headUid;
1348
1368
  effect(() => {
1369
+ reg.node = getOwner();
1349
1370
  let list = typeof tags === "function" ? tags() : tags;
1350
1371
  if (!Array.isArray(list)) list = [list];
1351
1372
  const replaceable = [];
@@ -1667,10 +1688,11 @@ function flattenClassList(list, result) {
1667
1688
  else if (typeof item !== "boolean" && (item || item === 0)) result[item] = true;
1668
1689
  }
1669
1690
  }
1691
+ let spreadHeld = 0;
1670
1692
  function assignProp(node, prop, value, prev, skipRef, nodeName) {
1671
1693
  if (prop === "style") return style(node, value, prev), value;
1672
1694
  if (prop === "class") return className(node, value, prev), value;
1673
- if (value === prev && DOMWithState[nodeName]?.[prop] !== 1) return prev;
1695
+ if (value === prev && (spreadHeld || DOMWithState[nodeName]?.[prop] !== 1)) return prev;
1674
1696
  if (prop === "ref") {
1675
1697
  if (!skipRef && value) ref(() => value, node);
1676
1698
  return value;
@@ -1715,37 +1737,32 @@ function eventHandler(e, container, state) {
1715
1737
  e[$$EVENT_OWNER] = owner;
1716
1738
  let node = resumeNode || e.target;
1717
1739
  const key = EVENT_KEY + e.type;
1718
- const retarget = value => Object.defineProperty(e, "target", {
1740
+ const define = (name, value) => Object.defineProperty(e, name, {
1719
1741
  configurable: true,
1720
1742
  value
1721
1743
  });
1722
1744
  const handleNode = () => {
1723
1745
  const handler = node[key];
1724
1746
  if (handler && !node.disabled) {
1747
+ define("currentTarget", node);
1725
1748
  const data = node[`${key}Data`];
1726
1749
  data !== undefined ? handler.call(node, data, e) : typeof handler === "function" ? handler.call(node, e) : handler.handleEvent(e);
1727
1750
  if (e.cancelBubble) return;
1728
1751
  }
1729
- node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host);
1752
+ node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && define("target", node.host);
1730
1753
  return true;
1731
1754
  };
1732
1755
  const atOwner = () => node === owner || node.parentNode === owner;
1733
1756
  const walkUpTree = () => {
1734
1757
  while (node && handleNode() && !atOwner()) node = parentOf(node);
1735
1758
  };
1736
- Object.defineProperty(e, "currentTarget", {
1737
- configurable: true,
1738
- get() {
1739
- return node || owner;
1740
- }
1741
- });
1742
1759
  if (resumeNode) {
1743
1760
  if (resumeNode === e.target) node = parentOf(resumeNode);
1744
1761
  if (node && node !== owner) walkUpTree();
1745
1762
  } else if (e.composedPath) {
1746
1763
  const path = e.composedPath();
1747
1764
  if (path.length) {
1748
- retarget(path[0]);
1765
+ define("target", path[0]);
1749
1766
  for (let i = 0; i < path.length; i++) {
1750
1767
  node = path[i];
1751
1768
  if (!handleNode()) break;
@@ -1814,7 +1831,8 @@ function insertExpression(parent, value, current, marker) {
1814
1831
  if (t === "string" || t === "number") {
1815
1832
  const prev = currentArray ? current[i] : undefined;
1816
1833
  if (prev && prev.nodeType === 3) {
1817
- if (prev.data !== "" + item) prev.data = item;
1834
+ const last = prev._$d;
1835
+ if (last !== item && (last !== undefined || prev.data !== "" + item)) prev.data = prev._$d = item;
1818
1836
  value[i] = prev;
1819
1837
  } else value[i] = document.createTextNode(item);
1820
1838
  }
@@ -1874,13 +1892,16 @@ function normalize(value, current, multi, doNotUnwrap) {
1874
1892
  }
1875
1893
  return value;
1876
1894
  }
1895
+ function hostGetter() {
1896
+ return this[$$HOST]();
1897
+ }
1877
1898
  function tagHost(value, host) {
1878
1899
  if (Array.isArray(value)) {
1879
1900
  for (let i = 0, len = value.length; i < len; i++) tagHost(value[i], host);
1880
1901
  } else if (value && value.nodeType && value[$$HOST] !== host) {
1881
1902
  value[$$HOST] = host;
1882
1903
  Object.defineProperty(value, "_$host", {
1883
- get: host,
1904
+ get: hostGetter,
1884
1905
  configurable: true
1885
1906
  });
1886
1907
  }
@@ -2141,6 +2162,7 @@ function portalImpl(props) {
2141
2162
  const m = untrack(mount);
2142
2163
  m.appendChild(endMarker);
2143
2164
  const dispose = runWithOwner(owner, () => createRoot(d => {
2165
+ installHostTagging();
2144
2166
  insert(m, c, endMarker, undefined, {
2145
2167
  host: () => treeMarker.parentNode
2146
2168
  });
@@ -2226,4 +2248,4 @@ _moduleUrl) {
2226
2248
  function httpStatus(_code, _text) {}
2227
2249
  function httpHeader(_name, _value, _options) {}
2228
2250
 
2229
- export { ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, HREF, HydrationScript, MathMLElements, NULL_BODY_STATUSES, Namespaces, Portal, RESPONSE_HEADER_VALUE_LIMIT, REVALIDATE_ALL, REVALIDATE_HEADER, RawTextElements, RequestContext, ResponseEnvelope, SAFE_ERROR, SVGElements, VoidElements, acquireAsset, addEvent, applyRef, assign, claimElement, claimElementTree, className, clearFlashCookie, clientOnly, commitEventResponse, composeMiddleware, configureServerErrors, createRequestEvent, createResponseStub, createSSRResponse, delegateEvents, dispatchAsInteraction, dynamic, dynamicProperty, effect, escape, generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getHydrationWriter, getNextElement, getNextMarker, getNextMatch, getNextSibling, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, hasServerLinkState, httpHeader, httpStatus, hydrate, insert, installHydrationRuntime, installServerComponentHydration, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, readShallow, redirect, ref, registerDelegatedContainer, registerDelegatedRoot, registerElementClaim, reload, render, renderToStream, renderToString, reportRequestFailure, resolveSSRNode, respond, runHydrationEvents, scope, serializeCookie, setAttribute, setAttributeNS, setLinkClaim, setProperty, setStatefulProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrElementAttribute, ssrGroup, ssrHydrationKey, ssrLinkClaim, ssrStyle, ssrStyleProperties, ssrStyleProperty, style, takeHydrationValue, template, unregisterDelegatedContainer, unregisterDelegatedRoot, useHead, waitAsset, warmAsset };
2251
+ export { ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, HREF, HydrationScript, MathMLElements, NULL_BODY_STATUSES, Namespaces, Portal, RESPONSE_HEADER_VALUE_LIMIT, REVALIDATE_ALL, REVALIDATE_HEADER, RawTextElements, RequestContext, ResponseEnvelope, SAFE_ERROR, SVGElements, VoidElements, acquireAsset, addEvent, applyRef, assign, claimElement, claimElementTree, className, clearFlashCookie, clientOnly, commitEventResponse, composeMiddleware, configureServerErrors, createRequestEvent, createResponseStub, createSSRResponse, delegateEvents, dispatchAsInteraction, dynamic, dynamicProperty, effect, escape, generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getHydrationWriter, getNextElement, getNextMarker, getNextMatch, getNextSibling, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, hasServerLinkState, httpHeader, httpStatus, hydrate, insert, installHostTagging, installHydrationRuntime, installServerComponentHydration, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, readShallow, redirect, ref, registerDelegatedContainer, registerDelegatedRoot, registerElementClaim, reload, render, renderToStream, renderToString, reportRequestFailure, resolveSSRNode, respond, runHydrationEvents, scope, serializeCookie, setAttribute, setAttributeNS, setLinkClaim, setProperty, setStatefulProperty, setStyleProperty, setTrustedTypesPolicy, spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrElementAttribute, ssrGroup, ssrHydrationKey, ssrLinkClaim, ssrStyle, ssrStyleProperties, ssrStyleProperty, strictHandler, style, takeHydrationValue, template, trustedHTML, unregisterDelegatedContainer, unregisterDelegatedRoot, useHead, waitAsset, warmAsset };
@@ -1,5 +1,5 @@
1
1
  import { OBSERVE, DEV, getOwner, onCleanup, createMemo, runWithOwner, untrack, createRenderEffect, onHydrationEnd, createSignal, createOwner } from 'solid-js';
2
- import { installServerComponentHydration, insert } from '@solidjs/web';
2
+ import { installServerComponentHydration, insert, trustedHTML } from '@solidjs/web';
3
3
  import { frameAddress, SINGLE_FLIGHT_HEADER, LIVE_WIRE, deserializeStream, getServerFunctionsCodec, createChunk, deliverFlightData, ERROR_HEADER, hasFlightMetadata, ChunkReader, configureServerFunctionsClient } from '@solidjs/web/server-functions/client';
4
4
  import { setSignalIdentities, sharedConfig, createLoadingBoundary, setWriteHook, setReadWatch, signalName, storeName } from 'solid-js/internal';
5
5
 
@@ -900,9 +900,13 @@ function removeUntil(parent, n, stop) {
900
900
  n = next;
901
901
  }
902
902
  }
903
+ let trusted;
904
+ function setTrustedHTML(wrap) {
905
+ trusted = wrap;
906
+ }
903
907
  function parseFragment(html) {
904
908
  const template = document.createElement("template");
905
- template.innerHTML = html;
909
+ template.innerHTML = trusted ? trusted(html) : html;
906
910
  return template.content;
907
911
  }
908
912
  function isPlaceholderStart(node, id) {
@@ -1382,6 +1386,7 @@ function createServerComponentHandler({
1382
1386
  }
1383
1387
  }
1384
1388
 
1389
+ setTrustedHTML(trustedHTML);
1385
1390
  const TRACE_STATE = Symbol.for("solid.container-trace-state");
1386
1391
  tierLoaders.trace = () => import('@solidjs/web/frames/trace');
1387
1392
  tierLoaders.regions = () => import('@solidjs/web/frames/regions');
@@ -1,5 +1,5 @@
1
1
  import { getOwner, onCleanup, createMemo, runWithOwner, untrack, createRenderEffect, onHydrationEnd, createSignal, createOwner } from 'solid-js';
2
- import { installServerComponentHydration, insert } from '@solidjs/web';
2
+ import { installServerComponentHydration, insert, trustedHTML } from '@solidjs/web';
3
3
  import { LIVE_WIRE, ChunkReader, frameAddress, SINGLE_FLIGHT_HEADER, deserializeStream, getServerFunctionsCodec, createChunk, deliverFlightData, ERROR_HEADER, hasFlightMetadata, configureServerFunctionsClient } from '@solidjs/web/server-functions/client';
4
4
  import { setSignalIdentities, sharedConfig, createLoadingBoundary, setWriteHook, signalName, storeName } from 'solid-js/internal';
5
5
 
@@ -885,9 +885,13 @@ function removeUntil(parent, n, stop) {
885
885
  n = next;
886
886
  }
887
887
  }
888
+ let trusted;
889
+ function setTrustedHTML(wrap) {
890
+ trusted = wrap;
891
+ }
888
892
  function parseFragment(html) {
889
893
  const template = document.createElement("template");
890
- template.innerHTML = html;
894
+ template.innerHTML = trusted ? trusted(html) : html;
891
895
  return template.content;
892
896
  }
893
897
  function isPlaceholderStart(node, id) {
@@ -1255,6 +1259,7 @@ function createServerComponentHandler({
1255
1259
  }
1256
1260
  }
1257
1261
 
1262
+ setTrustedHTML(trustedHTML);
1258
1263
  const TRACE_STATE = Symbol.for("solid.container-trace-state");
1259
1264
  tierLoaders.trace = () => import('@solidjs/web/frames/trace');
1260
1265
  tierLoaders.regions = () => import('@solidjs/web/frames/regions');
@@ -1,6 +1,6 @@
1
1
  import * as core from 'solid-js';
2
2
  import { OBSERVE, getOwner, onCleanup, createMemo, runWithOwner, untrack, createRenderEffect, onHydrationEnd, createSignal, createOwner } from 'solid-js';
3
- import { installServerComponentHydration, insert } from '@solidjs/web';
3
+ import { installServerComponentHydration, insert, trustedHTML } from '@solidjs/web';
4
4
  import { frameAddress, SINGLE_FLIGHT_HEADER, LIVE_WIRE, deserializeStream, getServerFunctionsCodec, createChunk, deliverFlightData, ERROR_HEADER, hasFlightMetadata, ChunkReader, configureServerFunctionsClient } from '@solidjs/web/server-functions/client';
5
5
 
6
6
  const ELEMENT_NODE = 1;
@@ -890,9 +890,13 @@ function removeUntil(parent, n, stop) {
890
890
  n = next;
891
891
  }
892
892
  }
893
+ let trusted;
894
+ function setTrustedHTML(wrap) {
895
+ trusted = wrap;
896
+ }
893
897
  function parseFragment(html) {
894
898
  const template = document.createElement("template");
895
- template.innerHTML = html;
899
+ template.innerHTML = trusted ? trusted(html) : html;
896
900
  return template.content;
897
901
  }
898
902
  function isPlaceholderStart(node, id) {
@@ -1365,6 +1369,7 @@ const storeName = core.storeName;
1365
1369
  const createLoadingBoundary = core.createLoadingBoundary;
1366
1370
  const sharedConfig = core.sharedConfig;
1367
1371
 
1372
+ setTrustedHTML(trustedHTML);
1368
1373
  const TRACE_STATE = Symbol.for("solid.container-trace-state");
1369
1374
  tierLoaders.trace = () => import('@solidjs/web/frames/trace');
1370
1375
  tierLoaders.regions = () => import('@solidjs/web/frames/regions');