ember-safe-button 2.1.1 → 3.1.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.
Files changed (76) hide show
  1. package/README.md +9 -3
  2. package/addon-main.cjs +6 -0
  3. package/dist/_app_/components/safe-button/animations/flip.js +1 -0
  4. package/dist/_app_/components/safe-button/animations/index.js +1 -0
  5. package/dist/_app_/components/safe-button/animations/lift-bars.js +1 -0
  6. package/dist/_app_/components/safe-button/animations/poing.js +1 -0
  7. package/dist/_app_/components/safe-button/animations/roll.js +1 -0
  8. package/dist/_app_/components/safe-button/animations/slide.js +1 -0
  9. package/dist/_app_/components/safe-button/animations/zoom.js +1 -0
  10. package/dist/_app_/components/safe-button/index.js +1 -0
  11. package/dist/_app_/components/safety/index.js +1 -0
  12. package/dist/_app_/components/trigger/index.js +1 -0
  13. package/dist/_app_/modifiers/animate-me.js +1 -0
  14. package/dist/components/safe-button/animations/flip.js +103 -0
  15. package/dist/components/safe-button/animations/flip.js.map +1 -0
  16. package/dist/components/safe-button/animations/index.js +18 -0
  17. package/dist/components/safe-button/animations/index.js.map +1 -0
  18. package/{addon → dist}/components/safe-button/animations/lift-bars.js +25 -20
  19. package/dist/components/safe-button/animations/lift-bars.js.map +1 -0
  20. package/dist/components/safe-button/animations/poing.js +93 -0
  21. package/dist/components/safe-button/animations/poing.js.map +1 -0
  22. package/dist/components/safe-button/animations/roll.js +57 -0
  23. package/dist/components/safe-button/animations/roll.js.map +1 -0
  24. package/dist/components/safe-button/animations/slide.js +57 -0
  25. package/dist/components/safe-button/animations/slide.js.map +1 -0
  26. package/dist/components/safe-button/animations/zoom.js +73 -0
  27. package/dist/components/safe-button/animations/zoom.js.map +1 -0
  28. package/dist/components/safe-button/index.js +9 -0
  29. package/dist/components/safe-button/index.js.map +1 -0
  30. package/dist/components/safety/index.js +49 -0
  31. package/dist/components/safety/index.js.map +1 -0
  32. package/dist/components/trigger/index.js +40 -0
  33. package/dist/components/trigger/index.js.map +1 -0
  34. package/dist/index-447fee60.js +243 -0
  35. package/dist/index-447fee60.js.map +1 -0
  36. package/dist/index.js +2 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/modifiers/animate-me.js +22 -0
  39. package/dist/modifiers/animate-me.js.map +1 -0
  40. package/package.json +70 -69
  41. package/.gitlab-ci.yml +0 -27
  42. package/.prettierignore +0 -21
  43. package/.prettierrc.js +0 -5
  44. package/.vscode/settings.json +0 -19
  45. package/CHANGELOG.md +0 -126
  46. package/LICENSE.md +0 -9
  47. package/addon/components/safe-button/animations/flip.js +0 -114
  48. package/addon/components/safe-button/animations/index.js +0 -15
  49. package/addon/components/safe-button/animations/poing.js +0 -99
  50. package/addon/components/safe-button/animations/roll.js +0 -50
  51. package/addon/components/safe-button/animations/slide.js +0 -50
  52. package/addon/components/safe-button/animations/zoom.js +0 -52
  53. package/addon/components/safe-button/index.hbs +0 -35
  54. package/addon/components/safe-button/index.js +0 -184
  55. package/addon/components/safety/index.hbs +0 -20
  56. package/addon/components/safety/index.js +0 -41
  57. package/addon/components/trigger/index.hbs +0 -20
  58. package/addon/components/trigger/index.js +0 -31
  59. package/addon/modifiers/animate-me.js +0 -20
  60. package/app/components/safe-button.js +0 -1
  61. package/app/components/safety.js +0 -1
  62. package/app/components/trigger.js +0 -2
  63. package/app/modifiers/animate-me.js +0 -1
  64. package/app/templates/components/safe-button.js +0 -1
  65. package/app/templates/components/safety.js +0 -1
  66. package/app/templates/components/trigger.js +0 -1
  67. package/config/addon-docs.js +0 -13
  68. package/config/deploy.js +0 -29
  69. package/config/environment.js +0 -5
  70. package/config/tailwindcss-config.js +0 -924
  71. package/doc/demo.gif +0 -0
  72. package/doc/logo.png +0 -0
  73. package/index.js +0 -5
  74. package/netlify.toml +0 -3
  75. package/renovate.json +0 -75
  76. package/yarn-error.log +0 -13431
