camox 0.54.0 → 0.57.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/dist/features/canvas/CamoxCanvas.js +14 -11
- package/dist/features/canvas/CanvasLoadingScreen.js +1 -1
- package/dist/features/canvas/CanvasPageHeader.js +1 -1
- package/dist/features/canvas/canvasFrameDocument.js +13 -6
- package/dist/features/canvas/sidebar/CanvasViewHeader.js +1 -1
- package/dist/features/canvas/sidebar/{CanvasSidebar.js → ContentSidebar.js} +5 -5
- package/dist/features/canvas/sidebar/{CanvasSidebarFrame.js → ContentSidebarFrame.js} +4 -4
- package/dist/features/canvas/sidebar/{CanvasSidebarSkeleton.js → ContentSidebarSkeleton.js} +7 -7
- package/dist/features/preview/CamoxPreview.js +2 -2
- package/dist/features/preview/components/Frame.js +1 -18
- package/dist/features/preview/components/PreviewToolbar.js +1 -1
- package/dist/features/preview/components/SelectionEditor.js +2 -2
- package/dist/features/preview/components/SidebarStack.js +201 -116
- package/dist/features/preview/components/StudioEditingFallback.js +3 -3
- package/dist/features/preview/components/previewStyles.js +25 -1
- package/dist/features/renderer/RendererApp.js +55 -37
- package/dist/features/routes/pageRuntime.d.ts +1 -1
- package/dist/features/runtime/RuntimeChrome.js +4 -4
- package/dist/features/studio/components/AgentSidebar.js +56 -0
- package/dist/features/studio/components/ChatWidget.js +219 -0
- package/dist/features/studio/components/DraftsControl.js +17 -17
- package/dist/features/studio/components/Patrol.js +676 -0
- package/dist/features/studio/components/ReviewDraftSheet.js +38 -38
- package/dist/features/studio/components/Squareling.js +171 -84
- package/dist/features/studio/components/ThreadMessages.js +256 -136
- package/dist/features/studio/localeOptions.js +7 -3
- package/dist/features/studio/reportSentence.js +75 -0
- package/dist/features/studio/routes.js +2 -1
- package/dist/features/studio/showInCanvas.js +9 -2
- package/dist/features/studio/studioStore.js +5 -5
- package/dist/features/studio/workingSentence.js +55 -0
- package/dist/lib/queries.js +1 -1
- package/dist/lib/studio-reads.d.ts +1 -0
- package/dist/lib/studio-reads.js +5 -0
- package/dist/lib/use-thread.js +156 -190
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/skills/camox/SKILL.md +3 -10
- package/skills/camox/references/artifacts.md +2 -2
- package/skills/camox/references/block-definitions.md +1 -1
- package/skills/camox/references/layout-definitions.md +1 -1
- package/skills/camox/references/routed-layouts.md +2 -2
- package/skills/camox-cli/SKILL.md +15 -0
- package/skills/{camox → camox-cli}/references/cli-common.md +1 -1
- package/skills/{camox → camox-cli}/references/cli-content.md +2 -2
- package/skills/{camox → camox-cli}/references/cli-publishing.md +4 -4
- package/skills/camox-expand/SKILL.md +1 -1
- package/skills/camoxify/SKILL.md +1 -1
- package/dist/features/studio/components/ChatSidebar.js +0 -346
|
@@ -29,7 +29,7 @@ import { CanvasPageHeader } from "./CanvasPageHeader.js";
|
|
|
29
29
|
import { CanvasPreviewPageSlot } from "./CanvasPreviewPageSlot.js";
|
|
30
30
|
import { CANVAS_WORLD_TRANSFORM, canvasScreenAbove, canvasScreenLength, canvasScreenX } from "./canvasScreenSpace.js";
|
|
31
31
|
import { selectedCanvasPage } from "./canvasSelection.js";
|
|
32
|
-
import {
|
|
32
|
+
import { ContentSidebar } from "./sidebar/ContentSidebar.js";
|
|
33
33
|
import { useCanvasCamera } from "./useCanvasCamera.js";
|
|
34
34
|
import { useCanvasNearness } from "./useCanvasNearness.js";
|
|
35
35
|
import { useDiscoveredPreviewPaths } from "./useDiscoveredPreviewPaths.js";
|
|
@@ -42,7 +42,7 @@ import { createStore as createStore$1 } from "@xstate/store";
|
|
|
42
42
|
|
|
43
43
|
//#region src/features/canvas/CamoxCanvas.tsx
|
|
44
44
|
/**
|
|
45
|
-
* The Canvas spans the studio under its sidebars, the
|
|
45
|
+
* The Canvas spans the studio under its sidebars, the Content Sidebar on its left and the Agent Sidebar on
|
|
46
46
|
* its right: the camera frames and snaps Pages between them, and above the studio's bottom edge.
|
|
47
47
|
*/
|
|
48
48
|
const CANVAS_INSETS = {
|
|
@@ -459,10 +459,10 @@ function CanvasPageFrameLoader(t0) {
|
|
|
459
459
|
return t2;
|
|
460
460
|
}
|
|
461
461
|
/**
|
|
462
|
-
*
|
|
463
|
-
*
|
|
462
|
+
* Where a sidebar's scrim starts fading, in px from the studio's edge: past the sidebar's outer
|
|
463
|
+
* gutter (`SIDEBAR_GUTTER`), so it fades across the whole of the sidebar's contents.
|
|
464
464
|
*/
|
|
465
|
-
const
|
|
465
|
+
const SCRIM_FADE_START = 8;
|
|
466
466
|
/** How opaque the scrim gets at most: what's under it always shows through, faintly. */
|
|
467
467
|
const SCRIM_MAX_OPACITY = .8;
|
|
468
468
|
/** Opacity along the fade, relative to the most, eased so it leaves no visible edge where it ends. */
|
|
@@ -477,11 +477,14 @@ const SCRIM_EASING = [
|
|
|
477
477
|
.05,
|
|
478
478
|
0
|
|
479
479
|
];
|
|
480
|
-
/**
|
|
480
|
+
/**
|
|
481
|
+
* Fades what the Canvas shows around a sidebar into the Canvas's background, toward the sidebar:
|
|
482
|
+
* from nothing past a snapped Page's edge, to the most only at the sidebar's outer gutter.
|
|
483
|
+
*/
|
|
481
484
|
function scrimGradient(towards, inset) {
|
|
482
|
-
const from =
|
|
483
|
-
const length =
|
|
484
|
-
const stops = SCRIM_EASING.map((alpha, index) => `color-mix(in oklab, var(--color-
|
|
485
|
+
const from = SCRIM_FADE_START;
|
|
486
|
+
const length = inset + 16 - SCRIM_FADE_START;
|
|
487
|
+
const stops = SCRIM_EASING.map((alpha, index) => `color-mix(in oklab, var(--color-canvas) ${alpha * SCRIM_MAX_OPACITY * 100}%, transparent) ${from + length * index / (SCRIM_EASING.length - 1)}px`);
|
|
485
488
|
return `linear-gradient(to ${towards === "left" ? "right" : "left"}, ${stops.join(", ")})`;
|
|
486
489
|
}
|
|
487
490
|
/** A frame header above an item's slot, at a constant on-screen height. */
|
|
@@ -1049,7 +1052,7 @@ function CanvasWorkspace(t0) {
|
|
|
1049
1052
|
"aria-describedby": instructionsId,
|
|
1050
1053
|
tabIndex: 0,
|
|
1051
1054
|
"data-camox-canvas": true,
|
|
1052
|
-
className: "bg-
|
|
1055
|
+
className: "bg-canvas relative min-h-0 min-w-0 flex-1 touch-none overflow-clip outline-none *:*:[--canvas-x:initial] *:*:[--canvas-y:initial] data-[canvas-pan]:cursor-grab data-[canvas-pan]:**:cursor-[inherit]! data-[canvas-pan=dragging]:cursor-grabbing data-[canvas-pan]:[&_iframe]:pointer-events-none",
|
|
1053
1056
|
style: t13,
|
|
1054
1057
|
children: [
|
|
1055
1058
|
/* @__PURE__ */ jsx(CanvasWorkspaceContext, {
|
|
@@ -1305,7 +1308,7 @@ function CamoxCanvas(t0) {
|
|
|
1305
1308
|
} else t17 = $[37];
|
|
1306
1309
|
let t18;
|
|
1307
1310
|
if ($[38] !== editingOwner || $[39] !== intendedPage || $[40] !== pageRecord || $[41] !== runtimeBasePath || $[42] !== t16) {
|
|
1308
|
-
t18 = /* @__PURE__ */ jsx(
|
|
1311
|
+
t18 = /* @__PURE__ */ jsx(ContentSidebar, {
|
|
1309
1312
|
page: intendedPage,
|
|
1310
1313
|
navigator: t16,
|
|
1311
1314
|
onShowWholeCanvas: t17,
|
|
@@ -26,7 +26,7 @@ function CanvasLoadingScreen(t0) {
|
|
|
26
26
|
if ($[3] !== t2) {
|
|
27
27
|
t3 = /* @__PURE__ */ jsx("div", {
|
|
28
28
|
"data-canvas-loading": true,
|
|
29
|
-
className: "bg-
|
|
29
|
+
className: "bg-canvas absolute inset-0 grid place-items-center",
|
|
30
30
|
children: t2
|
|
31
31
|
});
|
|
32
32
|
$[3] = t2;
|
|
@@ -39,7 +39,7 @@ function CanvasPageHeader({ page, pathname, selected, onSelect, onHoverChange, o
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
const path = pathname ?? (page.kind === "derived" ? page.pattern : void 0);
|
|
42
|
-
const pathClassName = "text-muted-foreground w-full min-w-0 truncate text-left text-xs font-normal";
|
|
42
|
+
const pathClassName = "text-muted-foreground max-w-full min-w-0 truncate text-left text-xs font-normal";
|
|
43
43
|
const focusClassName = "focus-visible:ring-ring outline-none focus-visible:ring-2";
|
|
44
44
|
const name = draft !== null ? /* @__PURE__ */ jsx("input", {
|
|
45
45
|
"aria-label": "Page nickname",
|
|
@@ -4,6 +4,16 @@ import { EMPTY_PREVIEW_DOCUMENT, isSiteStyle } from "../preview/components/previ
|
|
|
4
4
|
//#region src/features/canvas/canvasFrameDocument.ts
|
|
5
5
|
/** Freezes CSS animations, including ones that start while the frame is paused. */
|
|
6
6
|
const PAUSED_ANIMATIONS_STYLE = `html[${PREVIEW_PAUSED_ATTRIBUTE}] *, html[${PREVIEW_PAUSED_ATTRIBUTE}] *::before, html[${PREVIEW_PAUSED_ATTRIBUTE}] *::after { animation-play-state: paused !important; }`;
|
|
7
|
+
/**
|
|
8
|
+
* A style of the studio's own for a frame's document, marked so that giving the frame a site
|
|
9
|
+
* document's stylesheets (`restyle`) leaves it.
|
|
10
|
+
*/
|
|
11
|
+
function studioStyle(doc, css) {
|
|
12
|
+
const style = doc.createElement("style");
|
|
13
|
+
style.setAttribute("data-camox-studio", "");
|
|
14
|
+
style.textContent = css;
|
|
15
|
+
return style;
|
|
16
|
+
}
|
|
7
17
|
/** Set by the camera on elements that hold Canvas frames: see `canvasBlockOverlap`. */
|
|
8
18
|
const BLOCK_OVERLAP_ATTRIBUTE = "data-canvas-block-overlap";
|
|
9
19
|
const BLOCK = "[data-camox-viewport-block]";
|
|
@@ -93,8 +103,7 @@ function createCanvasDocument(previewDocument, href) {
|
|
|
93
103
|
doc.querySelector("[data-camox-preview-root]")?.replaceChildren();
|
|
94
104
|
doc.documentElement.style.setProperty("overscroll-behavior", "none");
|
|
95
105
|
doc.body.style.setProperty("overscroll-behavior", "none");
|
|
96
|
-
const paused = doc
|
|
97
|
-
paused.textContent = PAUSED_ANIMATIONS_STYLE;
|
|
106
|
+
const paused = studioStyle(doc, PAUSED_ANIMATIONS_STYLE);
|
|
98
107
|
doc.head.appendChild(paused);
|
|
99
108
|
return `<!doctype html>${doc.documentElement.outerHTML}`;
|
|
100
109
|
}
|
|
@@ -106,8 +115,7 @@ function createCanvasDocument(previewDocument, href) {
|
|
|
106
115
|
*/
|
|
107
116
|
function adoptCanvasDocument(iframe, root, viewportHeight) {
|
|
108
117
|
const doc = root.ownerDocument;
|
|
109
|
-
const paused = doc
|
|
110
|
-
paused.textContent = PAUSED_ANIMATIONS_STYLE;
|
|
118
|
+
const paused = studioStyle(doc, PAUSED_ANIMATIONS_STYLE);
|
|
111
119
|
doc.head.appendChild(paused);
|
|
112
120
|
const restored = [doc.documentElement, doc.body].map((element) => ({
|
|
113
121
|
element,
|
|
@@ -199,8 +207,7 @@ function observeCanvasDocument(iframe, root, viewportHeight, suspended = () => f
|
|
|
199
207
|
doc.documentElement.style.setProperty("--camox-viewport-height", `${baseline}px`);
|
|
200
208
|
doc.documentElement.style.setProperty("overflow", "hidden", "important");
|
|
201
209
|
doc.body.style.setProperty("overflow", "hidden", "important");
|
|
202
|
-
const overlapStyle = doc
|
|
203
|
-
overlapStyle.textContent = BLOCK_OVERLAP_STYLE;
|
|
210
|
+
const overlapStyle = studioStyle(doc, BLOCK_OVERLAP_STYLE);
|
|
204
211
|
doc.head.appendChild(overlapStyle);
|
|
205
212
|
const followOverlap = () => {
|
|
206
213
|
const overlap = iframe.closest(`[${BLOCK_OVERLAP_ATTRIBUTE}]`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SidebarStackHeader, useSelectionViewCount } from "../../preview/components/SidebarStack.js";
|
|
2
|
-
import { SHOW_WHOLE_CANVAS_SHORTCUT } from "../../preview/previewConstants.js";
|
|
3
2
|
import { formatShortcut } from "../../../lib/shortcuts.js";
|
|
3
|
+
import { SHOW_WHOLE_CANVAS_SHORTCUT } from "../../preview/previewConstants.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { SidebarStack, SidebarStackView } from "../../preview/components/SidebarStack.js";
|
|
2
|
-
import { CanvasSidebarFrame } from "./CanvasSidebarFrame.js";
|
|
3
2
|
import { CanvasViewHeader } from "./CanvasViewHeader.js";
|
|
3
|
+
import { ContentSidebarFrame } from "./ContentSidebarFrame.js";
|
|
4
4
|
import { CreatePageModal } from "../../preview/components/CreatePageModal.js";
|
|
5
5
|
import { CanvasNavigator } from "./CanvasNavigator.js";
|
|
6
6
|
import { PageInspector } from "./PageInspector.js";
|
|
7
7
|
import { c } from "react/compiler-runtime";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
|
|
10
|
-
//#region src/features/canvas/sidebar/
|
|
10
|
+
//#region src/features/canvas/sidebar/ContentSidebar.tsx
|
|
11
11
|
/**
|
|
12
12
|
* The sidebar beside the Canvas, a stack of views: the Canvas's own, which shows the Canvas
|
|
13
13
|
* Navigator, then the Canvas Inspector of the selected Page laid over it, if any.
|
|
14
14
|
*/
|
|
15
|
-
function
|
|
15
|
+
function ContentSidebar(t0) {
|
|
16
16
|
const $ = c(16);
|
|
17
17
|
const { page, navigator, onShowWholeCanvas, owner: t1, pageRecord, runtimeBasePath } = t0;
|
|
18
18
|
const owner = t1 === void 0 ? null : t1;
|
|
@@ -61,7 +61,7 @@ function CanvasSidebar(t0) {
|
|
|
61
61
|
} else t7 = $[12];
|
|
62
62
|
let t8;
|
|
63
63
|
if ($[13] !== t2 || $[14] !== t6) {
|
|
64
|
-
t8 = /* @__PURE__ */ jsxs(
|
|
64
|
+
t8 = /* @__PURE__ */ jsxs(ContentSidebarFrame, {
|
|
65
65
|
label: t2,
|
|
66
66
|
children: [t6, t7]
|
|
67
67
|
});
|
|
@@ -73,4 +73,4 @@ function CanvasSidebar(t0) {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
//#endregion
|
|
76
|
-
export {
|
|
76
|
+
export { ContentSidebar };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { c } from "react/compiler-runtime";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
|
|
4
|
-
//#region src/features/canvas/sidebar/
|
|
4
|
+
//#region src/features/canvas/sidebar/ContentSidebarFrame.tsx
|
|
5
5
|
/**
|
|
6
|
-
* The
|
|
6
|
+
* The Content Sidebar's own box, laid over the Canvas's left side: the Canvas Navigator or the
|
|
7
7
|
* Canvas Inspector, or a stand-in for either, goes in it. Only its cards have a background:
|
|
8
8
|
* around them, the Canvas shows through.
|
|
9
9
|
*/
|
|
10
|
-
function
|
|
10
|
+
function ContentSidebarFrame(t0) {
|
|
11
11
|
const $ = c(9);
|
|
12
12
|
let children;
|
|
13
13
|
let label;
|
|
@@ -46,4 +46,4 @@ function CanvasSidebarFrame(t0) {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
//#endregion
|
|
49
|
-
export {
|
|
49
|
+
export { ContentSidebarFrame };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { SidebarStack, SidebarStackView } from "../../preview/components/SidebarStack.js";
|
|
2
2
|
import { CanvasInspectorBody, CanvasInspectorHeaderSkeleton } from "./CanvasInspector.js";
|
|
3
|
-
import { CanvasSidebarFrame } from "./CanvasSidebarFrame.js";
|
|
4
3
|
import { CanvasViewHeader } from "./CanvasViewHeader.js";
|
|
4
|
+
import { ContentSidebarFrame } from "./ContentSidebarFrame.js";
|
|
5
5
|
import { CuratedPageSkeleton, LayoutPageSkeleton } from "./PageInspectorSkeleton.js";
|
|
6
6
|
import { c } from "react/compiler-runtime";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
|
|
9
|
-
//#region src/features/canvas/sidebar/
|
|
9
|
+
//#region src/features/canvas/sidebar/ContentSidebarSkeleton.tsx
|
|
10
10
|
/**
|
|
11
|
-
* Stands in for the
|
|
11
|
+
* Stands in for the Content Sidebar while the Canvas loads, where the sidebar will show. For a
|
|
12
12
|
* selected Page, it takes the Canvas Inspector's layout. Without one, it is empty.
|
|
13
13
|
*/
|
|
14
|
-
function
|
|
14
|
+
function ContentSidebarSkeleton(t0) {
|
|
15
15
|
const $ = c(5);
|
|
16
16
|
const { page: t1, layoutPage: t2 } = t0;
|
|
17
17
|
const page = t1 === void 0 ? true : t1;
|
|
@@ -33,8 +33,8 @@ function CanvasSidebarSkeleton(t0) {
|
|
|
33
33
|
} else t3 = $[2];
|
|
34
34
|
let t4;
|
|
35
35
|
if ($[3] !== t3) {
|
|
36
|
-
t4 = /* @__PURE__ */ jsx(
|
|
37
|
-
"data-
|
|
36
|
+
t4 = /* @__PURE__ */ jsx(ContentSidebarFrame, {
|
|
37
|
+
"data-content-sidebar-skeleton": true,
|
|
38
38
|
children: t3
|
|
39
39
|
});
|
|
40
40
|
$[3] = t3;
|
|
@@ -44,4 +44,4 @@ function CanvasSidebarSkeleton(t0) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
//#endregion
|
|
47
|
-
export {
|
|
47
|
+
export { ContentSidebarSkeleton };
|
|
@@ -14,7 +14,7 @@ import { CanvasLoadingScreen } from "../canvas/CanvasLoadingScreen.js";
|
|
|
14
14
|
import { canvasStore } from "../canvas/canvasStore.js";
|
|
15
15
|
import { previewStore, selectIsCanvasShown } from "./previewStore.js";
|
|
16
16
|
import { SHOW_WHOLE_CANVAS_SHORTCUT, TOGGLE_CANVAS_SHORTCUT } from "./previewConstants.js";
|
|
17
|
-
import {
|
|
17
|
+
import { ContentSidebarSkeleton } from "../canvas/sidebar/ContentSidebarSkeleton.js";
|
|
18
18
|
import { takeShowCanvasRequest } from "../provider/signInShortcut.js";
|
|
19
19
|
import { PreviewEditingOwnerContext } from "./previewSelection.js";
|
|
20
20
|
import { RendererFramesProvider, RendererSlot, useRendererHost, useRendererStatus } from "../renderer/RendererFrames.js";
|
|
@@ -577,7 +577,7 @@ const PreviewShell = (t0) => {
|
|
|
577
577
|
const t14 = !!derivedLayout;
|
|
578
578
|
let t15;
|
|
579
579
|
if ($[20] !== t13 || $[21] !== t14) {
|
|
580
|
-
t15 = /* @__PURE__ */ jsx(
|
|
580
|
+
t15 = /* @__PURE__ */ jsx(ContentSidebarSkeleton, {
|
|
581
581
|
page: t13,
|
|
582
582
|
layoutPage: t14
|
|
583
583
|
});
|
|
@@ -5,7 +5,7 @@ import { PageViewportContext } from "../../runtime/pageViewport.js";
|
|
|
5
5
|
import { PreviewDocumentContext } from "../../runtime/PreviewDocumentContext.js";
|
|
6
6
|
import { ViewportContinuityContext, capturePreviewAnchor, restorePreviewAnchor } from "../viewportContinuity.js";
|
|
7
7
|
import { PreviewActivationContext } from "./PreviewActivation.js";
|
|
8
|
-
import { EMPTY_PREVIEW_DOCUMENT, isSiteStyle } from "./previewStyles.js";
|
|
8
|
+
import { EMPTY_PREVIEW_DOCUMENT, isSiteStyle, restyle } from "./previewStyles.js";
|
|
9
9
|
import { c } from "react/compiler-runtime";
|
|
10
10
|
import * as React from "react";
|
|
11
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -21,23 +21,6 @@ function useFrame() {
|
|
|
21
21
|
if (!context) throw new Error("useFrame must be used within a Frame");
|
|
22
22
|
return context;
|
|
23
23
|
}
|
|
24
|
-
/** The stylesheets of a document's head that are the site's: not the studio's. */
|
|
25
|
-
const SITE_STYLESHEETS = "link[rel~=\"stylesheet\"], style";
|
|
26
|
-
const siteStylesheetsOf = (head) => Array.from(head.querySelectorAll(SITE_STYLESHEETS)).filter((element) => element.parentElement === head && isSiteStyle(element));
|
|
27
|
-
/**
|
|
28
|
-
* Gives the frame's document the site stylesheets of `html`, a site document: the ones it no
|
|
29
|
-
* longer has go, and its new ones are added, the rest of the frame left as it is.
|
|
30
|
-
*/
|
|
31
|
-
function restyle(frame, html) {
|
|
32
|
-
const doc = frame.document;
|
|
33
|
-
const { DOMParser } = frame;
|
|
34
|
-
const wanted = siteStylesheetsOf(new DOMParser().parseFromString(html, "text/html").head);
|
|
35
|
-
const held = siteStylesheetsOf(doc.head);
|
|
36
|
-
const wantedMarkup = new Set(wanted.map((element) => element.outerHTML));
|
|
37
|
-
const heldMarkup = new Set(held.map((element) => element.outerHTML));
|
|
38
|
-
for (const element of held) if (!wantedMarkup.has(element.outerHTML)) element.remove();
|
|
39
|
-
for (const element of wanted) if (!heldMarkup.has(element.outerHTML)) doc.head.appendChild(doc.importNode(element, true));
|
|
40
|
-
}
|
|
41
24
|
function ClearServerMarkup(t0) {
|
|
42
25
|
const $ = c(4);
|
|
43
26
|
const { nodes } = t0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { previewStore, selectIsCanvasShown } from "../previewStore.js";
|
|
2
|
-
import { TOGGLE_CANVAS_SHORTCUT } from "../previewConstants.js";
|
|
3
2
|
import { formatShortcut } from "../../../lib/shortcuts.js";
|
|
3
|
+
import { TOGGLE_CANVAS_SHORTCUT } from "../previewConstants.js";
|
|
4
4
|
import { prefetchCanvas } from "./CanvasPreview.js";
|
|
5
5
|
import { DeviceSelector } from "../../../components/DeviceSelector.js";
|
|
6
6
|
import { c } from "react/compiler-runtime";
|
|
@@ -35,7 +35,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@
|
|
|
35
35
|
//#region src/features/preview/components/SelectionEditor.tsx
|
|
36
36
|
const EMPTY_CONTENT = {};
|
|
37
37
|
/**
|
|
38
|
-
* The path's headers. The `kept` first steps
|
|
38
|
+
* The path's headers. The `kept` first steps and the selection always show; two or
|
|
39
39
|
* more steps between them collapse into one header, which lists them.
|
|
40
40
|
*/
|
|
41
41
|
function stackRows(items, kept) {
|
|
@@ -43,7 +43,7 @@ function stackRows(items, kept) {
|
|
|
43
43
|
index,
|
|
44
44
|
item
|
|
45
45
|
}));
|
|
46
|
-
const between = items.slice(kept, -
|
|
46
|
+
const between = items.slice(kept, -1);
|
|
47
47
|
if (between.length < 2) return rows;
|
|
48
48
|
return [
|
|
49
49
|
...rows.slice(0, kept),
|