alchemy_cms 6.0.0.pre.rc3 → 6.0.0.pre.rc4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21260eb0f68590cfe400b34ba5cbfe8d18551ed9fd2f6cc206bb5c7ed2aebb66
4
- data.tar.gz: 870421eb1bbaf3c7b246de59379297f63f3719da3601e1ac07f8bb72877d6c0a
3
+ metadata.gz: da8076b5e01533899e6c3003841940160335389c6e8a961bedec1b08839f61ba
4
+ data.tar.gz: dfcd49629458243d86cb4bb49615da876b3e5bfb1b69de121f90fe6e98bb964c
5
5
  SHA512:
6
- metadata.gz: 8056e9a0e2cebea3069b47405f60339e4dbb1af55399323a32f7298976e918318ec7e790674a273d84825c0416c6658127dba68c5596562e0f8687bb9cbcd56e
7
- data.tar.gz: 438ee71b5721ccf34a713a9c6469c5cc1a383a1dd75f7534348cb25b9ef9f9dd668e59821e7d3c087c1f3cc3d86fbf121d5e7b0c07905dfcb2f4cd431005f13d
6
+ metadata.gz: a25f6e26595f7b7e218200a0a7dbc1e69ac175c1daa3736b443501f80c8f1012215c69ab2f17addeb61b397cb3288b018b87f8e175d1ec9c1399e38101018d7f
7
+ data.tar.gz: 1c8cee2a1c08c70581945e25dc0745ba9bf2dea83e44220e00a096fce531df941bea97405836dcc4cf650ede4e12162e7ab6b9dc18a8e297f4ac6f71a18643d6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 6.0.0-rc4 (2022-01-16)
2
+
3
+ ### Changes
4
+
5
+ - Allow ransack 2.5.0 [#2223](https://github.com/AlchemyCMS/alchemy_cms/pull/2223) ([depfu](https://github.com/apps/depfu))
6
+ - make the admin error tracker customizable [#2220](https://github.com/AlchemyCMS/alchemy_cms/pull/2220) ([DarkSwoop](https://github.com/DarkSwoop))
7
+ - Update Flatpickr to 4.6.9 [#2197](https://github.com/AlchemyCMS/alchemy_cms/pull/2197) ([tvdeyen](https://github.com/tvdeyen))
8
+
1
9
  ## 6.0.0-rc3 (2021-11-24)
2
10
 
3
11
  ### Changes
data/alchemy_cms.gemspec CHANGED
@@ -46,7 +46,7 @@ Gem::Specification.new do |gem|
46
46
  gem.add_runtime_dependency "kaminari", ["~> 1.1"]
47
47
  gem.add_runtime_dependency "originator", ["~> 3.1"]
48
48
  gem.add_runtime_dependency "non-stupid-digest-assets", ["~> 1.0.8"]
49
- gem.add_runtime_dependency "ransack", [">= 1.8", "< 2.4.2"] # 2.4.2 dropped Ruby 2.5 support in a patch level release
49
+ gem.add_runtime_dependency "ransack", [">= 1.8", "<= 2.5.0"] # 2.4.2 dropped Ruby 2.5 support in a patch level release
50
50
  gem.add_runtime_dependency "request_store", ["~> 1.2"]
51
51
  gem.add_runtime_dependency "responders", [">= 2.0", "< 4.0"]
52
52
  gem.add_runtime_dependency "sassc-rails", ["~> 2.1"]
@@ -22,7 +22,6 @@
22
22
  //= require alchemy/alchemy.dialog
23
23
  //= require alchemy/alchemy.char_counter
24
24
  //= require alchemy/alchemy.confirm_dialog
25
- //= require alchemy/alchemy.datepicker
26
25
  //= require alchemy/alchemy.dirty
27
26
  //= require alchemy/alchemy.dragndrop
28
27
  //= require alchemy/alchemy.element_editors
@@ -6,7 +6,7 @@ Alchemy.GUI =
6
6
  # Initializes all Alchemy GUI elements in given scope
7
7
  init: (scope) ->
8
8
  Alchemy.SelectBox(scope)
9
- Alchemy.Datepicker(scope)
9
+ Alchemy.Datepicker(scope && scope.selector)
10
10
  Alchemy.Tooltips(scope)
11
11
  Alchemy.Buttons.observe(scope)
12
12
  # Dialog links use event delegation and therefore do not
@@ -21,7 +21,7 @@ Alchemy.GUI =
21
21
 
22
22
  initElement: ($el) ->
23
23
  Alchemy.ElementDirtyObserver($el)
24
- Alchemy.GUI.init($el)
24
+ Alchemy.GUI.init($el && $el.selector)
25
25
  Alchemy.ImageLoader($el[0])
26
26
  Alchemy.fileEditors($el.find(".essence_file, .essence_video, .essence_audio, .ingredient-editor.file, .ingredient-editor.audio, .ingredient-editor.video").selector)
27
27
  Alchemy.pictureEditors($el.find(".essence_picture, .ingredient-editor.picture").selector)
@@ -37,8 +37,8 @@
37
37
 
38
38
  &[disabled],
39
39
  &.disabled,
40
- &[readonly],
41
- &.readonly {
40
+ &:not(.flatpickr-input)[readonly],
41
+ &:not(.flatpickr-input).readonly {
42
42
  color: $form-field-disabled-text-color;
43
43
  background-color: $form-field-disabled-bg-color;
44
44
  cursor: default;
@@ -49,8 +49,8 @@
49
49
  cursor: not-allowed;
50
50
  }
51
51
 
52
- &[readonly],
53
- &.readonly {
52
+ &:not(.flatpickr-input)[readonly],
53
+ &:not(.flatpickr-input).readonly {
54
54
  pointer-events: none;
55
55
  }
56
56
  }
@@ -19,148 +19,137 @@
19
19
  -ms-touch-action: manipulation;
20
20
  touch-action: manipulation;
21
21
  background: $white;
22
- -webkit-box-shadow: 1px 0 0 $medium-gray, -1px 0 0 $medium-gray, 0 1px 0 $medium-gray, 0 -1px 0 $medium-gray, 0 3px 13px rgba(0, 0, 0, 0.08);
23
- box-shadow: 1px 0 0 $medium-gray, -1px 0 0 $medium-gray, 0 1px 0 $medium-gray, 0 -1px 0 $medium-gray, 0 3px 13px rgba(0, 0, 0, 0.08);
22
+ -webkit-box-shadow: 1px 0 0 $medium-gray, -1px 0 0 $medium-gray,
23
+ 0 1px 0 $medium-gray, 0 -1px 0 $medium-gray, 0 3px 13px rgba(0, 0, 0, 0.08);
24
+ box-shadow: 1px 0 0 $medium-gray, -1px 0 0 $medium-gray, 0 1px 0 $medium-gray,
25
+ 0 -1px 0 $medium-gray, 0 3px 13px rgba(0, 0, 0, 0.08);
24
26
  }
25
-
26
27
  .flatpickr-calendar.open,
27
28
  .flatpickr-calendar.inline {
28
29
  opacity: 1;
29
30
  max-height: 640px;
30
- visibility: visible
31
+ visibility: visible;
31
32
  }
32
-
33
33
  .flatpickr-calendar.open {
34
34
  display: inline-block;
35
- z-index: 99999
35
+ z-index: 99999;
36
36
  }
37
-
38
37
  .flatpickr-calendar.animate.open {
39
- -webkit-animation: fpFadeInDown 300ms cubic-bezier(.23, 1, .32, 1);
40
- animation: fpFadeInDown 300ms cubic-bezier(.23, 1, .32, 1)
38
+ -webkit-animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1);
39
+ animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1);
41
40
  }
42
-
43
41
  .flatpickr-calendar.inline {
44
42
  display: block;
45
43
  position: relative;
46
- top: 2px
44
+ top: 2px;
47
45
  }
48
-
49
46
  .flatpickr-calendar.static {
50
47
  position: absolute;
51
48
  top: calc(100% + 2px);
52
49
  }
53
-
54
50
  .flatpickr-calendar.static.open {
55
51
  z-index: 999;
56
- display: block
52
+ display: block;
57
53
  }
58
-
59
- .flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7) {
54
+ .flatpickr-calendar.multiMonth
55
+ .flatpickr-days
56
+ .dayContainer:nth-child(n + 1)
57
+ .flatpickr-day.inRange:nth-child(7n + 7) {
60
58
  -webkit-box-shadow: none !important;
61
- box-shadow: none !important
59
+ box-shadow: none !important;
62
60
  }
63
-
64
- .flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) {
61
+ .flatpickr-calendar.multiMonth
62
+ .flatpickr-days
63
+ .dayContainer:nth-child(n + 2)
64
+ .flatpickr-day.inRange:nth-child(7n + 1) {
65
65
  -webkit-box-shadow: -2px 0 0 $medium-gray, 5px 0 0 $medium-gray;
66
- box-shadow: -2px 0 0 $medium-gray, 5px 0 0 $medium-gray
66
+ box-shadow: -2px 0 0 $medium-gray, 5px 0 0 $medium-gray;
67
67
  }
68
-
69
68
  .flatpickr-calendar .hasWeeks .dayContainer,
70
69
  .flatpickr-calendar .hasTime .dayContainer {
71
70
  border-bottom: 0;
72
71
  border-bottom-right-radius: 0;
73
- border-bottom-left-radius: 0
72
+ border-bottom-left-radius: 0;
74
73
  }
75
-
76
74
  .flatpickr-calendar .hasWeeks .dayContainer {
77
- border-left: 0
75
+ border-left: 0;
78
76
  }
79
-
80
- .flatpickr-calendar.showTimeInput.hasTime .flatpickr-time {
77
+ .flatpickr-calendar.hasTime .flatpickr-time {
81
78
  height: 40px;
82
- border-top: 1px solid $medium-gray
79
+ border-top: 1px solid $medium-gray;
83
80
  }
84
-
85
81
  .flatpickr-calendar.noCalendar.hasTime .flatpickr-time {
86
- height: auto
82
+ height: auto;
87
83
  }
88
-
89
84
  .flatpickr-calendar:before,
90
85
  .flatpickr-calendar:after {
91
86
  position: absolute;
92
87
  display: block;
93
88
  pointer-events: none;
94
89
  border: solid transparent;
95
- content: '';
90
+ content: "";
96
91
  height: 0;
97
92
  width: 0;
98
- left: 22px
93
+ left: 22px;
99
94
  }
100
-
101
95
  .flatpickr-calendar.rightMost:before,
102
- .flatpickr-calendar.rightMost:after {
96
+ .flatpickr-calendar.arrowRight:before,
97
+ .flatpickr-calendar.rightMost:after,
98
+ .flatpickr-calendar.arrowRight:after {
103
99
  left: auto;
104
- right: 22px
100
+ right: 22px;
101
+ }
102
+ .flatpickr-calendar.arrowCenter:before,
103
+ .flatpickr-calendar.arrowCenter:after {
104
+ left: 50%;
105
+ right: 50%;
105
106
  }
106
-
107
107
  .flatpickr-calendar:before {
108
108
  border-width: 5px;
109
- margin: 0 -5px
109
+ margin: 0 -5px;
110
110
  }
111
-
112
111
  .flatpickr-calendar:after {
113
112
  border-width: 4px;
114
- margin: 0 -4px
113
+ margin: 0 -4px;
115
114
  }
116
-
117
115
  .flatpickr-calendar.arrowTop:before,
118
116
  .flatpickr-calendar.arrowTop:after {
119
- bottom: 100%
117
+ bottom: 100%;
120
118
  }
121
-
122
119
  .flatpickr-calendar.arrowTop:before {
123
- border-bottom-color: $medium-gray
120
+ border-bottom-color: $medium-gray;
124
121
  }
125
-
126
122
  .flatpickr-calendar.arrowTop:after {
127
- border-bottom-color: $white
123
+ border-bottom-color: $white;
128
124
  }
129
-
130
125
  .flatpickr-calendar.arrowBottom:before,
131
126
  .flatpickr-calendar.arrowBottom:after {
132
- top: 100%
127
+ top: 100%;
133
128
  }
134
-
135
129
  .flatpickr-calendar.arrowBottom:before {
136
- border-top-color: $medium-gray
130
+ border-top-color: $medium-gray;
137
131
  }
138
-
139
132
  .flatpickr-calendar.arrowBottom:after {
140
- border-top-color: $white
133
+ border-top-color: $white;
141
134
  }
142
-
143
135
  .flatpickr-calendar:focus {
144
- outline: 0
136
+ outline: 0;
145
137
  }
146
-
147
138
  .flatpickr-wrapper {
148
139
  position: relative;
149
- display: inline-block
140
+ display: inline-block;
150
141
  }
151
-
152
142
  .flatpickr-months {
153
143
  display: -webkit-box;
154
144
  display: -webkit-flex;
155
145
  display: -ms-flexbox;
156
146
  display: flex;
157
147
  }
158
-
159
148
  .flatpickr-months .flatpickr-month {
160
149
  background: transparent;
161
150
  color: rgba(0, 0, 0, 0.9);
162
151
  fill: rgba(0, 0, 0, 0.9);
163
- height: $form-field-height;
152
+ height: 34px;
164
153
  line-height: 1;
165
154
  text-align: center;
166
155
  position: relative;
@@ -172,43 +161,35 @@
172
161
  -webkit-box-flex: 1;
173
162
  -webkit-flex: 1;
174
163
  -ms-flex: 1;
175
- flex: 1
164
+ flex: 1;
176
165
  }
177
-
178
166
  .flatpickr-months .flatpickr-prev-month,
179
167
  .flatpickr-months .flatpickr-next-month {
180
168
  text-decoration: none;
181
169
  cursor: pointer;
182
170
  position: absolute;
183
171
  top: 0;
184
- line-height: 16px;
185
- height: 28px;
172
+ height: 34px;
186
173
  padding: 10px;
187
174
  z-index: 3;
188
175
  color: rgba(0, 0, 0, 0.9);
189
176
  fill: rgba(0, 0, 0, 0.9);
190
177
  }
191
-
192
- .flatpickr-months .flatpickr-prev-month.disabled,
193
- .flatpickr-months .flatpickr-next-month.disabled {
194
- display: none
178
+ .flatpickr-months .flatpickr-prev-month.flatpickr-disabled,
179
+ .flatpickr-months .flatpickr-next-month.flatpickr-disabled {
180
+ display: none;
195
181
  }
196
-
197
182
  .flatpickr-months .flatpickr-prev-month i,
198
183
  .flatpickr-months .flatpickr-next-month i {
199
- position: relative
184
+ position: relative;
200
185
  }
201
-
202
186
  .flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,
203
187
  .flatpickr-months .flatpickr-next-month.flatpickr-prev-month {
204
188
  /*
205
189
  /*rtl:begin:ignore*/
206
- left: 0;
207
- /*
190
+ left: 0; /*
208
191
  /*rtl:end:ignore*/
209
- }
210
-
211
- /*
192
+ } /*
212
193
  /*rtl:begin:ignore*/
213
194
  /*
214
195
  /*rtl:end:ignore*/
@@ -216,12 +197,9 @@
216
197
  .flatpickr-months .flatpickr-next-month.flatpickr-next-month {
217
198
  /*
218
199
  /*rtl:begin:ignore*/
219
- right: 0;
220
- /*
200
+ right: 0; /*
221
201
  /*rtl:end:ignore*/
222
- }
223
-
224
- /*
202
+ } /*
225
203
  /*rtl:begin:ignore*/
226
204
  /*
227
205
  /*rtl:end:ignore*/
@@ -229,43 +207,40 @@
229
207
  .flatpickr-months .flatpickr-next-month:hover {
230
208
  color: $dark-gray;
231
209
  }
232
-
233
210
  .flatpickr-months .flatpickr-prev-month:hover svg,
234
211
  .flatpickr-months .flatpickr-next-month:hover svg {
235
212
  fill: $dark-orange;
236
213
  }
237
-
238
214
  .flatpickr-months .flatpickr-prev-month svg,
239
215
  .flatpickr-months .flatpickr-next-month svg {
240
216
  width: 14px;
241
217
  height: 14px;
242
218
  }
243
-
244
219
  .flatpickr-months .flatpickr-prev-month svg path,
245
220
  .flatpickr-months .flatpickr-next-month svg path {
246
- -webkit-transition: fill .1s;
247
- transition: fill .1s;
248
- fill: inherit
221
+ -webkit-transition: fill 0.1s;
222
+ transition: fill 0.1s;
223
+ fill: inherit;
249
224
  }
250
-
251
225
  .numInputWrapper {
252
226
  position: relative;
253
227
  height: auto;
254
228
  }
255
-
256
229
  .numInputWrapper input,
257
230
  .numInputWrapper span {
258
- display: inline-block
231
+ display: inline-block;
259
232
  }
260
-
261
233
  .numInputWrapper input {
262
234
  width: 100%;
263
235
  }
264
-
265
236
  .numInputWrapper input::-ms-clear {
266
- display: none
237
+ display: none;
238
+ }
239
+ .numInputWrapper input::-webkit-outer-spin-button,
240
+ .numInputWrapper input::-webkit-inner-spin-button {
241
+ margin: 0;
242
+ -webkit-appearance: none;
267
243
  }
268
-
269
244
  .numInputWrapper span {
270
245
  position: absolute;
271
246
  right: 0;
@@ -275,119 +250,101 @@
275
250
  line-height: 50%;
276
251
  opacity: 0;
277
252
  cursor: pointer;
278
- border: 1px solid rgba(57, 57, 57, 0.15);
253
+ border: $default-border;
279
254
  -webkit-box-sizing: border-box;
280
255
  box-sizing: border-box;
281
256
  }
282
-
283
257
  .numInputWrapper span:hover {
284
- background: rgba(0, 0, 0, 0.1)
258
+ background: rgba(0, 0, 0, 0.1);
285
259
  }
286
-
287
260
  .numInputWrapper span:active {
288
- background: rgba(0, 0, 0, 0.2)
261
+ background: rgba(0, 0, 0, 0.2);
289
262
  }
290
-
291
263
  .numInputWrapper span:after {
292
264
  display: block;
293
265
  content: "";
294
- position: absolute
266
+ position: absolute;
295
267
  }
296
-
297
268
  .numInputWrapper span.arrowUp {
298
269
  top: 0;
299
270
  border-bottom: 0;
300
271
  }
301
-
302
272
  .numInputWrapper span.arrowUp:after {
303
273
  border-left: 4px solid transparent;
304
274
  border-right: 4px solid transparent;
305
- border-bottom: 4px solid rgba(57, 57, 57, 0.6);
306
- top: 26%
275
+ border-bottom: 4px solid $default-border-color;
276
+ top: 26%;
307
277
  }
308
-
309
278
  .numInputWrapper span.arrowDown {
310
279
  top: 50%;
311
280
  }
312
-
313
281
  .numInputWrapper span.arrowDown:after {
314
282
  border-left: 4px solid transparent;
315
283
  border-right: 4px solid transparent;
316
- border-top: 4px solid rgba(57, 57, 57, 0.6);
317
- top: 40%
284
+ border-top: 4px solid $default-border-color;
285
+ top: 40%;
318
286
  }
319
-
320
287
  .numInputWrapper span svg {
321
288
  width: inherit;
322
289
  height: auto;
323
290
  }
324
-
325
291
  .numInputWrapper span svg path {
326
- fill: rgba(0, 0, 0, 0.5)
292
+ fill: rgba(0, 0, 0, 0.5);
327
293
  }
328
-
329
294
  .numInputWrapper:hover {
330
295
  background: rgba(0, 0, 0, 0.05);
331
296
  }
332
-
333
297
  .numInputWrapper:hover span {
334
- opacity: 1
298
+ opacity: 1;
335
299
  }
336
-
337
300
  .flatpickr-current-month {
338
- font-size: 1.25rem;
301
+ font-size: 135%;
339
302
  line-height: inherit;
340
303
  font-weight: 300;
341
304
  color: inherit;
342
305
  position: absolute;
343
306
  width: 75%;
344
307
  left: 12.5%;
345
- padding: 6.16px 0 0 0;
308
+ padding: 7.48px 0 0 0;
346
309
  line-height: 1;
347
- height: 28px;
310
+ height: 34px;
348
311
  display: inline-block;
349
312
  text-align: center;
350
313
  -webkit-transform: translate3d(0, 0, 0);
351
314
  transform: translate3d(0, 0, 0);
352
315
  }
353
-
354
316
  .flatpickr-current-month span.cur-month {
355
317
  font-family: inherit;
356
318
  font-weight: 700;
357
319
  color: inherit;
358
320
  display: inline-block;
359
- margin-left: .5ch;
321
+ margin-left: 0.5ch;
360
322
  padding: 0;
361
323
  }
362
-
363
324
  .flatpickr-current-month span.cur-month:hover {
364
- background: rgba(0, 0, 0, 0.05)
325
+ background: rgba(0, 0, 0, 0.05);
365
326
  }
366
-
367
327
  .flatpickr-current-month .numInputWrapper {
368
328
  width: 6ch;
369
329
  width: 7ch\0;
370
330
  display: inline-block;
371
331
  }
372
-
373
332
  .flatpickr-current-month .numInputWrapper span.arrowUp:after {
374
- border-bottom-color: rgba(0, 0, 0, 0.9)
333
+ border-bottom-color: rgba(0, 0, 0, 0.9);
375
334
  }
376
-
377
335
  .flatpickr-current-month .numInputWrapper span.arrowDown:after {
378
- border-top-color: rgba(0, 0, 0, 0.9)
336
+ border-top-color: rgba(0, 0, 0, 0.9);
379
337
  }
380
-
381
338
  .flatpickr-current-month input.cur-year {
382
339
  background: transparent;
383
340
  -webkit-box-sizing: border-box;
384
341
  box-sizing: border-box;
385
342
  color: inherit;
386
343
  cursor: text;
387
- padding: 0 0 0 .5ch;
344
+ padding: 0 0 0 0.5ch;
388
345
  margin: 0;
389
346
  display: inline-block;
390
- font-size: $form-field-font-size;
347
+ font-size: inherit;
391
348
  font-family: inherit;
392
349
  font-weight: 300;
393
350
  line-height: inherit;
@@ -395,19 +352,57 @@
395
352
  border: 0;
396
353
  border-radius: 0;
397
354
  vertical-align: initial;
355
+ -webkit-appearance: textfield;
356
+ -moz-appearance: textfield;
357
+ appearance: textfield;
398
358
  }
399
-
400
359
  .flatpickr-current-month input.cur-year:focus {
401
- outline: 0
360
+ outline: 0;
402
361
  }
403
-
404
362
  .flatpickr-current-month input.cur-year[disabled],
405
363
  .flatpickr-current-month input.cur-year[disabled]:hover {
364
+ font-size: 100%;
406
365
  color: rgba(0, 0, 0, 0.5);
407
366
  background: transparent;
408
- pointer-events: none
367
+ pointer-events: none;
368
+ }
369
+ .flatpickr-current-month .flatpickr-monthDropdown-months {
370
+ appearance: menulist;
371
+ background: transparent;
372
+ border: none;
373
+ border-radius: 0;
374
+ box-sizing: border-box;
375
+ color: inherit;
376
+ cursor: pointer;
377
+ font-size: inherit;
378
+ font-family: inherit;
379
+ font-weight: 300;
380
+ height: auto;
381
+ line-height: inherit;
382
+ margin: -1px 0 0 0;
383
+ outline: none;
384
+ padding: 0 0 0 0.5ch;
385
+ position: relative;
386
+ vertical-align: initial;
387
+ -webkit-box-sizing: border-box;
388
+ -webkit-appearance: menulist;
389
+ -moz-appearance: menulist;
390
+ width: auto;
391
+ }
392
+ .flatpickr-current-month .flatpickr-monthDropdown-months:focus,
393
+ .flatpickr-current-month .flatpickr-monthDropdown-months:active {
394
+ outline: none;
395
+ }
396
+ .flatpickr-current-month .flatpickr-monthDropdown-months:hover {
397
+ background: rgba(0, 0, 0, 0.05);
398
+ }
399
+ .flatpickr-current-month
400
+ .flatpickr-monthDropdown-months
401
+ .flatpickr-monthDropdown-month {
402
+ background-color: transparent;
403
+ outline: none;
404
+ padding: 0;
409
405
  }
410
-
411
406
  .flatpickr-weekdays {
412
407
  background: transparent;
413
408
  text-align: center;
@@ -423,7 +418,6 @@
423
418
  align-items: center;
424
419
  height: 28px;
425
420
  }
426
-
427
421
  .flatpickr-weekdays .flatpickr-weekdaycontainer {
428
422
  display: -webkit-box;
429
423
  display: -webkit-flex;
@@ -432,11 +426,11 @@
432
426
  -webkit-box-flex: 1;
433
427
  -webkit-flex: 1;
434
428
  -ms-flex: 1;
435
- flex: 1
429
+ flex: 1;
436
430
  }
437
-
438
431
  span.flatpickr-weekday {
439
432
  cursor: default;
433
+ font-size: 90%;
440
434
  background: transparent;
441
435
  color: rgba(0, 0, 0, 0.54);
442
436
  line-height: 1;
@@ -447,14 +441,12 @@ span.flatpickr-weekday {
447
441
  -webkit-flex: 1;
448
442
  -ms-flex: 1;
449
443
  flex: 1;
450
- font-weight: bolder
444
+ font-weight: bolder;
451
445
  }
452
-
453
446
  .dayContainer,
454
447
  .flatpickr-weeks {
455
- padding: 1px 0 0 0
448
+ padding: 1px 0 0 0;
456
449
  }
457
-
458
450
  .flatpickr-days {
459
451
  position: relative;
460
452
  overflow: hidden;
@@ -468,11 +460,9 @@ span.flatpickr-weekday {
468
460
  align-items: flex-start;
469
461
  width: 307.875px;
470
462
  }
471
-
472
463
  .flatpickr-days:focus {
473
- outline: 0
464
+ outline: 0;
474
465
  }
475
-
476
466
  .dayContainer {
477
467
  padding: 0;
478
468
  outline: 0;
@@ -497,16 +487,14 @@ span.flatpickr-weekday {
497
487
  transform: translate3d(0, 0, 0);
498
488
  opacity: 1;
499
489
  }
500
-
501
- .dayContainer+.dayContainer {
490
+ .dayContainer + .dayContainer {
502
491
  -webkit-box-shadow: -1px 0 0 $medium-gray;
503
- box-shadow: -1px 0 0 $medium-gray
492
+ box-shadow: -1px 0 0 $medium-gray;
504
493
  }
505
-
506
494
  .flatpickr-day {
507
495
  background: none;
508
496
  border: 1px solid transparent;
509
- border-radius: $default-border-radius;
497
+ border-radius: 150px;
510
498
  -webkit-box-sizing: border-box;
511
499
  box-sizing: border-box;
512
500
  color: #393939;
@@ -528,7 +516,6 @@ span.flatpickr-weekday {
528
516
  justify-content: center;
529
517
  text-align: center;
530
518
  }
531
-
532
519
  .flatpickr-day.inRange,
533
520
  .flatpickr-day.prevMonthDay.inRange,
534
521
  .flatpickr-day.nextMonthDay.inRange,
@@ -544,20 +531,17 @@ span.flatpickr-weekday {
544
531
  cursor: pointer;
545
532
  outline: 0;
546
533
  background: $medium-gray;
547
- border-color: $medium-gray
534
+ border-color: $medium-gray;
548
535
  }
549
-
550
536
  .flatpickr-day.today {
551
537
  border-color: $dark-gray;
552
538
  }
553
-
554
539
  .flatpickr-day.today:hover,
555
540
  .flatpickr-day.today:focus {
556
541
  border-color: $dark-gray;
557
542
  background: $dark-gray;
558
- color: $white
543
+ color: $white;
559
544
  }
560
-
561
545
  .flatpickr-day.selected,
562
546
  .flatpickr-day.startRange,
563
547
  .flatpickr-day.endRange,
@@ -580,42 +564,36 @@ span.flatpickr-weekday {
580
564
  -webkit-box-shadow: none;
581
565
  box-shadow: none;
582
566
  color: $white;
583
- border-color: $blue
567
+ border-color: $blue;
584
568
  }
585
-
586
569
  .flatpickr-day.selected.startRange,
587
570
  .flatpickr-day.startRange.startRange,
588
571
  .flatpickr-day.endRange.startRange {
589
- border-radius: 50px 0 0 50px
572
+ border-radius: 50px 0 0 50px;
590
573
  }
591
-
592
574
  .flatpickr-day.selected.endRange,
593
575
  .flatpickr-day.startRange.endRange,
594
576
  .flatpickr-day.endRange.endRange {
595
- border-radius: 0 50px 50px 0
577
+ border-radius: 0 50px 50px 0;
596
578
  }
597
-
598
- .flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),
599
- .flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),
600
- .flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)) {
579
+ .flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n + 1)),
580
+ .flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n + 1)),
581
+ .flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n + 1)) {
601
582
  -webkit-box-shadow: -10px 0 0 $blue;
602
- box-shadow: -10px 0 0 $blue
583
+ box-shadow: -10px 0 0 $blue;
603
584
  }
