hyperclayjs 1.11.0 → 1.12.0
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
|
@@ -75,7 +75,7 @@ import 'hyperclayjs/presets/standard.js';
|
|
|
75
75
|
|--------|------|-------------|
|
|
76
76
|
| ajax-elements | 2.6KB | [ajax-form], [ajax-button] for async form submissions |
|
|
77
77
|
| dom-helpers | 6.2KB | el.nearest, el.val, el.text, el.exec, el.cycle |
|
|
78
|
-
| event-attrs | 4.
|
|
78
|
+
| event-attrs | 4.6KB | [onclickaway], [onclickchildren], [onclone], [onpagemutation], [onrender] |
|
|
79
79
|
| input-helpers | 1.2KB | [prevent-enter], [autosize] for textareas |
|
|
80
80
|
| onaftersave | 1KB | [onaftersave] attribute - run JS when save status changes |
|
|
81
81
|
| sortable | 3.4KB | Drag-drop sorting with [sortable], lazy-loads ~118KB Sortable.js in edit mode |
|
|
@@ -137,12 +137,12 @@ Essential features for basic editing
|
|
|
137
137
|
|
|
138
138
|
**Modules:** `save-core`, `save-system`, `edit-mode-helpers`, `toast`, `save-toast`, `export-to-window`
|
|
139
139
|
|
|
140
|
-
### Standard (~48.
|
|
140
|
+
### Standard (~48.9KB)
|
|
141
141
|
Standard feature set for most use cases
|
|
142
142
|
|
|
143
143
|
**Modules:** `save-core`, `save-system`, `edit-mode-helpers`, `persist`, `option-visibility`, `event-attrs`, `dom-helpers`, `toast`, `save-toast`, `export-to-window`
|
|
144
144
|
|
|
145
|
-
### Everything (~178.
|
|
145
|
+
### Everything (~178.6KB)
|
|
146
146
|
All available features
|
|
147
147
|
|
|
148
148
|
Includes all available modules across all categories.
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Events module - combines all event attribute handlers
|
|
2
2
|
import { init as initOnclickaway } from './onclickaway.js';
|
|
3
|
+
import { init as initOnclickchildren } from './onclickchildren.js';
|
|
3
4
|
import { init as initOnclone } from './onclone.js';
|
|
4
5
|
import { init as initOnmutation } from './onmutation.js';
|
|
5
6
|
import { init as initOnpagemutation } from './onpagemutation.js';
|
|
@@ -7,6 +8,7 @@ import { init as initOnrender } from './onrender.js';
|
|
|
7
8
|
|
|
8
9
|
function init() {
|
|
9
10
|
initOnclickaway();
|
|
11
|
+
initOnclickchildren();
|
|
10
12
|
initOnclone();
|
|
11
13
|
initOnmutation();
|
|
12
14
|
initOnpagemutation();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function init() {
|
|
2
|
+
document.addEventListener('click', function(event) {
|
|
3
|
+
const parent = event.target.closest('[onclickchildren]');
|
|
4
|
+
if (parent && event.target !== parent) {
|
|
5
|
+
const directChild = event.composedPath().find(el => el.parentNode === parent);
|
|
6
|
+
new Function(parent.getAttribute('onclickchildren')).call(directChild);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { init };
|
|
12
|
+
export default init;
|
package/src/hyperclay.js
CHANGED