cotomy 1.0.5 → 2.0.1
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 +14 -1
- package/dist/browser/cotomy.js +803 -127
- package/dist/browser/cotomy.js.map +1 -1
- package/dist/browser/cotomy.min.js +2 -1
- package/dist/browser/cotomy.min.js.LICENSE.txt +1 -0
- package/dist/browser/cotomy.min.js.map +1 -1
- package/dist/cjs/index.cjs +2 -1
- package/dist/cjs/index.cjs.LICENSE.txt +1 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/view.js +4 -4
- package/dist/esm/view.js.map +1 -1
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
**Cotomy** is a lightweight framework for managing form behavior and page controllers in web applications.
|
|
7
7
|
It is suitable for both SPAs (Single Page Applications) and traditional web apps requiring dynamic form operations.
|
|
8
8
|
|
|
9
|
+
## Requirements
|
|
10
|
+
|
|
11
|
+
- Node.js 20.19.0 or later
|
|
12
|
+
|
|
9
13
|
To install Cotomy in your project, run the following command:
|
|
10
14
|
|
|
11
15
|
```bash
|
|
@@ -18,6 +22,13 @@ Cotomy will continue to expand with more detailed usage instructions and code ex
|
|
|
18
22
|
For the latest updates, please check the official documentation or repository regularly.
|
|
19
23
|
Reference: https://cotomy.net/
|
|
20
24
|
|
|
25
|
+
## Version Notes
|
|
26
|
+
|
|
27
|
+
### v2
|
|
28
|
+
|
|
29
|
+
- Updated core development dependencies including TypeScript 6 and Vitest 4
|
|
30
|
+
- Internal ID generation was migrated from `cuid` to `@paralleldrive/cuid2`
|
|
31
|
+
|
|
21
32
|
## View Reference
|
|
22
33
|
|
|
23
34
|
The View layer provides thin wrappers around DOM elements and window events.
|
|
@@ -69,7 +80,7 @@ The View layer provides thin wrappers around DOM elements and window events.
|
|
|
69
80
|
- `enabled: boolean` (get/set) — Toggles `disabled` attribute
|
|
70
81
|
- `setFocus(): void`
|
|
71
82
|
- Tree traversal & manipulation
|
|
72
|
-
- `parent: CotomyElement`
|
|
83
|
+
- `parent: CotomyElement` — Returns `CotomyElement.empty()` when no parent element exists (mainly edge cases such as `html` or detached elements)
|
|
73
84
|
- `parents: CotomyElement[]`
|
|
74
85
|
- `children(selector = "*", type?): T[]` (direct children only)
|
|
75
86
|
- `firstChild(selector = "*", type?)`
|
|
@@ -83,6 +94,8 @@ The View layer provides thin wrappers around DOM elements and window events.
|
|
|
83
94
|
- `clone(type?): CotomyElement` - Returns a deep-cloned element, optionally typed, and reassigns a new `data-cotomy-instance` while preserving the `data-cotomy-scopeid` for scoped CSS sharing (strips `data-cotomy-moving`). Cloning an invalidated element (`data-cotomy-invalidated`) throws.
|
|
84
95
|
- `clear(): this` — Removes all descendants and text
|
|
85
96
|
- `remove(): void` — Explicitly non-chainable after removal
|
|
97
|
+
|
|
98
|
+
> Design note: `parent` intentionally returns `CotomyElement` (non-null) for chaining and simpler usage. In typical page structures, missing parent elements are rare (mainly `html` or detached elements), and those cases are represented by `CotomyElement.empty()`.
|
|
86
99
|
- Geometry & visibility
|
|
87
100
|
- `visible: boolean`
|
|
88
101
|
- `width: number` (get/set px)
|