ember-safe-button 3.2.0 → 4.0.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/package.json CHANGED
@@ -1,64 +1,90 @@
1
1
  {
2
2
  "name": "ember-safe-button",
3
- "version": "3.2.0",
3
+ "version": "4.0.0",
4
4
  "description": "For potentially dangerous actions that better needs a confirmation.",
5
+ "keywords": [
6
+ "ember-addon"
7
+ ],
5
8
  "repository": "https://gitlab.com/michal-bryxi/open-source/ember-safe-button",
6
9
  "license": "MIT",
7
10
  "author": "",
11
+ "imports": {
12
+ "#src/*": "./src/*"
13
+ },
8
14
  "exports": {
9
- ".": "./dist/index.js",
10
- "./*": "./dist/*",
11
- "./addon-main.js": "./addon-main.js"
15
+ ".": {
16
+ "default": "./dist/index.js"
17
+ },
18
+ "./addon-main.js": "./addon-main.cjs",
19
+ "./*.css": "./dist/*.css",
20
+ "./*": {
21
+ "default": "./dist/*.js"
22
+ }
12
23
  },
13
24
  "files": [
14
- "dist",
15
25
  "addon-main.cjs",
16
- "CHANGELOG.md",
17
- "README.md"
26
+ "declarations",
27
+ "dist",
28
+ "src"
18
29
  ],
19
30
  "dependencies": {
20
- "@ember/render-modifiers": "2.1.0",
21
- "@embroider/addon-shim": "1.10.2",
22
- "ember-cli-htmlbars": "^6.2.0",
31
+ "@ember/render-modifiers": "3.0.0",
32
+ "@embroider/addon-shim": "^1.10.2",
33
+ "decorator-transforms": "^2.2.2",
23
34
  "ember-concurrency": "5.1.0",
24
- "ember-modifier": "4.1.0"
35
+ "ember-modifier": "4.2.2"
25
36
  },
26
37
  "devDependencies": {
27
- "@babel/core": "7.23.2",
28
- "@babel/plugin-proposal-class-properties": "7.18.6",
29
- "@babel/plugin-proposal-decorators": "7.23.2",
30
- "@babel/plugin-syntax-decorators": "7.22.10",
31
- "@embroider/addon-dev": "8.1.2",
32
- "@nullvoxpopuli/eslint-configs": "2.3.5",
33
- "@rollup/plugin-babel": "6.0.4",
34
- "babel-eslint": "10.1.0",
35
- "concurrently": "7.6.0",
36
- "eslint": "^7.0.0",
37
- "eslint-config-prettier": "8.5.0",
38
- "eslint-plugin-decorator-position": "4.0.1",
39
- "eslint-plugin-ember": "10.6.1",
40
- "eslint-plugin-import": "2.26.0",
41
- "eslint-plugin-json": "3.1.0",
42
- "eslint-plugin-node": "11.1.0",
43
- "@ember/string": "3.1.1",
44
- "eslint-plugin-prettier": "4.2.1",
45
- "webpack": "^5.88.1",
46
- "eslint-plugin-simple-import-sort": "7.0.0",
47
- "rollup": "4.54.0"
48
- },
49
- "publishConfig": {
50
- "registry": "https://registry.npmjs.org"
38
+ "@babel/core": "^7.25.2",
39
+ "@babel/eslint-parser": "^7.25.1",
40
+ "@babel/runtime": "^7.25.6",
41
+ "@ember/app-tsconfig": "^1.0.3",
42
+ "@ember/library-tsconfig": "^1.0.0",
43
+ "@ember/test-helpers": "^5.2.1",
44
+ "@ember/test-waiters": "^4.1.1",
45
+ "@embroider/addon-dev": "^8.1.0",
46
+ "@embroider/compat": "^4.1.0",
47
+ "@embroider/core": "^4.1.0",
48
+ "@embroider/macros": "^1.18.0",
49
+ "@embroider/vite": "^1.1.5",
50
+ "@eslint/js": "^9.17.0",
51
+ "@glimmer/component": "^2.0.0",
52
+ "@rollup/plugin-babel": "^6.0.4",
53
+ "@tailwindcss/vite": "^4.0.0",
54
+ "babel-plugin-ember-template-compilation": "^2.2.5",
55
+ "concurrently": "^9.0.1",
56
+ "ember-concurrency": "5.1.0",
57
+ "ember-modifier": "4.2.2",
58
+ "ember-page-title": "^9.0.3",
59
+ "ember-qunit": "^9.0.2",
60
+ "ember-source": "^6.7.0",
61
+ "ember-strict-application-resolver": "^0.1.0",
62
+ "ember-template-lint": "^7.9.0",
63
+ "eslint": "^9.17.0",
64
+ "eslint-config-prettier": "^10.1.5",
65
+ "eslint-plugin-ember": "^12.3.3",
66
+ "eslint-plugin-import": "^2.31.0",
67
+ "eslint-plugin-n": "^17.15.1",
68
+ "globals": "^16.1.0",
69
+ "netlify-cli": "^23.13.0",
70
+ "node-gyp": "^12.1.0",
71
+ "prettier": "^3.4.2",
72
+ "prettier-plugin-ember-template-tag": "^2.0.4",
73
+ "qunit": "^2.24.1",
74
+ "qunit-dom": "^3.4.0",
75
+ "rollup": "^4.22.5",
76
+ "sinon": "^21.0.1",
77
+ "tailwindcss": "^4.0.0",
78
+ "testem": "^3.15.1",
79
+ "vite": "^7.1.9"
51
80
  },
52
81
  "ember": {
53
82
  "edition": "octane"
54
83
  },
55
- "keywords": [
56
- "ember-addon"
57
- ],
58
84
  "ember-addon": {
59
85
  "version": 2,
60
86
  "type": "addon",
61
- "main": "./addon-main.cjs",
87
+ "main": "addon-main.cjs",
62
88
  "app-js": {
63
89
  "./components/safe-button/animations/flip.js": "./dist/_app_/components/safe-button/animations/flip.js",
64
90
  "./components/safe-button/animations/index.js": "./dist/_app_/components/safe-button/animations/index.js",
@@ -73,22 +99,18 @@
73
99
  "./modifiers/animate-me.js": "./dist/_app_/modifiers/animate-me.js"
74
100
  }
75
101
  },
76
- "engines": {
77
- "node": "12.* || 14.* || >= 16"
78
- },
79
- "volta": {
80
- "extends": "../package.json"
81
- },
82
102
  "scripts": {
83
- "start": "concurrently 'npm:watch:*'",
84
- "build": "concurrently 'npm:build:*'",
85
- "build:js": "rollup -c ./rollup.config.mjs",
86
- "build:docs": "cp ../README.md ./README.md",
87
- "watch:js": "rollup -c --watch --no-watch.clearScreen",
88
- "lint": "concurrently 'npm:lint:js'",
89
- "lint:fix": "concurrently 'npm:lint:js:fix'",
103
+ "build": "rollup --config",
104
+ "format": "prettier . --cache --write",
105
+ "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
106
+ "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto && pnpm run format",
107
+ "lint:format": "prettier . --cache --check",
108
+ "lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
109
+ "lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
90
110
  "lint:js": "eslint . --cache",
91
111
  "lint:js:fix": "eslint . --fix",
92
- "test": "echo 'Addon does not have tests, run tests in test-app'"
112
+ "start": "vite dev",
113
+ "demo:build": "pnpm build && VITE_BUILD_TARGET=demo vite build --out-dir dist-demo --emptyOutDir",
114
+ "test": "vite build --mode=development --out-dir dist-tests && testem --file testem.cjs ci --port 0"
93
115
  }
94
116
  }
