marko 6.0.42 → 6.0.44

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/dist/debug/dom.js CHANGED
@@ -273,7 +273,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
273
273
  let resumeRender;
274
274
  const initRuntime = (renders2) => {
275
275
  defineRuntime({
276
- value: resumeRender = (renderId) => {
276
+ value: resumeRender = ((renderId) => {
277
277
  const render = resumeRender[renderId] = renders2[renderId] || renders2(renderId);
278
278
  const walk2 = render.w;
279
279
  const commentPrefixLen = render.i.length;
@@ -432,7 +432,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
432
432
  }
433
433
  };
434
434
  return render;
435
- }
435
+ })
436
436
  });
437
437
  };
438
438
  if (renders) {
@@ -969,7 +969,7 @@ function dynamicClosure(...closureSignals) {
969
969
  }
970
970
  function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
971
971
  const childSignal = closure(valueAccessor, fn, getOwnerScope);
972
- const closureSignal = (scope) => {
972
+ const closureSignal = ((scope) => {
973
973
  scope[closureSignal.___signalIndexAccessor] = closureSignal.___index;
974
974
  childSignal(scope);
975
975
  subscribeToScopeSet(
@@ -977,7 +977,7 @@ function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
977
977
  closureSignal.___scopeInstancesAccessor,
978
978
  scope
979
979
  );
980
- };
980
+ });
981
981
  closureSignal.___scopeInstancesAccessor = "ClosureScopes:" /* ClosureScopes */ + valueAccessor;
982
982
  closureSignal.___signalIndexAccessor = "ClosureSignalIndex:" /* ClosureSignalIndex */ + valueAccessor;
983
983
  return closureSignal;
@@ -2230,14 +2230,11 @@ var compat = {
2230
2230
  destroyBranch(this.scope);
2231
2231
  }
2232
2232
  },
2233
- resolveRegistered(value2, {
2234
- runtimeId,
2235
- componentIdPrefix
2236
- }) {
2233
+ resolveRegistered(value2, $global) {
2237
2234
  if (Array.isArray(value2) && typeof value2[0] === "string") {
2238
2235
  return getRegisteredWithScope(
2239
2236
  value2[0],
2240
- value2.length === 2 && self[runtimeId]?.[componentIdPrefix === "s" ? "_" : componentIdPrefix]?.s[value2[1]]
2237
+ value2.length === 2 && self[$global.runtimeId]?.[$global.renderId]?.s[value2[1]]
2241
2238
  );
2242
2239
  }
2243
2240
  return value2;
@@ -177,7 +177,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
177
177
  let resumeRender;
178
178
  const initRuntime = (renders2) => {
179
179
  defineRuntime({
180
- value: resumeRender = (renderId) => {
180
+ value: resumeRender = ((renderId) => {
181
181
  const render = resumeRender[renderId] = renders2[renderId] || renders2(renderId);
182
182
  const walk2 = render.w;
183
183
  const commentPrefixLen = render.i.length;
@@ -336,7 +336,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
336
336
  }
337
337
  };
338
338
  return render;
339
- }
339
+ })
340
340
  });
341
341
  };
342
342
  if (renders) {
@@ -873,7 +873,7 @@ function dynamicClosure(...closureSignals) {
873
873
  }
874
874
  function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
875
875
  const childSignal = closure(valueAccessor, fn, getOwnerScope);
876
- const closureSignal = (scope) => {
876
+ const closureSignal = ((scope) => {
877
877
  scope[closureSignal.___signalIndexAccessor] = closureSignal.___index;
878
878
  childSignal(scope);
879
879
  subscribeToScopeSet(
@@ -881,7 +881,7 @@ function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
881
881
  closureSignal.___scopeInstancesAccessor,
882
882
  scope
883
883
  );
884
- };
884
+ });
885
885
  closureSignal.___scopeInstancesAccessor = "ClosureScopes:" /* ClosureScopes */ + valueAccessor;
886
886
  closureSignal.___signalIndexAccessor = "ClosureSignalIndex:" /* ClosureSignalIndex */ + valueAccessor;
887
887
  return closureSignal;
@@ -2134,14 +2134,11 @@ var compat = {
2134
2134
  destroyBranch(this.scope);
2135
2135
  }
2136
2136
  },
