marko 6.0.60 → 6.0.62

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.
@@ -1,18 +1,18 @@
1
1
  import { type Accessor } from "../common/types";
2
- export declare function classAttr(value: unknown): string;
3
- export declare function styleAttr(value: unknown): string;
4
- export declare function optionValueAttr(value: unknown): string;
5
- export declare function controllable_select_value(scopeId: number, nodeAccessor: Accessor, value: unknown, valueChange: unknown, content?: () => void): void;
6
- export declare function controllable_textarea_value(scopeId: number, nodeAccessor: Accessor, value: unknown, valueChange: unknown): string;
7
- export declare function controllable_input_value(scopeId: number, nodeAccessor: Accessor, value: unknown, valueChange: unknown): string;
8
- export declare function controllable_input_checked(scopeId: number, nodeAccessor: Accessor, checked: unknown, checkedChange: unknown): string;
9
- export declare function controllable_input_checkedValue(scopeId: number, nodeAccessor: Accessor, checkedValue: unknown, checkedValueChange: unknown, value: unknown): string;
10
- export declare function controllable_detailsOrDialog_open(scopeId: number, nodeAccessor: Accessor, open: unknown, openChange: unknown): string;
11
- export declare function attr(name: string, value: unknown): string;
12
- export declare function attrs(data: Record<string, unknown>, nodeAccessor: Accessor, scopeId: number, tagName: string): string;
13
- export declare function writeAttrsAndContent(data: Record<string, unknown>, nodeAccessor: Accessor, scopeId: number, tagName: string, serializeReason?: 1 | 0): void;
14
- export declare function partialAttrs(data: Record<string, unknown>, skip: Record<string, 1>, nodeAccessor: Accessor, scopeId: number, tagName: string): string;
15
- export declare function writePartialAttrsAndContent(data: Record<string, unknown>, skip: Record<string, 1>, nodeAccessor: Accessor, scopeId: number, tagName: string, serializeReason?: 1 | 0): void;
2
+ export declare function _attr_class(value: unknown): string;
3
+ export declare function _attr_style(value: unknown): string;
4
+ export declare function _attr_option_value(value: unknown): string;
5
+ export declare function _attr_select_value(scopeId: number, nodeAccessor: Accessor, value: unknown, valueChange: unknown, content?: () => void): void;
6
+ export declare function _attr_textarea_value(scopeId: number, nodeAccessor: Accessor, value: unknown, valueChange: unknown): string;
7
+ export declare function _attr_input_value(scopeId: number, nodeAccessor: Accessor, value: unknown, valueChange: unknown): string;
8
+ export declare function _attr_input_checked(scopeId: number, nodeAccessor: Accessor, checked: unknown, checkedChange: unknown): string;
9
+ export declare function _attr_input_checkedValue(scopeId: number, nodeAccessor: Accessor, checkedValue: unknown, checkedValueChange: unknown, value: unknown): string;
10
+ export declare function _attr_details_or_dialog_open(scopeId: number, nodeAccessor: Accessor, open: unknown, openChange: unknown): string;
11
+ export declare function _attr(name: string, value: unknown): string;
12
+ export declare function _attrs(data: Record<string, unknown>, nodeAccessor: Accessor, scopeId: number, tagName: string): string;
13
+ export declare function _attrs_content(data: Record<string, unknown>, nodeAccessor: Accessor, scopeId: number, tagName: string, serializeReason?: 1 | 0): void;
14
+ export declare function _attrs_partial(data: Record<string, unknown>, skip: Record<string, 1>, nodeAccessor: Accessor, scopeId: number, tagName: string): string;
15
+ export declare function _attrs_partial_content(data: Record<string, unknown>, skip: Record<string, 1>, nodeAccessor: Accessor, scopeId: number, tagName: string, serializeReason?: 1 | 0): void;
16
16
  export declare function attrAssignment(value: string): string;
17
17
  export declare function escapeSingleQuotedAttrValue(value: string): string;
