vevet 2.0.11 → 2.3.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/build/cdn/index.js +1 -1
- package/build/cjs/app/events/Viewport.js +17 -6
- package/build/cjs/components/loading/ProgressPreloader.js +59 -14
- package/build/cjs/components/text/SplitText.js +2 -2
- package/build/es/app/events/Viewport.js +16 -6
- package/build/es/components/loading/ProgressPreloader.js +59 -14
- package/build/es/components/text/SplitText.js +2 -2
- package/build/types/app/events/Viewport.d.ts +9 -1
- package/build/types/app/events/Viewport.d.ts.map +1 -1
- package/build/types/components/loading/ProgressPreloader.d.ts +13 -7
- package/build/types/components/loading/ProgressPreloader.d.ts.map +1 -1
- package/build/types/components/text/SplitText.d.ts +5 -0
- package/build/types/components/text/SplitText.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/ts/app/events/Viewport.ts +18 -6
- package/src/ts/components/loading/ProgressPreloader.ts +73 -21
- package/src/ts/components/text/SplitText.ts +7 -1
|
@@ -263,7 +263,12 @@ var Viewport = /** @class */ (function (_super) {
|
|
|
263
263
|
/**
|
|
264
264
|
* Launch callbacks on resize.
|
|
265
265
|
*/
|
|
266
|
-
Viewport.prototype._onResize = function (
|
|
266
|
+
Viewport.prototype._onResize = function (
|
|
267
|
+
/**
|
|
268
|
+
* force all callbacks
|
|
269
|
+
*/
|
|
270
|
+
force) {
|
|
271
|
+
if (force === void 0) { force = false; }
|
|
267
272
|
// copy previous values
|
|
268
273
|
var prevWidth = this._prevSize.w;
|
|
269
274
|
var prevHeight = this._prevSize.h;
|
|
@@ -278,29 +283,35 @@ var Viewport = /** @class */ (function (_super) {
|
|
|
278
283
|
orientationChanged: (width > height) !== (prevWidth > prevHeight),
|
|
279
284
|
};
|
|
280
285
|
// only when width is changed
|
|
281
|
-
if (width !== prevWidth && height === prevHeight) {
|
|
286
|
+
if (force || (width !== prevWidth && height === prevHeight)) {
|
|
282
287
|
this.tbt('w_', changes);
|
|
283
288
|
}
|
|
284
289
|
// only when height is changed
|
|
285
|
-
if (height !== prevHeight && width === prevWidth) {
|
|
290
|
+
if (force || (height !== prevHeight && width === prevWidth)) {
|
|
286
291
|
this.tbt('h_', changes);
|
|
287
292
|
}
|
|
288
293
|
// when height & width are changed
|
|
289
|
-
if (width !== prevWidth && height !== prevHeight) {
|
|
294
|
+
if (force || (width !== prevWidth && height !== prevHeight)) {
|
|
290
295
|
this.tbt('wh', changes);
|
|
291
296
|
this.tbt('hw', changes);
|
|
292
297
|
}
|
|
293
298
|
// when width is changed
|
|
294
|
-
if (width !== prevWidth) {
|
|
299
|
+
if (force || width !== prevWidth) {
|
|
295
300
|
this.tbt('w', changes);
|
|
296
301
|
}
|
|
297
302
|
// when height changed
|
|
298
|
-
if (height !== prevHeight) {
|
|
303
|
+
if (force || height !== prevHeight) {
|
|
299
304
|
this.tbt('h', changes);
|
|
300
305
|
}
|
|
301
306
|
// on any change
|
|
302
307
|
this.tbt('', changes);
|
|
303
308
|
};
|
|
309
|
+
/**
|
|
310
|
+
* Force launching all callbacks
|
|
311
|
+
*/
|
|
312
|
+
Viewport.prototype.forceResize = function () {
|
|
313
|
+
this._onResize(true);
|
|
314
|
+
};
|
|
304
315
|
return Viewport;
|
|
305
316
|
}(Callbacks_1.Callbacks));
|
|
306
317
|
exports.Viewport = Viewport;
|
|
@@ -33,6 +33,7 @@ exports.ProgressPreloader = void 0;
|
|
|
33
33
|
var vevet_dom_1 = require("vevet-dom");
|
|
34
34
|
var p_cancelable_1 = __importDefault(require("p-cancelable"));
|
|
35
35
|
var AnimationFrame_1 = require("../animation-frame/AnimationFrame");
|
|
36
|
+
var clamp_1 = __importDefault(require("../../utils/math/clamp"));
|
|
36
37
|
var lerp_1 = __importDefault(require("../../utils/math/lerp"));
|
|
37
38
|
var Preloader_1 = require("./Preloader");
|
|
38
39
|
var Timeline_1 = require("../timeline/Timeline");
|
|
@@ -213,11 +214,19 @@ var ProgressPreloader = /** @class */ (function (_super) {
|
|
|
213
214
|
}
|
|
214
215
|
// get custom resources
|
|
215
216
|
if (loaders.custom) {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
Array.from((0, vevet_dom_1.selectAll)(loaders.custom)).forEach(function (el) {
|
|
218
|
+
// note that each custom resource may have the attribute "data-load-count"
|
|
219
|
+
// which defines how many resources should be added to the loading queue.
|
|
220
|
+
// here we check this quantity and duplicate elements
|
|
221
|
+
var loadCount = parseInt(el.getAttribute('data-load-count') || '1', 10);
|
|
222
|
+
loadCount = Number.isNaN(loadCount) ? 1 : (0, clamp_1.default)(loadCount, [1, Infinity]);
|
|
223
|
+
for (var index = 1; index <= loadCount; index += 1) {
|
|
224
|
+
var targetProgress = index / loadCount;
|
|
225
|
+
_this._customResources.push({
|
|
226
|
+
el: el,
|
|
227
|
+
targetProgress: targetProgress,
|
|
228
|
+
});
|
|
219
229
|
}
|
|
220
|
-
return true;
|
|
221
230
|
});
|
|
222
231
|
this._resourcesTotal += this._customResources.length;
|
|
223
232
|
}
|
|
@@ -267,8 +276,8 @@ var ProgressPreloader = /** @class */ (function (_super) {
|
|
|
267
276
|
}
|
|
268
277
|
});
|
|
269
278
|
// preload custom resources
|
|
270
|
-
this._customResources.forEach(function (
|
|
271
|
-
_this._seekCustomResourceLoaded(
|
|
279
|
+
this._customResources.forEach(function (data) {
|
|
280
|
+
_this._seekCustomResourceLoaded(data).then(function () {
|
|
272
281
|
_this._handleLoadedResource();
|
|
273
282
|
});
|
|
274
283
|
});
|
|
@@ -276,16 +285,52 @@ var ProgressPreloader = /** @class */ (function (_super) {
|
|
|
276
285
|
/**
|
|
277
286
|
* Seek the moment when a custom resource is loaded
|
|
278
287
|
*/
|
|
279
|
-
ProgressPreloader.prototype._seekCustomResourceLoaded = function (
|
|
288
|
+
ProgressPreloader.prototype._seekCustomResourceLoaded = function (data) {
|
|
280
289
|
var _this = this;
|
|
281
290
|
return new Promise(function (resolve) {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
291
|
+
var el = data.el, targetProgress = data.targetProgress;
|
|
292
|
+
// get loaded value
|
|
293
|
+
var loadProgress = 0;
|
|
294
|
+
// from "isComplete" property
|
|
295
|
+
if (typeof el.isComplete !== 'undefined') {
|
|
296
|
+
if (typeof el.isComplete === 'boolean') {
|
|
297
|
+
if (el.isComplete) {
|
|
298
|
+
loadProgress = targetProgress;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
else if (typeof el.isComplete === 'number') {
|
|
302
|
+
loadProgress = el.isComplete;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
else if (typeof el.isLoaded !== 'undefined') {
|
|
306
|
+
// from "isLoaded" property
|
|
307
|
+
if (typeof el.isLoaded === 'boolean') {
|
|
308
|
+
if (el.isLoaded) {
|
|
309
|
+
loadProgress = targetProgress;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
else if (typeof el.isLoaded === 'number') {
|
|
313
|
+
loadProgress = el.isLoaded;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
// if loadProgress is still incomplete,
|
|
317
|
+
// we check the "data-is-loaded" attribute
|
|
318
|
+
if (loadProgress === 0) {
|
|
319
|
+
var isLoadedAttr = el.getAttribute('data-is-loaded');
|
|
320
|
+
if (isLoadedAttr !== null && isLoadedAttr !== '') {
|
|
321
|
+
var isLoadedAttrNum = parseFloat(isLoadedAttr);
|
|
322
|
+
// if the value is non-numeric, we define the the resource is loaded
|
|
323
|
+
if (Number.isNaN(isLoadedAttrNum)) {
|
|
324
|
+
loadProgress = targetProgress;
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
loadProgress = isLoadedAttrNum;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
286
330
|
}
|
|
287
|
-
|
|
288
|
-
|
|
331
|
+
// console.log(loadProgress, targetLoadProgress);
|
|
332
|
+
// and we finally check if the target progress was reached
|
|
333
|
+
if (loadProgress >= targetProgress) {
|
|
289
334
|
resolve();
|
|
290
335
|
return;
|
|
291
336
|
}
|
|
@@ -294,7 +339,7 @@ var ProgressPreloader = /** @class */ (function (_super) {
|
|
|
294
339
|
if (_this.destroyed) {
|
|
295
340
|
return;
|
|
296
341
|
}
|
|
297
|
-
_this._seekCustomResourceLoaded(
|
|
342
|
+
_this._seekCustomResourceLoaded(data).then(function () {
|
|
298
343
|
resolve();
|
|
299
344
|
});
|
|
300
345
|
}, 50);
|
|
@@ -52,7 +52,7 @@ var SplitText = /** @class */ (function (_super) {
|
|
|
52
52
|
}
|
|
53
53
|
// get initial text
|
|
54
54
|
_this._initHTML = _this._container.innerHTML;
|
|
55
|
-
var innerText = _this._container
|
|
55
|
+
var innerText = _this._container[_this.prop.textSource].trim();
|
|
56
56
|
_this._initText = innerText || 'no rendered text';
|
|
57
57
|
_this._initText = _this._initText.replace(/\s+\n/gm, '\n');
|
|
58
58
|
_this._initText = _this._initText.replace(/<br>/gm, String.fromCharCode(10));
|
|
@@ -71,7 +71,7 @@ var SplitText = /** @class */ (function (_super) {
|
|
|
71
71
|
return _this;
|
|
72
72
|
}
|
|
73
73
|
SplitText.prototype._getDefaultProp = function () {
|
|
74
|
-
return __assign(__assign({}, _super.prototype._getDefaultProp.call(this)), { container: "#".concat(this.prefix), appendLetters: true, appendLines: false, viewportTarget: '', resizeTimeout: 0 });
|
|
74
|
+
return __assign(__assign({}, _super.prototype._getDefaultProp.call(this)), { container: "#".concat(this.prefix), textSource: 'innerText', appendLetters: true, appendLines: false, viewportTarget: '', resizeTimeout: 0 });
|
|
75
75
|
};
|
|
76
76
|
Object.defineProperty(SplitText.prototype, "prefix", {
|
|
77
77
|
get: function () {
|
|
@@ -194,7 +194,11 @@ export class Viewport extends Callbacks {
|
|
|
194
194
|
/**
|
|
195
195
|
* Launch callbacks on resize.
|
|
196
196
|
*/
|
|
197
|
-
_onResize(
|
|
197
|
+
_onResize(
|
|
198
|
+
/**
|
|
199
|
+
* force all callbacks
|
|
200
|
+
*/
|
|
201
|
+
force = false) {
|
|
198
202
|
// copy previous values
|
|
199
203
|
const prevWidth = this._prevSize.w;
|
|
200
204
|
const prevHeight = this._prevSize.h;
|
|
@@ -209,27 +213,33 @@ export class Viewport extends Callbacks {
|
|
|
209
213
|
orientationChanged: (width > height) !== (prevWidth > prevHeight),
|
|
210
214
|
};
|
|
211
215
|
// only when width is changed
|
|
212
|
-
if (width !== prevWidth && height === prevHeight) {
|
|
216
|
+
if (force || (width !== prevWidth && height === prevHeight)) {
|
|
213
217
|
this.tbt('w_', changes);
|
|
214
218
|
}
|
|
215
219
|
// only when height is changed
|
|
216
|
-
if (height !== prevHeight && width === prevWidth) {
|
|
220
|
+
if (force || (height !== prevHeight && width === prevWidth)) {
|
|
217
221
|
this.tbt('h_', changes);
|
|
218
222
|
}
|
|
219
223
|
// when height & width are changed
|
|
220
|
-
if (width !== prevWidth && height !== prevHeight) {
|
|
224
|
+
if (force || (width !== prevWidth && height !== prevHeight)) {
|
|
221
225
|
this.tbt('wh', changes);
|
|
222
226
|
this.tbt('hw', changes);
|
|
223
227
|
}
|
|
224
228
|
// when width is changed
|
|
225
|
-
if (width !== prevWidth) {
|
|
229
|
+
if (force || width !== prevWidth) {
|
|
226
230
|
this.tbt('w', changes);
|
|
227
231
|
}
|
|
228
232
|
// when height changed
|
|
229
|
-
if (height !== prevHeight) {
|
|
233
|
+
if (force || height !== prevHeight) {
|
|
230
234
|
this.tbt('h', changes);
|
|
231
235
|
}
|
|
232
236
|
// on any change
|
|
233
237
|
this.tbt('', changes);
|
|
234
238
|
}
|
|
239
|
+
/**
|
|
240
|
+
* Force launching all callbacks
|
|
241
|
+
*/
|
|
242
|
+
forceResize() {
|
|
243
|
+
this._onResize(true);
|
|
244
|
+
}
|
|
235
245
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { selectAll } from 'vevet-dom';
|
|
2
2
|
import PCancelable from 'p-cancelable';
|
|
3
3
|
import { AnimationFrame } from '../animation-frame/AnimationFrame';
|
|
4
|
+
import clamp from '../../utils/math/clamp';
|
|
4
5
|
import lerp from '../../utils/math/lerp';
|
|
5
6
|
import { Preloader } from './Preloader';
|
|
6
7
|
import { Timeline } from '../timeline/Timeline';
|
|
@@ -147,11 +148,19 @@ export class ProgressPreloader extends Preloader {
|
|
|
147
148
|
}
|
|
148
149
|
// get custom resources
|
|
149
150
|
if (loaders.custom) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
Array.from(selectAll(loaders.custom)).forEach((el) => {
|
|
152
|
+
// note that each custom resource may have the attribute "data-load-count"
|
|
153
|
+
// which defines how many resources should be added to the loading queue.
|
|
154
|
+
// here we check this quantity and duplicate elements
|
|
155
|
+
let loadCount = parseInt(el.getAttribute('data-load-count') || '1', 10);
|
|
156
|
+
loadCount = Number.isNaN(loadCount) ? 1 : clamp(loadCount, [1, Infinity]);
|
|
157
|
+
for (let index = 1; index <= loadCount; index += 1) {
|
|
158
|
+
const targetProgress = index / loadCount;
|
|
159
|
+
this._customResources.push({
|
|
160
|
+
el,
|
|
161
|
+
targetProgress,
|
|
162
|
+
});
|
|
153
163
|
}
|
|
154
|
-
return true;
|
|
155
164
|
});
|
|
156
165
|
this._resourcesTotal += this._customResources.length;
|
|
157
166
|
}
|
|
@@ -200,8 +209,8 @@ export class ProgressPreloader extends Preloader {
|
|
|
200
209
|
}
|
|
201
210
|
});
|
|
202
211
|
// preload custom resources
|
|
203
|
-
this._customResources.forEach((
|
|
204
|
-
this._seekCustomResourceLoaded(
|
|
212
|
+
this._customResources.forEach((data) => {
|
|
213
|
+
this._seekCustomResourceLoaded(data).then(() => {
|
|
205
214
|
this._handleLoadedResource();
|
|
206
215
|
});
|
|
207
216
|
});
|
|
@@ -209,15 +218,51 @@ export class ProgressPreloader extends Preloader {
|
|
|
209
218
|
/**
|
|
210
219
|
* Seek the moment when a custom resource is loaded
|
|
211
220
|
*/
|
|
212
|
-
_seekCustomResourceLoaded(
|
|
221
|
+
_seekCustomResourceLoaded(data) {
|
|
213
222
|
return new Promise((resolve) => {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
223
|
+
const { el, targetProgress } = data;
|
|
224
|
+
// get loaded value
|
|
225
|
+
let loadProgress = 0;
|
|
226
|
+
// from "isComplete" property
|
|
227
|
+
if (typeof el.isComplete !== 'undefined') {
|
|
228
|
+
if (typeof el.isComplete === 'boolean') {
|
|
229
|
+
if (el.isComplete) {
|
|
230
|
+
loadProgress = targetProgress;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
else if (typeof el.isComplete === 'number') {
|
|
234
|
+
loadProgress = el.isComplete;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
else if (typeof el.isLoaded !== 'undefined') {
|
|
238
|
+
// from "isLoaded" property
|
|
239
|
+
if (typeof el.isLoaded === 'boolean') {
|
|
240
|
+
if (el.isLoaded) {
|
|
241
|
+
loadProgress = targetProgress;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
else if (typeof el.isLoaded === 'number') {
|
|
245
|
+
loadProgress = el.isLoaded;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
// if loadProgress is still incomplete,
|
|
249
|
+
// we check the "data-is-loaded" attribute
|
|
250
|
+
if (loadProgress === 0) {
|
|
251
|
+
const isLoadedAttr = el.getAttribute('data-is-loaded');
|
|
252
|
+
if (isLoadedAttr !== null && isLoadedAttr !== '') {
|
|
253
|
+
const isLoadedAttrNum = parseFloat(isLoadedAttr);
|
|
254
|
+
// if the value is non-numeric, we define the the resource is loaded
|
|
255
|
+
if (Number.isNaN(isLoadedAttrNum)) {
|
|
256
|
+
loadProgress = targetProgress;
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
loadProgress = isLoadedAttrNum;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
218
262
|
}
|
|
219
|
-
|
|
220
|
-
|
|
263
|
+
// console.log(loadProgress, targetLoadProgress);
|
|
264
|
+
// and we finally check if the target progress was reached
|
|
265
|
+
if (loadProgress >= targetProgress) {
|
|
221
266
|
resolve();
|
|
222
267
|
return;
|
|
223
268
|
}
|
|
@@ -226,7 +271,7 @@ export class ProgressPreloader extends Preloader {
|
|
|
226
271
|
if (this.destroyed) {
|
|
227
272
|
return;
|
|
228
273
|
}
|
|
229
|
-
this._seekCustomResourceLoaded(
|
|
274
|
+
this._seekCustomResourceLoaded(data).then(() => {
|
|
230
275
|
resolve();
|
|
231
276
|
});
|
|
232
277
|
}, 50);
|
|
@@ -21,7 +21,7 @@ export class SplitText extends Component {
|
|
|
21
21
|
}
|
|
22
22
|
// get initial text
|
|
23
23
|
this._initHTML = this._container.innerHTML;
|
|
24
|
-
const innerText = this._container
|
|
24
|
+
const innerText = this._container[this.prop.textSource].trim();
|
|
25
25
|
this._initText = innerText || 'no rendered text';
|
|
26
26
|
this._initText = this._initText.replace(/\s+\n/gm, '\n');
|
|
27
27
|
this._initText = this._initText.replace(/<br>/gm, String.fromCharCode(10));
|
|
@@ -39,7 +39,7 @@ export class SplitText extends Component {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
_getDefaultProp() {
|
|
42
|
-
return Object.assign(Object.assign({}, super._getDefaultProp()), { container: `#${this.prefix}`, appendLetters: true, appendLines: false, viewportTarget: '', resizeTimeout: 0 });
|
|
42
|
+
return Object.assign(Object.assign({}, super._getDefaultProp()), { container: `#${this.prefix}`, textSource: 'innerText', appendLetters: true, appendLines: false, viewportTarget: '', resizeTimeout: 0 });
|
|
43
43
|
}
|
|
44
44
|
get prefix() {
|
|
45
45
|
return `${this._app.prefix}split-text`;
|
|
@@ -134,6 +134,14 @@ export declare class Viewport extends Callbacks<NViewport.CallbacksTypes> {
|
|
|
134
134
|
/**
|
|
135
135
|
* Launch callbacks on resize.
|
|
136
136
|
*/
|
|
137
|
-
protected _onResize(
|
|
137
|
+
protected _onResize(
|
|
138
|
+
/**
|
|
139
|
+
* force all callbacks
|
|
140
|
+
*/
|
|
141
|
+
force?: boolean): void;
|
|
142
|
+
/**
|
|
143
|
+
* Force launching all callbacks
|
|
144
|
+
*/
|
|
145
|
+
forceResize(): void;
|
|
138
146
|
}
|
|
139
147
|
//# sourceMappingURL=Viewport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Viewport.d.ts","sourceRoot":"","sources":["../../../../src/ts/app/events/Viewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,yBAAiB,SAAS,CAAC;IAEvB;;OAEG;IACH,UAAiB,OAAO;QACpB,YAAY,EAAE,OAAO,CAAC;QACtB,aAAa,EAAE,OAAO,CAAC;QACvB,kBAAkB,EAAE,OAAO,CAAC;KAC/B;IAED;;OAEG;IACH,UAAiB,cAAe,SAAQ,UAAU,CAAC,cAAc;QAC7D;;WAEG;QACH,GAAG,EAAE,OAAO,CAAC;QACb;;WAEG;QACH,GAAG,EAAE,OAAO,CAAC;QACb;;WAEG;QACH,IAAI,EAAE,OAAO,CAAC;QACd;;WAEG;QACH,IAAI,EAAE,OAAO,CAAA;QACb;;WAEG;QACH,IAAI,EAAE,OAAO,CAAC;QACd;;WAEG;QACH,IAAI,EAAE,OAAO,CAAC;QACd;;WAEG;QACH,EAAE,EAAE,OAAO,CAAC;KACf;CAEJ;AAqBD;;;GAGG;AACH,qBAAa,QAAS,SAAQ,SAAS,CACnC,SAAS,CAAC,cAAc,CAC3B;IACG;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,IAAI,KAAK,WAER;IAED;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;IAC1B,IAAI,MAAM,WAET;IAED;;OAEG;IACH,IAAI,EAAE,WAEL;IACD;;OAEG;IACH,IAAI,EAAE,WAEL;IAED;;OAEG;IACH,SAAS,CAAC,SAAS,EAAE;QACjB,CAAC,EAAE,MAA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B9D,SAAS,CAAC,YAAY;IAMtB,SAAS,CAAC,UAAU;IAapB;;OAEG;IACH,SAAS,CAAC,UAAU;IA0BpB;;OAEG;IACH,SAAS,CAAC,cAAc;IA4CxB;;OAEG;IACH,SAAS,CAAC,wBAAwB,CAC9B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EAAE;IAenB;;OAEG;IACH,SAAS,CAAC,cAAc;IAQxB;;OAEG;IACH,SAAS,CAAC,SAAS;IACf;;OAEG;IACH,KAAK,UAAQ;IA6CjB;;OAEG;IACI,WAAW;CAGrB"}
|
|
@@ -29,8 +29,10 @@ export declare namespace NProgressPreloader {
|
|
|
29
29
|
video?: boolean;
|
|
30
30
|
/**
|
|
31
31
|
* Selector for elements to be preloaded.
|
|
32
|
-
* These elements may have such properties
|
|
33
|
-
*
|
|
32
|
+
* These elements may have such properties
|
|
33
|
+
* as 'isLoaded' or 'isComplete' (numeral or boolean)
|
|
34
|
+
* or an attribute like 'data-is-loaded'
|
|
35
|
+
* (string with float or non-empty string for true).
|
|
34
36
|
* @default '.js-preload'
|
|
35
37
|
*/
|
|
36
38
|
custom?: string | false;
|
|
@@ -76,8 +78,12 @@ export declare namespace NProgressPreloader {
|
|
|
76
78
|
};
|
|
77
79
|
}
|
|
78
80
|
interface CustomResource extends Element {
|
|
79
|
-
isLoaded?: boolean;
|
|
80
|
-
isComplete?: boolean;
|
|
81
|
+
isLoaded?: boolean | number;
|
|
82
|
+
isComplete?: boolean | number;
|
|
83
|
+
}
|
|
84
|
+
interface CustomResourceData {
|
|
85
|
+
el: NProgressPreloader.CustomResource;
|
|
86
|
+
targetProgress: number;
|
|
81
87
|
}
|
|
82
88
|
}
|
|
83
89
|
/**
|
|
@@ -98,8 +104,8 @@ export declare class ProgressPreloader<StaticProp extends NProgressPreloader.Sta
|
|
|
98
104
|
/**
|
|
99
105
|
* Custom resources
|
|
100
106
|
*/
|
|
101
|
-
get customResources(): NProgressPreloader.
|
|
102
|
-
protected _customResources: NProgressPreloader.
|
|
107
|
+
get customResources(): NProgressPreloader.CustomResourceData[];
|
|
108
|
+
protected _customResources: NProgressPreloader.CustomResourceData[];
|
|
103
109
|
/**
|
|
104
110
|
* Quantity of resources to be preloader
|
|
105
111
|
*/
|
|
@@ -146,7 +152,7 @@ export declare class ProgressPreloader<StaticProp extends NProgressPreloader.Sta
|
|
|
146
152
|
/**
|
|
147
153
|
* Seek the moment when a custom resource is loaded
|
|
148
154
|
*/
|
|
149
|
-
protected _seekCustomResourceLoaded(
|
|
155
|
+
protected _seekCustomResourceLoaded(data: NProgressPreloader.CustomResourceData): Promise<any>;
|
|
150
156
|
/**
|
|
151
157
|
* Iterate quantity of loaded resources.
|
|
152
158
|
* @param quantity - Only integers
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressPreloader.d.ts","sourceRoot":"","sources":["../../../../src/ts/components/loading/ProgressPreloader.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"ProgressPreloader.d.ts","sourceRoot":"","sources":["../../../../src/ts/components/loading/ProgressPreloader.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAG/D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIhD,yBAAiB,kBAAkB,CAAC;IAEhC;;OAEG;IACH,UAAiB,UAAW,SAAQ,UAAU,CAAC,UAAU;QACrD;;;WAGG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB;;WAEG;QACH,OAAO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BAAqB;IAc/B;;OAEG;IACH,SAAS,CAAC,eAAe;IA+CzB;;OAEG;IACH,SAAS,CAAC,QAAQ;CAMrB"}
|
|
@@ -11,6 +11,11 @@ export declare namespace NSplitText {
|
|
|
11
11
|
* @default '#v-split-text'
|
|
12
12
|
*/
|
|
13
13
|
container?: string | Element;
|
|
14
|
+
/**
|
|
15
|
+
* Text content
|
|
16
|
+
* @default 'innerText'
|
|
17
|
+
*/
|
|
18
|
+
textSource?: 'textContent' | 'innerText' | 'innerHTML';
|
|
14
19
|
/**
|
|
15
20
|
* If need to split text into letters.
|
|
16
21
|
* @default true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitText.d.ts","sourceRoot":"","sources":["../../../../src/ts/components/text/SplitText.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAI/D,yBAAiB,UAAU,CAAC;IAExB;;OAEG;IACH,UAAiB,UAAW,SAAQ,UAAU,CAAC,UAAU;QACrD;;;WAGG;QACH,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAC7B;;;WAGG;QACH,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB;;;WAGG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB;;;WAGG;QACH,cAAc,CAAC,EAAE,MAAM,SAAS,CAAC,cAAc,CAAC;QAChD;;WAEG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;KAC1B;IAED;;OAEG;IACH,UAAiB,cAAe,SAAQ,UAAU,CAAC,cAAc;KAAI;IAErE;;OAEG;IACH,UAAiB,cAAe,SAAQ,UAAU,CAAC,cAAc;QAC7D,OAAO,EAAE,KAAK,CAAC;KAClB;IAED,UAAiB,IAAI;QACjB,EAAE,EAAE,WAAW,CAAC;QA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CACrB,CAAC,SAAS,kBAAkB,CAAC,UAAU,GAAG,cAAc,CAAC,KACvD,CAAC;IAYP,IAAI,MAAM,WAET;IAGD;;OAEG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,SAAS,CAAC,eAAe,EAAE,OAAO,CAAC;IAInC;;OAEG;IACH,IAAI,SAAS,gBAEZ;IACD,SAAS,CAAC,UAAU,EAAG,WAAW,CAAC;IAEnC,IAAI,OAAO,wBAEV;IACD,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC;IAExC,IAAI,KAAK,sBAER;IACD,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC;IAEpC,IAAI,KAAK,sBAER;IACD,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC;gBAKhC,WAAW,CAAC,EAAE,CAAC,UAAU,GAAG,cAAc,CAAC,EAC3C,IAAI,UAAO;IA0Cf,SAAS,CAAC,UAAU;IAgBpB;;OAEG;IACI,SAAS;IAmBhB;;OAEG;IACH,SAAS,CAAC,eAAe;IAkFzB;;OAEG;IACH,SAAS,CAAC,YAAY;IAYtB;;OAEG;IACH,SAAS,CAAC,YAAY;IActB;;OAEG;IACH,SAAS,CAAC,iBAAiB;IAqC3B;;OAEG;IACH,SAAS,CAAC,eAAe;IAiEzB;;OAEG;IACH,SAAS,CAAC,YAAY;IAYtB;;OAEG;IACH,SAAS,CAAC,QAAQ;CASrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vevet",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "VEVET - A JavaScript library",
|
|
5
5
|
"browserslist": [
|
|
6
6
|
"since 2015"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"prepare:cdn": "webpack --config ./config/webpack.cdn.js",
|
|
18
18
|
"lint:js": "eslint . --ext .ts,.js",
|
|
19
19
|
"prepare": "npm run prepare:all",
|
|
20
|
-
"release": "npm
|
|
20
|
+
"release": "npm publish"
|
|
21
21
|
},
|
|
22
22
|
"main": "./build/cjs/index.js",
|
|
23
23
|
"types": "./build/types/index.d.ts",
|
|
@@ -323,7 +323,12 @@ export class Viewport extends Callbacks<
|
|
|
323
323
|
/**
|
|
324
324
|
* Launch callbacks on resize.
|
|
325
325
|
*/
|
|
326
|
-
protected _onResize (
|
|
326
|
+
protected _onResize (
|
|
327
|
+
/**
|
|
328
|
+
* force all callbacks
|
|
329
|
+
*/
|
|
330
|
+
force = false,
|
|
331
|
+
) {
|
|
327
332
|
// copy previous values
|
|
328
333
|
const prevWidth = this._prevSize.w;
|
|
329
334
|
const prevHeight = this._prevSize.h;
|
|
@@ -342,29 +347,36 @@ export class Viewport extends Callbacks<
|
|
|
342
347
|
};
|
|
343
348
|
|
|
344
349
|
// only when width is changed
|
|
345
|
-
if (width !== prevWidth && height === prevHeight) {
|
|
350
|
+
if (force || (width !== prevWidth && height === prevHeight)) {
|
|
346
351
|
this.tbt('w_', changes);
|
|
347
352
|
}
|
|
348
353
|
// only when height is changed
|
|
349
|
-
if (height !== prevHeight && width === prevWidth) {
|
|
354
|
+
if (force || (height !== prevHeight && width === prevWidth)) {
|
|
350
355
|
this.tbt('h_', changes);
|
|
351
356
|
}
|
|
352
357
|
// when height & width are changed
|
|
353
|
-
if (width !== prevWidth && height !== prevHeight) {
|
|
358
|
+
if (force || (width !== prevWidth && height !== prevHeight)) {
|
|
354
359
|
this.tbt('wh', changes);
|
|
355
360
|
this.tbt('hw', changes);
|
|
356
361
|
}
|
|
357
362
|
// when width is changed
|
|
358
|
-
if (width !== prevWidth) {
|
|
363
|
+
if (force || width !== prevWidth) {
|
|
359
364
|
this.tbt('w', changes);
|
|
360
365
|
}
|
|
361
366
|
// when height changed
|
|
362
|
-
if (height !== prevHeight) {
|
|
367
|
+
if (force || height !== prevHeight) {
|
|
363
368
|
this.tbt('h', changes);
|
|
364
369
|
}
|
|
365
370
|
|
|
366
371
|
// on any change
|
|
367
372
|
this.tbt('', changes);
|
|
368
373
|
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Force launching all callbacks
|
|
377
|
+
*/
|
|
378
|
+
public forceResize () {
|
|
379
|
+
this._onResize(true);
|
|
380
|
+
}
|
|
369
381
|
}
|
|
370
382
|
|