marko 6.4.0 → 6.4.1
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 +1 -1
- 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 +1 -1
- 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-ClV4kVOO.js} +32 -16
- package/dist/debug/{dom-Btj2QJhk.mjs → dom-LFrKxOk5.mjs} +32 -16
- package/dist/debug/dom.js +1 -1
- package/dist/debug/dom.mjs +1 -1
- package/dist/debug/html.js +277 -222
- package/dist/debug/html.mjs +275 -220
- package/dist/dom/catch.feat.js +1 -1
- 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/dynamic-tag-script.feat.js +1 -1
- 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 +1 -1
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/signals.d.ts +3 -2
- package/dist/{dom-BSsI9OPC.js → dom-CNglVi8P.js} +13 -4
- package/dist/{dom-B-v8Gw6T.mjs → dom-DfP3MCo0.mjs} +13 -4
- package/dist/dom.js +1 -1
- package/dist/dom.mjs +1 -1
- package/dist/html/attrs.d.ts +2 -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 +1 -1
- package/dist/html/writer.d.ts +34 -22
- package/dist/html.d.ts +1 -1
- package/dist/html.js +224 -167
- package/dist/html.mjs +224 -167
- 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 +8573 -8458
- 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 +127 -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 +1 -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 +8 -7
- 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 +67 -166
- 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 +48 -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 +5 -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 +2 -2
- 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
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
+
import { type Binding } from "./bindings";
|
|
2
3
|
import * as Step from "./constants/step";
|
|
3
|
-
import { type Section, type
|
|
4
|
+
import { type Section, type StructureNode, type StructureRef } from "./sections";
|
|
4
5
|
export declare function enter(path: t.NodePath<any>): void;
|
|
5
6
|
export declare function exit(path: t.NodePath<any>): void;
|
|
6
7
|
export declare function enterShallow(path: t.NodePath<any>): void;
|
|
7
8
|
export declare function child(tag: t.NodePath<t.MarkoTag>, name: string, renderer?: StructureRef): void;
|
|
8
9
|
export declare function writeTo(path: t.NodePath<any>): (strs: TemplateStringsArray, ...exprs: string[]) => void;
|
|
9
10
|
export declare function writeTextTo(path: t.NodePath<any>, value: string): void;
|
|
10
|
-
export declare function
|
|
11
|
+
export declare function node(path: t.NodePath<t.MarkoTag | t.MarkoPlaceholder>, binding?: Binding): StructureNode | undefined;
|
|
12
|
+
export declare function marker(path: t.NodePath<t.MarkoTag | t.MarkoPlaceholder>, binding: Binding): void;
|
|
13
|
+
export declare function controlFlowNode(tag: t.NodePath<t.MarkoTag>, section: Section): Binding;
|
|
11
14
|
type ResolvedPart = string | t.Expression;
|
|
12
15
|
interface ResolvedStructure {
|
|
13
16
|
writes: ResolvedPart[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { types as t } from "@marko/compiler";
|
|
2
|
+
import * as ContentType from "./constants/content-type";
|
|
3
|
+
export interface TagFacts {
|
|
4
|
+
/** What renders at its edges, `null` for nothing. */
|
|
5
|
+
content: ContentType.Value | null | ((tag: t.MarkoTag) => ContentType.Value | null);
|
|
6
|
+
/** Its body renders into the section holding the tag. */
|
|
7
|
+
inlineBody?: true;
|
|
8
|
+
/** Its body is text rather than markup. */
|
|
9
|
+
textBody?: true;
|
|
10
|
+
/** It renders its body in its own place, with no node of its own. */
|
|
11
|
+
controlFlow?: true;
|
|
12
|
+
/** One of the document's own elements: the parser implies and moves nodes
|
|
13
|
+
* into it, and the page writes assets and resume scripts into it. */
|
|
14
|
+
pageElement?: true;
|
|
15
|
+
/** Its insertion mode drops an unknown element but keeps its children, so a
|
|
16
|
+
* wrapper around content inside it is discarded. */
|
|
17
|
+
discardsWrapperChildren?: true;
|
|
18
|
+
}
|
|
19
|
+
export declare function getTagFacts(tag: t.NodePath<t.MarkoTag>): TagFacts;
|
|
20
|
+
export declare function getTagContentType(tag: t.NodePath<t.MarkoTag>): ContentType.Value | null;
|
|
21
|
+
export declare function isNonHTMLText(child: t.NodePath<t.MarkoPlaceholder | t.MarkoText>): boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
2
|
import { type LoadImportConfig } from "../visitors/import-declaration";
|
|
3
3
|
import * as TagNameType from "./constants/tag-name-type";
|
|
4
|
+
declare const kTagNameDynamic: unique symbol;
|
|
4
5
|
declare module "@marko/compiler/dist/types" {
|
|
5
6
|
interface ProgramExtra {
|
|
6
7
|
featureType?: "class" | "tags";
|
|
@@ -9,6 +10,8 @@ declare module "@marko/compiler/dist/types" {
|
|
|
9
10
|
}
|
|
10
11
|
interface NodeExtra {
|
|
11
12
|
tagNameType?: TagNameType;
|
|
13
|
+
}
|
|
14
|
+
interface MarkoTagExtra {
|
|
12
15
|
tagNameNullable?: boolean;
|
|
13
16
|
tagNameImported?: string;
|
|
14
17
|
/** Every template the name may resolve to, when it can resolve to
|
|
@@ -17,7 +20,7 @@ declare module "@marko/compiler/dist/types" {
|
|
|
17
20
|
tagNameLoad?: LoadImportConfig;
|
|
18
21
|
}
|
|
19
22
|
interface MarkoTagExtra {
|
|
20
|
-
|
|
23
|
+
[kTagNameDynamic]?: boolean;
|
|
21
24
|
tagNameUnresolved?: boolean;
|
|
22
25
|
featureType?: ProgramExtra["featureType"];
|
|
23
26
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
2
|
import { type BindingPropTree } from "./binding-prop-tree";
|
|
3
|
+
import { type Binding } from "./bindings";
|
|
3
4
|
import { type AttrTagLookup } from "./nested-attribute-tags";
|
|
4
5
|
import { type SortedOpt } from "./optional";
|
|
5
6
|
type ContentKey = "renderBody" | "content";
|
|
@@ -14,4 +15,5 @@ export declare function addDynamicAttrTagStatements(attrTags: t.NodePath<t.Marko
|
|
|
14
15
|
/** Unwraps a lone spread to the spread argument itself, so the result may alias
|
|
15
16
|
* a caller binding; anything the runtime writes to needs its own object. */
|
|
16
17
|
export declare function propsToExpression(props: t.ObjectExpression["properties"]): t.Expression;
|
|
18
|
+
export declare function getSingleKnownSpread(attributes: (t.MarkoAttribute | t.MarkoSpreadAttribute)[]): Binding | undefined;
|
|
17
19
|
export {};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
+
import { type Binding } from "./bindings";
|
|
2
3
|
export default function translateVar(tag: t.NodePath<t.MarkoTag>, initialValue: t.Expression, kind?: "let" | "const", statements?: t.Statement[]): void;
|
|
4
|
+
export declare function getRestPattern(rest: Binding, id: t.Identifier, from: Binding, shorthand: boolean): t.ArrayPattern | t.ObjectPattern;
|
|
5
|
+
export declare function withRestFallback(rest: Binding, from: Binding, value: t.Expression): t.Expression;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { types as t } from "@marko/compiler";
|
|
2
|
+
import { type Reason, type Reasons } from "./reasons";
|
|
3
|
+
import { type Section } from "./sections";
|
|
4
|
+
export declare function isSameReason(a: Reason | undefined, b: Reason | undefined): boolean;
|
|
5
|
+
export declare function buildGroupMask(groups: {
|
|
6
|
+
value: number | t.Expression | undefined;
|
|
7
|
+
names: string;
|
|
8
|
+
}[]): t.Expression | undefined;
|
|
9
|
+
export declare function getScopeReasonStatement(section: Section): t.Statement;
|
|
10
|
+
export declare function getWriteGuard(section: Section, reason: undefined | Reason, optional: boolean): t.Expression | undefined;
|
|
11
|
+
export declare function getWriteGuardForAny(section: Section, reasons: undefined | Reasons, optional: boolean): t.Expression | undefined;
|
|
12
|
+
export declare function getExprIfWritten<T extends undefined | Reason, R extends (T extends {} ? t.Expression : undefined)>(section: Section, reason: T, expr: t.Expression): R;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type Binding } from "./
|
|
3
|
-
import type {
|
|
2
|
+
import { type Binding } from "./bindings";
|
|
3
|
+
import type { Reason } from "./reasons";
|
|
4
4
|
type Write = string | t.Expression | (() => undefined | string | t.Expression);
|
|
5
5
|
export declare function writeTo(path: t.NodePath<any>, trailer?: boolean): (strs: TemplateStringsArray, ...exprs: Write[]) => void;
|
|
6
6
|
export declare function consumeHTML(path: t.NodePath<any>): t.ExpressionStatement | undefined;
|
|
7
7
|
export declare function flushBefore(path: t.NodePath<any>): void;
|
|
8
8
|
export declare function flushInto(path: t.NodePath<t.MarkoTag> | t.NodePath<t.Program>): void;
|
|
9
|
-
export declare function markNode(path: t.NodePath<t.MarkoTag | t.MarkoPlaceholder>, nodeBinding: Binding, reason: undefined | false |
|
|
9
|
+
export declare function markNode(path: t.NodePath<t.MarkoTag | t.MarkoPlaceholder>, nodeBinding: Binding, reason: undefined | false | Reason, deferred?: boolean): void;
|
|
10
10
|
export {};
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
+
declare const kTagImport: unique symbol;
|
|
3
|
+
declare module "@marko/compiler/dist/types" {
|
|
4
|
+
interface ExportNamedDeclarationExtra {
|
|
5
|
+
[kTagImport]?: string;
|
|
6
|
+
}
|
|
7
|
+
interface ExportAllDeclarationExtra {
|
|
8
|
+
[kTagImport]?: string;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
2
11
|
declare const _default: {
|
|
3
12
|
analyze(this: unknown, exportDecl: t.NodePath<t.ExportAllDeclaration | t.ExportNamedDeclaration>): void;
|
|
4
13
|
translate: {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
+
declare const kRegisteredExports: unique symbol;
|
|
2
3
|
declare module "@marko/compiler/dist/types" {
|
|
3
4
|
interface ProgramExtra {
|
|
4
|
-
|
|
5
|
+
[kRegisteredExports]?: Map<string, ReservedExport>;
|
|
5
6
|
}
|
|
6
7
|
}
|
|
7
8
|
/** The canonical name a reserved register id is exported under, and its id. */
|
|
@@ -17,12 +18,12 @@ declare const _default: {
|
|
|
17
18
|
analyze(this: unknown, fn: t.NodePath<t.Function>): void;
|
|
18
19
|
};
|
|
19
20
|
export default _default;
|
|
20
|
-
export declare function
|
|
21
|
+
export declare function resolveFunctionReason(): void;
|
|
21
22
|
export declare function finalizeFunctionRegistry(): void;
|
|
22
23
|
/**
|
|
23
24
|
* Tracks a function imported from another template that reserved a register id.
|
|
24
|
-
* The importing template registers it (under the reserved id) when
|
|
25
|
-
*
|
|
25
|
+
* The importing template registers it (under the reserved id) when client
|
|
26
|
+
* code reads its own references.
|
|
26
27
|
*/
|
|
27
28
|
export declare function trackImportedFn(importDecl: t.NodePath<t.ImportDeclaration>, local: string, resolved: ResolvedExport): void;
|
|
28
29
|
/**
|
|
@@ -6,7 +6,7 @@ declare module "@marko/compiler/dist/types" {
|
|
|
6
6
|
/** Absolute filenames of templates this one imports with `load`. */
|
|
7
7
|
loadImports?: Set<string>;
|
|
8
8
|
}
|
|
9
|
-
interface
|
|
9
|
+
interface ImportDeclarationExtra {
|
|
10
10
|
tagImport?: string;
|
|
11
11
|
loadImport?: LoadImportConfig;
|
|
12
12
|
registeredImportedFns?: (ResolvedExport & {
|
|
@@ -28,4 +28,4 @@ declare const _default: {
|
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
30
|
export default _default;
|
|
31
|
-
export declare function getImportFacts(importDecl: t.NodePath<t.ImportDeclaration>): t.NodeExtra;
|
|
31
|
+
export declare function getImportFacts(importDecl: t.NodePath<t.ImportDeclaration>): t.ImportDeclarationExtra & t.NodeExtra;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type Binding } from "../util/references";
|
|
3
2
|
import * as SiblingText from "./constants/sibling-text";
|
|
4
|
-
declare const kNodeBinding: unique symbol;
|
|
5
3
|
declare const kSiblingText: unique symbol;
|
|
6
4
|
type SiblingText = SiblingText.Value;
|
|
7
5
|
declare module "@marko/compiler/dist/types" {
|
|
8
6
|
interface MarkoPlaceholderExtra {
|
|
9
|
-
[kNodeBinding]?: Binding;
|
|
10
7
|
[kSiblingText]?: SiblingText;
|
|
11
8
|
}
|
|
12
9
|
}
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
2
|
import { type BindingPropTree } from "../../util/binding-prop-tree";
|
|
3
|
+
import { type Binding } from "../../util/bindings";
|
|
3
4
|
import { preAnalyze } from "./pre-analyze";
|
|
4
5
|
export declare let scopeIdentifier: t.Identifier;
|
|
5
6
|
export declare let localsIdentifier: t.Identifier;
|
|
6
7
|
declare module "@marko/compiler/dist/types" {
|
|
7
8
|
interface ProgramExtra {
|
|
9
|
+
/** Client code reads something of its own after resume (a section, or a
|
|
10
|
+
* renderer it registers), so a page bundles it. */
|
|
8
11
|
hasResumes?: boolean;
|
|
9
|
-
|
|
12
|
+
/** What the template reads of its params (its input is the first), the
|
|
13
|
+
* contract its callers keep. */
|
|
14
|
+
paramsTree?: BindingPropTree;
|
|
15
|
+
/** The names every compile of the template exports its parts under. */
|
|
16
|
+
exportNames?: {
|
|
10
17
|
template: string;
|
|
11
18
|
walks: string;
|
|
12
19
|
setup: string;
|
|
13
|
-
|
|
14
|
-
|
|
20
|
+
/** The signal of each of the template's param bindings, a property of
|
|
21
|
+
* one included. */
|
|
22
|
+
params: Map<Binding, string>;
|
|
23
|
+
/** Each content passthrough's `_dynamic_tag_content` signal. */
|
|
24
|
+
directContent: Map<Binding, string>;
|
|
15
25
|
};
|
|
16
26
|
styleFile?: string;
|
|
17
27
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
+
declare const kAbortId: unique symbol;
|
|
2
3
|
declare module "@marko/compiler/dist/types" {
|
|
3
4
|
interface NodeExtra {
|
|
4
5
|
/** `$signal` abort id for this expression root, allocated in analyze
|
|
5
6
|
* (see below) so every translate reads the same id. */
|
|
6
|
-
|
|
7
|
+
[kAbortId]?: number;
|
|
7
8
|
}
|
|
8
9
|
}
|
|
9
10
|
declare const _default: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import type
|
|
2
|
+
import { type Binding } from "../../util/bindings";
|
|
3
3
|
declare const kLoadTagBinding: unique symbol;
|
|
4
4
|
declare module "@marko/compiler/dist/types" {
|
|
5
5
|
interface MarkoTagExtra {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type Binding } from "../../util/references";
|
|
3
2
|
import { type Section } from "../../util/sections";
|
|
4
3
|
import * as ClassHydration from "./constants/class-hydration";
|
|
5
|
-
declare const kChildOffsetScopeBinding: unique symbol;
|
|
6
4
|
type ClassHydration = ClassHydration.Value;
|
|
7
5
|
declare module "@marko/compiler" {
|
|
8
6
|
interface MarkoMeta {
|
|
@@ -12,7 +10,6 @@ declare module "@marko/compiler" {
|
|
|
12
10
|
}
|
|
13
11
|
declare module "@marko/compiler/dist/types" {
|
|
14
12
|
interface MarkoTagExtra {
|
|
15
|
-
[kChildOffsetScopeBinding]?: Binding;
|
|
16
13
|
defineBodySection?: Section;
|
|
17
14
|
}
|
|
18
15
|
}
|
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type Binding } from "../../util/references";
|
|
3
2
|
import { type DOMRuntimeFeature } from "../../util/runtime";
|
|
4
|
-
import { type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare const kTagContentAttr: unique symbol;
|
|
8
|
-
declare const kVisitOp: unique symbol;
|
|
3
|
+
import { type StructureNode } from "../../util/sections";
|
|
4
|
+
declare const kNodeOp: unique symbol;
|
|
5
|
+
declare const kNativeAttrs: unique symbol;
|
|
9
6
|
declare module "@marko/compiler/dist/types" {
|
|
10
|
-
interface
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[kTagContentAttr]?: true;
|
|
14
|
-
[kVisitOp]?: StructureVisit;
|
|
7
|
+
interface MarkoTagExtra {
|
|
8
|
+
[kNodeOp]?: StructureNode;
|
|
9
|
+
[kNativeAttrs]?: NativeAttrs;
|
|
15
10
|
}
|
|
16
11
|
}
|
|
12
|
+
interface NativeAttrs {
|
|
13
|
+
/** Attributes written on their own, apart from the controllable pair. */
|
|
14
|
+
own: number[] | undefined;
|
|
15
|
+
/** Event handlers the element attaches on its own, in source order. */
|
|
16
|
+
handlers: number[] | undefined;
|
|
17
|
+
/** The `content` attribute rendering in place of a body. */
|
|
18
|
+
content: number | undefined;
|
|
19
|
+
/** Attributes controlling an element state, its change handler second. */
|
|
20
|
+
controllable: Controllable | undefined;
|
|
21
|
+
/** Attributes written as one object with the spreads, in write order. */
|
|
22
|
+
spread: number[] | undefined;
|
|
23
|
+
/** No attribute sets the nonce the page requires of it. */
|
|
24
|
+
nonceUnset: boolean;
|
|
25
|
+
}
|
|
26
|
+
interface Controllable {
|
|
27
|
+
state: "checked" | "checkedValue" | "value" | "open";
|
|
28
|
+
special: boolean;
|
|
29
|
+
valueMode?: "attribute" | "dynamic";
|
|
30
|
+
attrs: (number | undefined)[];
|
|
31
|
+
}
|
|
17
32
|
declare const _default: {
|
|
18
33
|
analyze: {
|
|
19
34
|
enter(this: unknown, tag: t.NodePath<t.MarkoTag>): void;
|
|
@@ -33,4 +48,3 @@ export declare function controllableClaimFor(tagName: string | undefined): "_con
|
|
|
33
48
|
* kind at run time, and a run-time tag name can be any of them. */
|
|
34
49
|
export declare function controllableFeatureFor(tagName: string | undefined): "controllable" | "controllable-input" | "controllable-open" | "controllable-select" | "controllable-textarea" | undefined;
|
|
35
50
|
export declare function enableControllable(feature: DOMRuntimeFeature | undefined): void;
|
|
36
|
-
export declare function isPageElement(tagName: string): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marko",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.1",
|
|
4
4
|
"description": "Optimized runtime for Marko templates.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"magic-string": "^0.30.21"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@marko/runtime-tags": "npm:marko@6.4.
|
|
60
|
+
"@marko/runtime-tags": "npm:marko@6.4.1",
|
|
61
61
|
"marko": "5.39.44"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function discardsWrapperChildren(tagName: string): boolean;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type Section } from "./sections";
|
|
3
|
-
import { type SerializeReason, type SerializeReasons } from "./serialize-reasons";
|
|
4
|
-
export declare function buildGroupMask(groups: {
|
|
5
|
-
value: number | t.Expression | undefined;
|
|
6
|
-
names: string;
|
|
7
|
-
}[]): t.Expression | undefined;
|
|
8
|
-
export declare function getScopeReasonStatement(section: Section): t.Statement;
|
|
9
|
-
export declare function getSerializeGuard(section: Section, reason: undefined | SerializeReason, optional: boolean): t.Expression | undefined;
|
|
10
|
-
export declare function getSerializeGuardForAny(section: Section, reasons: undefined | SerializeReasons, optional: boolean): t.Expression | undefined;
|
|
11
|
-
export declare function getExprIfSerialized<T extends undefined | SerializeReason, R extends (T extends {} ? t.Expression : undefined)>(section: Section, reason: T, expr: t.Expression): R;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { AccessorPrefix, AccessorProp } from "../../common/types";
|
|
3
|
-
import { type Opt, Sorted, type SortedOneMany } from "./optional";
|
|
4
|
-
import { type Binding, type KnownExprs, type ReferencedBindings, type Sources } from "./references";
|
|
5
|
-
import { type ParamSerializeReasonGroups, type Section } from "./sections";
|
|
6
|
-
export type SerializeReasons = SortedOneMany<Sources>;
|
|
7
|
-
export declare const sourcesUtil: Sorted<Sources>;
|
|
8
|
-
export type SerializeReason = Sources;
|
|
9
|
-
export type SerializeKey = symbol & {
|
|
10
|
-
__serialize_key__: 1;
|
|
11
|
-
};
|
|
12
|
-
export declare function isSameReason(a: SerializeReason | undefined, b: SerializeReason | undefined): boolean;
|
|
13
|
-
export declare function isForceSerialized(section: Section, prop?: Binding | AccessorProp | symbol, prefix?: AccessorPrefix | symbol): boolean;
|
|
14
|
-
export declare function addSerializeReason(section: Section, reason: undefined | false | SerializeReason, prop?: Binding | AccessorProp | symbol, prefix?: AccessorPrefix | symbol): void;
|
|
15
|
-
export declare function addSerializeExpr(section: Section, expr: Opt<t.NodeExtra>, prop?: Binding | AccessorProp | symbol, prefix?: AccessorPrefix | symbol): void;
|
|
16
|
-
export declare function addOwnerSerializeReason(from: Section, to: Section, reason: undefined | false | SerializeReason): void;
|
|
17
|
-
export declare function isReasonDynamic(reason: undefined | SerializeReason): reason is Sources & {
|
|
18
|
-
state: undefined;
|
|
19
|
-
forced: undefined;
|
|
20
|
-
};
|
|
21
|
-
export declare function isStaticSerializeReason(reason: undefined | SerializeReason): reason is SerializeReason;
|
|
22
|
-
export declare function isStateSerializeReason(reason: undefined | SerializeReason): reason is Sources;
|
|
23
|
-
export declare function hasSerializeReasons(section: Section | undefined): boolean;
|
|
24
|
-
export declare function getSerializeReason(section: Section, prop?: Binding | AccessorProp | symbol, prefix?: AccessorPrefix | symbol): Sources | undefined;
|
|
25
|
-
export declare function getSerializeSourcesForExpr(expr: t.NodeExtra): Sources | undefined;
|
|
26
|
-
export declare function getSerializeSourcesForExprs(exprs: Opt<t.NodeExtra> | boolean): Sources | undefined;
|
|
27
|
-
export declare function getSerializeSourcesForRef(ref: ReferencedBindings): Sources | undefined;
|
|
28
|
-
export declare function getSerializeSourcesForDownstream({ binding, exprs, properties, }: NonNullable<Section["downstream"]>): Sources | undefined;
|
|
29
|
-
export declare function mapParamReason(program: Section, reason: Sources, exprs: KnownExprs | undefined, ownParams: boolean): SerializeReason | undefined;
|
|
30
|
-
export declare function mergeSerializeReasons(a: SerializeReason, b: undefined | SerializeReason): SerializeReason;
|
|
31
|
-
export declare function mergeSerializeReasons(a: undefined | SerializeReason, b: SerializeReason): SerializeReason;
|
|
32
|
-
export declare function mergeSerializeReasons(a: undefined | SerializeReason, b: undefined | SerializeReason): SerializeReason | undefined;
|
|
33
|
-
export declare function isOwnResumeReason(reason: SerializeReason | undefined): boolean;
|
|
34
|
-
export declare function applySerializeExprs(section: Section): void;
|
|
35
|
-
export declare function finalizeSerializeReason(section: Section): void;
|
|
36
|
-
export declare function getSerializeReasonsVersion(): number;
|
|
37
|
-
export declare function setParamReasonGroups(section: Section, groups: ParamSerializeReasonGroups): void;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type Opt } from "./optional";
|
|
3
|
-
import type { Binding, KnownExprs } from "./references";
|
|
4
|
-
import { type Section } from "./sections";
|
|
5
|
-
export declare function setTagDownstream(tag: t.NodePath<t.MarkoTag>, binding: Opt<Binding>, exprs?: KnownExprs): void;
|
|
6
|
-
export declare function finalizeTagDownstreams(section: Section): void;
|