@perkyzz/emvb 0.9.0 → 1.1.0
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/README.md +10 -1
- package/package.json +2 -2
- package/src/admin/agents-api.ts +45 -0
- package/src/admin/bulk-api.ts +67 -0
- package/src/admin/content-api.ts +10 -6
- package/src/admin/copy-rich-text.ts +119 -0
- package/src/admin/dialog-tab-wrap.ts +78 -0
- package/src/admin/editor/A11yCopilot.tsx +3 -1
- package/src/admin/editor/Editor.tsx +311 -250
- package/src/admin/editor/Timeline.tsx +8 -3
- package/src/admin/editor/TopBar.tsx +29 -7
- package/src/admin/editor/canvas/CanvasFrame.tsx +7 -2
- package/src/admin/editor/canvas/DeviceBar.tsx +31 -10
- package/src/admin/editor/canvas/canvas-scale.ts +3 -3
- package/src/admin/editor/canvas/use-canvas-session.ts +2 -2
- package/src/admin/editor/co-design.ts +190 -0
- package/src/admin/editor/dnd/new-element.ts +48 -4
- package/src/admin/editor/editor-chrome.tsx +8 -6
- package/src/admin/editor/editor-commands.ts +15 -4
- package/src/admin/editor/editor-css.ts +2 -1
- package/src/admin/editor/element-chrome.ts +3 -1
- package/src/admin/editor/extension-manifests.ts +20 -0
- package/src/admin/editor/extensions/ExtensionPanels.tsx +26 -0
- package/src/admin/editor/extensions-context.tsx +27 -0
- package/src/admin/editor/feature-css.ts +17 -0
- package/src/admin/editor/palette-items.ts +2 -2
- package/src/admin/editor/panels/AddPanel.tsx +31 -1
- package/src/admin/editor/panels/AgentRequestBox.tsx +116 -0
- package/src/admin/editor/panels/ClassesSection.tsx +9 -6
- package/src/admin/editor/panels/CoDesignPanel.tsx +170 -0
- package/src/admin/editor/panels/ColorControl.tsx +2 -2
- package/src/admin/editor/panels/ElementPanel.tsx +68 -20
- package/src/admin/editor/panels/LanguagesSection.tsx +152 -0
- package/src/admin/editor/panels/LayersPanel.tsx +10 -6
- package/src/admin/editor/panels/LeftPanel.tsx +33 -5
- package/src/admin/editor/panels/PageSettings.tsx +4 -0
- package/src/admin/editor/panels/SettingsPanel.tsx +21 -2
- package/src/admin/editor/panels/SiteStylesDrawer.tsx +7 -7
- package/src/admin/editor/panels/settings/BackgroundControls.tsx +72 -15
- package/src/admin/editor/panels/settings/BackgroundFill.tsx +8 -6
- package/src/admin/editor/panels/settings/BoxControl.tsx +5 -5
- package/src/admin/editor/panels/settings/EffectsControls.tsx +183 -10
- package/src/admin/editor/panels/settings/FieldControl.tsx +9 -3
- package/src/admin/editor/panels/settings/IconControls.tsx +25 -11
- package/src/admin/editor/panels/settings/LengthRow.tsx +63 -19
- package/src/admin/editor/panels/settings/LoopControl.tsx +269 -0
- package/src/admin/editor/panels/settings/LoopItemBindControl.tsx +19 -1
- package/src/admin/editor/panels/settings/MotionControl.tsx +12 -11
- package/src/admin/editor/panels/settings/QueryStyleRows.tsx +7 -4
- package/src/admin/editor/panels/settings/StyleRow.tsx +120 -13
- package/src/admin/editor/panels/settings/TextMarksControl.tsx +247 -0
- package/src/admin/editor/panels/settings/VariableBinding.tsx +2 -2
- package/src/admin/editor/panels/settings/background-mode.ts +14 -11
- package/src/admin/editor/panels/settings/box-link-name.ts +1 -1
- package/src/admin/editor/panels/settings/box-sides.ts +22 -14
- package/src/admin/editor/panels/settings/heading-warning.ts +5 -1
- package/src/admin/editor/panels/settings/length-units.ts +68 -4
- package/src/admin/editor/panels/settings/query-style.ts +3 -3
- package/src/admin/editor/panels/settings/style-sections.ts +52 -10
- package/src/admin/editor/panels/style-target.ts +22 -7
- package/src/admin/editor/presence.ts +60 -0
- package/src/admin/editor/section-templates.ts +26 -4
- package/src/admin/editor/store.ts +14 -4
- package/src/admin/editor/useCoDesign.ts +177 -0
- package/src/admin/editor/useEditorCommands.ts +7 -5
- package/src/admin/editor/useExtensions.ts +45 -0
- package/src/admin/editor/useNodeActions.ts +18 -7
- package/src/admin/editor/useProposals.ts +81 -0
- package/src/admin/export-api.ts +221 -0
- package/src/admin/index.tsx +6 -1
- package/src/admin/languages-api.ts +61 -0
- package/src/admin/pages/AgentSetup.tsx +148 -0
- package/src/admin/pages/AgentsPage.tsx +9 -26
- package/src/admin/pages/CreateDialog.tsx +15 -0
- package/src/admin/pages/ExportDialog.tsx +395 -0
- package/src/admin/pages/ImportButton.tsx +18 -0
- package/src/admin/pages/ImportElementorDialog.tsx +669 -0
- package/src/admin/pages/ImportPageLinks.tsx +86 -0
- package/src/admin/pages/PageList.tsx +82 -3
- package/src/admin/pages/ThemePartList.tsx +52 -2
- package/src/admin/pages/bulk.tsx +303 -0
- package/src/admin/pages/section-head.tsx +27 -0
- package/src/admin/proposals-api.ts +91 -0
- package/src/admin/search.ts +20 -0
- package/src/admin/theme-api.ts +4 -0
- package/src/admin/ui.ts +50 -4
- package/src/admin/widgets/CanvasField.tsx +8 -0
- package/src/admin/widgets/ConvertToRichText.tsx +136 -0
- package/src/admin/widgets/ExportEntryHtml.tsx +92 -0
- package/src/admin/widgets/convert-body.ts +73 -2
- package/src/astro/content-port.ts +14 -1
- package/src/astro/render.ts +6 -6
- package/src/astro/resolve-theme.ts +25 -8
- package/src/astro/resolve.ts +89 -2
- package/src/astro/tabs/runtime.ts +16 -6
- package/src/constants.ts +1 -1
- package/src/core/a11y/audit.ts +45 -14
- package/src/core/arrange.ts +5 -1
- package/src/core/bounded-array.ts +31 -0
- package/src/core/clipboard.ts +9 -0
- package/src/core/contract.ts +305 -0
- package/src/core/css/generate.ts +151 -20
- package/src/core/css/scope.ts +10 -2
- package/src/core/css/trace.ts +47 -13
- package/src/core/css-keywords.ts +51 -1
- package/src/core/design/cascade.ts +12 -9
- package/src/core/design/classes.ts +28 -9
- package/src/core/design/devices.ts +89 -13
- package/src/core/design/states.ts +5 -3
- package/src/core/design/transfer.ts +5 -0
- package/src/core/design/variables.ts +31 -5
- package/src/core/elements/dynamic-elements.ts +3 -3
- package/src/core/elements/index.ts +73 -9
- package/src/core/export/runtimes.generated.ts +9 -0
- package/src/core/export/site.ts +562 -0
- package/src/core/export/zip.ts +95 -0
- package/src/core/extensions/define.ts +13 -0
- package/src/core/extensions/index.ts +41 -0
- package/src/core/extensions/namespace.ts +82 -0
- package/src/core/extensions/normalize.ts +141 -0
- package/src/core/extensions/placeholder.ts +41 -0
- package/src/core/extensions/registry.ts +94 -0
- package/src/core/extensions/render-ext.ts +118 -0
- package/src/core/extensions/safe-nodes.ts +93 -0
- package/src/core/extensions/schema.ts +112 -0
- package/src/core/extensions/types.ts +159 -0
- package/src/core/forms/binding.ts +1 -1
- package/src/core/history/diff.ts +26 -1
- package/src/core/import/elementor/atomic.ts +1608 -0
- package/src/core/import/elementor/classes.ts +127 -0
- package/src/core/import/elementor/context.ts +429 -0
- package/src/core/import/elementor/counter-steps.ts +72 -0
- package/src/core/import/elementor/css.ts +445 -0
- package/src/core/import/elementor/html.ts +500 -0
- package/src/core/import/elementor/index.ts +967 -0
- package/src/core/import/elementor/inline-marks.ts +81 -0
- package/src/core/import/elementor/snapshots.ts +48 -0
- package/src/core/import/elementor/style.ts +429 -0
- package/src/core/import/elementor/values.ts +241 -0
- package/src/core/import/elementor/widgets.ts +1897 -0
- package/src/core/index.ts +96 -0
- package/src/core/json-schema.ts +114 -0
- package/src/core/limits.ts +19 -0
- package/src/core/migrate/index.ts +6 -1
- package/src/core/migrate/v18.ts +222 -0
- package/src/core/perf/meter.ts +42 -24
- package/src/core/portable-text-export.ts +243 -0
- package/src/core/proposals-safety.ts +102 -0
- package/src/core/proposals.ts +357 -0
- package/src/core/public-attributes.ts +30 -0
- package/src/core/recipes/index.ts +2 -2
- package/src/core/render/extras.ts +3 -3
- package/src/core/render/index.ts +222 -23
- package/src/core/render/loop.ts +1 -1
- package/src/core/render/section.ts +4 -4
- package/src/core/render/tabs.ts +18 -11
- package/src/core/render/vnode.ts +1 -1
- package/src/core/sanitize/css.ts +151 -10
- package/src/core/sanitize/motion.ts +116 -0
- package/src/core/saved-sections.ts +6 -0
- package/src/core/schema/descriptors.ts +3 -1
- package/src/core/schema/design.ts +4 -3
- package/src/core/schema/layout.ts +92 -16
- package/src/core/schema/style.ts +296 -112
- package/src/core/search-text.ts +70 -0
- package/src/core/text-marks.ts +227 -0
- package/src/core/theme/dynamic.ts +9 -4
- package/src/core/theme/float.ts +2 -0
- package/src/core/theme/popup-rules.ts +33 -1
- package/src/core/translatable.ts +34 -0
- package/src/core/validate.ts +13 -1
- package/src/index.ts +24 -0
- package/src/mcp/errors.ts +3 -1
- package/src/mcp/ports.ts +67 -0
- package/src/mcp/prompts.ts +1 -11
- package/src/mcp/proposals.ts +281 -0
- package/src/mcp/read.ts +10 -10
- package/src/mcp/tools.ts +71 -3
- package/src/mcp/write.ts +66 -11
- package/src/server/agent-settings.ts +5 -1
- package/src/server/icon-routes.ts +52 -12
- package/src/server/mcp-routes.ts +15 -0
- package/src/server/plugin.ts +35 -2
- package/src/server/presence.ts +78 -0
- package/src/server/proposals.ts +261 -0
- package/src/server/requests.ts +196 -0
- package/src/server/tools-served.ts +45 -0
|
@@ -375,7 +375,8 @@ export function TimelineDialog({
|
|
|
375
375
|
title={v.agent.summary}
|
|
376
376
|
>
|
|
377
377
|
<RobotIcon aria-hidden="true" size={12} />
|
|
378
|
-
|
|
378
|
+
{/* W-930: a person's save of changes accepted from a proposal. */}
|
|
379
|
+
{v.agent.tool === "accept_proposal" ? "Via agent" : "Agent"}
|
|
379
380
|
</span>
|
|
380
381
|
)}
|
|
381
382
|
</button>
|
|
@@ -417,6 +418,7 @@ export function TimelineDialog({
|
|
|
417
418
|
<span className="emvb-timeline-kind">{KIND_LABELS[change.kind]}</span>{" "}
|
|
418
419
|
{change.label || ELEMENT_NAMES[change.type] || change.type}
|
|
419
420
|
{change.kind === "changed" &&
|
|
421
|
+
!change.page &&
|
|
420
422
|
` · ${change.edits} element${change.edits === 1 ? "" : "s"}`}
|
|
421
423
|
{(change.kind === "changed" || change.kind === "removed") && (
|
|
422
424
|
<button
|
|
@@ -432,10 +434,13 @@ export function TimelineDialog({
|
|
|
432
434
|
}
|
|
433
435
|
setError(null);
|
|
434
436
|
refocusAfterRestore.current = true;
|
|
435
|
-
onApply(
|
|
437
|
+
onApply(
|
|
438
|
+
result.layout,
|
|
439
|
+
change.page ? "Page styles restored" : "Section restored",
|
|
440
|
+
);
|
|
436
441
|
}}
|
|
437
442
|
>
|
|
438
|
-
Restore this section
|
|
443
|
+
{change.page ? "Restore page styles" : "Restore this section"}
|
|
439
444
|
</button>
|
|
440
445
|
)}
|
|
441
446
|
</li>
|
|
@@ -10,6 +10,8 @@ import {
|
|
|
10
10
|
DeviceTabletIcon,
|
|
11
11
|
FloppyDiskIcon,
|
|
12
12
|
KeyboardIcon,
|
|
13
|
+
LaptopIcon,
|
|
14
|
+
MonitorIcon,
|
|
13
15
|
PaintBrushIcon,
|
|
14
16
|
SignOutIcon,
|
|
15
17
|
UploadSimpleIcon,
|
|
@@ -18,18 +20,23 @@ import {
|
|
|
18
20
|
import { BUTTON, SOLID_PRIMARY } from "../ui.ts";
|
|
19
21
|
import { statusLabel } from "../entry-status.ts";
|
|
20
22
|
import type { SaveStatus } from "./useSave.ts";
|
|
21
|
-
import type
|
|
23
|
+
import { WIDE_MIN_PX, type EditorDevice } from "../../core/index.ts";
|
|
22
24
|
import { useMediaQuery } from "./useMediaQuery.ts";
|
|
23
25
|
|
|
24
26
|
/** Preview sizes (W-158): the canvas device widths, in a window of that size. */
|
|
25
27
|
const PREVIEW_SIZES = [
|
|
28
|
+
{ device: "wide", label: "Wide screen (2560 px)", icon: MonitorIcon },
|
|
26
29
|
{ device: "desktop", label: "Desktop", icon: DesktopIcon },
|
|
30
|
+
{ device: "laptop", label: "Laptop (1200 px)", icon: LaptopIcon },
|
|
27
31
|
{ device: "tablet", label: "Tablet (768 px)", icon: DeviceTabletIcon },
|
|
28
32
|
{ device: "mobile", label: "Mobile (390 px)", icon: DeviceMobileIcon },
|
|
29
33
|
] as const;
|
|
30
34
|
|
|
31
35
|
export type TopBarPage = { title: string; status: string };
|
|
32
36
|
|
|
37
|
+
const wideScreenFits = () =>
|
|
38
|
+
typeof window !== "undefined" && (window.screen?.availWidth ?? 0) >= WIDE_MIN_PX;
|
|
39
|
+
|
|
33
40
|
function SaveStatusText({
|
|
34
41
|
status,
|
|
35
42
|
dirty,
|
|
@@ -91,7 +98,7 @@ export function TopBar({
|
|
|
91
98
|
onShortcuts: () => void;
|
|
92
99
|
onSiteStyles?: () => void;
|
|
93
100
|
/** Opens the preview; with no device, at the device shown on the canvas (W-158). */
|
|
94
|
-
onPreview: (device?:
|
|
101
|
+
onPreview: (device?: EditorDevice) => void;
|
|
95
102
|
onSave: () => void;
|
|
96
103
|
onPublish: () => void;
|
|
97
104
|
/** Site styles have unpublished changes (W-153): the Publish button carries a dot. */
|
|
@@ -251,11 +258,26 @@ export function TopBar({
|
|
|
251
258
|
/>
|
|
252
259
|
</DropdownMenu.Trigger>
|
|
253
260
|
<DropdownMenu.Content data-emvb-preview-sizes="">
|
|
254
|
-
{PREVIEW_SIZES.map(({ device, label, icon }) =>
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
261
|
+
{PREVIEW_SIZES.map(({ device, label, icon }) => {
|
|
262
|
+
// W-959: a window can't be wider than the screen, so Wide screen's media
|
|
263
|
+
// queries only apply on a screen at least 2400 px wide.
|
|
264
|
+
const tooNarrow = device === "wide" && !wideScreenFits();
|
|
265
|
+
return (
|
|
266
|
+
<DropdownMenu.Item
|
|
267
|
+
key={device}
|
|
268
|
+
icon={icon}
|
|
269
|
+
disabled={tooNarrow}
|
|
270
|
+
title={
|
|
271
|
+
tooNarrow
|
|
272
|
+
? `Needs a screen at least ${WIDE_MIN_PX} px wide; the canvas shows Wide screen at any size`
|
|
273
|
+
: undefined
|
|
274
|
+
}
|
|
275
|
+
onClick={() => onPreview(device)}
|
|
276
|
+
>
|
|
277
|
+
{label}
|
|
278
|
+
</DropdownMenu.Item>
|
|
279
|
+
);
|
|
280
|
+
})}
|
|
259
281
|
</DropdownMenu.Content>
|
|
260
282
|
</DropdownMenu>
|
|
261
283
|
</div>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { createPortal } from "react-dom";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
isMultilineText,
|
|
4
|
+
type Layout,
|
|
5
|
+
type EditorDevice,
|
|
6
|
+
type VNode,
|
|
7
|
+
} from "../../../core/index.ts";
|
|
3
8
|
import type { PasteRefusal } from "../useClipboardActions.ts";
|
|
4
9
|
import { CanvasTextEdit } from "./CanvasTextEdit.tsx";
|
|
5
10
|
import { useFrameFocusRing } from "./frame-focus-ring.ts";
|
|
@@ -112,7 +117,7 @@ export function CanvasFrame({
|
|
|
112
117
|
/** The style state chosen in the Style tab, shown on the selected element (W-089). */
|
|
113
118
|
statePreview?: StatePreview | null;
|
|
114
119
|
/** The previewed device (W-096): its page width, scaled to the stage (W-158, D-046). */
|
|
115
|
-
device?:
|
|
120
|
+
device?: EditorDevice;
|
|
116
121
|
/** Fit to the stage or show at 100% (W-158). */
|
|
117
122
|
zoom?: CanvasZoom;
|
|
118
123
|
/** Told the on-screen scale whenever it changes, for the zoom readout (W-158). */
|
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
import { Button, Tabs } from "@cloudflare/kumo";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
DesktopIcon,
|
|
4
|
+
DeviceMobileIcon,
|
|
5
|
+
DeviceTabletIcon,
|
|
6
|
+
type Icon,
|
|
7
|
+
LaptopIcon,
|
|
8
|
+
MonitorIcon,
|
|
9
|
+
} from "@phosphor-icons/react";
|
|
3
10
|
import * as React from "react";
|
|
4
|
-
import {
|
|
11
|
+
import { EDITOR_DEVICES, type EditorDevice } from "../../../core/index.ts";
|
|
5
12
|
|
|
6
|
-
const LABELS: Record<
|
|
13
|
+
const LABELS: Record<EditorDevice, string> = {
|
|
14
|
+
wide: "Wide screen",
|
|
7
15
|
desktop: "Desktop",
|
|
16
|
+
laptop: "Laptop",
|
|
8
17
|
tablet: "Tablet",
|
|
9
18
|
mobile: "Mobile",
|
|
10
19
|
};
|
|
11
20
|
|
|
12
|
-
const ICONS: Record<
|
|
21
|
+
const ICONS: Record<EditorDevice, Icon> = {
|
|
22
|
+
wide: MonitorIcon,
|
|
13
23
|
desktop: DesktopIcon,
|
|
24
|
+
laptop: LaptopIcon,
|
|
14
25
|
tablet: DeviceTabletIcon,
|
|
15
26
|
mobile: DeviceMobileIcon,
|
|
16
27
|
};
|
|
17
28
|
|
|
18
29
|
/** The device's icon (decorative) and its name, which stays the tab's accessible name (W-127). */
|
|
19
|
-
function DeviceLabel({ device }: { device:
|
|
30
|
+
function DeviceLabel({ device }: { device: EditorDevice }) {
|
|
20
31
|
const DeviceIcon = ICONS[device];
|
|
21
32
|
return (
|
|
22
33
|
<span className="emvb-device-label">
|
|
@@ -26,25 +37,28 @@ function DeviceLabel({ device }: { device: PopupDevice }) {
|
|
|
26
37
|
);
|
|
27
38
|
}
|
|
28
39
|
|
|
29
|
-
/**
|
|
40
|
+
/** Wide screen (W-959), desktop, laptop, tablet or mobile. Desktop edits `style`; the others edit overrides (W-096). */
|
|
30
41
|
export function DeviceBar({
|
|
31
42
|
device,
|
|
32
43
|
hidden,
|
|
33
44
|
canHide,
|
|
34
45
|
hideLabel,
|
|
46
|
+
inherited = false,
|
|
35
47
|
onDevice,
|
|
36
48
|
onToggleHidden,
|
|
37
49
|
zoom = "fit",
|
|
38
50
|
scale = 1,
|
|
39
51
|
onZoom,
|
|
40
52
|
}: {
|
|
41
|
-
device:
|
|
53
|
+
device: EditorDevice;
|
|
42
54
|
/** Whether the selected element is hidden on `device`. */
|
|
43
55
|
hidden: boolean;
|
|
44
56
|
canHide: boolean;
|
|
45
57
|
/** From the hide-on-device command, so the checkbox wording has one source. */
|
|
46
58
|
hideLabel: string;
|
|
47
|
-
|
|
59
|
+
/** W-959: Wide screen's hide still follows Desktop (no choice of its own yet). */
|
|
60
|
+
inherited?: boolean;
|
|
61
|
+
onDevice: (device: EditorDevice) => void;
|
|
48
62
|
onToggleHidden: () => void;
|
|
49
63
|
/** Fit or 100% (W-158), with the current on-screen scale for the readout. */
|
|
50
64
|
zoom?: "fit" | "actual";
|
|
@@ -62,19 +76,26 @@ export function DeviceBar({
|
|
|
62
76
|
variant="segmented"
|
|
63
77
|
size="sm"
|
|
64
78
|
className="emvb-device-tabs"
|
|
65
|
-
tabs={
|
|
79
|
+
tabs={EDITOR_DEVICES.map((item) => ({
|
|
66
80
|
value: item,
|
|
67
81
|
label: <DeviceLabel device={item} />,
|
|
68
82
|
}))}
|
|
69
83
|
value={device}
|
|
70
84
|
onValueChange={(next) => {
|
|
71
|
-
if ((
|
|
85
|
+
if ((EDITOR_DEVICES as readonly string[]).includes(next))
|
|
86
|
+
onDevice(next as EditorDevice);
|
|
72
87
|
}}
|
|
73
88
|
/>
|
|
74
89
|
</div>
|
|
75
90
|
<label className="emvb-device-hide">
|
|
76
91
|
<input type="checkbox" checked={hidden} disabled={!canHide} onChange={onToggleHidden} />
|
|
77
92
|
{hideLabel}
|
|
93
|
+
{inherited && (
|
|
94
|
+
<span className="emvb-helper" data-emvb-hide-inherited="">
|
|
95
|
+
{" "}
|
|
96
|
+
(follows Desktop)
|
|
97
|
+
</span>
|
|
98
|
+
)}
|
|
78
99
|
</label>
|
|
79
100
|
{onZoom && (
|
|
80
101
|
<Button
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEVICE_PREVIEW_PX, type
|
|
1
|
+
import { DEVICE_PREVIEW_PX, WIDE_PREVIEW_PX, type EditorDevice } from "../../../core/index.ts";
|
|
2
2
|
|
|
3
3
|
/** Fit scales the canvas down to the stage; Actual shows it at 100% and scrolls (W-158). */
|
|
4
4
|
export type CanvasZoom = "fit" | "actual";
|
|
@@ -9,11 +9,11 @@ export type CanvasZoom = "fit" | "actual";
|
|
|
9
9
|
* the stage width, never up; Actual keeps 100% and the stage scrolls sideways.
|
|
10
10
|
*/
|
|
11
11
|
export function canvasScale(
|
|
12
|
-
device:
|
|
12
|
+
device: EditorDevice,
|
|
13
13
|
stageWidth: number,
|
|
14
14
|
zoom: CanvasZoom,
|
|
15
15
|
): { width: number; scale: number } {
|
|
16
|
-
const base = DEVICE_PREVIEW_PX[device];
|
|
16
|
+
const base = device === "wide" ? WIDE_PREVIEW_PX : DEVICE_PREVIEW_PX[device];
|
|
17
17
|
const width = device === "desktop" ? Math.max(base, Math.floor(stageWidth)) : base;
|
|
18
18
|
if (zoom === "actual" || stageWidth <= 0) return { width, scale: 1 };
|
|
19
19
|
return { width, scale: Math.min(1, stageWidth / width) };
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
isPlainTextNode,
|
|
5
5
|
plainTextOf,
|
|
6
6
|
type Layout,
|
|
7
|
-
type
|
|
7
|
+
type EditorDevice,
|
|
8
8
|
type VNode,
|
|
9
9
|
} from "../../../core/index.ts";
|
|
10
10
|
import type { PasteRefusal, ClipboardActions } from "../useClipboardActions.ts";
|
|
@@ -65,7 +65,7 @@ export function useCanvasSession({
|
|
|
65
65
|
layout: Layout | null;
|
|
66
66
|
selection: CanvasSelection;
|
|
67
67
|
statePreview: StatePreview | null;
|
|
68
|
-
device:
|
|
68
|
+
device: EditorDevice;
|
|
69
69
|
zoom: CanvasZoom;
|
|
70
70
|
onScale?: (scale: number) => void;
|
|
71
71
|
refusal: PasteRefusal | null;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { applyProposal, type Proposal, type ProposalRefusal } from "../../core/proposals.ts";
|
|
2
|
+
import type { DesignSystem } from "../../core/schema/design.ts";
|
|
3
|
+
import type { Layout, LayoutNode } from "../../core/schema/layout.ts";
|
|
4
|
+
import { findNode, forEachNode } from "../../core/tree-ops.ts";
|
|
5
|
+
import { ELEMENT_NAMES } from "./element-chrome.ts";
|
|
6
|
+
import { adminExtensionInstalled } from "./extension-manifests.ts";
|
|
7
|
+
|
|
8
|
+
const OPTIONS = { extensionInstalled: adminExtensionInstalled };
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* W-930 co-design review, as pure functions over the editor's own state. Accepting runs the same
|
|
12
|
+
* `applyProposal` the server checked with, on the page as it is in the editor now (unsaved edits
|
|
13
|
+
* included), so nothing an agent sent reaches the page without passing every save-time check.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export type Op = Proposal["ops"][number];
|
|
17
|
+
export type OpGroup = "added" | "changed" | "moved" | "removed" | "styles";
|
|
18
|
+
export const GROUP_LABELS: Record<OpGroup, string> = {
|
|
19
|
+
added: "Added",
|
|
20
|
+
changed: "Changed",
|
|
21
|
+
moved: "Moved",
|
|
22
|
+
removed: "Removed",
|
|
23
|
+
styles: "Site styles",
|
|
24
|
+
};
|
|
25
|
+
export const GROUP_ORDER: readonly OpGroup[] = ["added", "changed", "moved", "removed", "styles"];
|
|
26
|
+
|
|
27
|
+
/** What the editor knows about its page and styles, as a proposal base. */
|
|
28
|
+
export type EditorBase = {
|
|
29
|
+
rev: string | null;
|
|
30
|
+
layout: Layout | null;
|
|
31
|
+
design: DesignSystem;
|
|
32
|
+
/** The style draft's revision, or the published one when there is no draft (as the server). */
|
|
33
|
+
designRevision: string | null;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const groupOf = (op: Op): OpGroup =>
|
|
37
|
+
op.kind === "insert"
|
|
38
|
+
? "added"
|
|
39
|
+
: op.kind === "update"
|
|
40
|
+
? "changed"
|
|
41
|
+
: op.kind === "move"
|
|
42
|
+
? "moved"
|
|
43
|
+
: op.kind === "delete"
|
|
44
|
+
? "removed"
|
|
45
|
+
: "styles";
|
|
46
|
+
|
|
47
|
+
const nameOf = (node: { type?: unknown } | undefined | null): string =>
|
|
48
|
+
(typeof node?.type === "string" && ELEMENT_NAMES[node.type]) ||
|
|
49
|
+
(typeof node?.type === "string" ? node.type : "Element");
|
|
50
|
+
|
|
51
|
+
const textOf = (node: unknown): string | undefined => {
|
|
52
|
+
const props = (node as { props?: Record<string, unknown> } | null)?.props;
|
|
53
|
+
const text = props?.["text"] ?? props?.["label"];
|
|
54
|
+
if (typeof text !== "string" || !text.trim()) return undefined;
|
|
55
|
+
// W-933: direction overrides and other invisible controls could make a change read as another.
|
|
56
|
+
const plain = text.replace(BIDI_AND_CONTROLS, "").trim().replace(/\s+/g, " ");
|
|
57
|
+
return plain.length > 48 ? `${plain.slice(0, 47)}…` : plain;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** C0 controls (not tab or newline), zero-width and bidi formatting characters. */
|
|
61
|
+
const BIDI_AND_CONTROLS =
|
|
62
|
+
// oxlint-disable-next-line no-control-regex
|
|
63
|
+
/[\u0000-\u0008\u000B-\u001F\u007F\u200B-\u200F\u202A-\u202E\u2060-\u2069\uFEFF]/g;
|
|
64
|
+
|
|
65
|
+
const quoted = (text: string | undefined) => (text ? ` “${text}”` : "");
|
|
66
|
+
|
|
67
|
+
/** One line a person can read: what the change does, to which element. Agent text is quoted. */
|
|
68
|
+
export function describeOp(op: Op, layout: Layout | null): string {
|
|
69
|
+
const target = (id: string) => (layout ? findNode(layout, id) : null);
|
|
70
|
+
switch (op.kind) {
|
|
71
|
+
case "insert": {
|
|
72
|
+
const parent = target(op.parentId);
|
|
73
|
+
return `Add ${nameOf(op.node)}${quoted(textOf(op.node))} to ${nameOf(parent)}`;
|
|
74
|
+
}
|
|
75
|
+
case "update": {
|
|
76
|
+
const node = target(op.id);
|
|
77
|
+
const fields = Object.keys(op.set).join(", ");
|
|
78
|
+
const text = textOf({ props: op.set["props"] });
|
|
79
|
+
return text
|
|
80
|
+
? `Change ${nameOf(node)} text to${quoted(text)}`
|
|
81
|
+
: `Change ${nameOf(node)}${quoted(textOf(node))}: ${fields}`;
|
|
82
|
+
}
|
|
83
|
+
case "move": {
|
|
84
|
+
const node = target(op.id);
|
|
85
|
+
return `Move ${nameOf(node)}${quoted(textOf(node))} into ${nameOf(target(op.parentId))}`;
|
|
86
|
+
}
|
|
87
|
+
case "delete": {
|
|
88
|
+
const node = target(op.id);
|
|
89
|
+
return `Remove ${nameOf(node)}${quoted(textOf(node))}`;
|
|
90
|
+
}
|
|
91
|
+
case "class":
|
|
92
|
+
return op.value === null
|
|
93
|
+
? `Remove class ${op.id}`
|
|
94
|
+
: `Set class “${String(op.value["name"] ?? op.id)}”`;
|
|
95
|
+
case "variable":
|
|
96
|
+
return op.value === null
|
|
97
|
+
? `Remove ${op.group} variable ${op.id}`
|
|
98
|
+
: `Set ${op.group} variable “${String(op.value["name"] ?? op.id)}”`;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const baseOf = (editor: EditorBase) => ({
|
|
103
|
+
revision: editor.rev ?? "",
|
|
104
|
+
layout: editor.layout,
|
|
105
|
+
design: editor.design,
|
|
106
|
+
designRevision: editor.designRevision,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The page and styles with the selected changes applied, or why they can't be. Never mutates the
|
|
111
|
+
* editor's state; the caller dispatches the result as one undoable edit.
|
|
112
|
+
*/
|
|
113
|
+
export function acceptOps(
|
|
114
|
+
editor: EditorBase,
|
|
115
|
+
proposal: Proposal,
|
|
116
|
+
selected: readonly number[],
|
|
117
|
+
): { ok: true; layout: Layout; design: DesignSystem; designChanged: boolean } | ProposalRefusal {
|
|
118
|
+
const applied = applyProposal(
|
|
119
|
+
baseOf(editor),
|
|
120
|
+
proposal,
|
|
121
|
+
[...selected].toSorted((a, b) => a - b),
|
|
122
|
+
OPTIONS,
|
|
123
|
+
);
|
|
124
|
+
if (!applied.ok) return applied;
|
|
125
|
+
const designChanged = selected.some((i) => groupOf(proposal.ops[i] as Op) === "styles");
|
|
126
|
+
return { ...applied, designChanged };
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export type Ghost = {
|
|
130
|
+
layout: Layout;
|
|
131
|
+
added: Set<string>;
|
|
132
|
+
changed: Set<string>;
|
|
133
|
+
removed: Set<string>;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const idsOf = (layout: Layout): Set<string> => {
|
|
137
|
+
const ids = new Set<string>();
|
|
138
|
+
forEachNode(layout.root as LayoutNode, (node) => ids.add(node.id));
|
|
139
|
+
return ids;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* W-930 ghost preview of pending changes: the layout with every pending insert, update and move
|
|
144
|
+
* applied, and removals kept in place so they can be shown struck through. A new layout object;
|
|
145
|
+
* the editor's own layout is never touched. Null when the pending changes don't apply.
|
|
146
|
+
*/
|
|
147
|
+
export function ghostOf(
|
|
148
|
+
editor: EditorBase,
|
|
149
|
+
proposal: Proposal,
|
|
150
|
+
pending: readonly number[],
|
|
151
|
+
): Ghost | null {
|
|
152
|
+
if (!editor.layout) return null;
|
|
153
|
+
const shown = pending.filter((i) => {
|
|
154
|
+
const op = proposal.ops[i];
|
|
155
|
+
return op && op.kind !== "delete" && groupOf(op) !== "styles";
|
|
156
|
+
});
|
|
157
|
+
const before = idsOf(editor.layout);
|
|
158
|
+
const applied =
|
|
159
|
+
shown.length === 0
|
|
160
|
+
? { ok: true as const, layout: structuredClone(editor.layout) }
|
|
161
|
+
: applyProposal(baseOf(editor), proposal, shown, OPTIONS);
|
|
162
|
+
if (!applied.ok) return null;
|
|
163
|
+
const added = new Set([...idsOf(applied.layout)].filter((id) => !before.has(id)));
|
|
164
|
+
const changed = new Set<string>();
|
|
165
|
+
const removed = new Set<string>();
|
|
166
|
+
for (const i of pending) {
|
|
167
|
+
const op = proposal.ops[i];
|
|
168
|
+
if (op?.kind === "update" || op?.kind === "move") changed.add(op.id);
|
|
169
|
+
if (op?.kind === "delete") removed.add(op.id);
|
|
170
|
+
}
|
|
171
|
+
return { layout: applied.layout, added, changed, removed };
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** Canvas CSS that marks the ghost: added = blue outline, changed = dashed, removed = struck. */
|
|
175
|
+
const ghostSelector = (ids: Set<string>) =>
|
|
176
|
+
[...ids].map((id) => `[data-emvb-id="${id.replace(/[^A-Za-z0-9_-]/g, "")}"]`).join(",");
|
|
177
|
+
|
|
178
|
+
export function ghostCss(ghost: Ghost): string {
|
|
179
|
+
const sel = ghostSelector;
|
|
180
|
+
const rules: string[] = [];
|
|
181
|
+
if (ghost.added.size)
|
|
182
|
+
rules.push(`${sel(ghost.added)}{outline:2px solid #2563eb;outline-offset:2px}`);
|
|
183
|
+
if (ghost.changed.size)
|
|
184
|
+
rules.push(`${sel(ghost.changed)}{outline:2px dashed #2563eb;outline-offset:2px}`);
|
|
185
|
+
if (ghost.removed.size)
|
|
186
|
+
rules.push(
|
|
187
|
+
`${sel(ghost.removed)}{outline:2px dashed #dc2626;outline-offset:2px;opacity:.5;text-decoration:line-through}`,
|
|
188
|
+
);
|
|
189
|
+
return rules.join("\n");
|
|
190
|
+
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultElement,
|
|
3
|
+
updateNode,
|
|
3
4
|
ELEMENTS,
|
|
5
|
+
isExtensionType,
|
|
4
6
|
newNodeId,
|
|
5
7
|
type ElementType,
|
|
6
8
|
type Layout,
|
|
7
9
|
type LayoutNode,
|
|
8
10
|
} from "../../../core/index.ts";
|
|
11
|
+
import type { ThemePartType } from "../../../core/theme/part-types.ts";
|
|
12
|
+
import { indexLayout } from "../../../core/tree-ops.ts";
|
|
13
|
+
import { isSharedPart } from "../panels/settings/heading-warning.ts";
|
|
9
14
|
|
|
10
15
|
const hasH1 = (node: LayoutNode): boolean =>
|
|
11
16
|
((node.type === "heading" || node.type === "post-title") &&
|
|
@@ -14,13 +19,40 @@ const hasH1 = (node: LayoutNode): boolean =>
|
|
|
14
19
|
|
|
15
20
|
/**
|
|
16
21
|
* A new Heading is the page's H1 when the page has none yet, otherwise the default H2 (W-147).
|
|
17
|
-
* Other nodes, and headings whose level was already chosen, are returned as they are.
|
|
22
|
+
* Other nodes, and headings whose level was already chosen, are returned as they are. In a
|
|
23
|
+
* header, footer, popup, float, synced section or loop item it stays H2: that part lands on pages
|
|
24
|
+
* that have their own H1 (W-946).
|
|
18
25
|
*/
|
|
19
|
-
export function withPageHeadingLevel(
|
|
20
|
-
|
|
26
|
+
export function withPageHeadingLevel(
|
|
27
|
+
node: LayoutNode,
|
|
28
|
+
layout: Layout,
|
|
29
|
+
partType?: ThemePartType,
|
|
30
|
+
): LayoutNode {
|
|
31
|
+
if (node.type !== "heading" || node.props.level !== 2) return node;
|
|
32
|
+
if (isSharedPart(partType) || hasH1(layout.root)) return node;
|
|
21
33
|
return { ...node, props: { ...node.props, level: 1 } };
|
|
22
34
|
}
|
|
23
35
|
|
|
36
|
+
/**
|
|
37
|
+
* W-968: a new Post title inside a Loop (or in a loop item part) is an H2. Its default H1 gave a
|
|
38
|
+
* grid of cards one H1 per post. Run on the layout right after the insert; a title whose level was
|
|
39
|
+
* already changed, or one moved in later, is left alone.
|
|
40
|
+
*/
|
|
41
|
+
export function withLoopPostTitleLevel(
|
|
42
|
+
layout: Layout,
|
|
43
|
+
id: string,
|
|
44
|
+
partType?: ThemePartType,
|
|
45
|
+
): Layout {
|
|
46
|
+
const index = indexLayout(layout);
|
|
47
|
+
const node = index.byId.get(id);
|
|
48
|
+
if (node?.type !== "post-title" || (node.props as { level?: number }).level !== 1) return layout;
|
|
49
|
+
let inLoop = partType === "loop_item";
|
|
50
|
+
for (let at = index.parentOf.get(id); !inLoop && at; at = index.parentOf.get(at))
|
|
51
|
+
inLoop = index.byId.get(at)?.type === "loop";
|
|
52
|
+
if (!inLoop) return layout;
|
|
53
|
+
return updateNode(layout, id, (n) => ({ ...n, props: { ...n.props, level: 2 } }) as LayoutNode);
|
|
54
|
+
}
|
|
55
|
+
|
|
24
56
|
const textNode = (text: string, random?: () => number): LayoutNode => ({
|
|
25
57
|
...defaultElement("text", newNodeId(random)),
|
|
26
58
|
props: { text },
|
|
@@ -55,7 +87,19 @@ export function newTabPanel(n: number, random?: () => number): LayoutNode {
|
|
|
55
87
|
* Default node for a new element from the Add panel. Only new inserts get starter children;
|
|
56
88
|
* saved Accordions and Tabs with no items keep working as they are (W-130).
|
|
57
89
|
*/
|
|
58
|
-
export function newElement(
|
|
90
|
+
export function newElement(
|
|
91
|
+
type: string,
|
|
92
|
+
random?: () => number,
|
|
93
|
+
extensionDefaults?: Record<string, unknown>,
|
|
94
|
+
): LayoutNode | null {
|
|
95
|
+
// W-927: extension elements are stored as UnknownNodes with namespaced types.
|
|
96
|
+
if (isExtensionType(type)) {
|
|
97
|
+
return {
|
|
98
|
+
id: newNodeId(random),
|
|
99
|
+
type,
|
|
100
|
+
props: extensionDefaults ? { ...extensionDefaults } : {},
|
|
101
|
+
};
|
|
102
|
+
}
|
|
59
103
|
if (!(type in ELEMENTS)) return null;
|
|
60
104
|
if (type === "tabs") {
|
|
61
105
|
const tabs = defaultElement("tabs", newNodeId(random));
|
|
@@ -4,11 +4,11 @@ import type { SavedSectionActions } from "./useSavedSections.ts";
|
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import {
|
|
6
6
|
findNode,
|
|
7
|
-
|
|
7
|
+
toggleHiddenOn,
|
|
8
8
|
type A11yReport,
|
|
9
9
|
type ElementType,
|
|
10
10
|
type LayoutNode,
|
|
11
|
-
type
|
|
11
|
+
type EditorDevice,
|
|
12
12
|
type ThemeDynamicData,
|
|
13
13
|
} from "../../core/index.ts";
|
|
14
14
|
import type { Fetcher } from "../api.ts";
|
|
@@ -167,19 +167,21 @@ async function revertToPublished({
|
|
|
167
167
|
/** Hide or show the selected element on the current device (W-096). */
|
|
168
168
|
export function hideSelectedOnDevice(
|
|
169
169
|
state: EditorState,
|
|
170
|
-
device:
|
|
170
|
+
device: EditorDevice,
|
|
171
171
|
dispatch: React.Dispatch<EditorAction>,
|
|
172
172
|
): void {
|
|
173
173
|
const id = state.selectedId;
|
|
174
174
|
const node = state.page.layout && id ? findNode(state.page.layout, id) : undefined;
|
|
175
175
|
if (!node) return;
|
|
176
|
-
const hiddenOn = toggleHidden(node.hiddenOn, device);
|
|
177
176
|
dispatch({
|
|
178
177
|
type: "update-node",
|
|
179
178
|
id: node.id,
|
|
180
179
|
update: (current) => {
|
|
181
|
-
|
|
180
|
+
// W-959: Wide screen's hide sits in `style.wide.hidden`; the rest in `hiddenOn`.
|
|
181
|
+
const { hiddenOn, style } = toggleHiddenOn(current, device);
|
|
182
|
+
const next = { ...current, hiddenOn, style };
|
|
182
183
|
if (!hiddenOn) delete next.hiddenOn;
|
|
184
|
+
if (!style) delete next.style;
|
|
183
185
|
return next;
|
|
184
186
|
},
|
|
185
187
|
});
|
|
@@ -225,7 +227,7 @@ export function EditorDialogs({
|
|
|
225
227
|
selectedNode: LayoutNode | null;
|
|
226
228
|
formsAvailable: boolean;
|
|
227
229
|
paletteActions: readonly EditorCommand[];
|
|
228
|
-
addFromPanel: (type: ElementType) => void;
|
|
230
|
+
addFromPanel: (type: ElementType | string) => void;
|
|
229
231
|
addRecipe: (id: string) => void;
|
|
230
232
|
deleteAsk: { id: string; label: string; count: number } | null;
|
|
231
233
|
setDeleteAsk: (ask: { id: string; label: string; count: number } | null) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PasteMode,
|
|
1
|
+
import type { PasteMode, EditorDevice, WrapType } from "../../core/index.ts";
|
|
2
2
|
|
|
3
3
|
/** Where an editor command is offered. Shortcuts call `runCommand` for the same ids. */
|
|
4
4
|
export type CommandSurface = "palette" | "layers" | "overlay" | "device";
|
|
@@ -39,7 +39,7 @@ export type CommandRunners = {
|
|
|
39
39
|
openTimeline?: () => void;
|
|
40
40
|
openShare?: () => void;
|
|
41
41
|
openWeight?: () => void;
|
|
42
|
-
setDevice?: (device:
|
|
42
|
+
setDevice?: (device: EditorDevice) => void;
|
|
43
43
|
openShortcuts?: () => void;
|
|
44
44
|
rename?: () => void;
|
|
45
45
|
/** Opens Save as section for an element (W-876). */
|
|
@@ -53,7 +53,7 @@ export type CommandInput = {
|
|
|
53
53
|
targetId: string | null;
|
|
54
54
|
isRoot: boolean;
|
|
55
55
|
isParent: boolean;
|
|
56
|
-
device:
|
|
56
|
+
device: EditorDevice;
|
|
57
57
|
/** Duplicate and wrap. False on the root and when nothing is selected. */
|
|
58
58
|
canDuplicate: boolean;
|
|
59
59
|
/** Delete and the sibling moves. False on the root. */
|
|
@@ -184,7 +184,9 @@ const SPECS: readonly Spec[] = [
|
|
|
184
184
|
keywords: "performance budget size speed",
|
|
185
185
|
surfaces: ["palette"],
|
|
186
186
|
},
|
|
187
|
+
{ id: "device-wide", labels: { palette: "View on wide screen" }, surfaces: ["palette"] },
|
|
187
188
|
{ id: "device-desktop", labels: { palette: "View on desktop" }, surfaces: ["palette"] },
|
|
189
|
+
{ id: "device-laptop", labels: { palette: "View on laptop" }, surfaces: ["palette"] },
|
|
188
190
|
{ id: "device-tablet", labels: { palette: "View on tablet" }, surfaces: ["palette"] },
|
|
189
191
|
{ id: "device-mobile", labels: { palette: "View on mobile" }, surfaces: ["palette"] },
|
|
190
192
|
{
|
|
@@ -231,7 +233,9 @@ const ORDER: Record<CommandSurface, readonly string[]> = {
|
|
|
231
233
|
"timeline",
|
|
232
234
|
"share",
|
|
233
235
|
"weight",
|
|
236
|
+
"device-wide",
|
|
234
237
|
"device-desktop",
|
|
238
|
+
"device-laptop",
|
|
235
239
|
"device-tablet",
|
|
236
240
|
"device-mobile",
|
|
237
241
|
"shortcuts",
|
|
@@ -265,7 +269,8 @@ function blocked(id: string, input: CommandInput): boolean {
|
|
|
265
269
|
}
|
|
266
270
|
|
|
267
271
|
function labelFor(spec: Spec, input: CommandInput): string {
|
|
268
|
-
if (spec.id === "hide-on-device")
|
|
272
|
+
if (spec.id === "hide-on-device")
|
|
273
|
+
return `Hide on ${input.device === "wide" ? "wide screen" : input.device}`;
|
|
269
274
|
return spec.labels[input.surface] ?? spec.id;
|
|
270
275
|
}
|
|
271
276
|
|
|
@@ -367,9 +372,15 @@ export function runCommand(runners: CommandRunners, id: string, targetId: string
|
|
|
367
372
|
case "weight":
|
|
368
373
|
runners.openWeight?.();
|
|
369
374
|
return;
|
|
375
|
+
case "device-wide":
|
|
376
|
+
runners.setDevice?.("wide");
|
|
377
|
+
return;
|
|
370
378
|
case "device-desktop":
|
|
371
379
|
runners.setDevice?.("desktop");
|
|
372
380
|
return;
|
|
381
|
+
case "device-laptop":
|
|
382
|
+
runners.setDevice?.("laptop");
|
|
383
|
+
return;
|
|
373
384
|
case "device-tablet":
|
|
374
385
|
runners.setDevice?.("tablet");
|
|
375
386
|
return;
|
|
@@ -502,7 +502,8 @@ iframe[data-emvb-canvas-focus="keyboard"] { outline: 2px solid var(--color-kumo-
|
|
|
502
502
|
font-family: var(--font-sans); font-size: 12px; line-height: 16px;
|
|
503
503
|
}
|
|
504
504
|
.emvb-chip:hover { background: var(--color-kumo-recessed); }
|
|
505
|
-
|
|
505
|
+
/* W-976: white on the plain brand blue was 4.48:1 (#076eff); a darker mix keeps it over 4.5:1. */
|
|
506
|
+
.emvb-chip[data-active="true"] { background: color-mix(in oklch, var(--color-kumo-brand), black 18%); color: #fff; }
|
|
506
507
|
.emvb-chip[data-missing] { background: transparent; box-shadow: inset 0 0 0 1px var(--color-kumo-danger); }
|
|
507
508
|
.emvb-chip[data-missing] .emvb-chip-main { cursor: default; }
|
|
508
509
|
.emvb-chip-main {
|