marko 6.4.11 → 6.4.13

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.
Files changed (108) hide show
  1. package/dist/common/attr-tag.d.ts +1 -0
  2. package/dist/common/errors.d.ts +2 -0
  3. package/dist/common/helpers.d.ts +2 -0
  4. package/dist/debug/dom/catch.feat.js +1 -1
  5. package/dist/debug/dom/catch.feat.mjs +1 -1
  6. package/dist/debug/dom/compat.feat.js +143 -0
  7. package/dist/debug/dom/compat.feat.mjs +141 -0
  8. package/dist/debug/dom/controllable-input.feat.js +1 -1
  9. package/dist/debug/dom/controllable-input.feat.mjs +1 -1
  10. package/dist/debug/dom/controllable-open.feat.js +1 -1
  11. package/dist/debug/dom/controllable-open.feat.mjs +1 -1
  12. package/dist/debug/dom/controllable-select.feat.js +1 -1
  13. package/dist/debug/dom/controllable-select.feat.mjs +1 -1
  14. package/dist/debug/dom/controllable-textarea.feat.js +1 -1
  15. package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
  16. package/dist/debug/dom/controllable.feat.js +1 -1
  17. package/dist/debug/dom/controllable.feat.mjs +1 -1
  18. package/dist/debug/dom/dynamic-tag-script.feat.js +1 -1
  19. package/dist/debug/dom/dynamic-tag-script.feat.mjs +1 -1
  20. package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
  21. package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
  22. package/dist/debug/dom/lazy.feat.js +1 -1
  23. package/dist/debug/dom/lazy.feat.mjs +1 -1
  24. package/dist/debug/dom/placeholder.feat.js +1 -1
  25. package/dist/debug/dom/placeholder.feat.mjs +1 -1
  26. package/dist/debug/{dom-DjUZd-9y.mjs → dom-BORByF2b.mjs} +54 -27
  27. package/dist/debug/{dom-mQ5mPBTF.js → dom-sfzdCRAg.js} +71 -38
  28. package/dist/debug/dom.js +4 -127
  29. package/dist/debug/dom.mjs +2 -119
  30. package/dist/debug/html/compat.feat.js +222 -0
  31. package/dist/debug/html/compat.feat.mjs +220 -0
  32. package/dist/debug/html-DMo6pc_h.mjs +3931 -0
  33. package/dist/debug/html-DfZjMkhx.js +4513 -0
  34. package/dist/debug/html.js +83 -4220
  35. package/dist/debug/html.mjs +1 -4133
  36. package/dist/dom/catch.feat.js +4 -4
  37. package/dist/dom/catch.feat.mjs +1 -1
  38. package/dist/dom/{compat.d.ts → compat.feat.d.ts} +18 -9
  39. package/dist/dom/compat.feat.js +101 -0
  40. package/dist/dom/compat.feat.mjs +100 -0
  41. package/dist/dom/control-flow.d.ts +0 -1
  42. package/dist/dom/controllable-input.feat.js +2 -2
  43. package/dist/dom/controllable-input.feat.mjs +1 -1
  44. package/dist/dom/controllable-open.feat.js +2 -2
  45. package/dist/dom/controllable-open.feat.mjs +1 -1
  46. package/dist/dom/controllable-select.feat.js +2 -2
  47. package/dist/dom/controllable-select.feat.mjs +1 -1
  48. package/dist/dom/controllable-textarea.feat.js +2 -2
  49. package/dist/dom/controllable-textarea.feat.mjs +1 -1
  50. package/dist/dom/controllable.feat.js +2 -2
  51. package/dist/dom/controllable.feat.mjs +1 -1
  52. package/dist/dom/dom.d.ts +2 -1
  53. package/dist/dom/dynamic-tag-script.feat.js +2 -2
  54. package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
  55. package/dist/dom/dynamic-tag-var.feat.js +3 -3
  56. package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
  57. package/dist/dom/lazy.feat.js +1 -1
  58. package/dist/dom/lazy.feat.mjs +1 -1
  59. package/dist/dom/placeholder.feat.js +3 -3
  60. package/dist/dom/placeholder.feat.mjs +1 -1
  61. package/dist/dom/resume.d.ts +3 -1
  62. package/dist/{dom-HEWdZCCb.mjs → dom-DKn1bCPC.mjs} +15 -19
  63. package/dist/{dom-B8j2453O.js → dom-DRiewpRL.js} +127 -136
  64. package/dist/dom.d.ts +0 -1
  65. package/dist/dom.js +21 -95
  66. package/dist/dom.mjs +3 -72
  67. package/dist/html/{compat.d.ts → compat.feat.d.ts} +5 -4
  68. package/dist/html/compat.feat.js +165 -0
  69. package/dist/html/compat.feat.mjs +164 -0
  70. package/dist/html/dynamic-tag.d.ts +1 -2
  71. package/dist/html/writer.d.ts +2 -1
  72. package/dist/html-DMDc0zKs.mjs +2404 -0
  73. package/dist/html-DrHsybFm.js +2880 -0
  74. package/dist/html.d.ts +0 -1
  75. package/dist/html.js +2 -2566
  76. package/dist/html.mjs +3 -2561
  77. package/dist/translator/core/if.d.ts +0 -85
  78. package/dist/translator/core/index.d.ts +2 -85
  79. package/dist/translator/index.d.ts +2 -85
  80. package/dist/translator/index.js +332 -476
  81. package/dist/translator/interop/index.d.ts +2 -0
  82. package/dist/translator/util/assert.d.ts +2 -0
  83. package/dist/translator/util/branch-tag.d.ts +1 -1
  84. package/dist/translator/util/known-tag.d.ts +4 -1
  85. package/dist/translator/util/optional.d.ts +0 -1
  86. package/dist/translator/util/reasons.d.ts +0 -1
  87. package/dist/translator/util/references.d.ts +1 -0
  88. package/dist/translator/util/sections.d.ts +5 -1
  89. package/dist/translator/util/tag-facts.d.ts +2 -0
  90. package/dist/translator/util/translate-attrs.d.ts +1 -4
  91. package/dist/translator/visitors/program/index.d.ts +2 -2
  92. package/index.d.ts +2 -7
  93. package/package.json +4 -4
  94. package/tags/await.d.marko +9 -1
  95. package/tags/const.d.marko +7 -1
  96. package/tags/debug.d.marko +7 -1
  97. package/tags/define.d.marko +7 -1
  98. package/tags/effect.d.marko +6 -1
  99. package/tags/html-comment.d.marko +6 -0
  100. package/tags/html-script.d.marko +5 -0
  101. package/tags/html-style.d.marko +5 -0
  102. package/tags/id.d.marko +11 -1
  103. package/tags/let.d.marko +8 -1
  104. package/tags/lifecycle.d.marko +11 -1
  105. package/tags/log.d.marko +7 -1
  106. package/tags/script.d.marko +9 -1
  107. package/tags/show.d.marko +7 -1
  108. package/tags/try.d.marko +9 -1
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ // src/common/attr-tag.ts
3
+ const empty = [];
4
+ const rest = Symbol("Attribute Tag");
5
+ function attrTag(attrs) {
6
+ attrs[Symbol.iterator] = attrTagIterator;
7
+ attrs[rest] = empty;
8
+ return attrs;
9
+ }
10
+ function attrTags(first, attrs) {
11
+ if (first) {
12
+ if (first[rest] === empty) first[rest] = [attrs];
13
+ else first[rest].push(attrs);
14
+ return first;
15
+ }
16
+ return attrTag(attrs);
17
+ }
18
+ function isAttrTag(value) {
19
+ return !!value?.[rest];
20
+ }
21
+ function* attrTagIterator() {
22
+ yield this;
23
+ yield* this[rest];
24
+ }
2
25
  // src/common/constants/accessor-prefix.debug.ts