18
18
  export declare function escapeDoubleQuotedAttrValue(value: string): string;
@@ -1,13 +1,13 @@
1
1
  import { patchDynamicTag } from "./dynamic-tag";
2
2
  import { type ServerRenderer } from "./template";
3
- import { $global, Chunk, fork, isInResumedBranch, nextScopeId, peekNextScopeId, State, write, writeScript } from "./writer";
3
+ import { _await, _html, _peek_scope_id, _scope_id, $global, Chunk, isInResumedBranch, State, writeScript } from "./writer";
4
4
  export declare const compat: {
5
5
  $global: typeof $global;
6
- fork: typeof fork;
7
- write: typeof write;
6
+ fork: typeof _await;
7
+ write: typeof _html;
8
8
  writeScript: typeof writeScript;
9
- nextScopeId: typeof nextScopeId;
10
- peekNextScopeId: typeof peekNextScopeId;
9
+ nextScopeId: typeof _scope_id;
10
+ peekNextScopeId: typeof _peek_scope_id;
11
11
  isInResumedBranch: typeof isInResumedBranch;
12
12
  ensureState($global: any): State;
13
13
  isTagsAPI(fn: any): boolean;
@@ -1,5 +1,5 @@
1
- export declare function toString(val: unknown): string;
2
- export declare function escapeXML(val: unknown): string;
1
+ export declare function _unescaped(val: unknown): string;
2
+ export declare function _escape(val: unknown): string;
3
3
  export declare function escapeTextAreaValue(val: unknown): string;
4
- export declare function escapeScript(val: unknown): string;
5
- export declare function escapeStyle(val: unknown): string;
4
+ export declare function _escape_script(val: unknown): string;
5
+ export declare function _escape_style(val: unknown): string;
@@ -4,8 +4,8 @@ interface BodyContentObject {
4
4
  [x: PropertyKey]: unknown;
5
5
  content: ServerRenderer;
6
6
  }
7
- export declare let dynamicTag: (scopeId: number, accessor: Accessor, tag: unknown | string | ServerRenderer | BodyContentObject, inputOrArgs: unknown, content?: (() => void) | 0, inputIsArgs?: 1, serializeReason?: 1 | 0) => unknown;
8
- export declare function createContent(id: string, fn: ServerRenderer): ServerRenderer;
9
- export declare function registerContent(id: string, fn: ServerRenderer, scopeId?: number): ServerRenderer;
7
+ export declare let _dynamic_tag: (scopeId: number, accessor: Accessor, tag: unknown | string | ServerRenderer | BodyContentObject, inputOrArgs: unknown, content?: (() => void) | 0, inputIsArgs?: 1, serializeReason?: 1 | 0) => unknown;
8
+ export declare function _content(id: string, fn: ServerRenderer): ServerRenderer;
9
+ export declare function _content_resume(id: string, fn: ServerRenderer, scopeId?: number): ServerRenderer;
10
10
  export declare function patchDynamicTag(patch: (scopeId: number, accessor: Accessor, tag: unknown | string | ServerRenderer | BodyContentObject) => unknown): void;
11
11
  export {};
@@ -2,5 +2,5 @@ import type { Template } from "../common/types";
2
2
  export type ServerRenderer = ((...args: unknown[]) => unknown) & {
3
3
  ___id?: string;
4
4
  };
5
- export declare const createTemplate: (templateId: string, renderer: ServerRenderer) => Template;
5
+ export declare const _template: (templateId: string, renderer: ServerRenderer) => Template;
6
6
  export declare function isTemplate(renderer: ServerRenderer | Template): renderer is ServerRenderer & Template;
@@ -15,45 +15,45 @@ export declare function getChunk(): Chunk | undefined;
15
15
  export declare function getContext(key: keyof NonNullable<Chunk["context"]>): unknown;
16
16
  export declare function getState(): State;
17
17
  export declare function getScopeId(scope: unknown): number | undefined;
18
- export declare function write(html: string): void;
18
+ export declare function _html(html: string): void;
19
19
  export declare function writeScript(script: string): void;
20
- export declare function writeEffect(scopeId: number, registryId: string): void;
21
- export declare function writeContent(nodeAccessor: Accessor, scopeId: number, content: unknown, serializeReason?: 1 | 0): void;
20
+ export declare function _script(scopeId: number, registryId: string): void;
21
+ export declare function _attr_content(nodeAccessor: Accessor, scopeId: number, content: unknown, serializeReason?: 1 | 0): void;
22
22
  export declare function normalizeServerRender(value: unknown): ServerRenderer | undefined;
23
23
  export declare function withContext<T>(key: PropertyKey, value: unknown, cb: () => T): T;
24
- export declare function setTagVar(parentScopeId: number, scopeOffsetAccessor: Accessor, childScopeId: number, registryId: string): void;
25
- export declare function register<T extends WeakKey>(val: T, id: string, scopeId?: number): T;
26
- export declare function nextTagId(): string;
27
- export declare function nextScopeId(): number;
28
- export declare function peekNextScopeId(): number;
24
+ export declare function _var(parentScopeId: number, scopeOffsetAccessor: Accessor, childScopeId: number, registryId: string): void;
25
+ export declare function _resume<T extends WeakKey>(val: T, id: string, scopeId?: number): T;
26
+ export declare function _id(): string;
27
+ export declare function _scope_id(): number;
28
+ export declare function _peek_scope_id(): number;
29
29
  export declare function getScopeById(scopeId: number | undefined): PartialScope | undefined;
30
- export declare function serializeIf(condition: undefined | 1 | Record<string, 1>, key: string): 1 | undefined;
31
- export declare function serializeGuard(condition: undefined | 1 | Record<string, 1>, key: string): 0 | 1;
32
- export declare function markResumeNode(scopeId: number, accessor: Accessor, shouldResume?: 0 | 1): string;
33
- export declare function commentSeparator(shouldResume: 0 | 1): "" | "<!>";
34
- export declare function nodeRef(scopeId: number, id?: string): () => void;
35
- export declare function hoist(scopeId: number, id?: string): {
30
+ export declare function _serialize_if(condition: undefined | 1 | Record<string, 1>, key: string): 1 | undefined;
31
+ export declare function _serialize_guard(condition: undefined | 1 | Record<string, 1>, key: string): 0 | 1;
32
+ export declare function _el_resume(scopeId: number, accessor: Accessor, shouldResume?: 0 | 1): string;
33
+ export declare function _sep(shouldResume: 0 | 1): "" | "<!>";
34
+ export declare function _el(scopeId: number, id?: string): () => void;
35
+ export declare function _hoist(scopeId: number, id?: string): {
36
36
  (): void;
37
37
  [Symbol.iterator]: /*elided*/ any;
38
38
  };
39
- export declare function resumeClosestBranch(scopeId: number): void;
39
+ export declare function _resume_branch(scopeId: number): void;
40
40
  export declare function isInResumedBranch(): boolean;
41
41
  export declare function withBranchId<T>(branchId: number, cb: () => T): T;
42
- export declare function resumeForOf(list: Falsy | Iterable<unknown>, cb: (item: unknown, index: number) => void, by: Falsy | ((item: unknown, index: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
43
- export declare function resumeForIn(obj: Falsy | {}, cb: (key: string, value: unknown) => void, by: Falsy | ((key: string, v: unknown) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
44
- export declare function resumeForTo(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
45
- export declare function resumeConditional(cb: () => void | number, scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
42
+ 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, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
43
+ export declare function _for_in(obj: Falsy | {}, cb: (key: string, value: unknown) => void, by: Falsy | ((key: string, v: unknown) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
44
+ 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, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
45
+ export declare function _if(cb: () => void | number, scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
46
46
  declare let writeScope: (scopeId: number, partialScope: PartialScope) => ScopeInternals;
47
47
  export declare function writeScopeToState(state: State, scopeId: number, partialScope: PartialScope): ScopeInternals;
48
- export { writeScope };
49
- export declare function writeExistingScope(scopeId: number): ScopeInternals;
50
- export declare function ensureScopeWithId(scopeId: number): PartialScope;
48
+ export { writeScope as _scope };
49
+ export declare function _existing_scope(scopeId: number): ScopeInternals;
50
+ export declare function _scope_with_id(scopeId: number): PartialScope;
51
51
  export declare function $global(): $Global & {
52
52
  renderId: string;
53
53
  runtimeId: string;
54
54
  };
55
- export declare function fork<T>(scopeId: number, accessor: Accessor, promise: Promise<T> | T, content: (value: T) => void, serializeMarker?: 0 | 1): void;
56
- export declare function tryContent(scopeId: number, accessor: Accessor, content: () => void, input: {
55
+ export declare function _await<T>(scopeId: number, accessor: Accessor, promise: Promise<T> | T, content: (value: T) => void, serializeMarker?: 0 | 1): void;
56
+ export declare function _try(scopeId: number, accessor: Accessor, content: () => void, input: {
57
57
  placeholder?: {
58
58
  content?(): void;
59
59
  };
@@ -127,8 +127,8 @@ export declare class Chunk {
127
127
  flushScript(): this;
128
128
  flushHTML(): string;
129
129
  }
130
- export declare function writeTrailers(html: string): void;
130
+ export declare function _trailers(html: string): void;
131
131
  type QueueCallback = (ticked: true) => void;
132
132
  export declare function queueTick(cb: QueueCallback): void;
133
133
  export declare function offTick(cb: QueueCallback): void;
134
- export declare function writeSubscribe(subscribers: Set<ScopeInternals>, scope: ScopeInternals): ScopeInternals;
134
+ export declare function _subscribe(subscribers: Set<ScopeInternals>, scope: ScopeInternals): ScopeInternals;
package/dist/html.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  export { attrTag, attrTags } from "./common/attr-tag";
2
- export { attr, attrs, classAttr, controllable_detailsOrDialog_open, controllable_input_checked, controllable_input_checkedValue, controllable_input_value, controllable_select_value, controllable_textarea_value, optionValueAttr, partialAttrs, styleAttr, writeAttrsAndContent, writePartialAttrsAndContent, } from "./html/attrs";
2
+ export { _attr, _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_option_value, _attr_select_value, _attr_style, _attr_textarea_value, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, } from "./html/attrs";
3
3
  export { compat } from "./html/compat";
4
- export { escapeScript, escapeStyle, escapeXML, toString } from "./html/content";
5
- export { createContent, dynamicTag, registerContent } from "./html/dynamic-tag";
4
+ export { _escape, _escape_script, _escape_style, _unescaped, } from "./html/content";
5
+ export { _content, _content_resume, _dynamic_tag } from "./html/dynamic-tag";
6
6
  export { forIn, forInBy, forOf, forOfBy, forTo, forToBy } from "./html/for";
7
- export { createTemplate } from "./html/template";
8
- export { $global, commentSeparator, ensureScopeWithId, fork, getScopeById, hoist, markResumeNode, nextScopeId, nextTagId, nodeRef, peekNextScopeId, register, resumeClosestBranch, resumeConditional, resumeForIn, resumeForOf, resumeForTo, serializeGuard, serializeIf, setTagVar, tryContent, write, writeContent, writeEffect, writeExistingScope, writeScope, writeSubscribe, writeTrailers, } from "./html/writer";
7
+ export { _template } from "./html/template";
8
+ export { _attr_content, _await, _el, _el_resume, _existing_scope, _for_in, _for_of, _for_to, _hoist, _html, _id, _if, _peek_scope_id, _resume, _resume_branch, _scope, _scope_id, _scope_with_id, _script, _sep, _serialize_guard, _serialize_if, _subscribe, _trailers, _try, _var, $global, } from "./html/writer";