marko 6.0.130 → 6.0.132
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 +5 -4
- package/dist/debug/dom.mjs +5 -4
- package/dist/debug/html.js +1 -1
- package/dist/debug/html.mjs +1 -1
- package/dist/dom/dom.d.ts +2 -2
- package/dist/dom.js +3 -3
- package/dist/dom.mjs +3 -3
- package/dist/html.js +1 -1
- package/dist/html.mjs +1 -1
- package/dist/translator/core/lifecycle.d.ts +0 -7
- package/dist/translator/index.js +848 -551
- 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 +6 -5
- 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 +1 -1
- 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
|
@@ -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
|
@@ -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/debug/html.js
CHANGED
|
@@ -3320,7 +3320,7 @@ var compat = {
|
|
|
3320
3320
|
if (!compatRegistered) {
|
|
3321
3321
|
const registered = getRegistered(this);
|
|
3322
3322
|
if (registered) {
|
|
3323
|
-
const scopeId = getScopeId(registered.scope);
|
|
3323
|
+
const scopeId = registered.scope ? getScopeId(registered.scope) : void 0;
|
|
3324
3324
|
if (scopeId !== void 0) {
|
|
3325
3325
|
writeScopeToState(state, scopeId, {});
|
|
3326
3326
|
}
|
package/dist/debug/html.mjs
CHANGED
|
@@ -3227,7 +3227,7 @@ var compat = {
|
|
|
3227
3227
|
if (!compatRegistered) {
|
|
3228
3228
|
const registered = getRegistered(this);
|
|
3229
3229
|
if (registered) {
|
|
3230
|
-
const scopeId = getScopeId(registered.scope);
|
|
3230
|
+
const scopeId = registered.scope ? getScopeId(registered.scope) : void 0;
|
|
3231
3231
|
if (scopeId !== void 0) {
|
|
3232
3232
|
writeScopeToState(state, scopeId, {});
|
|
3233
3233
|
}
|
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
|
@@ -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
|
@@ -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;
|
package/dist/html.js
CHANGED
|
@@ -2094,7 +2094,7 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
|
|
|
2094
2094
|
if (!compatRegistered) {
|
|
2095
2095
|
let registered = getRegistered(this);
|
|
2096
2096
|
if (registered) {
|
|
2097
|
-
let scopeId = getScopeId(registered.scope);
|
|
2097
|
+
let scopeId = registered.scope ? getScopeId(registered.scope) : void 0;
|
|
2098
2098
|
scopeId !== void 0 && writeScopeToState(state, scopeId, {}), COMPAT_REGISTRY.set(
|
|
2099
2099
|
this,
|
|
2100
2100
|
compatRegistered = [registered.id, scopeId]
|
package/dist/html.mjs
CHANGED
|
@@ -2004,7 +2004,7 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
|
|
|
2004
2004
|
if (!compatRegistered) {
|
|
2005
2005
|
let registered = getRegistered(this);
|
|
2006
2006
|
if (registered) {
|
|
2007
|
-
let scopeId = getScopeId(registered.scope);
|
|
2007
|
+
let scopeId = registered.scope ? getScopeId(registered.scope) : void 0;
|
|
2008
2008
|
scopeId !== void 0 && writeScopeToState(state, scopeId, {}), COMPAT_REGISTRY.set(
|
|
2009
2009
|
this,
|
|
2010
2010
|
compatRegistered = [registered.id, scopeId]
|
|
@@ -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;
|