604
-
605
585
  .flatpickr-day.selected.startRange.endRange,
606
586
  .flatpickr-day.startRange.startRange.endRange,
607
587
  .flatpickr-day.endRange.startRange.endRange {
608
- border-radius: 50px
588
+ border-radius: 50px;
609
589
  }
610
-
611
590
  .flatpickr-day.inRange {
612
591
  border-radius: 0;
613
592
  -webkit-box-shadow: -5px 0 0 $medium-gray, 5px 0 0 $medium-gray;
614
- box-shadow: -5px 0 0 $medium-gray, 5px 0 0 $medium-gray
593
+ box-shadow: -5px 0 0 $medium-gray, 5px 0 0 $medium-gray;
615
594
  }
616
-
617
- .flatpickr-day.disabled,
618
- .flatpickr-day.disabled:hover,
595
+ .flatpickr-day.flatpickr-disabled,
596
+ .flatpickr-day.flatpickr-disabled:hover,
619
597
  .flatpickr-day.prevMonthDay,
620
598
  .flatpickr-day.nextMonthDay,
621
599
  .flatpickr-day.notAllowed,
@@ -624,46 +602,37 @@ span.flatpickr-weekday {
624
602
  color: rgba(57, 57, 57, 0.3);
625
603
  background: transparent;
626
604
  border-color: transparent;
627
- cursor: default
605
+ cursor: default;
628
606
  }
