beyond_canvas 0.19.2.pre → 0.23.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -45
  3. data/app/assets/images/icons/adblocker.svg +5 -0
  4. data/app/assets/images/icons/checkbox_checked.svg +1 -1
  5. data/app/assets/images/icons/checkbox_unchecked.svg +1 -1
  6. data/app/assets/images/icons/external_link.svg +1 -0
  7. data/app/assets/images/icons/toggle.svg +1 -0
  8. data/app/assets/images/icons/toggle_checked.svg +3 -0
  9. data/app/assets/images/icons/toggle_unchecked.svg +3 -0
  10. data/app/assets/javascripts/beyond_canvas/base.js +107 -44
  11. data/app/assets/stylesheets/beyond_canvas/base.scss +21 -18
  12. data/app/assets/stylesheets/beyond_canvas/components/_action_bar.scss +11 -6
  13. data/app/assets/stylesheets/beyond_canvas/components/_breadcrumbs.scss +8 -4
  14. data/app/assets/stylesheets/beyond_canvas/components/_buttons.scss +50 -56
  15. data/app/assets/stylesheets/beyond_canvas/components/_cards.scss +20 -12
  16. data/app/assets/stylesheets/beyond_canvas/components/_collapse.scss +33 -0
  17. data/app/assets/stylesheets/beyond_canvas/components/_flash.scss +13 -12
  18. data/app/assets/stylesheets/beyond_canvas/components/_forms.scss +2 -2
  19. data/app/assets/stylesheets/beyond_canvas/components/_inputs.scss +186 -38
  20. data/app/assets/stylesheets/beyond_canvas/components/_links.scss +80 -4
  21. data/app/assets/stylesheets/beyond_canvas/components/_main.scss +3 -3
  22. data/app/assets/stylesheets/beyond_canvas/components/_menu.scss +13 -0
  23. data/app/assets/stylesheets/beyond_canvas/components/_modals.scss +48 -18
  24. data/app/assets/stylesheets/beyond_canvas/components/_notices.scss +12 -13
  25. data/app/assets/stylesheets/beyond_canvas/components/_scrollbox.scss +5 -4
  26. data/app/assets/stylesheets/beyond_canvas/components/_select2.scss +70 -0
  27. data/app/assets/stylesheets/beyond_canvas/components/_statuses.scss +28 -0
  28. data/app/assets/stylesheets/beyond_canvas/components/_step_list.scss +67 -0
  29. data/app/assets/stylesheets/beyond_canvas/components/_tables.scss +10 -5
  30. data/app/assets/stylesheets/beyond_canvas/components/_titles.scss +1 -1
  31. data/app/assets/stylesheets/beyond_canvas/mailer.scss +2 -1
  32. data/app/assets/stylesheets/beyond_canvas/settings/_base_variables.scss +241 -0
  33. data/app/assets/stylesheets/beyond_canvas/settings/{_variables.scss → _constant_variables.scss} +60 -53
  34. data/app/assets/stylesheets/beyond_canvas/settings/_custom_variables.scss +233 -0
  35. data/app/assets/stylesheets/beyond_canvas/settings/_typography.scss +7 -3
  36. data/app/assets/stylesheets/beyond_canvas/utilities/_mixins.scss +39 -3
  37. data/app/controllers/beyond_canvas/authentications_controller.rb +18 -2
  38. data/app/controllers/beyond_canvas/system_controller.rb +3 -1
  39. data/app/controllers/beyond_canvas/webhooks_controller.rb +49 -0
  40. data/app/controllers/concerns/beyond_canvas/add_blocker_check.rb +17 -0
  41. data/app/controllers/concerns/beyond_canvas/custom_styles.rb +54 -0
  42. data/app/controllers/concerns/beyond_canvas/locale_management.rb +31 -8
  43. data/app/controllers/concerns/beyond_canvas/request_validation.rb +6 -0
  44. data/app/form_builders/beyond_canvas/form_builder.rb +62 -49
  45. data/app/helpers/beyond_canvas/application_helper.rb +48 -4
  46. data/app/helpers/beyond_canvas/form_tag_helper.rb +130 -0
  47. data/app/helpers/beyond_canvas/statuses_helper.rb +26 -0
  48. data/app/javascript/beyond_canvas/base.js +1 -1
  49. data/app/javascript/beyond_canvas/initializers/buttons.js +49 -29
  50. data/app/javascript/beyond_canvas/initializers/collapse.js +8 -0
  51. data/app/javascript/beyond_canvas/initializers/flash.js +33 -11
  52. data/app/javascript/beyond_canvas/initializers/inputs.js +9 -4
  53. data/app/javascript/beyond_canvas/initializers/modals.js +46 -10
  54. data/app/views/beyond_canvas/mailer/_header.html.erb +2 -2
  55. data/app/views/beyond_canvas/shared/_breadcrumbs.html.erb +5 -2
  56. data/app/views/beyond_canvas/shared/_flash.html.erb +14 -10
  57. data/app/views/beyond_canvas/shared/_head.html.erb +4 -0
  58. data/app/views/beyond_canvas/shared/_locales.html.erb +1 -1
  59. data/app/views/layouts/beyond_canvas/application.html.erb +1 -2
  60. data/app/views/layouts/beyond_canvas/public.html.erb +1 -1
  61. data/config/initializers/beyond_canvas/constants.rb +13 -0
  62. data/config/initializers/beyond_canvas/session_store.rb +8 -0
  63. data/lib/beyond_canvas/configuration.rb +9 -1
  64. data/lib/beyond_canvas/engine.rb +7 -0
  65. data/lib/beyond_canvas/rails/routes.rb +27 -7
  66. data/lib/beyond_canvas/version.rb +1 -1
  67. data/lib/beyond_canvas/webhook_event_registration.rb +19 -0
  68. data/lib/beyond_canvas.rb +6 -4
  69. data/lib/generators/beyond_canvas/custom_styles/templates/beyond_canvas_custom_styles.scss +33 -0
  70. data/lib/generators/beyond_canvas/install/install_generator.rb +6 -0
  71. data/lib/generators/beyond_canvas/install/templates/beyond_canvas.rb.erb +38 -1
  72. data/lib/generators/beyond_canvas/model/model_generator.rb +3 -0
  73. data/lib/generators/beyond_canvas/webhook/templates/webhooks_controller.rb +22 -0
  74. data/lib/generators/beyond_canvas/webhook/webhook_generator.rb +15 -0
  75. data/lib/models/concerns/authentication.rb +10 -3
  76. data/lib/models/concerns/utils.rb +6 -5
  77. data/lib/models/concerns/webhook.rb +123 -0
  78. data/lib/models/shop.rb +1 -0
  79. metadata +73 -40
  80. data/app/assets/stylesheets/beyond_canvas/components/_comments.scss +0 -6
  81. data/app/assets/stylesheets/beyond_canvas/components/_containers.scss +0 -37
  82. data/app/views/beyond_canvas/shared/_modal.html.erb +0 -6
  83. data/config/routes.rb +0 -12
