mediacube-ui 0.1.203 → 0.1.205

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.205](https://github.com/MediaCubeCo/mcui/compare/v0.1.204...v0.1.205) (2024-01-11)
6
+
7
+ ### [0.1.204](https://github.com/MediaCubeCo/mcui/compare/v0.1.203...v0.1.204) (2024-01-10)
8
+
5
9
  ### [0.1.203](https://github.com/MediaCubeCo/mcui/compare/v0.1.202...v0.1.203) (2024-01-09)
6
10
 
7
11
  ### [0.1.202](https://github.com/MediaCubeCo/mcui/compare/v0.1.201...v0.1.202) (2024-01-09)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediacube-ui",
3
- "version": "0.1.203",
3
+ "version": "0.1.205",
4
4
  "description": "Design system for Mediacube services",
5
5
  "author": "Mediacube",
6
6
  "private": false,
@@ -25,8 +25,8 @@
25
25
  :class="contentClasses"
26
26
  v-html="filteredComment"
27
27
  />
28
- <mc-title v-if="comment.message" slot="bottom" :ellipsis="false" class="mc-chat-comment__message">
29
- {{ comment.message }}
28
+ <mc-title v-if="comment.message" slot="bottom" :ellipsis="false" pre-line class="mc-chat-comment__message"
29
+ >{{ comment.message }}
30
30
  </mc-title>
31
31
  <mc-button
32
32
  v-if="canEdit"
@@ -128,6 +128,7 @@ export default {
128
128
  scrolled_bottom: false,
129
129
  resize_observer: null,
130
130
  small_indents: false,
131
+ can_shorten_modal: false,
131
132
  modal_params: {},
132
133
  indent: {
133
134
  regular: 400,
@@ -190,7 +191,7 @@ export default {
190
191
  this.$refs.mcModalBody.addEventListener('scroll', this.calculateSeparators, {
191
192
  passive: true,
192
193
  })
193
- this.resize_observer = new ResizeObserver(() => this.calculateSeparators())
194
+ this.resize_observer = new ResizeObserver(() => this.resizeHandler())
194
195
  this.resize_observer?.observe(this.$refs.mcModalBody)
195
196
  this.calculateSeparators()
196
197
  }
@@ -224,6 +225,28 @@ export default {
224
225
  console.error(e)
225
226
  }
226
227
  },
228
+
229
+ calculateIndents() {
230
+ /* Если шапка уже маленькая, то отключаем при отключении сепаратора
231
+ * Иначе смотрим, чтобы отступ был > чем убираемые отступы, т.к. нет смысла сжимать шапку, если <
232
+ */
233
+ const indentDifferences =
234
+ (this.modal_params?.['--mc-modal-padding'] -
235
+ this.modal_params?.['--mc-modal-padding-small']) *
236
+ 3
237
+ const lineHeightDifferences =
238
+ this.modal_params?.['--mc-modal-header-line-height'] -
239
+ this.modal_params?.['--mc-modal-header-line-height-small']
240
+ const sizeDifferences = indentDifferences + lineHeightDifferences
241
+ if (!this.small_indents) {
242
+ const body = this.$refs.mcModalBody
243
+ this.can_shorten_modal = body?.scrollHeight - body?.clientHeight > sizeDifferences
244
+ }
245
+ },
246
+ resizeHandler() {
247
+ this.calculateIndents()
248
+ this.calculateSeparators()
249
+ },
227
250
  /**
228
251
  * Устанавливаем сепараторы, если есть скролл
229
252
  * @param {Boolean} scrolled - если метод вызван скроллом
@@ -241,18 +264,7 @@ export default {
241
264
  // Сепаратор появится если высота скролла будет > 2px
242
265
  const offset = 2
243
266
  this.scrolled_top = scrollTop > offset
244
- /* Если шапка уже маленькая, то отключаем при отключении сепаратора
245
- * Иначе смотрим, чтобы отступ был > чем убираемые отступы, т.к. нет смысла сжимать шапку, если <
246
- */
247
- const indentDifferences =
248
- (this.modal_params?.['--mc-modal-padding'] -
249
- this.modal_params?.['--mc-modal-padding-small']) *
250
- 3
251
- const lineHeightDifferences =
252
- this.modal_params?.['--mc-modal-header-line-height'] -
253
- this.modal_params?.['--mc-modal-header-line-height-small']
254
- const sizeDifferences = indentDifferences + lineHeightDifferences
255
- this.small_indents = this.small_indents ? this.scrolled_top : scrollTop > sizeDifferences
267
+ this.small_indents = this.scrolled_top && this.can_shorten_modal
256
268
  this.scrolled_bottom = scrollTop + clientHeight < scrollHeight - offset
257
269
  },
258
270
  scrolled ? 0 : 300,
@@ -528,17 +540,18 @@ export default {
528
540
  }
529
541
 
530
542
  &--scrolled {
543
+ $separator-border: 1px solid $color-hover-gray;
531
544
  &-top {
532
545
  #{$block-name} {
533
546
  &__header {
534
- border-bottom: 1px solid $color-outline-gray;
547
+ border-bottom: $separator-border;
535
548
  }
536
549
  }
537
550
  }
538
551
  &-bottom {
539
552
  #{$block-name} {
540
553
  &__control:not(:empty) {
541
- border-top: 1px solid $color-outline-gray;
554
+ border-top: $separator-border;
542
555
  }
543
556
  }
544
557
  }
@@ -564,6 +577,7 @@ export default {
564
577
  }
565
578
  @media #{$media-query-s} {
566
579
  .mc-button {
580
+ min-width: 100px;
567
581
  width: unset;
568
582
  }
569
583
  }