@schneiderelli/cms-runtime 0.0.9 → 0.0.11

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.
@@ -14,7 +14,9 @@
14
14
  breaks: false
15
15
  });
16
16
 
17
- const html = $derived(marked.parse(block.content) as string);
17
+ // Check if content is already HTML (from Quill) or Markdown
18
+ const isHTML = $derived(block.content.includes('<p>') || block.content.includes('<h') || block.content.includes('<ul') || block.content.includes('<ol'));
19
+ const html = $derived(isHTML ? block.content : (marked.parse(block.content) as string));
18
20
  </script>
19
21
 
20
22
  <div class="csm-markdown">
@@ -48,12 +50,29 @@
48
50
  .csm-markdown :global(ol) {
49
51
  margin: 0 0 1rem;
50
52
  padding-left: 1.5rem;
53
+ list-style-position: outside;
54
+ }
55
+
56
+ .csm-markdown :global(ul) {
57
+ list-style-type: disc;
58
+ }
59
+
60
+ .csm-markdown :global(ol) {
61
+ list-style-type: decimal;
51
62
  }
52
63
 
53
64
  .csm-markdown :global(li) {
54
65
  margin-bottom: 0.5rem;
55
66
  }
56
67
 
68
+ .csm-markdown :global(ul ul) {
69
+ list-style-type: circle;
70
+ }
71
+
72
+ .csm-markdown :global(ul ul ul) {
73
+ list-style-type: square;
74
+ }
75
+
57
76
  .csm-markdown :global(strong) {
58
77
  font-weight: 600;
59
78
  }
@@ -8,12 +8,11 @@
8
8
 
9
9
  let { block }: Props = $props();
10
10
 
11
- const html = $derived(marked.parseInline(block.content) as string);
11
+ const html = $derived(marked.parse(block.content) as string);
12
12
  </script>
13
13
 
14
14
  <div
15
15
  class="csm-note csm-note-{block.variant}"
16
- style:background-color={block.backgroundColor || undefined}
17
16
  style:color={block.textColor || undefined}
18
17
  >
19
18
  {@html html}
@@ -60,4 +59,30 @@
60
59
  .csm-note :global(strong) {
61
60
  font-weight: 600;
62
61
  }
62
+
63
+ .csm-note :global(p) {
64
+ margin: 0 0 0.5rem;
65
+ }
66
+
67
+ .csm-note :global(p:last-child) {
68
+ margin-bottom: 0;
69
+ }
70
+
71
+ .csm-note :global(ul),
72
+ .csm-note :global(ol) {
73
+ margin: 0 0 0.75rem;
74
+ padding-left: 1.5rem;
75
+ }
76
+
77
+ .csm-note :global(li) {
78
+ margin-bottom: 0.375rem;
79
+ }
80
+
81
+ .csm-note :global(ul) {
82
+ list-style-type: disc;
83
+ }
84
+
85
+ .csm-note :global(ol) {
86
+ list-style-type: decimal;
87
+ }
63
88
  </style>
@@ -8,7 +8,7 @@
8
8
 
9
9
  let { block }: Props = $props();
10
10
 
11
- const html = $derived(marked.parseInline(block.content) as string);
11
+ const html = $derived(marked.parse(block.content) as string);
12
12
  </script>
13
13
 
14
14
  <blockquote class="csm-quote">
@@ -41,4 +41,34 @@
41
41
  font-style: normal;
42
42
  color: var(--csm-muted-color, #64748b);
43
43
  }
44
+
45
+ .csm-quote-content :global(p) {
46
+ margin: 0 0 0.5rem;
47
+ }
48
+
49
+ .csm-quote-content :global(p:last-child) {
50
+ margin-bottom: 0;
51
+ }
52
+
53
+ .csm-quote-content :global(ul),
54
+ .csm-quote-content :global(ol) {
55
+ margin: 0 0 0.75rem;
56
+ padding-left: 1.5rem;
57
+ }
58
+
59
+ .csm-quote-content :global(li) {
60
+ margin-bottom: 0.375rem;
61
+ }
62
+
63
+ .csm-quote-content :global(ul) {
64
+ list-style-type: disc;
65
+ }
66
+
67
+ .csm-quote-content :global(ol) {
68
+ list-style-type: decimal;
69
+ }
70
+
71
+ .csm-quote-content :global(strong) {
72
+ font-weight: 600;
73
+ }
44
74
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schneiderelli/cms-runtime",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "Content System Manager Runtime - Shared types and components for CMS editor and website framework",
5
5
  "scripts": {
6
6
  "dev": "vite dev",