marko 6.4.14 → 6.4.15

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
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_control_flow = require("../html-DfZjMkhx.js");
3
+ const require_control_flow = require("../html-7qRi22mK.js");
4
4
  // src/common/compat-meta.ts
5
5
  const SET_SCOPE_REGISTER_ID = "$compat_setScope";
6
6
  const RENDER_BODY_ID = "$compat_renderBody";
@@ -1,4 +1,4 @@
1
- import { A as $global, F as State, Ft as register, J as _scope_id, M as Boundary, N as Chunk, P as NOOP, Pt as REGISTRY, Q as _set_scope_reason, V as _html, Vt as setClassAPIRenderer, W as _peek_scope_id, Z as _script, _ as writeLoadAsset, at as getChunk, ct as joinHeldEffects, dt as writeScript, j as ALL_GROUPS, k as $chunk, lt as withChunk, ot as getScopeId, st as isInResumedBranch, t as _await, ut as writeScope } from "../html-DMo6pc_h.mjs";
1
+ import { A as $global, F as State, Ft as register, J as _scope_id, M as Boundary, N as Chunk, P as NOOP, Pt as REGISTRY, Q as _set_scope_reason, V as _html, Vt as setClassAPIRenderer, W as _peek_scope_id, Z as _script, _ as writeLoadAsset, at as getChunk, ct as joinHeldEffects, dt as writeScript, j as ALL_GROUPS, k as $chunk, lt as withChunk, ot as getScopeId, st as isInResumedBranch, t as _await, ut as writeScope } from "../html-C17tAtch.mjs";
2
2
  // src/common/compat-meta.ts
3
3
  const SET_SCOPE_REGISTER_ID = "$compat_setScope";
4
4
  const RENDER_BODY_ID = "$compat_renderBody";
@@ -2113,6 +2113,10 @@ const WALKER_RUNTIME_CODE = `((runtimeId) => (self[runtimeId] ||= (
2113
2113
  visits.push(node);
2114
2114
  }
2115
2115
  }
2116
+
2117
+ // Back to the script calling it, which is where the parser is: a node
2118
+ // another script appended lies past it, ahead of what streams in later.
2119
+ walker.currentNode = document.currentScript;
2116
2120
  },
2117
2121
  })
2118
2122
  , self[runtimeId]))`;
@@ -2112,6 +2112,10 @@ const WALKER_RUNTIME_CODE = `((runtimeId) => (self[runtimeId] ||= (
2112
2112
  visits.push(node);
2113
2113
  }
2114
2114
  }
2115
+
2116
+ // Back to the script calling it, which is where the parser is: a node
2117
+ // another script appended lies past it, ahead of what streams in later.
2118
+ walker.currentNode = document.currentScript;
2115
2119
  },
2116
2120
  })
2117
2121
  , self[runtimeId]))`;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_control_flow = require("./html-DfZjMkhx.js");
3
+ const require_control_flow = require("./html-7qRi22mK.js");
4
4
  exports.$global = require_control_flow.$global;
5
5
  exports._assert_class_toggles = require_control_flow._assert_class_toggles;
6
6
  exports._assert_hoist = require_control_flow._assert_hoist;
