cotomy 1.0.2 → 1.0.3

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/README.md CHANGED
@@ -50,7 +50,8 @@ The View layer provides thin wrappers around DOM elements and window events.
50
50
  - Identity & matching
51
51
  - `instanceId: string` — Always returns the element's `data-cotomy-instance` (generated when missing, respects existing values)
52
52
  - `id: string | null | undefined`
53
- - `attached: boolean` — True when the element is connected to a document
53
+ - `attached: boolean` — True when the element belongs to the current window document
54
+ - `isConnected: boolean` — True when the element is connected to any document tree (Node.isConnected)
54
55
  - `generateId(prefix = "__cotomy_elem__"): this`
55
56
  - `is(selector: string): boolean` — Parent-aware matching helper
56
57
  - `empty: boolean` — True for tags that cannot have children or have no content
@@ -1113,6 +1113,9 @@ class CotomyElement {
1113
1113
  || this._element.innerHTML.trim() === "";
1114
1114
  }
1115
1115
  get attached() {
1116
+ return document.contains(this.element);
1117
+ }
1118
+ get isConnected() {
1116
1119
  return this.element.isConnected;
1117
1120
  }
1118
1121
  get readonly() {