marko 6.0.131 → 6.0.133
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/accessor.d.ts +1 -1
- package/dist/common/accessor.debug.d.ts +1 -1
- package/dist/debug/dom.js +6 -5
- package/dist/debug/dom.mjs +6 -5
- package/dist/dom/dom.d.ts +2 -2
- package/dist/dom.js +4 -4
- package/dist/dom.mjs +4 -4
- package/dist/translator/core/lifecycle.d.ts +0 -7
- package/dist/translator/index.js +852 -568
- package/dist/translator/util/binding-has-prop.d.ts +3 -0
- package/dist/translator/util/binding-prop-tree.d.ts +4 -3
- package/dist/translator/util/nested-attribute-tags.d.ts +3 -2
- package/dist/translator/util/references.d.ts +7 -6
- package/dist/translator/util/sections.d.ts +6 -3
- package/dist/translator/util/set-tag-sections-downstream.d.ts +1 -1
- package/dist/translator/util/translate-attrs.d.ts +3 -4
- package/package.json +2 -2
- package/dist/translator/util/binding-has-downstream-expressions.d.ts +0 -2
|
@@ -9,7 +9,7 @@ export declare enum AccessorPrefix {
|
|
|
9
9
|
DynamicHTMLLastChild = "DynamicHTMLLastChild:",
|
|
10
10
|
EventAttributes = "EventAttributes:",
|
|
11
11
|
Getter = "Getter:",
|
|
12
|
-
|
|
12
|
+
Lifecycle = "Lifecycle:",
|
|
13
13
|
Promise = "Promise:",
|
|
14
14
|
TagVariableChange = "TagVariableChange:"
|
|
15
15
|
}
|
package/dist/debug/dom.js
CHANGED
|
@@ -1121,7 +1121,7 @@ function _attr_input_value(scope, nodeAccessor, value, valueChange) {
|
|
|
1121
1121
|
const normalizedValue = normalizeStrProp(value);
|
|
1122
1122
|
scope["ControlledHandler:" /* ControlledHandler */ + nodeAccessor] = valueChange;
|
|
1123
1123
|
if (valueChange) {
|
|
1124
|
-
scope["ControlledType:" /* ControlledType */ + nodeAccessor] =
|
|
1124
|
+
scope["ControlledType:" /* ControlledType */ + nodeAccessor] = 2 /* InputValue */;
|
|
1125
1125
|
scope["ControlledValue:" /* ControlledValue */ + nodeAccessor] = value;
|
|
1126
1126
|
if (el.isConnected) {
|
|
1127
1127
|
setValueAndUpdateSelection(el, normalizedValue);
|
|
@@ -1588,15 +1588,16 @@ function normalizeAttrValue(value) {
|
|
|
1588
1588
|
function normalizeString(value) {
|
|
1589
1589
|
return value || value === 0 ? value + "" : "\u200D";
|
|
1590
1590
|
}
|
|
1591
|
-
function _lifecycle(scope,
|
|
1592
|
-
const
|
|
1591
|
+
function _lifecycle(scope, thisObj, index = 0) {
|
|
1592
|
+
const accessor = "Lifecycle:" /* Lifecycle */ + index;
|
|
1593
|
+
const instance = scope[accessor];
|
|
1593
1594
|
if (instance) {
|
|
1594
1595
|
Object.assign(instance, thisObj);
|
|
1595
1596
|
instance.onUpdate?.();
|
|
1596
1597
|
} else {
|
|
1597
|
-
scope[
|
|
1598
|
+
scope[accessor] = thisObj;
|
|
1598
1599
|
thisObj.onMount?.();
|
|
1599
|
-
$signal(scope,
|
|
1600
|
+
$signal(scope, accessor).onabort = () => thisObj.onDestroy?.();
|
|
1600
1601
|
}
|
|
1601
1602
|
}
|
|
1602
1603
|
function removeChildNodes(startNode, endNode) {
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -1015,7 +1015,7 @@ function _attr_input_value(scope, nodeAccessor, value, valueChange) {
|
|
|
1015
1015
|
const normalizedValue = normalizeStrProp(value);
|
|
1016
1016
|
scope["ControlledHandler:" /* ControlledHandler */ + nodeAccessor] = valueChange;
|
|
1017
1017
|
if (valueChange) {
|
|
1018
|
-
scope["ControlledType:" /* ControlledType */ + nodeAccessor] =
|
|
1018
|
+
scope["ControlledType:" /* ControlledType */ + nodeAccessor] = 2 /* InputValue */;
|
|
1019
1019
|
scope["ControlledValue:" /* ControlledValue */ + nodeAccessor] = value;
|
|
1020
1020
|
if (el.isConnected) {
|
|
1021
1021
|
setValueAndUpdateSelection(el, normalizedValue);
|
|
@@ -1482,15 +1482,16 @@ function normalizeAttrValue(value) {
|
|
|
1482
1482
|
function normalizeString(value) {
|
|
1483
1483
|
return value || value === 0 ? value + "" : "\u200D";
|
|
1484
1484
|
}
|
|
1485
|
-
function _lifecycle(scope,
|
|
1486
|
-
const
|
|
1485
|
+
function _lifecycle(scope, thisObj, index = 0) {
|
|
1486
|
+
const accessor = "Lifecycle:" /* Lifecycle */ + index;
|
|
1487
|
+
const instance = scope[accessor];
|
|
1487
1488
|
if (instance) {
|
|
1488
1489
|
Object.assign(instance, thisObj);
|
|
1489
1490
|
instance.onUpdate?.();
|
|
1490
1491
|
} else {
|
|
1491
|
-
scope[
|
|
1492
|
+
scope[accessor] = thisObj;
|
|
1492
1493
|
thisObj.onMount?.();
|
|
1493
|
-
$signal(scope,
|
|
1494
|
+
$signal(scope, accessor).onabort = () => thisObj.onDestroy?.();
|
|
1494
1495
|
}
|
|
1495
1496
|
}
|
|
1496
1497
|
function removeChildNodes(startNode, endNode) {
|
package/dist/dom/dom.d.ts
CHANGED
|
@@ -21,11 +21,11 @@ export declare function _attrs_script(scope: Scope, nodeAccessor: Accessor): voi
|
|
|
21
21
|
export declare function _html(scope: Scope, value: unknown, accessor: Accessor): void;
|
|
22
22
|
export declare function normalizeClientRender(value: any): Renderer | undefined;
|
|
23
23
|
export declare function normalizeAttrValue(value: unknown): string | undefined;
|
|
24
|
-
export declare function _lifecycle(scope: Scope,
|
|
24
|
+
export declare function _lifecycle(scope: Scope, thisObj: Record<string, unknown> & {
|
|
25
25
|
onMount?: (this: unknown) => void;
|
|
26
26
|
onUpdate?: (this: unknown) => void;
|
|
27
27
|
onDestroy?: (this: unknown) => void;
|
|
28
|
-
}): void;
|
|
28
|
+
}, index?: number): void;
|
|
29
29
|
export declare function removeChildNodes(startNode: ChildNode, endNode: ChildNode): void;
|
|
30
30
|
export declare function insertChildNodes(parentNode: ParentNode, referenceNode: Node | null, startNode: Node, endNode: Node): void;
|
|
31
31
|
export declare function toInsertNode(startNode: Node, endNode: Node): Node;
|
package/dist/dom.js
CHANGED
|
@@ -682,7 +682,7 @@ function _attr_input_checkedValue_script(scope, nodeAccessor) {
|
|
|
682
682
|
}
|
|
683
683
|
function _attr_input_value(scope, nodeAccessor, value, valueChange) {
|
|
684
684
|
let el = scope[nodeAccessor], normalizedValue = normalizeStrProp(value);
|
|
685
|
-
scope["E" /* ControlledHandler */ + nodeAccessor] = valueChange, valueChange ? (scope["F" /* ControlledType */ + nodeAccessor] =
|
|
685
|
+
scope["E" /* ControlledHandler */ + nodeAccessor] = valueChange, valueChange ? (scope["F" /* ControlledType */ + nodeAccessor] = 2 /* InputValue */, scope["G" /* ControlledValue */ + nodeAccessor] = value, el.isConnected ? setValueAndUpdateSelection(el, normalizedValue) : el.defaultValue = normalizedValue) : (scope["F" /* ControlledType */ + nodeAccessor] = 5 /* None */, el.defaultValue = normalizedValue);
|
|
686
686
|
}
|
|
687
687
|
function _attr_input_value_script(scope, nodeAccessor) {
|
|
688
688
|
let el = scope[nodeAccessor];
|
|
@@ -1013,9 +1013,9 @@ function normalizeAttrValue(value) {
|
|
|
1013
1013
|
function normalizeString(value) {
|
|
1014
1014
|
return value || value === 0 ? value + "" : "\u200D";
|
|
1015
1015
|
}
|
|
1016
|
-
function _lifecycle(scope,
|
|
1017
|
-
let instance = scope[
|
|
1018
|
-
instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[
|
|
1016
|
+
function _lifecycle(scope, thisObj, index = 0) {
|
|
1017
|
+
let accessor = "K" /* Lifecycle */ + index, instance = scope[accessor];
|
|
1018
|
+
instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[accessor] = thisObj, thisObj.onMount?.(), $signal(scope, accessor).onabort = () => thisObj.onDestroy?.());
|
|
1019
1019
|
}
|
|
1020
1020
|
function removeChildNodes(startNode, endNode) {
|
|
1021
1021
|
let stop = endNode.nextSibling, current = startNode;
|
package/dist/dom.mjs
CHANGED
|
@@ -579,7 +579,7 @@ function _attr_input_checkedValue_script(scope, nodeAccessor) {
|
|
|
579
579
|
}
|
|
580
580
|
function _attr_input_value(scope, nodeAccessor, value, valueChange) {
|
|
581
581
|
let el = scope[nodeAccessor], normalizedValue = normalizeStrProp(value);
|
|
582
|
-
scope["E" /* ControlledHandler */ + nodeAccessor] = valueChange, valueChange ? (scope["F" /* ControlledType */ + nodeAccessor] =
|
|
582
|
+
scope["E" /* ControlledHandler */ + nodeAccessor] = valueChange, valueChange ? (scope["F" /* ControlledType */ + nodeAccessor] = 2 /* InputValue */, scope["G" /* ControlledValue */ + nodeAccessor] = value, el.isConnected ? setValueAndUpdateSelection(el, normalizedValue) : el.defaultValue = normalizedValue) : (scope["F" /* ControlledType */ + nodeAccessor] = 5 /* None */, el.defaultValue = normalizedValue);
|
|
583
583
|
}
|
|
584
584
|
function _attr_input_value_script(scope, nodeAccessor) {
|
|
585
585
|
let el = scope[nodeAccessor];
|
|
@@ -910,9 +910,9 @@ function normalizeAttrValue(value) {
|
|
|
910
910
|
function normalizeString(value) {
|
|
911
911
|
return value || value === 0 ? value + "" : "\u200D";
|
|
912
912
|
}
|
|
913
|
-
function _lifecycle(scope,
|
|
914
|
-
let instance = scope[
|
|
915
|
-
instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[
|
|
913
|
+
function _lifecycle(scope, thisObj, index = 0) {
|
|
914
|
+
let accessor = "K" /* Lifecycle */ + index, instance = scope[accessor];
|
|
915
|
+
instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[accessor] = thisObj, thisObj.onMount?.(), $signal(scope, accessor).onabort = () => thisObj.onDestroy?.());
|
|
916
916
|
}
|
|
917
917
|
function removeChildNodes(startNode, endNode) {
|
|
918
918
|
let stop = endNode.nextSibling, current = startNode;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
import { type Tag } from "@marko/compiler/babel-utils";
|
|
2
|
-
import { type Binding } from "../util/references";
|
|
3
|
-
declare const kRef: unique symbol;
|
|
4
|
-
declare module "@marko/compiler/dist/types" {
|
|
5
|
-
interface MarkoTagExtra {
|
|
6
|
-
[kRef]?: Binding;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
2
|
declare const _default: Tag;
|
|
10
3
|
export default _default;
|