@@ -0,0 +1,114 @@
1
+ // TODO: https://github.com/animate-css/animate.css/blob/main/source/flippers/flipOutX.css
2
+ // TODO: https://github.com/animate-css/animate.css/blob/main/source/flippers/flipInX.css
3
+ export default {
4
+ safety: {
5
+ unlocking: {
6
+ keyframes: [
7
+ { transform: 'perspective(400px)', offset: 0 },
8
+ {
9
+ transform: 'perspective(400px) rotate3d(1, 0, 0, -20deg)',
10
+ offset: 0.3 / 2,
11
+ opacity: 1,
12
+ },
13
+ {
14
+ transform: 'perspective(400px) rotate3d(1, 0, 0, 90deg)',
15
+ offset: 1 / 2,
16
+ opacity: 0,
17
+ },
18
+ ],
19
+ options: {
20
+ duration: 1000,
21
+ fill: 'forwards',
22
+ easing: 'ease-in',
23
+ },
24
+ },
25
+ locking: {
26
+ keyframes: [
27
+ {
28
+ transform: 'perspective(400px) rotate3d(1, 0, 0, 90deg)',
29
+ offset: 0,
30
+ opacity: 0,
31
+ },
32
+ {
33
+ transform: ['perspective(400px)', 'rotate3d(1, 0, 0, -20deg)'],
34
+ offset: 0.4 / 2 + 0.5,
35
+ },
36
+ {
37
+ transform: ['perspective(400px)', 'rotate3d(1, 0, 0, 10deg)'],
38
+ offset: 0.6 / 2 + 0.5,
39
+ opacity: 1,
40
+ },
41
+ {
42
+ transform: ['perspective(400px)', 'rotate3d(1, 0, 0, -5deg)'],
43
+ offset: 0.8 / 2 + 0.5,
44
+ opacity: 1,
45
+ },
46
+ {
47
+ transform: 'perspective(400px)',
48
+ offset: 1 / 2 + 0.5,
49
+ opacity: 1,
50
+ },
51
+ ],
52
+ options: {
53
+ duration: 1000,
54
+ fill: 'forwards',
55
+ easing: 'ease-in',
56
+ },
57
+ },
58
+ },
59
+ trigger: {
60
+ unlocking: {
61
+ keyframes: [
62
+ {
63
+ transform: 'perspective(400px) rotate3d(1, 0, 0, 90deg)',
64
+ offset: 0 + 0.5,
65
+ opacity: 0,
66
+ },
67
+ {
68
+ transform: 'perspective(400px) rotate3d(1, 0, 0, -20deg)',
69
+ offset: 0.4 / 2 + 0.5,
70
+ },
71
+ {
72
+ transform: 'perspective(400px) rotate3d(1, 0, 0, 10deg)',
73
+ offset: 0.6 / 2 + 0.5,
74
+ opacity: 1,
75
+ },
76
+ {
77
+ transform: 'perspective(400px) rotate3d(1, 0, 0, -5deg)',
78
+ offset: 0.8 / 2 + 0.5,
79
+ opacity: 1,
80
+ },
81
+ {
82
+ transform: 'perspective(400px)',
83
+ offset: 1 / 2 + 0.5,
84
+ opacity: 1,
85
+ },
86
+ ],
87
+ options: {
88
+ duration: 1000,
89
+ fill: 'forwards',
90
+ easing: 'ease-in',
91
+ },
92
+ },
93
+ locking: {
94
+ keyframes: [
95
+ { transform: 'perspective(400px)', offset: 0 },
96
+ {
97
+ transform: 'perspective(400px) rotate3d(1, 0, 0, -20deg)',
98
+ offset: 0.3 / 2,
99
+ opacity: 1,
100
+ },
101
+ {
102
+ transform: 'perspective(400px) rotate3d(1, 0, 0, 90deg)',
103
+ offset: 1 / 2,
104
+ opacity: 0,
105
+ },
106
+ ],
107
+ options: {
108
+ duration: 1000,
109
+ fill: 'forwards',
110
+ easing: 'ease-in',
111
+ },
112
+ },
113
+ },
114
+ };
@@ -0,0 +1,15 @@
1
+ import poing from './poing.js';
2
+ import slide from './slide.js';
3
+ import roll from './roll.js';
4
+ import flip from './flip.js';
5
+ import liftBars from './lift-bars.js';
6
+ import zoom from './zoom.js';
7
+
8
+ export default {
9
+ poing,
10
+ slide,
11
+ flip,
12
+ zoom,
13
+ roll,
14
+ 'lift-bars': liftBars,
15
+ };
@@ -0,0 +1,50 @@
1
+ export default {
2
+ safety: {
3
+ unlocking: {
4
+ keyframes: [
5
+ { transform: 'translate3d(0, 0, 0)' },
6
+ { transform: 'translate3d(0, -100%, 0)' },
7
+ ],
8
+ options: {
9
+ duration: 1000,
10
+ fill: 'both',
11
+ easing: 'ease',
12
+ },
13
+ },
14
+ locking: {
15
+ keyframes: [
16
+ { transform: 'translate3d(0, -100%, 0)' },
17
+ { transform: 'translate3d(0, 0, 0)' },
18
+ ],
19
+ options: {
20
+ duration: 1000,
21
+ fill: 'both',
22
+ easing: 'ease',
23
+ },
24
+ },
25
+ },
26
+ trigger: {
27
+ unlocking: {
28
+ keyframes: [
29
+ // { transform: 'translateX(100%)' },
30
+ // { transform: 'translateX(0)' },
31
+ ],
32
+ options: {
33
+ duration: 1000,
34
+ fill: 'both',
35
+ easing: 'ease',
36
+ },
37
+ },
38
+ locking: {
39
+ keyframes: [
40
+ // { transform: 'translateX(0)' },
41
+ // { transform: 'translateX(100%)' },
42
+ ],
43
+ options: {
44
+ duration: 1000,
45
+ fill: 'both',
46
+ easing: 'ease',
47
+ },
48
+ },
49
+ },
50
+ };
@@ -0,0 +1,99 @@
1
+ export default {
2
+ safety: {
3
+ unlocking: {
4
+ keyframes: [
5
+ { transform: 'scale(1)', opacity: 1, offset: 0 },
6
+ {
7
+ transform: 'translateX(0px) scale(0.7)',
8
+ opacity: 0.7,
9
+ offset: 0.2,
10
+ },
11
+ {
12
+ transform: 'translateX(-2000px) scale(0.7)',
13
+ opacity: 0.7,
14
+ offset: 1,
15
+ },
16
+ ],
17
+ options: {
18
+ duration: 2000,
19
+ fill: 'both',
20
+ easing: 'ease',
21
+ },
22
+ },
23
+ locking: {
24
+ keyframes: [
25
+ {
26
+ transform: 'translateX(-2000px) scale(0.7)',
27
+ opacity: 0.7,
28
+ offset: 0,
29
+ },
30
+ {
31
+ transform: 'translateX(0px) scale(0.7)',
32
+ opacity: 0.7,
33
+ offset: 0.8,
34
+ },
35
+ { transform: 'scale(1)', opacity: 1, offset: 1 },
36
+ ],
37
+ options: {
38
+ duration: 2000,
39
+ fill: 'both',
40
+ easing: 'ease',
41
+ },
42
+ },
43
+ },
44
+ trigger: {
45
+ unlocking: {
46
+ keyframes: [
47
+ {
48
+ opacity: 0,
49
+ transform: 'translate3d(3000px, 0, 0) scaleX(3)',
50
+ offset: 0,
51
+ },
52
+ {
53
+ opacity: 1,
54
+ transform: 'translate3d(-25px, 0, 0) scaleX(1)',
55
+ offset: 0.6,
56
+ },
57
+ {
58
+ opacity: 1,
59
+ transform: 'translate3d(10px, 0, 0) scaleX(0.98)',
60
+ offset: 0.75,
61
+ },
62
+ {
63
+ opacity: 1,
64
+ transform: 'translate3d(-5px, 0, 0) scaleX(0.995)',
65
+ offset: 0.9,
66
+ },
67
+ {
68
+ opacity: 1,
69
+ transform: 'translate3d(0, 0, 0)',
70
+ offset: 1,
71
+ },
72
+ ],
73
+ options: {
74
+ duration: 2000,
75
+ fill: 'both',
76
+ easing: 'cubic-bezier(0.215, 0.61, 0.355, 1)',
77
+ },
78
+ },
79
+ locking: {
80
+ keyframes: [
81
+ {
82
+ opacity: 1,
83
+ transform: 'translate3d(-20px, 0, 0) scaleX(0.9)',
84
+ offset: 0.2,
85
+ },
86
+ {
87
+ opacity: 0,
88
+ transform: 'translate3d(2000px, 0, 0) scaleX(2)',
89
+ offset: 1,
90
+ },
91
+ ],
92
+ options: {
93
+ duration: 2000,
94
+ fill: 'both',
95
+ easing: 'ease',
96
+ },
97
+ },
98
+ },
99
+ };
@@ -0,0 +1,50 @@
1
+ export default {
2
+ safety: {
3
+ unlocking: {
4
+ keyframes: [
5
+ { transform: 'translateX(0)' },
6
+ { transform: 'translateX(-100%) rotate(-180deg)' },
7
+ ],
8
+ options: {
9
+ duration: 1000,
10
+ fill: 'both',
11
+ easing: 'ease',
12
+ },
13
+ },
14
+ locking: {
15
+ keyframes: [
16
+ { transform: 'translateX(-100%) rotate(-180deg)' },
17
+ { transform: 'translateX(0)' },
18
+ ],
19
+ options: {
20
+ duration: 1000,
21
+ fill: 'both',
22
+ easing: 'ease',
23
+ },
24
+ },
25
+ },
26
+ trigger: {
27
+ unlocking: {
28
+ keyframes: [
29
+ { transform: 'translateX(100%) rotate(180deg)' },
30
+ { transform: 'translateX(0)' },
31
+ ],
32
+ options: {
33
+ duration: 1000,
34
+ fill: 'both',
35
+ easing: 'ease',
36
+ },
37
+ },
38
+ locking: {
39
+ keyframes: [
40
+ { transform: 'translateX(0)' },
41
+ { transform: 'translateX(100%) rotate(180deg)' },
42
+ ],
43
+ options: {
44
+ duration: 1000,
45
+ fill: 'both',
46
+ easing: 'ease',
47
+ },
48
+ },
49
+ },
50
+ };
@@ -0,0 +1,50 @@
1
+ export default {
2
+ safety: {
3
+ unlocking: {
4
+ keyframes: [
5
+ { transform: 'translateX(0)' },
6
+ { transform: 'translateX(-100%)' },
7
+ ],
8
+ options: {
9
+ duration: 1000,
10
+ fill: 'both',
11
+ easing: 'ease',
12
+ },
13
+ },
14
+ locking: {
15
+ keyframes: [
16
+ { transform: 'translateX(-100%)' },
17
+ { transform: 'translateX(0)' },
18
+ ],
19
+ options: {
20
+ duration: 1000,
21
+ fill: 'both',
22
+ easing: 'ease',
23
+ },
24
+ },
25
+ },
26
+ trigger: {
27
+ unlocking: {
28
+ keyframes: [
29
+ { transform: 'translateX(100%)' },
30
+ { transform: 'translateX(0)' },
31
+ ],
32
+ options: {
33
+ duration: 1000,
34
+ fill: 'both',
35
+ easing: 'ease',
36
+ },
37
+ },
38
+ locking: {
39
+ keyframes: [
40
+ { transform: 'translateX(0)' },
41
+ { transform: 'translateX(100%)' },
42
+ ],
43
+ options: {
44
+ duration: 1000,
45
+ fill: 'both',
46
+ easing: 'ease',
47
+ },
48
+ },
49
+ },
50
+ };
@@ -0,0 +1,52 @@
1
+ export default {
2
+ safety: {
3
+ unlocking: {
4
+ keyframes: [
5
+ { offset: 0, transform: 'translate3d(0, 0, 0)' },
6
+ { offset: 1, transform: 'translate3d(100%, 0, 0)' },
7
+ ],
8
+ options: {
9
+ duration: 1000,
10
+ fill: 'both',
11
+ easing: 'ease',
12
+ },
13
+ },
14
+ locking: {
15
+ keyframes: [
16
+ { offset: 0, transform: 'translate3d(-100%, 0, 0)' },
17
+ { offset: 1, transform: 'translate3d(0, 0, 0)' },
18
+ ],
19
+ options: {
20
+ duration: 1000,
21
+ fill: 'both',
22
+ easing: 'ease',
23
+ },
24
+ },
25
+ },
26
+ trigger: {
27
+ unlocking: {
28
+ keyframes: [
29
+ { offset: 0, opacity: 0, transform: 'scale3d(0.3, 0.3, 0.3)' },
30
+ { offset: 0.5, opacity: 1 },
31
+ { offset: 1, opacity: 1 },
32
+ ],
33
+ options: {
34
+ duration: 1000,
35
+ fill: 'both',
36
+ easing: 'ease',
37
+ },
38
+ },
39
+ locking: {
40
+ keyframes: [
41
+ { offset: 0, opacity: 1 },
42
+ { offset: 0.5, opacity: 0, transform: 'scale3d(0.3, 0.3, 0.3)' },
43
+ { offset: 1, opacity: 0 },
44
+ ],
45
+ options: {
46
+ duration: 1000,
47
+ fill: 'both',
48
+ easing: 'ease',
49
+ },
50
+ },
51
+ },
52
+ };