@voila.dev/ui-email-block-editor 1.1.9 → 1.1.10
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/package.json +1 -1
- package/src/blocks/article-block.tsx +15 -15
- package/src/blocks/block-definitions.tsx +1 -1
- package/src/blocks/button-block.tsx +10 -10
- package/src/blocks/divider-block.tsx +1 -1
- package/src/blocks/grid-block.tsx +6 -6
- package/src/blocks/heading-block.tsx +7 -7
- package/src/blocks/image-block.tsx +18 -18
- package/src/blocks/list-block.tsx +14 -15
- package/src/blocks/offer-block.tsx +26 -26
- package/src/blocks/paragraph-block.tsx +4 -4
- package/src/blocks/product-block.tsx +19 -19
- package/src/blocks/rating-block.tsx +14 -14
- package/src/blocks/stat-block.tsx +10 -10
- package/src/blocks/table-block.tsx +15 -15
- package/src/document/types.ts +2 -2
- package/src/email-block-editor.tsx +3 -3
- package/src/lib/use-media-query.ts +1 -1
- package/src/sections/add-block-menu.tsx +2 -2
- package/src/sections/block-options/alignment-option.tsx +5 -5
- package/src/sections/block-options/block-option-row.tsx +3 -3
- package/src/sections/block-options/money-option.tsx +1 -1
- package/src/sections/block-options/text-option.tsx +2 -2
- package/src/sections/block-toolbar.tsx +12 -12
- package/src/sections/editor-canvas.tsx +3 -3
- package/src/sections/editor-sidebar.tsx +3 -3
- package/src/sections/link-popover.tsx +5 -5
- package/src/sections/preview-toggle.tsx +2 -2
- package/src/theme.ts +3 -3
|
@@ -22,7 +22,7 @@ function SelectedBlockSettings({
|
|
|
22
22
|
if (definition.Settings === null) {
|
|
23
23
|
return (
|
|
24
24
|
<p className="text-muted-foreground text-sm">
|
|
25
|
-
|
|
25
|
+
This block has no settings.
|
|
26
26
|
</p>
|
|
27
27
|
);
|
|
28
28
|
}
|
|
@@ -58,7 +58,7 @@ export function BlockSettingsPanel({
|
|
|
58
58
|
if (selectedBlock === null) {
|
|
59
59
|
return (
|
|
60
60
|
<p className="text-muted-foreground text-sm">
|
|
61
|
-
|
|
61
|
+
Select a block to edit its settings.
|
|
62
62
|
</p>
|
|
63
63
|
);
|
|
64
64
|
}
|
|
@@ -84,7 +84,7 @@ export function EditorSidebar({
|
|
|
84
84
|
}) {
|
|
85
85
|
return (
|
|
86
86
|
<div className="flex flex-col gap-4 rounded-lg border bg-background p-4">
|
|
87
|
-
<h3 className="font-medium text-sm">
|
|
87
|
+
<h3 className="font-medium text-sm">Block settings</h3>
|
|
88
88
|
<BlockSettingsPanel
|
|
89
89
|
state={state}
|
|
90
90
|
dispatch={dispatch}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import { type ReactElement, useState } from "react";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* The shared
|
|
11
|
+
* The shared link editing surface: a small popover with a URL field,
|
|
12
12
|
* apply, and an optional remove action. The paragraph toolbar drives it with
|
|
13
13
|
* text-selection callbacks; the button block edits its target through it.
|
|
14
14
|
*/
|
|
@@ -25,7 +25,7 @@ export function LinkPopover({
|
|
|
25
25
|
/** Runs as the popover opens (the toolbar saves the text selection here). */
|
|
26
26
|
onOpen?: () => void;
|
|
27
27
|
onApply: (href: string) => void;
|
|
28
|
-
/**
|
|
28
|
+
/** "Remove link" — omitted when removing makes no sense (a button). */
|
|
29
29
|
onRemove?: () => void;
|
|
30
30
|
}) {
|
|
31
31
|
const [open, setOpen] = useState(false);
|
|
@@ -57,7 +57,7 @@ export function LinkPopover({
|
|
|
57
57
|
}}
|
|
58
58
|
>
|
|
59
59
|
<Input
|
|
60
|
-
aria-label="
|
|
60
|
+
aria-label="Link URL"
|
|
61
61
|
type="url"
|
|
62
62
|
placeholder="https://"
|
|
63
63
|
value={href}
|
|
@@ -66,7 +66,7 @@ export function LinkPopover({
|
|
|
66
66
|
/>
|
|
67
67
|
<div className="flex items-center justify-between gap-2">
|
|
68
68
|
<Button type="submit" size="sm" disabled={href.trim() === ""}>
|
|
69
|
-
|
|
69
|
+
Apply
|
|
70
70
|
</Button>
|
|
71
71
|
{onRemove ? (
|
|
72
72
|
<Button
|
|
@@ -78,7 +78,7 @@ export function LinkPopover({
|
|
|
78
78
|
setOpen(false);
|
|
79
79
|
}}
|
|
80
80
|
>
|
|
81
|
-
|
|
81
|
+
Remove link
|
|
82
82
|
</Button>
|
|
83
83
|
) : null}
|
|
84
84
|
</div>
|
|
@@ -10,7 +10,7 @@ const PREVIEWS: ReadonlyArray<{
|
|
|
10
10
|
readonly label: string;
|
|
11
11
|
readonly Icon: typeof DesktopIcon;
|
|
12
12
|
}> = [
|
|
13
|
-
{ value: "desktop", label: "
|
|
13
|
+
{ value: "desktop", label: "Desktop", Icon: DesktopIcon },
|
|
14
14
|
{ value: "mobile", label: "Mobile", Icon: DeviceMobileIcon },
|
|
15
15
|
];
|
|
16
16
|
|
|
@@ -30,7 +30,7 @@ export function PreviewToggle({
|
|
|
30
30
|
return (
|
|
31
31
|
<SegmentedControl
|
|
32
32
|
size="sm"
|
|
33
|
-
aria-label="
|
|
33
|
+
aria-label="Preview"
|
|
34
34
|
value={value}
|
|
35
35
|
onValueChange={(next) => onChange(next as EmailEditorPreview)}
|
|
36
36
|
>
|
package/src/theme.ts
CHANGED
|
@@ -19,8 +19,8 @@ export const EMAIL_FONT =
|
|
|
19
19
|
/**
|
|
20
20
|
* The locale the canvas previews prices and dates in, mirroring
|
|
21
21
|
* `renderMarketingEmailDocument`'s default. Deliberately not the browser's
|
|
22
|
-
* locale: the canvas shows what the email will look like, and
|
|
23
|
-
*
|
|
22
|
+
* locale: the canvas shows what the email will look like, and an author on a
|
|
23
|
+
* differently-configured machine would otherwise see a price the recipient
|
|
24
24
|
* never gets. The sent email formats per recipient.
|
|
25
25
|
*/
|
|
26
|
-
export const EMAIL_PREVIEW_LOCALE = "
|
|
26
|
+
export const EMAIL_PREVIEW_LOCALE = "en-US";
|