targetj 1.0.224 → 1.0.225

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
@@ -112,16 +112,11 @@ App({
112
112
  this.setTarget('backgroundColor', { value: [ '#ffe8ec', '#f5f5f5' ], steps: 12, interval: 12 });
113
113
  },
114
114
  heart$$: { // Wait for the button animation to finish, THEN add and animate the heart.
115
- html: "♥", color: "crimson", fontSize: 20,
115
+ html: "♥", color: "crimson", fontSize: 20;
116
116
  fly() {
117
- const cx = this.getCenterX(), cy = this.getCenterY();
118
- this.setTarget({
119
- opacity: { value: [0, 1, 1, 0.8, 0.1], steps: 20 },
120
- scale: { value: [0.8, 1.4, 1.1, 0.9, 0.8], steps: 20 },
121
- rotate: { value: [0, 12, -8, 6, 0], steps: 20 },
122
- x: { value: [cx, cx + 22, cx - 16, cx + 10, cx], steps: 30 },
123
- y: { value: [cy - 8, cy - 70, cy - 90, cy - 120, cy - 150], steps: 30 }
124
- });
117
+ const cx = (this.parent.getWidth() - this.getWidth()) / 2;
118
+ this.setTarget('x', { value: [cx, cx + 22, cx - 16, cx + 10, cx ], steps: 50, cycles: 2 }); // Repeat it twice
119
+ this.setTarget('y', { value: [0, -120], steps: 400 });
125
120
  }
126
121
  }
127
122
  }).mount("#likeButton");
@@ -152,14 +147,9 @@ App({
152
147
  heart$$: {
153
148
  html: "♥", color: "crimson", fontSize: 20,
154
149
  fly() {
155
- const cx = this.getCenterX(), cy = this.getCenterY();
156
- this.setTarget({
157
- opacity: { value: [0, 1, 1, 0.8, 0.1], steps: 20 },
158
- scale: { value: [0.8, 1.4, 1.1, 0.9, 0.8], steps: 20 },
159
- rotate: { value: [0, 12, -8, 6, 0], steps: 20 },
160
- x: { value: [cx, cx + 22, cx - 16, cx + 10, cx], steps: 30 },
161
- y: { value: [cy - 8, cy - 70, cy - 90, cy - 120, cy - 150], steps: 30 }
162
- });
150
+ const cx = (this.parent.getWidth() - this.getWidth()) / 2;
151
+ this.setTarget('x', { value: [cx, cx + 22, cx - 16, cx + 10, cx ], steps: 50, cycles: 2 }); // Repeat it twice
152
+ this.setTarget('y', { value: [0, -120], steps: 400 });
163
153
  }
164
154
  },
165
155
  fetch$$: { method: "POST", id: 123, url: "/api/like" }, // Wait for the heart to finish, THEN fetch
@@ -334,7 +324,7 @@ App({
334
324
  gap: 10,
335
325
  fetch: {
336
326
  interval: 1000,
337
- cycles: 4,
327
+ cycles: 5,
338
328
  value(i) { return `https://targetjs.io/api/randomUser?id=user${i}`; }
339
329
  },
340
330
  child$() {
@@ -411,7 +401,7 @@ App({
411
401
  },
412
402
  wave$$: {
413
403
  interval: 30,
414
- cycles() { return this.visibleChildren.length - 1; },
404
+ cycles() { return this.visibleChildren.length; },
415
405
  value(i) {
416
406
  const child = this.visibleChildren[i];
417
407
  child.setTarget("scale", { value: [1, 1.06, 1], steps: 18 });
package/build/Bracket.js CHANGED
@@ -157,9 +157,28 @@ var Bracket = exports.Bracket = /*#__PURE__*/function (_TModel) {
157
157
  }, {
158
158
  key: "shouldCalculateChildren",
159
159
  value: function shouldCalculateChildren() {
160
- var result = this.isVisible() && this.getDirtyLayout() !== false || this.currentStatus === 'new' || this.isNowVisible;
161
- this.currentStatus = undefined;
162
- return result;
160
+ if (this.currentStatus === 'new' || this.isNowVisible) {
161
+ var visibleChild = this.getChildren().find(function (child) {
162
+ return child.calcVisibility();
163
+ });
164
+ this.currentStatus = undefined;
165
+ if (visibleChild) {
166
+ this.currentStatus = 'new';
167
+ var parent = this.parent;
168
+ while (parent && parent.type === 'BI') {
169
+ parent.currentStatus = 'new';
170
+ parent = parent.parent;
171
+ }
172
+ }
173
+ return true;
174
+ }
175
+ if (this.getDirtyLayout() === false) {
176
+ return false;
177
+ }
178
+ if (this.isVisible()) {
179
+ return true;
180
+ }
181
+ return false;
163
182
  }
164
183
  }, {
165
184
  key: "getDirtyLayout",
@@ -236,9 +236,6 @@ var LocationManager = exports.LocationManager = /*#__PURE__*/function () {
236
236
  if (child.isDomIsland()) {
237
237
  _this.domIslandSet.add(child);
238
238
  }
239
- if (child.shouldBeBracketed() && !_TUtil.TUtil.isDefined(child.getDomParent().targets['onWindowScroll'])) {
240
- child.getDomParent().addTarget('onWindowScroll', '');
241
- }
242
239
  viewport.setLocation();
243
240
  if (viewport.isOverflow()) {
244
241
  viewport.overflow();