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
@@ -5,4 +5,5 @@ type AttrTag = Attrs & {
5
5
  declare const rest: unique symbol;
6
6
  export declare function attrTag(attrs: Attrs): AttrTag;
7
7
  export declare function attrTags(first: undefined | AttrTag, attrs: Attrs): AttrTag;
8
+ export declare function isAttrTag(value: unknown): boolean;
8
9
  export {};
@@ -14,6 +14,8 @@ export declare function _assert_hoist(value: unknown): void;
14
14
  export declare function assertExclusiveAttrs(attrs: Record<string, unknown> | undefined, onError?: typeof throwErr, isSet?: (value: unknown) => unknown): void;
15
15
  export declare function assertNoValueBindingOnCheckable(type: unknown, valueChange: unknown): void;
16
16
  export declare function assertHandlerIsFunction(name: string, value: unknown): void;
17
+ export declare function assertNoNativeAttrTags(tagName: string, input: Record<string, unknown> | undefined): void;
18
+ export declare function assertValidContent(value: any, renderer: any): void;
17
19
  export declare function assertValidTagName(tagName: string): void;
18
20
  declare function throwErr(msg: string): void;
19
21
  export {};
@@ -12,6 +12,8 @@ export declare function hasKeys(obj: object): boolean;
12
12
  export declare function isNullishOrFalse(value: unknown): value is false | null | undefined;
13
13
  export declare function isNotNullishOrFalse(value: unknown): boolean;
14
14
  export declare function isPromise(value: unknown): value is Promise<unknown>;
15
+ export declare let classAPIRenderer: undefined | (<Renderer>(value: unknown) => Renderer | undefined);
16
+ export declare function setClassAPIRenderer(render: NonNullable<typeof classAPIRenderer>): void;
15
17
  export declare function normalizeDynamicRenderer<Renderer>(value: any): Renderer | string | undefined;
16
18
  export declare const decodeAccessor: (num: number) => string;
17
19
  export declare let branchesEnabled: undefined | 1;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-mQ5mPBTF.js");
2
+ const require_control_flow = require("../dom-sfzdCRAg.js");
3
3
  // src/dom/catch.feat.ts
4
4
  const deferToPendingTry = (fn, scope, branch) => {
5
5
  while (branch) {
@@ -1,4 +1,4 @@
1
- import { Hn as PendingEffectScopes, In as ClosestBranch, Mn as Pending, Nn as Scope, Un as PendingEffects, Vn as ParentBranch, Wn as PendingRenders, ln as queueAsyncRender, sn as installCatch, un as queueEffect, v as renderCatch, y as runPendingEffects } from "../dom-DjUZd-9y.mjs";
1
+ import { Bn as ParentBranch, Fn as ClosestBranch, Hn as PendingEffects, Mn as Scope, Un as PendingRenders, Vn as PendingEffectScopes, _ as renderCatch, an as installCatch, cn as queueEffect, jn as Pending, sn as queueAsyncRender, v as runPendingEffects } from "../dom-BORByF2b.mjs";
2
2
  // src/dom/catch.feat.ts
3
3
  const deferToPendingTry = (fn, scope, branch) => {
4
4
  while (branch) {
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const require_control_flow = require("../dom-sfzdCRAg.js");
4
+ // src/common/compat-meta.ts
5
+ const SET_SCOPE_REGISTER_ID = "$compat_setScope";
6
+ const RENDER_BODY_ID = "$compat_renderBody";
7
+ // src/dom/compat.feat.ts
8
+ const classIdToBranch = /* @__PURE__ */ new Map();
9
+ let classEventResolver;
10
+ const scopesByRender = /* @__PURE__ */ new WeakMap();
11
+ const getRenderScopes = ($global) => {
12
+ require_control_flow.init($global.runtimeId);
13
+ const render = self[$global.runtimeId]?.[$global.renderId];
14
+ let scopes = render && scopesByRender.get(render);
15
+ if (render && !scopes) scopesByRender.set(render, scopes = {});
16
+ return scopes;
17
+ };
18
+ const compat = {
19
+ setClassAPIRenderer: require_control_flow.setClassAPIRenderer,
20
+ queueEffect: require_control_flow.queueEffect,
21
+ init(warp10Noop) {
22
+ require_control_flow._resumed[SET_SCOPE_REGISTER_ID] = (scope) => {
23
+ getRenderScopes(scope[require_control_flow.Global])[scope["#Id"]] = scope;
24
+ if (scope.m5c) classIdToBranch.set(scope.m5c, scope);
25
+ if (classEventResolver) for (const key in scope) {
26
+ const resolved = classEventResolver(scope[key], scope);
27
+ if (resolved !== scope[key]) scope[key] = resolved;
28
+ }
29
+ };
30
+ require_control_flow._resumed[RENDER_BODY_ID] = warp10Noop;
31
+ },
32
+ setClassEventResolver(fn) {
33
+ classEventResolver = fn;
34
+ },
35
+ resumeClassFunction(id, build) {
36
+ require_control_flow._resumed[id] = build;
37
+ },
38
+ getScope($global, scopeId) {
39
+ return getRenderScopes($global)?.[scopeId];
40
+ },
41
+ isRenderer(value) {
42
+ return "id" in value && typeof value["clone"] === "function";
43
+ },
44
+ getGlobal(scope) {
45
+ return scope[require_control_flow.Global];
46
+ },
47
+ getStartNode(branch) {
48
+ return branch[require_control_flow.StartNode];
49
+ },
50
+ getEndNode(branch) {
51
+ return branch[require_control_flow.EndNode];
52
+ },
53
+ setScopeNodes(branch, startNode, endNode) {
54
+ branch[require_control_flow.StartNode] = startNode;
55
+ branch[require_control_flow.EndNode] = endNode;
56
+ },
57
+ runComponentEffects() {
58
+ if (this.effects) require_control_flow.runEffects(this.effects);
59
+ },
60
+ runComponentDestroy() {
61
+ if (this.scope) require_control_flow.destroyBranch(this.scope);
62
+ },
63
+ resolveRegistered(value, $global) {
64
+ if (Array.isArray(value) && typeof value[0] === "string") return require_control_flow.getRegisteredWithScope(getRenderScopes($global)?.[value[1]], value[0]);
65
+ return value;
66
+ },
67
+ createRenderer(id, clone) {
68
+ const renderer = require_control_flow._content("", 0)();
69
+ renderer["id"] = id;
70
+ renderer[require_control_flow.Clone] = cloneBranch(clone);
71
+ return renderer;
72
+ },
73
+ createTemplate(render, clone) {
74
+ const create = createClassRenderer(render, clone);
75
+ return (template, renderer) => {
76
+ const templateRenderer = create(template, renderer);
77
+ templateRenderer._ = templateRenderer;
78
+ return templateRenderer;
79
+ };
80
+ },
81
+ createContent(render, clone) {
82
+ const create = createClassRenderer(render, clone);
83
+ return (content) => {
84
+ const renderer = create(RENDER_BODY_ID, content);
85
+ renderer[require_control_flow.LocalClosures] = renderer[require_control_flow.Setup];
86
+ return renderer;
87
+ };
88
+ },
89
+ render(out, component, renderer, args) {
90
+ require_control_flow.init(out.global.runtimeId);
91
+ let branch = component.scope;
92
+ let created = 0;
93
+ if (!branch && (branch = classIdToBranch.get(component.id))) {
94
+ component.scope = branch;
95
+ classIdToBranch.delete(component.id);
96
+ }
97
+ if (args[0] && typeof args[0] === "object" && "renderBody" in args[0]) {
98
+ const input = args[0];
99
+ const normalizedInput = args[0] = {};
100
+ for (const key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
101
+ }
102
+ const renderBranch = (_) => {
103
+ if (!branch) {
104
+ created = 1;
105
+ branch = component.scope = require_control_flow.setupBranch(renderer, require_control_flow.createBranch(out.global, renderer, renderer[require_control_flow.Owner], document.body));
106
+ }
107
+ renderer[require_control_flow.LocalClosures]?.(branch);
108
+ renderer[require_control_flow.Params]?.(branch, renderer._ ? args[0] : args);
109
+ };
110
+ component.effects = require_control_flow.rendering ? renderBranch() : require_control_flow.prepareEffects(renderBranch);
111
+ if (created) return branch["#StartNode"].parentNode || branch["#StartNode"];
112
+ }
113
+ };
114
+ function createClassRenderer(render, clone) {
115
+ const renderBranch = (branch) => render(branch, branch.m5b, branch.m5a);
116
+ const create = require_control_flow._content("", 0);
117
+ const cloneClass = cloneBranch(clone);
118
+ return (id, value) => {
119
+ const renderer = create();
120
+ renderer["id"] = id;
121
+ renderer[require_control_flow.Clone] = cloneClass;
122
+ renderer[require_control_flow.Setup] = (branch) => {
123
+ if (branch.m5b !== value) {
124
+ branch.m5b = value;
125
+ require_control_flow.queueRender(branch, renderBranch, 0);
126
+ }
127
+ };
128
+ renderer[require_control_flow.Params] = (branch, input) => {
129
+ branch.m5b = value;
130
+ branch.m5a = input;
131
+ require_control_flow.queueRender(branch, renderBranch, 0);
132
+ };
133
+ return renderer;
134
+ };
135
+ }
136
+ function cloneBranch(clone) {
137
+ return (branch) => {
138
+ const cloned = clone();
139
+ branch[require_control_flow.StartNode] = cloned.startNode;
140
+ branch[require_control_flow.EndNode] = cloned.endNode;
141
+ };
142
+ }
143
+ exports.compat = compat;
@@ -0,0 +1,141 @@
1
+ import { An as Setup, Dn as Owner, En as LocalClosures, Gn as StartNode, In as EndNode, On as Params, Rn as Global, Sn as setClassAPIRenderer, St as init, cn as queueEffect, dt as _content, fn as runEffects, gt as setupBranch, ht as createBranch, ln as queueRender, on as prepareEffects, qt as destroyBranch, un as rendering, wn as Clone, xt as getRegisteredWithScope, yt as _resumed } from "../dom-BORByF2b.mjs";
2
+ // src/common/compat-meta.ts
3
+ const SET_SCOPE_REGISTER_ID = "$compat_setScope";
4
+ const RENDER_BODY_ID = "$compat_renderBody";
5
+ // src/dom/compat.feat.ts
6
+ const classIdToBranch = /* @__PURE__ */ new Map();
7
+ let classEventResolver;
8
+ const scopesByRender = /* @__PURE__ */ new WeakMap();
9
+ const getRenderScopes = ($global) => {
10
+ init($global.runtimeId);
11
+ const render = self[$global.runtimeId]?.[$global.renderId];
12
+ let scopes = render && scopesByRender.get(render);
13
+ if (render && !scopes) scopesByRender.set(render, scopes = {});
14
+ return scopes;
15
+ };
16
+ const compat = {
17
+ setClassAPIRenderer,
18
+ queueEffect,
19
+ init(warp10Noop) {
20
+ _resumed[SET_SCOPE_REGISTER_ID] = (scope) => {
21
+ getRenderScopes(scope[Global])[scope["#Id"]] = scope;
22
+ if (scope.m5c) classIdToBranch.set(scope.m5c, scope);
23
+ if (classEventResolver) for (const key in scope) {
24
+ const resolved = classEventResolver(scope[key], scope);
25
+ if (resolved !== scope[key]) scope[key] = resolved;
26
+ }
27
+ };
28
+ _resumed[RENDER_BODY_ID] = warp10Noop;
29
+ },
30
+ setClassEventResolver(fn) {
31
+ classEventResolver = fn;
32
+ },
33
+ resumeClassFunction(id, build) {
34
+ _resumed[id] = build;
35
+ },
36
+ getScope($global, scopeId) {
37
+ return getRenderScopes($global)?.[scopeId];
38
+ },
39
+ isRenderer(value) {
40
+ return "id" in value && typeof value["clone"] === "function";
41
+ },
42
+ getGlobal(scope) {
43
+ return scope[Global];
44
+ },
45
+ getStartNode(branch) {
46
+ return branch[StartNode];
47
+ },
48
+ getEndNode(branch) {
49
+ return branch[EndNode];
50
+ },
51
+ setScopeNodes(branch, startNode, endNode) {
52
+ branch[StartNode] = startNode;
53
+ branch[EndNode] = endNode;
54
+ },
55
+ runComponentEffects() {
56
+ if (this.effects) runEffects(this.effects);
57
+ },
58
+ runComponentDestroy() {
59
+ if (this.scope) destroyBranch(this.scope);
60
+ },
61
+ resolveRegistered(value, $global) {
62
+ if (Array.isArray(value) && typeof value[0] === "string") return getRegisteredWithScope(getRenderScopes($global)?.[value[1]], value[0]);
63
+ return value;
64
+ },
65
+ createRenderer(id, clone) {
66
+ const renderer = _content("", 0)();
67
+ renderer["id"] = id;
68
+ renderer[Clone] = cloneBranch(clone);
69
+ return renderer;
70
+ },
71
+ createTemplate(render, clone) {
72
+ const create = createClassRenderer(render, clone);
73
+ return (template, renderer) => {
74
+ const templateRenderer = create(template, renderer);
75
+ templateRenderer._ = templateRenderer;
76
+ return templateRenderer;
77
+ };
78
+ },
79
+ createContent(render, clone) {
80
+ const create = createClassRenderer(render, clone);
81
+ return (content) => {
82
+ const renderer = create(RENDER_BODY_ID, content);
83
+ renderer[LocalClosures] = renderer[Setup];
84
+ return renderer;
85
+ };
86
+ },
87
+ render(out, component, renderer, args) {
88
+ init(out.global.runtimeId);
89
+ let branch = component.scope;
90
+ let created = 0;
91
+ if (!branch && (branch = classIdToBranch.get(component.id))) {
92
+ component.scope = branch;
93
+ classIdToBranch.delete(component.id);
94
+ }
95
+ if (args[0] && typeof args[0] === "object" && "renderBody" in args[0]) {
96
+ const input = args[0];
97
+ const normalizedInput = args[0] = {};
98
+ for (const key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
99
+ }
100
+ const renderBranch = (_) => {
101
+ if (!branch) {
102
+ created = 1;
103
+ branch = component.scope = setupBranch(renderer, createBranch(out.global, renderer, renderer[Owner], document.body));
104
+ }
105
+ renderer[LocalClosures]?.(branch);
106
+ renderer[Params]?.(branch, renderer._ ? args[0] : args);
107
+ };
108
+ component.effects = rendering ? renderBranch() : prepareEffects(renderBranch);
109
+ if (created) return branch["#StartNode"].parentNode || branch["#StartNode"];
110
+ }
111
+ };
112
+ function createClassRenderer(render, clone) {
113
+ const renderBranch = (branch) => render(branch, branch.m5b, branch.m5a);
114
+ const create = _content("", 0);
115
+ const cloneClass = cloneBranch(clone);
116
+ return (id, value) => {
117
+ const renderer = create();
118
+ renderer["id"] = id;
119
+ renderer[Clone] = cloneClass;
120
+ renderer[Setup] = (branch) => {
121
+ if (branch.m5b !== value) {
122
+ branch.m5b = value;
123
+ queueRender(branch, renderBranch, 0);
124
+ }
125
+ };
126
+ renderer[Params] = (branch, input) => {
127
+ branch.m5b = value;
128
+ branch.m5a = input;
129
+ queueRender(branch, renderBranch, 0);
130
+ };
131
+ return renderer;
132
+ };
133
+ }
134
+ function cloneBranch(clone) {
135
+ return (branch) => {
136
+ const cloned = clone();
137
+ branch[StartNode] = cloned.startNode;
138
+ branch[EndNode] = cloned.endNode;
139
+ };
140
+ }
141
+ export { compat };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-mQ5mPBTF.js");
2
+ const require_control_flow = require("../dom-sfzdCRAg.js");
3
3
  // src/dom/controllable-input.feat.ts
4
4
  require_control_flow.controllableScripts[0] = require_control_flow._attr_input_checked_script;
5
5
  require_control_flow.controllableScripts[1] = require_control_flow._attr_input_checkedValue_script;
@@ -1,4 +1,4 @@
1
- import { D as _attr_input_checkedValue_script, H as controllableScripts, P as _attr_input_value_script, k as _attr_input_checked_script } from "../dom-DjUZd-9y.mjs";
1
+ import { E as _attr_input_checkedValue_script, N as _attr_input_value_script, O as _attr_input_checked_script, V as controllableScripts } from "../dom-BORByF2b.mjs";
2
2
  // src/dom/controllable-input.feat.ts
3
3
  controllableScripts[0] = _attr_input_checked_script;
4
4
  controllableScripts[1] = _attr_input_checkedValue_script;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-mQ5mPBTF.js");
2
+ const require_control_flow = require("../dom-sfzdCRAg.js");
3
3
  // src/dom/controllable-open.feat.ts
4
4
  require_control_flow.controllableScripts[4] = require_control_flow._attr_details_or_dialog_open_script;
@@ -1,3 +1,3 @@
1
- import { C as _attr_details_or_dialog_open_script, H as controllableScripts } from "../dom-DjUZd-9y.mjs";
1
+ import { S as _attr_details_or_dialog_open_script, V as controllableScripts } from "../dom-BORByF2b.mjs";
2
2
  // src/dom/controllable-open.feat.ts
3
3
  controllableScripts[4] = _attr_details_or_dialog_open_script;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-mQ5mPBTF.js");
2
+ const require_control_flow = require("../dom-sfzdCRAg.js");
3
3
  // src/dom/controllable-select.feat.ts
4
4
  require_control_flow.controllableScripts[3] = require_control_flow._attr_select_value_script;
@@ -1,3 +1,3 @@
1
- import { H as controllableScripts, L as _attr_select_value_script } from "../dom-DjUZd-9y.mjs";
1
+ import { I as _attr_select_value_script, V as controllableScripts } from "../dom-BORByF2b.mjs";
2
2
  // src/dom/controllable-select.feat.ts
3
3
  controllableScripts[3] = _attr_select_value_script;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-mQ5mPBTF.js");
2
+ const require_control_flow = require("../dom-sfzdCRAg.js");
3
3
  // src/dom/controllable-textarea.feat.ts
4
4
  require_control_flow.controllableScripts[2] = require_control_flow._attr_input_value_script;
@@ -1,3 +1,3 @@
1
- import { H as controllableScripts, P as _attr_input_value_script } from "../dom-DjUZd-9y.mjs";
1
+ import { N as _attr_input_value_script, V as controllableScripts } from "../dom-BORByF2b.mjs";
2
2
  // src/dom/controllable-textarea.feat.ts
3
3
  controllableScripts[2] = _attr_input_value_script;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-mQ5mPBTF.js");
2
+ const require_control_flow = require("../dom-sfzdCRAg.js");
3
3
  require("./controllable-input.feat.js");
4
4
  require("./controllable-open.feat.js");
5
5
  require("./controllable-select.feat.js");
@@ -1,4 +1,4 @@
1
- import { B as _controllable_select, R as _controllable_input, U as controllableSpreadHelpers, V as _controllable_textarea, z as _controllable_open } from "../dom-DjUZd-9y.mjs";
1
+ import { B as _controllable_textarea, H as controllableSpreadHelpers, L as _controllable_input, R as _controllable_open, z as _controllable_select } from "../dom-BORByF2b.mjs";
2
2
  import "./controllable-input.feat.mjs";
3
3
  import "./controllable-open.feat.mjs";
4
4
  import "./controllable-select.feat.mjs";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-mQ5mPBTF.js");
2
+ const require_control_flow = require("../dom-sfzdCRAg.js");
3
3
  // src/dom/dynamic-tag-script.feat.ts
4
4
  require_control_flow._resumed[require_control_flow.DYNAMIC_TAG_SCRIPT_REGISTER_ID] = require_control_flow.withBranches(require_control_flow.dynamicTagScript);
@@ -1,3 +1,3 @@
1
- import { $t as DYNAMIC_TAG_SCRIPT_REGISTER_ID, h as dynamicTagScript, wn as withBranches, xt as _resumed } from "../dom-DjUZd-9y.mjs";
1
+ import { Cn as withBranches, Zt as DYNAMIC_TAG_SCRIPT_REGISTER_ID, h as dynamicTagScript, yt as _resumed } from "../dom-BORByF2b.mjs";
2
2
  // src/dom/dynamic-tag-script.feat.ts
3
3
  _resumed[DYNAMIC_TAG_SCRIPT_REGISTER_ID] = withBranches(dynamicTagScript);
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-mQ5mPBTF.js");
2
+ const require_control_flow = require("../dom-sfzdCRAg.js");
3
3
  // src/dom/dynamic-tag-var.feat.ts
4
4
  require_control_flow.installBranchRenders();
5
5
  require_control_flow.installDynamicTagVar((scope, branch, scopeKey, renderer) => {
@@ -1,4 +1,4 @@
1
- import { Fn as BranchRenders, Kn as StartNode, Mt as _el_read, an as createBranchRenders, g as installDynamicTagVar, on as installBranchRenders, qn as TagVariable } from "../dom-DjUZd-9y.mjs";
1
+ import { At as _el_read, Gn as StartNode, Kn as TagVariable, Pn as BranchRenders, g as installDynamicTagVar, in as installBranchRenders, rn as createBranchRenders } from "../dom-BORByF2b.mjs";
2
2
  // src/dom/dynamic-tag-var.feat.ts
3
3
  installBranchRenders();
4
4
  installDynamicTagVar((scope, branch, scopeKey, renderer) => {
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  // src/dom/lazy.feat.ts
3
- require("../dom-mQ5mPBTF.js").withLazy();
3
+ require("../dom-sfzdCRAg.js").withLazy();
@@ -1,3 +1,3 @@
1
- import { Ot as withLazy } from "../dom-DjUZd-9y.mjs";
1
+ import { Et as withLazy } from "../dom-BORByF2b.mjs";
2
2
  // src/dom/lazy.feat.ts
3
3
  withLazy();
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-mQ5mPBTF.js");
2
+ const require_control_flow = require("../dom-sfzdCRAg.js");
3
3
  // src/dom/placeholder.feat.ts
4
4
  require_control_flow._resumed[require_control_flow.PLACEHOLDER_DISMISS_REGISTER_ID] = (tryBranch) => {
5
5
  if (tryBranch["#PlaceholderBranch"]) {
@@ -1,4 +1,4 @@
1
- import { Gn as PlaceholderBranch, Yt as destroyBranch, en as PLACEHOLDER_DISMISS_REGISTER_ID, xt as _resumed } from "../dom-DjUZd-9y.mjs";
1
+ import { Qt as PLACEHOLDER_DISMISS_REGISTER_ID, Wn as PlaceholderBranch, qt as destroyBranch, yt as _resumed } from "../dom-BORByF2b.mjs";
2
2
  // src/dom/placeholder.feat.ts
3
3
  _resumed[PLACEHOLDER_DISMISS_REGISTER_ID] = (tryBranch) => {
4
4
  if (tryBranch["#PlaceholderBranch"]) {
@@ -1,3 +1,26 @@
1
+ // src/common/attr-tag.ts
2
+ const empty = [];
3
+ const rest = Symbol("Attribute Tag");
4
+ function attrTag(attrs) {
5
+ attrs[Symbol.iterator] = attrTagIterator;
6
+ attrs[rest] = empty;
7
+ return attrs;
8
+ }
9
+ function attrTags(first, attrs) {
10
+ if (first) {
11
+ if (first[rest] === empty) first[rest] = [attrs];
12
+ else first[rest].push(attrs);
13
+ return first;
14
+ }
15
+ return attrTag(attrs);
16
+ }
17
+ function isAttrTag(value) {
18
+ return !!value?.[rest];
19
+ }
20
+ function* attrTagIterator() {
21
+ yield this;
22
+ yield* this[rest];
23
+ }
1
24
  // src/common/constants/accessor-prefix.debug.ts
2
25
  const BranchScopes$1 = "BranchScopes:";
3
26
  const ClosureScopes = "ClosureScopes:";
@@ -166,15 +189,20 @@ function isNotNullishOrFalse(value) {
166
189
  function isPromise(value) {
167
190
  return value != null && typeof value.then === "function";
168
191
  }
192
+ let classAPIRenderer;
193
+ function setClassAPIRenderer(render) {
194
+ classAPIRenderer = render;
195
+ }
169
196
  function normalizeDynamicRenderer(value) {
170
197
  if (value) {
171
198
  if (typeof value === "string") return value;
172
199
  const normalized = value.content || value.default || value;
173
- if (!((typeof normalized === "object" || typeof normalized === "function") && "id" in normalized)) {
174
- 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.`);
175
- 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}.`);
176
- }
177
- if ("id" in normalized) return normalized;
200
+ 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}`}.`);
201
+ if (classAPIRenderer) {
202
+ const renderer = classAPIRenderer(normalized);
203
+ if (renderer || false) return renderer;
204
+ } else if ("id" in normalized) return normalized;
205
+ 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.`);
178
206
  }
179
207
  }
180
208
  let branchesEnabled;
@@ -285,6 +313,12 @@ function assertNoValueBindingOnCheckable(type, valueChange) {
285
313
  function assertHandlerIsFunction(name, value) {
286
314
  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}".`);
287
315
  }
316
+ function assertNoNativeAttrTags(tagName, input) {
317
+ 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.`);
318
+ }
319
+ function assertValidContent(value, renderer) {
320
+ 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}".`);
321
+ }
288
322
  function assertValidTagName(tagName) {
289
323
  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.`);
290
324
  }
@@ -1027,10 +1061,10 @@ function init(runtimeId = "M") {
1027
1061
  visitText = serialized;
1028
1062
  while (nextToken()) if (/\D/.test(lastToken)) lastEffect = _resumed[lastToken];
1029
1063
  else effects.push(lastEffect, getScope(lastToken));
1030
- } else if (Array.isArray(serialized)) {
1031
- if (!(readyIds && serialized.every((dep) => readyIds.has(dep) && !render.b[dep].length))) break;
1032
- } else if (readyIds && typeof serialized === "number") break;
1033
- else {
1064
+ } else if (readyIds && typeof serialized !== "function") {
1065
+ if (typeof serialized === "number" || !Object.keys(serialized).every((dep) => readyIds.has(dep) && (render.b[dep]?.n || 0) >= serialized[dep])) break;
1066
+ } else {
1067
+ if (readyIds) resumes.n = (resumes.n || 0) + 1;
1034
1068
  const scopes = serialized(serializeContext);
1035
1069
  if (Array.isArray(scopes)) applyScopes(scopes);
1036
1070
  }
@@ -1147,7 +1181,9 @@ function setParentBranch(branch, parentBranch) {
1147
1181
  branch[ClosestBranch] = branch;
1148
1182
  }
1149
1183
  function createAndSetupBranch($global, renderer, parentScope, parentNode) {
1150
- return setupBranch(renderer, createBranch($global, renderer, parentScope, parentNode));
1184
+ const branch = setupBranch(renderer, createBranch($global, renderer, parentScope, parentNode));
1185
+ renderer[Params]?.(branch, []);
1186
+ return branch;
1151
1187
  }
1152
1188
  function setupBranch(renderer, branch) {
1153
1189
  renderer[Setup]?.(branch);
@@ -1343,13 +1379,11 @@ function attrsInternal(scope, nodeAccessor, nextAttrs, controllable) {
1343
1379
  }
1344
1380
  }
1345
1381
  }
1346
- function _attr_content(scope, nodeAccessor, value) {
1347
- const renderer = normalizeDynamicRenderer(value);
1348
- let content;
1349
- if (renderer) {
1350
- if (renderer["id"]) content = renderer;
1351
- else throw new Error(`Invalid \`content\` attribute. Received ${typeof value}`);
1352
- }
1382
+ function _attr_content(scope, nodeAccessor, content) {
1383
+ var value = content;
1384
+ content = content?.content || content;
1385
+ if (classAPIRenderer && content) content = classAPIRenderer(content);
1386
+ assertValidContent(value, content);
1353
1387
  if (scope["ConditionalRenderer:" + nodeAccessor] !== (scope["ConditionalRenderer:" + nodeAccessor] = rendererKey(content))) {
1354
1388
  setBranch(scope, nodeAccessor, content, createAndSetupBranch);
1355
1389
  if (content?.["accessor"]) subscribeToScopeSet(content[Owner], content[Accessor], scope[BranchScopes$1 + nodeAccessor]);
@@ -1961,9 +1995,6 @@ const _show = /*@__PURE__*/ withBranches((nodeAccessor, startNodeAccessor) => {
1961
1995
  function rendererKey(renderer) {
1962
1996
  return renderer?.["owner"] ? renderer["id"] + " " + renderer[Owner]["#Id"] : renderer?.["id"] || renderer;
1963
1997
  }
1964
- function patchDynamicTag(fn) {
1965
- _dynamic_tag = fn(_dynamic_tag);
1966
- }
1967
1998
  let _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagVar, inputIsArgs) => {
1968
1999
  const scopeOffsetAccessor = getTagVar && getDebugKey(+nodeAccessor.slice(nodeAccessor.lastIndexOf("/") + 1) + 1, "#scopeOffset");
1969
2000
  const childScopeAccessor = BranchScopes$1 + nodeAccessor;
@@ -1977,12 +2008,7 @@ let _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagV
1977
2008
  bindTagVar(scope, branch, scope[scopeOffsetAccessor], tagNameOrRenderer);
1978
2009
  }
1979
2010
  if (typeof tagNameOrRenderer !== "string") setupBranch(tagNameOrRenderer, branch);
1980
- else if (getContent) {
1981
- const content = getContent(scope);
1982
- const elementAccessor = `#${tagNameOrRenderer.toLowerCase()}/0`;
1983
- setBranch(branch, elementAccessor, content, createAndSetupBranch);
1984
- if (content["accessor"]) subscribeToScopeSet(content[Owner], content[Accessor], branch[BranchScopes$1 + elementAccessor]);
1985
- }
2011
+ else if (getContent) _attr_content(branch, `#${tagNameOrRenderer.toLowerCase()}/0`, getContent(scope));
1986
2012
  return branch;
1987
2013
  };
1988
2014
  return (scope, newRenderer, getInput) => {
@@ -2001,6 +2027,7 @@ let _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagV
2001
2027
  const args = getInput?.();
2002
2028
  if (typeof normalizedRenderer === "string") {
2003
2029
  const nodeAccessor = `#${normalizedRenderer.toLowerCase()}/0`;
2030
+ assertNoNativeAttrTags(normalizedRenderer, inputIsArgs ? args[0] : args);
2004
2031
  (getContent ? _attrs : _attrs_content)(childScope, nodeAccessor, (inputIsArgs ? args[0] : args) || {}, controllableSpreadHelpers[childScope[nodeAccessor].tagName]);
2005
2032
  if (childScope["EventAttributes:" + nodeAccessor] || childScope["ControlledHandler:" + nodeAccessor]) queueEffect(childScope, dynamicTagScript);
2006
2033
  } else {
@@ -2194,4 +2221,4 @@ function bySecondArg(_item, index) {
2194
2221
  function byFirstArg(name) {
2195
2222
  return name;
2196
2223
  }
2197
- export { _attr_style_items as $, DYNAMIC_TAG_SCRIPT_REGISTER_ID as $t, _attr_input_value as A, Returns as An, _closure_get as At, _controllable_select as B, Load as Bn, _let as Bt, _attr_details_or_dialog_open_script as C, _call as Cn, getRegisteredWithScope as Ct, _attr_input_checkedValue_script as D, LocalClosures as Dn, readyFailed as Dt, _attr_input_checkedValue_default as E, Lazy as En, ready as Et, _attr_select_value as F, BranchRenders as Fn, _global_read as Ft, _attr_class as G, PlaceholderBranch as Gn, _script as Gt, controllableScripts as H, PendingEffectScopes as Hn, _or as Ht, _attr_select_value_default as I, ClosestBranch as In, _hoist as It, _attr_class_names as J, _assert_init as Jt, _attr_class_item as K, StartNode as Kn, _var as Kt, _attr_select_value_script as L, EndNode as Ln, _hoist_resume as Lt, _attr_input_value_default as M, Pending as Mn, _el_read as Mt, _attr_input_value_dynamic_default as N, Scope as Nn, _for_closure as Nt, _attr_input_checked_default as O, Owner as On, withLazy as Ot, _attr_input_value_script as P, AwaitCounter as Pn, _for_selector as Pt, _attr_style_item as Q, syncGen as Qt, _controllable_input as R, Gen$1 as Rn, _id as Rt, _attr_details_or_dialog_open_default as S, _hoist_read_error as Sn, _var_resume as St, _attr_input_checkedValue as T, Clone as Tn, initEmbedded as Tt, controllableSpreadHelpers as U, PendingEffects as Un, _return as Ut, _controllable_textarea as V, ParentBranch as Vn, _let_change as Vt, _attr as W, PendingRenders as Wn, _return_change as Wt, _attr_nonce as X, insertBranchBefore as Xt, _attr_content as Y, destroyBranch as Yt, _attr_style as Z, removeAndDestroyBranch as Zt, patchDynamicTag as _, forOf as _n, createBranch as _t, _for_in as a, createBranchRenders as an, _html as at, startAwait as b, _assert_class_toggles as bn, _el as bt, _for_to as c, prepareEffects as cn, _style_shell as ct, _for_until_unkeyed as d, queueRender as dn, _to_text as dt, PLACEHOLDER_DISMISS_REGISTER_ID as en, _attrs as et, _if as f, rendering as fn, _content as ft, installDynamicTagVar as g, forIn as gn, createAndSetupBranch as gt, dynamicTagScript as h, runId as hn, _return_setup as ht, _dynamic_tag_content as i, onAbort as in, _attrs_script as it, _attr_input_value_attribute_default as j, Setup as jn, _const as jt, _attr_input_checked_script as k, Params as kn, _closure as kt, _for_to_unkeyed as l, queueAsyncRender as ln, _text as lt, _try as m, runEffects as mn, _content_resume as mt, _await_promise as n, $signal as nn, _attrs_partial as nt, _for_of as o, installBranchRenders as on, _lifecycle as ot, _show as p, run as pn, _content_closures as pt, _attr_class_items as q, TagVariable as qn, _var_change as qt, _dynamic_tag as r, $signalReset as rn, _attrs_partial_content as rt, _for_of_unkeyed as s, installCatch as sn, _style_rule_item as st, _await_content as t, _on as tn, _attrs_content as tt, _for_until as u, queueEffect as un, _text_content as ut, renderCatch as v, forTo as vn, setupBranch as vt, _attr_input_checked as w, withBranches as wn, init as wt, _attr_details_or_dialog_open as x, _assert_hoist as xn, _resumed as xt, runPendingEffects as y, forUntil as yn, _dynamic_tag_var_resume as yt, _controllable_open as z, Global as zn, _if_closure as zt };
2224
+ export { _attrs as $, _on as $t, _attr_input_value_attribute_default as A, Setup as An, _el_read as At, _controllable_textarea as B, ParentBranch as Bn, _or as Bt, _attr_input_checked as C, withBranches as Cn, initEmbedded as Ct, _attr_input_checked_default as D, Owner as Dn, _closure as Dt, _attr_input_checkedValue_script as E, LocalClosures as En, withLazy as Et, _attr_select_value_default as F, ClosestBranch as Fn, _hoist_resume as Ft, _attr_class_item as G, StartNode as Gn, _var_change as Gt, controllableSpreadHelpers as H, PendingEffects as Hn, _return_change as Ht, _attr_select_value_script as I, EndNode as In, _id as It, _attr_content as J, attrTags as Jn, insertBranchBefore as Jt, _attr_class_items as K, TagVariable as Kn, _assert_init as Kt, _controllable_input as L, Gen$1 as Ln, _if_closure as Lt, _attr_input_value_dynamic_default as M, Scope as Mn, _for_selector as Mt, _attr_input_value_script as N, AwaitCounter as Nn, _global_read as Nt, _attr_input_checked_script as O, Params as On, _closure_get as Ot, _attr_select_value as P, BranchRenders as Pn, _hoist as Pt, _attr_style_items as Q, PLACEHOLDER_DISMISS_REGISTER_ID as Qt, _controllable_open as R, Global as Rn, _let as Rt, _attr_details_or_dialog_open_script as S, setClassAPIRenderer as Sn, init as St, _attr_input_checkedValue_default as T, Lazy as Tn, readyFailed as Tt, _attr as U, PendingRenders as Un, _script as Ut, controllableScripts as V, PendingEffectScopes as Vn, _return as Vt, _attr_class as W, PlaceholderBranch as Wn, _var as Wt, _attr_style as X, syncGen as Xt, _attr_nonce as Y, removeAndDestroyBranch as Yt, _attr_style_item as Z, DYNAMIC_TAG_SCRIPT_REGISTER_ID as Zt, renderCatch as _, forUntil as _n, _dynamic_tag_var_resume as _t, _for_in as a, installCatch as an, _lifecycle as at, _attr_details_or_dialog_open as b, _hoist_read_error as bn, _var_resume as bt, _for_to as c, queueEffect as cn, _text as ct, _for_until_unkeyed as d, run as dn, _content as dt, $signal as en, _attrs_content as et, _if as f, runEffects as fn, _content_closures as ft, installDynamicTagVar as g, forTo as gn, setupBranch as gt, dynamicTagScript as h, forOf as hn, createBranch as ht, _dynamic_tag_content as i, installBranchRenders as in, _html as it, _attr_input_value_default as j, Pending as jn, _for_closure as jt, _attr_input_value as k, Returns as kn, _const as kt, _for_to_unkeyed as l, queueRender as ln, _text_content as lt, _try as m, forIn as mn, _return_setup as mt, _await_promise as n, onAbort as nn, _attrs_partial_content as nt, _for_of as o, prepareEffects as on, _style_rule_item as ot, _show as p, runId as pn, _content_resume as pt, _attr_class_names as q, attrTag as qn, destroyBranch as qt, _dynamic_tag as r, createBranchRenders as rn, _attrs_script as rt, _for_of_unkeyed as s, queueAsyncRender as sn, _style_shell as st, _await_content as t, $signalReset as tn, _attrs_partial as tt, _for_until as u, rendering as un, _to_text as ut, runPendingEffects as v, _assert_class_toggles as vn, _el as vt, _attr_input_checkedValue as w, Clone as wn, ready as wt, _attr_details_or_dialog_open_default as x, _call as xn, getRegisteredWithScope as xt, startAwait as y, _assert_hoist as yn, _resumed as yt, _controllable_select as z, Load as zn, _let_change as zt };