@domql/element 2.5.190 → 2.5.191

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/create.js CHANGED
@@ -259,11 +259,12 @@ const renderElement = async (element, parent, options, attachOptions) => {
259
259
  // apply events
260
260
  applyAnimationFrame(element, options)
261
261
 
262
- // run `on.renderRouter`
263
- await triggerEventOn('renderRouter', element, options)
264
-
265
262
  // run `on.render`
266
263
  await triggerEventOn('render', element, options)
264
+ // triggerEventOn('render', element, options).then(() => {})
265
+
266
+ // run `on.renderRouter`
267
+ await triggerEventOn('renderRouter', element, options)
267
268
 
268
269
  // run `on.done`
269
270
  await triggerEventOn('done', element, options)
@@ -212,8 +212,8 @@ const renderElement = async (element, parent, options, attachOptions) => {
212
212
  }
213
213
  (0, import_render.assignNode)(element, parent, key, attachOptions);
214
214
  (0, import_event.applyAnimationFrame)(element, options);
215
- await (0, import_event.triggerEventOn)("renderRouter", element, options);
216
215
  await (0, import_event.triggerEventOn)("render", element, options);
216
+ await (0, import_event.triggerEventOn)("renderRouter", element, options);
217
217
  await (0, import_event.triggerEventOn)("done", element, options);
218
218
  await (0, import_event.triggerEventOn)("create", element, options);
219
219
  };
package/dist/cjs/node.js CHANGED
@@ -83,7 +83,12 @@ const createNode = async (element, options) => {
83
83
  await (0, import_create.default)((0, import_utils.exec)(value, element), element, param, options);
84
84
  };
85
85
  if (element.props && element.props.lazyLoad || options.lazyLoad) {
86
- window.requestAnimationFrame(async () => await createAsync());
86
+ window.requestAnimationFrame(async () => {
87
+ await createAsync();
88
+ if (!options.preventUpdateListener) {
89
+ (0, import_event.triggerEventOn)("lazyLoad", element, options);
90
+ }
91
+ });
87
92
  } else
88
93
  await createAsync();
89
94
  }
package/dist/cjs/set.js CHANGED
@@ -85,7 +85,12 @@ const set = function(params, options = {}, el) {
85
85
  props.ignoreChildProps = true;
86
86
  }
87
87
  if (lazyLoad) {
88
- window.requestAnimationFrame(() => resetElement(params, element, options));
88
+ window.requestAnimationFrame(() => {
89
+ resetElement(params, element, options);
90
+ if (!options.preventUpdateListener) {
91
+ (0, import_event.triggerEventOn)("lazyLoad", element, options);
92
+ }
93
+ });
89
94
  } else
90
95
  resetElement(params, element, options);
91
96
  }
@@ -143,7 +143,12 @@ const update = function(params = {}, opts) {
143
143
  currentSnapshot: snapshotOnCallee,
144
144
  calleeElement
145
145
  });
146
- lazyLoad ? import_utils.window.requestAnimationFrame(() => childUpdateCall()) : childUpdateCall();
146
+ lazyLoad ? import_utils.window.requestAnimationFrame(() => {
147
+ childUpdateCall();
148
+ if (!options.preventUpdateListener) {
149
+ (0, import_event.triggerEventOn)("lazyLoad", element, options);
150
+ }
151
+ }) : childUpdateCall();
147
152
  }
148
153
  }
149
154
  if (!preventUpdateListener)
@@ -198,8 +198,8 @@ const renderElement = async (element, parent, options, attachOptions) => {
198
198
  }
199
199
  assignNode(element, parent, key, attachOptions);
200
200
  applyAnimationFrame(element, options);
201
- await triggerEventOn("renderRouter", element, options);
202
201
  await triggerEventOn("render", element, options);
202
+ await triggerEventOn("renderRouter", element, options);
203
203
  await triggerEventOn("done", element, options);
204
204
  await triggerEventOn("create", element, options);
205
205
  };
package/dist/esm/node.js CHANGED
@@ -53,7 +53,12 @@ const createNode = async (element, options) => {
53
53
  await create(exec(value, element), element, param, options);
54
54
  };