@@ -0,0 +1,49 @@
1
+ import { S as SAFETY_STATUS, _ as _defineProperty } from '../../index-447fee60.js';
2
+ import Component from '@glimmer/component';
3
+ import { precompileTemplate } from '@ember/template-compilation';
4
+ import { setComponentTemplate } from '@ember/component';
5
+
6
+ var TEMPLATE = precompileTemplate("<button\n class={{this.BASIC_CLASS}}\n disabled={{this.isDisabled}}\n aria-label={{this.ariaLabel}}\n type=\'button\'\n tabindex={{if this.isDisabled \'-1\' \'0\'}}\n ...attributes\n {{on \'click\' @onClick}}\n {{animate-me\n safetyStatus=@safetyStatus\n webAnimations=@webAnimations\n focusMe=this.focusMe\n }}\n>\n {{#if (has-block)}}\n {{yield}}\n {{else}}\n {{@displayedMessage}}\n {{/if}}\n</button>");
7
+
8
+ const BASIC_CLASS = 'ember-safe-button-safety';
9
+ const ARIA_LABELS = {
10
+ [SAFETY_STATUS.LOCKED]: 'Deactivate safety',
11
+ [SAFETY_STATUS.UNLOCKING]: 'Deactivating safety',
12
+ [SAFETY_STATUS.UNLOCKED]: 'Safety not active',
13
+ [SAFETY_STATUS.LOCKING]: 'Activating safety'
14
+ };
15
+
16
+ /**
17
+ Safety is a component that covers the trigger.
18
+
19
+ ```hbs
20
+ <SafeButton
21
+ @onConfirm={{action safeButtonClicked}} as |button|
22
+ >
23
+ <button.safety class="bg-grey-light">
24
+ This is safety
25
+ </button.safety>
26
+ </SafeButton>
27
+ ```
28
+
29
+ @class SafetyComponent
30
+ */
31
+ class SafetyComponent extends Component {
32
+ constructor(...args) {
33
+ super(...args);
34
+ _defineProperty(this, "BASIC_CLASS", BASIC_CLASS);
35
+ }
36
+ get isDisabled() {
37
+ return this.args.safetyStatus === SAFETY_STATUS.UNLOCKED;
38
+ }
39
+ get focusMe() {
40
+ return !this.isDisabled;
41
+ }
42
+ get ariaLabel() {
43
+ return ARIA_LABELS[this.args.safetyStatus];
44
+ }
45
+ }
46
+ setComponentTemplate(TEMPLATE, SafetyComponent);
47
+
48
+ export { ARIA_LABELS, BASIC_CLASS, SafetyComponent as default };
49
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/safety/index.hbs.js","../../../src/components/safety/index.js"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"<button\\n class={{this.BASIC_CLASS}}\\n disabled={{this.isDisabled}}\\n aria-label={{this.ariaLabel}}\\n type=\\'button\\'\\n tabindex={{if this.isDisabled \\'-1\\' \\'0\\'}}\\n ...attributes\\n {{on \\'click\\' @onClick}}\\n {{animate-me\\n safetyStatus=@safetyStatus\\n webAnimations=@webAnimations\\n focusMe=this.focusMe\\n }}\\n>\\n {{#if (has-block)}}\\n {{yield}}\\n {{else}}\\n {{@displayedMessage}}\\n {{/if}}\\n</button>\")","import Component from '@glimmer/component';\n\nimport { SAFETY_STATUS } from '../safe-button/index';\n\nexport const BASIC_CLASS = 'ember-safe-button-safety';\nexport const ARIA_LABELS = {\n [SAFETY_STATUS.LOCKED]: 'Deactivate safety',\n [SAFETY_STATUS.UNLOCKING]: 'Deactivating safety',\n [SAFETY_STATUS.UNLOCKED]: 'Safety not active',\n [SAFETY_STATUS.LOCKING]: 'Activating safety',\n};\n\n/**\n Safety is a component that covers the trigger.\n\n ```hbs\n <SafeButton\n @onConfirm={{action safeButtonClicked}} as |button|\n >\n <button.safety class=\"bg-grey-light\">\n This is safety\n </button.safety>\n </SafeButton>\n ```\n\n @class SafetyComponent\n */\nexport default class SafetyComponent extends Component {\n BASIC_CLASS = BASIC_CLASS;\n\n get isDisabled() {\n return this.args.safetyStatus === SAFETY_STATUS.UNLOCKED;\n }\n\n get focusMe() {\n return !this.isDisabled;\n }\n\n get ariaLabel() {\n return ARIA_LABELS[this.args.safetyStatus];\n }\n}\n"],"names":["precompileTemplate","BASIC_CLASS","ARIA_LABELS","SAFETY_STATUS","LOCKED","UNLOCKING","UNLOCKED","LOCKING","SafetyComponent","Component","constructor","args","_defineProperty","isDisabled","safetyStatus","focusMe","ariaLabel","setComponentTemplate","TEMPLATE"],"mappings":";;;;;AACA,eAAeA,kBAAkB,CAAC,ibAAib,CAAC;;ACG7c,MAAMC,WAAW,GAAG,2BAA0B;AAC9C,MAAMC,WAAW,GAAG;AACzB,EAAA,CAACC,aAAa,CAACC,MAAM,GAAG,mBAAmB;AAC3C,EAAA,CAACD,aAAa,CAACE,SAAS,GAAG,qBAAqB;AAChD,EAAA,CAACF,aAAa,CAACG,QAAQ,GAAG,mBAAmB;EAC7C,CAACH,aAAa,CAACI,OAAO,GAAG,mBAAA;AAC3B,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,MAAMC,eAAe,SAASC,SAAS,CAAC;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,eAAA,sBACvCX,WAAW,CAAA,CAAA;AAAA,GAAA;EAEzB,IAAIY,UAAUA,GAAG;IACf,OAAO,IAAI,CAACF,IAAI,CAACG,YAAY,KAAKX,aAAa,CAACG,QAAQ,CAAA;AAC1D,GAAA;EAEA,IAAIS,OAAOA,GAAG;IACZ,OAAO,CAAC,IAAI,CAACF,UAAU,CAAA;AACzB,GAAA;EAEA,IAAIG,SAASA,GAAG;AACd,IAAA,OAAOd,WAAW,CAAC,IAAI,CAACS,IAAI,CAACG,YAAY,CAAC,CAAA;AAC5C,GAAA;AACF,CAAA;AAACG,oBAAA,CAAAC,QAAA,EAdoBV,eAAe,CAAA;;;;"}
@@ -0,0 +1,40 @@
1
+ import { _ as _defineProperty, S as SAFETY_STATUS } from '../../index-447fee60.js';
2
+ import Component from '@glimmer/component';
3
+ import { precompileTemplate } from '@ember/template-compilation';
4
+ import { setComponentTemplate } from '@ember/component';
5
+
6
+ var TEMPLATE = precompileTemplate("<button\n class={{this.BASIC_CLASS}}\n disabled={{this.isDisabled}}\n aria-label=\'Confirm action\'\n type=\'button\'\n tabindex={{if this.isDisabled \'-1\' \'0\'}}\n ...attributes\n {{on \'click\' @onClick}}\n {{animate-me\n safetyStatus=@safetyStatus\n webAnimations=@webAnimations\n focusMe=this.focusMe\n }}\n>\n {{#if (has-block)}}\n {{yield}}\n {{else}}\n {{@displayedMessage}}\n {{/if}}\n</button>");
7
+
8
+ const BASIC_CLASS = 'ember-safe-button-trigger';
9
+
10
+ /**
11
+ Trigger is a component that is by default covered by safety and triggers the action passed to <SafeButton> when clicked.
12
+
13
+ ```hbs
14
+ <SafeButton
15
+ @onConfirm={{action safeButtonClicked}} as |button|
16
+ >
17
+ <button.trigger class="bg-red-dark">
18
+ Trigger
19
+ </button.trigger>
20
+ </SafeButton>
21
+ ```
22
+
23
+ @class SafetyComponent
24
+ */
25
+ class TriggerComponent extends Component {
26
+ constructor(...args) {
27
+ super(...args);
28
+ _defineProperty(this, "BASIC_CLASS", BASIC_CLASS);
29
+ }
30
+ get isDisabled() {
31
+ return this.args.safetyStatus !== SAFETY_STATUS.UNLOCKED;
32
+ }
33
+ get focusMe() {
34
+ return !this.isDisabled;
35
+ }
36
+ }
37
+ setComponentTemplate(TEMPLATE, TriggerComponent);
38
+
39
+ export { BASIC_CLASS, TriggerComponent as default };
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/trigger/index.hbs.js","../../../src/components/trigger/index.js"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"<button\\n class={{this.BASIC_CLASS}}\\n disabled={{this.isDisabled}}\\n aria-label=\\'Confirm action\\'\\n type=\\'button\\'\\n tabindex={{if this.isDisabled \\'-1\\' \\'0\\'}}\\n ...attributes\\n {{on \\'click\\' @onClick}}\\n {{animate-me\\n safetyStatus=@safetyStatus\\n webAnimations=@webAnimations\\n focusMe=this.focusMe\\n }}\\n>\\n {{#if (has-block)}}\\n {{yield}}\\n {{else}}\\n {{@displayedMessage}}\\n {{/if}}\\n</button>\")","import Component from '@glimmer/component';\n\nimport { SAFETY_STATUS } from '../safe-button/index';\n\nexport const BASIC_CLASS = 'ember-safe-button-trigger';\n\n/**\n Trigger is a component that is by default covered by safety and triggers the action passed to <SafeButton> when clicked.\n\n ```hbs\n <SafeButton\n @onConfirm={{action safeButtonClicked}} as |button|\n >\n <button.trigger class=\"bg-red-dark\">\n Trigger\n </button.trigger>\n </SafeButton>\n ```\n\n @class SafetyComponent\n */\nexport default class TriggerComponent extends Component {\n BASIC_CLASS = BASIC_CLASS;\n\n get isDisabled() {\n return this.args.safetyStatus !== SAFETY_STATUS.UNLOCKED;\n }\n\n get focusMe() {\n return !this.isDisabled;\n }\n}\n"],"names":["precompileTemplate","BASIC_CLASS","TriggerComponent","Component","constructor","args","_defineProperty","isDisabled","safetyStatus","SAFETY_STATUS","UNLOCKED","focusMe","setComponentTemplate","TEMPLATE"],"mappings":";;;;;AACA,eAAeA,kBAAkB,CAAC,ibAAib,CAAC;;ACG7c,MAAMC,WAAW,GAAG,4BAA2B;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,MAAMC,gBAAgB,SAASC,SAAS,CAAC;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,eAAA,sBACxCL,WAAW,CAAA,CAAA;AAAA,GAAA;EAEzB,IAAIM,UAAUA,GAAG;IACf,OAAO,IAAI,CAACF,IAAI,CAACG,YAAY,KAAKC,aAAa,CAACC,QAAQ,CAAA;AAC1D,GAAA;EAEA,IAAIC,OAAOA,GAAG;IACZ,OAAO,CAAC,IAAI,CAACJ,UAAU,CAAA;AACzB,GAAA;AACF,CAAA;AAACK,oBAAA,CAAAC,QAAA,EAVoBX,gBAAgB,CAAA;;;;"}
@@ -0,0 +1,243 @@
1
+ import Component from '@glimmer/component';
2
+ import { tracked } from '@glimmer/tracking';
3
+ import { assert } from '@ember/debug';
4
+ import { action } from '@ember/object';
5
+ import { task, timeout } from 'ember-concurrency';
6
+ import embeddedAnimations from './components/safe-button/animations/index.js';
7
+ import { precompileTemplate } from '@ember/template-compilation';
8
+ import { setComponentTemplate } from '@ember/component';
9
+
10
+ function _defineProperty(obj, key, value) {
11
+ key = _toPropertyKey(key);
12
+ if (key in obj) {
13
+ Object.defineProperty(obj, key, {
14
+ value: value,
15
+ enumerable: true,
16
+ configurable: true,
17
+ writable: true
18
+ });
19
+ } else {
20
+ obj[key] = value;
21
+ }
22
+ return obj;
23
+ }
24
+ function _toPrimitive(input, hint) {
25
+ if (typeof input !== "object" || input === null) return input;
26
+ var prim = input[Symbol.toPrimitive];
27
+ if (prim !== undefined) {
28
+ var res = prim.call(input, hint || "default");
29
+ if (typeof res !== "object") return res;
30
+ throw new TypeError("@@toPrimitive must return a primitive value.");
31
+ }
32
+ return (hint === "string" ? String : Number)(input);
33
+ }
34
+ function _toPropertyKey(arg) {
35
+ var key = _toPrimitive(arg, "string");
36
+ return typeof key === "symbol" ? key : String(key);
37
+ }
38
+ function _initializerDefineProperty(target, property, descriptor, context) {
39
+ if (!descriptor) return;
40
+ Object.defineProperty(target, property, {
41
+ enumerable: descriptor.enumerable,
42
+ configurable: descriptor.configurable,
43
+ writable: descriptor.writable,
44
+ value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
45
+ });
46
+ }
47
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
48
+ var desc = {};
49
+ Object.keys(descriptor).forEach(function (key) {
50
+ desc[key] = descriptor[key];
51
+ });
52
+ desc.enumerable = !!desc.enumerable;
53
+ desc.configurable = !!desc.configurable;
54
+ if ('value' in desc || desc.initializer) {
55
+ desc.writable = true;
56
+ }
57
+ desc = decorators.slice().reverse().reduce(function (desc, decorator) {
58
+ return decorator(target, property, desc) || desc;
59
+ }, desc);
60
+ if (context && desc.initializer !== void 0) {
61
+ desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
62
+ desc.initializer = undefined;
63
+ }
64
+ if (desc.initializer === void 0) {
65
+ Object.defineProperty(target, property, desc);
66
+ desc = null;
67
+ }
68
+ return desc;
69
+ }
70
+
71
+ var TEMPLATE = precompileTemplate("<div class=\'ember-safe-button\' ...attributes>\n {{#if (has-block)}}\n {{yield\n (hash\n trigger=(component\n \'trigger\'\n onClick=@onConfirm\n safetyStatus=this.safetyStatus\n displayedMessage=this.displayedMessage\n webAnimations=this.webAnimations.trigger\n )\n safety=(component\n \'safety\'\n onClick=this.onUnlocking\n safetyStatus=this.safetyStatus\n displayedMessage=this.displayedMessage\n webAnimations=this.webAnimations.safety\n )\n )\n }}\n {{else}}\n <Trigger\n @onClick={{@onConfirm}}\n @safetyStatus={{this.safetyStatus}}\n @displayedMessage={{this.displayedMessage}}\n @webAnimations={{this.webAnimations.trigger}}\n />\n <Safety\n @onClick={{this.onUnlocking}}\n @safetyStatus={{this.safetyStatus}}\n @displayedMessage={{this.displayedMessage}}\n @webAnimations={{this.webAnimations.safety}}\n />\n {{/if}}\n</div>");
72
+
73
+ var _dec, _class, _descriptor, _descriptor2;
74
+ const DEFAULT_TIMEOUT = 3000;
75
+ const DEFAULT_ANIMATION = 'slide';
76
+ const SAFETY_STATUS = {
77
+ LOCKED: 1,
78
+ UNLOCKING: 2,
79
+ UNLOCKED: 3,
80
+ LOCKING: 4
81
+ };
82
+
83
+ /**
84
+ Main component.
85
+
86
+ ```hbs
87
+ <SafeButton
88
+ class="border-black"
89
+ @animation={{this.animation}}
90
+ @message="Delete me"
91
+ @timeout={{2000}}
92
+ @onConfirm={{action safeButtonClicked}} />
93
+ ```
94
+
95
+ ```
96
+ @class SafeButtonComponent
97
+ @param {string} [class="ember-safe-button"] CSS class to be applied on the wrapping element.
98
+ @param {object} [animation="slid"] Definition of animation; It can either be string and point to one of the pre-defined animations; Or it can be an object describing Web Animation API
99
+ @param {number} [timeout=3000] Number of millisenconds after which the safety rolls back over the trigger.
100
+ @param {string} [message="delete"] Text to be printed on the buttons in case block is not provided.
101
+ @param {function} onConfirm - Action to trigger whenever user clicks the trigger.
102
+ ```
103
+
104
+ When trying to construct your own `@animation` object you can take inspiration from the simple `slide` animation. The thing to keep in mind is that these go directly as parameters to [element.animate()](https://developer.mozilla.org/en-US/docs/Web/API/Element/animate) and that there are in fact four animations of which always two fire at the same time:
105
+
106
+ - `safety.unlocking` and `trigger.unlocking`
107
+ - `safety.locking` and `trigger.locking`
108
+
109
+ ```js
110
+ {
111
+ safety: {
112
+ unlocking: {
113
+ keyframes: [
114
+ { transform: 'translateX(0)' },
115
+ { transform: 'translateX(-100%)' },
116
+ ],
117
+ options: {
118
+ duration: 1000,
119
+ fill: 'both',
120
+ easing: 'ease',
121
+ },
122
+ },
123
+ locking: {
124
+ keyframes: [
125
+ { transform: 'translateX(-100%)' },
126
+ { transform: 'translateX(0)' },
127
+ ],
128
+ options: {
129
+ duration: 1000,
130
+ fill: 'both',
131
+ easing: 'ease',
132
+ },
133
+ },
134
+ },
135
+ trigger: {
136
+ unlocking: {
137
+ keyframes: [
138
+ { transform: 'translateX(100%)' },
139
+ { transform: 'translateX(0)' },
140
+ ],
141
+ options: {
142
+ duration: 1000,
143
+ fill: 'both',
144
+ easing: 'ease',
145
+ },
146
+ },
147
+ locking: {
148
+ keyframes: [
149
+ { transform: 'translateX(0)' },
150
+ { transform: 'translateX(100%)' },
151
+ ],
152
+ options: {
153
+ duration: 1000,
154
+ fill: 'both',
155
+ easing: 'ease',
156
+ },
157
+ },
158
+ },
159
+ }
160
+ ```
161
+ */
162
+ let SafeButtonComponent = (_dec = task(function* () {
163
+ yield timeout(this.timeout);
164
+ this.safetyStatus = SAFETY_STATUS.LOCKING;
165
+ }), (_class = class SafeButtonComponent extends Component {
166
+ constructor() {
167
+ super(...arguments);
168
+ _initializerDefineProperty(this, "safetyStatus", _descriptor, this);
169
+ _initializerDefineProperty(this, "triggerSafety", _descriptor2, this);
170
+ assert('@onConfirm attribute must be set', typeof this.args.onConfirm === 'function');
171
+ }
172
+ get activeAnimation() {
173
+ const animation = this.args.animation || DEFAULT_ANIMATION;
174
+ return typeof animation === 'string' ? embeddedAnimations[animation] : animation;
175
+ }
176
+ get webAnimations() {
177
+ const {
178
+ activeAnimation,
179
+ onUnlocked,
180
+ onLocked
181
+ } = this;
182
+ return {
183
+ safety: {
184
+ unlocking: ({
185
+ element
186
+ }) => {
187
+ let animation = element.animate(activeAnimation.safety.unlocking.keyframes, activeAnimation.safety.unlocking.options);
188
+ animation.onfinish = onUnlocked;
189
+ },
190
+ locking: ({
191
+ element
192
+ }) => {
193
+ let animation = element.animate(activeAnimation.safety.locking.keyframes, activeAnimation.safety.locking.options);
194
+ animation.onfinish = onLocked;
195
+ }
196
+ },
197
+ trigger: {
198
+ unlocking({
199
+ element
200
+ }) {
201
+ element.animate(activeAnimation.trigger.unlocking.keyframes, activeAnimation.trigger.unlocking.options);
202
+ },
203
+ locking({
204
+ element
205
+ }) {
206
+ element.animate(activeAnimation.trigger.locking.keyframes, activeAnimation.trigger.locking.options);
207
+ }
208
+ }
209
+ };
210
+ }
211
+ get timeout() {
212
+ return this.args.timeout || DEFAULT_TIMEOUT;
213
+ }
214
+ get displayedMessage() {
215
+ return this.args.message || 'delete';
216
+ }
217
+ onUnlocking() {
218
+ this.safetyStatus = SAFETY_STATUS.UNLOCKING;
219
+ }
220
+ onUnlocked() {
221
+ this.safetyStatus = SAFETY_STATUS.UNLOCKED;
222
+ this.triggerSafety.perform();
223
+ }
224
+ onLocked() {
225
+ this.safetyStatus = SAFETY_STATUS.LOCKED;
226
+ }
227
+ }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "safetyStatus", [tracked], {
228
+ configurable: true,
229
+ enumerable: true,
230
+ writable: true,
231
+ initializer: function () {
232
+ return SAFETY_STATUS.LOCKED;
233
+ }
234
+ }), _applyDecoratedDescriptor(_class.prototype, "onUnlocking", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onUnlocking"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onUnlocked", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onUnlocked"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onLocked", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onLocked"), _class.prototype), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "triggerSafety", [_dec], {
235
+ configurable: true,
236
+ enumerable: true,
237
+ writable: true,
238
+ initializer: null
239
+ })), _class));
240
+ setComponentTemplate(TEMPLATE, SafeButtonComponent);
241
+
242
+ export { SAFETY_STATUS as S, _defineProperty as _, SafeButtonComponent as a };
243
+ //# sourceMappingURL=index-447fee60.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-447fee60.js","sources":["../src/components/safe-button/index.hbs.js","../src/components/safe-button/index.js"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"<div class=\\'ember-safe-button\\' ...attributes>\\n {{#if (has-block)}}\\n {{yield\\n (hash\\n trigger=(component\\n \\'trigger\\'\\n onClick=@onConfirm\\n safetyStatus=this.safetyStatus\\n displayedMessage=this.displayedMessage\\n webAnimations=this.webAnimations.trigger\\n )\\n safety=(component\\n \\'safety\\'\\n onClick=this.onUnlocking\\n safetyStatus=this.safetyStatus\\n displayedMessage=this.displayedMessage\\n webAnimations=this.webAnimations.safety\\n )\\n )\\n }}\\n {{else}}\\n <Trigger\\n @onClick={{@onConfirm}}\\n @safetyStatus={{this.safetyStatus}}\\n @displayedMessage={{this.displayedMessage}}\\n @webAnimations={{this.webAnimations.trigger}}\\n />\\n <Safety\\n @onClick={{this.onUnlocking}}\\n @safetyStatus={{this.safetyStatus}}\\n @displayedMessage={{this.displayedMessage}}\\n @webAnimations={{this.webAnimations.safety}}\\n />\\n {{/if}}\\n</div>\")","import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { assert } from '@ember/debug';\nimport { action } from '@ember/object';\n\nimport { timeout } from 'ember-concurrency';\nimport { task } from 'ember-concurrency';\n\nimport embeddedAnimations from './animations/index';\n\nconst DEFAULT_TIMEOUT = 3000;\nconst DEFAULT_ANIMATION = 'slide';\n\nexport const SAFETY_STATUS = {\n LOCKED: 1,\n UNLOCKING: 2,\n UNLOCKED: 3,\n LOCKING: 4,\n};\n\n/**\n Main component.\n\n ```hbs\n <SafeButton\n class=\"border-black\"\n @animation={{this.animation}}\n @message=\"Delete me\"\n @timeout={{2000}}\n @onConfirm={{action safeButtonClicked}} />\n ```\n\n ```\n @class SafeButtonComponent\n @param {string} [class=\"ember-safe-button\"] CSS class to be applied on the wrapping element.\n @param {object} [animation=\"slid\"] Definition of animation; It can either be string and point to one of the pre-defined animations; Or it can be an object describing Web Animation API\n @param {number} [timeout=3000] Number of millisenconds after which the safety rolls back over the trigger.\n @param {string} [message=\"delete\"] Text to be printed on the buttons in case block is not provided.\n @param {function} onConfirm - Action to trigger whenever user clicks the trigger.\n ```\n\n When trying to construct your own `@animation` object you can take inspiration from the simple `slide` animation. The thing to keep in mind is that these go directly as parameters to [element.animate()](https://developer.mozilla.org/en-US/docs/Web/API/Element/animate) and that there are in fact four animations of which always two fire at the same time:\n\n - `safety.unlocking` and `trigger.unlocking`\n - `safety.locking` and `trigger.locking`\n\n ```js\n {\n safety: {\n unlocking: {\n keyframes: [\n { transform: 'translateX(0)' },\n { transform: 'translateX(-100%)' },\n ],\n options: {\n duration: 1000,\n fill: 'both',\n easing: 'ease',\n },\n },\n locking: {\n keyframes: [\n { transform: 'translateX(-100%)' },\n { transform: 'translateX(0)' },\n ],\n options: {\n duration: 1000,\n fill: 'both',\n easing: 'ease',\n },\n },\n },\n trigger: {\n unlocking: {\n keyframes: [\n { transform: 'translateX(100%)' },\n { transform: 'translateX(0)' },\n ],\n options: {\n duration: 1000,\n fill: 'both',\n easing: 'ease',\n },\n },\n locking: {\n keyframes: [\n { transform: 'translateX(0)' },\n { transform: 'translateX(100%)' },\n ],\n options: {\n duration: 1000,\n fill: 'both',\n easing: 'ease',\n },\n },\n },\n }\n ```\n */\nexport default class SafeButtonComponent extends Component {\n constructor() {\n super(...arguments);\n\n assert('@onConfirm attribute must be set', typeof this.args.onConfirm === 'function');\n }\n\n @tracked safetyStatus = SAFETY_STATUS.LOCKED;\n\n get activeAnimation() {\n const animation = this.args.animation || DEFAULT_ANIMATION;\n\n return typeof animation === 'string' ? embeddedAnimations[animation] : animation;\n }\n\n get webAnimations() {\n const { activeAnimation, onUnlocked, onLocked } = this;\n\n return {\n safety: {\n unlocking: ({ element }) => {\n let animation = element.animate(\n activeAnimation.safety.unlocking.keyframes,\n activeAnimation.safety.unlocking.options\n );\n animation.onfinish = onUnlocked;\n },\n locking: ({ element }) => {\n let animation = element.animate(\n activeAnimation.safety.locking.keyframes,\n activeAnimation.safety.locking.options\n );\n animation.onfinish = onLocked;\n },\n },\n trigger: {\n unlocking({ element }) {\n element.animate(\n activeAnimation.trigger.unlocking.keyframes,\n activeAnimation.trigger.unlocking.options\n );\n },\n locking({ element }) {\n element.animate(\n activeAnimation.trigger.locking.keyframes,\n activeAnimation.trigger.locking.options\n );\n },\n },\n };\n }\n\n get timeout() {\n return this.args.timeout || DEFAULT_TIMEOUT;\n }\n\n get displayedMessage() {\n return this.args.message || 'delete';\n }\n\n @action\n onUnlocking() {\n this.safetyStatus = SAFETY_STATUS.UNLOCKING;\n }\n\n @action\n onUnlocked() {\n this.safetyStatus = SAFETY_STATUS.UNLOCKED;\n this.triggerSafety.perform();\n }\n\n @action\n onLocked() {\n this.safetyStatus = SAFETY_STATUS.LOCKED;\n }\n\n @task(function* () {\n yield timeout(this.timeout);\n this.safetyStatus = SAFETY_STATUS.LOCKING;\n })\n triggerSafety;\n}\n"],"names":["precompileTemplate","DEFAULT_TIMEOUT","DEFAULT_ANIMATION","SAFETY_STATUS","LOCKED","UNLOCKING","UNLOCKED","LOCKING","SafeButtonComponent","_dec","task","timeout","safetyStatus","_class","Component","constructor","arguments","_initializerDefineProperty","_descriptor","_descriptor2","assert","args","onConfirm","activeAnimation","animation","embeddedAnimations","webAnimations","onUnlocked","onLocked","safety","unlocking","element","animate","keyframes","options","onfinish","locking","trigger","displayedMessage","message","onUnlocking","triggerSafety","perform","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":"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"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ import { modifier } from 'ember-modifier';
2
+ import { S as SAFETY_STATUS } from '../index-447fee60.js';
3
+
4
+ var animateMe = modifier((element, _, named) => {
5
+ if (named.focusMe) {
6
+ element.focus();
7
+ }
8
+ if (named.safetyStatus === SAFETY_STATUS.UNLOCKING) {
9
+ named.webAnimations.unlocking({
10
+ element
11
+ });
12
+ } else if (named.safetyStatus === SAFETY_STATUS.LOCKING) {
13
+ named.webAnimations.locking({
14
+ element
15
+ });
16
+ }
17
+ }, {
18
+ eager: false
19
+ });
20
+
21
+ export { animateMe as default };
22
+ //# sourceMappingURL=animate-me.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animate-me.js","sources":["../../src/modifiers/animate-me.js"],"sourcesContent":["import { modifier } from 'ember-modifier';\n\nimport { SAFETY_STATUS } from '../components/safe-button/index';\n\nexport default modifier(\n (element, _, named) => {\n if (named.focusMe) {\n element.focus();\n }\n\n if (named.safetyStatus === SAFETY_STATUS.UNLOCKING) {\n named.webAnimations.unlocking({\n element,\n });\n } else if (named.safetyStatus === SAFETY_STATUS.LOCKING) {\n named.webAnimations.locking({\n element,\n });\n }\n },\n { eager: false }\n);\n"],"names":["modifier","element","_","named","focusMe","focus","safetyStatus","SAFETY_STATUS","UNLOCKING","webAnimations","unlocking","LOCKING","locking","eager"],"mappings":";;;AAIA,gBAAeA,QAAQ,CACrB,CAACC,OAAO,EAAEC,CAAC,EAAEC,KAAK,KAAK;EACrB,IAAIA,KAAK,CAACC,OAAO,EAAE;IACjBH,OAAO,CAACI,KAAK,EAAE,CAAA;AACjB,GAAA;AAEA,EAAA,IAAIF,KAAK,CAACG,YAAY,KAAKC,aAAa,CAACC,SAAS,EAAE;AAClDL,IAAAA,KAAK,CAACM,aAAa,CAACC,SAAS,CAAC;AAC5BT,MAAAA,OAAAA;AACF,KAAC,CAAC,CAAA;GACH,MAAM,IAAIE,KAAK,CAACG,YAAY,KAAKC,aAAa,CAACI,OAAO,EAAE;AACvDR,IAAAA,KAAK,CAACM,aAAa,CAACG,OAAO,CAAC;AAC1BX,MAAAA,OAAAA;AACF,KAAC,CAAC,CAAA;AACJ,GAAA;AACF,CAAC,EACD;AAAEY,EAAAA,KAAK,EAAE,KAAA;AAAM,CACjB,CAAC;;;;"}
package/package.json CHANGED
@@ -1,93 +1,94 @@
1
1
  {
2
2
  "name": "ember-safe-button",
3
- "version": "2.1.1",
3
+ "version": "3.1.0",
4
4
  "description": "For potentially dangerous actions that better needs a confirmation.",
5
- "keywords": [
6
- "ember-addon"
7
- ],
8
- "private": false,
9
5
  "repository": "https://gitlab.com/michal-bryxi/open-source/ember-safe-button",
10
6
  "license": "MIT",
11
7
  "author": "",
12
- "directories": {
13
- "doc": "doc",
14
- "test": "tests"
8
+ "exports": {
9
+ ".": "./dist/index.js",
10
+ "./*": "./dist/*",
11
+ "./addon-main.js": "./addon-main.js"
15
12
  },
13
+ "files": [
14
+ "dist",
15
+ "addon-main.cjs",
16
+ "CHANGELOG.md",
17
+ "README.md"
18
+ ],
16
19
  "scripts": {
17
- "build": "ember build --environment=production",
18
- "lint": "npm-run-all --aggregate-output --continue-on-error --parallel 'lint:!(fix)'",
19
- "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
20
- "lint:hbs": "ember-template-lint .",
21
- "lint:hbs:fix": "ember-template-lint . --fix",
20
+ "start": "concurrently 'npm:watch:*'",
21
+ "build": "concurrently 'npm:build:*'",
22
+ "build:js": "rollup -c ./rollup.config.js",
23
+ "build:docs": "cp ../README.md ./README.md",
24
+ "watch:js": "rollup -c --watch --no-watch.clearScreen",
25
+ "lint": "concurrently 'npm:lint:js'",
26
+ "lint:fix": "concurrently 'npm:lint:js:fix'",
22
27
  "lint:js": "eslint . --cache",
23
28
  "lint:js:fix": "eslint . --fix",
24
- "start": "ember serve",
25
- "test": "npm-run-all lint test:*",
26
- "test:ember": "ember test",
27
- "format:hbs": "prettier **/*.hbs --write --parser=glimmer",
28
- "!test:ember-compatibility": "ember try:each"
29
+ "test": "echo 'Addon does not have tests, run tests in test-app'",
30
+ "prepare": "yarn run build",
31
+ "prepublishOnly": "yarn run build"
29
32
  },
30
33
  "dependencies": {
31
- "@ember/render-modifiers": "1.0.2",
32
- "ember-cli-babel": "7.26.6",
33
- "ember-cli-htmlbars": "5.7.1",
34
- "ember-concurrency": "2.1.0"
34
+ "@ember/render-modifiers": "2.1.0",
35
+ "@embroider/addon-shim": "1.10.2",
36
+ "ember-cli-htmlbars": "^6.2.0",
37
+ "ember-concurrency": "2.3.7",
38
+ "ember-modifier": "4.1.0"
35
39
  },
36
40
  "devDependencies": {
37
- "@ember/optional-features": "2.0.0",
38
- "@ember/test-helpers": "2.2.8",
39
- "@fortawesome/ember-fontawesome": "0.2.3",
40
- "@fortawesome/free-solid-svg-icons": "5.15.3",
41
- "@glimmer/component": "1.0.4",
42
- "@glimmer/tracking": "1.0.4",
43
- "autoprefixer": "10.2.6",
41
+ "@babel/core": "7.23.2",
42
+ "@babel/plugin-proposal-class-properties": "7.18.6",
43
+ "@babel/plugin-proposal-decorators": "7.23.2",
44
+ "@babel/plugin-syntax-decorators": "7.22.10",
45
+ "@embroider/addon-dev": "3.2.0",
46
+ "@nullvoxpopuli/eslint-configs": "2.3.5",
47
+ "@rollup/plugin-babel": "6.0.4",
44
48
  "babel-eslint": "10.1.0",
45
- "broccoli-asset-rev": "3.0.0",
46
- "ember-auto-import": "1.11.3",
47
- "ember-cli": "3.26.1",
48
- "ember-cli-addon-docs": "3.0.0",
49
- "ember-cli-addon-docs-esdoc": "0.4.0",
50
- "ember-cli-dependency-checker": "3.2.0",
51
- "ember-cli-inject-live-reload": "2.1.0",
52
- "ember-cli-postcss": "7.0.2",
53
- "ember-cli-sri": "2.1.1",
54
- "ember-cli-terser": "4.0.2",
55
- "ember-data": "3.27.1",
56
- "ember-disable-prototype-extensions": "1.1.3",
57
- "ember-export-application-global": "2.0.1",
58
- "ember-load-initializers": "2.1.2",
59
- "ember-maybe-import-regenerator": "0.1.6",
60
- "ember-modifier": "2.1.2",
61
- "ember-page-title": "6.2.2",
62
- "ember-qunit": "5.1.3",
63
- "ember-resolver": "8.0.2",
64
- "ember-sinon-qunit": "6.0.0",
65
- "ember-source": "3.27.5",
66
- "ember-source-channel-url": "3.0.0",
67
- "ember-template-lint": "2.18.1",
68
- "ember-template-lint-plugin-prettier": "2.0.1",
69
- "ember-try": "1.4.0",
70
- "eslint": "7.20.0",
71
- "eslint-config-prettier": "7.2.0",
72
- "eslint-plugin-ember": "10.2.0",
49
+ "concurrently": "7.6.0",
50
+ "eslint": "^7.0.0",
51
+ "eslint-config-prettier": "8.5.0",
52
+ "eslint-plugin-decorator-position": "4.0.1",
53
+ "eslint-plugin-ember": "10.6.1",
54
+ "eslint-plugin-import": "2.26.0",
55
+ "eslint-plugin-json": "3.1.0",
73
56
  "eslint-plugin-node": "11.1.0",
74
- "eslint-plugin-prettier": "3.3.1",
75
- "eslint-plugin-unicorn": "28.0.2",
76
- "loader.js": "4.7.0",
77
- "npm-run-all": "4.1.5",
78
- "prettier": "2.2.1",
79
- "qunit": "2.14.0",
80
- "qunit-dom": "1.6.0",
81
- "tailwindcss": "2.1.4"
57
+ "eslint-plugin-prettier": "4.2.1",
58
+ "eslint-plugin-simple-import-sort": "7.0.0",
59
+ "rollup": "2.79.1"
82
60
  },
83
- "engines": {
84
- "node": "10.* || >= 12"
61
+ "publishConfig": {
62
+ "registry": "https://registry.npmjs.org"
85
63
  },
86
64
  "ember": {
87
65
  "edition": "octane"
88
66
  },
67
+ "keywords": [
68
+ "ember-addon"
69
+ ],
89
70
  "ember-addon": {
90
- "configPath": "tests/dummy/config"
71
+ "version": 2,
72
+ "type": "addon",
73
+ "main": "./addon-main.cjs",
74
+ "app-js": {
75
+ "./components/safe-button/animations/flip.js": "./dist/_app_/components/safe-button/animations/flip.js",
76
+ "./components/safe-button/animations/index.js": "./dist/_app_/components/safe-button/animations/index.js",
77
+ "./components/safe-button/animations/lift-bars.js": "./dist/_app_/components/safe-button/animations/lift-bars.js",
78
+ "./components/safe-button/animations/poing.js": "./dist/_app_/components/safe-button/animations/poing.js",
79
+ "./components/safe-button/animations/roll.js": "./dist/_app_/components/safe-button/animations/roll.js",
80
+ "./components/safe-button/animations/slide.js": "./dist/_app_/components/safe-button/animations/slide.js",
81
+ "./components/safe-button/animations/zoom.js": "./dist/_app_/components/safe-button/animations/zoom.js",
82
+ "./components/safe-button/index.js": "./dist/_app_/components/safe-button/index.js",
83
+ "./components/safety/index.js": "./dist/_app_/components/safety/index.js",
84
+ "./components/trigger/index.js": "./dist/_app_/components/trigger/index.js",
85
+ "./modifiers/animate-me.js": "./dist/_app_/modifiers/animate-me.js"
86
+ }
87
+ },
88
+ "engines": {
89
+ "node": "12.* || 14.* || >= 16"
91
90
  },
92
- "homepage": "https://ember-safe-button.netlify.com/"
91
+ "volta": {
92
+ "extends": "../package.json"
93
+ }
93
94
  }
package/.gitlab-ci.yml DELETED
@@ -1,27 +0,0 @@
1
- image: timbru31/node-chrome:14-slim
2
-
3
- stages:
4
- - build
5
- - test
6
-
7
- cache:
8
- paths:
9
- - node_modules/
10
-
11
- install_dependencies:
12
- except:
13
- refs:
14
- - master
15
- stage: build
16
- script:
17
- - yarn
18
- artifacts:
19
- paths:
20
- - node_modules/
21
-
22
- testing_testing:
23
- except:
24
- refs:
25
- - master
26
- stage: test
27
- script: yarn test
package/.prettierignore DELETED
@@ -1,21 +0,0 @@
1
- # unconventional js
2
- /blueprints/*/files/
3
- /vendor/
4
-
5
- # compiled output
6
- /dist/
7
- /tmp/
8
-
9
- # dependencies
10
- /bower_components/
11
- /node_modules/
12
-
13
- # misc
14
- /coverage/
15
- !.*
16
- .eslintcache
17
-
18
- # ember-try
19
- /.node_modules.ember-try/
20
- /bower.json.ember-try
21
- /package.json.ember-try
package/.prettierrc.js DELETED
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- singleQuote: true,
5
- };