629
-
630
- .flatpickr-day.disabled,
631
- .flatpickr-day.disabled:hover {
607
+ .flatpickr-day.flatpickr-disabled,
608
+ .flatpickr-day.flatpickr-disabled:hover {
632
609
  cursor: not-allowed;
633
- color: rgba(57, 57, 57, 0.1)
610
+ color: rgba(57, 57, 57, 0.1);
634
611
  }
635
-
636
612
  .flatpickr-day.week.selected {
637
613
  border-radius: 0;
638
614
  -webkit-box-shadow: -5px 0 0 $blue, 5px 0 0 $blue;
639
- box-shadow: -5px 0 0 $blue, 5px 0 0 $blue
615
+ box-shadow: -5px 0 0 $blue, 5px 0 0 $blue;
640
616
  }
641
-
642
617
  .flatpickr-day.hidden {
643
- visibility: hidden
618
+ visibility: hidden;
644
619
  }
645
-
646
620
  .rangeMode .flatpickr-day {
647
- margin-top: 1px
621
+ margin-top: 1px;
648
622
  }
649
-
650
623
  .flatpickr-weekwrapper {
651
- display: inline-block;
652
624
  float: left;
653
625
  }
654
-
655
626
  .flatpickr-weekwrapper .flatpickr-weeks {
656
627
  padding: 0 12px;
657
628
  -webkit-box-shadow: 1px 0 0 $medium-gray;
658
- box-shadow: 1px 0 0 $medium-gray
629
+ box-shadow: 1px 0 0 $medium-gray;
659
630
  }
660
-
661
631
  .flatpickr-weekwrapper .flatpickr-weekday {
662
632
  float: none;
663
633
  width: 100%;
664
- line-height: 28px
634
+ line-height: 28px;
665
635
  }
666
-
667
636
  .flatpickr-weekwrapper span.flatpickr-day,
668
637
  .flatpickr-weekwrapper span.flatpickr-day:hover {
669
638
  display: block;
@@ -672,9 +641,8 @@ span.flatpickr-weekday {
672
641
  color: rgba(57, 57, 57, 0.3);
673
642
  background: transparent;
674
643
  cursor: default;
675
- border: none
644
+ border: none;
676
645
  }
677
-
678
646
  .flatpickr-innerContainer {
679
647
  display: block;
680
648
  display: -webkit-box;
@@ -685,14 +653,12 @@ span.flatpickr-weekday {
685
653
  box-sizing: border-box;
686
654
  overflow: hidden;
687
655
  }
688
-
689
656
  .flatpickr-rContainer {
690
657
  display: inline-block;
691
658
  padding: 0;
692
659
  -webkit-box-sizing: border-box;
693
- box-sizing: border-box
660
+ box-sizing: border-box;
694
661
  }
695
-
696
662
  .flatpickr-time {
697
663
  text-align: center;
698
664
  outline: 0;
@@ -708,13 +674,11 @@ span.flatpickr-weekday {
708
674
  display: -ms-flexbox;
709
675
  display: flex;
710
676
  }
711
-
712
677
  .flatpickr-time:after {
713
678
  content: "";
714
679
  display: table;
715
- clear: both
680
+ clear: both;
716
681
  }
717
-
718
682
  .flatpickr-time .numInputWrapper {
719
683
  -webkit-box-flex: 1;
720
684
  -webkit-flex: 1;
@@ -724,23 +688,18 @@ span.flatpickr-weekday {
724
688
  height: 40px;
725
689
  float: left;
726
690
  }
727
-
728
691
  .flatpickr-time .numInputWrapper span.arrowUp:after {
729
- border-bottom-color: #393939
692
+ border-bottom-color: #393939;
730
693
  }
731
-
732
694
  .flatpickr-time .numInputWrapper span.arrowDown:after {
733
- border-top-color: #393939
695
+ border-top-color: #393939;
734
696
  }
735
-
736
697
  .flatpickr-time.hasSeconds .numInputWrapper {
737
- width: 26%
698
+ width: 26%;
738
699
  }
739
-
740
700
  .flatpickr-time.time24hr .numInputWrapper {
741
- width: 49%
701
+ width: 49%;
742
702
  }
743
-
744
703
  .flatpickr-time input {
745
704
  background: transparent;
746
705
  -webkit-box-shadow: none;
@@ -752,31 +711,29 @@ span.flatpickr-weekday {
752
711
  padding: 0;
753
712
  height: inherit;
754
713
  line-height: inherit;
755
- color: #393939;
756
- font-size: $form-field-font-size;
714
+ color: $form-field-text-color;
715
+ font-size: 14px;
757
716
  position: relative;
758
717
  -webkit-box-sizing: border-box;
759
718
  box-sizing: border-box;
719
+ -webkit-appearance: textfield;
720
+ -moz-appearance: textfield;
721
+ appearance: textfield;
760
722
  }
761
-
762
723
  .flatpickr-time input.flatpickr-hour {
763
- font-weight: bold
724
+ font-weight: bold;
764
725
  }
765
-
766
726
  .flatpickr-time input.flatpickr-minute,
767
727
  .flatpickr-time input.flatpickr-second {
768
- font-weight: 400
728
+ font-weight: 400;
769
729
  }
770
-
771
730
  .flatpickr-time input:focus {
772
731
  outline: 0;
773
- border: 0
732
+ border: 0;
774
733
  }
775
-
776
734
  .flatpickr-time .flatpickr-time-separator,
777
735
  .flatpickr-time .flatpickr-am-pm {
778
736
  height: inherit;
779
- display: inline-block;
780
737
  float: left;
781
738
  line-height: inherit;
782
739
  color: #393939;
@@ -788,52 +745,45 @@ span.flatpickr-weekday {
788
745
  user-select: none;
789
746
  -webkit-align-self: center;
790
747
  -ms-flex-item-align: center;
791
- align-self: center
748
+ align-self: center;
792
749
  }
793
-
794
750
  .flatpickr-time .flatpickr-am-pm {
795
751
  outline: 0;
796
752
  width: 18%;
797
753
  cursor: pointer;
798
754
  text-align: center;
799
- font-weight: 400
755
+ font-weight: 400;
800
756
  }
801
-
802
757
  .flatpickr-time input:hover,
803
758
  .flatpickr-time .flatpickr-am-pm:hover,
804
759
  .flatpickr-time input:focus,
805
760
  .flatpickr-time .flatpickr-am-pm:focus {
806
- background: $light-gray
761
+ background: $light-gray;
807
762
  }
808
-
809
763
  .flatpickr-input[readonly] {
810
- cursor: pointer
764
+ cursor: pointer;
811
765
  }
812
-
813
766
  @-webkit-keyframes fpFadeInDown {
814
767
  from {
815
768
  opacity: 0;
816
769
  -webkit-transform: translate3d(0, -20px, 0);
817
- transform: translate3d(0, -20px, 0)
770
+ transform: translate3d(0, -20px, 0);
818
771
  }
819
-
820
772
  to {
821
773
  opacity: 1;
822
774
  -webkit-transform: translate3d(0, 0, 0);
823
- transform: translate3d(0, 0, 0)
775
+ transform: translate3d(0, 0, 0);
824
776
  }
825
777
  }
826
-
827
778
  @keyframes fpFadeInDown {
828
779
  from {
829
780
  opacity: 0;
830
781
  -webkit-transform: translate3d(0, -20px, 0);
831
- transform: translate3d(0, -20px, 0)
782
+ transform: translate3d(0, -20px, 0);
832
783
  }
833
-
834
784
  to {
835
785
  opacity: 1;
836
786
  -webkit-transform: translate3d(0, 0, 0);
837
- transform: translate3d(0, 0, 0)
787
+ transform: translate3d(0, 0, 0);
838
788
  }
839
789
  }
@@ -40,9 +40,7 @@ module Alchemy
40
40
  def exception_handler(error)
41
41
  exception_logger(error)
42
42
  show_error_notice(error)
43
- if defined?(Airbrake)
44
- notify_airbrake(error) unless Rails.env.development? || Rails.env.test?
45
- end
43
+ notify_error_tracker(error)
46
44
  end
47
45
 
48
46
  # Displays an error notice in the Alchemy backend.
@@ -146,6 +144,14 @@ module Alchemy
146
144
  site
147
145
  end
148
146
  end
147
+
148
+ def notify_error_tracker(exception)
149
+ if ::Alchemy::ErrorTracking.notification_handler.respond_to?(:call)
150
+ ::Alchemy::ErrorTracking.notification_handler.call(exception)
151
+ else
152
+ Rails.logger.warn("To use the Alchemy::ErrorTracking.notification_handler, it must respond to #call.")
153
+ end
154
+ end
149
155
  end
150
156
  end
151
157
  end
@@ -44,5 +44,12 @@ module Alchemy
44
44
  end
45
45
  end
46
46
  end
47
+
48
+ initializer "alchemy.error_tracking" do
49
+ if defined?(Airbrake)
50
+ require_relative "error_tracking/airbrake_handler"
51
+ Alchemy::ErrorTracking.notification_handler = Alchemy::ErrorTracking::AirbrakeHandler
52
+ end
53
+ end
47
54
  end
48
55
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module ErrorTracking
5
+ class AirbrakeHandler < BaseHandler
6
+ def self.call(exception)
7
+ return if ["development", "test"].include?(Rails.env)
8
+
9
+ notify_airbrake(exception)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module ErrorTracking
5
+ class BaseHandler
6
+ def self.call(exception)
7
+ # implement your own notification method
8
+ end
9
+ end
10
+
11
+ mattr_accessor :notification_handler
12
+ @@notification_handler = BaseHandler
13
+ end
14
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "6.0.0-rc3"
4
+ VERSION = "6.0.0-rc4"
5
5
 
6
6
  def self.version
7
7
  VERSION
data/lib/alchemy_cms.rb CHANGED
@@ -37,6 +37,7 @@ require_relative "alchemy/controller_actions"
37
37
  require_relative "alchemy/deprecation"
38
38
  require_relative "alchemy/element_definition"
39
39
  require_relative "alchemy/elements_finder"
40
+ require_relative "alchemy/error_tracking"
40
41
  require_relative "alchemy/errors"
41
42
  require_relative "alchemy/essence"
42
43
  require_relative "alchemy/filetypes"
data/package/admin.js CHANGED
@@ -5,6 +5,7 @@ import fileEditors from "./src/file_editors"
5
5
  import pictureEditors from "./src/picture_editors"
6
6
  import ImageLoader from "./src/image_loader"
7
7
  import ImageCropper from "./src/image_cropper"
8
+ import Datepicker from "./src/datepicker"
8
9
 
9
10
  // Global Alchemy object
10
11
  if (typeof window.Alchemy === "undefined") {
@@ -20,5 +21,6 @@ Object.assign(Alchemy, {
20
21
  fileEditors,
21
22
  pictureEditors,
22
23
  ImageLoader: ImageLoader.init,
23
- ImageCropper
24
+ ImageCropper,
25
+ Datepicker
24
26
  })
@@ -0,0 +1,39 @@
1
+ import flatpickr from "flatpickr"
2
+
3
+ export default function Datepicker(scope = document) {
4
+ if (scope === "") {
5
+ scope = document
6
+ } else if (scope instanceof String) {
7
+ scope = document.querySelectorAll(scope)
8
+ }
9
+
10
+ const datepickerInputs = scope.querySelectorAll("input[data-datepicker-type]")
11
+
12
+ // Initializes the datepickers on the text inputs and sets the proper type
13
+ // to enable browsers default datepicker if the current OS is iOS.
14
+ if (Alchemy.isiOS) {
15
+ datepickerInputs.forEach((input) => {
16
+ input.attributes.type = input.dataset.datepickerType
17
+ })
18
+ } else {
19
+ datepickerInputs.forEach((input) => {
20
+ const type = input.dataset.datepickerType
21
+ const options = {
22
+ // alchemy_i18n supports `zh_CN` etc., but flatpickr only has two-letter codes (`zh`)
23
+ locale: Alchemy.locale.slice(0, 2),
24
+ altInput: true,
25
+ altFormat: Alchemy.t(`formats.${type}`),
26
+ altInputClass: "flatpickr-input",
27
+ enableTime: /time/.test(type),
28
+ noCalendar: type === "time",
29
+ time_24hr: Alchemy.t("formats.time_24hr"),
30
+ onValueUpdate(_selectedDates, _dateStr, instance) {
31
+ return Alchemy.setElementDirty(
32
+ instance.element.closest(".element-editor")
33
+ )
34
+ }
35
+ }
36
+ flatpickr(input, options)
37
+ })
38
+ }
39
+ }
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alchemy_cms/admin",
3
- "version": "6.0.0-rc3",
3
+ "version": "6.0.0-rc4",
4
4
  "description": "AlchemyCMS",
5
5
  "browser": "package/admin.js",
6
6
  "files": [
@@ -24,6 +24,7 @@
24
24
  },
25
25
  "homepage": "https://github.com/AlchemyCMS/alchemy_cms#readme",
26
26
  "dependencies": {
27
+ "flatpickr": "^4.6.9",
27
28
  "lodash-es": "^4.17.21",
28
29
  "sortablejs": "^1.10.2"
29
30
  },
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.pre.rc3
4
+ version: 6.0.0.pre.rc4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2021-11-24 00:00:00.000000000 Z
16
+ date: 2022-01-16 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: actionmailer
@@ -408,9 +408,9 @@ dependencies:
408
408
  - - ">="
409
409
  - !ruby/object:Gem::Version
410
410
  version: '1.8'
411
- - - "<"
411
+ - - "<="
412
412
  - !ruby/object:Gem::Version
413
- version: 2.4.2
413
+ version: 2.5.0
414
414
  type: :runtime
415
415
  prerelease: false
416
416
  version_requirements: !ruby/object:Gem::Requirement
@@ -418,9 +418,9 @@ dependencies:
418
418
  - - ">="
419
419
  - !ruby/object:Gem::Version
420
420
  version: '1.8'
421
- - - "<"
421
+ - - "<="
422
422
  - !ruby/object:Gem::Version
423
- version: 2.4.2
423
+ version: 2.5.0
424
424
  - !ruby/object:Gem::Dependency
425
425
  name: request_store
426
426
  requirement: !ruby/object:Gem::Requirement
@@ -757,7 +757,6 @@ files:
757
757
  - app/assets/javascripts/alchemy/alchemy.buttons.js.coffee
758
758
  - app/assets/javascripts/alchemy/alchemy.char_counter.js.coffee
759
759
  - app/assets/javascripts/alchemy/alchemy.confirm_dialog.js.coffee
760
- - app/assets/javascripts/alchemy/alchemy.datepicker.js.coffee
761
760
  - app/assets/javascripts/alchemy/alchemy.dialog.js.coffee
762
761
  - app/assets/javascripts/alchemy/alchemy.dirty.js.coffee
763
762
  - app/assets/javascripts/alchemy/alchemy.dragndrop.js.coffee
@@ -1308,6 +1307,8 @@ files:
1308
1307
  - lib/alchemy/element_definition.rb
1309
1308
  - lib/alchemy/elements_finder.rb
1310
1309
  - lib/alchemy/engine.rb
1310
+ - lib/alchemy/error_tracking.rb
1311
+ - lib/alchemy/error_tracking/airbrake_handler.rb
1311
1312
  - lib/alchemy/errors.rb
1312
1313
  - lib/alchemy/essence.rb
1313
1314
  - lib/alchemy/filetypes.rb
@@ -1424,6 +1425,7 @@ files:
1424
1425
  - package.json
1425
1426
  - package/admin.js
1426
1427
  - package/src/__tests__/i18n.spec.js
1428
+ - package/src/datepicker.js
1427
1429
  - package/src/file_editors.js
1428
1430
  - package/src/i18n.js
1429
1431
  - package/src/image_cropper.js
@@ -1,29 +0,0 @@
1
- window.Alchemy = {} if typeof(window.Alchemy) is 'undefined'
2
-
3
- $.extend Alchemy,
4
-
5
- Datepicker: (scope) ->
6
- $datepicker_inputs = $('input[data-datepicker-type]', scope)
7
-
8
- # Initializes the datepickers on the text inputs and sets the proper type
9
- # to enable browsers default datepicker if the current OS is iOS.
10
- if Alchemy.isiOS
11
- $datepicker_inputs.prop "type", ->
12
- return $(this).data('datepicker-type')
13
- else
14
- $datepicker_inputs.each ->
15
- type = $(this).data('datepicker-type')
16
- options =
17
- # alchemy_i18n supports `zh_CN` etc., but flatpickr only has two-letter codes (`zh`)
18
- locale: Alchemy.locale.slice(0, 2)
19
- altInput: true
20
- altFormat: Alchemy.t("formats.#{type}")
21
- altInputClass: ""
22
- enableTime: /time/.test(type)
23
- noCalendar: type == "time"
24
- time_24hr: Alchemy.t("formats.time_24hr")
25
- onValueUpdate: (_selectedDates, _dateStr, instance) ->
26
- Alchemy.setElementDirty $(instance.element).closest(".element-editor")
27
- $(this).flatpickr(options)
28
-
29
- return