@@ -1 +1 @@
1
- export { A as $global, It as _assert_class_toggles, Lt as _assert_hoist, ft as _attr, pt as _attr_and, mt as _attr_class, I as _attr_content, ht as _attr_details_open, ht as _attr_dialog_open, gt as _attr_input_checked, _t as _attr_input_checkedValue, vt as _attr_input_value, yt as _attr_nonce, bt as _attr_nullish, xt as _attr_option_value, St as _attr_or, Ct as _attr_select_value, wt as _attr_style, Tt as _attr_textarea_value, Et as _attrs, Dt as _attrs_content, Ot as _attrs_partial, kt as _attrs_partial_content, At as _attrs_select_value, jt as _attrs_textarea_value, t as _await, y as _content, b as _content_resume, x as _dynamic_tag, L as _el, R as _el_mark, Rt as _el_read_error, S as _escape, C as _escape_comment, w as _escape_script, T as _escape_style, E as _escape_style_value, z as _existing_scope, m as _flush_head, n as _for_in, r as _for_of, i as _for_to, a as _for_until, B as _hoist, zt as _hoist_read_error, V as _html, H as _html_mark, U as _id, o as _if, W as _peek_scope_id, G as _resume, K as _resume_branch, q as _resume_locals, ut as _scope, J as _scope_id, Y as _scope_reason, X as _scope_with_id, Z as _script, Q as _set_scope_reason, s as _show_end, c as _show_start, Bt as _signal_read_error, Mt as _style_html, $ as _subscribe, v as _template, et as _text_mark, Nt as _textarea_value, D as _to_text, tt as _trailers, l as _try, O as _unescaped, nt as _var, rt as _write_guard, it as _write_if, Ht as attrTag, Ut as attrTags, u as forIn, d as forOf, f as forTo, p as forUntil, h as withLoadAssets, g as withPageAssets } from "./html-DMo6pc_h.mjs";
1
+ export { A as $global, It as _assert_class_toggles, Lt as _assert_hoist, ft as _attr, pt as _attr_and, mt as _attr_class, I as _attr_content, ht as _attr_details_open, ht as _attr_dialog_open, gt as _attr_input_checked, _t as _attr_input_checkedValue, vt as _attr_input_value, yt as _attr_nonce, bt as _attr_nullish, xt as _attr_option_value, St as _attr_or, Ct as _attr_select_value, wt as _attr_style, Tt as _attr_textarea_value, Et as _attrs, Dt as _attrs_content, Ot as _attrs_partial, kt as _attrs_partial_content, At as _attrs_select_value, jt as _attrs_textarea_value, t as _await, y as _content, b as _content_resume, x as _dynamic_tag, L as _el, R as _el_mark, Rt as _el_read_error, S as _escape, C as _escape_comment, w as _escape_script, T as _escape_style, E as _escape_style_value, z as _existing_scope, m as _flush_head, n as _for_in, r as _for_of, i as _for_to, a as _for_until, B as _hoist, zt as _hoist_read_error, V as _html, H as _html_mark, U as _id, o as _if, W as _peek_scope_id, G as _resume, K as _resume_branch, q as _resume_locals, ut as _scope, J as _scope_id, Y as _scope_reason, X as _scope_with_id, Z as _script, Q as _set_scope_reason, s as _show_end, c as _show_start, Bt as _signal_read_error, Mt as _style_html, $ as _subscribe, v as _template, et as _text_mark, Nt as _textarea_value, D as _to_text, tt as _trailers, l as _try, O as _unescaped, nt as _var, rt as _write_guard, it as _write_if, Ht as attrTag, Ut as attrTags, u as forIn, d as forOf, f as forTo, p as forUntil, h as withLoadAssets, g as withPageAssets } from "./html-C17tAtch.mjs";
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- let require_control_flow = require("../html-DrHsybFm.js"), SET_SCOPE_REGISTER_ID = "$C_s", RENDER_BODY_ID = "$C_b", K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap(), compat = {
2
+ let require_control_flow = require("../html-BaAyg2TB.js"), SET_SCOPE_REGISTER_ID = "$C_s", RENDER_BODY_ID = "$C_b", K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap(), compat = {
3
3
  $global: require_control_flow.A,
4
4
  writeLoadAsset: require_control_flow._,
5
5
  fork(scopeId, promise, content) {
@@ -149,7 +149,7 @@ let SET_SCOPE_REGISTER_ID = "$C_s", RENDER_BODY_ID = "$C_b", K_TAGS_API_STATE =
149
149
  return !!pendingClassFunctions.get($global)?.length;
150
150
  }
151
151
  }, pendingClassFunctions = /* @__PURE__ */ new WeakMap();
152
- import { A as $global, F as State, Ft as register, J as _scope_id, M as Boundary, N as Chunk, P as NOOP, Pt as REGISTRY, Q as _set_scope_reason, V as _html, Vt as setClassAPIRenderer, W as _peek_scope_id, Z as _script, _ as writeLoadAsset, at as getChunk, ct as joinHeldEffects, dt as writeScript, j as ALL_GROUPS, k as $chunk, lt as withChunk, ot as getScopeId, st as isInResumedBranch, t as _await, ut as writeScope } from "../html-DMDc0zKs.mjs";
152
+ import { A as $global, F as State, Ft as register, J as _scope_id, M as Boundary, N as Chunk, P as NOOP, Pt as REGISTRY, Q as _set_scope_reason, V as _html, Vt as setClassAPIRenderer, W as _peek_scope_id, Z as _script, _ as writeLoadAsset, at as getChunk, ct as joinHeldEffects, dt as writeScript, j as ALL_GROUPS, k as $chunk, lt as withChunk, ot as getScopeId, st as isInResumedBranch, t as _await, ut as writeScope } from "../html-6w1jd6wm.mjs";
153
153
  // src/common/compat-meta.ts
154
154
  // src/html/compat.feat.ts
155
155
  function drainClassFunctions($global, writeScope) {
@@ -1,2 +1,2 @@
1
- export declare const WALKER_RUNTIME_CODE = "(e=>(self[e]||=(l,f=e+l,s=f.length,a={},d=[],t=document,n=t.createTreeWalker(t,129))=>t=self[e][l]={i:f,l:a,v:d,x(){},w(e,l,r){for(;e=n.nextNode();)t.x(l=(l=e.data)&&!l.indexOf(f)&&(r=l.slice(s+1),(l=l[s])>\"#\"||(a[r]=e),l),r,e),l>\"#\"&&d.push(e)}},self[e]))";
1
+ export declare const WALKER_RUNTIME_CODE = "(e=>(self[e]||=(l,f=e+l,s=f.length,a={},d=[],t=document,n=t.createTreeWalker(t,129))=>t=self[e][l]={i:f,l:a,v:d,x(){},w(e,l,r){for(;e=n.nextNode();)t.x(l=(l=e.data)&&!l.indexOf(f)&&(r=l.slice(s+1),(l=l[s])>\"#\"||(a[r]=e),l),r,e),l>\"#\"&&d.push(e);n.currentNode=document.currentScript}},self[e]))";
2
2
  export declare const REORDER_RUNTIME_CODE = "(e=>{if(e.j)return;let i,l,r,t=e.p={},c=(i,l)=>e.l[i].replaceWith(...l.childNodes);e.j={},e.x=(n,a,d,o,g)=>{d==r&&i(),\"#\"==n?(t[a]=l).i++:\"T\"==d.tagName&&(a=d.getAttribute(e.i))&&(r=d.nextSibling,i=e=>{d.remove(),o||c(a,d),l.c()},l=t[a]||(o=t[a]={i:1,r:a,c(i=e.l[\"^\"+a],f=d.cloneNode()){if(--o.i)return 1;for(;f.prepend(r=e.l[a].previousSibling||i),i!=r;);c(a,d)}}),e.v.push({data:e.i+\"*\"+l.r}),(n=e.j[a])&&(g=l.c,l.c=i=>g()||n(e.r)))}})";
@@ -1,2 +1,2 @@
1
- export declare const WALKER_RUNTIME_CODE = "((runtimeId) => (self[runtimeId] ||= (\n renderId,\n prefix = runtimeId + renderId,\n prefixLen = prefix.length,\n lookup = {},\n visits = [],\n doc = document,\n walker = doc.createTreeWalker(\n doc,\n 129 /* NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_ELEMENT */,\n ),\n) =>\n doc = (self[runtimeId][renderId] = {\n i: prefix,\n l: lookup,\n v: visits,\n x() {},\n w(node, op, id) {\n while ((node = walker.nextNode())) {\n // Only reorder markers (\"#\", \"!\") are ever looked up, so only they are\n // kept: the lookup lives as long as the page, and every node marker\n // would otherwise stay referenced in it after resume consumed it.\n doc.x(\n (op =\n (op = node.data) &&\n !op.indexOf(prefix) &&\n ((id = op.slice(prefixLen + 1)),\n (op = op[prefixLen]) > \"#\" || (lookup[id] = node),\n op)),\n id,\n node,\n );\n\n if (op > \"#\") {\n visits.push(node);\n }\n }\n },\n })\n, self[runtimeId]))";
1
+ export declare const WALKER_RUNTIME_CODE = "((runtimeId) => (self[runtimeId] ||= (\n renderId,\n prefix = runtimeId + renderId,\n prefixLen = prefix.length,\n lookup = {},\n visits = [],\n doc = document,\n walker = doc.createTreeWalker(\n doc,\n 129 /* NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_ELEMENT */,\n ),\n) =>\n doc = (self[runtimeId][renderId] = {\n i: prefix,\n l: lookup,\n v: visits,\n x() {},\n w(node, op, id) {\n while ((node = walker.nextNode())) {\n // Only reorder markers (\"#\", \"!\") are ever looked up, so only they are\n // kept: the lookup lives as long as the page, and every node marker\n // would otherwise stay referenced in it after resume consumed it.\n doc.x(\n (op =\n (op = node.data) &&\n !op.indexOf(prefix) &&\n ((id = op.slice(prefixLen + 1)),\n (op = op[prefixLen]) > \"#\" || (lookup[id] = node),\n op)),\n id,\n node,\n );\n\n if (op > \"#\") {\n visits.push(node);\n }\n }\n\n // Back to the script calling it, which is where the parser is: a node\n // another script appended lies past it, ahead of what streams in later.\n walker.currentNode = document.currentScript;\n },\n })\n, self[runtimeId]))";
2
2
  export declare const REORDER_RUNTIME_CODE = "((runtime) => {\n if (runtime.j) return;\n let onNextSibling,\n placeholder,\n nextSibling,\n placeholders = runtime.p = {},\n replace = (id, container) => runtime.l[id].replaceWith(...container.childNodes);\n runtime.j = {};\n runtime.x = (op, id, node, placeholderRoot, placeholderCb) => {\n if (node == nextSibling) {\n onNextSibling();\n }\n\n if (op == \"#\") {\n (placeholders[id] = placeholder).i++;\n } else if (node.tagName == \"T\" && (id = node.getAttribute(runtime.i))) {\n nextSibling = node.nextSibling;\n onNextSibling = (_) => {\n node.remove();\n placeholderRoot || replace(id, node);\n placeholder.c();\n };\n placeholder =\n placeholders[id] ||\n (placeholderRoot = placeholders[id] =\n {\n // The writer streams a reorder only after its markers.\n i: 1,\n r: id,\n // Resume may still walk markers inside the dropped placeholder, so\n // park it in any detached parent (a bare <t> clone is the cheapest).\n c(start = runtime.l[\"^\" + id], removed = node.cloneNode()) {\n if (--placeholderRoot.i) return 1;\n for (\n ;\n removed.prepend(\n (nextSibling = runtime.l[id].previousSibling || start),\n ),\n start != nextSibling;\n\n );\n replace(id, node);\n },\n });\n // Opens the chunk's visits for resume to parent to the root's branch; the\n // walk that this chunk's own script triggers closes it.\n runtime.v.push({ data: runtime.i + \"*\" + placeholder.r });\n // repurpose \"op\" for callbacks ...carefully\n if ((op = runtime.j[id])) {\n placeholderCb = placeholder.c;\n placeholder.c = (_) => placeholderCb() || op(runtime.r);\n }\n }\n };\n})";
@@ -1510,7 +1510,7 @@ var State = class {
1510
1510
  flushSerializer(boundary, this);
1511
1511
  }
1512
1512
  runtimeScript() {
1513
- return "(e=>(self[e]||=(l,f=e+l,s=f.length,a={},d=[],t=document,n=t.createTreeWalker(t,129))=>t=self[e][l]={i:f,l:a,v:d,x(){},w(e,l,r){for(;e=n.nextNode();)t.x(l=(l=e.data)&&!l.indexOf(f)&&(r=l.slice(s+1),(l=l[s])>\"#\"||(a[r]=e),l),r,e),l>\"#\"&&d.push(e)}},self[e]))(\"" + this.$global.runtimeId + "\")(\"" + this.$global.renderId + "\")";
1513
+ return "(e=>(self[e]||=(l,f=e+l,s=f.length,a={},d=[],t=document,n=t.createTreeWalker(t,129))=>t=self[e][l]={i:f,l:a,v:d,x(){},w(e,l,r){for(;e=n.nextNode();)t.x(l=(l=e.data)&&!l.indexOf(f)&&(r=l.slice(s+1),(l=l[s])>\"#\"||(a[r]=e),l),r,e),l>\"#\"&&d.push(e);n.currentNode=document.currentScript}},self[e]))(\"" + this.$global.runtimeId + "\")(\"" + this.$global.renderId + "\")";
1514
1514
  }
1515
1515
  keepsTryMarks(chunk, resumeWrites) {
1516
1516
  return chunk !== $chunk || chunk.boundary.resumeWrites !== resumeWrites;
@@ -1511,7 +1511,7 @@ var State = class {
1511
1511
  flushSerializer(boundary, this);
1512
1512
  }
1513
1513
  runtimeScript() {
1514
- return "(e=>(self[e]||=(l,f=e+l,s=f.length,a={},d=[],t=document,n=t.createTreeWalker(t,129))=>t=self[e][l]={i:f,l:a,v:d,x(){},w(e,l,r){for(;e=n.nextNode();)t.x(l=(l=e.data)&&!l.indexOf(f)&&(r=l.slice(s+1),(l=l[s])>\"#\"||(a[r]=e),l),r,e),l>\"#\"&&d.push(e)}},self[e]))(\"" + this.$global.runtimeId + "\")(\"" + this.$global.renderId + "\")";
1514
+ return "(e=>(self[e]||=(l,f=e+l,s=f.length,a={},d=[],t=document,n=t.createTreeWalker(t,129))=>t=self[e][l]={i:f,l:a,v:d,x(){},w(e,l,r){for(;e=n.nextNode();)t.x(l=(l=e.data)&&!l.indexOf(f)&&(r=l.slice(s+1),(l=l[s])>\"#\"||(a[r]=e),l),r,e),l>\"#\"&&d.push(e);n.currentNode=document.currentScript}},self[e]))(\"" + this.$global.runtimeId + "\")(\"" + this.$global.renderId + "\")";
1515
1515
  }
1516
1516
  keepsTryMarks(chunk, resumeWrites) {
1517
1517
  return chunk !== $chunk || chunk.boundary.resumeWrites !== resumeWrites;
package/dist/html.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- let require_control_flow = require("./html-DrHsybFm.js"), empty = [], rest = Symbol();
2
+ let require_control_flow = require("./html-BaAyg2TB.js"), empty = [], rest = Symbol();
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  // src/common/attr-tag.ts
5
5
  function attrTag(attrs) {
package/dist/html.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  let empty = [], rest = Symbol();
2
- import { $ as _subscribe, A as $global, At as _attrs_select_value, B as _hoist, Bt as _signal_read_error, C as _escape_comment, Ct as _attr_select_value, D as _to_text, Dt as _attrs_content, E as _escape_style_value, Et as _attrs, G as _resume, H as _html_mark, I as _attr_content, It as _assert_class_toggles, J as _scope_id, K as _resume_branch, L as _el, Lt as _assert_hoist, Mt as _style_html, Nt as _textarea_value, O as _unescaped, Ot as _attrs_partial, Q as _set_scope_reason, R as _el_mark, Rt as _el_read_error, S as _escape, St as _attr_or, T as _escape_style, Tt as _attr_textarea_value, U as _id, V as _html, W as _peek_scope_id, X as _scope_with_id, Y as _scope_reason, Z as _script, _t as _attr_input_checkedValue, a as _for_until, b as _content_resume, bt as _attr_nullish, c as _show_start, d as forOf, et as _text_mark, f as forTo, ft as _attr, g as withPageAssets, gt as _attr_input_checked, h as withLoadAssets, ht as _attr_details_or_dialog_open, i as _for_to, it as _write_if, jt as _attrs_textarea_value, kt as _attrs_partial_content, l as _try, m as _flush_head, mt as _attr_class, n as _for_in, nt as _var, o as _if, p as forUntil, pt as _attr_and, q as _resume_locals, r as _for_of, rt as _write_guard, s as _show_end, t as _await, tt as _trailers, u as forIn, ut as writeScope, v as _template, vt as _attr_input_value, w as _escape_script, wt as _attr_style, x as _dynamic_tag, xt as _attr_option_value, y as _content, yt as _attr_nonce, z as _existing_scope, zt as _hoist_read_error } from "./html-DMDc0zKs.mjs";
2
+ import { $ as _subscribe, A as $global, At as _attrs_select_value, B as _hoist, Bt as _signal_read_error, C as _escape_comment, Ct as _attr_select_value, D as _to_text, Dt as _attrs_content, E as _escape_style_value, Et as _attrs, G as _resume, H as _html_mark, I as _attr_content, It as _assert_class_toggles, J as _scope_id, K as _resume_branch, L as _el, Lt as _assert_hoist, Mt as _style_html, Nt as _textarea_value, O as _unescaped, Ot as _attrs_partial, Q as _set_scope_reason, R as _el_mark, Rt as _el_read_error, S as _escape, St as _attr_or, T as _escape_style, Tt as _attr_textarea_value, U as _id, V as _html, W as _peek_scope_id, X as _scope_with_id, Y as _scope_reason, Z as _script, _t as _attr_input_checkedValue, a as _for_until, b as _content_resume, bt as _attr_nullish, c as _show_start, d as forOf, et as _text_mark, f as forTo, ft as _attr, g as withPageAssets, gt as _attr_input_checked, h as withLoadAssets, ht as _attr_details_or_dialog_open, i as _for_to, it as _write_if, jt as _attrs_textarea_value, kt as _attrs_partial_content, l as _try, m as _flush_head, mt as _attr_class, n as _for_in, nt as _var, o as _if, p as forUntil, pt as _attr_and, q as _resume_locals, r as _for_of, rt as _write_guard, s as _show_end, t as _await, tt as _trailers, u as forIn, ut as writeScope, v as _template, vt as _attr_input_value, w as _escape_script, wt as _attr_style, x as _dynamic_tag, xt as _attr_option_value, y as _content, yt as _attr_nonce, z as _existing_scope, zt as _hoist_read_error } from "./html-6w1jd6wm.mjs";
3
3
  // src/common/attr-tag.ts
4
4
  function attrTag(attrs) {
5
5
  return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.4.14",
3
+ "version": "6.4.15",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",
@@ -57,8 +57,8 @@
57
57
  "magic-string": "^1.4.5"
58
58
  },
59
59
  "devDependencies": {
60
- "@marko/runtime-tags": "npm:marko@6.4.14",
61
- "marko": "5.40.1"
60
+ "@marko/runtime-tags": "npm:marko@6.4.15",
61
+ "marko": "5.40.2"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=22.12.0"