cotomy 0.3.11 → 0.3.12
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 +1 -1
- package/dist/browser/cotomy.js +4 -1
- package/dist/browser/cotomy.js.map +1 -1
- package/dist/browser/cotomy.min.js +1 -1
- package/dist/browser/cotomy.min.js.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/view.js +4 -1
- package/dist/esm/view.js.map +1 -1
- package/dist/types/view.d.ts +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ The View layer provides thin wrappers around DOM elements and window events.
|
|
|
48
48
|
- `CotomyElement.byId(id, type?)`
|
|
49
49
|
- `CotomyElement.empty(type?)` — Creates a hidden placeholder element
|
|
50
50
|
- Identity & matching
|
|
51
|
-
- `instanceId: string
|
|
51
|
+
- `instanceId: string` — Always returns the element's `data-cotomy-instance` (generated when missing, respects existing values)
|
|
52
52
|
- `id: string | null | undefined`
|
|
53
53
|
- `generateId(prefix = "__cotomy_elem__"): this`
|
|
54
54
|
- `is(selector: string): boolean` — Parent-aware matching helper
|
package/dist/browser/cotomy.js
CHANGED
|
@@ -942,7 +942,10 @@ class CotomyElement {
|
|
|
942
942
|
}
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
|
-
|
|
945
|
+
this.setInstanceId();
|
|
946
|
+
}
|
|
947
|
+
setInstanceId() {
|
|
948
|
+
if (!this.hasAttribute("data-cotomy-instance")) {
|
|
946
949
|
this.attribute("data-cotomy-instance", cuid_default()());
|
|
947
950
|
this.removed(() => {
|
|
948
951
|
this._element = CotomyElement.createHTMLElement(`<div data-cotomy-invalidated style="display: none;"></div>`);
|