@aphexcms/cms-core 9.2.0 → 9.2.1

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.
Files changed (92) hide show
  1. package/dist/cli/generate-types.d.ts.map +1 -1
  2. package/dist/cli/generate-types.js +8 -3
  3. package/dist/cli/generate-types.js.map +1 -1
  4. package/dist/client/index.d.ts +1 -0
  5. package/dist/client/index.d.ts.map +1 -1
  6. package/dist/client/index.js +4 -0
  7. package/dist/components/AdminApp.svelte +27 -11
  8. package/dist/components/AdminApp.svelte.d.ts.map +1 -1
  9. package/dist/components/admin/DocumentEditor.svelte +548 -21
  10. package/dist/components/admin/DocumentEditor.svelte.d.ts +6 -0
  11. package/dist/components/admin/DocumentEditor.svelte.d.ts.map +1 -1
  12. package/dist/components/admin/SchemaField.svelte +1 -1
  13. package/dist/components/admin/fields/ArrayField.svelte +2 -2
  14. package/dist/components/admin/fields/ImageField.svelte +85 -27
  15. package/dist/components/admin/fields/ImageField.svelte.d.ts.map +1 -1
  16. package/dist/components/admin/fields/richtext/ImageBlockModal.svelte +133 -0
  17. package/dist/components/admin/fields/richtext/ImageBlockModal.svelte.d.ts +14 -0
  18. package/dist/components/admin/fields/richtext/ImageBlockModal.svelte.d.ts.map +1 -0
  19. package/dist/components/admin/fields/richtext/PortableTextImageView.svelte +2 -2
  20. package/dist/components/admin/fields/richtext/RichtextField.svelte +156 -11
  21. package/dist/components/admin/fields/richtext/RichtextField.svelte.d.ts.map +1 -1
  22. package/dist/components/admin/fields/richtext/svelte-node-view.d.ts.map +1 -1
  23. package/dist/components/admin/fields/richtext/svelte-node-view.js +11 -0
  24. package/dist/lib/client/index.d.ts +1 -0
  25. package/dist/lib/client/index.d.ts.map +1 -1
  26. package/dist/lib/client/index.js +4 -0
  27. package/dist/lib/client/index.js.map +1 -1
  28. package/dist/lib/components/admin/fields/richtext/svelte-node-view.d.ts.map +1 -1
  29. package/dist/lib/components/admin/fields/richtext/svelte-node-view.js +11 -0
  30. package/dist/lib/components/admin/fields/richtext/svelte-node-view.js.map +1 -1
  31. package/dist/lib/preview/assets.d.ts +19 -0
  32. package/dist/lib/preview/assets.d.ts.map +1 -0
  33. package/dist/lib/preview/assets.js +60 -0
  34. package/dist/lib/preview/assets.js.map +1 -0
  35. package/dist/lib/preview/perspective.d.ts +20 -0
  36. package/dist/lib/preview/perspective.d.ts.map +1 -0
  37. package/dist/lib/preview/perspective.js +21 -0
  38. package/dist/lib/preview/perspective.js.map +1 -0
  39. package/dist/lib/preview/stega.d.ts +25 -0
  40. package/dist/lib/preview/stega.d.ts.map +1 -0
  41. package/dist/lib/preview/stega.js +168 -0
  42. package/dist/lib/preview/stega.js.map +1 -0
  43. package/dist/lib/richtext-context.svelte.d.ts +18 -0
  44. package/dist/lib/richtext-context.svelte.d.ts.map +1 -0
  45. package/dist/lib/richtext-context.svelte.js +13 -0
  46. package/dist/lib/richtext-context.svelte.js.map +1 -0
  47. package/dist/lib/server/index.d.ts +1 -0
  48. package/dist/lib/server/index.d.ts.map +1 -1
  49. package/dist/lib/server/index.js +2 -0
  50. package/dist/lib/server/index.js.map +1 -1
  51. package/dist/lib/services/asset-service.d.ts +12 -0
  52. package/dist/lib/services/asset-service.d.ts.map +1 -1
  53. package/dist/lib/services/asset-service.js +32 -0
  54. package/dist/lib/services/asset-service.js.map +1 -1
  55. package/dist/lib/types/asset.d.ts +15 -0
  56. package/dist/lib/types/asset.d.ts.map +1 -1
  57. package/dist/lib/types/config.d.ts +7 -0
  58. package/dist/lib/types/config.d.ts.map +1 -1
  59. package/dist/lib/types/schemas.d.ts +17 -0
  60. package/dist/lib/types/schemas.d.ts.map +1 -1
  61. package/dist/lib/utils/preview.d.ts +4 -0
  62. package/dist/lib/utils/preview.d.ts.map +1 -1
  63. package/dist/lib/utils/preview.js +7 -0
  64. package/dist/lib/utils/preview.js.map +1 -1
  65. package/dist/preview/assets.d.ts +19 -0
  66. package/dist/preview/assets.d.ts.map +1 -0
  67. package/dist/preview/assets.js +59 -0
  68. package/dist/preview/perspective.d.ts +20 -0
  69. package/dist/preview/perspective.d.ts.map +1 -0
  70. package/dist/preview/perspective.js +20 -0
  71. package/dist/preview/stega.d.ts +25 -0
  72. package/dist/preview/stega.d.ts.map +1 -0
  73. package/dist/preview/stega.js +167 -0
  74. package/dist/richtext-context.svelte.d.ts +18 -0
  75. package/dist/richtext-context.svelte.d.ts.map +1 -0
  76. package/dist/richtext-context.svelte.js +12 -0
  77. package/dist/server/index.d.ts +1 -0
  78. package/dist/server/index.d.ts.map +1 -1
  79. package/dist/server/index.js +2 -0
  80. package/dist/services/asset-service.d.ts +12 -0
  81. package/dist/services/asset-service.d.ts.map +1 -1
  82. package/dist/services/asset-service.js +32 -0
  83. package/dist/types/asset.d.ts +15 -0
  84. package/dist/types/asset.d.ts.map +1 -1
  85. package/dist/types/config.d.ts +7 -0
  86. package/dist/types/config.d.ts.map +1 -1
  87. package/dist/types/schemas.d.ts +17 -0
  88. package/dist/types/schemas.d.ts.map +1 -1
  89. package/dist/utils/preview.d.ts +4 -0
  90. package/dist/utils/preview.d.ts.map +1 -1
  91. package/dist/utils/preview.js +7 -0
  92. package/package.json +3 -2