3
26
  const BranchScopes$1 = "BranchScopes:";
4
27
  const ClosureScopes = "ClosureScopes:";
@@ -167,15 +190,20 @@ function isNotNullishOrFalse(value) {
167
190
  function isPromise(value) {
168
191
  return value != null && typeof value.then === "function";
169
192
  }
193
+ let classAPIRenderer;
194
+ function setClassAPIRenderer(render) {
195
+ classAPIRenderer = render;
196
+ }
170
197
  function normalizeDynamicRenderer(value) {
171
198
  if (value) {
172
199
  if (typeof value === "string") return value;
173
200
  const normalized = value.content || value.default || value;
174
- if (!((typeof normalized === "object" || typeof normalized === "function") && "id" in normalized)) {
175
- if (value.content) throw new Error(`A dynamic tag must be a string tag name (like \`"div"\`) or a Marko template/component, but received an object whose \`content\` is not a template/component.`);
176
- if (typeof value !== "object" && typeof value !== "function") throw new Error(`A dynamic tag must be a string tag name (like \`"div"\`) or a Marko template/component, but received a ${typeof value}.`);
177
- }
178
- if ("id" in normalized) return normalized;
201
+ if (typeof normalized !== "object" && typeof normalized !== "function") throw new Error(`A dynamic tag must be a string tag name (like \`"div"\`) or a Marko template/component, but received ${normalized === value ? `a ${typeof value}` : `an object whose \`content\` or \`default\` is a ${typeof normalized}`}.`);
202
+ if (classAPIRenderer) {
203
+ const renderer = classAPIRenderer(normalized);
204
+ if (renderer || false) return renderer;
205
+ } else if ("id" in normalized) return normalized;
206
+ if (value.content) throw new Error(`A dynamic tag must be a string tag name (like \`"div"\`) or a Marko template/component, but received an object whose \`content\` is not a template/component.`);
179
207
  }
180
208
  }
181
209
  let branchesEnabled;
@@ -286,6 +314,12 @@ function assertNoValueBindingOnCheckable(type, valueChange) {
286
314
  function assertHandlerIsFunction(name, value) {
287
315
  if (value && typeof value !== "function") throw new Error(`The \`${name}\` handler must be a function or a falsey value (\`null\`, \`undefined\`, \`false\`, \`0\`, …), but received type "${typeof value}".`);
288
316
  }
317
+ function assertNoNativeAttrTags(tagName, input) {
318
+ for (const name in input) if (name !== "content" && isAttrTag(input[name])) throw new Error(`A dynamic tag passed the native \`<${tagName}>\` tag an [attribute tag](https://markojs.com/docs/reference/language#attribute-tags) as \`${name}\`, but [native tags](https://markojs.com/docs/reference/native-tag) do not support attribute tags.`);
319
+ }
320
+ function assertValidContent(value, renderer) {
321
+ if (value && !renderer?.["id"]) throw new Error(`The \`content\` attribute on a [native tag](https://markojs.com/docs/reference/native-tag#content) must be body content, a \`<define>\` tag variable or attribute tag holding it, or a falsey value (\`null\`, \`undefined\`, \`false\`, \`0\`, …), but received type "${typeof value}".`);
322
+ }
289
323
  function assertValidTagName(tagName) {
290
324
  if (!/^[a-z][a-z0-9._-]*$/i.test(tagName)) throw new Error(`Invalid tag name: "${tagName}". Tag names must start with a letter and contain only letters, numbers, periods, hyphens, and underscores.`);
291
325
  }
@@ -1028,10 +1062,10 @@ function init(runtimeId = "M") {
1028
1062
  visitText = serialized;
1029
1063
  while (nextToken()) if (/\D/.test(lastToken)) lastEffect = _resumed[lastToken];
1030
1064
  else effects.push(lastEffect, getScope(lastToken));
1031
- } else if (Array.isArray(serialized)) {
1032
- if (!(readyIds && serialized.every((dep) => readyIds.has(dep) && !render.b[dep].length))) break;
1033
- } else if (readyIds && typeof serialized === "number") break;
1034
- else {
1065
+ } else if (readyIds && typeof serialized !== "function") {
1066
+ if (typeof serialized === "number" || !Object.keys(serialized).every((dep) => readyIds.has(dep) && (render.b[dep]?.n || 0) >= serialized[dep])) break;
1067
+ } else {
1068
+ if (readyIds) resumes.n = (resumes.n || 0) + 1;
1035
1069
  const scopes = serialized(serializeContext);
1036
1070
  if (Array.isArray(scopes)) applyScopes(scopes);
1037
1071
  }
@@ -1148,7 +1182,9 @@ function setParentBranch(branch, parentBranch) {
1148
1182
  branch[ClosestBranch] = branch;
1149
1183
  }
1150
1184
  function createAndSetupBranch($global, renderer, parentScope, parentNode) {
1151
- return setupBranch(renderer, createBranch($global, renderer, parentScope, parentNode));
1185
+ const branch = setupBranch(renderer, createBranch($global, renderer, parentScope, parentNode));
1186
+ renderer[Params]?.(branch, []);
1187
+ return branch;
1152
1188
  }
1153
1189
  function setupBranch(renderer, branch) {
1154
1190
  renderer[Setup]?.(branch);
@@ -1344,13 +1380,11 @@ function attrsInternal(scope, nodeAccessor, nextAttrs, controllable) {
1344
1380
  }
1345
1381
  }
1346
1382
  }
1347
- function _attr_content(scope, nodeAccessor, value) {
1348
- const renderer = normalizeDynamicRenderer(value);
1349
- let content;
1350
- if (renderer) {
1351
- if (renderer["id"]) content = renderer;
1352
- else throw new Error(`Invalid \`content\` attribute. Received ${typeof value}`);
1353
- }
1383
+ function _attr_content(scope, nodeAccessor, content) {
1384
+ var value = content;
1385
+ content = content?.content || content;
1386
+ if (classAPIRenderer && content) content = classAPIRenderer(content);
1387
+ assertValidContent(value, content);
1354
1388
  if (scope["ConditionalRenderer:" + nodeAccessor] !== (scope["ConditionalRenderer:" + nodeAccessor] = rendererKey(content))) {
1355
1389
  setBranch(scope, nodeAccessor, content, createAndSetupBranch);
1356
1390
  if (content?.["accessor"]) subscribeToScopeSet(content[Owner], content[Accessor], scope[BranchScopes$1 + nodeAccessor]);
@@ -1962,9 +1996,6 @@ const _show = /*@__PURE__*/ withBranches((nodeAccessor, startNodeAccessor) => {
1962
1996
  function rendererKey(renderer) {
1963
1997
  return renderer?.["owner"] ? renderer["id"] + " " + renderer[Owner]["#Id"] : renderer?.["id"] || renderer;
1964
1998
  }
1965
- function patchDynamicTag(fn) {
1966
- _dynamic_tag = fn(_dynamic_tag);
1967
- }
1968
1999
  let _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagVar, inputIsArgs) => {
1969
2000
  const scopeOffsetAccessor = getTagVar && getDebugKey(+nodeAccessor.slice(nodeAccessor.lastIndexOf("/") + 1) + 1, "#scopeOffset");
1970
2001
  const childScopeAccessor = BranchScopes$1 + nodeAccessor;
@@ -1978,12 +2009,7 @@ let _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagV
1978
2009
  bindTagVar(scope, branch, scope[scopeOffsetAccessor], tagNameOrRenderer);
1979
2010
  }
1980
2011
  if (typeof tagNameOrRenderer !== "string") setupBranch(tagNameOrRenderer, branch);
1981
- else if (getContent) {
1982
- const content = getContent(scope);
1983
- const elementAccessor = `#${tagNameOrRenderer.toLowerCase()}/0`;
1984
- setBranch(branch, elementAccessor, content, createAndSetupBranch);
1985
- if (content["accessor"]) subscribeToScopeSet(content[Owner], content[Accessor], branch[BranchScopes$1 + elementAccessor]);
1986
- }
2012
+ else if (getContent) _attr_content(branch, `#${tagNameOrRenderer.toLowerCase()}/0`, getContent(scope));
1987
2013
  return branch;
1988
2014
  };
1989
2015
  return (scope, newRenderer, getInput) => {
@@ -2002,6 +2028,7 @@ let _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagV
2002
2028
  const args = getInput?.();
2003
2029
  if (typeof normalizedRenderer === "string") {
2004
2030
  const nodeAccessor = `#${normalizedRenderer.toLowerCase()}/0`;
2031
+ assertNoNativeAttrTags(normalizedRenderer, inputIsArgs ? args[0] : args);
2005
2032
  (getContent ? _attrs : _attrs_content)(childScope, nodeAccessor, (inputIsArgs ? args[0] : args) || {}, controllableSpreadHelpers[childScope[nodeAccessor].tagName]);
2006
2033
  if (childScope["EventAttributes:" + nodeAccessor] || childScope["ControlledHandler:" + nodeAccessor]) queueEffect(childScope, dynamicTagScript);
2007
2034
  } else {
@@ -2897,22 +2924,28 @@ Object.defineProperty(exports, "_var_resume", {
2897
2924
  return _var_resume;
2898
2925
  }
2899
2926
  });
2900
- Object.defineProperty(exports, "controllableScripts", {
2927
+ Object.defineProperty(exports, "attrTag", {
2901
2928
  enumerable: true,
2902
2929
  get: function() {
2903
- return controllableScripts;
2930
+ return attrTag;
2904
2931
  }
2905
2932
  });
2906
- Object.defineProperty(exports, "controllableSpreadHelpers", {
2933
+ Object.defineProperty(exports, "attrTags", {
2907
2934
  enumerable: true,
2908
2935
  get: function() {
2909
- return controllableSpreadHelpers;
2936
+ return attrTags;
2910
2937
  }
2911
2938
  });
2912
- Object.defineProperty(exports, "createAndSetupBranch", {
2939
+ Object.defineProperty(exports, "controllableScripts", {
2913
2940
  enumerable: true,
2914
2941
  get: function() {
2915
- return createAndSetupBranch;
2942
+ return controllableScripts;
2943
+ }
2944
+ });
2945
+ Object.defineProperty(exports, "controllableSpreadHelpers", {
2946
+ enumerable: true,
2947
+ get: function() {
2948
+ return controllableSpreadHelpers;
2916
2949
  }
2917
2950
  });
2918
2951
  Object.defineProperty(exports, "createBranch", {
@@ -3011,12 +3044,6 @@ Object.defineProperty(exports, "onAbort", {
3011
3044
  return onAbort;
3012
3045
  }
3013
3046
  });
3014
- Object.defineProperty(exports, "patchDynamicTag", {
3015
- enumerable: true,
3016
- get: function() {
3017
- return patchDynamicTag;
3018
- }
3019
- });
3020
3047
  Object.defineProperty(exports, "prepareEffects", {
3021
3048
  enumerable: true,
3022
3049
  get: function() {
@@ -3095,6 +3122,12 @@ Object.defineProperty(exports, "runPendingEffects", {
3095
3122
  return runPendingEffects;
3096
3123
  }
3097
3124
  });
3125
+ Object.defineProperty(exports, "setClassAPIRenderer", {
3126
+ enumerable: true,
3127
+ get: function() {
3128
+ return setClassAPIRenderer;
3129
+ }
3130
+ });
3098
3131
  Object.defineProperty(exports, "setupBranch", {
3099
3132
  enumerable: true,
3100
3133
  get: function() {
package/dist/debug/dom.js CHANGED
@@ -1,123 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_control_flow = require("./dom-mQ5mPBTF.js");
4
- // src/common/attr-tag.ts
5
- const empty = [];
6
- const rest = Symbol("Attribute Tag");
7
- function attrTag(attrs) {
8
- attrs[Symbol.iterator] = attrTagIterator;
9
- attrs[rest] = empty;
10
- return attrs;
11
- }
12
- function attrTags(first, attrs) {
13
- if (first) {
14
- if (first[rest] === empty) first[rest] = [attrs];
15
- else first[rest].push(attrs);
16
- return first;
17
- }
18
- return attrTag(attrs);
19
- }
20
- function* attrTagIterator() {
21
- yield this;
22
- yield* this[rest];
23
- }
24
- // src/common/compat-meta.ts
25
- const SET_SCOPE_REGISTER_ID = "$compat_setScope";
26
- const RENDER_BODY_ID = "$compat_renderBody";
27
- // src/dom/compat.ts
28
- const classIdToBranch = /* @__PURE__ */ new Map();
29
- let classEventResolver;
30
- const scopesByRender = /* @__PURE__ */ new WeakMap();
31
- const getRenderScopes = ($global) => {
32
- require_control_flow.init($global.runtimeId);
33
- const render = self[$global.runtimeId]?.[$global.renderId];
34
- let scopes = render && scopesByRender.get(render);
35
- if (render && !scopes) scopesByRender.set(render, scopes = {});
36
- return scopes;
37
- };
38
- const compat = {
39
- patchDynamicTag: require_control_flow.patchDynamicTag,
40
- queueEffect: require_control_flow.queueEffect,
41
- init(warp10Noop) {
42
- require_control_flow._resumed[SET_SCOPE_REGISTER_ID] = (scope) => {
43
- getRenderScopes(scope[require_control_flow.Global])[scope["#Id"]] = scope;
44
- if (scope.m5c) classIdToBranch.set(scope.m5c, scope);
45
- if (classEventResolver) for (const key in scope) {
46
- const resolved = classEventResolver(scope[key], scope);
47
- if (resolved !== scope[key]) scope[key] = resolved;
48
- }
49
- };
50
- require_control_flow._resumed[RENDER_BODY_ID] = warp10Noop;
51
- },
52
- setClassEventResolver(fn) {
53
- classEventResolver = fn;
54
- },
55
- resumeClassFunction(id, build) {
56
- require_control_flow._resumed[id] = build;
57
- },
58
- getScope($global, scopeId) {
59
- return getRenderScopes($global)?.[scopeId];
60
- },
61
- setRendererId(renderer, id) {
62
- renderer["id"] = id;
63
- },
64
- isRenderer(renderer) {
65
- return renderer[require_control_flow.Clone];
66
- },
67
- getStartNode(branch) {
68
- return branch[require_control_flow.StartNode];
69
- },
70
- getEndNode(branch) {
71
- return branch[require_control_flow.EndNode];
72
- },
73
- setScopeNodes(branch, startNode, endNode) {
74
- branch[require_control_flow.StartNode] = startNode;
75
- branch[require_control_flow.EndNode] = endNode;
76
- },
77
- runComponentEffects() {
78
- if (this.effects) require_control_flow.runEffects(this.effects);
79
- },
80
- runComponentDestroy() {
81
- if (this.scope) require_control_flow.destroyBranch(this.scope);
82
- },
83
- resolveRegistered(value, $global) {
84
- if (Array.isArray(value) && typeof value[0] === "string") return require_control_flow.getRegisteredWithScope(getRenderScopes($global)?.[value[1]], value[0]);
85
- return value;
86
- },
87
- createRenderer(params, clone) {
88
- const renderer = require_control_flow._content("", 0, 0, 0, params)();
89
- renderer[require_control_flow.Clone] = (branch) => {
90
- const cloned = clone();
91
- branch[require_control_flow.StartNode] = cloned.startNode;
92
- branch[require_control_flow.EndNode] = cloned.endNode;
93
- };
94
- return renderer;
95
- },
96
- render(out, component, renderer, args) {
97
- require_control_flow.init(out.global.runtimeId);
98
- let branch = component.scope;
99
- let created = 0;
100
- if (!branch && (branch = classIdToBranch.get(component.id))) {
101
- component.scope = branch;
102
- classIdToBranch.delete(component.id);
103
- }
104
- if (args[0] && typeof args[0] === "object" && "renderBody" in args[0]) {
105
- const input = args[0];
106
- const normalizedInput = args[0] = {};
107
- for (const key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
108
- }
109
- const renderBranch = (_) => {
110
- if (!branch) {
111
- created = 1;
112
- branch = component.scope = require_control_flow.createAndSetupBranch(out.global, renderer, renderer[require_control_flow.Owner], document.body);
113
- }
114
- renderer[require_control_flow.LocalClosures]?.(branch);
115
- renderer[require_control_flow.Params]?.(branch, renderer._ ? args[0] : args);
116
- };
117
- component.effects = require_control_flow.rendering ? renderBranch() : require_control_flow.prepareEffects(renderBranch);
118
- if (created) return branch["#StartNode"].parentNode || branch["#StartNode"];
119
- }
120
- };
3
+ const require_control_flow = require("./dom-sfzdCRAg.js");
121
4
  // src/dom/template.ts
122
5
  const _template = (id, template, walks, setup, inputSignal) => {
123
6
  const renderer = require_control_flow._content(id, template, walks, setup, inputSignal)();
@@ -342,12 +225,7 @@ exports._controllable_input = require_control_flow._controllable_input;
342
225
  exports._controllable_open = require_control_flow._controllable_open;
343
226
  exports._controllable_select = require_control_flow._controllable_select;
344
227
  exports._controllable_textarea = require_control_flow._controllable_textarea;
345
- Object.defineProperty(exports, "_dynamic_tag", {
346
- enumerable: true,
347
- get: function() {
348
- return require_control_flow._dynamic_tag;
349
- }
350
- });
228
+ exports._dynamic_tag = require_control_flow._dynamic_tag;
351
229
  exports._dynamic_tag_content = require_control_flow._dynamic_tag_content;
352
230
  exports._dynamic_tag_var_resume = require_control_flow._dynamic_tag_var_resume;
353
231
  exports._el = require_control_flow._el;
@@ -398,9 +276,8 @@ exports._try = require_control_flow._try;
398
276
  exports._var = require_control_flow._var;
399
277
  exports._var_change = require_control_flow._var_change;
400
278
  exports._var_resume = require_control_flow._var_resume;
401
- exports.attrTag = attrTag;
402
- exports.attrTags = attrTags;
403
- exports.compat = compat;
279
+ exports.attrTag = require_control_flow.attrTag;
280
+ exports.attrTags = require_control_flow.attrTags;
404
281
  exports.forIn = require_control_flow.forIn;
405
282
  exports.forOf = require_control_flow.forOf;
406
283
  exports.forTo = require_control_flow.forTo;
@@ -1,121 +1,4 @@
1
- import { $ as _attr_style_items, A as _attr_input_value, At as _closure_get, B as _controllable_select, Bn as Load, Bt as _let, C as _attr_details_or_dialog_open_script, Cn as _call, Ct as getRegisteredWithScope, D as _attr_input_checkedValue_script, Dn as LocalClosures, Dt as readyFailed, E as _attr_input_checkedValue_default, En as Lazy, Et as ready, F as _attr_select_value, Ft as _global_read, G as _attr_class, Gt as _script, Ht as _or, I as _attr_select_value_default, It as _hoist, J as _attr_class_names, Jt as _assert_init, K as _attr_class_item, Kn as StartNode, Kt as _var, L as _attr_select_value_script, Ln as EndNode, Lt as _hoist_resume, M as _attr_input_value_default, Mt as _el_read, N as _attr_input_value_dynamic_default, Nt as _for_closure, O as _attr_input_checked_default, On as Owner, P as _attr_input_value_script, Pt as _for_selector, Q as _attr_style_item, Qt as syncGen, R as _controllable_input, Rt as _id, S as _attr_details_or_dialog_open_default, Sn as _hoist_read_error, St as _var_resume, T as _attr_input_checkedValue, Tn as Clone, Tt as initEmbedded, Ut as _return, V as _controllable_textarea, Vt as _let_change, W as _attr, Wt as _return_change, X as _attr_nonce, Xt as insertBranchBefore, Y as _attr_content, Yt as destroyBranch, Z as _attr_style, Zt as removeAndDestroyBranch, _ as patchDynamicTag, _n as forOf, _t as createBranch, a as _for_in, at as _html, b as startAwait, bn as _assert_class_toggles, bt as _el, c as _for_to, cn as prepareEffects, ct as _style_shell, d as _for_until_unkeyed, dn as queueRender, dt as _to_text, et as _attrs, f as _if, fn as rendering, ft as _content, gn as forIn, gt as createAndSetupBranch, hn as runId, ht as _return_setup, i as _dynamic_tag_content, in as onAbort, it as _attrs_script, j as _attr_input_value_attribute_default, jn as Setup, jt as _const, k as _attr_input_checked_script, kn as Params, kt as _closure, l as _for_to_unkeyed, ln as queueAsyncRender, lt as _text, m as _try, mn as runEffects, mt as _content_resume, n as _await_promise, nn as $signal, nt as _attrs_partial, o as _for_of, ot as _lifecycle, p as _show, pn as run, pt as _content_closures, q as _attr_class_items, qn as TagVariable, qt as _var_change, r as _dynamic_tag, rn as $signalReset, rt as _attrs_partial_content, s as _for_of_unkeyed, st as _style_rule_item, t as _await_content, tn as _on, tt as _attrs_content, u as _for_until, un as queueEffect, ut as _text_content, v as renderCatch, vn as forTo, vt as setupBranch, w as _attr_input_checked, wt as init, x as _attr_details_or_dialog_open, xn as _assert_hoist, xt as _resumed, yn as forUntil, yt as _dynamic_tag_var_resume, z as _controllable_open, zn as Global, zt as _if_closure } from "./dom-DjUZd-9y.mjs";
2
- // src/common/attr-tag.ts
3
- const empty = [];
4
- const rest = Symbol("Attribute Tag");
5
- function attrTag(attrs) {
6
- attrs[Symbol.iterator] = attrTagIterator;
7
- attrs[rest] = empty;
8
- return attrs;
9
- }
10
- function attrTags(first, attrs) {
11
- if (first) {
12
- if (first[rest] === empty) first[rest] = [attrs];
13
- else first[rest].push(attrs);
14
- return first;
15
- }
16
- return attrTag(attrs);
17
- }
18
- function* attrTagIterator() {
19
- yield this;
20
- yield* this[rest];
21
- }
22
- // src/common/compat-meta.ts
23
- const SET_SCOPE_REGISTER_ID = "$compat_setScope";
24
- const RENDER_BODY_ID = "$compat_renderBody";
25
- // src/dom/compat.ts
26
- const classIdToBranch = /* @__PURE__ */ new Map();
27
- let classEventResolver;
28
- const scopesByRender = /* @__PURE__ */ new WeakMap();
29
- const getRenderScopes = ($global) => {
30
- init($global.runtimeId);
31
- const render = self[$global.runtimeId]?.[$global.renderId];
32
- let scopes = render && scopesByRender.get(render);
33
- if (render && !scopes) scopesByRender.set(render, scopes = {});
34
- return scopes;
35
- };
36
- const compat = {
37
- patchDynamicTag,
38
- queueEffect,
39
- init(warp10Noop) {
40
- _resumed[SET_SCOPE_REGISTER_ID] = (scope) => {
41
- getRenderScopes(scope[Global])[scope["#Id"]] = scope;
42
- if (scope.m5c) classIdToBranch.set(scope.m5c, scope);
43
- if (classEventResolver) for (const key in scope) {
44
- const resolved = classEventResolver(scope[key], scope);
45
- if (resolved !== scope[key]) scope[key] = resolved;
46
- }
47
- };
48
- _resumed[RENDER_BODY_ID] = warp10Noop;
49
- },
50
- setClassEventResolver(fn) {
51
- classEventResolver = fn;
52
- },
53
- resumeClassFunction(id, build) {
54
- _resumed[id] = build;
55
- },
56
- getScope($global, scopeId) {
57
- return getRenderScopes($global)?.[scopeId];
58
- },
59
- setRendererId(renderer, id) {
60
- renderer["id"] = id;
61
- },
62
- isRenderer(renderer) {
63
- return renderer[Clone];
64
- },
65
- getStartNode(branch) {
66
- return branch[StartNode];
67
- },
68
- getEndNode(branch) {
69
- return branch[EndNode];
70
- },
71
- setScopeNodes(branch, startNode, endNode) {
72
- branch[StartNode] = startNode;
73
- branch[EndNode] = endNode;
74
- },
75
- runComponentEffects() {
76
- if (this.effects) runEffects(this.effects);
77
- },
78
- runComponentDestroy() {
79
- if (this.scope) destroyBranch(this.scope);
80
- },
81
- resolveRegistered(value, $global) {
82
- if (Array.isArray(value) && typeof value[0] === "string") return getRegisteredWithScope(getRenderScopes($global)?.[value[1]], value[0]);
83
- return value;
84
- },
85
- createRenderer(params, clone) {
86
- const renderer = _content("", 0, 0, 0, params)();
87
- renderer[Clone] = (branch) => {
88
- const cloned = clone();
89
- branch[StartNode] = cloned.startNode;
90
- branch[EndNode] = cloned.endNode;
91
- };
92
- return renderer;
93
- },
94
- render(out, component, renderer, args) {
95
- init(out.global.runtimeId);
96
- let branch = component.scope;
97
- let created = 0;
98
- if (!branch && (branch = classIdToBranch.get(component.id))) {
99
- component.scope = branch;
100
- classIdToBranch.delete(component.id);
101
- }
102
- if (args[0] && typeof args[0] === "object" && "renderBody" in args[0]) {
103
- const input = args[0];
104
- const normalizedInput = args[0] = {};
105
- for (const key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
106
- }
107
- const renderBranch = (_) => {
108
- if (!branch) {
109
- created = 1;
110
- branch = component.scope = createAndSetupBranch(out.global, renderer, renderer[Owner], document.body);
111
- }
112
- renderer[LocalClosures]?.(branch);
113
- renderer[Params]?.(branch, renderer._ ? args[0] : args);
114
- };
115
- component.effects = rendering ? renderBranch() : prepareEffects(renderBranch);
116
- if (created) return branch["#StartNode"].parentNode || branch["#StartNode"];
117
- }
118
- };
1
+ import { $ as _attrs, $t as _on, A as _attr_input_value_attribute_default, An as Setup, At as _el_read, B as _controllable_textarea, Bt as _or, C as _attr_input_checked, Ct as initEmbedded, D as _attr_input_checked_default, Dt as _closure, E as _attr_input_checkedValue_script, F as _attr_select_value_default, Ft as _hoist_resume, G as _attr_class_item, Gn as StartNode, Gt as _var_change, Ht as _return_change, I as _attr_select_value_script, It as _id, J as _attr_content, Jn as attrTags, Jt as insertBranchBefore, K as _attr_class_items, Kn as TagVariable, Kt as _assert_init, L as _controllable_input, Lt as _if_closure, M as _attr_input_value_dynamic_default, Mt as _for_selector, N as _attr_input_value_script, Nt as _global_read, O as _attr_input_checked_script, On as Params, Ot as _closure_get, P as _attr_select_value, Pt as _hoist, Q as _attr_style_items, R as _controllable_open, Rt as _let, S as _attr_details_or_dialog_open_script, St as init, T as _attr_input_checkedValue_default, Tn as Lazy, Tt as readyFailed, U as _attr, Ut as _script, Vt as _return, W as _attr_class, Wt as _var, X as _attr_style, Xt as syncGen, Y as _attr_nonce, Yt as removeAndDestroyBranch, Z as _attr_style_item, _ as renderCatch, _n as forUntil, _t as _dynamic_tag_var_resume, a as _for_in, at as _lifecycle, b as _attr_details_or_dialog_open, bn as _hoist_read_error, bt as _var_resume, c as _for_to, ct as _text, d as _for_until_unkeyed, dn as run, dt as _content, en as $signal, et as _attrs_content, f as _if, fn as runEffects, ft as _content_closures, gn as forTo, gt as setupBranch, hn as forOf, ht as createBranch, i as _dynamic_tag_content, it as _html, j as _attr_input_value_default, jt as _for_closure, k as _attr_input_value, kt as _const, l as _for_to_unkeyed, ln as queueRender, lt as _text_content, m as _try, mn as forIn, mt as _return_setup, n as _await_promise, nn as onAbort, nt as _attrs_partial_content, o as _for_of, on as prepareEffects, ot as _style_rule_item, p as _show, pn as runId, pt as _content_resume, q as _attr_class_names, qn as attrTag, r as _dynamic_tag, rt as _attrs_script, s as _for_of_unkeyed, sn as queueAsyncRender, st as _style_shell, t as _await_content, tn as $signalReset, tt as _attrs_partial, u as _for_until, ut as _to_text, vn as _assert_class_toggles, vt as _el, w as _attr_input_checkedValue, wn as Clone, wt as ready, x as _attr_details_or_dialog_open_default, xn as _call, y as startAwait, yn as _assert_hoist, yt as _resumed, z as _controllable_select, zn as Load, zt as _let_change } from "./dom-BORByF2b.mjs";
119
2
  // src/dom/template.ts
120
3
  const _template = (id, template, walks, setup, inputSignal) => {
121
4
  const renderer = _content(id, template, walks, setup, inputSignal)();
@@ -284,4 +167,4 @@ function _load_race_trigger(...triggers) {
284
167
  function getSelectorOrResolve(selector, resolve) {
285
168
  return document.querySelector(selector) || (console.warn(`A lazy load trigger could not find an element matching "${selector}". The module was loaded immediately.`), resolve());
286
169
  }
287
- export { $signal, $signalReset, _assert_class_toggles, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_class_names, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, _dynamic_tag, _dynamic_tag_content, _dynamic_tag_var_resume, _el, _el_read, _for_closure, _for_in, _for_of, _for_of_unkeyed, _for_selector, _for_to, _for_to_unkeyed, _for_until, _for_until_unkeyed, _global_read, _hoist, _hoist_read_error, _hoist_resume, _html, _id, _if, _if_closure, _let, _let_change, _lifecycle, _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, _on, _or, _resumed, _return, _return_change, _return_setup, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, onAbort, ready, readyFailed, run };
170
+ export { $signal, $signalReset, _assert_class_toggles, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_class_names, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, _dynamic_tag, _dynamic_tag_content, _dynamic_tag_var_resume, _el, _el_read, _for_closure, _for_in, _for_of, _for_of_unkeyed, _for_selector, _for_to, _for_to_unkeyed, _for_until, _for_until_unkeyed, _global_read, _hoist, _hoist_read_error, _hoist_resume, _html, _id, _if, _if_closure, _let, _let_change, _lifecycle, _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, _on, _or, _resumed, _return, _return_change, _return_setup, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, forIn, forOf, forTo, forUntil, init, initEmbedded, onAbort, ready, readyFailed, run };