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.
@@ -9,7 +9,7 @@ export declare enum AccessorPrefix {
9
9
  DynamicHTMLLastChild = "H",
10
10
  EventAttributes = "I",
11
11
  Getter = "J",
12
- LifecycleAbortController = "K",
12
+ Lifecycle = "K",
13
13
  Promise = "L",
14
14
  TagVariableChange = "M"
15
15
  }
@@ -9,7 +9,7 @@ export declare enum AccessorPrefix {
9
9
  DynamicHTMLLastChild = "DynamicHTMLLastChild:",
10
10
  EventAttributes = "EventAttributes:",
11
11
  Getter = "Getter:",
12
- LifecycleAbortController = "LifecycleAbortController:",
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, index, thisObj) {
1592
- const instance = scope[index];
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[index] = thisObj;
1598
+ scope[accessor] = thisObj;
1598
1599
  thisObj.onMount?.();
1599
- $signal(scope, "LifecycleAbortController:" /* LifecycleAbortController */ + index).onabort = () => thisObj.onDestroy?.();
1600
+ $signal(scope, accessor).onabort = () => thisObj.onDestroy?.();
1600
1601
  }
1601
1602
  }
1602
1603
  function removeChildNodes(startNode, endNode) {
@@ -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, index, thisObj) {
1486
- const instance = scope[index];
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[index] = thisObj;
1492
+ scope[accessor] = thisObj;
1492
1493
  thisObj.onMount?.();
1493
- $signal(scope, "LifecycleAbortController:" /* LifecycleAbortController */ + index).onabort = () => thisObj.onDestroy?.();
1494
+ $signal(scope, accessor).onabort = () => thisObj.onDestroy?.();
1494
1495
  }
1495
1496
  }
1496
1497
  function removeChildNodes(startNode, endNode) {
@@ -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
  }
@@ -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, index: string | number, thisObj: Record<string, unknown> & {
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, index, thisObj) {
1017
- let instance = scope[index];
1018
- instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[index] = thisObj, thisObj.onMount?.(), $signal(scope, "K" /* LifecycleAbortController */ + index).onabort = () => thisObj.onDestroy?.());
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, index, thisObj) {
914
- let instance = scope[index];
915
- instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[index] = thisObj, thisObj.onMount?.(), $signal(scope, "K" /* LifecycleAbortController */ + index).onabort = () => thisObj.onDestroy?.());
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;