beyond_canvas 0.22.0.pre → 0.23.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/icons/adblocker.svg +5 -0
  3. data/app/assets/images/icons/checkbox_checked.svg +1 -1
  4. data/app/assets/images/icons/checkbox_unchecked.svg +1 -1
  5. data/app/assets/images/icons/external_link.svg +1 -0
  6. data/app/assets/images/icons/toggle.svg +1 -0
  7. data/app/assets/images/icons/toggle_checked.svg +3 -0
  8. data/app/assets/images/icons/toggle_unchecked.svg +3 -0
  9. data/app/assets/javascripts/beyond_canvas/base.js +77 -31
  10. data/app/assets/stylesheets/beyond_canvas/base.scss +19 -18
  11. data/app/assets/stylesheets/beyond_canvas/components/_action_bar.scss +11 -6
  12. data/app/assets/stylesheets/beyond_canvas/components/_breadcrumbs.scss +5 -5
  13. data/app/assets/stylesheets/beyond_canvas/components/_buttons.scss +45 -95
  14. data/app/assets/stylesheets/beyond_canvas/components/_cards.scss +20 -12
  15. data/app/assets/stylesheets/beyond_canvas/components/_collapse.scss +6 -3
  16. data/app/assets/stylesheets/beyond_canvas/components/_flash.scss +11 -11
  17. data/app/assets/stylesheets/beyond_canvas/components/_forms.scss +2 -2
  18. data/app/assets/stylesheets/beyond_canvas/components/_inputs.scss +182 -40
  19. data/app/assets/stylesheets/beyond_canvas/components/_links.scss +51 -3
  20. data/app/assets/stylesheets/beyond_canvas/components/_main.scss +3 -3
  21. data/app/assets/stylesheets/beyond_canvas/components/_menu.scss +13 -0
  22. data/app/assets/stylesheets/beyond_canvas/components/_modals.scss +48 -18
  23. data/app/assets/stylesheets/beyond_canvas/components/_notices.scss +11 -11
  24. data/app/assets/stylesheets/beyond_canvas/components/_scrollbox.scss +5 -4
  25. data/app/assets/stylesheets/beyond_canvas/components/_select2.scss +13 -13
  26. data/app/assets/stylesheets/beyond_canvas/components/_statuses.scss +9 -8
  27. data/app/assets/stylesheets/beyond_canvas/components/_step_list.scss +67 -0
  28. data/app/assets/stylesheets/beyond_canvas/components/_tables.scss +10 -5
  29. data/app/assets/stylesheets/beyond_canvas/components/_titles.scss +1 -1
  30. data/app/assets/stylesheets/beyond_canvas/mailer.scss +2 -1
  31. data/app/assets/stylesheets/beyond_canvas/settings/_base_variables.scss +241 -0
  32. data/app/assets/stylesheets/beyond_canvas/settings/{_variables.scss → _constant_variables.scss} +30 -64
  33. data/app/assets/stylesheets/beyond_canvas/settings/_custom_variables.scss +233 -0
  34. data/app/assets/stylesheets/beyond_canvas/settings/_typography.scss +7 -3
  35. data/app/assets/stylesheets/beyond_canvas/utilities/_mixins.scss +30 -3
  36. data/app/controllers/beyond_canvas/authentications_controller.rb +18 -2
  37. data/app/controllers/beyond_canvas/system_controller.rb +3 -1
  38. data/app/controllers/beyond_canvas/webhooks_controller.rb +49 -0
  39. data/app/controllers/concerns/beyond_canvas/add_blocker_check.rb +17 -0
  40. data/app/controllers/concerns/beyond_canvas/custom_styles.rb +54 -0
  41. data/app/controllers/concerns/beyond_canvas/locale_management.rb +31 -8
  42. data/app/controllers/concerns/beyond_canvas/request_validation.rb +6 -0
  43. data/app/form_builders/beyond_canvas/form_builder.rb +62 -49
  44. data/app/helpers/beyond_canvas/application_helper.rb +27 -4
  45. data/app/helpers/beyond_canvas/form_tag_helper.rb +130 -0
  46. data/app/javascript/beyond_canvas/base.js +0 -1
  47. data/app/javascript/beyond_canvas/initializers/buttons.js +10 -2
  48. data/app/javascript/beyond_canvas/initializers/flash.js +32 -10
  49. data/app/javascript/beyond_canvas/initializers/inputs.js +9 -4
  50. data/app/javascript/beyond_canvas/initializers/modals.js +46 -10
  51. data/app/views/beyond_canvas/mailer/_header.html.erb +2 -2
  52. data/app/views/beyond_canvas/shared/_flash.html.erb +14 -10
  53. data/app/views/beyond_canvas/shared/_head.html.erb +4 -0
  54. data/app/views/beyond_canvas/shared/_locales.html.erb +1 -1
  55. data/app/views/layouts/beyond_canvas/application.html.erb +0 -1
  56. data/app/views/layouts/beyond_canvas/public.html.erb +1 -1
  57. data/config/initializers/beyond_canvas/constants.rb +13 -0
  58. data/config/initializers/beyond_canvas/session_store.rb +8 -0
  59. data/lib/beyond_canvas/configuration.rb +9 -1
  60. data/lib/beyond_canvas/engine.rb +7 -0
  61. data/lib/beyond_canvas/rails/routes.rb +27 -7
  62. data/lib/beyond_canvas/version.rb +1 -1
  63. data/lib/beyond_canvas/webhook_event_registration.rb +19 -0
  64. data/lib/beyond_canvas.rb +6 -4
  65. data/lib/generators/beyond_canvas/install/install_generator.rb +6 -0
  66. data/lib/generators/beyond_canvas/install/templates/beyond_canvas.rb.erb +38 -1
  67. data/lib/generators/beyond_canvas/model/model_generator.rb +3 -0
  68. data/lib/generators/beyond_canvas/webhook/templates/webhooks_controller.rb +22 -0
  69. data/lib/generators/beyond_canvas/webhook/webhook_generator.rb +15 -0
  70. data/lib/models/concerns/authentication.rb +10 -3
  71. data/lib/models/concerns/utils.rb +1 -1
  72. data/lib/models/concerns/webhook.rb +123 -0
  73. data/lib/models/shop.rb +1 -0
  74. metadata +68 -39
  75. data/app/assets/stylesheets/beyond_canvas/components/_comments.scss +0 -6
  76. data/app/views/beyond_canvas/shared/_modal.html.erb +0 -6
  77. data/config/routes.rb +0 -12
