marko 6.4.0 → 6.4.2
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 +2 -2
- package/dist/common/constants/accessor-prefix.d.ts +1 -0
- package/dist/common/constants/accessor-prefix.debug.d.ts +1 -0
- package/dist/common/constants/reserved-id.d.ts +5 -0
- package/dist/common/errors.d.ts +2 -1
- package/dist/common/opt.d.ts +1 -0
- package/dist/common/types.d.ts +3 -0
- package/dist/debug/dom/catch.feat.js +1 -1
- package/dist/debug/dom/catch.feat.mjs +1 -1
- 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 +1 -1
- package/dist/debug/dom/controllable.feat.mjs +1 -1
- 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-BRO5aArp.js → dom-BLbR0hEx.js} +62 -16
- package/dist/debug/{dom-Btj2QJhk.mjs → dom-Cii0IA92.mjs} +51 -17
- package/dist/debug/dom.js +7 -4
- package/dist/debug/dom.mjs +6 -5
- package/dist/debug/html.js +551 -292
- package/dist/debug/html.mjs +548 -290
- package/dist/dom/catch.feat.js +3 -3
- package/dist/dom/catch.feat.mjs +1 -1
- package/dist/dom/controllable-input.feat.js +1 -1
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +1 -1
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +1 -1
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +1 -1
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.feat.js +1 -1
- package/dist/dom/controllable.feat.mjs +1 -1
- package/dist/dom/dom.d.ts +1 -0
- 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 +1 -1
- 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 +3 -3
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/signals.d.ts +3 -2
- package/dist/{dom-BSsI9OPC.js → dom-B8UEYzOz.js} +112 -84
- package/dist/{dom-B-v8Gw6T.mjs → dom-BPjLe6YU.mjs} +23 -5
- package/dist/dom.d.ts +2 -2
- package/dist/dom.js +34 -33
- package/dist/dom.mjs +6 -5
- package/dist/html/assets.d.ts +12 -6
- package/dist/html/attrs.d.ts +3 -2
- package/dist/html/compat.d.ts +10 -2
- package/dist/html/dynamic-tag.d.ts +1 -1
- package/dist/html/inlined-runtimes.d.ts +1 -1
- package/dist/html/inlined-runtimes.debug.d.ts +1 -1
- package/dist/html/serializer.d.ts +2 -1
- package/dist/html/writer.d.ts +42 -22
- package/dist/html.d.ts +2 -2
- package/dist/html.js +400 -208
- package/dist/html.mjs +399 -207
- package/dist/translator/core/html-comment.d.ts +0 -7
- package/dist/translator/core/let.d.ts +0 -5
- package/dist/translator/core/show.d.ts +2 -5
- package/dist/translator/core/style.d.ts +6 -8
- package/dist/translator/index.d.ts +9 -0
- package/dist/translator/index.js +8429 -8100
- package/dist/translator/util/binding-has-prop.d.ts +1 -1
- package/dist/translator/util/binding-prop-tree.d.ts +4 -4
- package/dist/translator/util/bindings.d.ts +135 -0
- package/dist/translator/util/body-to-text-literal.d.ts +1 -2
- package/dist/translator/util/branch-tag.d.ts +7 -7
- package/dist/translator/util/constants/binding-type.d.ts +5 -6
- package/dist/translator/util/constants/slot-kind.d.ts +14 -0
- package/dist/translator/util/constants/structure-kind.d.ts +2 -1
- package/dist/translator/util/evaluate.d.ts +11 -10
- package/dist/translator/util/finalize-references.d.ts +4 -0
- package/dist/translator/util/for-selector.d.ts +1 -1
- package/dist/translator/util/generate-uid.d.ts +3 -1
- package/dist/translator/util/get-declared-binding-expression.d.ts +2 -2
- package/dist/translator/util/is-core-tag.d.ts +0 -3
- package/dist/translator/util/is-only-child-in-parent.d.ts +2 -7
- package/dist/translator/util/known-tag.d.ts +10 -8
- package/dist/translator/util/module-read.d.ts +21 -0
- package/dist/translator/util/read-replacement.d.ts +3 -0
- package/dist/translator/util/reasons.d.ts +32 -0
- package/dist/translator/util/references.d.ts +68 -166
- package/dist/translator/util/runtime.d.ts +2 -0
- package/dist/translator/util/scope-accessor.d.ts +14 -0
- package/dist/translator/util/scope-read.d.ts +1 -1
- package/dist/translator/util/sections.d.ts +52 -48
- package/dist/translator/util/set-tag-derived-from.d.ts +7 -0
- package/dist/translator/util/setup-work.d.ts +1 -2
- package/dist/translator/util/signals.d.ts +3 -5
- package/dist/translator/util/slots.d.ts +50 -0
- package/dist/translator/util/solve-reasons.d.ts +10 -0
- package/dist/translator/util/sources.d.ts +21 -0
- package/dist/translator/util/structure.d.ts +6 -2
- package/dist/translator/util/tag-facts.d.ts +21 -0
- package/dist/translator/util/tag-name-type.d.ts +4 -1
- package/dist/translator/util/translate-attrs.d.ts +2 -0
- package/dist/translator/util/translate-var.d.ts +3 -0
- package/dist/translator/util/write-guard.d.ts +12 -0
- package/dist/translator/util/writer.d.ts +3 -3
- package/dist/translator/visitors/export-declaration.d.ts +9 -0
- package/dist/translator/visitors/function.d.ts +5 -4
- package/dist/translator/visitors/import-declaration.d.ts +2 -2
- package/dist/translator/visitors/placeholder.d.ts +0 -3
- package/dist/translator/visitors/program/index.d.ts +13 -3
- package/dist/translator/visitors/referenced-identifier.d.ts +2 -1
- package/dist/translator/visitors/tag/custom-tag.d.ts +1 -1
- package/dist/translator/visitors/tag/dynamic-tag.d.ts +0 -3
- package/dist/translator/visitors/tag/index.d.ts +2 -1
- package/dist/translator/visitors/tag/native-tag.d.ts +26 -12
- package/package.json +3 -3
- package/dist/translator/util/insertion-context.d.ts +0 -1
- package/dist/translator/util/is-non-html-text.d.ts +0 -3
- package/dist/translator/util/serialize-guard.d.ts +0 -11
- package/dist/translator/util/serialize-reasons.d.ts +0 -37
- package/dist/translator/util/set-tag-sections-downstream.d.ts +0 -6
package/dist/html/writer.d.ts
CHANGED
|
@@ -38,7 +38,9 @@ export declare function withBranchId<T>(branchId: number, cb: () => T): T;
|
|
|
38
38
|
export declare function withBranchId<T, U>(branchId: number, cb: (value: U) => T, cbValue: U): T;
|
|
39
39
|
export declare function _html(html: string): void;
|
|
40
40
|
export declare function writeScript(script: string): void;
|
|
41
|
-
export declare function
|
|
41
|
+
export declare function catchableBoundary(): Boundary | null;
|
|
42
|
+
export declare function mayDrop(written: Boundary): boolean;
|
|
43
|
+
export declare function _script(scopeId: number, registryId: string, markerGuard?: number): void;
|
|
42
44
|
export declare function _trailers(html: string): void;
|
|
43
45
|
export declare function _resume<T extends WeakKey>(val: T, id: string, scopeId?: number, locals?: Locals): T;
|
|
44
46
|
export declare function _resume_locals<T extends WeakKey>(val: T, id: string, locals: Record<string, unknown>, ownerScopeId?: number): T;
|
|
@@ -51,31 +53,31 @@ export declare function _el_resume(scopeId: number, accessor: Accessor, shouldRe
|
|
|
51
53
|
export declare function _text_resume(scopeId: number, accessor: Accessor, val: unknown, shouldResume?: number): string;
|
|
52
54
|
export declare function _html_resume(scopeId: number, accessor: Accessor, val: unknown, shouldResume?: number): string;
|
|
53
55
|
export declare function _resume_branch(scopeId: number): void;
|
|
54
|
-
export declare function _attr_content(nodeAccessor: Accessor, scopeId: number, content: unknown,
|
|
56
|
+
export declare function _attr_content(nodeAccessor: Accessor, scopeId: number, content: unknown, markerGuard?: number): void;
|
|
55
57
|
export declare function _var(parentScopeId: number, scopeOffsetAccessor: Accessor, childScopeId: number, registryId: string, nodeAccessor?: Accessor): void;
|
|
56
|
-
export declare function _show_start(display: unknown,
|
|
57
|
-
export declare function _show_end(scopeId: number, accessor: Accessor, display: unknown,
|
|
58
|
-
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,
|
|
59
|
-
export declare function _for_in(obj: Falsy | {}, cb: (key: string, value: unknown) => void, by: Falsy | ((key: string, v: unknown) => unknown), scopeId: number, accessor: Accessor,
|
|
60
|
-
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,
|
|
61
|
-
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,
|
|
62
|
-
export declare function _if(cb: () => void | number, scopeId: number, accessor: Accessor,
|
|
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;
|
|
63
65
|
export declare function deferBranchStart(chunk: Chunk): string;
|
|
64
66
|
export declare function applyBranchStart(chunk: Chunk, beforeBranch: string, rendered: boolean): void;
|
|
65
67
|
declare let writeScope: (scopeId: number, partialScope: PartialScope) => ScopeInternals;
|
|
66
68
|
export { writeScope as _scope };
|
|
67
69
|
export declare function _existing_scope(scopeId: number): ScopeInternals;
|
|
68
70
|
export declare function _scope_with_id(scopeId: number): ScopeInternals;
|
|
69
|
-
export declare function _subscribe(subscribers: Set<ScopeInternals> | undefined, scope: ScopeInternals, resumeId?: string,
|
|
70
|
-
export type
|
|
71
|
+
export declare function _subscribe(subscribers: Set<ScopeInternals> | undefined, scope: ScopeInternals, resumeId?: string, markerGuard?: number): ScopeInternals;
|
|
72
|
+
export type GroupMask = undefined | number | Partial<Record<string, number>>;
|
|
71
73
|
export declare const CLIENT_ALL = 715827883;
|
|
72
|
-
export declare function maskGroup(mask:
|
|
73
|
-
export declare function
|
|
74
|
-
export declare function _scope_reason():
|
|
75
|
-
export declare function
|
|
76
|
-
export declare function
|
|
74
|
+
export declare function maskGroup(mask: GroupMask, group: number): number;
|
|
75
|
+
export declare function _set_scope_reason(reason: GroupMask): void;
|
|
76
|
+
export declare function _scope_reason(): GroupMask;
|
|
77
|
+
export declare function _write_if(condition: GroupMask, key: number): 1 | undefined;
|
|
78
|
+
export declare function _write_guard(condition: GroupMask, key: number): 0 | 1;
|
|
77
79
|
export declare function writeWaitReady(readyId: string, renderer: ServerRenderer, input: unknown): void;
|
|
78
|
-
export declare function _await<T>(scopeId: number, accessor: Accessor, promise: Promise<T> | T, content: (value: T) => void,
|
|
80
|
+
export declare function _await<T>(scopeId: number, accessor: Accessor, promise: Promise<T> | T, content: (value: T) => void, markerGuard?: number): void;
|
|
79
81
|
export declare function _try(scopeId: number, accessor: Accessor, content: () => void, placeholderContent?: ServerRenderer, catchContent?: ServerRenderer, placeholderId?: string, catchId?: string): void;
|
|
80
82
|
declare const NOOP: () => void;
|
|
81
83
|
type Mark = Mark.Value;
|
|
@@ -101,7 +103,7 @@ export declare class State implements SerializeState {
|
|
|
101
103
|
flushScopes: boolean;
|
|
102
104
|
writeScopes: Record<number, PartialScope>;
|
|
103
105
|
readyIds: Set<string> | null;
|
|
104
|
-
|
|
106
|
+
scopeReason: GroupMask;
|
|
105
107
|
$global: $Global & {
|
|
106
108
|
renderId: string;
|
|
107
109
|
runtimeId: string;
|
|
@@ -123,13 +125,20 @@ export declare class State implements SerializeState {
|
|
|
123
125
|
}
|
|
124
126
|
type FlushStatus = FlushStatus.Value;
|
|
125
127
|
export { FlushStatus };
|
|
126
|
-
export declare class Boundary
|
|
128
|
+
export declare class Boundary {
|
|
127
129
|
onNext: typeof NOOP;
|
|
128
130
|
count: number;
|
|
129
131
|
resumeWrites: number;
|
|
130
132
|
state: State;
|
|
131
133
|
parent?: Boundary;
|
|
134
|
+
aborted: boolean;
|
|
135
|
+
reason: unknown;
|
|
136
|
+
subscribed?: unknown[];
|
|
137
|
+
pendingReorders?: Set<Chunk>;
|
|
138
|
+
children?: Boundary[];
|
|
139
|
+
withinCatch: boolean;
|
|
132
140
|
constructor(state: State, signal?: AbortSignal, parent?: Boundary);
|
|
141
|
+
abort(reason: unknown): void;
|
|
133
142
|
handleEvent(event: Event): void;
|
|
134
143
|
flush(): 0 | 1 | 2;
|
|
135
144
|
startAsync(): void;
|
|
@@ -142,9 +151,15 @@ export declare class Chunk {
|
|
|
142
151
|
lastEffect: string;
|
|
143
152
|
async: boolean;
|
|
144
153
|
consumed: boolean;
|
|
145
|
-
needsWalk: boolean;
|
|
146
154
|
reorderId: string | null;
|
|
155
|
+
reorderStart: string;
|
|
147
156
|
deferredReady: Opt<Chunk>;
|
|
157
|
+
heldEffects: Opt<Chunk>;
|
|
158
|
+
deferredReorder: Chunk | null;
|
|
159
|
+
catchRange: {
|
|
160
|
+
id: string;
|
|
161
|
+
end: Chunk;
|
|
162
|
+
} | null;
|
|
148
163
|
placeholder: {
|
|
149
164
|
body: Chunk;
|
|
150
165
|
render: () => void;
|
|
@@ -162,16 +177,21 @@ export declare class Chunk {
|
|
|
162
177
|
writeEffect(scopeId: number, registryId: string): void;
|
|
163
178
|
writeScript(script: string): void;
|
|
164
179
|
append(chunk: Chunk): void;
|
|
180
|
+
takeHeldEffects(): Opt<Chunk>;
|
|
165
181
|
takeDeferredReady(): Opt<Chunk>;
|
|
166
182
|
deferOwnReady(): void;
|
|
167
|
-
|
|
168
|
-
|
|
183
|
+
renderPlaceholders(boundary: Boundary): void;
|
|
184
|
+
renderPlaceholder(state: State): boolean;
|
|
185
|
+
markCatchRange(): void;
|
|
186
|
+
queueDeferredReorder(): void;
|
|
187
|
+
consume(boundary: Boundary): Chunk;
|
|
169
188
|
render(content: () => void): Chunk;
|
|
170
189
|
render<T>(content: (val: T) => void, val: T): Chunk;
|
|
171
190
|
flushReadyScripts(boundary: Boundary, reservations?: string[], holdEffects?: boolean): string;
|
|
172
191
|
flushScript(boundary: Boundary): this;
|
|
173
192
|
flushHTML(boundary: Boundary): string;
|
|
174
193
|
}
|
|
194
|
+
export declare function joinHeldEffects(heldEffects: Opt<Chunk>, effects: string): string;
|
|
175
195
|
type QueueCallback = (ticked: true) => void;
|
|
176
196
|
export declare function queueTick(cb: QueueCallback): void;
|
|
177
197
|
export declare function offTick(cb: QueueCallback): void;
|
package/dist/html.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { attrTag, attrTags } from "./common/attr-tag";
|
|
2
|
-
export { _assert_hoist, _el_read_error, _hoist_read_error, } from "./common/errors";
|
|
2
|
+
export { _assert_class_toggles, _assert_hoist, _el_read_error, _hoist_read_error, } from "./common/errors";
|
|
3
3
|
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";
|
|
@@ -7,4 +7,4 @@ export { _escape, _escape_comment, _escape_script, _escape_style, _escape_style_
|
|
|
7
7
|
export { _content, _content_resume, _dynamic_tag } from "./html/dynamic-tag";
|
|
8
8
|
export { forIn, forOf, forTo, forUntil } from "./html/for";
|
|
9
9
|
export { _template } from "./html/template";
|
|
10
|
-
export { _attr_content, _await, _el, _el_resume, _existing_scope, _for_in, _for_of, _for_to, _for_until, _hoist, _html, _id, _if, _peek_scope_id, _resume, _resume_branch, _resume_locals, _scope, _scope_id, _scope_reason, _html_resume, _scope_with_id, _script,
|
|
10
|
+
export { _attr_content, _await, _el, _el_resume, _existing_scope, _for_in, _for_of, _for_to, _for_until, _hoist, _html, _id, _if, _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, _show_end, _show_start, _text_resume, _subscribe, _trailers, _try, _var, $global, } from "./html/writer";
|