marko 6.3.24 → 6.3.26
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/constants/accessor-prefix.d.ts +1 -0
- package/dist/common/constants/accessor-prefix.debug.d.ts +1 -0
- package/dist/common/constants/walk-range-size.d.ts +1 -1
- package/dist/debug/dom.js +375 -339
- package/dist/debug/dom.mjs +367 -340
- package/dist/debug/html.js +9 -3
- package/dist/debug/html.mjs +9 -3
- package/dist/dom/controllable.d.ts +22 -1
- package/dist/dom/dom.d.ts +5 -4
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +258 -249
- package/dist/dom.mjs +257 -248
- package/dist/html.js +8 -3
- package/dist/html.mjs +8 -3
- package/dist/translator/index.js +158 -36
- package/dist/translator/util/translate-attrs.d.ts +2 -0
- package/dist/translator/util/walks.d.ts +3 -0
- package/dist/translator/visitors/tag/native-tag.d.ts +10 -0
- package/package.json +4 -4
package/dist/debug/html.js
CHANGED
|
@@ -1366,13 +1366,18 @@ function writeGenerator(state, iter, ref) {
|
|
|
1366
1366
|
state.buf.push("(function*(){})()");
|
|
1367
1367
|
return true;
|
|
1368
1368
|
}
|
|
1369
|
-
|
|
1369
|
+
const heldReturn = returnValue !== void 0 && isAncestorMember(state, ref, returnValue);
|
|
1370
|
+
state.buf.push(returnValue === void 0 ? "(function*(a){yield*a})(" : heldReturn ? "(function*(a,r){yield*a;return r.v})(" : "(function*(a,r){yield*a;return r})(");
|
|
1370
1371
|
if (needsId) {
|
|
1371
1372
|
const arrayRef = new Reference(ref, null, state.flush, null, nextRefAccess(state));
|
|
1372
1373
|
state.buf.push(arrayRef.id + "=");
|
|
1373
1374
|
writeArray(state, yields, arrayRef);
|
|
1374
1375
|
} else writeArray(state, yields, new Reference(ref, null, state.flush, state.buf.length));
|
|
1375
|
-
if (
|
|
1376
|
+
if (heldReturn) {
|
|
1377
|
+
const holder = new Reference(ref, null, state.flush, null, nextRefAccess(state));
|
|
1378
|
+
state.buf.push("," + holder.id + "={}");
|
|
1379
|
+
writeProp(state, returnValue, holder, "v");
|
|
1380
|
+
} else if (returnValue !== void 0) {
|
|
1376
1381
|
const sepIndex = state.buf.push(",") - 1;
|
|
1377
1382
|
if (writeProp(state, returnValue, ref, "") && isDedupedMember(returnValue)) {
|
|
1378
1383
|
const retRef = typeof returnValue === "string" ? state.strs.get(returnValue) : state.refs.get(returnValue);
|
|
@@ -2763,7 +2768,8 @@ function _attr_textarea_value(scopeId, nodeAccessor, value, valueChange, seriali
|
|
|
2763
2768
|
return _textarea_value(value);
|
|
2764
2769
|
}
|
|
2765
2770
|
function _textarea_value(value) {
|
|
2766
|
-
|
|
2771
|
+
const escaped = _escape(normalizeStrAttrValue(value));
|
|
2772
|
+
return escaped[0] === "\n" || escaped[0] === "\r" ? "\n" + escaped : escaped;
|
|
2767
2773
|
}
|
|
2768
2774
|
function _attr_input_value(scopeId, nodeAccessor, value, valueChange, serializeType) {
|
|
2769
2775
|
if (valueChange) writeControlledScope(2, scopeId, nodeAccessor, void 0, valueChange, serializeType);
|
package/dist/debug/html.mjs
CHANGED
|
@@ -1364,13 +1364,18 @@ function writeGenerator(state, iter, ref) {
|
|
|
1364
1364
|
state.buf.push("(function*(){})()");
|
|
1365
1365
|
return true;
|
|
1366
1366
|
}
|
|
1367
|
-
|
|
1367
|
+
const heldReturn = returnValue !== void 0 && isAncestorMember(state, ref, returnValue);
|
|
1368
|
+
state.buf.push(returnValue === void 0 ? "(function*(a){yield*a})(" : heldReturn ? "(function*(a,r){yield*a;return r.v})(" : "(function*(a,r){yield*a;return r})(");
|
|
1368
1369
|
if (needsId) {
|
|
1369
1370
|
const arrayRef = new Reference(ref, null, state.flush, null, nextRefAccess(state));
|
|
1370
1371
|
state.buf.push(arrayRef.id + "=");
|
|
1371
1372
|
writeArray(state, yields, arrayRef);
|
|
1372
1373
|
} else writeArray(state, yields, new Reference(ref, null, state.flush, state.buf.length));
|
|
1373
|
-
if (
|
|
1374
|
+
if (heldReturn) {
|
|
1375
|
+
const holder = new Reference(ref, null, state.flush, null, nextRefAccess(state));
|
|
1376
|
+
state.buf.push("," + holder.id + "={}");
|
|
1377
|
+
writeProp(state, returnValue, holder, "v");
|
|
1378
|
+
} else if (returnValue !== void 0) {
|
|
1374
1379
|
const sepIndex = state.buf.push(",") - 1;
|
|
1375
1380
|
if (writeProp(state, returnValue, ref, "") && isDedupedMember(returnValue)) {
|
|
1376
1381
|
const retRef = typeof returnValue === "string" ? state.strs.get(returnValue) : state.refs.get(returnValue);
|
|
@@ -2761,7 +2766,8 @@ function _attr_textarea_value(scopeId, nodeAccessor, value, valueChange, seriali
|
|
|
2761
2766
|
return _textarea_value(value);
|
|
2762
2767
|
}
|
|
2763
2768
|
function _textarea_value(value) {
|
|
2764
|
-
|
|
2769
|
+
const escaped = _escape(normalizeStrAttrValue(value));
|
|
2770
|
+
return escaped[0] === "\n" || escaped[0] === "\r" ? "\n" + escaped : escaped;
|
|
2765
2771
|
}
|
|
2766
2772
|
function _attr_input_value(scopeId, nodeAccessor, value, valueChange, serializeType) {
|
|
2767
2773
|
if (valueChange) writeControlledScope(2, scopeId, nodeAccessor, void 0, valueChange, serializeType);
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
import { type Accessor, type Scope } from "../common/types";
|
|
1
|
+
import { type Accessor, ControlledType, type Scope } from "../common/types";
|
|
2
2
|
export declare function _attr_input_checked_default(scope: Scope, nodeAccessor: Accessor, checked: boolean): void;
|
|
3
|
+
/** Filled by the latches a compiled page emits, so a page carries only the
|
|
4
|
+
* control kinds its tags can be (`_attrs_script` resolves the kind at run time). */
|
|
5
|
+
export declare const controllableScripts: {
|
|
6
|
+
[T in ControlledType]?: (scope: Scope, nodeAccessor: Accessor) => void;
|
|
7
|
+
};
|
|
8
|
+
/** The render pass equivalent, for a tag whose name is only known at run time;
|
|
9
|
+
* a statically named tag passes its claim to `_attrs` instead. */
|
|
10
|
+
export declare const controllableRenders: {
|
|
11
|
+
[tagName: string]: ControllableAttrs;
|
|
12
|
+
};
|
|
13
|
+
export type ControllableAttrs = (scope: Scope, nodeAccessor: Accessor, nextAttrs: Record<string, unknown>) => RegExp | void;
|
|
14
|
+
export declare function _enable_controllable_input(): void;
|
|
15
|
+
export declare function _enable_controllable_textarea(): void;
|
|
16
|
+
export declare function _enable_controllable_select(): void;
|
|
17
|
+
export declare function _enable_controllable_open(): void;
|
|
18
|
+
/** A run-time tag name can be any controllable, so its page enables them all. */
|
|
19
|
+
export declare function _enable_controllable(): void;
|
|
3
20
|
export declare function _attr_input_checked(scope: Scope, nodeAccessor: Accessor, checked: unknown, checkedChange: unknown): void;
|
|
4
21
|
export declare function _attr_input_checked_script(scope: Scope, nodeAccessor: Accessor): void;
|
|
5
22
|
export declare function _attr_input_checkedValue_default(scope: Scope, nodeAccessor: Accessor, checkedValue: unknown, value: unknown): void;
|
|
@@ -16,3 +33,7 @@ export declare function _attr_select_value_script(scope: Scope, nodeAccessor: Ac
|
|
|
16
33
|
export declare function _attr_details_or_dialog_open_default(scope: Scope, nodeAccessor: Accessor, open: unknown): void;
|
|
17
34
|
export declare function _attr_details_or_dialog_open(scope: Scope, nodeAccessor: Accessor, open: unknown, openChange: unknown): void;
|
|
18
35
|
export declare function _attr_details_or_dialog_open_script(scope: Scope, nodeAccessor: Accessor): void;
|
|
36
|
+
export declare function _controllable_input(scope: Scope, nodeAccessor: Accessor, nextAttrs: Record<string, unknown>): RegExp | undefined;
|
|
37
|
+
export declare function _controllable_textarea(scope: Scope, nodeAccessor: Accessor, nextAttrs: Record<string, unknown>, dynamicDefault?: typeof _attr_input_value_dynamic_default): RegExp | undefined;
|
|
38
|
+
export declare function _controllable_select(scope: Scope, nodeAccessor: Accessor, nextAttrs: Record<string, unknown>): RegExp | undefined;
|
|
39
|
+
export declare function _controllable_open(scope: Scope, nodeAccessor: Accessor, nextAttrs: Record<string, unknown>): RegExp | undefined;
|
package/dist/dom/dom.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Accessor, type Scope } from "../common/types";
|
|
2
|
+
import { type ControllableAttrs } from "./controllable";
|
|
2
3
|
export declare function _to_text(value: unknown): string;
|
|
3
4
|
export declare function _attr(element: Element, name: string, value: unknown): void;
|
|
4
5
|
export declare function _attr_class(element: Element, value: unknown): void;
|
|
@@ -12,10 +13,10 @@ export declare function _style_rule_item(element: HTMLStyleElement, name: string
|
|
|
12
13
|
export declare function _attr_nonce(scope: Scope, nodeAccessor: Accessor): void;
|
|
13
14
|
export declare function _text(node: Text | Comment, value: unknown): void;
|
|
14
15
|
export declare function _text_content(node: ParentNode, value: unknown): void;
|
|
15
|
-
export declare function _attrs(scope: Scope, nodeAccessor: Accessor, nextAttrs: Record<string, unknown
|
|
16
|
-
export declare function _attrs_content(scope: Scope, nodeAccessor: Accessor, nextAttrs: Record<string, unknown
|
|
17
|
-
export declare function _attrs_partial(scope: Scope, nodeAccessor: Accessor, nextAttrs: Record<string, unknown>, skip: Record<string, 1
|
|
18
|
-
export declare function _attrs_partial_content(scope: Scope, nodeAccessor: Accessor, nextAttrs: Record<string, unknown>, skip: Record<string, 1
|
|
16
|
+
export declare function _attrs(scope: Scope, nodeAccessor: Accessor, nextAttrs: Record<string, unknown>, controllable?: ControllableAttrs): void;
|
|
17
|
+
export declare function _attrs_content(scope: Scope, nodeAccessor: Accessor, nextAttrs: Record<string, unknown>, controllable?: ControllableAttrs): void;
|
|
18
|
+
export declare function _attrs_partial(scope: Scope, nodeAccessor: Accessor, nextAttrs: Record<string, unknown>, skip: Record<string, 1>, controllable?: ControllableAttrs): void;
|
|
19
|
+
export declare function _attrs_partial_content(scope: Scope, nodeAccessor: Accessor, nextAttrs: Record<string, unknown>, skip: Record<string, 1>, controllable?: ControllableAttrs): void;
|
|
19
20
|
export declare function _attr_content(scope: Scope, nodeAccessor: Accessor, value: unknown): void;
|
|
20
21
|
export declare function _attrs_script(scope: Scope, nodeAccessor: Accessor): void;
|
|
21
22
|
export declare function _html(scope: Scope, value: unknown, accessor: Accessor): void;
|
package/dist/dom.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { _call } from "./common/helpers";
|
|
|
5
5
|
export { $signal, $signalReset } from "./dom/abort-signal";
|
|
6
6
|
export { compat } from "./dom/compat";
|
|
7
7
|
export { _await_content, _await_promise, _dynamic_tag, _dynamic_tag_content, _for_in, _for_of, _for_to, _for_until, _if, _resume_dynamic_tag, _show, _try, } from "./dom/control-flow";
|
|
8
|
-
export { _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checked_default, _attr_input_checked_script, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_input_value as _attr_textarea_value, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_script as _attr_textarea_value_script, } from "./dom/controllable";
|
|
8
|
+
export { _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checked_default, _attr_input_checked_script, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_input_value as _attr_textarea_value, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_script as _attr_textarea_value_script, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, _enable_controllable, _enable_controllable_input, _enable_controllable_open, _enable_controllable_select, _enable_controllable_textarea, } from "./dom/controllable";
|
|
9
9
|
export { _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_content, _attr_nonce, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _html, _lifecycle, _style_rule_item, _style_shell, _text, _text_content, _to_text, } from "./dom/dom";
|
|
10
10
|
export { _on } from "./dom/event";
|
|
11
11
|
export { _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, } from "./dom/load";
|