55
55
  if (element.props && element.props.lazyLoad || options.lazyLoad) {
56
- window.requestAnimationFrame(async () => await createAsync());
56
+ window.requestAnimationFrame(async () => {
57
+ await createAsync();
58
+ if (!options.preventUpdateListener) {
59
+ triggerEventOn("lazyLoad", element, options);
60
+ }
61
+ });
57
62
  } else
58
63
  await createAsync();
59
64
  }
package/dist/esm/set.js CHANGED
@@ -59,7 +59,12 @@ const set = function(params, options = {}, el) {
59
59
  props.ignoreChildProps = true;
60
60
  }
61
61
  if (lazyLoad) {
62
- window.requestAnimationFrame(() => resetElement(params, element, options));
62
+ window.requestAnimationFrame(() => {
63
+ resetElement(params, element, options);
64
+ if (!options.preventUpdateListener) {
65
+ triggerEventOn("lazyLoad", element, options);
66
+ }
67
+ });
63
68
  } else
64
69
  resetElement(params, element, options);
65
70
  }
@@ -133,7 +133,12 @@ const update = function(params = {}, opts) {
133
133
  currentSnapshot: snapshotOnCallee,
134
134
  calleeElement
135
135
  });
136
- lazyLoad ? window.requestAnimationFrame(() => childUpdateCall()) : childUpdateCall();
136
+ lazyLoad ? window.requestAnimationFrame(() => {
137
+ childUpdateCall();
138
+ if (!options.preventUpdateListener) {
139
+ triggerEventOn("lazyLoad", element, options);
140
+ }
141
+ }) : childUpdateCall();
137
142
  }
138
143
  }
139
144
  if (!preventUpdateListener)
package/node.js CHANGED
@@ -82,7 +82,13 @@ export const createNode = async (element, options) => {
82
82
  }
83
83
 
84
84
  if ((element.props && element.props.lazyLoad) || options.lazyLoad) {
85
- window.requestAnimationFrame(async () => await createAsync())
85
+ window.requestAnimationFrame(async () => {
86
+ await createAsync()
87
+ // handle lazy load
88
+ if (!options.preventUpdateListener) {
89
+ triggerEventOn('lazyLoad', element, options)
90
+ }
91
+ })
86
92
  } else await createAsync()
87
93
  }
88
94
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/element",
3
- "version": "2.5.190",
3
+ "version": "2.5.191",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -32,7 +32,7 @@
32
32
  "@domql/state": "^2.5.190",
33
33
  "@domql/utils": "^2.5.187"
34
34
  },
35
- "gitHead": "c4e06a81317c6d43c070d9ad93bbaeba24b3bb3b",
35
+ "gitHead": "5d4f4461533c18d4ed4524c1631d8dee17452e93",
36
36
  "devDependencies": {
37
37
  "@babel/core": "^7.12.0"
38
38
  }
package/set.js CHANGED
@@ -63,7 +63,13 @@ export const set = function (params, options = {}, el) {
63
63
  }
64
64
 
65
65
  if (lazyLoad) {
66
- window.requestAnimationFrame(() => resetElement(params, element, options))
66
+ window.requestAnimationFrame(() => {
67
+ resetElement(params, element, options)
68
+ // handle lazy load
69
+ if (!options.preventUpdateListener) {
70
+ triggerEventOn('lazyLoad', element, options)
71
+ }
72
+ })
67
73
  } else resetElement(params, element, options)
68
74
  }
69
75
 
package/update.js CHANGED
@@ -152,7 +152,13 @@ export const update = function (params = {}, opts) {
152
152
  calleeElement
153
153
  })
154
154
 
155
- lazyLoad ? window.requestAnimationFrame(() => childUpdateCall()) : childUpdateCall()
155
+ lazyLoad ? window.requestAnimationFrame(() => { // eslint-disable-line
156
+ childUpdateCall()
157
+ // handle lazy load
158
+ if (!options.preventUpdateListener) {
159
+ triggerEventOn('lazyLoad', element, options)
160
+ }
161
+ }) : childUpdateCall()
156
162
  }
157
163
  }
158
164