markstream-svelte 2.0.2 → 2.0.4

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/dist/index.css CHANGED
@@ -128,12 +128,23 @@ markstream-svelte {
128
128
  }
129
129
 
130
130
  .markstream-svelte .node-placeholder {
131
+ position: relative;
132
+ overflow: hidden;
131
133
  width: 100%;
132
134
  min-height: 1rem;
133
135
  margin: 0.25rem 0;
134
136
  border-radius: 0.5rem;
135
- background-image: linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.05), rgba(148, 163, 184, 0.18));
136
- background-size: 200% 100%;
137
+ background: rgba(148, 163, 184, 0.18);
138
+ }
139
+
140
+ .markstream-svelte .node-placeholder::before {
141
+ content: '';
142
+ position: absolute;
143
+ inset-block: 0;
144
+ left: -200%;
145
+ width: 500%;
146
+ background: linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.05), rgba(148, 163, 184, 0.18));
147
+ background-size: 40% 100%;
137
148
  animation: node-placeholder-shimmer 1.1s ease-in-out infinite;
138
149
  }
139
150
 
@@ -145,7 +156,6 @@ markstream-svelte {
145
156
  .markstream-svelte .fade-node {
146
157
  opacity: 0;
147
158
  animation: typewriter-fade var(--fade-duration, var(--typewriter-fade-duration, 280ms)) var(--fade-ease, var(--typewriter-fade-ease, cubic-bezier(0.33, 0, 0.67, 1))) both;
148
- will-change: opacity;
149
159
  }
150
160
 
151
161
  .markstream-svelte .markstream-svelte-text-node {
@@ -166,7 +176,6 @@ markstream-svelte {
166
176
  animation-duration: var(--stream-update-fade-duration, var(--fade-duration, var(--typewriter-fade-duration, 280ms)));
167
177
  animation-timing-function: var(--stream-update-fade-ease, var(--fade-ease, var(--typewriter-fade-ease, cubic-bezier(0.33, 0, 0.67, 1))));
168
178
  animation-fill-mode: both;
169
- will-change: opacity;
170
179
  }
171
180
 
172
181
  .markstream-svelte .markstream-svelte-text__stream-delta--a {
@@ -270,7 +279,6 @@ markstream-svelte {
270
279
  bottom: var(--underline-bottom, -3px);
271
280
  background: currentColor;
272
281
  border-radius: 999px;
273
- will-change: opacity;
274
282
  opacity: var(--underline-rest-opacity, 0.18);
275
283
  animation: markstream-svelte-link-loading-pulse var(--underline-duration, 1.6s) var(--underline-timing, ease-in-out) var(--underline-iteration, infinite);
276
284
  }
@@ -314,6 +322,10 @@ markstream-svelte {
314
322
  }
315
323
 
316
324
  @media (prefers-reduced-motion: reduce) {
325
+ .markstream-svelte .node-placeholder::before {
326
+ animation: none !important;
327
+ }
328
+
317
329
  .markstream-svelte .link-loading-indicator {
318
330
  animation: none !important;
319
331
  opacity: var(--underline-rest-opacity, 0.18);
@@ -512,17 +524,29 @@ markstream-svelte {
512
524
  }
513
525
 
514
526
  .markstream-svelte .image-shimmer {
527
+ position: relative;
528
+ overflow: hidden;
515
529
  display: block;
516
530
  width: 100%;
517
531
  height: 100%;
518
532
  min-height: 8rem;
533
+ background: hsl(var(--ms-muted));
534
+ }
535
+
536
+ .markstream-svelte .image-shimmer::before {
537
+ content: '';
538
+ position: absolute;
539
+ inset-block: 0;
540
+ left: -200%;
541
+ width: 300%;
519
542
  background: linear-gradient(
520
543
  90deg,
521
544
  hsl(var(--ms-muted)) 0%,
522
545
  hsl(var(--ms-muted-foreground) / 0.06) 50%,
523
546
  hsl(var(--ms-muted)) 100%
524
547
  );
525
- background-size: 200% 100%;
548
+ background-position: 100% 0;
549
+ background-size: 66.6667% 100%;
526
550
  animation: markstream-svelte-image-shimmer 1.5s ease-in-out infinite;
527
551
  }
528
552
 
@@ -546,12 +570,12 @@ markstream-svelte {
546
570
  }
547
571
 
548
572
  @keyframes markstream-svelte-image-shimmer {
549
- 0% { background-position: 100% 0; }
550
- 100% { background-position: -100% 0; }
573
+ from { transform: translateX(0); }
574
+ to { transform: translateX(66.6667%); }
551
575
  }
552
576
 
553
577
  @media (prefers-reduced-motion: reduce) {
554
- .markstream-svelte .image-shimmer {
578
+ .markstream-svelte .image-shimmer::before {
555
579
  animation: none !important;
556
580
  }
557
581
 
@@ -1450,13 +1474,8 @@ body > div[id^="dmermaid-"] {
1450
1474
  }
1451
1475
 
1452
1476
  @keyframes node-placeholder-shimmer {
1453
- from {
1454
- background-position: 200% 0%;
1455
- }
1456
-
1457
- to {
1458
- background-position: -200% 0%;
1459
- }
1477
+ from { transform: translateX(0); }
1478
+ to { transform: translateX(80%); }
1460
1479
  }
1461
1480
 
1462
1481
  @keyframes spin {
package/dist/index.px.css CHANGED
@@ -128,12 +128,23 @@ markstream-svelte {
128
128
  }
129
129
 
130
130
  .markstream-svelte .node-placeholder {
131
+ position: relative;
132
+ overflow: hidden;
131
133
  width: 100%;
132
134
  min-height: 16px;
133
135
  margin: 4px 0;
134
136
  border-radius: 8px;
135
- background-image: linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.05), rgba(148, 163, 184, 0.18));
136
- background-size: 200% 100%;
137
+ background: rgba(148, 163, 184, 0.18);
138
+ }
139
+
140
+ .markstream-svelte .node-placeholder::before {
141
+ content: '';
142
+ position: absolute;
143
+ inset-block: 0;
144
+ left: -200%;
145
+ width: 500%;
146
+ background: linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.05), rgba(148, 163, 184, 0.18));
147
+ background-size: 40% 100%;
137
148
  animation: node-placeholder-shimmer 1.1s ease-in-out infinite;
138
149
  }
139
150
 
@@ -145,7 +156,6 @@ markstream-svelte {
145
156
  .markstream-svelte .fade-node {
146
157
  opacity: 0;
147
158
  animation: typewriter-fade var(--fade-duration, var(--typewriter-fade-duration, 280ms)) var(--fade-ease, var(--typewriter-fade-ease, cubic-bezier(0.33, 0, 0.67, 1))) both;
148
- will-change: opacity;
149
159
  }
150
160
 
151
161
  .markstream-svelte .markstream-svelte-text-node {
@@ -166,7 +176,6 @@ markstream-svelte {
166
176
  animation-duration: var(--stream-update-fade-duration, var(--fade-duration, var(--typewriter-fade-duration, 280ms)));
167
177
  animation-timing-function: var(--stream-update-fade-ease, var(--fade-ease, var(--typewriter-fade-ease, cubic-bezier(0.33, 0, 0.67, 1))));
168
178
  animation-fill-mode: both;
169
- will-change: opacity;
170
179
  }
171
180
 
172
181
  .markstream-svelte .markstream-svelte-text__stream-delta--a {
@@ -270,7 +279,6 @@ markstream-svelte {
270
279
  bottom: var(--underline-bottom, -3px);
271
280
  background: currentColor;
272
281
  border-radius: 999px;
273
- will-change: opacity;
274
282
  opacity: var(--underline-rest-opacity, 0.18);
275
283
  animation: markstream-svelte-link-loading-pulse var(--underline-duration, 1.6s) var(--underline-timing, ease-in-out) var(--underline-iteration, infinite);
276
284
  }
@@ -314,6 +322,10 @@ markstream-svelte {
314
322
  }
315
323
 
316
324
  @media (prefers-reduced-motion: reduce) {
325
+ .markstream-svelte .node-placeholder::before {
326
+ animation: none !important;
327
+ }
328
+
317
329
  .markstream-svelte .link-loading-indicator {
318
330
  animation: none !important;
319
331
  opacity: var(--underline-rest-opacity, 0.18);
@@ -512,17 +524,29 @@ markstream-svelte {
512
524
  }
513
525
 
514
526
  .markstream-svelte .image-shimmer {
527
+ position: relative;
528
+ overflow: hidden;
515
529
  display: block;
516
530
  width: 100%;
517
531
  height: 100%;
518
532
  min-height: 128px;
533
+ background: hsl(var(--ms-muted));
534
+ }
535
+
536
+ .markstream-svelte .image-shimmer::before {
537
+ content: '';
538
+ position: absolute;
539
+ inset-block: 0;
540
+ left: -200%;
541
+ width: 300%;
519
542
  background: linear-gradient(
520
543
  90deg,
521
544
  hsl(var(--ms-muted)) 0%,
522
545
  hsl(var(--ms-muted-foreground) / 0.06) 50%,
523
546
  hsl(var(--ms-muted)) 100%
524
547
  );
525
- background-size: 200% 100%;
548
+ background-position: 100% 0;
549
+ background-size: 66.6667% 100%;
526
550
  animation: markstream-svelte-image-shimmer 1.5s ease-in-out infinite;
527
551
  }
528
552
 
@@ -546,12 +570,12 @@ markstream-svelte {
546
570
  }
547
571
 
548
572
  @keyframes markstream-svelte-image-shimmer {
549
- 0% { background-position: 100% 0; }
550
- 100% { background-position: -100% 0; }
573
+ from { transform: translateX(0); }
574
+ to { transform: translateX(66.6667%); }
551
575
  }
552
576
 
553
577
  @media (prefers-reduced-motion: reduce) {
554
- .markstream-svelte .image-shimmer {
578
+ .markstream-svelte .image-shimmer::before {
555
579
  animation: none !important;
556
580
  }
557
581
 
@@ -1450,13 +1474,8 @@ body > div[id^="dmermaid-"] {
1450
1474
  }
1451
1475
 
1452
1476
  @keyframes node-placeholder-shimmer {
1453
- from {
1454
- background-position: 200% 0%;
1455
- }
1456
-
1457
- to {
1458
- background-position: -200% 0%;
1459
- }
1477
+ from { transform: translateX(0); }
1478
+ to { transform: translateX(80%); }
1460
1479
  }
1461
1480
 
1462
1481
  @keyframes spin {
@@ -128,12 +128,23 @@ markstream-svelte {
128
128
  }
129
129
 
130
130
  .markstream-svelte .node-placeholder {
131
+ position: relative;
132
+ overflow: hidden;
131
133
  width: 100%;
132
134
  min-height: 1rem;
133
135
  margin: 0.25rem 0;
134
136
  border-radius: 0.5rem;
135
- background-image: linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.05), rgba(148, 163, 184, 0.18));
136
- background-size: 200% 100%;
137
+ background: rgba(148, 163, 184, 0.18);
138
+ }
139
+
140
+ .markstream-svelte .node-placeholder::before {
141
+ content: '';
142
+ position: absolute;
143
+ inset-block: 0;
144
+ left: -200%;
145
+ width: 500%;
146
+ background: linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.05), rgba(148, 163, 184, 0.18));
147
+ background-size: 40% 100%;
137
148
  animation: node-placeholder-shimmer 1.1s ease-in-out infinite;
138
149
  }
139
150
 
@@ -145,7 +156,6 @@ markstream-svelte {
145
156
  .markstream-svelte .fade-node {
146
157
  opacity: 0;
147
158
  animation: typewriter-fade var(--fade-duration, var(--typewriter-fade-duration, 280ms)) var(--fade-ease, var(--typewriter-fade-ease, cubic-bezier(0.33, 0, 0.67, 1))) both;
148
- will-change: opacity;
149
159
  }
150
160
 
151
161
  .markstream-svelte .markstream-svelte-text-node {
@@ -166,7 +176,6 @@ markstream-svelte {
166
176
  animation-duration: var(--stream-update-fade-duration, var(--fade-duration, var(--typewriter-fade-duration, 280ms)));
167
177
  animation-timing-function: var(--stream-update-fade-ease, var(--fade-ease, var(--typewriter-fade-ease, cubic-bezier(0.33, 0, 0.67, 1))));
168
178
  animation-fill-mode: both;
169
- will-change: opacity;
170
179
  }
171
180
 
172
181
  .markstream-svelte .markstream-svelte-text__stream-delta--a {
@@ -270,7 +279,6 @@ markstream-svelte {
270
279
  bottom: var(--underline-bottom, -3px);
271
280
  background: currentColor;
272
281
  border-radius: 999px;
273
- will-change: opacity;
274
282
  opacity: var(--underline-rest-opacity, 0.18);
275
283
  animation: markstream-svelte-link-loading-pulse var(--underline-duration, 1.6s) var(--underline-timing, ease-in-out) var(--underline-iteration, infinite);
276
284
  }
@@ -314,6 +322,10 @@ markstream-svelte {
314
322
  }
315
323
 
316
324
  @media (prefers-reduced-motion: reduce) {
325
+ .markstream-svelte .node-placeholder::before {
326
+ animation: none !important;
327
+ }
328
+
317
329
  .markstream-svelte .link-loading-indicator {
318
330
  animation: none !important;
319
331
  opacity: var(--underline-rest-opacity, 0.18);
@@ -512,17 +524,29 @@ markstream-svelte {
512
524
  }
513
525
 
514
526
  .markstream-svelte .image-shimmer {
527
+ position: relative;
528
+ overflow: hidden;
515
529
  display: block;
516
530
  width: 100%;
517
531
  height: 100%;
518
532
  min-height: 8rem;
533
+ background: hsl(var(--ms-muted));
534
+ }
535
+
536
+ .markstream-svelte .image-shimmer::before {
537
+ content: '';
538
+ position: absolute;
539
+ inset-block: 0;
540
+ left: -200%;
541
+ width: 300%;
519
542
  background: linear-gradient(
520
543
  90deg,
521
544
  hsl(var(--ms-muted)) 0%,
522
545
  hsl(var(--ms-muted-foreground) / 0.06) 50%,
523
546
  hsl(var(--ms-muted)) 100%
524
547
  );
525
- background-size: 200% 100%;
548
+ background-position: 100% 0;
549
+ background-size: 66.6667% 100%;
526
550
  animation: markstream-svelte-image-shimmer 1.5s ease-in-out infinite;
527
551
  }
528
552
 
@@ -546,12 +570,12 @@ markstream-svelte {
546
570
  }
547
571
 
548
572
  @keyframes markstream-svelte-image-shimmer {
549
- 0% { background-position: 100% 0; }
550
- 100% { background-position: -100% 0; }
573
+ from { transform: translateX(0); }
574
+ to { transform: translateX(66.6667%); }
551
575
  }
552
576
 
553
577
  @media (prefers-reduced-motion: reduce) {
554
- .markstream-svelte .image-shimmer {
578
+ .markstream-svelte .image-shimmer::before {
555
579
  animation: none !important;
556
580
  }
557
581
 
@@ -1450,13 +1474,8 @@ body > div[id^="dmermaid-"] {
1450
1474
  }
1451
1475
 
1452
1476
  @keyframes node-placeholder-shimmer {
1453
- from {
1454
- background-position: 200% 0%;
1455
- }
1456
-
1457
- to {
1458
- background-position: -200% 0%;
1459
- }
1477
+ from { transform: translateX(0); }
1478
+ to { transform: translateX(80%); }
1460
1479
  }
1461
1480
 
1462
1481
  @keyframes spin {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "markstream-svelte",
3
3
  "type": "module",
4
- "version": "2.0.2",
4
+ "version": "2.0.4",
5
5
  "description": "Svelte 5 and SvelteKit streaming Markdown renderer for AI chat, LLM token streams, SSE/WebSocket output, incomplete Markdown, Mermaid, KaTeX, stream-diffs powered code blocks, and custom Svelte components.",
6
6
  "author": "Simon He",
7
7
  "license": "MIT",
@@ -100,8 +100,8 @@
100
100
  },
101
101
  "dependencies": {
102
102
  "@floating-ui/dom": "^1.8.0",
103
- "markstream-core": "2.0.2",
104
- "stream-markdown-parser": "1.2.10"
103
+ "markstream-core": "2.0.4",
104
+ "stream-markdown-parser": "1.2.11"
105
105
  },
106
106
  "devDependencies": {
107
107
  "@sveltejs/package": "^2.5.8",