@@ -211,21 +211,25 @@
211
211
  assetData?.originalFilename || assetData?.filename || value?.asset?._ref || 'Image'
212
212
  );
213
213
 
214
- // Alt text stored on the asset record, not on the ImageValue
215
- let altText = $state('');
216
- let altSaveTimer: ReturnType<typeof setTimeout> | null = null;
217
-
218
- // Sync altText from asset data when it loads
214
+ // Two layers of alt text:
215
+ // • Default stored on the ASSET, shared across every placement. Set it once and
216
+ // it applies everywhere the image is used.
217
+ // • Override — stored on THIS image value, for when one spot needs a different
218
+ // description. Render precedence is `value.alt || asset.alt`.
219
+ // The override is also what carries visual-editing stega.
220
+ let assetAltText = $state('');
221
+ let assetAltTimer: ReturnType<typeof setTimeout> | null = null;
222
+
223
+ // Sync the default from the loaded asset record.
219
224
  $effect(() => {
220
- altText = assetData?.alt || '';
225
+ assetAltText = assetData?.alt || '';
221
226
  });
222
227
 
223
- function updateAltText(newAlt: string) {
224
- altText = newAlt;
225
-
226
- // Debounce the API call
227
- if (altSaveTimer) clearTimeout(altSaveTimer);
228
- altSaveTimer = setTimeout(async () => {
228
+ function updateAssetAlt(newAlt: string) {
229
+ assetAltText = newAlt;
230
+ // Debounce the asset-update API call.
231
+ if (assetAltTimer) clearTimeout(assetAltTimer);
232
+ assetAltTimer = setTimeout(async () => {
229
233
  const assetId = value?.asset?._ref;
230
234
  if (!assetId) return;
231
235
  try {
@@ -236,6 +240,17 @@
236
240
  }, 800);
237
241
  }
238
242
 
243
+ function updateOverrideAlt(newAlt: string) {
244
+ if (!value) return;
245
+ onUpdate({ ...value, alt: newAlt || undefined });
246
+ }
247
+
248
+ // Whether to reveal the per-placement override input.
249
+ let showOverride = $state(false);
250
+ $effect(() => {
251
+ if (value?.alt) showOverride = true;
252
+ });
253
+
239
254
  // Download image
240
255
  function downloadImage() {
241
256
  if (previewUrl) {
@@ -272,7 +287,7 @@
272
287
  {:else if previewUrl}
273
288
  <img
274
289
  src={previewUrl}
275
- alt={assetData?.alt || displayName}
290
+ alt={value?.alt || assetData?.alt || displayName}
276
291
  class="h-full w-full object-cover"
277
292
  loading="lazy"
278
293
  />
@@ -299,7 +314,7 @@
299
314
  {:else if previewUrl}
300
315
  <img
301
316
  src={previewUrl}
302
- alt={assetData?.alt || displayName}
317
+ alt={value?.alt || assetData?.alt || displayName}
303
318
  class="h-full w-full object-cover"
304
319
  loading="lazy"
305
320
  />
@@ -389,7 +404,7 @@
389
404
  {:else if previewUrl}
390
405
  <img
391
406
  src={previewUrl}
392
- alt={assetData?.alt || 'Uploaded image'}
407
+ alt={value?.alt || assetData?.alt || 'Uploaded image'}
393
408
  class="h-full w-full object-contain"
394
409
  loading="lazy"
395
410
  />
@@ -453,18 +468,61 @@
453
468
  {/if}
454
469
  </div>
455
470
 
456
- <!-- Alt text field -->
457
- <div class="border-border space-y-1.5 border-t p-3">
458
- <label class="text-sm font-medium" for="alt-{field.name}">Alt text</label>
459
- <p class="text-muted-foreground text-xs">Describe the image for accessibility and SEO</p>
460
- <Input
461
- id="alt-{field.name}"
462
- type="text"
463
- placeholder="Describe this image..."
464
- value={altText}
465
- oninput={(e) => updateAltText(e.currentTarget.value)}
466
- disabled={isReadOnly}
467
- />
471
+ <!-- Alt text asset-level default + optional per-placement override -->
472
+ <div class="border-border space-y-2 border-t p-3">
473
+ <div class="space-y-1.5">
474
+ <label class="text-sm font-medium" for="alt-{field.name}">Alt text</label>
475
+ <p class="text-muted-foreground text-xs">
476
+ Describes the image everywhere it's used (accessibility &amp; SEO).
477
+ </p>
478
+ <Input
479
+ id="alt-{field.name}"
480
+ type="text"
481
+ placeholder="Describe this image..."
482
+ value={assetAltText}
483
+ oninput={(e) => updateAssetAlt(e.currentTarget.value)}
484
+ disabled={isReadOnly}
485
+ />
486
+ </div>
487
+
488
+ {#if showOverride}
489
+ <div class="space-y-1.5">
490
+ <div class="flex items-center justify-between">
491
+ <label
492
+ class="text-muted-foreground text-xs font-medium"
493
+ for="alt-override-{field.name}">Override for this placement</label
494
+ >
495
+ {#if !isReadOnly}
496
+ <button
497
+ type="button"
498
+ class="text-muted-foreground hover:text-foreground text-xs underline-offset-2 hover:underline"
499
+ onclick={() => {
500
+ updateOverrideAlt('');
501
+ showOverride = false;
502
+ }}
503
+ >
504
+ Remove
505
+ </button>
506
+ {/if}
507
+ </div>
508
+ <Input
509
+ id="alt-override-{field.name}"
510
+ type="text"
511
+ placeholder={assetAltText || 'Describe this image...'}
512
+ value={value?.alt ?? ''}
513
+ oninput={(e) => updateOverrideAlt(e.currentTarget.value)}
514
+ disabled={isReadOnly}
515
+ />
516
+ </div>
517
+ {:else if !isReadOnly}
518
+ <button
519
+ type="button"
520
+ class="text-muted-foreground hover:text-foreground text-xs underline-offset-2 hover:underline"
521
+ onclick={() => (showOverride = true)}
522
+ >
523
+ + Override for this placement
524
+ </button>
525
+ {/if}
468
526
  </div>
469
527
  </div>
470
528
  {:else}
@@ -1 +1 @@
1
- {"version":3,"file":"ImageField.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/admin/fields/ImageField.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAmB1E,UAAU,KAAK;IACd,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AA4cF,QAAA,MAAM,UAAU,2CAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"ImageField.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/admin/fields/ImageField.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAmB1E,UAAU,KAAK;IACd,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AAofF,QAAA,MAAM,UAAU,2CAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
@@ -0,0 +1,133 @@
1
+ <script lang="ts">
2
+ import { Button } from '@aphexcms/ui/shadcn/button';
3
+ import { Input } from '@aphexcms/ui/shadcn/input';
4
+ import { Image as ImageIcon, Upload, Trash2, X } from '@lucide/svelte';
5
+ import { assets } from '../../../../api/assets';
6
+
7
+ interface Props {
8
+ open: boolean;
9
+ assetRef?: string;
10
+ alt: string;
11
+ readonly?: boolean;
12
+ onAltChange: (alt: string) => void;
13
+ onReplace: () => void;
14
+ onRemove: () => void;
15
+ onClose: () => void;
16
+ }
17
+
18
+ let {
19
+ open,
20
+ assetRef,
21
+ alt,
22
+ readonly = false,
23
+ onAltChange,
24
+ onReplace,
25
+ onRemove,
26
+ onClose
27
+ }: Props = $props();
28
+
29
+ const assetPromise = $derived(assetRef ? assets.getById(assetRef) : null);
30
+
31
+ function handleBackdropClick(e: MouseEvent) {
32
+ if (e.target === e.currentTarget) onClose();
33
+ }
34
+
35
+ function handleKeydown(e: KeyboardEvent) {
36
+ if (e.key === 'Escape') onClose();
37
+ }
38
+ </script>
39
+
40
+ {#if open}
41
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
42
+ <div
43
+ class="bg-background/80 absolute inset-0 z-50 flex items-center justify-center p-4 lg:p-6"
44
+ onclick={handleBackdropClick}
45
+ onkeydown={handleKeydown}
46
+ role="button"
47
+ tabindex="-1"
48
+ >
49
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
50
+ <div
51
+ class="border-border bg-background w-full max-w-lg overflow-hidden rounded-lg border shadow-lg"
52
+ onclick={(e) => e.stopPropagation()}
53
+ onkeydown={(e) => e.stopPropagation()}
54
+ >
55
+ <div class="border-border flex items-center justify-between border-b px-4 py-2">
56
+ <span class="text-sm font-medium">Edit image</span>
57
+ <Button variant="ghost" size="icon" class="h-7 w-7" onclick={onClose}>
58
+ <X class="h-3.5 w-3.5" />
59
+ </Button>
60
+ </div>
61
+
62
+ <div class="space-y-3 p-4">
63
+ <!-- Preview -->
64
+ <div
65
+ class="bg-muted flex items-center justify-center overflow-hidden rounded-md"
66
+ style="aspect-ratio: 16 / 9;"
67
+ >
68
+ {#if assetPromise}
69
+ {#await assetPromise}
70
+ <div
71
+ class="border-primary h-5 w-5 animate-spin rounded-full border-2 border-t-transparent"
72
+ ></div>
73
+ {:then result}
74
+ {#if result.success && result.data?.url}
75
+ <img src={result.data.url} {alt} class="h-full w-full object-contain" />
76
+ {:else}
77
+ <div class="text-muted-foreground flex flex-col items-center gap-1">
78
+ <ImageIcon class="h-8 w-8" />
79
+ <span class="text-xs">Image not found</span>
80
+ </div>
81
+ {/if}
82
+ {:catch}
83
+ <div class="text-muted-foreground flex flex-col items-center gap-1">
84
+ <ImageIcon class="h-8 w-8" />
85
+ <span class="text-xs">Failed to load</span>
86
+ </div>
87
+ {/await}
88
+ {:else}
89
+ <div class="text-muted-foreground flex flex-col items-center gap-1">
90
+ <ImageIcon class="h-8 w-8" />
91
+ <span class="text-xs">No image</span>
92
+ </div>
93
+ {/if}
94
+ </div>
95
+
96
+ <!-- Alt text (per-placement override of the asset's default alt) -->
97
+ <div class="space-y-1.5">
98
+ <label class="text-sm font-medium" for="image-block-alt">Alt text</label>
99
+ <p class="text-muted-foreground text-xs">
100
+ Overrides the image's default alt for this spot. Leave blank to use the default.
101
+ </p>
102
+ <Input
103
+ id="image-block-alt"
104
+ type="text"
105
+ placeholder="Describe this image..."
106
+ value={alt}
107
+ oninput={(e) => onAltChange(e.currentTarget.value)}
108
+ disabled={readonly}
109
+ />
110
+ </div>
111
+
112
+ <!-- Actions -->
113
+ {#if !readonly}
114
+ <div class="flex items-center justify-between gap-2 pt-1">
115
+ <Button variant="outline" size="sm" onclick={onReplace}>
116
+ <Upload class="mr-1.5 h-4 w-4" />
117
+ Replace
118
+ </Button>
119
+ <Button
120
+ variant="ghost"
121
+ size="sm"
122
+ class="text-destructive hover:text-destructive"
123
+ onclick={onRemove}
124
+ >
125
+ <Trash2 class="mr-1.5 h-4 w-4" />
126
+ Remove
127
+ </Button>
128
+ </div>
129
+ {/if}
130
+ </div>
131
+ </div>
132
+ </div>
133
+ {/if}
@@ -0,0 +1,14 @@
1
+ interface Props {
2
+ open: boolean;
3
+ assetRef?: string;
4
+ alt: string;
5
+ readonly?: boolean;
6
+ onAltChange: (alt: string) => void;
7
+ onReplace: () => void;
8
+ onRemove: () => void;
9
+ onClose: () => void;
10
+ }
11
+ declare const ImageBlockModal: import("svelte").Component<Props, {}, "">;
12
+ type ImageBlockModal = ReturnType<typeof ImageBlockModal>;
13
+ export default ImageBlockModal;
14
+ //# sourceMappingURL=ImageBlockModal.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageBlockModal.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/admin/fields/richtext/ImageBlockModal.svelte.ts"],"names":[],"mappings":"AASC,UAAU,KAAK;IACd,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB;AAoGF,QAAA,MAAM,eAAe,2CAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
@@ -19,7 +19,7 @@
19
19
 
20
20
  <!-- svelte-ignore a11y_click_events_have_key_events -->
21
21
  <!-- svelte-ignore a11y_no_static_element_interactions -->
22
- <div class="image-block-view group" class:selected onclick={onEdit}>
22
+ <div class="image-block-view group" class:selected data-pt-image-edit onclick={onEdit}>
23
23
  {#if assetPromise}
24
24
  {#await assetPromise}
25
25
  <div class="image-block-placeholder">
@@ -29,7 +29,7 @@
29
29
  </div>
30
30
  {:then result}
31
31
  {#if result.success && result.data?.url}
32
- <img src={result.data.url} alt={result.data.alt || ''} class="image-block-img" />
32
+ <img src={result.data.url} alt={(data?.alt as string) || ''} class="image-block-img" />
33
33
  {:else}
34
34
  <div class="image-block-placeholder">
35
35
  <ImageIcon class="text-muted-foreground h-8 w-8" />
@@ -35,7 +35,9 @@
35
35
  import type { ArrayField as ArrayFieldType, SchemaType } from '../../../../types/schemas';
36
36
  import { getSchemaContext } from '../../../../schema-context.svelte';
37
37
  import { getSchemaByName } from '../../../../schema-utils/utils';
38
+ import { getRichtextEditorRegistry } from '../../../../richtext-context.svelte.js';
38
39
  import ObjectModal from '../../ObjectModal.svelte';
40
+ import ImageBlockModal from './ImageBlockModal.svelte';
39
41
  import AssetBrowserModal from '../../AssetBrowserModal.svelte';
40
42
  import * as Tooltip from '@aphexcms/ui/shadcn/tooltip';
41
43
  import { Image as ImageIcon } from '@lucide/svelte';
@@ -190,8 +192,9 @@
190
192
 
191
193
  function handleEditBlock(attrs: { _type: string; _key: string; data: Record<string, unknown> }) {
192
194
  if (attrs._type === 'image') {
193
- editingNodeKey = attrs._key;
194
- showAssetBrowser = true;
195
+ editingImageKey = attrs._key;
196
+ editingImageData = { ...attrs.data };
197
+ imageModalOpen = true;
195
198
  return;
196
199
  }
197
200
  const typeDef = customTypes.find((t) => t.type === attrs._type);
@@ -278,6 +281,50 @@
278
281
 
279
282
  let showAssetBrowser = $state(false);
280
283
 
284
+ // Inline image block editing — preview + alt + replace/remove. `editingImageData`
285
+ // holds the block's data ({ asset, alt }); alt is persisted into the node so it
286
+ // serializes to the portable-text block and carries visual-editing stega.
287
+ let imageModalOpen = $state(false);
288
+ let editingImageKey = $state<string | null>(null);
289
+ let editingImageData = $state<Record<string, any>>({});
290
+
291
+ function applyImageData(key: string, data: Record<string, any>) {
292
+ if (!editor) return;
293
+ const existing = findNodeByKey(key);
294
+ if (!existing) return;
295
+ const { tr } = editor.state;
296
+ tr.setNodeMarkup(existing.pos, undefined, { _type: 'image', _key: key, data });
297
+ editor.view.dispatch(tr);
298
+ }
299
+
300
+ function handleImageAltChange(alt: string) {
301
+ if (!editingImageKey) return;
302
+ editingImageData = { ...editingImageData, alt: alt || undefined };
303
+ applyImageData(editingImageKey, editingImageData);
304
+ }
305
+
306
+ function handleImageReplace() {
307
+ // Hand off to the asset browser, keeping editingImageKey so the alt is preserved
308
+ // and the modal can re-open with the new asset.
309
+ editingNodeKey = editingImageKey;
310
+ imageModalOpen = false;
311
+ showAssetBrowser = true;
312
+ }
313
+
314
+ function handleImageRemove() {
315
+ const key = editingImageKey;
316
+ imageModalOpen = false;
317
+ editingImageKey = null;
318
+ editingImageData = {};
319
+ if (key) handleDeleteBlock(key);
320
+ }
321
+
322
+ function handleImageModalClose() {
323
+ imageModalOpen = false;
324
+ editingImageKey = null;
325
+ editingImageData = {};
326
+ }
327
+
281
328
  function handleInsertImageBlock() {
282
329
  editingNodeKey = null;
283
330
  insertMenuOpen = false;
@@ -287,13 +334,17 @@
287
334
  function handleAssetSelected(asset: any) {
288
335
  if (!editor || !asset) return;
289
336
 
337
+ const newAssetRef = { _type: 'reference', _ref: asset.id };
290
338
  const existing = editingNodeKey ? findNodeByKey(editingNodeKey) : null;
291
339
  if (existing) {
340
+ // Replace — merge into existing data so the block's alt survives the swap.
341
+ const prevData = (existing.node.attrs?.data as Record<string, any>) ?? {};
342
+ const merged = { ...prevData, asset: newAssetRef };
292
343
  const { tr } = editor.state;
293
344
  tr.setNodeMarkup(existing.pos, undefined, {
294
345
  _type: 'image',
295
346
  _key: editingNodeKey,
296
- data: { asset: { _type: 'reference', _ref: asset.id } }
347
+ data: merged
297
348
  });
298
349
  editor.view.dispatch(tr);
299
350
  } else {
@@ -305,7 +356,7 @@
305
356
  attrs: {
306
357
  _type: 'image',
307
358
  _key: genKey(),
308
- data: { asset: { _type: 'reference', _ref: asset.id } }
359
+ data: { asset: newAssetRef }
309
360
  }
310
361
  })
311
362
  .run();
@@ -313,6 +364,14 @@
313
364
 
314
365
  showAssetBrowser = false;
315
366
  editingNodeKey = null;
367
+
368
+ // If the browser was opened from the image modal (a replace), re-open it on the
369
+ // updated block so the user can keep editing the alt.
370
+ if (editingImageKey) {
371
+ const updated = findNodeByKey(editingImageKey);
372
+ editingImageData = (updated?.node.attrs?.data as Record<string, any>) ?? {};
373
+ imageModalOpen = true;
374
+ }
316
375
  }
317
376
 
318
377
  function handleModalUpdate(updatedData: Record<string, any>) {
@@ -497,14 +556,18 @@
497
556
  annotationModalOpen = true;
498
557
  }
499
558
 
559
+ const editorRegistry = getRichtextEditorRegistry();
560
+
500
561
  onMount(() => {
501
562
  createEditor();
563
+ if (editor) editorRegistry?.set(field.name, { editor, openLinkPopover: showLinkPreview });
502
564
  document.addEventListener('click', handleClickOutside);
503
565
  document.addEventListener('keydown', handleKeydown);
504
566
  element?.addEventListener('click', handleAnnotationClick);
505
567
  });
506
568
 
507
569
  onDestroy(() => {
570
+ editorRegistry?.delete(field.name);
508
571
  editor?.destroy();
509
572
  document.removeEventListener('click', handleClickOutside);
510
573
  document.removeEventListener('keydown', handleKeydown);
@@ -536,6 +599,33 @@
536
599
  // own change back" vs "parent loaded a different document."
537
600
  let lastSyncedVersion = 0;
538
601
  let editorJustCreated = false;
602
+
603
+ // Link marks round-trip lossy: only `href` is persisted to Portable Text, so a
604
+ // rehydrated link drops tiptap's presentation attrs (e.g. `class: 'richtext-link'`
605
+ // → null). Strip those volatile attrs before the equality check below, otherwise an
606
+ // identical round-trip looks "changed", replaces the doc, and collapses the caret to
607
+ // the end — yanking it out of a link the user just clicked in presentation mode.
608
+ function stripVolatileMarks(node: unknown): unknown {
609
+ if (Array.isArray(node)) return node.map(stripVolatileMarks);
610
+ if (node && typeof node === 'object') {
611
+ const obj = node as Record<string, unknown>;
612
+ const out: Record<string, unknown> = {};
613
+ for (const key in obj) {
614
+ if (key === 'marks' && Array.isArray(obj.marks)) {
615
+ out.marks = (obj.marks as Array<Record<string, unknown>>).map((m) =>
616
+ m?.type === 'link'
617
+ ? { type: 'link', attrs: { href: (m.attrs as { href?: unknown })?.href ?? '' } }
618
+ : m
619
+ );
620
+ } else {
621
+ out[key] = stripVolatileMarks(obj[key]);
622
+ }
623
+ }
624
+ return out;
625
+ }
626
+ return node;
627
+ }
628
+
539
629
  $effect(() => {
540
630
  const v = value;
541
631
  if (!editor) return;
@@ -547,8 +637,18 @@
547
637
  lastSyncedVersion = internalVersion;
548
638
  return;
549
639
  }
550
- // Replace content without polluting undo history
640
+ // Skip when the incoming value would produce identical content. The parent
641
+ // can hand us a fresh array reference with the same data (e.g. the live-
642
+ // preview round-trip in presentation mode reassigns documentData); replacing
643
+ // the doc in that case needlessly collapses the selection to the end — which
644
+ // reads as "the cursor jumps to the bottom" mid-edit.
551
645
  const tiptapDoc = portableTextToTiptap(v || []);
646
+ if (
647
+ JSON.stringify(stripVolatileMarks(tiptapDoc)) ===
648
+ JSON.stringify(stripVolatileMarks(editor.getJSON()))
649
+ )
650
+ return;
651
+ // Replace content without polluting undo history
552
652
  const newDoc = editor.state.schema.nodeFromJSON(tiptapDoc);
553
653
  const tr = editor.state.tr.replaceWith(0, editor.state.doc.content.size, newDoc.content);
554
654
  tr.setMeta('addToHistory', false);
@@ -589,15 +689,45 @@
589
689
  let linkPopoverPos = $state({ top: 0, left: 0 });
590
690
  let linkPreviewHref = $state('');
591
691
 
692
+ // Render the link popover at <body> level. The editor can sit inside an ancestor with a
693
+ // `transform` (e.g. the sliding responsive document panel), which would make the popover's
694
+ // `position: fixed` resolve against that ancestor instead of the viewport — placing it
695
+ // off-screen. Portaling escapes any such containing block / overflow clip.
696
+ function portal(node: HTMLElement) {
697
+ document.body.appendChild(node);
698
+ return {
699
+ destroy() {
700
+ node.remove();
701
+ }
702
+ };
703
+ }
704
+
592
705
  function positionLinkPopover() {
593
- if (!editor || !element) return;
706
+ if (!editor) return;
594
707
  const { from, to } = editor.state.selection;
595
708
  const start = editor.view.coordsAtPos(from);
596
709
  const end = editor.view.coordsAtPos(to);
597
- const editorRect = element.getBoundingClientRect();
710
+
711
+ // The popover is `position: fixed`, so it works in viewport coordinates — `coordsAtPos`
712
+ // already returns those. This sidesteps the editor's scroll/overflow container (e.g. the
713
+ // split form panel in visual-editing mode), which would otherwise clip or shift an
714
+ // absolutely-positioned child.
715
+ const POPOVER_H = 44;
716
+ const POPOVER_W = 320; // approx; only used to keep the popover off the right edge
717
+ const GAP = 4;
718
+ const MARGIN = 8;
719
+
720
+ // Below the selection by default; flip above when it would spill past the viewport bottom.
721
+ const roomBelow = end.bottom + GAP + POPOVER_H <= window.innerHeight - MARGIN;
722
+ const roomAbove = start.top - GAP - POPOVER_H >= MARGIN;
723
+ const placeBelow = roomBelow || !roomAbove;
724
+
598
725
  linkPopoverPos = {
599
- top: end.bottom - editorRect.top + 4,
600
- left: Math.max(0, Math.min(start.left, end.left) - editorRect.left)
726
+ top: placeBelow ? end.bottom + GAP : start.top - GAP - POPOVER_H,
727
+ left: Math.min(
728
+ Math.max(MARGIN, Math.min(start.left, end.left)),
729
+ window.innerWidth - POPOVER_W - MARGIN
730
+ )
601
731
  };
602
732
  }
603
733
 
@@ -1018,7 +1148,8 @@
1018
1148
 
1019
1149
  {#if linkMode === 'preview'}
1020
1150
  <div
1021
- class="border-rule bg-popover absolute z-40 flex items-center gap-1.5 rounded-md border px-2 py-1.5 shadow-lg"
1151
+ use:portal
1152
+ class="border-rule bg-popover fixed z-[60] flex items-center gap-1.5 rounded-md border px-2 py-1.5 shadow-lg"
1022
1153
  style="top: {linkPopoverPos.top}px; left: {linkPopoverPos.left}px;"
1023
1154
  >
1024
1155
  <a
@@ -1060,7 +1191,8 @@
1060
1191
  </div>
1061
1192
  {:else if linkMode === 'edit'}
1062
1193
  <div
1063
- class="border-rule bg-popover absolute z-40 flex items-center gap-2 rounded-md border px-3 py-2 shadow-lg"
1194
+ use:portal
1195
+ class="border-rule bg-popover fixed z-[60] flex items-center gap-2 rounded-md border px-3 py-2 shadow-lg"
1064
1196
  style="top: {linkPopoverPos.top}px; left: {linkPopoverPos.left}px;"
1065
1197
  >
1066
1198
  <LinkIcon class="text-muted-foreground h-4 w-4 shrink-0" />
@@ -1139,6 +1271,19 @@
1139
1271
  onSelect={handleAssetSelected}
1140
1272
  />
1141
1273
 
1274
+ {#if imageModalOpen}
1275
+ <ImageBlockModal
1276
+ open={imageModalOpen}
1277
+ assetRef={editingImageData?.asset?._ref}
1278
+ alt={(editingImageData?.alt as string) ?? ''}
1279
+ {readonly}
1280
+ onAltChange={handleImageAltChange}
1281
+ onReplace={handleImageReplace}
1282
+ onRemove={handleImageRemove}
1283
+ onClose={handleImageModalClose}
1284
+ />
1285
+ {/if}
1286
+
1142
1287
  <style>
1143
1288
  .richtext-editor {
1144
1289
  position: relative;
@@ -1 +1 @@
1
- {"version":3,"file":"RichtextField.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/admin/fields/richtext/RichtextField.svelte.ts"],"names":[],"mappings":"AA4BA,OAAO,EAGL,KAAK,iBAAiB,EACtB,MAAM,4BAA4B,CAAC;AAIrC,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAc,MAAM,2BAA2B,CAAC;AASzF,UAAU,KAAK;IACd,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5C,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AAm+BF,QAAA,MAAM,aAAa,2CAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"RichtextField.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/admin/fields/richtext/RichtextField.svelte.ts"],"names":[],"mappings":"AA4BA,OAAO,EAGL,KAAK,iBAAiB,EACtB,MAAM,4BAA4B,CAAC;AAIrC,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAc,MAAM,2BAA2B,CAAC;AAWzF,UAAU,KAAK;IACd,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5C,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AAymCF,QAAA,MAAM,aAAa,2CAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"svelte-node-view.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/admin/fields/richtext/svelte-node-view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,IAAI,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAKvE,wBAAgB,sBAAsB,CACrC,MAAM,EAAE,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,KAAK,IAAI,EACvF,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,IAEvB,OAAO,qBAAqB,KAAG,mBAAmB,CA8D1D"}
1
+ {"version":3,"file":"svelte-node-view.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/admin/fields/richtext/svelte-node-view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,IAAI,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAKvE,wBAAgB,sBAAsB,CACrC,MAAM,EAAE,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,KAAK,IAAI,EACvF,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,IAEvB,OAAO,qBAAqB,KAAG,mBAAmB,CAyE1D"}
@@ -38,7 +38,18 @@ export function SvelteNodeViewRenderer(onEdit, onDelete) {
38
38
  update(node) {
39
39
  if (node.type.name !== 'portableTextObject')
40
40
  return false;
41
+ const prevType = nodeAttrs._type;
42
+ const prevRef = nodeAttrs.data?.asset?._ref;
41
43
  nodeAttrs = node.attrs;
44
+ const nextType = nodeAttrs._type;
45
+ const nextRef = nodeAttrs.data?.asset?._ref;
46
+ // Image views re-fetch their asset on mount, so a blind remount makes the
47
+ // thumbnail flash (or briefly disappear) on every keystroke/selection. Skip
48
+ // the remount when the image is visually unchanged — alt edits don't touch the
49
+ // thumbnail. Other block types still remount so their content stays in sync.
50
+ if (prevType === 'image' && nextType === 'image' && prevRef === nextRef) {
51
+ return true;
52
+ }
42
53
  unmount(currentComponent);
43
54
  currentComponent = mountView();
44
55
  return true;
@@ -26,4 +26,5 @@ export type { ApiResponse } from '../api/index.js';
26
26
  export { toast } from 'svelte-sonner';
27
27
  export { confirmDialog, type ConfirmDialogOptions } from '../components/admin/confirm-dialog/confirm-dialog.svelte.js';
28
28
  export { default as ConfirmDialogHost } from '../components/admin/confirm-dialog/ConfirmDialogHost.svelte';
29
+ export { stegaClean } from '../preview/stega.js';
29
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/client/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGlG,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAG1C,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAGjF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG9E,OAAO,EACN,qBAAqB,EACrB,cAAc,EACd,KAAK,kBAAkB,EACvB,MAAM,+BAA+B,CAAC;AAGvC,cAAc,uBAAuB,CAAC;AAGtC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAGzE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAG1F,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gDAAgD,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAG7F,cAAc,gBAAgB,CAAC;AAE/B,cAAc,cAAc,CAAC;AAC7B,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,OAAO,EACN,aAAa,EACb,KAAK,oBAAoB,EACzB,MAAM,0DAA0D,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,6DAA6D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/client/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGlG,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAG1C,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAGjF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG9E,OAAO,EACN,qBAAqB,EACrB,cAAc,EACd,KAAK,kBAAkB,EACvB,MAAM,+BAA+B,CAAC;AAGvC,cAAc,uBAAuB,CAAC;AAGtC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAGzE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAG1F,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gDAAgD,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAG7F,cAAc,gBAAgB,CAAC;AAE/B,cAAc,cAAc,CAAC;AAC7B,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,OAAO,EACN,aAAa,EACb,KAAK,oBAAoB,EACzB,MAAM,0DAA0D,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,6DAA6D,CAAC;AAK3G,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
@@ -38,4 +38,8 @@ export { toast } from 'svelte-sonner';
38
38
  // Confirm dialog (imperative API backed by a mounted host)
39
39
  export { confirmDialog } from '../components/admin/confirm-dialog/confirm-dialog.svelte.js';
40
40
  export { default as ConfirmDialogHost } from '../components/admin/confirm-dialog/ConfirmDialogHost.svelte';
41
+ // Live preview — the runtime overlay + document context live in @aphexcms/visual-editing
42
+ // (AphexVisualOverlay, getLivePreviewDocument). cms-core only owns the stega encoder used
43
+ // by the editor and the stegaClean helper re-exported here for convenience.
44
+ export { stegaClean } from '../preview/stega.js';
41
45
  //# sourceMappingURL=index.js.map