marko 6.4.4 → 6.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/errors.d.ts +2 -1
- package/dist/common/helpers.d.ts +7 -7
- package/dist/debug/dom/catch.feat.js +3 -3
- package/dist/debug/dom/catch.feat.mjs +3 -3
- package/dist/debug/dom/controllable-input.feat.js +1 -1
- package/dist/debug/dom/controllable-input.feat.mjs +1 -1
- package/dist/debug/dom/controllable-open.feat.js +1 -1
- package/dist/debug/dom/controllable-open.feat.mjs +1 -1
- package/dist/debug/dom/controllable-select.feat.js +1 -1
- package/dist/debug/dom/controllable-select.feat.mjs +1 -1
- package/dist/debug/dom/controllable-textarea.feat.js +1 -1
- package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/debug/dom/controllable.feat.js +5 -5
- package/dist/debug/dom/controllable.feat.mjs +5 -5
- package/dist/debug/dom/dynamic-tag-script.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/debug/dom/lazy.feat.js +1 -1
- package/dist/debug/dom/lazy.feat.mjs +1 -1
- package/dist/debug/dom/placeholder.feat.js +1 -1
- package/dist/debug/dom/placeholder.feat.mjs +1 -1
- package/dist/debug/{dom-CUxvM4i9.js → dom-CNgQ6lj9.js} +52 -52
- package/dist/debug/{dom-BeY1nGUb.mjs → dom-o9jQjchF.mjs} +43 -43
- package/dist/debug/dom.js +4 -4
- package/dist/debug/dom.mjs +4 -4
- package/dist/debug/html.js +721 -654
- package/dist/debug/html.mjs +721 -654
- package/dist/dom/catch.feat.js +4 -4
- package/dist/dom/catch.feat.mjs +3 -3
- package/dist/dom/control-flow.d.ts +2 -2
- package/dist/dom/controllable-input.feat.js +2 -2
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +2 -2
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +2 -2
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +2 -2
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.d.ts +4 -4
- package/dist/dom/controllable.feat.js +2 -2
- package/dist/dom/controllable.feat.mjs +2 -2
- package/dist/dom/dom.d.ts +5 -5
- package/dist/dom/dynamic-tag-script.feat.js +2 -2
- package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-var.feat.js +2 -2
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/dom/lazy.feat.js +1 -1
- package/dist/dom/lazy.feat.mjs +1 -1
- package/dist/dom/placeholder.feat.js +1 -1
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/signals.d.ts +4 -1
- package/dist/{dom-Diu8MpmL.js → dom-60R4bRWD.js} +40 -40
- package/dist/{dom-DefWmvQB.mjs → dom-Ci2W4l1P.mjs} +33 -33
- package/dist/dom.js +6 -6
- package/dist/dom.mjs +4 -4
- package/dist/html/assets.d.ts +1 -1
- package/dist/html/compat.d.ts +2 -1
- package/dist/html/control-flow.d.ts +20 -0
- package/dist/html/serializer.d.ts +63 -16
- package/dist/html/writer.d.ts +47 -35
- package/dist/html.d.ts +2 -1
- package/dist/html.js +517 -466
- package/dist/html.mjs +517 -466
- package/dist/translator/core/for.d.ts +0 -4
- package/dist/translator/core/return.d.ts +0 -3
- package/dist/translator/core/style.d.ts +2 -2
- package/dist/translator/index.js +8104 -8108
- package/dist/translator/util/analyze-errors.d.ts +2 -1
- package/dist/translator/util/assert.d.ts +8 -1
- package/dist/translator/util/bindings.d.ts +13 -9
- package/dist/translator/util/body-to-text.d.ts +9 -0
- package/dist/translator/util/branch-tag.d.ts +10 -3
- package/dist/translator/util/build-string-expression.d.ts +4 -0
- package/dist/translator/util/content-derives.d.ts +7 -0
- package/dist/translator/util/entry-builder.d.ts +16 -5
- package/dist/translator/util/finalize-references.d.ts +3 -2
- package/dist/translator/util/generate-uid.d.ts +3 -2
- package/dist/translator/util/get-root.d.ts +3 -3
- package/dist/translator/util/get-tag-name.d.ts +1 -1
- package/dist/translator/util/known-tag.d.ts +10 -8
- package/dist/translator/util/module-read.d.ts +0 -3
- package/dist/translator/util/module-registrations.d.ts +44 -0
- package/dist/translator/util/nested-attribute-tags.d.ts +1 -1
- package/dist/translator/util/optional.d.ts +6 -1
- package/dist/translator/util/params-tree.d.ts +18 -0
- package/dist/translator/util/reasons.d.ts +10 -8
- package/dist/translator/util/references.d.ts +23 -28
- package/dist/translator/util/runtime.d.ts +0 -12
- package/dist/translator/util/scope-accessor.d.ts +0 -1
- package/dist/translator/util/scope-read.d.ts +3 -0
- package/dist/translator/util/section-renderer.d.ts +4 -0
- package/dist/translator/util/sections.d.ts +16 -16
- package/dist/translator/util/setup-work.d.ts +2 -1
- package/dist/translator/util/signals.d.ts +22 -11
- package/dist/translator/util/simplify-fn.d.ts +1 -0
- package/dist/translator/util/slots.d.ts +2 -2
- package/dist/translator/util/solve-reasons.d.ts +1 -3
- package/dist/translator/util/sources.d.ts +2 -1
- package/dist/translator/util/statement-tag.d.ts +2 -0
- package/dist/translator/util/static-text.d.ts +2 -1
- package/dist/translator/util/structure.d.ts +0 -10
- package/dist/translator/util/tag-facts.d.ts +8 -1
- package/dist/translator/util/tag-import.d.ts +20 -0
- package/dist/translator/util/tag-name-type.d.ts +9 -2
- package/dist/translator/util/to-only-or-block.d.ts +3 -0
- package/dist/translator/util/to-property-name.d.ts +2 -0
- package/dist/translator/util/translate-attrs.d.ts +7 -5
- package/dist/translator/util/translate-var.d.ts +2 -0
- package/dist/translator/util/traverse.d.ts +1 -2
- package/dist/translator/util/visitors.d.ts +4 -1
- package/dist/translator/util/with-previous-location.d.ts +1 -1
- package/dist/translator/util/write-guard.d.ts +6 -2
- package/dist/translator/util/writer.d.ts +1 -2
- package/dist/translator/visitors/export-declaration.d.ts +2 -3
- package/dist/translator/visitors/function.d.ts +0 -35
- package/dist/translator/visitors/import-declaration.d.ts +0 -16
- package/dist/translator/visitors/placeholder.d.ts +2 -1
- package/dist/translator/visitors/program/html.d.ts +0 -1
- package/dist/translator/visitors/program/index.d.ts +4 -5
- package/dist/translator/visitors/tag/custom-tag.d.ts +0 -14
- package/dist/translator/visitors/tag/native-tag.d.ts +3 -12
- package/package.json +4 -4
- package/dist/translator/util/binding-has-prop.d.ts +0 -8
- package/dist/translator/util/binding-prop-tree.d.ts +0 -18
- package/dist/translator/util/body-to-text-literal.d.ts +0 -9
- package/dist/translator/util/import-reference.d.ts +0 -3
- package/dist/translator/util/normalize-string-expression.d.ts +0 -4
- package/dist/translator/util/plugin-hooks.d.ts +0 -4
- package/dist/translator/util/resolve-relative-to-entry.d.ts +0 -2
- package/dist/translator/util/set-tag-derived-from.d.ts +0 -7
- package/dist/translator/util/to-first-expression-or-block.d.ts +0 -2
- package/dist/translator/util/to-first-statement-or-block.d.ts +0 -2
package/dist/html/writer.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { _hoist_read_error } from "../common/errors";
|
|
2
2
|
import { type Opt } from "../common/opt";
|
|
3
|
-
import { type $Global, type Accessor,
|
|
3
|
+
import { type $Global, type Accessor, ResumeSymbol } from "../common/types";
|
|
4
4
|
import * as FlushStatus from "./constants/flush-status";
|
|
5
5
|
import * as Mark from "./constants/mark";
|
|
6
|
-
import { K_SCOPE_ID, type Locals,
|
|
6
|
+
import { K_SCOPE_ID, type Locals, type SerializeChannel, SerializerState } from "./serializer";
|
|
7
7
|
import type { ServerRenderer } from "./template";
|
|
8
8
|
export type PartialScope = Record<Accessor, unknown>;
|
|
9
|
-
interface
|
|
10
|
-
|
|
11
|
-
parent?: SerializeState;
|
|
9
|
+
interface Channel extends SerializeChannel {
|
|
10
|
+
parent?: Channel;
|
|
12
11
|
resumes: string;
|
|
13
12
|
writeScopes: Record<number, PartialScope>;
|
|
14
13
|
passiveScopes?: Record<number, PartialScope>;
|
|
15
14
|
flushScopes: boolean;
|
|
16
15
|
}
|
|
17
|
-
type ScopeInternals = PartialScope & {
|
|
16
|
+
export type ScopeInternals = PartialScope & {
|
|
18
17
|
[K_SCOPE_ID]?: number;
|
|
19
18
|
};
|
|
19
|
+
export declare let $chunk: Chunk;
|
|
20
20
|
export declare function getChunk(): Chunk | undefined;
|
|
21
21
|
export declare function withChunk<T>(chunk: Chunk, cb: () => T): T;
|
|
22
22
|
export declare function getContext(key: keyof NonNullable<Chunk["context"]>): unknown;
|
|
@@ -33,9 +33,20 @@ export declare function _scope_id(): number;
|
|
|
33
33
|
export declare function _peek_scope_id(): number;
|
|
34
34
|
export declare function withContext<T>(key: PropertyKey, value: unknown, cb: () => T): T;
|
|
35
35
|
export declare function withContext<T, U>(key: PropertyKey, value: unknown, cb: (value: U) => T, cbValue: U): T;
|
|
36
|
+
export declare function withContext<T, U, V>(key: PropertyKey, value: unknown, cb: (value: U, value2: V) => T, cbValue: U, cbValue2: V): T;
|
|
37
|
+
export declare function captureContext(chunk: Chunk): void;
|
|
38
|
+
export declare const kBranchId: unique symbol;
|
|
39
|
+
export interface AsyncContent {
|
|
40
|
+
visit?: string;
|
|
41
|
+
end?: Chunk;
|
|
42
|
+
parent?: AsyncContent;
|
|
43
|
+
resumed?: true;
|
|
44
|
+
}
|
|
36
45
|
export declare function isInResumedBranch(): boolean;
|
|
37
46
|
export declare function withBranchId<T>(branchId: number, cb: () => T): T;
|
|
38
47
|
export declare function withBranchId<T, U>(branchId: number, cb: (value: U) => T, cbValue: U): T;
|
|
48
|
+
export declare function withBranchId<T, U, V>(branchId: number, cb: (value: U, value2: V) => T, cbValue: U, cbValue2: V): T;
|
|
49
|
+
export declare function withAsyncContent<T, U>(async: AsyncContent, cb: (value: U) => T, value: U): T;
|
|
39
50
|
export declare function _html(html: string): void;
|
|
40
51
|
export declare function writeScript(script: string): void;
|
|
41
52
|
export declare function catchableBoundary(): Boundary | null;
|
|
@@ -49,54 +60,46 @@ export declare function _hoist(scopeId: number, id: string): {
|
|
|
49
60
|
(): void;
|
|
50
61
|
[Symbol.iterator]: typeof _hoist_read_error;
|
|
51
62
|
};
|
|
52
|
-
export declare function _el_resume(scopeId: number, accessor: Accessor,
|
|
53
|
-
export declare function _text_resume(scopeId: number, accessor: Accessor, val: unknown,
|
|
54
|
-
export declare function _html_resume(scopeId: number, accessor: Accessor, val: unknown,
|
|
63
|
+
export declare function _el_resume(scopeId: number, accessor: Accessor, markerGuard?: number): string;
|
|
64
|
+
export declare function _text_resume(scopeId: number, accessor: Accessor, val: unknown, markerGuard?: number): string;
|
|
65
|
+
export declare function _html_resume(scopeId: number, accessor: Accessor, val: unknown, markerGuard?: number): string;
|
|
55
66
|
export declare function _resume_branch(scopeId: number): void;
|
|
56
67
|
export declare function _attr_content(nodeAccessor: Accessor, scopeId: number, content: unknown, markerGuard?: number): void;
|
|
57
68
|
export declare function _var(parentScopeId: number, scopeOffsetAccessor: Accessor, childScopeId: number, registryId: string, nodeAccessor?: Accessor): void;
|
|
58
|
-
export declare function _show_start(display: unknown, markerGuard?: number, branchExprGuard?: number, parentEndTag?: string | 0): void;
|
|
59
|
-
export declare function _show_end(scopeId: number, accessor: Accessor, display: unknown, markerGuard?: number, branchExprGuard?: number, parentEndTag?: string | 0, singleNode?: 1 | 0): void;
|
|
60
|
-
export declare function _for_of(list: Falsy | Iterable<unknown>, cb: (item: unknown, index: number) => void, by: Falsy | ((item: unknown, index: number) => unknown), scopeId: number, accessor: Accessor, branchGuard?: number, markerGuard?: number, branchExprGuard?: number, parentEndTag?: string | 0, singleNode?: 1): void;
|
|
61
|
-
export declare function _for_in(obj: Falsy | {}, cb: (key: string, value: unknown) => void, by: Falsy | ((key: string, v: unknown) => unknown), scopeId: number, accessor: Accessor, branchGuard?: number, markerGuard?: number, branchExprGuard?: number, parentEndTag?: string | 0, singleNode?: 1): void;
|
|
62
|
-
export declare function _for_to(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor, branchGuard?: number, markerGuard?: number, branchExprGuard?: number, parentEndTag?: string | 0, singleNode?: 1): void;
|
|
63
|
-
export declare function _for_until(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor, branchGuard?: number, markerGuard?: number, branchExprGuard?: number, parentEndTag?: string | 0, singleNode?: 1): void;
|
|
64
|
-
export declare function _if(cb: () => void | number, scopeId: number, accessor: Accessor, branchGuard?: number, markerGuard?: number, branchExprGuard?: number, parentEndTag?: string | 0, singleNode?: 1): void;
|
|
65
|
-
export declare function deferBranchStart(chunk: Chunk): string;
|
|
66
|
-
export declare function applyBranchStart(chunk: Chunk, beforeBranch: string, rendered: boolean): void;
|
|
67
69
|
declare let writeScope: (scopeId: number, partialScope: PartialScope) => ScopeInternals;
|
|
68
70
|
export { writeScope as _scope };
|
|
69
71
|
export declare function _existing_scope(scopeId: number): ScopeInternals;
|
|
70
72
|
export declare function _scope_with_id(scopeId: number): ScopeInternals;
|
|
71
73
|
export declare function _subscribe(subscribers: Set<ScopeInternals> | undefined, scope: ScopeInternals, resumeId?: string, markerGuard?: number): ScopeInternals;
|
|
72
74
|
export type GroupMask = undefined | number | Partial<Record<string, number>>;
|
|
73
|
-
export declare const
|
|
74
|
-
export declare function
|
|
75
|
+
export declare const ALL_GROUPS = 715827883;
|
|
76
|
+
export declare function getGroupReason(reason: GroupMask, group: number): number;
|
|
75
77
|
export declare function _set_scope_reason(reason: GroupMask): void;
|
|
76
78
|
export declare function _scope_reason(): GroupMask;
|
|
77
|
-
export declare function _write_if(
|
|
78
|
-
export declare function _write_guard(
|
|
79
|
+
export declare function _write_if(reason: GroupMask, group: number): 1 | undefined;
|
|
80
|
+
export declare function _write_guard(reason: GroupMask, group: number): 0 | 1;
|
|
79
81
|
export declare function writeWaitReady(readyId: string, renderer: ServerRenderer, input: unknown): void;
|
|
80
|
-
export declare function
|
|
81
|
-
export declare function
|
|
82
|
+
export declare function deferBranchStart(chunk: Chunk): string;
|
|
83
|
+
export declare function applyBranchStart(chunk: Chunk, beforeBranch: string, rendered: boolean): void;
|
|
82
84
|
declare const NOOP: () => void;
|
|
85
|
+
export declare function getAsyncContent(chunk: Chunk): AsyncContent | undefined;
|
|
83
86
|
type Mark = Mark.Value;
|
|
84
|
-
export declare class State implements
|
|
87
|
+
export declare class State implements Channel {
|
|
85
88
|
tagId: number;
|
|
86
89
|
scopeId: number;
|
|
87
90
|
reorderId: number;
|
|
88
91
|
readyGate: number;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
hasWrittenGlobals: boolean;
|
|
93
|
+
needsWalkerRuntime: boolean;
|
|
94
|
+
hasWalkerRuntime: boolean;
|
|
95
|
+
hasWrittenReady: boolean;
|
|
93
96
|
hasReorderRuntime: boolean;
|
|
94
97
|
hasWrittenResume: boolean;
|
|
95
98
|
walkOnNextFlush: boolean;
|
|
96
99
|
trailerHTML: string;
|
|
97
100
|
resumes: string;
|
|
98
101
|
nonceAttr: string;
|
|
99
|
-
serializer:
|
|
102
|
+
serializer: SerializerState;
|
|
100
103
|
writeReorders: Chunk[] | null;
|
|
101
104
|
scopes: Map<number, ScopeInternals>;
|
|
102
105
|
scope: (scopeId: number) => ScopeInternals;
|
|
@@ -112,13 +115,20 @@ export declare class State implements SerializeState {
|
|
|
112
115
|
renderId: string;
|
|
113
116
|
runtimeId: string;
|
|
114
117
|
});
|
|
115
|
-
|
|
118
|
+
joinFlush(html: string, scripts: string, pending: number): string;
|
|
116
119
|
walkScript(): string;
|
|
120
|
+
addResumes(channel: Channel, resumes: string): void;
|
|
121
|
+
queueScope(target: Channel, scopeId: number, partialScope: PartialScope): void;
|
|
122
|
+
queuePassiveScope(target: Channel, scopeId: number, partialScope: PartialScope): void;
|
|
123
|
+
queueEffect(scopeId: number, registryId: string): void;
|
|
124
|
+
serializeFlush(boundary: Boundary): void;
|
|
125
|
+
runtimeScript(): string;
|
|
126
|
+
keepsTryMarks(chunk: Chunk, resumeWrites: number): boolean;
|
|
117
127
|
resumeScript(resumes: string): string;
|
|
118
128
|
get runtimePrefix(): string;
|
|
119
129
|
get commentPrefix(): string;
|
|
120
130
|
reorder(chunk: Chunk): void;
|
|
121
|
-
|
|
131
|
+
readyScript(id: string, resumes: string): string;
|
|
122
132
|
readyAccess(readyKey: string): string;
|
|
123
133
|
nextReorderId(): string;
|
|
124
134
|
mark(code: ResumeSymbol | Mark, str: string): string;
|
|
@@ -170,9 +180,10 @@ export declare class Chunk {
|
|
|
170
180
|
boundary: Boundary;
|
|
171
181
|
next: Chunk | null;
|
|
172
182
|
context: Record<string | symbol, unknown> | null;
|
|
173
|
-
|
|
174
|
-
constructor(boundary: Boundary, next: Chunk | null, context: Record<string | symbol, unknown> | null,
|
|
183
|
+
channel: Channel;
|
|
184
|
+
constructor(boundary: Boundary, next: Chunk | null, context: Record<string | symbol, unknown> | null, channel: Channel);
|
|
175
185
|
fork(boundary: Boundary, next: Chunk | null): Chunk;
|
|
186
|
+
forkRest(boundary: Boundary): Chunk;
|
|
176
187
|
writeHTML(html: string): void;
|
|
177
188
|
writeEffect(scopeId: number, registryId: string): void;
|
|
178
189
|
writeScript(script: string): void;
|
|
@@ -187,8 +198,9 @@ export declare class Chunk {
|
|
|
187
198
|
consume(boundary: Boundary): Chunk;
|
|
188
199
|
render(content: () => void): Chunk;
|
|
189
200
|
render<T>(content: (val: T) => void, val: T): Chunk;
|
|
201
|
+
render<T, U>(content: (val: T, val2: U) => void, val: T, val2: U): Chunk;
|
|
190
202
|
flushReadyScripts(boundary: Boundary, reservations?: string[], holdEffects?: boolean): string;
|
|
191
|
-
|
|
203
|
+
flush(boundary: Boundary): this;
|
|
192
204
|
flushHTML(boundary: Boundary): string;
|
|
193
205
|
}
|
|
194
206
|
export declare function joinHeldEffects(heldEffects: Opt<Chunk>, effects: string): string;
|
package/dist/html.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ export { _flush_head, withLoadAssets, withPageAssets } from "./html/assets";
|
|
|
4
4
|
export { _attr, _attr_and, _attr_class, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_input_checked, _attr_input_checkedValue, _attr_input_value, _attr_nonce, _attr_nullish, _attr_option_value, _attr_or, _attr_select_value, _attr_style, _attr_textarea_value, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_select_value, _attrs_textarea_value, _style_html, _textarea_value, } from "./html/attrs";
|
|
5
5
|
export { compat } from "./html/compat";
|
|
6
6
|
export { _escape, _escape_comment, _escape_script, _escape_style, _escape_style_value, _to_text, _unescaped, } from "./html/content";
|
|
7
|
+
export { _await, _for_in, _for_of, _for_to, _for_until, _if, _show_end, _show_start, _try, } from "./html/control-flow";
|
|
7
8
|
export { _content, _content_resume, _dynamic_tag } from "./html/dynamic-tag";
|
|
8
9
|
export { forIn, forOf, forTo, forUntil } from "./html/for";
|
|
9
10
|
export { _template } from "./html/template";
|
|
10
|
-
export { _attr_content,
|
|
11
|
+
export { _attr_content, _el, _el_resume, _existing_scope, _hoist, _html, _id, _peek_scope_id, _resume, _resume_branch, _resume_locals, _scope, _scope_id, _scope_reason, _html_resume, _scope_with_id, _script, _write_guard, _write_if, _set_scope_reason, _text_resume, _subscribe, _trailers, _var, $global, } from "./html/writer";
|