vevet 2.7.1 → 2.8.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
@@ -1,6 +1,7 @@
1
1
  # Vevet - a collection of ready-to-use solutions for Web Development
2
2
 
3
- ## Documentation: https://antonbobrov.github.io/vevet/
3
+ ### Demo: https://antonbobrov.github.io/vevet/
4
+ ### Documentation: https://antonbobrov.github.io/vevet/docs/
4
5
 
5
6
 
6
7
 
package/package.json CHANGED
@@ -1,22 +1,24 @@
1
1
  {
2
2
  "name": "vevet",
3
- "version": "2.7.1",
3
+ "version": "2.8.0",
4
4
  "description": "VEVET - A JavaScript library",
5
5
  "browserslist": [
6
6
  "since 2015"
7
7
  ],
8
8
  "scripts": {
9
- "pages-build": "node ./examples-src/compiler/index.js && webpack --config ./examples-src/webpack/webpack.prod.js",
9
+ "pages-build": "node ./examples-src/compiler/index.js && webpack --config ./examples-src/webpack/prod.js",
10
10
  "pages-dev": "npm-run-all --parallel pages-dev:pug pages-dev:webpack",
11
11
  "pages-dev:pug": "nodemon --watch ./examples-src/pages --watch ./examples-src/compiler --ext pug,json,ts,js,html,css ./examples-src/compiler/index.js",
12
- "pages-dev:webpack": "webpack serve --config ./examples-src/webpack/webpack.dev.js",
13
- "watch-tsc": "nodemon --watch ./src/ts --ext ts,js --exec \"npm run prepare:es\"",
12
+ "pages-dev:webpack": "webpack serve --config ./examples-src/webpack/dev.js",
14
13
  "prepare:all": "npm run prepare:es && npm run prepare:cjs && npm run prepare:cdn",
15
14
  "prepare:es": "tsc ./src/ts/index.ts --outDir ./build/es --target es6 --module es6 --moduleResolution node --esModuleInterop true --allowSyntheticDefaultImports true --declaration true --declarationDir ./build/types --declarationMap true",
16
15
  "prepare:cjs": "tsc ./src/ts/index.ts --outDir ./build/cjs --target es5 --module commonjs --moduleResolution node --esModuleInterop true --allowSyntheticDefaultImports true",
17
16
  "prepare:cdn": "webpack --config ./config/webpack.cdn.js",
18
17
  "lint:js": "eslint . --ext .ts,.js",
19
- "prepare": "npm run prepare:all",
18
+ "docs": "typedoc --out examples-build/docs ./src/ts --theme default --hideGenerator",
19
+ "gh-pages": "git add examples-build/* && git commit -m \"Update github pages\" && npm run gh-pages:push",
20
+ "gh-pages:push": "git subtree split --prefix examples-build/ -b gh-pages-temp && git push -f origin gh-pages-temp:gh-pages && git branch -D gh-pages-temp",
21
+ "prepare": "npm run lint:js && npm run prepare:all && npm run pages-build && npm run docs && npm run gh-pages",
20
22
  "release": "npm publish"
21
23
  },
22
24
  "main": "./build/cjs/index.js",
@@ -57,6 +59,10 @@
57
59
  "text animation",
58
60
  "timeline"
59
61
  ],
62
+ "files": [
63
+ "src",
64
+ "build"
65
+ ],
60
66
  "author": "Anton Bobrov <anton.bobrov@hotmail.com>",
61
67
  "license": "MIT",
62
68
  "devDependencies": {
@@ -90,6 +96,7 @@
90
96
  "style-loader": "^3.2.1",
91
97
  "terser-webpack-plugin": "^5.1.4",
92
98
  "ts-loader": "^9.2.3",
99
+ "typedoc": "^0.22.15",
93
100
  "typescript": "^4.3.5",
94
101
  "webpack": "^5.41.1",
95
102
  "webpack-cli": "^4.7.2",
@@ -1,41 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var Timeline_1 = require("../../components/timeline/Timeline");
7
- var getScrollValues_1 = __importDefault(require("./getScrollValues"));
8
- /**
9
- * Scroll to coordinates
10
- */
11
- function scrollTo(_a) {
12
- var _b = _a.container, container = _b === void 0 ? window : _b, _c = _a.top, top = _c === void 0 ? 0 : _c, _d = _a.left, left = _d === void 0 ? 0 : _d, _e = _a.duration, duration = _e === void 0 ? 250 : _e;
13
- return new Promise(function (resolve, reject) {
14
- // save start values
15
- var startValues = (0, getScrollValues_1.default)(container);
16
- if (startValues) {
17
- // create animation
18
- var timeline = new Timeline_1.Timeline({
19
- duration: duration,
20
- });
21
- timeline.addCallback('progress', function (data) {
22
- if (container) {
23
- container.scrollTo({
24
- top: startValues.scrollTop
25
- + (top - startValues.scrollTop) * data.easing,
26
- left: startValues.scrollLeft
27
- + (left - startValues.scrollLeft) * data.easing,
28
- behavior: 'auto',
29
- });
30
- }
31
- });
32
- timeline.addCallback('end', function () {
33
- resolve();
34
- });
35
- timeline.play();
36
- return;
37
- }
38
- reject();
39
- });
40
- }
41
- exports.default = scrollTo;
@@ -1,34 +0,0 @@
1
- import { Timeline } from '../../components/timeline/Timeline';
2
- import getScrollValues from './getScrollValues';
3
- /**
4
- * Scroll to coordinates
5
- */
6
- export default function scrollTo({ container = window, top = 0, left = 0, duration = 250, }) {
7
- return new Promise((resolve, reject) => {
8
- // save start values
9
- const startValues = getScrollValues(container);
10
- if (startValues) {
11
- // create animation
12
- const timeline = new Timeline({
13
- duration,
14
- });
15
- timeline.addCallback('progress', (data) => {
16
- if (container) {
17
- container.scrollTo({
18
- top: startValues.scrollTop
19
- + (top - startValues.scrollTop) * data.easing,
20
- left: startValues.scrollLeft
21
- + (left - startValues.scrollLeft) * data.easing,
22
- behavior: 'auto',
23
- });
24
- }
25
- });
26
- timeline.addCallback('end', () => {
27
- resolve();
28
- });
29
- timeline.play();
30
- return;
31
- }
32
- reject();
33
- });
34
- }
@@ -1,28 +0,0 @@
1
- import { ScrollLike } from '../types/general';
2
- interface Props {
3
- /**
4
- * @default window
5
- */
6
- container?: Window | Element | ScrollLike;
7
- /**
8
- * top padding
9
- * @default 0
10
- */
11
- top?: number;
12
- /**
13
- * left padding
14
- * @default 0
15
- */
16
- left?: number;
17
- /**
18
- * scroll duration
19
- * @default 250
20
- */
21
- duration?: number;
22
- }
23
- /**
24
- * Scroll to coordinates
25
- */
26
- export default function scrollTo({ container, top, left, duration, }: Props): Promise<void>;
27
- export {};
28
- //# sourceMappingURL=to.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"to.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/scroll/to.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,UAAU,KAAK;IACX;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;IAC1C;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAE,EAC9B,SAAkB,EAClB,GAAO,EACP,IAAQ,EACR,QAAc,GACjB,EAAE,KAAK,iBA8BP"}