marko 6.4.11 → 6.4.12

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 (89) 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-mQ5mPBTF.js → dom-CtXOr4Nm.js} +68 -31
  27. package/dist/debug/{dom-DjUZd-9y.mjs → dom-DaHYZpf2.mjs} +51 -26
  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-B8j2453O.js → dom-BB-Te-3z.js} +125 -130
  63. package/dist/{dom-HEWdZCCb.mjs → dom-BO-0hzLZ.mjs} +13 -18
  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/index.js +297 -285
  78. package/dist/translator/util/assert.d.ts +2 -0
  79. package/dist/translator/util/branch-tag.d.ts +1 -1
  80. package/dist/translator/util/known-tag.d.ts +4 -1
  81. package/dist/translator/util/optional.d.ts +0 -1
  82. package/dist/translator/util/reasons.d.ts +0 -1
  83. package/dist/translator/util/references.d.ts +1 -0
  84. package/dist/translator/util/sections.d.ts +5 -1
  85. package/dist/translator/util/tag-facts.d.ts +2 -0
  86. package/dist/translator/util/translate-attrs.d.ts +1 -4
  87. package/dist/translator/visitors/program/index.d.ts +2 -2
  88. package/index.d.ts +2 -7
  89. package/package.json +4 -4
@@ -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-CtXOr4Nm.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 { Hn as PendingEffectScopes, In as ClosestBranch, Mn as Pending, Nn as Scope, Un as PendingEffects, Vn as ParentBranch, Wn as PendingRenders, _ as renderCatch, cn as queueAsyncRender, ln as queueEffect, on as installCatch, v as runPendingEffects } from "../dom-DaHYZpf2.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-CtXOr4Nm.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.createAndSetupBranch(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 { Cn as setClassAPIRenderer, Ct as init, Dn as LocalClosures, Jt as destroyBranch, Kn as StartNode, Ln as EndNode, On as Owner, St as getRegisteredWithScope, Tn as Clone, bt as _resumed, dn as rendering, dt as _content, ht as createAndSetupBranch, jn as Setup, kn as Params, ln as queueEffect, pn as runEffects, sn as prepareEffects, un as queueRender, zn as Global } from "../dom-DaHYZpf2.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 = createAndSetupBranch(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-CtXOr4Nm.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-DaHYZpf2.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-CtXOr4Nm.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-DaHYZpf2.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-CtXOr4Nm.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-DaHYZpf2.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-CtXOr4Nm.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-DaHYZpf2.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-CtXOr4Nm.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-DaHYZpf2.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-CtXOr4Nm.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 { Qt as DYNAMIC_TAG_SCRIPT_REGISTER_ID, bt as _resumed, h as dynamicTagScript, wn as withBranches } from "../dom-DaHYZpf2.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-CtXOr4Nm.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 { Fn as BranchRenders, Kn as StartNode, an as installBranchRenders, g as installDynamicTagVar, in as createBranchRenders, jt as _el_read, qn as TagVariable } from "../dom-DaHYZpf2.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-CtXOr4Nm.js").withLazy();
@@ -1,3 +1,3 @@
1
- import { Ot as withLazy } from "../dom-DjUZd-9y.mjs";
1
+ import { Dt as withLazy } from "../dom-DaHYZpf2.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-CtXOr4Nm.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 { $t as PLACEHOLDER_DISMISS_REGISTER_ID, Gn as PlaceholderBranch, Jt as destroyBranch, bt as _resumed } from "../dom-DaHYZpf2.mjs";
2
2
  // src/dom/placeholder.feat.ts
3
3
  _resumed[PLACEHOLDER_DISMISS_REGISTER_ID] = (tryBranch) => {
4
4
  if (tryBranch["#PlaceholderBranch"]) {
@@ -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
  }
@@ -1344,13 +1378,11 @@ function attrsInternal(scope, nodeAccessor, nextAttrs, controllable) {
1344
1378
  }
1345
1379
  }
1346
1380
  }
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
- }
1381
+ function _attr_content(scope, nodeAccessor, content) {
1382
+ var value = content;
1383
+ content = content?.content || content;
1384
+ if (classAPIRenderer && content) content = classAPIRenderer(content);
1385
+ assertValidContent(value, content);
1354
1386
  if (scope["ConditionalRenderer:" + nodeAccessor] !== (scope["ConditionalRenderer:" + nodeAccessor] = rendererKey(content))) {
1355
1387
  setBranch(scope, nodeAccessor, content, createAndSetupBranch);
1356
1388
  if (content?.["accessor"]) subscribeToScopeSet(content[Owner], content[Accessor], scope[BranchScopes$1 + nodeAccessor]);
@@ -1962,9 +1994,6 @@ const _show = /*@__PURE__*/ withBranches((nodeAccessor, startNodeAccessor) => {
1962
1994
  function rendererKey(renderer) {
1963
1995
  return renderer?.["owner"] ? renderer["id"] + " " + renderer[Owner]["#Id"] : renderer?.["id"] || renderer;
1964
1996
  }
1965
- function patchDynamicTag(fn) {
1966
- _dynamic_tag = fn(_dynamic_tag);
1967
- }
1968
1997
  let _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagVar, inputIsArgs) => {
1969
1998
  const scopeOffsetAccessor = getTagVar && getDebugKey(+nodeAccessor.slice(nodeAccessor.lastIndexOf("/") + 1) + 1, "#scopeOffset");
1970
1999
  const childScopeAccessor = BranchScopes$1 + nodeAccessor;
@@ -1978,12 +2007,7 @@ let _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagV
1978
2007
  bindTagVar(scope, branch, scope[scopeOffsetAccessor], tagNameOrRenderer);
1979
2008
  }
1980
2009
  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
- }
2010
+ else if (getContent) _attr_content(branch, `#${tagNameOrRenderer.toLowerCase()}/0`, getContent(scope));
1987
2011
  return branch;
1988
2012
  };
1989
2013
  return (scope, newRenderer, getInput) => {
@@ -2002,6 +2026,7 @@ let _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagV
2002
2026
  const args = getInput?.();
2003
2027
  if (typeof normalizedRenderer === "string") {
2004
2028
  const nodeAccessor = `#${normalizedRenderer.toLowerCase()}/0`;
2029
+ assertNoNativeAttrTags(normalizedRenderer, inputIsArgs ? args[0] : args);
2005
2030
  (getContent ? _attrs : _attrs_content)(childScope, nodeAccessor, (inputIsArgs ? args[0] : args) || {}, controllableSpreadHelpers[childScope[nodeAccessor].tagName]);
2006
2031
  if (childScope["EventAttributes:" + nodeAccessor] || childScope["ControlledHandler:" + nodeAccessor]) queueEffect(childScope, dynamicTagScript);
2007
2032
  } else {
@@ -2897,6 +2922,18 @@ Object.defineProperty(exports, "_var_resume", {
2897
2922
  return _var_resume;
2898
2923
  }
2899
2924
  });
2925
+ Object.defineProperty(exports, "attrTag", {
2926
+ enumerable: true,
2927
+ get: function() {
2928
+ return attrTag;
2929
+ }
2930
+ });
2931
+ Object.defineProperty(exports, "attrTags", {
2932
+ enumerable: true,
2933
+ get: function() {
2934
+ return attrTags;
2935
+ }
2936
+ });
2900
2937
  Object.defineProperty(exports, "controllableScripts", {
2901
2938
  enumerable: true,
2902
2939
  get: function() {
@@ -3011,12 +3048,6 @@ Object.defineProperty(exports, "onAbort", {
3011
3048
  return onAbort;
3012
3049
  }
3013
3050
  });
3014
- Object.defineProperty(exports, "patchDynamicTag", {
3015
- enumerable: true,
3016
- get: function() {
3017
- return patchDynamicTag;
3018
- }
3019
- });
3020
3051
  Object.defineProperty(exports, "prepareEffects", {
3021
3052
  enumerable: true,
3022
3053
  get: function() {
@@ -3095,6 +3126,12 @@ Object.defineProperty(exports, "runPendingEffects", {
3095
3126
  return runPendingEffects;
3096
3127
  }
3097
3128
  });
3129
+ Object.defineProperty(exports, "setClassAPIRenderer", {
3130
+ enumerable: true,
3131
+ get: function() {
3132
+ return setClassAPIRenderer;
3133
+ }
3134
+ });
3098
3135
  Object.defineProperty(exports, "setupBranch", {
3099
3136
  enumerable: true,
3100
3137
  get: function() {