marko 6.3.19 → 6.3.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cheatsheet.md +29 -3
- package/dist/common/accessor.d.ts +21 -75
- package/dist/common/accessor.debug.d.ts +21 -75
- package/dist/common/constants/accessor-prefix.d.ts +16 -0
- package/dist/common/constants/accessor-prefix.debug.d.ts +16 -0
- package/dist/common/constants/accessor-prop.d.ts +30 -0
- package/dist/common/constants/accessor-prop.debug.d.ts +30 -0
- package/dist/common/constants/closure-signal-prop.d.ts +6 -0
- package/dist/common/constants/closure-signal-prop.debug.d.ts +6 -0
- package/dist/common/constants/controlled-type.d.ts +9 -0
- package/dist/common/constants/keyed-scopes-prop.d.ts +4 -0
- package/dist/common/constants/keyed-scopes-prop.debug.d.ts +4 -0
- package/dist/common/constants/load-signal-value.d.ts +5 -0
- package/dist/common/constants/load-signal-value.debug.d.ts +5 -0
- package/dist/common/constants/node-type.d.ts +7 -0
- package/dist/common/constants/pending-render-prop.d.ts +9 -0
- package/dist/common/constants/pending-render-prop.debug.d.ts +9 -0
- package/dist/common/constants/renderer-prop.d.ts +12 -0
- package/dist/common/constants/renderer-prop.debug.d.ts +12 -0
- package/dist/common/constants/resume-symbol.d.ts +10 -0
- package/dist/common/constants/walk-code.d.ts +17 -0
- package/dist/common/constants/walk-range-size.d.ts +7 -0
- package/dist/common/types.d.ts +15 -45
- package/dist/debug/dom.js +291 -225
- package/dist/debug/dom.mjs +291 -225
- package/dist/debug/html.js +189 -42
- package/dist/debug/html.mjs +189 -42
- package/dist/dom/compat.d.ts +1 -1
- package/dist/dom/control-flow.d.ts +1 -1
- package/dist/dom/renderer.d.ts +2 -2
- package/dist/dom/scope.d.ts +1 -1
- package/dist/dom.js +8 -6
- package/dist/dom.mjs +8 -6
- package/dist/html/constants/char.d.ts +11 -0
- package/dist/html/constants/flush-status.d.ts +6 -0
- package/dist/html/constants/mark.d.ts +6 -0
- package/dist/html/constants/runtime-key.d.ts +7 -0
- package/dist/html/writer.d.ts +19 -23
- package/dist/html.js +128 -29
- package/dist/html.mjs +128 -29
- package/dist/translator/core/if.d.ts +7 -7
- package/dist/translator/core/index.d.ts +7 -7
- package/dist/translator/index.d.ts +9 -9
- package/dist/translator/index.js +191 -133
- package/dist/translator/interop/constants/feature-type.d.ts +5 -0
- package/dist/translator/interop/index.d.ts +2 -2
- package/dist/translator/util/body-to-text-literal.d.ts +2 -2
- package/dist/translator/util/constants/binding-type.d.ts +10 -0
- package/dist/translator/util/constants/compile-stage.d.ts +8 -0
- package/dist/translator/util/constants/content-type.d.ts +8 -0
- package/dist/translator/util/constants/step.d.ts +5 -0
- package/dist/translator/util/constants/tag-name-type.d.ts +7 -0
- package/dist/translator/util/is-static.d.ts +1 -1
- package/dist/translator/util/references.d.ts +5 -12
- package/dist/translator/util/sections.d.ts +4 -8
- package/dist/translator/util/signals.d.ts +1 -0
- package/dist/translator/util/tag-name-type.d.ts +4 -7
- package/dist/translator/util/walks.d.ts +4 -6
- package/dist/translator/visitors/constants/sibling-text.d.ts +7 -0
- package/dist/translator/visitors/placeholder.d.ts +2 -6
- package/dist/translator/visitors/tag/constants/class-hydration.d.ts +5 -0
- package/dist/translator/visitors/tag/dynamic-tag.d.ts +2 -4
- package/package.json +16 -16
- package/tags-html.d.ts +98 -22
|
@@ -2,11 +2,6 @@ import { types as t } from "@marko/compiler";
|
|
|
2
2
|
import { type Tag } from "@marko/compiler/babel-utils";
|
|
3
3
|
export declare const IfTag: Tag;
|
|
4
4
|
export declare const ElseIfTag: {
|
|
5
|
-
autocomplete: {
|
|
6
|
-
snippet: string;
|
|
7
|
-
description: string;
|
|
8
|
-
descriptionMoreURL: string;
|
|
9
|
-
}[];
|
|
10
5
|
attributeGroups?: string[];
|
|
11
6
|
patternAttributes?: import("@marko/compiler/babel-utils").Attribute[];
|
|
12
7
|
attributes?: {
|
|
@@ -43,12 +38,13 @@ export declare const ElseIfTag: {
|
|
|
43
38
|
text?: boolean;
|
|
44
39
|
html?: boolean;
|
|
45
40
|
};
|
|
46
|
-
};
|
|
47
|
-
export declare const ElseTag: {
|
|
48
41
|
autocomplete: {
|
|
42
|
+
snippet: string;
|
|
49
43
|
description: string;
|
|
50
44
|
descriptionMoreURL: string;
|
|
51
45
|
}[];
|
|
46
|
+
};
|
|
47
|
+
export declare const ElseTag: {
|
|
52
48
|
attributeGroups?: string[];
|
|
53
49
|
patternAttributes?: import("@marko/compiler/babel-utils").Attribute[];
|
|
54
50
|
attributes?: {
|
|
@@ -85,5 +81,9 @@ export declare const ElseTag: {
|
|
|
85
81
|
text?: boolean;
|
|
86
82
|
html?: boolean;
|
|
87
83
|
};
|
|
84
|
+
autocomplete: {
|
|
85
|
+
description: string;
|
|
86
|
+
descriptionMoreURL: string;
|
|
87
|
+
}[];
|
|
88
88
|
};
|
|
89
89
|
export declare function flattenTextOnlyConditional(rootTag: t.NodePath<t.MarkoTag>): void;
|
|
@@ -9,11 +9,6 @@ declare const _default: {
|
|
|
9
9
|
"<define>": import("@marko/compiler/babel-utils").Tag;
|
|
10
10
|
"<effect>": import("@marko/compiler/babel-utils").Tag;
|
|
11
11
|
"<else-if>": {
|
|
12
|
-
autocomplete: {
|
|
13
|
-
snippet: string;
|
|
14
|
-
description: string;
|
|
15
|
-
descriptionMoreURL: string;
|
|
16
|
-
}[];
|
|
17
12
|
attributeGroups?: string[];
|
|
18
13
|
patternAttributes?: import("@marko/compiler/babel-utils").Attribute[];
|
|
19
14
|
attributes?: {
|
|
@@ -50,12 +45,13 @@ declare const _default: {
|
|
|
50
45
|
text?: boolean;
|
|
51
46
|
html?: boolean;
|
|
52
47
|
};
|
|
53
|
-
};
|
|
54
|
-
"<else>": {
|
|
55
48
|
autocomplete: {
|
|
49
|
+
snippet: string;
|
|
56
50
|
description: string;
|
|
57
51
|
descriptionMoreURL: string;
|
|
58
52
|
}[];
|
|
53
|
+
};
|
|
54
|
+
"<else>": {
|
|
59
55
|
attributeGroups?: string[];
|
|
60
56
|
patternAttributes?: import("@marko/compiler/babel-utils").Attribute[];
|
|
61
57
|
attributes?: {
|
|
@@ -92,6 +88,10 @@ declare const _default: {
|
|
|
92
88
|
text?: boolean;
|
|
93
89
|
html?: boolean;
|
|
94
90
|
};
|
|
91
|
+
autocomplete: {
|
|
92
|
+
description: string;
|
|
93
|
+
descriptionMoreURL: string;
|
|
94
|
+
}[];
|
|
95
95
|
};
|
|
96
96
|
"<export>": import("@marko/compiler/babel-utils").Tag;
|
|
97
97
|
"<for>": import("@marko/compiler/babel-utils").Tag;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { Config } from "@marko/compiler";
|
|
2
|
-
export
|
|
2
|
+
export declare const version: string;
|
|
3
3
|
export declare const cheatsheet = "../../cheatsheet.md";
|
|
4
4
|
export declare const tagDiscoveryDirs: string[];
|
|
5
5
|
export { default as internalEntryBuilder } from "./util/entry-builder";
|
|
6
6
|
export declare const preferAPI = "tags";
|
|
7
7
|
export declare const transform: import("@marko/compiler/babel-types").Visitor<unknown>, analyze: import("@marko/compiler/babel-types").Visitor<unknown>, translate: import("@marko/compiler/babel-types").Visitor<unknown>;
|
|
8
8
|
export declare const taglibs: (string | {
|
|
9
|
-
migrate: import("@marko/compiler/babel-types").Visitor<unknown>;
|
|
10
9
|
taglibId: string;
|
|
11
10
|
"<attrs>": import("@marko/compiler/babel-utils").Tag;
|
|
12
11
|
"<await>": import("@marko/compiler/babel-utils").Tag;
|
|
@@ -17,11 +16,6 @@ export declare const taglibs: (string | {
|
|
|
17
16
|
"<define>": import("@marko/compiler/babel-utils").Tag;
|
|
18
17
|
"<effect>": import("@marko/compiler/babel-utils").Tag;
|
|
19
18
|
"<else-if>": {
|
|
20
|
-
autocomplete: {
|
|
21
|
-
snippet: string;
|
|
22
|
-
description: string;
|
|
23
|
-
descriptionMoreURL: string;
|
|
24
|
-
}[];
|
|
25
19
|
attributeGroups?: string[];
|
|
26
20
|
patternAttributes?: import("@marko/compiler/babel-utils").Attribute[];
|
|
27
21
|
attributes?: {
|
|
@@ -58,12 +52,13 @@ export declare const taglibs: (string | {
|
|
|
58
52
|
text?: boolean;
|
|
59
53
|
html?: boolean;
|
|
60
54
|
};
|
|
61
|
-
};
|
|
62
|
-
"<else>": {
|
|
63
55
|
autocomplete: {
|
|
56
|
+
snippet: string;
|
|
64
57
|
description: string;
|
|
65
58
|
descriptionMoreURL: string;
|
|
66
59
|
}[];
|
|
60
|
+
};
|
|
61
|
+
"<else>": {
|
|
67
62
|
attributeGroups?: string[];
|
|
68
63
|
patternAttributes?: import("@marko/compiler/babel-utils").Attribute[];
|
|
69
64
|
attributes?: {
|
|
@@ -100,6 +95,10 @@ export declare const taglibs: (string | {
|
|
|
100
95
|
text?: boolean;
|
|
101
96
|
html?: boolean;
|
|
102
97
|
};
|
|
98
|
+
autocomplete: {
|
|
99
|
+
description: string;
|
|
100
|
+
descriptionMoreURL: string;
|
|
101
|
+
}[];
|
|
103
102
|
};
|
|
104
103
|
"<export>": import("@marko/compiler/babel-utils").Tag;
|
|
105
104
|
"<for>": import("@marko/compiler/babel-utils").Tag;
|
|
@@ -119,6 +118,7 @@ export declare const taglibs: (string | {
|
|
|
119
118
|
"<static>": import("@marko/compiler/babel-utils").Tag;
|
|
120
119
|
"<style>": import("@marko/compiler/babel-utils").Tag;
|
|
121
120
|
"<try>": import("@marko/compiler/babel-utils").Tag;
|
|
121
|
+
migrate: import("@marko/compiler/babel-types").Visitor<unknown>;
|
|
122
122
|
})[][];
|
|
123
123
|
export declare function getRuntimeEntryFiles(output: Config["output"], optimize: boolean): string[];
|
|
124
124
|
export { createInteropTranslator } from "./interop";
|
package/dist/translator/index.js
CHANGED
|
@@ -7,6 +7,15 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
7
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __exportAll = (all, no_symbols) => {
|
|
11
|
+
let target = {};
|
|
12
|
+
for (var name in all) __defProp(target, name, {
|
|
13
|
+
get: all[name],
|
|
14
|
+
enumerable: true
|
|
15
|
+
});
|
|
16
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
10
19
|
var __copyProps = (to, from, except, desc) => {
|
|
11
20
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
21
|
key = keys[i];
|
|
@@ -23,21 +32,22 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
32
|
}) : target, mod));
|
|
24
33
|
//#endregion
|
|
25
34
|
let package_json = require("../../package.json");
|
|
35
|
+
package_json = __toESM(package_json, 1);
|
|
26
36
|
let _marko_compiler = require("@marko/compiler");
|
|
27
37
|
let _marko_compiler_babel_utils = require("@marko/compiler/babel-utils");
|
|
28
38
|
let node_path = require("node:path");
|
|
29
|
-
node_path = __toESM(node_path);
|
|
39
|
+
node_path = __toESM(node_path, 1);
|
|
30
40
|
let path = require("path");
|
|
31
|
-
path = __toESM(path);
|
|
41
|
+
path = __toESM(path, 1);
|
|
32
42
|
let magic_string = require("magic-string");
|
|
33
|
-
magic_string = __toESM(magic_string);
|
|
43
|
+
magic_string = __toESM(magic_string, 1);
|
|
34
44
|
let fastest_levenshtein = require("fastest-levenshtein");
|
|
35
45
|
let _marko_compiler_internal_babel = require("@marko/compiler/internal/babel");
|
|
36
46
|
let _marko_compiler_modules = require("@marko/compiler/modules");
|
|
37
|
-
_marko_compiler_modules = __toESM(_marko_compiler_modules);
|
|
47
|
+
_marko_compiler_modules = __toESM(_marko_compiler_modules, 1);
|
|
38
48
|
//#region src/translator/util/runtime-info.ts
|
|
39
49
|
var runtime_info_default = {
|
|
40
|
-
name: package_json.name,
|
|
50
|
+
name: package_json.default.name,
|
|
41
51
|
taglibId: "marko-core"
|
|
42
52
|
};
|
|
43
53
|
//#endregion
|
|
@@ -93,53 +103,91 @@ var attrs_default = {
|
|
|
93
103
|
}]
|
|
94
104
|
};
|
|
95
105
|
//#endregion
|
|
96
|
-
//#region src/common/accessor.debug.ts
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
106
|
+
//#region src/common/constants/accessor-prefix.debug.ts
|
|
107
|
+
var accessor_prefix_debug_exports = /* @__PURE__ */ __exportAll({
|
|
108
|
+
BranchScopes: () => BranchScopes$3,
|
|
109
|
+
ClosureScopes: () => ClosureScopes$1,
|
|
110
|
+
ClosureSignalIndex: () => ClosureSignalIndex$1,
|
|
111
|
+
ConditionalRenderer: () => ConditionalRenderer$1,
|
|
112
|
+
ControlledHandler: () => ControlledHandler$1,
|
|
113
|
+
ControlledType: () => ControlledType$1,
|
|
114
|
+
ControlledValue: () => ControlledValue$1,
|
|
115
|
+
DynamicHTMLLastChild: () => DynamicHTMLLastChild$1,
|
|
116
|
+
EventAttributes: () => EventAttributes$1,
|
|
117
|
+
KeyedScopes: () => KeyedScopes$1,
|
|
118
|
+
Lifecycle: () => Lifecycle$1,
|
|
119
|
+
Promise: () => Promise$2,
|
|
120
|
+
TagVariableChange: () => TagVariableChange$3
|
|
121
|
+
});
|
|
122
|
+
const BranchScopes$3 = "BranchScopes:";
|
|
123
|
+
const ClosureScopes$1 = "ClosureScopes:";
|
|
124
|
+
const ClosureSignalIndex$1 = "ClosureSignalIndex:";
|
|
125
|
+
const ConditionalRenderer$1 = "ConditionalRenderer:";
|
|
126
|
+
const ControlledHandler$1 = "ControlledHandler:";
|
|
127
|
+
const ControlledType$1 = "ControlledType:";
|
|
128
|
+
const ControlledValue$1 = "ControlledValue:";
|
|
129
|
+
const DynamicHTMLLastChild$1 = "DynamicHTMLLastChild:";
|
|
130
|
+
const EventAttributes$1 = "EventAttributes:";
|
|
131
|
+
const KeyedScopes$1 = "KeyedScopes:";
|
|
132
|
+
const Lifecycle$1 = "Lifecycle:";
|
|
133
|
+
const Promise$2 = "Promise:";
|
|
134
|
+
const TagVariableChange$3 = "TagVariableChange:";
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/common/constants/accessor-prop.debug.ts
|
|
137
|
+
var accessor_prop_debug_exports = /* @__PURE__ */ __exportAll({
|
|
138
|
+
AbortControllers: () => AbortControllers$1,
|
|
139
|
+
AbortScopes: () => AbortScopes$1,
|
|
140
|
+
AwaitCounter: () => AwaitCounter$1,
|
|
141
|
+
BranchAccessor: () => BranchAccessor$1,
|
|
142
|
+
BranchScopes: () => BranchScopes$2,
|
|
143
|
+
CatchContent: () => CatchContent$1,
|
|
144
|
+
ClosestBranch: () => ClosestBranch$1,
|
|
145
|
+
ClosestBranchId: () => ClosestBranchId$1,
|
|
146
|
+
DetachedAwait: () => DetachedAwait$1,
|
|
147
|
+
EndNode: () => EndNode$1,
|
|
148
|
+
Gen: () => Gen$1,
|
|
149
|
+
Global: () => Global$1,
|
|
150
|
+
Id: () => "#Id",
|
|
151
|
+
Load: () => Load$1,
|
|
152
|
+
LoopIndex: () => LoopIndex$1,
|
|
153
|
+
LoopKey: () => LoopKey$1,
|
|
154
|
+
Owner: () => "_",
|
|
155
|
+
ParentBranch: () => ParentBranch$1,
|
|
156
|
+
PendingEffects: () => PendingEffects$1,
|
|
157
|
+
PendingRenders: () => PendingRenders$1,
|
|
158
|
+
PendingScopes: () => PendingScopes$1,
|
|
159
|
+
PlaceholderBranch: () => PlaceholderBranch$1,
|
|
160
|
+
PlaceholderContent: () => PlaceholderContent$1,
|
|
161
|
+
Renderer: () => Renderer$1,
|
|
162
|
+
StartNode: () => StartNode$1,
|
|
163
|
+
TagVariable: () => TagVariable$1,
|
|
164
|
+
TagVariableChange: () => TagVariableChange$2
|
|
165
|
+
});
|
|
166
|
+
const Global$1 = "$global";
|
|
167
|
+
const AbortControllers$1 = "#AbortControllers";
|
|
168
|
+
const AbortScopes$1 = "#AbortScopes";
|
|
169
|
+
const AwaitCounter$1 = "#AwaitCounter";
|
|
170
|
+
const BranchAccessor$1 = "#BranchAccessor";
|
|
171
|
+
const BranchScopes$2 = "#BranchScopes";
|
|
172
|
+
const CatchContent$1 = "#CatchContent";
|
|
173
|
+
const ClosestBranch$1 = "#ClosestBranch";
|
|
174
|
+
const ClosestBranchId$1 = "#ClosestBranchId";
|
|
175
|
+
const Gen$1 = "#Gen";
|
|
176
|
+
const DetachedAwait$1 = "#DetachedAwait";
|
|
177
|
+
const EndNode$1 = "#EndNode";
|
|
178
|
+
const Load$1 = "#Load";
|
|
179
|
+
const LoopKey$1 = "#LoopKey";
|
|
180
|
+
const LoopIndex$1 = "#LoopIndex";
|
|
181
|
+
const ParentBranch$1 = "#ParentBranch";
|
|
182
|
+
const PendingEffects$1 = "#PendingEffects";
|
|
183
|
+
const PendingRenders$1 = "#PendingRenders";
|
|
184
|
+
const PendingScopes$1 = "#PendingScopes";
|
|
185
|
+
const PlaceholderBranch$1 = "#PlaceholderBranch";
|
|
186
|
+
const PlaceholderContent$1 = "#PlaceholderContent";
|
|
187
|
+
const Renderer$1 = "#Renderer";
|
|
188
|
+
const StartNode$1 = "#StartNode";
|
|
189
|
+
const TagVariable$1 = "#TagVariable";
|
|
190
|
+
const TagVariableChange$2 = "#TagVariableChange";
|
|
143
191
|
//#endregion
|
|
144
192
|
//#region src/translator/util/evaluate.ts
|
|
145
193
|
function evaluate(value) {
|
|
@@ -335,9 +383,12 @@ function patchIteratorNext(proto) {
|
|
|
335
383
|
proto.next[kTouchedIterator] = true;
|
|
336
384
|
}
|
|
337
385
|
//#endregion
|
|
386
|
+
//#region src/translator/util/constants/compile-stage.ts
|
|
387
|
+
const translate$1 = "translate";
|
|
388
|
+
//#endregion
|
|
338
389
|
//#region src/translator/util/get-compile-stage.ts
|
|
339
390
|
function isTranslate() {
|
|
340
|
-
return getCompileStage() ===
|
|
391
|
+
return getCompileStage() === translate$1;
|
|
341
392
|
}
|
|
342
393
|
function getCompileStage() {
|
|
343
394
|
return (0, _marko_compiler_babel_utils.getFile)().___compileStage;
|
|
@@ -850,53 +901,53 @@ function joinRepeatable(compare, a, b) {
|
|
|
850
901
|
return compareResult === 0 ? a : compareResult < 0 ? [a, b] : [b, a];
|
|
851
902
|
}
|
|
852
903
|
//#endregion
|
|
853
|
-
//#region src/common/accessor.ts
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
}
|
|
904
|
+
//#region src/common/constants/accessor-prefix.ts
|
|
905
|
+
var accessor_prefix_exports = /* @__PURE__ */ __exportAll({
|
|
906
|
+
BranchScopes: () => "A",
|
|
907
|
+
ClosureScopes: () => "B",
|
|
908
|
+
ClosureSignalIndex: () => "C",
|
|
909
|
+
ConditionalRenderer: () => "D",
|
|
910
|
+
ControlledHandler: () => "E",
|
|
911
|
+
ControlledType: () => "F",
|
|
912
|
+
ControlledValue: () => "G",
|
|
913
|
+
DynamicHTMLLastChild: () => "H",
|
|
914
|
+
EventAttributes: () => "I",
|
|
915
|
+
KeyedScopes: () => "O",
|
|
916
|
+
Lifecycle: () => "K",
|
|
917
|
+
Promise: () => "L",
|
|
918
|
+
TagVariableChange: () => "M"
|
|
919
|
+
});
|
|
920
|
+
//#endregion
|
|
921
|
+
//#region src/common/constants/accessor-prop.ts
|
|
922
|
+
var accessor_prop_exports = /* @__PURE__ */ __exportAll({
|
|
923
|
+
AbortControllers: () => "A",
|
|
924
|
+
AbortScopes: () => "B",
|
|
925
|
+
AwaitCounter: () => "O",
|
|
926
|
+
BranchAccessor: () => "C",
|
|
927
|
+
BranchScopes: () => "D",
|
|
928
|
+
CatchContent: () => "E",
|
|
929
|
+
ClosestBranch: () => "F",
|
|
930
|
+
ClosestBranchId: () => "G",
|
|
931
|
+
DetachedAwait: () => "V",
|
|
932
|
+
EndNode: () => "K",
|
|
933
|
+
Gen: () => "H",
|
|
934
|
+
Global: () => "$",
|
|
935
|
+
Id: () => "L",
|
|
936
|
+
Load: () => "X",
|
|
937
|
+
LoopIndex: () => "I",
|
|
938
|
+
LoopKey: () => "M",
|
|
939
|
+
Owner: () => "_",
|
|
940
|
+
ParentBranch: () => "N",
|
|
941
|
+
PendingEffects: () => "J",
|
|
942
|
+
PendingRenders: () => "W",
|
|
943
|
+
PendingScopes: () => "Y",
|
|
944
|
+
PlaceholderBranch: () => "P",
|
|
945
|
+
PlaceholderContent: () => "Q",
|
|
946
|
+
Renderer: () => "R",
|
|
947
|
+
StartNode: () => "S",
|
|
948
|
+
TagVariable: () => "T",
|
|
949
|
+
TagVariableChange: () => "U"
|
|
950
|
+
});
|
|
900
951
|
//#endregion
|
|
901
952
|
//#region src/translator/util/marko-config.ts
|
|
902
953
|
function isOutputHTML() {
|
|
@@ -919,10 +970,10 @@ function getReadyId(file = (0, _marko_compiler_babel_utils.getFile)()) {
|
|
|
919
970
|
//#endregion
|
|
920
971
|
//#region src/translator/util/get-accessor-char.ts
|
|
921
972
|
function getAccessorPrefix() {
|
|
922
|
-
return isOptimize() ?
|
|
973
|
+
return isOptimize() ? accessor_prefix_exports : accessor_prefix_debug_exports;
|
|
923
974
|
}
|
|
924
975
|
function getAccessorProp() {
|
|
925
|
-
return isOptimize() ?
|
|
976
|
+
return isOptimize() ? accessor_prop_exports : accessor_prop_debug_exports;
|
|
926
977
|
}
|
|
927
978
|
//#endregion
|
|
928
979
|
//#region src/translator/util/serialize-reasons.ts
|
|
@@ -1804,7 +1855,7 @@ function _script(scopeId, registryId) {
|
|
|
1804
1855
|
}
|
|
1805
1856
|
function _resume_branch(scopeId) {
|
|
1806
1857
|
const branchId = $chunk.context?.[kBranchId];
|
|
1807
|
-
if (branchId !== void 0 && branchId !== scopeId) writeScope(scopeId, { [
|
|
1858
|
+
if (branchId !== void 0 && branchId !== scopeId) writeScope(scopeId, { [ClosestBranchId$1]: branchId });
|
|
1808
1859
|
}
|
|
1809
1860
|
let writeScope = (scopeId, partialScope) => {
|
|
1810
1861
|
const { state } = $chunk.boundary;
|
|
@@ -1934,7 +1985,7 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
|
|
|
1934
1985
|
if (name && !(isVoid(value) || skip.test(name) || name === "content" && tagName !== "meta")) if (isEventHandler(name)) {
|
|
1935
1986
|
if (!events) {
|
|
1936
1987
|
events = {};
|
|
1937
|
-
writeScope(scopeId, { [
|
|
1988
|
+
writeScope(scopeId, { [EventAttributes$1 + nodeAccessor]: events });
|
|
1938
1989
|
}
|
|
1939
1990
|
events[getEventHandlerName(name)] = value;
|
|
1940
1991
|
} else result += nonVoidAttr(name, value);
|
|
@@ -1945,12 +1996,12 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
|
|
|
1945
1996
|
}
|
|
1946
1997
|
function writeControlledScope(type, scopeId, nodeAccessor, value, valueChange, serializeType) {
|
|
1947
1998
|
writeScope(scopeId, serializeType ? {
|
|
1948
|
-
[
|
|
1949
|
-
[
|
|
1950
|
-
[
|
|
1999
|
+
[ControlledType$1 + nodeAccessor]: type,
|
|
2000
|
+
[ControlledValue$1 + nodeAccessor]: value,
|
|
2001
|
+
[ControlledHandler$1 + nodeAccessor]: valueChange
|
|
1951
2002
|
} : {
|
|
1952
|
-
[
|
|
1953
|
-
[
|
|
2003
|
+
[ControlledValue$1 + nodeAccessor]: value,
|
|
2004
|
+
[ControlledHandler$1 + nodeAccessor]: valueChange
|
|
1954
2005
|
});
|
|
1955
2006
|
}
|
|
1956
2007
|
function stringAttr(name, value) {
|
|
@@ -2021,7 +2072,7 @@ let _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, s
|
|
|
2021
2072
|
const childScope = getScopeById(branchId);
|
|
2022
2073
|
const needsScript = childScope && (childScope["EventAttributes:a"] || childScope["ControlledHandler:a"]);
|
|
2023
2074
|
if (needsScript) {
|
|
2024
|
-
writeScope(branchId, { [
|
|
2075
|
+
writeScope(branchId, { [Renderer$1]: renderer });
|
|
2025
2076
|
_script(branchId, "d");
|
|
2026
2077
|
}
|
|
2027
2078
|
if (shouldResume || needsScript) _html(state.mark("'", scopeId + " " + accessor + " " + branchId));
|
|
@@ -2046,7 +2097,7 @@ let _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, s
|
|
|
2046
2097
|
if (shouldResume) _html(state.mark("]", scopeId + " " + accessor + (rendered ? " " + branchId : "")));
|
|
2047
2098
|
}
|
|
2048
2099
|
if (rendered) {
|
|
2049
|
-
if (shouldResume) writeScope(scopeId, { [
|
|
2100
|
+
if (shouldResume) writeScope(scopeId, { [ConditionalRenderer$1 + accessor]: renderer?.["id"] || renderer });
|
|
2050
2101
|
} else _scope_id();
|
|
2051
2102
|
return result;
|
|
2052
2103
|
};
|
|
@@ -2906,6 +2957,7 @@ function getSignal(section, referencedBindings, name) {
|
|
|
2906
2957
|
renderReferencedBindings: void 0,
|
|
2907
2958
|
effect: [],
|
|
2908
2959
|
effectReferencedBindings: void 0,
|
|
2960
|
+
hasHTMLEffect: false,
|
|
2909
2961
|
build: void 0,
|
|
2910
2962
|
export: !!exportName,
|
|
2911
2963
|
hasSideEffect: !!(referencedBindings && (Array.isArray(referencedBindings) || referencedBindings.type === 0 || referencedBindings.type === 1 || referencedBindings.section !== section || referencedBindings.closureSections || referencedBindings.hoists)),
|
|
@@ -2967,7 +3019,7 @@ function initValue(binding, isLet = false) {
|
|
|
2967
3019
|
return signal;
|
|
2968
3020
|
}
|
|
2969
3021
|
function signalHasStatements(signal) {
|
|
2970
|
-
if (signal.extraArgs || signal.forcePersist || signal.render.length || signal.effect.length || signal.values.length || signal.intersection) return true;
|
|
3022
|
+
if (signal.extraArgs || signal.forcePersist || signal.render.length || signal.effect.length || signal.hasHTMLEffect || signal.values.length || signal.intersection) return true;
|
|
2971
3023
|
const binding = signal.referencedBindings;
|
|
2972
3024
|
if (binding) {
|
|
2973
3025
|
if (!Array.isArray(binding) && (binding.closureSections || binding.type === 0 || binding.section === signal.section && (binding.hoists || binding.aliases.size || hasNonConstantPropertyAlias(binding)))) return true;
|
|
@@ -3255,7 +3307,8 @@ function toReturnedFunction(rawFn) {
|
|
|
3255
3307
|
return fn.type === "FunctionDeclaration" ? [fn, _marko_compiler.types.returnStatement(fn.id)] : [_marko_compiler.types.returnStatement(fn)];
|
|
3256
3308
|
}
|
|
3257
3309
|
function addHTMLEffectCall(section, referencedBindings) {
|
|
3258
|
-
|
|
3310
|
+
const signal = getSignal(section, referencedBindings);
|
|
3311
|
+
signal.hasHTMLEffect = signal.hasSideEffect = true;
|
|
3259
3312
|
}
|
|
3260
3313
|
function writeHTMLResumeStatements(path) {
|
|
3261
3314
|
const section = getSectionForBody(path);
|
|
@@ -3287,7 +3340,7 @@ function writeHTMLResumeStatements(path) {
|
|
|
3287
3340
|
}
|
|
3288
3341
|
}
|
|
3289
3342
|
});
|
|
3290
|
-
for (let i = allSignals.length; i--;) if (allSignals[i].
|
|
3343
|
+
for (let i = allSignals.length; i--;) if (allSignals[i].hasHTMLEffect) {
|
|
3291
3344
|
const signalRefs = allSignals[i].referencedBindings;
|
|
3292
3345
|
body.push(_marko_compiler.types.expressionStatement(callRuntime("_script", scopeIdIdentifier, _marko_compiler.types.stringLiteral(getResumeRegisterId(section, signalRefs)))));
|
|
3293
3346
|
}
|
|
@@ -7377,7 +7430,12 @@ function addBindingGetter(binding, { invoked, hoisted }) {
|
|
|
7377
7430
|
}
|
|
7378
7431
|
}
|
|
7379
7432
|
function isLazyRead(expr, read, binding, isChangeHandlerRead) {
|
|
7380
|
-
return !!(expr.invokeOnly && read.deferred && !isChangeHandlerRead && !binding.upstreamAlias && binding.type !== 0 && binding.type !== 6 && (binding.type !== 4 || binding.section === expr.section));
|
|
7433
|
+
return !!(expr.invokeOnly && read.deferred && !isChangeHandlerRead && (!binding.upstreamAlias || isParamBinding(binding)) && binding.type !== 0 && binding.type !== 6 && (binding.type !== 4 || binding.section === expr.section));
|
|
7434
|
+
}
|
|
7435
|
+
function isParamBinding(binding) {
|
|
7436
|
+
let root = binding;
|
|
7437
|
+
while (root.upstreamAlias) root = root.upstreamAlias;
|
|
7438
|
+
return root === root.section.params;
|
|
7381
7439
|
}
|
|
7382
7440
|
function resolveReferencedBindings(expr, reads, intersectionsBySection) {
|
|
7383
7441
|
let referencedBindings;
|
|
@@ -9829,6 +9887,10 @@ function getFileNameWithLoc(fileName, { node: { loc } }) {
|
|
|
9829
9887
|
return fileName;
|
|
9830
9888
|
}
|
|
9831
9889
|
//#endregion
|
|
9890
|
+
//#region src/translator/interop/constants/feature-type.ts
|
|
9891
|
+
const Class = "class";
|
|
9892
|
+
const Tags = "tags";
|
|
9893
|
+
//#endregion
|
|
9832
9894
|
//#region src/translator/interop/feature-detection.ts
|
|
9833
9895
|
function isTagsAPI(file = (0, _marko_compiler_babel_utils.getFile)()) {
|
|
9834
9896
|
const program = file.path;
|
|
@@ -9838,11 +9900,11 @@ function isTagsAPI(file = (0, _marko_compiler_babel_utils.getFile)()) {
|
|
|
9838
9900
|
const lookup = (0, _marko_compiler_babel_utils.getTaglibLookup)(file);
|
|
9839
9901
|
const tagsDir = getTagsDir(file.opts.filename);
|
|
9840
9902
|
const state = {};
|
|
9841
|
-
if (tagsDir && !lookup.manualTagsDirs?.has(tagsDir)) addFeature(state,
|
|
9903
|
+
if (tagsDir && !lookup.manualTagsDirs?.has(tagsDir)) addFeature(state, Tags, "Template file within a tags directory", program);
|
|
9842
9904
|
scanBody(state, program.get("body"));
|
|
9843
9905
|
featureType = file.metadata.marko.api = programExtra.featureType = state.feature?.type || (lookup.exclusiveTagDiscoveryDirs === "tags" ? "tags" : "class");
|
|
9844
9906
|
}
|
|
9845
|
-
return featureType ===
|
|
9907
|
+
return featureType === Tags;
|
|
9846
9908
|
}
|
|
9847
9909
|
function getTagsDir(filename) {
|
|
9848
9910
|
const pathSeparator = /\/|\\/.exec(filename)?.[0];
|
|
@@ -9869,23 +9931,23 @@ function scanBody(state, body) {
|
|
|
9869
9931
|
scanTag(state, child);
|
|
9870
9932
|
break;
|
|
9871
9933
|
case "MarkoComment":
|
|
9872
|
-
if (/^\s*use tags\s*$/.test(child.node.value)) addFeature(state,
|
|
9873
|
-
else if (/^\s*use class\s*$/.test(child.node.value)) addFeature(state,
|
|
9934
|
+
if (/^\s*use tags\s*$/.test(child.node.value)) addFeature(state, Tags, "<!-- use tags -->", child);
|
|
9935
|
+
else if (/^\s*use class\s*$/.test(child.node.value)) addFeature(state, Class, "<!-- use class -->", child);
|
|
9874
9936
|
break;
|
|
9875
9937
|
case "MarkoScriptlet":
|
|
9876
|
-
if (!child.node.static) addFeature(state,
|
|
9938
|
+
if (!child.node.static) addFeature(state, Class, "Scriptlet", child);
|
|
9877
9939
|
break;
|
|
9878
9940
|
case "MarkoClass":
|
|
9879
|
-
addFeature(state,
|
|
9941
|
+
addFeature(state, Class, "Class block", child.get("body"));
|
|
9880
9942
|
break;
|
|
9881
9943
|
}
|
|
9882
9944
|
}
|
|
9883
9945
|
function scanTag(state, tag) {
|
|
9884
|
-
if (tag.node.var) addFeature(state,
|
|
9946
|
+
if (tag.node.var) addFeature(state, Tags, "Tag variable", tag.get("var"));
|
|
9885
9947
|
const tagDef = (0, _marko_compiler_babel_utils.getTagDef)(tag);
|
|
9886
9948
|
if (tagDef) {
|
|
9887
9949
|
if (tagDef.name === "style") {
|
|
9888
|
-
if (/^style(?:(?:\.[^.\s\\/:*?"<>|({]+)+)?\s*\{/.test(tag.node.rawValue || "")) addFeature(state,
|
|
9950
|
+
if (/^style(?:(?:\.[^.\s\\/:*?"<>|({]+)+)?\s*\{/.test(tag.node.rawValue || "")) addFeature(state, Class, `style block`, tag.get("name"));
|
|
9889
9951
|
} else if (tagDef.taglibId === runtime_info_default.taglibId) {
|
|
9890
9952
|
const feature = getFeatureTypeFromCoreTagName(tagDef.name);
|
|
9891
9953
|
if (feature) addFeature(state, feature, `<${tagDef.name}> tag`, tag.get("name"));
|
|
@@ -9894,10 +9956,10 @@ function scanTag(state, tag) {
|
|
|
9894
9956
|
if (!tagDef?.parseOptions?.rawOpenTag) {
|
|
9895
9957
|
for (const attr of tag.get("attributes")) if (attr.isMarkoAttribute()) {
|
|
9896
9958
|
if (attr.node.arguments?.length) {
|
|
9897
|
-
addFeature(state,
|
|
9959
|
+
addFeature(state, Class, "Attribute arguments", attr.get("arguments")[0]);
|
|
9898
9960
|
break;
|
|
9899
9961
|
} else if (attr.node.bound) {
|
|
9900
|
-
addFeature(state,
|
|
9962
|
+
addFeature(state, Tags, "Bound attribute", attr);
|
|
9901
9963
|
break;
|
|
9902
9964
|
}
|
|
9903
9965
|
}
|
|
@@ -9914,7 +9976,7 @@ function getFeatureTypeFromCoreTagName(tagName) {
|
|
|
9914
9976
|
case "init-components":
|
|
9915
9977
|
case "macro":
|
|
9916
9978
|
case "module-code":
|
|
9917
|
-
case "while": return
|
|
9979
|
+
case "while": return Class;
|
|
9918
9980
|
case "const":
|
|
9919
9981
|
case "debug":
|
|
9920
9982
|
case "define":
|
|
@@ -9924,7 +9986,7 @@ function getFeatureTypeFromCoreTagName(tagName) {
|
|
|
9924
9986
|
case "log":
|
|
9925
9987
|
case "return":
|
|
9926
9988
|
case "show":
|
|
9927
|
-
case "try": return
|
|
9989
|
+
case "try": return Tags;
|
|
9928
9990
|
default: return;
|
|
9929
9991
|
}
|
|
9930
9992
|
}
|
|
@@ -10110,6 +10172,7 @@ function getVisitorExit(visit) {
|
|
|
10110
10172
|
}
|
|
10111
10173
|
//#endregion
|
|
10112
10174
|
//#region src/translator/index.ts
|
|
10175
|
+
const version = package_json.default.version;
|
|
10113
10176
|
const cheatsheet = "../../cheatsheet.md";
|
|
10114
10177
|
const visitors = extractVisitors({
|
|
10115
10178
|
Program: program_default,
|
|
@@ -10146,9 +10209,4 @@ exports.tagDiscoveryDirs = tagDiscoveryDirs;
|
|
|
10146
10209
|
exports.taglibs = taglibs;
|
|
10147
10210
|
exports.transform = transform;
|
|
10148
10211
|
exports.translate = translate;
|
|
10149
|
-
|
|
10150
|
-
enumerable: true,
|
|
10151
|
-
get: function() {
|
|
10152
|
-
return package_json.version;
|
|
10153
|
-
}
|
|
10154
|
-
});
|
|
10212
|
+
exports.version = version;
|