@pushword/js-helper 0.0.92 → 0.0.94

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushword/js-helper",
3
- "version": "0.0.92",
3
+ "version": "0.0.94",
4
4
  "description": "Pushword front end helpers. ",
5
5
  "author": "Robin@PiedWeb <contact@piedweb.com>",
6
6
  "license": "MIT",
@@ -11,7 +11,6 @@
11
11
  "140.css": "^1.0.1",
12
12
  "@babel/core": "^7.23",
13
13
  "@babel/preset-env": "^7.22.20",
14
- "@symfony/webpack-encore": "^4.1",
15
14
  "@tailwindcss/aspect-ratio": "^0.4",
16
15
  "@tailwindcss/forms": "^0.5",
17
16
  "@tailwindcss/typography": "^0.5",
@@ -25,7 +24,7 @@
25
24
  "fslightbox": "^3.2.2",
26
25
  "postcss": "^8.4.30",
27
26
  "postcss-import": "^15.0",
28
- "postcss-loader": "^7.0",
27
+ "postcss-loader": "^6.4|^7.0",
29
28
  "sass": "^1.68",
30
29
  "sass-loader": "^13.3",
31
30
  "simple-jekyll-search": "^1.9.1",
@@ -33,7 +32,8 @@
33
32
  "tailwindcss-animated": "^1.0.1",
34
33
  "tailwindcss-hero-patterns": "^0.1",
35
34
  "tailwindcss-multi-column": "^1.0.2",
36
- "webpack": "^5.72",
35
+ "@symfony/webpack-encore": "^4.5",
36
+ "webpack": "^5",
37
37
  "webpack-cli": "^4.9.1 || ^5.0.1",
38
38
  "webpack-watch-files-plugin": "^1.1.0"
39
39
  },
@@ -0,0 +1,26 @@
1
+ export function mouseSlider(toSlide, speed = 1) {
2
+ let isDown = false;
3
+ let startX;
4
+ let scrollLeft;
5
+ toSlide.addEventListener('mousedown', (e) => {
6
+ isDown = true;
7
+ toSlide.classList.add('active');
8
+ startX = e.pageX - toSlide.offsetLeft;
9
+ scrollLeft = toSlide.scrollLeft;
10
+ });
11
+ toSlide.addEventListener('mouseleave', () => {
12
+ isDown = false;
13
+ toSlide.classList.remove('active');
14
+ });
15
+ toSlide.addEventListener('mouseup', () => {
16
+ isDown = false;
17
+ toSlide.classList.remove('active');
18
+ });
19
+ toSlide.addEventListener('mousemove', (e) => {
20
+ if (!isDown) return;
21
+ e.preventDefault();
22
+ const x = e.pageX - toSlide.offsetLeft;
23
+ const walk = (x - startX) * speed;
24
+ toSlide.scrollLeft = scrollLeft - walk;
25
+ });
26
+ }
package/src/encore.js CHANGED
@@ -17,7 +17,7 @@ function getFilesToWatch(basePath = './..') {
17
17
  }
18
18
  function getTailwindConfig(watchFiles = null) {
19
19
  if (watchFiles === null) watchFiles = getFilesToWatch();
20
- var tailwindConfig = require('@pushword/js-helper/src/tailwind.config.js');
20
+ var tailwindConfig = require('./tailwind.config.js');
21
21
  tailwindConfig.content = watchFiles;
22
22
  return tailwindConfig;
23
23
  }
@@ -1,5 +1,5 @@
1
1
  const plugin = require('tailwindcss/plugin');
2
- const pushwordHelper = require('@pushword/js-helper/src/tailwind.helpers.js');
2
+ const pushwordHelper = require('./tailwind.helpers.js');
3
3
 
4
4
  module.exports = {
5
5
  mode: 'jit',