2137
- resolveRegistered(value2, {
2138
- runtimeId,
2139
- componentIdPrefix
2140
- }) {
2137
+ resolveRegistered(value2, $global) {
2141
2138
  if (Array.isArray(value2) && typeof value2[0] === "string") {
2142
2139
  return getRegisteredWithScope(
2143
2140
  value2[0],
2144
- value2.length === 2 && self[runtimeId]?.[componentIdPrefix === "s" ? "_" : componentIdPrefix]?.s[value2[1]]
2141
+ value2.length === 2 && self[$global.runtimeId]?.[$global.renderId]?.s[value2[1]]
2145
2142
  );
2146
2143
  }
2147
2144
  return value2;
@@ -331,10 +331,10 @@ runtime.x = (op, id, node, start, placeholderCallback) => {
331
331
  // src/html/serializer.ts
332
332
  var kTouchedIterator = Symbol();
333
333
  var { hasOwnProperty } = {};
334
- var Generator = function* () {
335
- }().constructor;
336
- var AsyncGenerator = async function* () {
337
- }().constructor;
334
+ var Generator = (function* () {
335
+ })().constructor;
336
+ var AsyncGenerator = (async function* () {
337
+ })().constructor;
338
338
  patchIteratorNext(Generator.prototype);
339
339
  patchIteratorNext(AsyncGenerator.prototype);
340
340
  var REGISTRY = /* @__PURE__ */ new WeakMap();
@@ -3238,6 +3238,7 @@ function patchDynamicTag(patch) {
3238
3238
  var K_TAGS_API_STATE = Symbol();
3239
3239
  var COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap();
3240
3240
  var compat = {
3241
+ $global,
3241
3242
  fork,
3242
3243
  write,
3243
3244
  writeScript,
@@ -3273,7 +3274,7 @@ var compat = {
3273
3274
  let state = $global2[K_TAGS_API_STATE] ||= getChunk()?.boundary.state;
3274
3275
  if (!state) {
3275
3276
  $global2.runtimeId ||= DEFAULT_RUNTIME_ID;
3276
- $global2.renderId ||= $global2.componentIdPrefix || DEFAULT_RENDER_ID;
3277
+ $global2.renderId ||= $global2.componentIdPrefix || $global2.widgetIdPrefix || DEFAULT_RENDER_ID;
3277
3278
  $global2[K_TAGS_API_STATE] = state = new State2($global2);
3278
3279
  }
3279
3280
  const boundary = new Boundary(state);
@@ -247,10 +247,10 @@ runtime.x = (op, id, node, start, placeholderCallback) => {
247
247
  // src/html/serializer.ts
248
248
  var kTouchedIterator = Symbol();
249
249
  var { hasOwnProperty } = {};
250
- var Generator = function* () {
251
- }().constructor;
252
- var AsyncGenerator = async function* () {
253
- }().constructor;
250
+ var Generator = (function* () {
251
+ })().constructor;
252
+ var AsyncGenerator = (async function* () {
253
+ })().constructor;
254
254
  patchIteratorNext(Generator.prototype);
255
255
  patchIteratorNext(AsyncGenerator.prototype);
256
256
  var REGISTRY = /* @__PURE__ */ new WeakMap();
@@ -3154,6 +3154,7 @@ function patchDynamicTag(patch) {
3154
3154
  var K_TAGS_API_STATE = Symbol();
3155
3155
  var COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap();
3156
3156
  var compat = {
3157
+ $global,
3157
3158
  fork,
3158
3159
  write,
3159
3160
  writeScript,
@@ -3189,7 +3190,7 @@ var compat = {
3189
3190
  let state = $global2[K_TAGS_API_STATE] ||= getChunk()?.boundary.state;
3190
3191
  if (!state) {
3191
3192
  $global2.runtimeId ||= DEFAULT_RUNTIME_ID;
3192
- $global2.renderId ||= $global2.componentIdPrefix || DEFAULT_RENDER_ID;
3193
+ $global2.renderId ||= $global2.componentIdPrefix || $global2.widgetIdPrefix || DEFAULT_RENDER_ID;
3193
3194
  $global2[K_TAGS_API_STATE] = state = new State2($global2);
3194
3195
  }
3195
3196
  const boundary = new Boundary(state);
@@ -11,9 +11,9 @@ export declare const compat: {
11
11
  setScopeNodes(branch: any, startNode: Node, endNode: Node): void;
12
12
  runComponentEffects(this: any): void;
13
13
  runComponentDestroy(this: any): void;
14
- resolveRegistered(value: any, { runtimeId, componentIdPrefix, }: {
14
+ resolveRegistered(value: any, $global: {
15
15
  runtimeId: string;
16
- componentIdPrefix: string;
16
+ renderId: string;
17
17
  }): any;
18
18
  createRenderer(params: NonNullable<Renderer["___params"]>, clone: () => {
19
19
  startNode: ChildNode;
package/dist/dom.js CHANGED
@@ -201,18 +201,15 @@ function stripSpacesAndPunctuation(str) {
201
201
  return str.replace(/[^\p{L}\p{N}]/gu, "");
202
202
  }
203
203
 
204
- // src/common/meta.ts
205
- var DEFAULT_RUNTIME_ID = "M", DEFAULT_RENDER_ID = "_";
206
-
207
204
  // src/dom/resume.ts
208
205
  var registeredValues = {}, branchesEnabled;
209
206
  function enableBranches() {
210
207
  branchesEnabled = 1;
211
208
  }
212
- function init(runtimeId = DEFAULT_RUNTIME_ID) {
209
+ function init(runtimeId = "M") {
213
210
  let renders = self[runtimeId], defineRuntime = (desc) => Object.defineProperty(self, runtimeId, desc), resumeRender, initRuntime = (renders2) => {
214
211
  defineRuntime({
215
- value: resumeRender = (renderId) => {
212
+ value: resumeRender = ((renderId) => {
216
213
  let render = resumeRender[renderId] = renders2[renderId] || renders2(renderId), walk2 = render.w, commentPrefixLen = render.i.length, scopeLookup = render.s = {}, serializeContext = {
217
214
  _: registeredValues
218
215
  }, branches = branchesEnabled && /* @__PURE__ */ (() => {
@@ -283,7 +280,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
283
280
  isResuming = visits.length = resumes.length = 0;
284
281
  }
285
282
  }, render;
286
- }
283
+ })
287
284
  });
288
285
  };
289
286
  if (renders) {
@@ -631,13 +628,13 @@ function dynamicClosure(...closureSignals) {
631
628
  };
632
629
  }
633
630
  function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
634
- let childSignal = closure(valueAccessor, fn, getOwnerScope), closureSignal = (scope) => {
631
+ let childSignal = closure(valueAccessor, fn, getOwnerScope), closureSignal = ((scope) => {
635
632
  scope[closureSignal.F] = closureSignal.L, childSignal(scope), subscribeToScopeSet(
636
633
  getOwnerScope ? getOwnerScope(scope) : scope._,
637
634
  closureSignal.E,
638
635
  scope
639
636
  );
640
- };
637
+ });
641
638
  return closureSignal.E = "a" /* ClosureScopes */ + valueAccessor, closureSignal.F = "b" /* ClosureSignalIndex */ + valueAccessor, closureSignal;
642
639
  }
643
640
  function closure(valueAccessor, fn, getOwnerScope) {
@@ -1432,7 +1429,7 @@ function abort(ctrl) {
1432
1429
  }
1433
1430
 
1434
1431
  // src/common/compat-meta.ts
1435
- var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s", RENDER_BODY_ID = prefix + "b";
1432
+ var RENDERER_REGISTER_ID = "$C_r", SET_SCOPE_REGISTER_ID = "$C_s", RENDER_BODY_ID = "$C_b";
1436
1433
 
1437
1434
  // src/dom/compat.ts
1438
1435
  var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
@@ -1461,13 +1458,10 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
1461
1458
  runComponentDestroy() {
1462
1459
  this.scope && destroyBranch(this.scope);
1463
1460
  },
1464
- resolveRegistered(value2, {
1465
- runtimeId,
1466
- componentIdPrefix
1467
- }) {
1461
+ resolveRegistered(value2, $global) {
1468
1462
  return Array.isArray(value2) && typeof value2[0] == "string" ? getRegisteredWithScope(
1469
1463
  value2[0],
1470
- value2.length === 2 && self[runtimeId]?.[componentIdPrefix === "s" ? "_" : componentIdPrefix]?.s[value2[1]]
1464
+ value2.length === 2 && self[$global.runtimeId]?.[$global.renderId]?.s[value2[1]]
1471
1465
  ) : value2;
1472
1466
  },
1473
1467
  createRenderer(params, clone) {
@@ -1513,13 +1507,13 @@ function mount(input = {}, reference, position) {
1513
1507
  let branch, parentNode = reference, nextSibling = null, { $global } = input;
1514
1508
  switch ($global ? ({ $global, ...input } = input, $global = {
1515
1509
  q: 0,
1516
- runtimeId: DEFAULT_RUNTIME_ID,
1517
- renderId: DEFAULT_RENDER_ID,
1510
+ runtimeId: "M",
1511
+ renderId: "_",
1518
1512
  ...$global
1519
1513
  }) : $global = {
1520
1514
  q: 0,
1521
- runtimeId: DEFAULT_RUNTIME_ID,
1522
- renderId: DEFAULT_RENDER_ID
1515
+ runtimeId: "M",
1516
+ renderId: "_"
1523
1517
  }, position) {
1524
1518
  case "beforebegin":
1525
1519
  parentNode = reference.parentNode, nextSibling = reference;
package/dist/dom.mjs CHANGED
@@ -108,18 +108,15 @@ function stripSpacesAndPunctuation(str) {
108
108
  return str.replace(/[^\p{L}\p{N}]/gu, "");
109
109
  }
110
110
 
111
- // src/common/meta.ts
112
- var DEFAULT_RUNTIME_ID = "M", DEFAULT_RENDER_ID = "_";
113
-
114
111
  // src/dom/resume.ts
115
112
  var registeredValues = {}, branchesEnabled;
116
113
  function enableBranches() {
117
114
  branchesEnabled = 1;
118
115
  }
119
- function init(runtimeId = DEFAULT_RUNTIME_ID) {
116
+ function init(runtimeId = "M") {
120
117
  let renders = self[runtimeId], defineRuntime = (desc) => Object.defineProperty(self, runtimeId, desc), resumeRender, initRuntime = (renders2) => {
121
118
  defineRuntime({
122
- value: resumeRender = (renderId) => {
119
+ value: resumeRender = ((renderId) => {
123
120
  let render = resumeRender[renderId] = renders2[renderId] || renders2(renderId), walk2 = render.w, commentPrefixLen = render.i.length, scopeLookup = render.s = {}, serializeContext = {
124
121
  _: registeredValues
125
122
  }, branches = branchesEnabled && /* @__PURE__ */ (() => {
@@ -190,7 +187,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
190
187
  isResuming = visits.length = resumes.length = 0;
191
188
  }
192
189
  }, render;
193
- }
190
+ })
194
191
  });
195
192
  };
196
193
  if (renders) {
@@ -538,13 +535,13 @@ function dynamicClosure(...closureSignals) {
538
535
  };
539
536
  }
540
537
  function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
541
- let childSignal = closure(valueAccessor, fn, getOwnerScope), closureSignal = (scope) => {
538
+ let childSignal = closure(valueAccessor, fn, getOwnerScope), closureSignal = ((scope) => {
542
539
  scope[closureSignal.F] = closureSignal.L, childSignal(scope), subscribeToScopeSet(
543
540
  getOwnerScope ? getOwnerScope(scope) : scope._,
544
541
  closureSignal.E,
545
542
  scope
546
543
  );
547
- };
544
+ });
548
545
  return closureSignal.E = "a" /* ClosureScopes */ + valueAccessor, closureSignal.F = "b" /* ClosureSignalIndex */ + valueAccessor, closureSignal;
549
546
  }
550
547
  function closure(valueAccessor, fn, getOwnerScope) {
@@ -1339,7 +1336,7 @@ function abort(ctrl) {
1339
1336
  }
1340
1337
 
1341
1338
  // src/common/compat-meta.ts
1342
- var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s", RENDER_BODY_ID = prefix + "b";
1339
+ var RENDERER_REGISTER_ID = "$C_r", SET_SCOPE_REGISTER_ID = "$C_s", RENDER_BODY_ID = "$C_b";
1343
1340
 
1344
1341
  // src/dom/compat.ts
1345
1342
  var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
@@ -1368,13 +1365,10 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
1368
1365
  runComponentDestroy() {
1369
1366
  this.scope && destroyBranch(this.scope);
1370
1367
  },
1371
- resolveRegistered(value2, {
1372
- runtimeId,
1373
- componentIdPrefix
1374
- }) {
1368
+ resolveRegistered(value2, $global) {
1375
1369
  return Array.isArray(value2) && typeof value2[0] == "string" ? getRegisteredWithScope(
1376
1370
  value2[0],
1377
- value2.length === 2 && self[runtimeId]?.[componentIdPrefix === "s" ? "_" : componentIdPrefix]?.s[value2[1]]
1371
+ value2.length === 2 && self[$global.runtimeId]?.[$global.renderId]?.s[value2[1]]
1378
1372
  ) : value2;
1379
1373
  },
1380
1374
  createRenderer(params, clone) {
@@ -1420,13 +1414,13 @@ function mount(input = {}, reference, position) {
1420
1414
  let branch, parentNode = reference, nextSibling = null, { $global } = input;
1421
1415
  switch ($global ? ({ $global, ...input } = input, $global = {
1422
1416
  q: 0,
1423
- runtimeId: DEFAULT_RUNTIME_ID,
1424
- renderId: DEFAULT_RENDER_ID,
1417
+ runtimeId: "M",
1418
+ renderId: "_",
1425
1419
  ...$global
1426
1420
  }) : $global = {
1427
1421
  q: 0,
1428
- runtimeId: DEFAULT_RUNTIME_ID,
1429
- renderId: DEFAULT_RENDER_ID
1422
+ runtimeId: "M",
1423
+ renderId: "_"
1430
1424
  }, position) {
1431
1425
  case "beforebegin":
1432
1426
  parentNode = reference.parentNode, nextSibling = reference;
@@ -1,7 +1,8 @@
1
1
  import { patchDynamicTag } from "./dynamic-tag";
2
2
  import { type ServerRenderer } from "./template";
3
- import { fork, nextScopeId, write, writeScript } from "./writer";
3
+ import { $global, fork, nextScopeId, write, writeScript } from "./writer";
4
4
  export declare const compat: {
5
+ $global: typeof $global;
5
6
  fork: typeof fork;
6
7
  write: typeof write;
7
8
  writeScript: typeof writeScript;
package/dist/html.js CHANGED
@@ -183,9 +183,9 @@ function forToBy(by, index) {
183
183
  var WALKER_RUNTIME_CODE = '(e=>(self[e]=(l,d=e+l,f=d.length,o={},n=[],s=document,t=s.createTreeWalker(s,129))=>s=self[e][l]={i:d,d:s,l:o,v:n,x(){},w(e,l,x){for(;e=t.nextNode();)s.x(l=(l=e.data)&&!l.indexOf(d)&&(o[x=l.slice(f+1)]=e,l[f]),x,e),l>"#"&&n.push(e)}},self[e]))', REORDER_RUNTIME_CODE = '(e=>{let i,l,t,r={},c=(e,i)=>{e.replaceWith(...i.childNodes),i.remove()};e.d.head.append(e.d.querySelector("style["+e.i+"]")||""),e.j={},e.x=(d,o,n,a,g)=>{"#"==d?(r[o]=l).i++:n==t&&i(),"T"==n.tagName&&(o=n.getAttribute(e.i))&&((a=e.l["^"+o])&&(r[o]={i:1,c(i=e.l[o]||n){for(;(t=i.previousSibling||a).remove(),a!=t;);c(i,n)}}),t=n.nextSibling,l=r[o],i=()=>{a||c(e.l[o],n),--l.i||l.c()},(d=e.j[o])&&(g=l.c,l.c=()=>g()+d(e.r)))}})';
184
184
 
185
185
  // src/html/serializer.ts
186
- var kTouchedIterator = Symbol(), { hasOwnProperty } = {}, Generator = function* () {
187
- }().constructor, AsyncGenerator = async function* () {
188
- }().constructor;
186
+ var kTouchedIterator = Symbol(), { hasOwnProperty } = {}, Generator = (function* () {
187
+ })().constructor, AsyncGenerator = (async function* () {
188
+ })().constructor;
189
189
  patchIteratorNext(Generator.prototype);
190
190
  patchIteratorNext(AsyncGenerator.prototype);
191
191
  var REGISTRY = /* @__PURE__ */ new WeakMap(), KNOWN_SYMBOLS = (() => {
@@ -1851,10 +1851,7 @@ function replaceUnsafeDoubleQuoteAttrChar(match) {
1851
1851
  }
1852
1852
 
1853
1853
  // src/common/compat-meta.ts
1854
- var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s", RENDER_BODY_ID = prefix + "b";
1855
-
1856
- // src/common/meta.ts
1857
- var DEFAULT_RUNTIME_ID = "M", DEFAULT_RENDER_ID = "_";
1854
+ var RENDERER_REGISTER_ID = "$C_r", SET_SCOPE_REGISTER_ID = "$C_s", RENDER_BODY_ID = "$C_b";
1858
1855
 
1859
1856
  // src/html/template.ts
1860
1857
  var createTemplate = (templateId, renderer) => (renderer.render = render, renderer._ = renderer, registerContent(templateId, renderer));
@@ -1864,10 +1861,10 @@ function isTemplate(renderer) {
1864
1861
  function render(input = {}) {
1865
1862
  let { $global: $global2 } = input;
1866
1863
  $global2 ? ({ $global: $global2, ...input } = input, $global2 = {
1867
- runtimeId: DEFAULT_RUNTIME_ID,
1868
- renderId: DEFAULT_RENDER_ID,
1864
+ runtimeId: "M",
1865
+ renderId: "_",
1869
1866
  ...$global2
1870
- }) : $global2 = { runtimeId: DEFAULT_RUNTIME_ID, renderId: DEFAULT_RENDER_ID };
1867
+ }) : $global2 = { runtimeId: "M", renderId: "_" };
1871
1868
  let head = new Chunk(
1872
1869
  new Boundary(new State2($global2), $global2.signal),
1873
1870
  null,
@@ -2086,6 +2083,7 @@ function patchDynamicTag(patch) {
2086
2083
 
2087
2084
  // src/html/compat.ts
2088
2085
  var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap(), compat = {
2086
+ $global,
2089
2087
  fork,
2090
2088
  write,
2091
2089
  writeScript,
@@ -2114,7 +2112,7 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
2114
2112
  },
2115
2113
  render(renderer, willRerender, classAPIOut, component, input) {
2116
2114
  let $global2 = classAPIOut.global, state = $global2[K_TAGS_API_STATE] ||= getChunk()?.boundary.state;
2117
- state || ($global2.runtimeId ||= DEFAULT_RUNTIME_ID, $global2.renderId ||= $global2.componentIdPrefix || DEFAULT_RENDER_ID, $global2[K_TAGS_API_STATE] = state = new State2($global2));
2115
+ state || ($global2.runtimeId ||= "M", $global2.renderId ||= $global2.componentIdPrefix || $global2.widgetIdPrefix || "_", $global2[K_TAGS_API_STATE] = state = new State2($global2));
2118
2116
  let boundary = new Boundary(state), head = new Chunk(
2119
2117
  boundary,
2120
2118
  null,
package/dist/html.mjs CHANGED
@@ -102,9 +102,9 @@ function forToBy(by, index) {
102
102
  var WALKER_RUNTIME_CODE = '(e=>(self[e]=(l,d=e+l,f=d.length,o={},n=[],s=document,t=s.createTreeWalker(s,129))=>s=self[e][l]={i:d,d:s,l:o,v:n,x(){},w(e,l,x){for(;e=t.nextNode();)s.x(l=(l=e.data)&&!l.indexOf(d)&&(o[x=l.slice(f+1)]=e,l[f]),x,e),l>"#"&&n.push(e)}},self[e]))', REORDER_RUNTIME_CODE = '(e=>{let i,l,t,r={},c=(e,i)=>{e.replaceWith(...i.childNodes),i.remove()};e.d.head.append(e.d.querySelector("style["+e.i+"]")||""),e.j={},e.x=(d,o,n,a,g)=>{"#"==d?(r[o]=l).i++:n==t&&i(),"T"==n.tagName&&(o=n.getAttribute(e.i))&&((a=e.l["^"+o])&&(r[o]={i:1,c(i=e.l[o]||n){for(;(t=i.previousSibling||a).remove(),a!=t;);c(i,n)}}),t=n.nextSibling,l=r[o],i=()=>{a||c(e.l[o],n),--l.i||l.c()},(d=e.j[o])&&(g=l.c,l.c=()=>g()+d(e.r)))}})';
103
103
 
104
104
  // src/html/serializer.ts
105
- var kTouchedIterator = Symbol(), { hasOwnProperty } = {}, Generator = function* () {
106
- }().constructor, AsyncGenerator = async function* () {
107
- }().constructor;
105
+ var kTouchedIterator = Symbol(), { hasOwnProperty } = {}, Generator = (function* () {
106
+ })().constructor, AsyncGenerator = (async function* () {
107
+ })().constructor;
108
108
  patchIteratorNext(Generator.prototype);
109
109
  patchIteratorNext(AsyncGenerator.prototype);
110
110
  var REGISTRY = /* @__PURE__ */ new WeakMap(), KNOWN_SYMBOLS = (() => {
@@ -1770,10 +1770,7 @@ function replaceUnsafeDoubleQuoteAttrChar(match) {
1770
1770
  }
1771
1771
 
1772
1772
  // src/common/compat-meta.ts
1773
- var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s", RENDER_BODY_ID = prefix + "b";
1774
-
1775
- // src/common/meta.ts
1776
- var DEFAULT_RUNTIME_ID = "M", DEFAULT_RENDER_ID = "_";
1773
+ var RENDERER_REGISTER_ID = "$C_r", SET_SCOPE_REGISTER_ID = "$C_s", RENDER_BODY_ID = "$C_b";
1777
1774
 
1778
1775
  // src/html/template.ts
1779
1776
  var createTemplate = (templateId, renderer) => (renderer.render = render, renderer._ = renderer, registerContent(templateId, renderer));
@@ -1783,10 +1780,10 @@ function isTemplate(renderer) {
1783
1780
  function render(input = {}) {
1784
1781
  let { $global: $global2 } = input;
1785
1782
  $global2 ? ({ $global: $global2, ...input } = input, $global2 = {
1786
- runtimeId: DEFAULT_RUNTIME_ID,
1787
- renderId: DEFAULT_RENDER_ID,
1783
+ runtimeId: "M",
1784
+ renderId: "_",
1788
1785
  ...$global2
1789
- }) : $global2 = { runtimeId: DEFAULT_RUNTIME_ID, renderId: DEFAULT_RENDER_ID };
1786
+ }) : $global2 = { runtimeId: "M", renderId: "_" };
1790
1787
  let head = new Chunk(
1791
1788
  new Boundary(new State2($global2), $global2.signal),
1792
1789
  null,
@@ -2005,6 +2002,7 @@ function patchDynamicTag(patch) {
2005
2002
 
2006
2003
  // src/html/compat.ts
2007
2004
  var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap(), compat = {
2005
+ $global,
2008
2006
  fork,
2009
2007
  write,
2010
2008
  writeScript,
@@ -2033,7 +2031,7 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
2033
2031
  },
2034
2032
  render(renderer, willRerender, classAPIOut, component, input) {
2035
2033
  let $global2 = classAPIOut.global, state = $global2[K_TAGS_API_STATE] ||= getChunk()?.boundary.state;
2036
- state || ($global2.runtimeId ||= DEFAULT_RUNTIME_ID, $global2.renderId ||= $global2.componentIdPrefix || DEFAULT_RENDER_ID, $global2[K_TAGS_API_STATE] = state = new State2($global2));
2034
+ state || ($global2.runtimeId ||= "M", $global2.renderId ||= $global2.componentIdPrefix || $global2.widgetIdPrefix || "_", $global2[K_TAGS_API_STATE] = state = new State2($global2));
2037
2035
  let boundary = new Boundary(state), head = new Chunk(
2038
2036
  boundary,
2039
2037
  null,
@@ -238,10 +238,10 @@ var import_babel_utils17 = require("@marko/compiler/babel-utils");
238
238
  // src/html/serializer.ts
239
239
  var kTouchedIterator = Symbol();
240
240
  var { hasOwnProperty } = {};
241
- var Generator = function* () {
242
- }().constructor;
243
- var AsyncGenerator = async function* () {
244
- }().constructor;
241
+ var Generator = (function* () {
242
+ })().constructor;
243
+ var AsyncGenerator = (async function* () {
244
+ })().constructor;
245
245
  patchIteratorNext(Generator.prototype);
246
246
  patchIteratorNext(AsyncGenerator.prototype);
247
247
  var KNOWN_SYMBOLS = (() => {
@@ -5691,7 +5691,7 @@ var await_default = {
5691
5691
  descriptionMoreURL: "https://markojs.com/docs/core-tags/#await"
5692
5692
  }
5693
5693
  ],
5694
- types: runtime_info_default.name + "/tag-types/await.d.marko"
5694
+ types: runtime_info_default.name + "/tags/await.d.marko"
5695
5695
  };
5696
5696
 
5697
5697
  // src/translator/core/client.ts
@@ -5704,8 +5704,8 @@ var client_default = {
5704
5704
  hub: { file }
5705
5705
  } = tag;
5706
5706
  const rawValue = node.rawValue;
5707
- const code = rawValue.replace(/^client\s*/, "").trim();
5708
- const start = node.name.start + (rawValue.length - code.length);
5707
+ const code = rawValue.replace(/^client\s*/, "");
5708
+ const start = node.start + (rawValue.length - code.length);
5709
5709
  let body = (0, import_babel_utils19.parseStatements)(file, code, start, start + code.length);
5710
5710
  if (body.length === 1 && import_compiler26.types.isBlockStatement(body[0])) {
5711
5711
  body = body[0].body;
@@ -5827,7 +5827,7 @@ var const_default = {
5827
5827
  descriptionMoreURL: "https://markojs.com/docs/core-tags/#const"
5828
5828
  }
5829
5829
  ],
5830
- types: runtime_info_default.name + "/tag-types/const.d.marko"
5830
+ types: runtime_info_default.name + "/tags/const.d.marko"
5831
5831
  };
5832
5832
 
5833
5833
  // src/translator/core/debug.ts
@@ -5870,7 +5870,7 @@ var debug_default = {
5870
5870
  descriptionMoreURL: "https://markojs.com/docs/core-tags/#debug"
5871
5871
  }
5872
5872
  ],
5873
- types: runtime_info_default.name + "/tag-types/debug.d.marko"
5873
+ types: runtime_info_default.name + "/tags/debug.d.marko"
5874
5874
  };
5875
5875
 
5876
5876
  // src/translator/core/define.ts
@@ -7699,7 +7699,7 @@ var define_default = {
7699
7699
  descriptionMoreURL: "https://markojs.com/docs/core-tags/#define"
7700
7700
  }
7701
7701
  ],
7702
- types: runtime_info_default.name + "/tag-types/define.d.marko"
7702
+ types: runtime_info_default.name + "/tags/define.d.marko"
7703
7703
  };
7704
7704
 
7705
7705
  // src/translator/core/effect.ts
@@ -7733,7 +7733,7 @@ var effect_default = {
7733
7733
  }
7734
7734
  ],
7735
7735
  attributes: {},
7736
- types: runtime_info_default.name + "/tag-types/effect.d.marko"
7736
+ types: runtime_info_default.name + "/tags/effect.d.marko"
7737
7737
  };
7738
7738
 
7739
7739
  // src/translator/core/export.ts
@@ -8824,7 +8824,7 @@ var id_default = {
8824
8824
  descriptionMoreURL: "https://markojs.com/docs/core-tags/#id"
8825
8825
  }
8826
8826
  ],
8827
- types: runtime_info_default.name + "/tag-types/id.d.marko"
8827
+ types: runtime_info_default.name + "/tags/id.d.marko"
8828
8828
  };
8829
8829
 
8830
8830
  // src/translator/core/if.ts
@@ -9309,7 +9309,7 @@ var let_default = {
9309
9309
  descriptionMoreURL: "https://markojs.com/docs/core-tags/#let"
9310
9310
  }
9311
9311
  ],
9312
- types: runtime_info_default.name + "/tag-types/let.d.marko"
9312
+ types: runtime_info_default.name + "/tags/let.d.marko"
9313
9313
  };
9314
9314
 
9315
9315
  // src/translator/core/lifecycle.ts
@@ -9391,7 +9391,7 @@ var lifecycle_default = {
9391
9391
  descriptionMoreURL: "https://markojs.com/docs/core-tags/#effect"
9392
9392
  }
9393
9393
  ],
9394
- types: runtime_info_default.name + "/tag-types/lifecycle.d.marko"
9394
+ types: runtime_info_default.name + "/tags/lifecycle.d.marko"
9395
9395
  };
9396
9396
 
9397
9397
  // src/translator/core/log.ts
@@ -9443,7 +9443,7 @@ var log_default = {
9443
9443
  descriptionMoreURL: "https://markojs.com/docs/core-tags/#log"
9444
9444
  }
9445
9445
  ],
9446
- types: runtime_info_default.name + "/tag-types/log.d.marko"
9446
+ types: runtime_info_default.name + "/tags/log.d.marko"
9447
9447
  };
9448
9448
 
9449
9449
  // src/translator/core/script.ts
@@ -9564,7 +9564,7 @@ var script_default = {
9564
9564
  descriptionMoreURL: "https://markojs.com/docs/core-tags/#script"
9565
9565
  }
9566
9566
  ],
9567
- types: runtime_info_default.name + "/tag-types/script.d.marko"
9567
+ types: runtime_info_default.name + "/tags/script.d.marko"
9568
9568
  };
9569
9569
  function isAwaitExpression(node) {
9570
9570
  switch (node.type) {
@@ -9594,8 +9594,8 @@ var server_default = {
9594
9594
  hub: { file }
9595
9595
  } = tag;
9596
9596
  const rawValue = node.rawValue;
9597
- const code = rawValue.replace(/^server\s*/, "").trim();
9598
- const start = node.name.start + (rawValue.length - code.length);
9597
+ const code = rawValue.replace(/^server\s*/, "");
9598
+ const start = node.start + (rawValue.length - code.length);
9599
9599
  let body = (0, import_babel_utils40.parseStatements)(file, code, start, start + code.length);
9600
9600
  if (body.length === 1 && import_compiler47.types.isBlockStatement(body[0])) {
9601
9601
  body = body[0].body;
@@ -9625,8 +9625,8 @@ var static_default = {
9625
9625
  hub: { file }
9626
9626
  } = tag;
9627
9627
  const rawValue = node.rawValue;
9628
- const code = rawValue.replace(/^static\s*/, "").trim();
9629
- const start = node.name.start + (rawValue.length - code.length);
9628
+ const code = rawValue.replace(/^static\s*/, "");
9629
+ const start = node.start + (rawValue.length - code.length);
9630
9630
  let body = (0, import_babel_utils41.parseStatements)(file, code, start, start + code.length);
9631
9631
  if (body.length === 1 && import_compiler48.types.isBlockStatement(body[0])) {
9632
9632
  body = body[0].body;
@@ -9884,7 +9884,7 @@ var try_default = {
9884
9884
  descriptionMoreURL: "https://markojs.com/docs/core-tags/#try"
9885
9885
  }
9886
9886
  ],
9887
- types: runtime_info_default.name + "/tag-types/try.d.marko"
9887
+ types: runtime_info_default.name + "/tags/try.d.marko"
9888
9888
  };
9889
9889
 
9890
9890
  // src/translator/core/index.ts
package/index.d.ts CHANGED
@@ -23,9 +23,7 @@ declare global {
23
23
  /** Used to uniquely identify a instance of a Marko runtime. */
24
24
  runtimeId?: string;
25
25
  /** A list of globals that should be serialized to the browser. */
26
- serializedGlobals?:
27
- | (string | number)[]
28
- | Record<string | number, boolean>;
26
+ serializedGlobals?: string[] | Record<string, boolean>;
29
27
  }
30
28
 
31
29
  export type TemplateInput<Input> = Input & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.0.42",
3
+ "version": "6.0.44",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "./package.json": "./package.json",
24
24
  "./translator": "./dist/translator/index.js",
25
- "./tag-types/*": "./tag-types/*",
25
+ "./tags/*": "./tags/*",
26
26
  "./debug/*": {
27
27
  "types": "./dist/*.d.ts",
28
28
  "import": "./dist/debug/*.mjs",
@@ -48,7 +48,7 @@
48
48
  "build": "node -r ~ts ./scripts/bundle.ts"
49
49
  },
50
50
  "dependencies": {
51
- "@marko/compiler": "^5.39.31",
51
+ "@marko/compiler": "^5.39.33",
52
52
  "csstype": "^3.1.3",
53
53
  "magic-string": "^0.30.17"
54
54
  },
@@ -60,7 +60,7 @@
60
60
  "types": "./index.d.ts"
61
61
  },
62
62
  "./translator": "./src/translator/index.ts",
63
- "./tag-types/*": "./tag-types/*",
63
+ "./tags/*": "./tags/*",
64
64
  "./debug/*": "./src/*.ts",
65
65
  "./*": "./src/*.ts"
66
66
  }