mediacube-ui-v2 0.0.344 → 0.0.345

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "catalogSchemaVersion": 2,
3
- "libraryVersion": "0.0.344",
3
+ "libraryVersion": "0.0.345",
4
4
  "packageName": "mediacube-ui-v2",
5
5
  "pathHash": "9b6f3b8016b22ac7",
6
6
  "componentCount": 76,
@@ -382,7 +382,17 @@
382
382
  }
383
383
  }
384
384
 
385
- @mixin editor-default-styles($main-font-size: $font-size-300, $main-line-height: $line-height-300) {
385
+ /**
386
+ * $preserve-empty-lines — сохранять пустые строки, набранные в редакторе (Enter x2 / Shift+Enter).
387
+ * По умолчанию выключено: пустые параграфы прячутся, как и раньше.
388
+ * Включать только там, где рендерится контент из визуального редактора, и пустая строка —
389
+ * осмысленная часть вёрстки автора. Для текстов из бэка/переводов оставлять false.
390
+ */
391
+ @mixin editor-default-styles(
392
+ $main-font-size: $font-size-300,
393
+ $main-line-height: $line-height-300,
394
+ $preserve-empty-lines: false
395
+ ) {
386
396
  p,
387
397
  strong,
388
398
  em,
@@ -395,6 +405,21 @@
395
405
  display: none;
396
406
  }
397
407
  }
408
+ @if $preserve-empty-lines {
409
+ /**
410
+ * Пустой <p> без контента имеет нулевую высоту, а висящий <br> в конце абзаца
411
+ * браузер не отрисовывает вовсе. Zero-width space даёт последней строке содержимое,
412
+ * поэтому отступ, который автор видит в редакторе, не схлопывается при показе.
413
+ */
414
+ p {
415
+ &:empty {
416
+ display: block;
417
+ }
418
+ &::after {
419
+ content: '\200B';
420
+ }
421
+ }
422
+ }
398
423
  ol,
399
424
  ul {
400
425
  margin-block-start: 0;
@@ -704,8 +729,8 @@
704
729
  }
705
730
 
706
731
 
707
- @mixin editor-notification-styles {
708
- @include editor-default-styles;
732
+ @mixin editor-notification-styles($preserve-empty-lines: false) {
733
+ @include editor-default-styles($preserve-empty-lines: $preserve-empty-lines);
709
734
  h1 {
710
735
  margin-bottom: $space-250;
711
736
  img {
@@ -751,7 +776,7 @@
751
776
  }
752
777
  }
753
778
 
754
- @mixin editor-assist-styles {
779
+ @mixin editor-assist-styles($preserve-empty-lines: false) {
755
780
  img {
756
781
  max-width: 100%;
757
782
  width: 100%;
@@ -759,5 +784,5 @@
759
784
  object-fit: cover;
760
785
  margin: 16px 0;
761
786
  }
762
- @include editor-default-styles;
787
+ @include editor-default-styles($preserve-empty-lines: $preserve-empty-lines);
763
788
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediacube-ui-v2",
3
- "version": "0.0.344",
3
+ "version": "0.0.345",
4
4
  "license": "MIT",
5
5
  "description": "Design system for Mediacube services",
6
6
  "sideEffects": [