@@ -1,10 +1,20 @@
1
+ %card {
2
+ background: var(--card-background);
3
+ border-radius: var(--card-borderRadius);
4
+ box-shadow: var(--card-shadow);
5
+ }
6
+
7
+ %card_padding {
8
+ @include padding(var(--card-padding));
9
+
10
+ box-sizing: border-box;
11
+ }
12
+
1
13
  .card {
2
- background: $white;
3
- border-radius: $card-border-radius;
4
- box-shadow: $card-box-shadow;
14
+ @extend %card;
5
15
 
6
16
  &:not(:last-child) {
7
- margin-bottom: $card-margin;
17
+ margin-bottom: 30px;
8
18
  }
9
19
 
10
20
  &--relative {
@@ -12,22 +22,20 @@
12
22
  }
13
23
 
14
24
  &--padding {
15
- @include padding($card-padding);
16
-
17
- box-sizing: border-box;
25
+ @extend %card_padding;
18
26
  }
19
27
 
20
28
  &__separator {
21
- @include margin($card-separator-spacing null);
29
+ @include margin(35px null);
22
30
 
23
- border-bottom: 1px solid $card-separator-color;
24
- left: -#{$card-padding};
31
+ border-bottom: var(--card-divider-border);
32
+ left: calc(-1 * var(--card-padding));
25
33
  position: relative;
26
- width: calc(100% + 2 * #{$card-padding});
34
+ width: calc(100% + 2 * #{var(--card-padding)});
27
35
  }
28
36
 
29
37
  &__headline {
30
- color: $card-title-color;
38
+ color: var(--card-headline);
31
39
  font-size: 20px;
32
40
  margin-bottom: 20px;
33
41
  }
@@ -9,18 +9,21 @@
9
9
  }
10
10
 
11
11
  &__button {
12
- color: $palette-primary;
12
+ color: var(--primary-color);
13
13
  font-weight: 700;
14
14
  cursor: pointer;
15
- display: table;
15
+ display: block;
16
16
  line-height: 1;
17
17
  margin-bottom: 4px;
18
+ overflow: hidden;
19
+ text-overflow: ellipsis;
20
+ white-space: nowrap;
18
21
  }
19
22
 
20
23
  &__icon {
21
24
  @include size(10px);
22
25
 
23
- fill: $palette-primary;
26
+ fill: var(--primary-color);
24
27
  margin-right: 2px;
25
28
 
26
29
  &--open {
@@ -1,13 +1,13 @@
1
1
  .flash {
2
2
  @include position(fixed, 70px null null null);
3
3
 
4
- background-color: $white;
5
- border-radius: $flash-border-radius;
6
- box-shadow: $flash-box-shadow;
4
+ background-color: var(--notification-background);
5
+ border-radius: var(--notification-borderRadius);
6
+ box-shadow: var(--notification-boxShadow);
7
7
  display: flex;
8
8
  overflow: hidden;
9
9
  transition: 0.7s linear;
10
- z-index: 9999;
10
+ z-index: 999999;
11
11
 
12
12
  &--shown {
13
13
  // sass-lint:disable no-important
@@ -24,25 +24,25 @@
24
24
  > svg {
25
25
  @include size(18px);
26
26
 
27
- fill: $white;
27
+ fill: var(--notification-background);
28
28
  }
29
29
 
30
30
  &--success,
31
31
  &--notice {
32
- background-color: $flash-success;
32
+ background-color: var(--notification-success);
33
33
  }
34
34
 
35
35
  &--info {
36
- background-color: $flash-info;
36
+ background-color: var(--notification-info);
37
37
  }
38
38
 
39
39
  &--warning {
40
- background-color: $flash-warning;
40
+ background-color: var(--notification-warning);
41
41
  }
42
42
 
43
43
  &--error,
44
44
  &--alert {
45
- background-color: $flash-error;
45
+ background-color: var(--notification-danger);
46
46
  }
47
47
  }
48
48
 
@@ -50,7 +50,7 @@
50
50
  @include padding(10px 15px);
51
51
 
52
52
  box-sizing: border-box;
53
- color: $flash-color;
53
+ color: var(--notification-text);
54
54
  }
55
55
 
56
56
  &__close {
@@ -61,7 +61,7 @@
61
61
  > svg {
62
62
  @include size(8px);
63
63
 
64
- fill: $flash-color;
64
+ fill: var(--notification-text);
65
65
  }
66
66
  }
67
67
  }
@@ -1,5 +1,5 @@
1
1
  %form__actions {
2
- overflow: auto;
2
+ overflow: hidden;
3
3
  }
4
4
 
5
5
  .form {
@@ -7,7 +7,7 @@
7
7
  &__actions {
8
8
  width: 100%;
9
9
 
10
- &:not(:last-child) {
10
+ &:not(:last-of-type) {
11
11
  margin-bottom: 30px;
12
12
  }
13
13
  }
@@ -2,17 +2,18 @@ $controls: checkbox, radio;
2
2
 
3
3
  #{$all-text-inputs},
4
4
  select {
5
- background-color: $white;
6
- border: 1px solid $input-border-color;
7
- border-radius: 3px;
5
+ background-color: var(--inputField-background);
6
+ border: 1px solid var(--inputField-border);
7
+ border-radius: var(--inputField-borderRadius);
8
8
  box-sizing: border-box;
9
+ order: 2;
9
10
  outline: none;
10
11
  padding: 6px 8px;
11
12
  width: 100%;
12
13
 
13
14
  &:disabled {
14
- background-color: $input-disabled-background !important;
15
- color: $input-disabled-color;
15
+ background-color: var(--inputField-background-disabled) !important;
16
+ color: var(--inputField-text-disabled);
16
17
  opacity: 1;
17
18
  }
18
19
  }
@@ -23,7 +24,7 @@ select {
23
24
 
24
25
  #{$all-text-inputs-focus},
25
26
  select:focus {
26
- border-color: $input-border-color-focus;
27
+ border-color: var(--inputField-border-focus);
27
28
  }
28
29
 
29
30
  select {
@@ -43,70 +44,208 @@ textarea {
43
44
  #{$all-text-inputs},
44
45
  select {
45
46
  &.input__error {
46
- border-left: 2px solid $input-errors-color;
47
+ border-left: 2px solid var(--formGroup-validation-error);
47
48
 
48
49
  &:focus {
49
- border: 1px solid $input-border-color-focus;
50
+ border: 1px solid var(--inputField-border-focus);
50
51
  }
51
52
  }
52
53
  }
53
54
 
54
55
  .input {
55
56
  &__label {
56
- color: $label-color;
57
+ color: var(--formGroup-label);
57
58
  display: block;
58
59
  font-size: 13px;
59
60
  font-weight: bold;
61
+
62
+ &--disabled {
63
+ color: var(--check-disabled-text);
64
+ }
60
65
  }
61
66
 
62
67
  &__hint {
63
- color: $hint-color;
68
+ color: var(--inputField-hint-text);
64
69
  font-size: 13px;
65
70
  margin-top: 1px;
66
71
  }
67
72
 
73
+ &__pre,
74
+ &__post {
75
+ background-color: var(--inputField-background-disabled);
76
+ border: 1px solid var(--inputField-border);
77
+ box-sizing: border-box;
78
+ color: var(--inputField-text-disabled);
79
+ line-height: 1;
80
+ outline: none;
81
+ padding: 6px 8px;
82
+ }
83
+
84
+ &__pre {
85
+ border-bottom-left-radius: var(--inputField-borderRadius);
86
+ border-top-left-radius: var(--inputField-borderRadius);
87
+ border-right: 0;
88
+ order: 1;
89
+
90
+ ~ input,
91
+ ~ select {
92
+ @include border-left-radius(0);
93
+ }
94
+ }
95
+
96
+ &__post {
97
+ border-bottom-right-radius: var(--inputField-borderRadius);
98
+ border-top-right-radius: var(--inputField-borderRadius);
99
+ border-left: 0;
100
+ order: 10;
101
+
102
+ ~ input,
103
+ ~ select {
104
+ @include border-right-radius(0);
105
+ }
106
+ }
107
+
68
108
  @each $control in $controls {
69
109
 
70
110
  &__#{$control} {
71
- display: flex;
72
- align-items: center;
73
-
74
- .input__#{$control}__control {
75
- @if $control == checkbox {
76
- @include size(16px);
77
- } @else if $control == radio {
78
- @include size(18px);
79
- }
80
111
 
112
+ &__control {
81
113
  cursor: pointer;
82
- margin-right: 7px;
83
114
  }
84
115
 
85
- input[type=#{$control}] + .input__#{$control}__control {
86
- @if $control == checkbox {
87
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' style='background: #{str-replace('' + $checkbox-unchecked-background, '#', '%23')};' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='#{str-replace('' + $checkbox-unchecked-color, '#', '%23')}' d='M0 0v24h24V0H0zm21.5 21.5h-19v-19h19v19z'%3E%3C/path%3E%3C/svg%3E%0A");
88
- } @else if $control == radio {
89
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' style='background: #{str-replace('' + $radio-unchecked-background, '#', '%23')};' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath fill='#{str-replace('' + $radio-unchecked-color, '#', '%23')}' d='M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.6 0 12 0zm0 21.6c-5.3 0-9.6-4.3-9.6-9.6S6.7 2.4 12 2.4s9.6 4.3 9.6 9.6-4.3 9.6-9.6 9.6z'%3E%3C/path%3E%3C/svg%3E");
116
+ &--unchecked {
117
+ background: #fff;
118
+
119
+ path {
120
+ fill: var(--uncheck-color);
90
121
  }
91
122
  }
92
123
 
93
- input[type=#{$control}]:checked + .input__#{$control}__control {
94
- @if $control == checkbox {
95
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' style='background: #{str-replace('' + $checkbox-checked-background, '#', '%23')};' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='#{str-replace('' + $checkbox-checked-color, '#', '%23')}' d='M0 0v24h24V0H0zm9.6 18.4l-5.8-5.6 2-2.1 3.7 3.6L18 5.6l2.1 2.1L9.6 18.4z'%3E%3C/path%3E%3C/svg%3E%0A");
96
- } @else if $control == radio {
97
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' style='background: #{str-replace('' + $radio-checked-background, '#', '%23')};' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath fill='#{str-replace('' + $radio-checked-color, '#', '%23')}' d='M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.6 0 12 0zm0 21.6c-5.3 0-9.6-4.3-9.6-9.6S6.7 2.4 12 2.4s9.6 4.3 9.6 9.6-4.3 9.6-9.6 9.6zm0-15.9c-3.4 0-6.3 2.8-6.3 6.3s2.8 6.2 6.3 6.2 6.2-2.8 6.2-6.2-2.8-6.3-6.2-6.3z'%3E%3C/path%3E%3C/svg%3E");
124
+ &--checked {
125
+ background: #fff;
126
+
127
+ path {
128
+ fill: var(--check-color);
98
129
  }
99
130
  }
100
131
 
101
- + div .input__label {
102
- line-height: 1;
132
+ &:not(:checked) + .input__#{$control}__control .input__#{$control}--unchecked,
133
+ &:checked + .input__#{$control}__control .input__#{$control}--checked {
134
+ display: block !important;
135
+ }
136
+
137
+ &:disabled {
138
+ ~ div .input__label,
139
+ ~ div .input__hint {
140
+ cursor: default;
141
+ color: var(--check-disabled-text);
142
+ }
143
+
144
+ + .input__#{$control}__control .input__#{$control}--unchecked,
145
+ + .input__#{$control}__control .input__#{$control}--checked {
146
+ cursor: default;
147
+
148
+ path {
149
+ fill: var(--check-disabled-icon);
150
+ }
151
+ }
103
152
  }
104
153
 
105
- + div .input__hint {
154
+ ~ div .input__label {
155
+ padding-left: 7px;
156
+ }
157
+
158
+ ~ div .input__hint {
159
+ padding-left: 7px;
160
+ padding-top: 4px;
161
+ }
162
+
163
+ ~ div .input__label,
164
+ ~ div .input__hint {
106
165
  line-height: 1;
107
- margin-top: 4px;
166
+ cursor: pointer;
167
+ }
168
+ }
169
+ }
170
+
171
+ &__toggle {
172
+
173
+ &:checked + .input__toggle__control svg path:nth-of-type(1),
174
+ &:not(:checked) + .input__toggle__control svg path:nth-of-type(2) {
175
+ opacity: 1;
176
+ }
177
+
178
+ &:checked + .input__toggle__control svg path {
179
+ transform: translateX(19.6px);
180
+ }
181
+
182
+ &:disabled {
183
+ + .input__toggle__control {
184
+ cursor: default;
185
+
186
+ svg {
187
+
188
+ rect {
189
+ fill: var(--inputField-background-disabled);
190
+ }
191
+
192
+ path {
193
+ fill: var(--check-disabled-icon);
194
+ }
195
+ }
196
+ }
197
+
198
+ ~ div .input__label,
199
+ ~ div .input__hint {
200
+ cursor: default;
201
+ color: var(--check-disabled-text);
108
202
  }
109
203
  }
204
+
205
+ &__control {
206
+ cursor: pointer;
207
+ width: 47px;
208
+ height: 26px;
209
+
210
+ svg {
211
+ width: 47px;
212
+ height: 26px;
213
+
214
+ rect {
215
+ stroke: var(--flipSwitch-border);
216
+ fill: transparent;
217
+ }
218
+
219
+ path {
220
+ transition: 0.3s;
221
+ opacity: 0;
222
+
223
+ &:nth-of-type(1) {
224
+ fill: var(--flipSwitch-checked-background);
225
+ }
226
+
227
+ &:nth-of-type(2) {
228
+ fill: var(--flipSwitch-unchecked-background);
229
+ }
230
+ }
231
+ }
232
+ }
233
+
234
+ ~ div .input__label {
235
+ color: var(--flipSwitch-label);
236
+ }
237
+
238
+ ~ div .input__hint {
239
+ color: var(--flipSwitch-text);
240
+ padding-top: 4px;
241
+ }
242
+
243
+ ~ div .input__label,
244
+ ~ div .input__hint {
245
+ padding-left: 10px;
246
+ line-height: 1;
247
+ cursor: pointer;
248
+ }
110
249
  }
111
250
 
112
251
  &__file {
@@ -139,16 +278,19 @@ label.input__error {
139
278
  @include padding(5px 7px);
140
279
  @include position(absolute, calc(100% + 8px) null null 0);
141
280
 
142
- background-color: $input-errors-color;
143
- border-radius: 3px;
144
- color: $white;
281
+ background-color: var(--formGroup-validation-error);
282
+ border-radius: var(--formGroup-validation-borderRadius);
283
+ color: var(--formGroup-validation-text);
145
284
  font-size: 13px;
146
285
  z-index: 1;
147
286
 
148
287
  &::before {
149
288
  @include position(absolute, null null 100% 8px);
150
- @include triangle("up", 12px, 6px, $input-errors-color);
151
-
152
- content: "";
289
+ border-style: solid;
290
+ height: 0;
291
+ width: 0;
292
+ border-color: transparent transparent var(--formGroup-validation-error);
293
+ border-width: 0 6px 6px;
294
+ content: '';
153
295
  }
154
296
  }