@@ -1,17 +1,93 @@
1
+ %link_disabled {
2
+ @include color-darken($link-disabled-color, 10%);
3
+
4
+ cursor: not-allowed;
5
+ pointer-events: none;
6
+ }
7
+
8
+ %link {
9
+ line-height: 1.2;
10
+ }
11
+
12
+ @mixin external($color) {
13
+ background-image: url('data:image/svg+xml;utf8,\
14
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\
15
+ <path d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/>\
16
+ </svg>');
17
+
18
+ background-position-x: right;
19
+ background-position-y: center;
20
+ background-repeat: no-repeat;
21
+ background-size: 12px;
22
+ padding-right: 18px;
23
+
24
+ @include recolor($color, 1);
25
+
26
+ &:hover {
27
+ @include recolor(darken($color, 10%), 1);
28
+
29
+ transition: $main-transition;
30
+ }
31
+ }
32
+
1
33
  .link {
2
- &__icon {
3
- margin-right: 10px;
34
+ &__icon--left,
35
+ &__icon--right {
36
+ @include size(14px);
37
+ }
38
+
39
+ &__icon--left {
40
+ margin-right: 6px;
41
+ }
42
+
43
+ &__icon--right {
44
+ margin-left: 6px;
4
45
  }
5
46
 
6
47
  &--primary {
7
- @include color-darken($link-primary-color, 10%);
48
+ color: var(--primaryLink-color);
49
+
50
+ @extend %link;
51
+
52
+ &:hover {
53
+ color: var(--primaryLink-hover-color);
54
+ }
55
+
56
+ &[target="_blank"] {
57
+ @include external($link-primary-color)
58
+ }
8
59
  }
9
60
 
10
61
  &--secondary {
11
- @include color-darken($link-secondary-color, 10%);
62
+ color: var(--defaultLink-color);
63
+
64
+ @extend %link;
65
+
66
+ &:hover {
67
+ color: var(--defaultLink-hover-color);
68
+ }
69
+
70
+ &[target="_blank"] {
71
+ @include external($link-secondary-color)
72
+ }
12
73
  }
13
74
 
14
75
  &--danger {
15
76
  @include color-darken($link-danger-color, 10%);
77
+
78
+ @extend %link;
79
+
80
+ &[target="_blank"] {
81
+ @include external($link-secondary-color)
82
+ }
83
+ }
84
+
85
+ &--primary,
86
+ &--secondary,
87
+ &--danger {
88
+ &:disabled,
89
+ &[disabled] {
90
+ @extend %link_disabled;
91
+ }
16
92
  }
17
93
  }
@@ -6,10 +6,10 @@
6
6
  }
7
7
 
8
8
  .body--public {
9
- background-color: $main-background-public;
9
+ background-color: var(--workspace-background);
10
10
 
11
11
  .main-wrapper {
12
- @include margin(32px auto);
12
+ @include margin(32px auto 100px);
13
13
 
14
14
  max-width: 531px;
15
15
  width: 94%;
@@ -24,7 +24,7 @@
24
24
  }
25
25
 
26
26
  .body--application {
27
- background-color: $main-background-application;
27
+ background-color: var(--workspace-background);
28
28
 
29
29
  .main-wrapper {
30
30
  @include margin(25px auto 100px auto);
@@ -30,13 +30,26 @@
30
30
  display: inherit;
31
31
  }
32
32
 
33
+ &__icon {
34
+ @include size(14px);
35
+
36
+ margin-right: 6px;
37
+ fill: $menu-item-color;
38
+ }
39
+
33
40
  &__item {
34
41
  @include margin(0 15px);
35
42
  line-height: 1;
36
43
  color: $menu-item-color;
44
+ display: flex;
45
+ align-items: center;
37
46
 
38
47
  &:hover {
39
48
  color: $menu-item-hover-color;
49
+
50
+ .menu__icon {
51
+ fill: $menu-item-hover-color;
52
+ }
40
53
  }
41
54
 
42
55
  &--active {
@@ -1,35 +1,65 @@
1
1
  .modal {
2
+ @include position(fixed, 0 0 0 0);
2
3
 
3
- &__background {
4
+ align-items: center;
5
+ background-color: var(--modal-overlay-background);
6
+ content: '';
7
+ display: flex;
8
+ height: 100%;
9
+ justify-content: center;
10
+ width: 100%;
11
+ z-index: 99999;
12
+ visibility: hidden;
13
+
14
+ &__dialog {
4
15
  width: 100%;
5
- height: 100%;
6
- background-color: $modal-background-color;
7
- position: absolute;
8
- z-index: 99999;
9
- justify-content: center;
10
- align-items: center;
11
- display: none;
12
-
13
- .card {
14
- width: 100%;
15
- max-width: $modal-width;
16
- margin: 25px;
17
- }
16
+ max-width: $modal-width;
17
+ margin: 25px;
18
18
  }
19
19
 
20
- &__headline {
20
+ &__content {
21
+ @include padding(var(--modal-container-padding));
22
+
23
+ background: var(--notification-background);
24
+ border-radius: var(--notification-borderRadius);
25
+ box-shadow: var(--notification-boxShadow);
26
+ box-sizing: border-box;
27
+ position: relative;
28
+ }
29
+
30
+ &__header {
21
31
  margin-bottom: 30px;
32
+ }
33
+
34
+ &__title {
22
35
  font-size: 24px;
23
36
  font-weight: normal;
24
37
  line-height: 1.2;
25
- color: rgb(62, 62, 62);
38
+ color: var(--notification-text);
26
39
  }
27
40
 
28
41
  &__close {
29
- @include position(absolute, $modal-padding $modal-padding null null);
42
+ // SEE: https://newbedev.com/change-svg-fill-color-in-before-or-after-css
43
+ @include position(absolute, 20px 20px null null);
44
+ @include prefixer(mask, url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M23.954 21.03l-9.184-9.095 9.092-9.174L21.03-.046l-9.09 9.179L2.764.045l-2.81 2.81L9.14 11.96.045 21.144l2.81 2.81 9.112-9.192 9.18 9.1z"></path></svg>'), ('webkit'));
45
+ @include prefixer(mask-size, cover, ('webkit'));
30
46
  @include size(14px);
31
47
 
48
+ background-color: var(--modal-closeButton-icon);
49
+ content: '';
32
50
  cursor: pointer;
33
- fill: $modal-close-icon-color;
51
+ display: inline-block;
52
+
53
+ &:hover {
54
+ background-color: var(--modal-closeButton-icon-hover);
55
+ }
56
+ }
57
+
58
+ &__body {
59
+ @extend %scrollbox;
60
+ }
61
+
62
+ &__footer {
63
+ margin-top: 35px;
34
64
  }
35
65
  }
@@ -1,38 +1,38 @@
1
1
  .notice {
2
- border-radius: $notice-border-radius;
2
+ border-radius: var(--notification-borderRadius);
3
3
  border: 1px solid;
4
4
  box-sizing: border-box;
5
5
  display: flex;
6
6
 
7
7
  &--success {
8
- border-color: $notice-success-background;
8
+ border-color: var(--notification-success);
9
9
 
10
10
  .notice__icon {
11
- background-color: $notice-success-background;
11
+ background-color: var(--notification-success);
12
12
  }
13
13
  }
14
14
 
15
15
  &--info {
16
- border-color: $notice-info-background;
16
+ border-color: var(--notification-info);
17
17
 
18
18
  .notice__icon {
19
- background-color: $notice-info-background;
19
+ background-color: var(--notification-info);
20
20
  }
21
21
  }
22
22
 
23
23
  &--warning {
24
- border-color: $notice-warning-background;
24
+ border-color: var(--notification-warning);
25
25
 
26
26
  .notice__icon {
27
- background-color: $notice-warning-background;
27
+ background-color: var(--notification-warning);
28
28
  }
29
29
  }
30
30
 
31
31
  &--error {
32
- border-color: $notice-error-background;
32
+ border-color: var(--notification-danger);
33
33
 
34
34
  .notice__icon {
35
- background-color: $notice-error-background;
35
+ background-color: var(--notification-danger);
36
36
  }
37
37
  }
38
38
 
@@ -44,15 +44,14 @@
44
44
  > svg {
45
45
  @include size(18px);
46
46
 
47
- fill: $white;
47
+ fill: var(--notification-background);
48
48
  }
49
49
  }
50
50
 
51
51
  &__content {
52
52
  @include padding(8px 14px);
53
53
 
54
- color: $notice-color;
55
- display: flex;
56
- align-items: center;
54
+ color: var(--notification-text);
55
+ display: block;
57
56
  }
58
57
  }
@@ -1,6 +1,7 @@
1
- .scrollbox {
1
+ %scrollbox {
2
2
  max-height: 65vh;
3
3
  overflow: auto;
4
+ padding-right: 20px;
4
5
  width: 100%;
5
6
 
6
7
  -ms-overflow-style: none;
@@ -28,8 +29,8 @@
28
29
 
29
30
  /* Opera doesn’t support this in the shorthand */
30
31
  background-attachment: local, local, scroll, scroll;
32
+ }
31
33
 
32
- &::-webkit-scrollbar {
33
- display: none;
34
- }
34
+ .scrollbox {
35
+ @extend %scrollbox;
35
36
  }
@@ -0,0 +1,70 @@
1
+ .beyond-canvas {
2
+
3
+ .select2-dropdown--above {
4
+ border-top: 1px solid var(--inputField-border-focus) !important;
5
+ }
6
+
7
+ .select2-container--default .select2-selection--multiple {
8
+ border: 1px solid var(--inputField-border);
9
+ border-radius: 3px;
10
+ }
11
+
12
+ .select2-container--default.select2-container--focus .select2-selection--multiple{
13
+ border: 1px solid var(--inputField-border-focus);
14
+ }
15
+
16
+ .select2-container--default.select2-container--open.select2-container--below .select2-selection--single,
17
+ .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
18
+ border-bottom-left-radius: 0;
19
+ border-bottom-right-radius: 0;
20
+ border-color: var(--inputField-border-focus);
21
+ }
22
+
23
+ .select2-container--default.select2-container--disabled .select2-selection--multiple {
24
+ background-color: var(--inputField-background-disabled);
25
+ pointer-events: none;
26
+ }
27
+
28
+ .select2-container--default .select2-results__option--highlighted[aria-selected] {
29
+ background-color: var(--smartInputField-suggestion-active);
30
+ color: var(--workspace-text);
31
+ }
32
+
33
+ .select2-container--default .select2-selection--multiple .select2-selection__choice {
34
+ background-color: var(--smartInputField-value-background);
35
+ color: var(--smartInputField-value-text);
36
+ font-weight: bold;
37
+ font-size: 11px;
38
+ border-radius: var(--smartInputField-value-borderRadius);
39
+ border: none;
40
+ padding: 3px 7px 4px;
41
+ display: flex;
42
+ align-items: center;
43
+ flex-direction: row-reverse;
44
+ }
45
+
46
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
47
+ margin-left: 8px;
48
+ color: var(--smartInputField-value-icon);
49
+ font-size: 18px;
50
+ line-height: 0;
51
+
52
+ &:hover {
53
+ color: var(--smartInputField-value-icon-hover);
54
+ }
55
+ }
56
+
57
+ .select2-dropdown{
58
+ border: 1px solid var(--inputField-border-focus);
59
+ border-top: none;
60
+ z-index: 9999999;
61
+ }
62
+
63
+ .select2-results__option {
64
+ font-weight: 700;
65
+ }
66
+
67
+ .select2-results__option[aria-selected=true] {
68
+ display: none;
69
+ }
70
+ }
@@ -0,0 +1,28 @@
1
+ .status {
2
+ @include padding(4px 6px);
3
+ font-size: 12px;
4
+ border-radius: 3px;
5
+ line-height: 1.2;
6
+ font-weight: 500;
7
+
8
+ &--good {
9
+ background-color: var(--active-status-background);
10
+ color: var(--active-status-text);
11
+ }
12
+
13
+ &--warning {
14
+ background-color: var(--todo-status-background);
15
+ color: var(--todo-status-text);
16
+ }
17
+
18
+ &--danger {
19
+ background-color: var(--danger-status-background);
20
+ color: var(--danger-status-text);
21
+ }
22
+
23
+ &--neutral {
24
+ background-color: var(--outline-status-background);
25
+ border: 1px solid var(--outline-status-border);
26
+ color: var(--outline-status-text);
27
+ }
28
+ }
@@ -0,0 +1,67 @@
1
+ .step-list {
2
+
3
+ &__container {
4
+ background-color: var(--stepList-background);
5
+ padding: 25px;
6
+ }
7
+
8
+ &__title {
9
+ color: var(--stepList-headline);
10
+ font-size: 20px;
11
+ font-weight: bold;
12
+ margin-bottom: 15px;
13
+ margin-top: 0;
14
+ }
15
+
16
+ &__items {
17
+ width: 100%;
18
+ margin-left: -2px;
19
+
20
+ tr:last-child td {
21
+ padding-bottom: 0;
22
+
23
+ &::after {
24
+ height: 0;
25
+ }
26
+ }
27
+
28
+ td {
29
+ vertical-align: top;
30
+ padding-bottom: 20px;
31
+ position: relative;
32
+ }
33
+ }
34
+
35
+ &__bubble-column {
36
+ width: 35px;
37
+ text-align: center;
38
+
39
+ &::after {
40
+ content: ' ';
41
+ position: absolute;
42
+ left: 10px;
43
+ width: 2px;
44
+ height: 100%;
45
+ background-color: var(--stepList-bubble-line);
46
+ }
47
+ }
48
+
49
+ &__bubble {
50
+ width: 20px;
51
+ height: 20px;
52
+ border-radius: 10px;
53
+ background-color: var(--stepList-bubble-background);
54
+ color: var(--stepList-bubble-text);
55
+ line-height: 19px;
56
+ font-size: 11px;
57
+ font-weight: bold;
58
+ }
59
+
60
+ &__headline {
61
+ font-weight: bold;
62
+ line-height: 1.2;
63
+ margin-bottom: 5px;
64
+ color: var(--stepList-headline);
65
+ }
66
+
67
+ }