alchemy-widget 0.1.0 → 0.1.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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.1.1 (2022-01-28)
2
+
3
+ * Hide context button when clicking out of widget
4
+ * Update context button position on scroll
5
+ * Fix row children becoming too wide
6
+
1
7
  ## 0.1.0 (2021-09-12)
2
8
 
3
9
  * Initial release
@@ -11,7 +11,7 @@ alchemy-widgets-column {
11
11
  }
12
12
 
13
13
  > * {
14
- flex: 1 auto;
14
+ flex: 1;
15
15
  }
16
16
  }
17
17
 
@@ -112,4 +112,43 @@ Awc.setMethod(function introduced() {
112
112
 
113
113
  that.toggleToolbar();
114
114
  });
115
+
116
+ document.addEventListener('click', e => {
117
+
118
+ if (!this.active_widget) {
119
+ return;
120
+ }
121
+
122
+ // Ignore clicks on the context element button itself!
123
+ if (e.target == this || this.contains(e.target)) {
124
+ return;
125
+ }
126
+
127
+ // Ignore clicks in the active widget
128
+ if (e.target == this.active_widget || this.active_widget.contains(e.target)) {
129
+ return;
130
+ }
131
+
132
+ return this.unselectedWidget();
133
+ });
134
+
135
+ let update_scroll = () => {
136
+ animation_request = null;
137
+ this.moveToWidget(this.active_widget);
138
+ }
139
+
140
+ let animation_request;
141
+
142
+ document.addEventListener('scroll', e => {
143
+
144
+ if (!this.active_widget) {
145
+ return;
146
+ }
147
+
148
+ if (animation_request != null) {
149
+ cancelAnimationFrame(animation_request);
150
+ }
151
+
152
+ animation_request = requestAnimationFrame(update_scroll);
153
+ }, {passive: true});
115
154
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "alchemy-widget",
3
3
  "description": "The widget plugin for the AlchemyMVC",
4
- "version": "0.1.0",
4
+ "version": "0.1.1",
5
5
  "author": "Jelle De Loecker <jelle@elevenways.be>",
6
6
  "keywords": [
7
7
  "alchemy",
@@ -15,6 +15,6 @@
15
15
  "repository": "11ways/alchemy-widget",
16
16
  "license": "MIT",
17
17
  "engines": {
18
- "node" : ">=10.0.0"
18
+ "node" : ">=12.0.0"
19
19
  }
20
20
  }