@histoire/app 1.0.0-beta.2 → 1.0.0-beta.3
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/app/style/theme.css +8 -0
- package/dist/bundled/app.css +2 -2
- package/dist/bundled/chunks/{AboutSection-D3IIVsiV.js → AboutSection-mX7J6xrz.js} +2 -2
- package/dist/bundled/chunks/{AgentCursor-Cg5SLa2H.js → AgentCursor-DcVxonMC.js} +2 -2
- package/dist/bundled/chunks/{AgentPlanApproval-D4hnGlYs.js → AgentPlanApproval-22I_Lbhn.js} +1 -1
- package/dist/bundled/chunks/{AgentsSection-CJGS9C2q.js → AgentsSection-DWmUKCX-.js} +1 -1
- package/dist/bundled/chunks/{AiPanel-B9QWRuSg.js → AiPanel-BICtbtCE.js} +4 -4
- package/dist/bundled/chunks/{AppearanceSection-DMjmDr1Y.js → AppearanceSection-maVgcfMk.js} +6 -6
- package/dist/bundled/chunks/{BasePopover-CQQ8wKev.js → BasePopover-B3Y5H1gd.js} +1 -1
- package/dist/bundled/chunks/{CommentsCanvasOverlay-UX-oYgnx.js → CommentsCanvasOverlay-DhqtbJNX.js} +5 -5
- package/dist/bundled/chunks/{DevBrowseStatus-D2rIG8uC.js → DevBrowseStatus-B6cLRu19.js} +2 -2
- package/dist/bundled/chunks/{DocsTab-BR3BktyF.js → DocsTab-PpFKAC6Q.js} +4 -4
- package/dist/bundled/chunks/{EventsTab-BP0hCGqL.js → EventsTab-DLVYcX1N.js} +3 -3
- package/dist/bundled/chunks/{GeneralSection-CT_-32qT.js → GeneralSection-dvmJUgqN.js} +1 -1
- package/dist/bundled/chunks/{InspectionPanel-C6kUdJj9.js → InspectionPanel-DDuT3guJ.js} +2 -2
- package/dist/bundled/chunks/{InspectorGuideLink-Bqlz1aaY.js → InspectorGuideLink-7Ui_Y2Wd.js} +1 -1
- package/dist/bundled/chunks/{MarkdownPage-DD7XyGkq.js → MarkdownPage-D_LpsCvG.js} +3 -3
- package/dist/bundled/chunks/{MarketplaceUpdateBody-B1cn_zeo.js → MarketplaceUpdateBody-BtLPpA7F.js} +2 -2
- package/dist/bundled/chunks/{MarketplaceView-eDPLtc_x.js → MarketplaceView-C1sVFRsq.js} +39 -10
- package/dist/bundled/chunks/{MatrixInspector-eIr_N5eH.js → MatrixInspector-wqkJJnuf.js} +3 -3
- package/dist/bundled/chunks/{MatrixView-CDmN-Kl9.js → MatrixView-D-Snu47M.js} +82 -40
- package/dist/bundled/chunks/{MatrixVisualActions-Cx3QzDTD.js → MatrixVisualActions-D3b-cp7N.js} +2 -2
- package/dist/bundled/chunks/{McpActivity-CiK3jUTY.js → McpActivity-r2CFr-ny.js} +1 -1
- package/dist/bundled/chunks/{McpSection-DRGzPGXO.js → McpSection-swh7qlM0.js} +1 -1
- package/dist/bundled/chunks/{NeedsAttention-C5zjd6RT.js → NeedsAttention-Cf6ihlT0.js} +2 -2
- package/dist/bundled/chunks/{PermissionPrompt-i5VbZCCJ.js → PermissionPrompt-CXTPfiIu.js} +1 -1
- package/dist/bundled/chunks/{PluginsSection-B3ZWAjrk.js → PluginsSection-Dhv2haa3.js} +6 -3
- package/dist/bundled/chunks/{ScreenshotPopover-DWcV_NAf.js → ScreenshotPopover-BZ37-dfK.js} +4 -4
- package/dist/bundled/chunks/{SettingsPage-BvT1FOl7.js → SettingsPage-D6ZOAgS9.js} +11 -11
- package/dist/bundled/chunks/{ShortcutsSection-D3-4e5Ug.js → ShortcutsSection-EK2-e56v.js} +1 -1
- package/dist/bundled/chunks/{StoryInspector-BJKzoeHc.js → StoryInspector-DCNgw0x8.js} +14 -11
- package/dist/bundled/chunks/{TestsPanel-CpBld3wM.js → TestsPanel-D1USqA8I.js} +5 -5
- package/dist/bundled/chunks/{TestsSection-CEXW49Ge.js → TestsSection-CIkkHlyK.js} +1 -1
- package/dist/bundled/chunks/{TestsTab-B-ZNDgGi.js → TestsTab-ykf9zwmG.js} +3 -3
- package/dist/bundled/chunks/{ThreadMessage-CPRLVXXQ.js → ThreadMessage-DxrvoIea.js} +5 -5
- package/dist/bundled/chunks/{ToolbarPopover-Nd-us4Fg.js → ToolbarPopover-CXizdbQq.js} +3 -3
- package/dist/bundled/chunks/{ViewportsSection-3EWu6WSc.js → ViewportsSection-D6mpKTSM.js} +1 -1
- package/dist/bundled/chunks/{VisualViewer-DV5mNFT8.js → VisualViewer-BQqfw1ov.js} +2 -2
- package/dist/bundled/chunks/{WorkbenchPanelAction-Cl68QrDs.js → WorkbenchPanelAction-SLby10Vh.js} +6 -2
- package/dist/bundled/chunks/{WorkbenchVirtualList-CUTamRgO.js → WorkbenchVirtualList-HCZiNo7p.js} +1 -1
- package/dist/bundled/chunks/{background-CG5-SPiv.js → background-CUUIkZVL.js} +7 -1
- package/dist/bundled/chunks/{canvas-settings-EP62RnvB.js → canvas-settings-Cw7AXzFG.js} +31 -13
- package/dist/bundled/chunks/{capture-SFV9pF9b.js → capture-DxD6llwl.js} +1 -1
- package/dist/bundled/chunks/{color-scheme-mhmCnofm.js → color-scheme-zLURTKoT.js} +1 -0
- package/dist/bundled/chunks/{content-view-Bpn8As7f.js → content-view-ChEpdsxh.js} +2 -2
- package/dist/bundled/chunks/{controls-view-COcHf8Pm.js → controls-view-CtDADD0e.js} +3 -3
- package/dist/bundled/chunks/{explorer-view-5gTgnjcf.js → explorer-view-B717fDtg.js} +6 -4
- package/dist/bundled/chunks/{extensions-DUXM9uEy.js → extensions-BtOjYv3e.js} +11 -2
- package/dist/bundled/chunks/{frame-ledger-BHZ0nJjD.js → frame-ledger-C67dpCuY.js} +160 -45
- package/dist/bundled/chunks/{frame-screenshot-D9R_xDns.js → frame-screenshot-IEmQR7TR.js} +1 -1
- package/dist/bundled/chunks/{icons-Bd36WZPu.js → icons-DoUVE4X3.js} +2 -2
- package/dist/bundled/chunks/{local-mount-CCa2jcqi.js → local-mount-CQ14I_16.js} +2 -1
- package/dist/bundled/chunks/{marketplace-DKeNfni-.js → marketplace-BE5IMmf3.js} +9 -3
- package/dist/bundled/chunks/{measurement-DfNeNMZe.js → measurement-BPE7RMeb.js} +1 -1
- package/dist/bundled/chunks/{model-DhvdMZzS.js → model-CIFxQfDH.js} +1 -1
- package/dist/bundled/chunks/{navigation-view-GU5-aPWL.js → navigation-view-Co43QbrR.js} +2 -2
- package/dist/bundled/chunks/{ownership-004rrffQ.js → ownership-BVQ3d672.js} +1 -1
- package/dist/bundled/chunks/{selection-DQJWdqhl.js → selection-BTc1fRMu.js} +1 -1
- package/dist/bundled/chunks/{settings-DC0gilMg.js → settings-BbefKI5N.js} +1 -1
- package/dist/bundled/chunks/{src-BazVZNon.js → src-CDZfcmuw.js} +7 -1
- package/dist/bundled/chunks/{tests-view-B9J9Gvpt.js → tests-view-RYpujVD_.js} +2 -2
- package/dist/bundled/chunks/{use-install-plan-ChZg4Xyq.js → use-install-plan-D0tiW2wu.js} +1 -1
- package/dist/bundled/chunks/{visual-CId9zv09.js → visual-nnXRPOP8.js} +1 -1
- package/dist/bundled/index.js +580 -313
- package/dist/embed/EmbedDocument.vue_vue_type_script_setup_true_lang.js +6 -1
- package/dist/embed/adapters/explorer-session.js +2 -1
- package/dist/embed/adapters/explorer-view.js +1 -0
- package/dist/embed/adapters/local-mount.js +2 -1
- package/dist/embed/adapters/runtime-frame.js +7 -1
- package/dist/embed/adapters/sandbox-urls.d.ts +2 -0
- package/dist/embed/adapters/sandbox-urls.js +1 -0
- package/dist/embed/app.css +2 -2
- package/dist/embed/handshake.js +5 -2
- package/dist/embed/packages/histoire-vue/src/components/embed/HistoireEmbed.js +6 -0
- package/dist/embed/packages/histoire-vue/src/components/preview/surface.js +11 -2
- package/dist/embed/surfaces.d.ts +2 -0
- package/dist/style.css +57 -13
- package/package.json +8 -8
- package/src/app/components/base/overflow/BaseOverflowToolbar.vue +1 -1
- package/src/app/components/base/overflow/BaseOverflowToolbarItem.vue +1 -1
- package/src/app/components/base/popover/BasePopover.vue +1 -1
- package/src/app/components/canvas/CanvasFrame.vue +47 -8
- package/src/app/components/canvas/CanvasReplicaPreview.vue +3 -1
- package/src/app/components/canvas/CanvasSingleVariant.vue +10 -5
- package/src/app/components/canvas/CanvasStatus.vue +6 -2
- package/src/app/components/canvas/CanvasViewport.vue +29 -10
- package/src/app/components/canvas/FramePaddingAligners.vue +44 -0
- package/src/app/components/canvas/SingleVariantResizeHandles.vue +3 -0
- package/src/app/components/canvas/frame-layout.ts +44 -23
- package/src/app/components/canvas/frame-props-override.ts +16 -2
- package/src/app/components/canvas/matrix/MatrixCell.vue +19 -6
- package/src/app/components/canvas/matrix/MatrixView.vue +10 -8
- package/src/app/components/canvas/matrix/matrix-layout.ts +32 -14
- package/src/app/components/canvas/matrix/matrix-registration.ts +4 -4
- package/src/app/components/canvas/single-resize.ts +4 -2
- package/src/app/components/canvas/single-viewport.ts +5 -0
- package/src/app/components/canvas/story-frame-size.ts +15 -0
- package/src/app/components/canvas/toolbar/ArrangeSwitch.vue +1 -1
- package/src/app/components/canvas/toolbar/CanvasToolbar.vue +1 -1
- package/src/app/components/canvas/toolbar/SearchMatchStepper.vue +1 -1
- package/src/app/components/canvas/toolbar/ToolSwitch.vue +1 -1
- package/src/app/components/canvas/toolbar/ViewportMenu.vue +46 -16
- package/src/app/components/canvas/toolbar/ZoomMenu.vue +13 -11
- package/src/app/components/canvas/toolbar/viewport-size.ts +14 -0
- package/src/app/components/canvas/useCanvasVariantSize.ts +24 -6
- package/src/app/components/canvas/useSingleVariantGeometry.ts +7 -4
- package/src/app/components/comments/prompt/AttachMenuPanel.vue +1 -1
- package/src/app/components/comments/prompt/PromptSuggestions.vue +1 -1
- package/src/app/components/embed/EmbedMenu.vue +8 -6
- package/src/app/components/inspector/InspectorTabs.vue +1 -1
- package/src/app/components/inspector/inspection/plugin.ts +1 -1
- package/src/app/components/marketplace/browse/CatalogState.vue +3 -0
- package/src/app/components/marketplace/detail/DetailHeader.vue +13 -5
- package/src/app/components/marketplace/install/use-install-wizard.ts +7 -2
- package/src/app/components/menu/ContextMenu.vue +1 -1
- package/src/app/components/menu/SubMenu.vue +1 -1
- package/src/app/components/pages/settings/PluginsSection.vue +4 -0
- package/src/app/components/pages/settings/plugins/use-plugin-updates.ts +3 -3
- package/src/app/components/shell/WorkbenchApp.vue +2 -2
- package/src/app/components/shell/WorkbenchPanelAction.vue +5 -3
- package/src/app/composables/canvas-settings.ts +23 -9
- package/src/app/standalone/workbench.ts +2 -0
- package/src/app/stores/canvas.ts +47 -7
- package/src/app/stores/marketplace.ts +1 -0
- package/src/app/stores/story-canvas-views.ts +15 -2
- package/src/app/style/theme.css +8 -0
- package/src/app/util/background.ts +7 -0
- package/src/app/util/frame-actions.ts +6 -0
- package/src/app/util/marketplace-client.ts +5 -2
- package/src/embed/EmbedDocument.vue +1 -1
- package/src/embed/adapters/explorer-session.ts +2 -2
- package/src/embed/adapters/explorer-view.ts +1 -1
- package/src/embed/adapters/local-mount.ts +1 -1
- package/src/embed/adapters/runtime-frame.ts +6 -1
- package/src/embed/adapters/sandbox-urls.ts +3 -0
- package/src/embed/handshake.ts +4 -2
- package/src/embed/surfaces.ts +2 -0
package/dist/bundled/chunks/{WorkbenchPanelAction-Cl68QrDs.js → WorkbenchPanelAction-SLby10Vh.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as HstButton, t as BuiltinIcon } from "./controls-DpdwHd4q.js";
|
|
2
|
-
import { l as useMenuKeyboard, t as BasePopover_default } from "./BasePopover-
|
|
2
|
+
import { l as useMenuKeyboard, t as BasePopover_default } from "./BasePopover-B3Y5H1gd.js";
|
|
3
3
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderSlot, shallowRef, toDisplayString, unref, withCtx } from "@histoire/vendors/vue";
|
|
4
4
|
// src/app/components/shell/WorkbenchPanelAction.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var _hoisted_1 = { class: "htw:inline-flex htw:flex-none htw:gap-px htw:[--histoire-icon-button-size:var(--histoire-control-height,34px)]" };
|
|
@@ -10,6 +10,10 @@ var WorkbenchPanelAction_default = /* @__PURE__ */ defineComponent({
|
|
|
10
10
|
icon: {},
|
|
11
11
|
label: {},
|
|
12
12
|
disabled: { type: Boolean },
|
|
13
|
+
menuDisabled: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: void 0
|
|
16
|
+
},
|
|
13
17
|
menuLabel: {},
|
|
14
18
|
menuWidth: {}
|
|
15
19
|
},
|
|
@@ -52,7 +56,7 @@ var WorkbenchPanelAction_default = /* @__PURE__ */ defineComponent({
|
|
|
52
56
|
"aria-label": resolvedMenuLabel.value,
|
|
53
57
|
"aria-haspopup": "menu",
|
|
54
58
|
"aria-expanded": open.value,
|
|
55
|
-
disabled: __props.disabled,
|
|
59
|
+
disabled: __props.menuDisabled ?? __props.disabled,
|
|
56
60
|
onClick: _cache[1] || (_cache[1] = ($event) => {
|
|
57
61
|
focusLast.value = false;
|
|
58
62
|
open.value = !open.value;
|
package/dist/bundled/chunks/{WorkbenchVirtualList-CUTamRgO.js → WorkbenchVirtualList-HCZiNo7p.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as HistoireVirtualList } from "./extensions-
|
|
1
|
+
import { _ as HistoireVirtualList } from "./extensions-BtOjYv3e.js";
|
|
2
2
|
import { a as useUiSettingsStore } from "./settings-B8QvkMcW.js";
|
|
3
3
|
import { computed, createBlock, createCommentVNode, defineComponent, mergeProps, openBlock, ref, renderSlot, unref, withCtx } from "@histoire/vendors/vue";
|
|
4
4
|
// src/app/composables/list-density.ts
|
|
@@ -33,6 +33,12 @@ function withCheckerboardPresets(configured) {
|
|
|
33
33
|
function getBackgroundPreset(settings) {
|
|
34
34
|
return settings.checkerboard ? checkerboards[settings.checkerboardTheme ?? "light"].color : settings.backgroundColor;
|
|
35
35
|
}
|
|
36
|
+
/** Readable color on a painted background; transparency shows the workbench, so it has none. */
|
|
37
|
+
function getBackgroundContrastColor(settings, presets) {
|
|
38
|
+
if (!settings.checkerboard && settings.backgroundColor === "transparent") return void 0;
|
|
39
|
+
const color = getBackgroundPreset(settings);
|
|
40
|
+
return withCheckerboardPresets(presets).find((preset) => preset.color === color)?.contrastColor;
|
|
41
|
+
}
|
|
36
42
|
/** Paint inspection tiles at displayed scale; transparency reveals canvas backing. */
|
|
37
43
|
function getBackgroundStyle(settings) {
|
|
38
44
|
if (!settings.checkerboard) return {
|
|
@@ -67,4 +73,4 @@ function getBackgroundPresetStyle(preset) {
|
|
|
67
73
|
function getBackgroundCapture(settings) {
|
|
68
74
|
return settings.checkerboard ? "$checkerboard" : settings.backgroundColor;
|
|
69
75
|
}
|
|
70
|
-
export {
|
|
76
|
+
export { getBackgroundPresetStyle as a, getBackgroundPreset as i, getBackgroundCapture as n, getBackgroundStyle as o, getBackgroundContrastColor as r, withCheckerboardPresets as s, checkerboardTheme as t };
|
|
@@ -1,11 +1,38 @@
|
|
|
1
|
-
import { j as useHistoireSnapshot } from "./extensions-
|
|
1
|
+
import { j as useHistoireSnapshot } from "./extensions-BtOjYv3e.js";
|
|
2
|
+
import { STORY_REMOUNT } from "@histoire/shared";
|
|
2
3
|
import { computed, inject, provide, shallowReactive } from "@histoire/vendors/vue";
|
|
3
4
|
// src/app/composables/canvas-settings.ts
|
|
4
5
|
/** Registry is independent per mounted canvas, including multiple native hosts. */
|
|
5
6
|
function createCanvasFrames(store) {
|
|
6
7
|
const frames = shallowReactive(/* @__PURE__ */ new Map());
|
|
8
|
+
/** Finite additive preview requests stay pinned to current same-origin document. */
|
|
9
|
+
function postToFrame(id, payload) {
|
|
10
|
+
const frame = frames.get(id);
|
|
11
|
+
if (!frame?.iframe?.contentWindow || !frame.documentId) return false;
|
|
12
|
+
const window = frame.iframe.ownerDocument.defaultView;
|
|
13
|
+
if (!window) return false;
|
|
14
|
+
frame.iframe.contentWindow.postMessage({
|
|
15
|
+
...payload,
|
|
16
|
+
__histoire: true,
|
|
17
|
+
documentId: frame.documentId
|
|
18
|
+
}, window.location.origin);
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
/** Replay the rendered variant's mount lifecycle without reloading its document. */
|
|
22
|
+
function remountFrame(id) {
|
|
23
|
+
const frame = frames.get(id);
|
|
24
|
+
if (!frame || !postToFrame(id, {
|
|
25
|
+
type: STORY_REMOUNT,
|
|
26
|
+
storyId: frame.storyId,
|
|
27
|
+
variantId: frame.variantId
|
|
28
|
+
})) return false;
|
|
29
|
+
frame.remounts = (frame.remounts ?? 0) + 1;
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
7
32
|
return {
|
|
8
33
|
frames,
|
|
34
|
+
postToFrame,
|
|
35
|
+
remountFrame,
|
|
9
36
|
/** Replacement cleanup cannot remove its successor registration. */
|
|
10
37
|
registerFrame(frame) {
|
|
11
38
|
const record = shallowReactive(frame);
|
|
@@ -38,18 +65,9 @@ function createCanvasFrames(store) {
|
|
|
38
65
|
y: rect.top + point.y * rect.height / frame.rect.height
|
|
39
66
|
};
|
|
40
67
|
},
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (!frame?.iframe?.contentWindow || !frame.documentId) return false;
|
|
45
|
-
const window = frame.iframe.ownerDocument.defaultView;
|
|
46
|
-
if (!window) return false;
|
|
47
|
-
frame.iframe.contentWindow.postMessage({
|
|
48
|
-
...payload,
|
|
49
|
-
__histoire: true,
|
|
50
|
-
documentId: frame.documentId
|
|
51
|
-
}, window.location.origin);
|
|
52
|
-
return true;
|
|
68
|
+
/** Remount every running frame in the same task so their animations start together. */
|
|
69
|
+
remountAll() {
|
|
70
|
+
return [...frames.keys()].filter(remountFrame).length;
|
|
53
71
|
},
|
|
54
72
|
/** Canvas scale exposed for overlay helpers without leaking root DOM. */
|
|
55
73
|
get zoom() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as useWorkbenchTestsModel } from "./model-
|
|
1
|
+
import { r as useWorkbenchTestsModel } from "./model-CIFxQfDH.js";
|
|
2
2
|
import { onBeforeUnmount, watch } from "@histoire/vendors/vue";
|
|
3
3
|
// src/app/components/panes/tests/capture.ts
|
|
4
4
|
/** Capture requests preempt provider-local discovery before their transport admission. */
|
|
@@ -65,6 +65,7 @@ function createRuntimeFrameUrl(base, options) {
|
|
|
65
65
|
url.searchParams.set("selectionVersion", String(options.selectionVersion));
|
|
66
66
|
url.searchParams.set("embed", "true");
|
|
67
67
|
if (options.standalone) url.searchParams.set("standalone", "true");
|
|
68
|
+
else if (options.padding) url.searchParams.set("padding", String(options.padding));
|
|
68
69
|
if (options.standalone && base.searchParams.get("nativeScroll") === "true") url.searchParams.set("nativeScroll", "true");
|
|
69
70
|
if (options.standalone && base.searchParams.get("matrix") === "true") url.searchParams.set("matrix", "true");
|
|
70
71
|
return url.href;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as HistoireDocs, h as HistoireSource } from "./extensions-
|
|
2
|
-
import { t as HistoireProvider } from "./src-
|
|
1
|
+
import { T as HistoireDocs, h as HistoireSource } from "./extensions-BtOjYv3e.js";
|
|
2
|
+
import { t as HistoireProvider } from "./src-CDZfcmuw.js";
|
|
3
3
|
import { createApp, h } from "@histoire/vendors/vue";
|
|
4
4
|
// src/embed/adapters/content-view.ts
|
|
5
5
|
/** Source-owned iframe renders same native parts against finite parent session proxy. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { S as getControlsAppearance } from "./controls-DpdwHd4q.js";
|
|
2
|
-
import { O as StatePresets, k as GenericControls } from "./extensions-
|
|
3
|
-
import { t as HistoireProvider } from "./src-
|
|
4
|
-
import { n as createControlsReplicaUrl, o as createRuntimeDocumentOwner, t as isColorSchemeDark } from "./color-scheme-
|
|
2
|
+
import { O as StatePresets, k as GenericControls } from "./extensions-BtOjYv3e.js";
|
|
3
|
+
import { t as HistoireProvider } from "./src-CDZfcmuw.js";
|
|
4
|
+
import { n as createControlsReplicaUrl, o as createRuntimeDocumentOwner, t as isColorSchemeDark } from "./color-scheme-zLURTKoT.js";
|
|
5
5
|
import { createApp, h, nextTick, shallowRef } from "@histoire/vendors/vue";
|
|
6
6
|
import { CONTROLS_APPEARANCE, CONTROLS_FOCUS, CONTROLS_OVERLAY, CONTROLS_OVERLAY_REFRESH, CONTROLS_OVERLAY_RESULT, CONTROLS_READY, CONTROLS_RESIZE, HistoireSdkError, PREVIEW_SETTINGS_SYNC, RUNTIME_FAILED, STATE_SYNC, createControlsStateRevision, mapRuntimeViewport, validateBridgeEventPayload, validateHistoireStateSnapshot } from "@histoire/protocol";
|
|
7
7
|
// src/embed/adapters/controls-replica.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as HistoireExplorer } from "./extensions-
|
|
2
|
-
import { r as HistoireEmbed, t as HistoireProvider } from "./src-
|
|
3
|
-
import { t as mountLocalHistoireSurface } from "./local-mount-
|
|
1
|
+
import { i as HistoireExplorer } from "./extensions-BtOjYv3e.js";
|
|
2
|
+
import { r as HistoireEmbed, t as HistoireProvider } from "./src-CDZfcmuw.js";
|
|
3
|
+
import { t as mountLocalHistoireSurface } from "./local-mount-CQ14I_16.js";
|
|
4
4
|
import { createApp, h } from "@histoire/vendors/vue";
|
|
5
5
|
import { HistoireSdkError } from "@histoire/protocol";
|
|
6
6
|
import { workbenchPlugins } from "virtual:$histoire-workbench-plugins";
|
|
@@ -29,7 +29,7 @@ function createExplorerViewSession(context) {
|
|
|
29
29
|
});
|
|
30
30
|
const session = {
|
|
31
31
|
...context.session,
|
|
32
|
-
mount(container, { surface }) {
|
|
32
|
+
mount(container, { surface, padding }) {
|
|
33
33
|
if (!active) throw new HistoireSdkError("DISPOSED", "Explorer detached");
|
|
34
34
|
const isPrimary = surface === "preview";
|
|
35
35
|
if (surface === "explorer" || isPrimary && primary) throw new HistoireSdkError("RUNTIME_IN_USE", "Explorer already owns primary runtime");
|
|
@@ -41,6 +41,7 @@ function createExplorerViewSession(context) {
|
|
|
41
41
|
sessionId: owner.sessionId,
|
|
42
42
|
mountId,
|
|
43
43
|
surface,
|
|
44
|
+
padding,
|
|
44
45
|
hidden: false,
|
|
45
46
|
container,
|
|
46
47
|
target: snapshot.selection,
|
|
@@ -247,6 +248,7 @@ function createEmbedExplorerView(context) {
|
|
|
247
248
|
}, { default: () => context.presentation ? h(HistoireEmbed, {
|
|
248
249
|
scope: context.presentation.scope,
|
|
249
250
|
panels: context.presentation.panels,
|
|
251
|
+
padding: context.padding,
|
|
250
252
|
onReady: () => resolve(owner.runtime()),
|
|
251
253
|
onError: reject
|
|
252
254
|
}) : h(HistoireExplorer, {
|
|
@@ -1513,13 +1513,19 @@ function createHistoirePrimary(name, surface) {
|
|
|
1513
1513
|
return defineComponent({
|
|
1514
1514
|
name,
|
|
1515
1515
|
inheritAttrs: false,
|
|
1516
|
+
props: {
|
|
1517
|
+
/** Gutter in CSS pixels around the variant, replacing the story and project padding. */
|
|
1518
|
+
padding: {
|
|
1519
|
+
type: Number,
|
|
1520
|
+
default: void 0
|
|
1521
|
+
} },
|
|
1516
1522
|
emits: {
|
|
1517
1523
|
/** Fires after source runtime readiness, including explicit empty-book readiness. */
|
|
1518
1524
|
ready: () => true,
|
|
1519
1525
|
/** Typed source/runtime or primary ownership failure. */
|
|
1520
1526
|
error: (_error) => true
|
|
1521
1527
|
},
|
|
1522
|
-
setup(
|
|
1528
|
+
setup(props, { attrs, slots, emit, expose }) {
|
|
1523
1529
|
const context = useHistoireContext();
|
|
1524
1530
|
const session = context.session;
|
|
1525
1531
|
const initial = session.getSnapshot();
|
|
@@ -1574,7 +1580,10 @@ function createHistoirePrimary(name, surface) {
|
|
|
1574
1580
|
onMounted(() => {
|
|
1575
1581
|
if (removed || !container.value) return;
|
|
1576
1582
|
try {
|
|
1577
|
-
mount = session.mount(container.value, {
|
|
1583
|
+
mount = session.mount(container.value, {
|
|
1584
|
+
surface,
|
|
1585
|
+
...props.padding === void 0 ? {} : { padding: props.padding }
|
|
1586
|
+
});
|
|
1578
1587
|
stopReadiness = session.subscribe(synchronizeReadiness);
|
|
1579
1588
|
stopFocus = subscribeHistoireMountEvents(mount, (event) => {
|
|
1580
1589
|
if (event.event !== "focus.changed") return;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { f as mapRuntimeViewport$1, p as createClientId } from "./sandbox-shared-CwPQj187.js";
|
|
2
2
|
import { d as HstPulsatingDisc } from "./controls-DpdwHd4q.js";
|
|
3
|
-
import { C as requestHistoireUiShow, N as useHistoireContext, S as focusHistoireSearch, j as useHistoireSnapshot, w as requestHistoireUiToggle } from "./extensions-
|
|
4
|
-
import { n as useHistoireSession } from "./src-
|
|
3
|
+
import { C as requestHistoireUiShow, N as useHistoireContext, S as focusHistoireSearch, j as useHistoireSnapshot, w as requestHistoireUiToggle } from "./extensions-BtOjYv3e.js";
|
|
4
|
+
import { n as useHistoireSession } from "./src-CDZfcmuw.js";
|
|
5
5
|
import { n as isContextMenuShortcut } from "./context-menu-Cw2xQKsM.js";
|
|
6
6
|
import { i as getCanvasTargetGeneration, r as useMatrixStore } from "./matrix-BPPIGW-q.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { a as
|
|
7
|
+
import { r as getBackgroundContrastColor } from "./background-CUUIkZVL.js";
|
|
8
|
+
import { r as usePresetConfigStore } from "./presets-config-CfdpjV2k.js";
|
|
9
|
+
import { a as useCanvasFrameState, c as useCanvasStore, o as useCanvasFrames } from "./canvas-settings-Cw7AXzFG.js";
|
|
10
|
+
import { n as registerEmbedSurface, t as mountLocalHistoireSurface } from "./local-mount-CQ14I_16.js";
|
|
11
|
+
import { a as createRuntimeDocumentId, i as createTestWorkerUrl, o as createRuntimeDocumentOwner, r as createRuntimeFrameUrl, t as isColorSchemeDark } from "./color-scheme-zLURTKoT.js";
|
|
10
12
|
import { PROPS_OVERRIDE, RUNTIME_RESULT, createFailedRunSummary, mergeHistoireTestSummaries } from "@histoire/shared";
|
|
11
13
|
import { useEventListener, useTimeoutFn } from "@histoire/vendors/vue-use";
|
|
12
|
-
import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, effectScope, inject, onBeforeUnmount, onMounted, openBlock, provide, reactive, readonly, ref, shallowReactive, shallowRef, unref, watch } from "@histoire/vendors/vue";
|
|
14
|
+
import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, effectScope, inject, normalizeStyle, onBeforeUnmount, onMounted, openBlock, provide, reactive, readonly, ref, shallowReactive, shallowRef, unref, watch } from "@histoire/vendors/vue";
|
|
13
15
|
import { COLLECT_TESTS, EVENT_SEND, HISTOIRE_ERROR_CODES, HOST_CHANNEL_MESSAGE, HistoireSdkError, PREVIEW_SETTINGS_SYNC as PREVIEW_SETTINGS_SYNC$1, PREVIEW_SYNC, RUNTIME_FAILED, RUNTIME_FOCUS, RUNTIME_LAYOUT, RUNTIME_REQUEST, RUNTIME_RESULT as RUNTIME_RESULT$1, RUN_TESTS, RUN_TEST_CASE, STATE_SYNC, TEST_CASE_RESULT, TEST_DEFINITIONS, TEST_RESULT, VARIANT_READY, createHostChannelRateLimiter, createPluginChannelLimiters, getHistoireTargetKey, isHistoirePluginNotice, resolveEmbedOrigins, validateBridgePayload, validateBridgeResult, validateHistoireSourceDescriptor, validateHistoireStateSnapshot, validateHistoireTarget, validateHistoireViewports, validateHostChannelPayload, validateInspectionCapabilities, validatePluginChannelPayload, validateWireValue } from "@histoire/protocol";
|
|
14
16
|
import { createHistoireSessionWithAdapters, delegateHistoireStoryLinks, getAcceptedHistoireSessionDescriptor, isAcceptedHistoireSourceDescriptor, subscribeHistoireMountEvents } from "@histoire/sdk/internal";
|
|
15
17
|
import Fuse from "fuse.js";
|
|
@@ -117,7 +119,7 @@ function fitCanvas(bounds, viewport, options = {}) {
|
|
|
117
119
|
};
|
|
118
120
|
}
|
|
119
121
|
// src/app/components/canvas/CanvasLoadingIndicator.vue?vue&type=script&setup=true&lang.ts
|
|
120
|
-
var _hoisted_1$
|
|
122
|
+
var _hoisted_1$2 = {
|
|
121
123
|
class: "htw:inline-flex htw:text-muted htw:opacity-50 htw:pointer-events-none",
|
|
122
124
|
"aria-hidden": "true"
|
|
123
125
|
};
|
|
@@ -126,7 +128,7 @@ var CanvasLoadingIndicator_default = /* @__PURE__ */ defineComponent({
|
|
|
126
128
|
__name: "CanvasLoadingIndicator",
|
|
127
129
|
setup(__props) {
|
|
128
130
|
return (_ctx, _cache) => {
|
|
129
|
-
return openBlock(), createElementBlock("span", _hoisted_1$
|
|
131
|
+
return openBlock(), createElementBlock("span", _hoisted_1$2, [createVNode(unref(HstPulsatingDisc), {
|
|
130
132
|
immediate: "",
|
|
131
133
|
size: 16
|
|
132
134
|
})]);
|
|
@@ -424,6 +426,18 @@ function createCanvasPropsOverrideController(options) {
|
|
|
424
426
|
options.fail(error);
|
|
425
427
|
}, 3e3);
|
|
426
428
|
}
|
|
429
|
+
/** Startup may resend a projection while content sizing is already waiting. */
|
|
430
|
+
async function wait() {
|
|
431
|
+
let pending;
|
|
432
|
+
do {
|
|
433
|
+
pending = readiness;
|
|
434
|
+
try {
|
|
435
|
+
await pending;
|
|
436
|
+
} catch (error) {
|
|
437
|
+
if (pending === readiness) throw error;
|
|
438
|
+
}
|
|
439
|
+
} while (pending !== readiness);
|
|
440
|
+
}
|
|
427
441
|
/** Reject a pending source read when its owning component retires. */
|
|
428
442
|
function dispose() {
|
|
429
443
|
clearTimeout(timeout);
|
|
@@ -432,7 +446,7 @@ function createCanvasPropsOverrideController(options) {
|
|
|
432
446
|
return {
|
|
433
447
|
receive,
|
|
434
448
|
update,
|
|
435
|
-
wait
|
|
449
|
+
wait,
|
|
436
450
|
dispose
|
|
437
451
|
};
|
|
438
452
|
}
|
|
@@ -1875,6 +1889,11 @@ function createEmbedRuntimeFrame(context) {
|
|
|
1875
1889
|
if (status === "absent") selected = null;
|
|
1876
1890
|
if (publishNow) publish(status);
|
|
1877
1891
|
}
|
|
1892
|
+
/** Mount override first, then the story layout, then the project default; embeds draw no aligners. */
|
|
1893
|
+
function embedPadding(target) {
|
|
1894
|
+
const story = context.session.getSnapshot().catalog.stories.find((item) => item.id === target.storyId);
|
|
1895
|
+
return context.padding ?? story?.layout?.padding ?? context.descriptor.framePadding ?? 0;
|
|
1896
|
+
}
|
|
1878
1897
|
/** New document minted before assigning src; WindowProxy equality cannot resurrect predecessor. */
|
|
1879
1898
|
function navigate(target) {
|
|
1880
1899
|
requests.invalidate();
|
|
@@ -1892,7 +1911,8 @@ function createEmbedRuntimeFrame(context) {
|
|
|
1892
1911
|
target,
|
|
1893
1912
|
documentId: owner.id,
|
|
1894
1913
|
selectionVersion: owner.selectionVersion,
|
|
1895
|
-
standalone: context.standalone
|
|
1914
|
+
standalone: context.standalone,
|
|
1915
|
+
padding: embedPadding(target)
|
|
1896
1916
|
});
|
|
1897
1917
|
if (!iframe.isConnected) context.container.append(iframe);
|
|
1898
1918
|
settings();
|
|
@@ -2180,20 +2200,20 @@ function createLazyEmbedSurface(context, load) {
|
|
|
2180
2200
|
// src/embed/adapters/tests-surface.ts
|
|
2181
2201
|
/** Metadata bootstrap registers names only; UI module loads on explicit mount. */
|
|
2182
2202
|
registerEmbedSurface("tests", (context) => createLazyEmbedSurface(context, async () => {
|
|
2183
|
-
const { createEmbedTestsView } = await import("./tests-view-
|
|
2203
|
+
const { createEmbedTestsView } = await import("./tests-view-RYpujVD_.js");
|
|
2184
2204
|
context.signal.throwIfAborted();
|
|
2185
2205
|
return createEmbedTestsView(context);
|
|
2186
2206
|
}));
|
|
2187
2207
|
// src/embed/adapters/controls.ts
|
|
2188
2208
|
/** Registration remains metadata-safe; Vue/control code loads only for explicit surface. */
|
|
2189
|
-
registerEmbedSurface("controls", (context) => createLazyEmbedSurface(context, () => import("./controls-view-
|
|
2209
|
+
registerEmbedSurface("controls", (context) => createLazyEmbedSurface(context, () => import("./controls-view-CtDADD0e.js").then((module) => {
|
|
2190
2210
|
context.signal.throwIfAborted();
|
|
2191
2211
|
return module.createEmbedControlsView(context);
|
|
2192
2212
|
})));
|
|
2193
2213
|
// src/embed/adapters/content-surface.ts
|
|
2194
2214
|
/** Registration is data-only; native UI/heavy content dependencies load only explicit mount. */
|
|
2195
2215
|
for (const surface of ["docs", "source"]) registerEmbedSurface(surface, (context) => createLazyEmbedSurface(context, async () => {
|
|
2196
|
-
const module = await import("./content-view-
|
|
2216
|
+
const module = await import("./content-view-ChEpdsxh.js");
|
|
2197
2217
|
if (context.signal.aborted) throw context.signal.reason;
|
|
2198
2218
|
return module.createEmbedContentView(context, surface);
|
|
2199
2219
|
}));
|
|
@@ -2205,14 +2225,14 @@ for (const surface of [
|
|
|
2205
2225
|
"toolbar",
|
|
2206
2226
|
"events"
|
|
2207
2227
|
]) registerEmbedSurface(surface, (context) => createLazyEmbedSurface(context, async () => {
|
|
2208
|
-
const { createEmbedNavigationView } = await import("./navigation-view-
|
|
2228
|
+
const { createEmbedNavigationView } = await import("./navigation-view-Co43QbrR.js");
|
|
2209
2229
|
context.signal.throwIfAborted();
|
|
2210
2230
|
return createEmbedNavigationView(context, surface);
|
|
2211
2231
|
}));
|
|
2212
2232
|
// src/embed/adapters/explorer.ts
|
|
2213
2233
|
/** Explorer imports reusable Vue only when explicitly mounted, never metadata access. */
|
|
2214
2234
|
registerEmbedSurface("explorer", (context) => createLazyEmbedSurface(context, async () => {
|
|
2215
|
-
const module = await import("./explorer-view-
|
|
2235
|
+
const module = await import("./explorer-view-B717fDtg.js");
|
|
2216
2236
|
context.signal.throwIfAborted();
|
|
2217
2237
|
return module.createEmbedExplorerView(context);
|
|
2218
2238
|
}));
|
|
@@ -2956,7 +2976,7 @@ function useCanvasContentSizing(options) {
|
|
|
2956
2976
|
};
|
|
2957
2977
|
}
|
|
2958
2978
|
// src/app/components/canvas/CanvasReplicaPreview.vue?vue&type=script&setup=true&lang.ts
|
|
2959
|
-
var _hoisted_1 = { class: "htw:relative htw:w-full htw:h-full" };
|
|
2979
|
+
var _hoisted_1$1 = { class: "htw:relative htw:w-full htw:h-full" };
|
|
2960
2980
|
var _hoisted_2 = [
|
|
2961
2981
|
"data-interactive",
|
|
2962
2982
|
"aria-busy",
|
|
@@ -2973,6 +2993,7 @@ var CanvasReplicaPreview_default = /* @__PURE__ */ defineComponent({
|
|
|
2973
2993
|
variantId: {},
|
|
2974
2994
|
previewBase: {},
|
|
2975
2995
|
viewport: {},
|
|
2996
|
+
declaredSize: {},
|
|
2976
2997
|
propsOverride: {}
|
|
2977
2998
|
},
|
|
2978
2999
|
emits: ["status", "snapshot"],
|
|
@@ -3028,7 +3049,7 @@ var CanvasReplicaPreview_default = /* @__PURE__ */ defineComponent({
|
|
|
3028
3049
|
function settings() {
|
|
3029
3050
|
const value = snapshot.value.settings;
|
|
3030
3051
|
const background = store.frameBackgrounds[props.frameId];
|
|
3031
|
-
const viewport = contentSizing.size.value ?? props.viewport;
|
|
3052
|
+
const viewport = props.declaredSize ?? contentSizing.size.value ?? props.viewport;
|
|
3032
3053
|
return {
|
|
3033
3054
|
...value,
|
|
3034
3055
|
...background ?? {},
|
|
@@ -3053,7 +3074,7 @@ var CanvasReplicaPreview_default = /* @__PURE__ */ defineComponent({
|
|
|
3053
3074
|
getSource: frame.getSource
|
|
3054
3075
|
});
|
|
3055
3076
|
return (_ctx, _cache) => {
|
|
3056
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", {
|
|
3077
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [createElementVNode("div", {
|
|
3057
3078
|
ref_key: "container",
|
|
3058
3079
|
ref: container,
|
|
3059
3080
|
class: "histoire-canvas-replica htw:data-[interactive=false]:[&_iframe]:pointer-events-none htw:group-data-[panning=true]/viewport:[&_iframe]:pointer-events-none htw:w-full htw:h-full htw:[color-scheme:normal]",
|
|
@@ -3087,7 +3108,10 @@ function keepFrameLayouts(previous, next) {
|
|
|
3087
3108
|
for (let index = 0; index < next.length; index++) {
|
|
3088
3109
|
const a = previous[index];
|
|
3089
3110
|
const b = next[index];
|
|
3090
|
-
if (a.id !== b.id || a.x !== b.x || a.y !== b.y || a.width !== b.width || a.height !== b.height || a.
|
|
3111
|
+
if (a.id !== b.id || a.x !== b.x || a.y !== b.y || a.width !== b.width || a.height !== b.height || a.bodyHeight !== b.bodyHeight || a.storyId !== b.storyId || a.variantId !== b.variantId) return next;
|
|
3112
|
+
const first = a.runtimeBounds;
|
|
3113
|
+
const second = b.runtimeBounds;
|
|
3114
|
+
if (first?.x !== second?.x || first?.y !== second?.y || first?.width !== second?.width || first?.height !== second?.height) return next;
|
|
3091
3115
|
}
|
|
3092
3116
|
return previous;
|
|
3093
3117
|
}
|
|
@@ -3103,23 +3127,39 @@ function layoutCanvasFrames(storyId, variantIds, size, arrange, columns = 3, chr
|
|
|
3103
3127
|
const heights = Array.from({ length: Math.ceil(variantIds.length / count) }, () => 0);
|
|
3104
3128
|
sizes.forEach((size, index) => {
|
|
3105
3129
|
widths[index % count] = Math.max(widths[index % count], size.width);
|
|
3106
|
-
|
|
3130
|
+
const row = Math.floor(index / count);
|
|
3131
|
+
heights[row] = Math.max(heights[row], size.height);
|
|
3107
3132
|
});
|
|
3108
3133
|
const xs = canvasTrackOffsets(widths, GRID_FRAME_GAP / scale);
|
|
3109
|
-
const ys = canvasTrackOffsets(heights, gap);
|
|
3110
|
-
return variantIds.map((variantId, index) =>
|
|
3111
|
-
|
|
3134
|
+
const ys = canvasTrackOffsets(heights, labelHeight + gap);
|
|
3135
|
+
return variantIds.map((variantId, index) => {
|
|
3136
|
+
const column = index % count;
|
|
3137
|
+
const row = Math.floor(index / count);
|
|
3138
|
+
const x = xs[column];
|
|
3139
|
+
const y = ys[row];
|
|
3140
|
+
const { width, height } = sizes[index];
|
|
3141
|
+
const cardWidth = list ? width : widths[column];
|
|
3142
|
+
const bodyHeight = heights[row];
|
|
3143
|
+
return {
|
|
3144
|
+
id: getHistoireTargetKey({
|
|
3145
|
+
storyId,
|
|
3146
|
+
variantId
|
|
3147
|
+
}),
|
|
3112
3148
|
storyId,
|
|
3113
|
-
variantId
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3149
|
+
variantId,
|
|
3150
|
+
x,
|
|
3151
|
+
y,
|
|
3152
|
+
width: cardWidth,
|
|
3153
|
+
height: bodyHeight + labelHeight,
|
|
3154
|
+
bodyHeight,
|
|
3155
|
+
runtimeBounds: cardWidth === width && bodyHeight === height ? void 0 : {
|
|
3156
|
+
x,
|
|
3157
|
+
y,
|
|
3158
|
+
width,
|
|
3159
|
+
height: height + labelHeight
|
|
3160
|
+
}
|
|
3161
|
+
};
|
|
3162
|
+
});
|
|
3123
3163
|
}
|
|
3124
3164
|
/** Accumulate unequal tracks once rather than summing preceding sizes for every cell. */
|
|
3125
3165
|
function canvasTrackOffsets(sizes, gap, start = 0) {
|
|
@@ -3157,7 +3197,7 @@ function visibleCanvasFrames(frames, viewport) {
|
|
|
3157
3197
|
let high = frames.length;
|
|
3158
3198
|
while (low < high) {
|
|
3159
3199
|
const middle = Math.floor((low + high) / 2);
|
|
3160
|
-
if (
|
|
3200
|
+
if (frames[middle].y + frames[middle].height <= viewport.y) low = middle + 1;
|
|
3161
3201
|
else high = middle;
|
|
3162
3202
|
}
|
|
3163
3203
|
const start = low;
|
|
@@ -3174,16 +3214,20 @@ function visibleCanvasFrames(frames, viewport) {
|
|
|
3174
3214
|
function visibleArea(frame, viewport) {
|
|
3175
3215
|
return Math.max(0, Math.min(frame.x + frame.width, viewport.x + viewport.width) - Math.max(frame.x, viewport.x)) * Math.max(0, Math.min(frame.y + frame.height, viewport.y + viewport.height) - Math.max(frame.y, viewport.y));
|
|
3176
3216
|
}
|
|
3177
|
-
/** Admit selected frame first, then
|
|
3217
|
+
/** Admit selected frame first, then by visible content area, up to the live budget. */
|
|
3178
3218
|
function liveCanvasFrames(frames, viewport, budget, selected, margin = 160) {
|
|
3179
3219
|
const limit = Math.max(1, Math.floor(Number.isFinite(budget) ? budget : 1));
|
|
3180
3220
|
const selectedFrame = frames.find((frame) => frame.id === selected);
|
|
3181
3221
|
const intersectsMargin = (frame) => frame.x + frame.width >= viewport.x - margin && frame.x <= viewport.x + viewport.width + margin && frame.y + frame.height >= viewport.y - margin && frame.y <= viewport.y + viewport.height + margin;
|
|
3182
|
-
const candidates = frames.
|
|
3183
|
-
frame
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3222
|
+
const candidates = frames.flatMap((frame, index) => {
|
|
3223
|
+
const bounds = frame.runtimeBounds ?? frame;
|
|
3224
|
+
if (frame === selectedFrame || !intersectsMargin(bounds)) return [];
|
|
3225
|
+
return [{
|
|
3226
|
+
frame,
|
|
3227
|
+
index,
|
|
3228
|
+
area: visibleArea(bounds, viewport)
|
|
3229
|
+
}];
|
|
3230
|
+
}).sort((first, second) => second.area - first.area || first.index - second.index);
|
|
3187
3231
|
return new Set([...selectedFrame ? [selectedFrame] : [], ...candidates.map((candidate) => candidate.frame)].slice(0, limit).map((frame) => frame.id));
|
|
3188
3232
|
}
|
|
3189
3233
|
/** Order only admitted startup targets by center distance from selected or first admitted anchor. */
|
|
@@ -3194,12 +3238,14 @@ function rankCanvasStartupFrames(frames, admittedFrameIds, selectedFrameId) {
|
|
|
3194
3238
|
if (!admitted.length) return [];
|
|
3195
3239
|
const anchorId = selectedFrameId && admitted.includes(selectedFrameId) ? selectedFrameId : admitted[0];
|
|
3196
3240
|
const anchor = byId.get(anchorId);
|
|
3197
|
-
const
|
|
3198
|
-
const
|
|
3241
|
+
const anchorBounds = anchor.runtimeBounds ?? anchor;
|
|
3242
|
+
const centerX = anchorBounds.x + anchorBounds.width / 2;
|
|
3243
|
+
const centerY = anchorBounds.y + anchorBounds.height / 2;
|
|
3199
3244
|
const distances = new Map(admitted.map((id) => {
|
|
3200
3245
|
const frame = byId.get(id);
|
|
3201
|
-
const
|
|
3202
|
-
const
|
|
3246
|
+
const bounds = frame.runtimeBounds ?? frame;
|
|
3247
|
+
const dx = bounds.x + bounds.width / 2 - centerX;
|
|
3248
|
+
const dy = bounds.y + bounds.height / 2 - centerY;
|
|
3203
3249
|
return [id, dx * dx + dy * dy];
|
|
3204
3250
|
}));
|
|
3205
3251
|
return [anchorId, ...admitted.filter((id) => id !== anchorId).sort((first, second) => {
|
|
@@ -3215,6 +3261,75 @@ function isFrameMenuShortcut(event) {
|
|
|
3215
3261
|
function openFrameMenu(menu, event, target) {
|
|
3216
3262
|
menu?.open(event, target);
|
|
3217
3263
|
}
|
|
3264
|
+
// src/app/components/canvas/FramePaddingAligners.vue?vue&type=script&setup=true&lang.ts
|
|
3265
|
+
var _hoisted_1 = ["d"];
|
|
3266
|
+
var GAP = 6;
|
|
3267
|
+
/** Longest mark, kept inside the gutter. */
|
|
3268
|
+
var MAX_LENGTH = 4;
|
|
3269
|
+
// src/app/components/canvas/FramePaddingAligners.vue
|
|
3270
|
+
var FramePaddingAligners_default = /* @__PURE__ */ defineComponent({
|
|
3271
|
+
__name: "FramePaddingAligners",
|
|
3272
|
+
props: {
|
|
3273
|
+
width: {},
|
|
3274
|
+
height: {},
|
|
3275
|
+
padding: {},
|
|
3276
|
+
background: {}
|
|
3277
|
+
},
|
|
3278
|
+
setup(__props) {
|
|
3279
|
+
const props = __props;
|
|
3280
|
+
const presets = usePresetConfigStore();
|
|
3281
|
+
const color = computed(() => getBackgroundContrastColor(props.background, presets?.backgroundPresets.value ?? []));
|
|
3282
|
+
/** Distance between a mark and the variant edge it extends. */
|
|
3283
|
+
const path = computed(() => {
|
|
3284
|
+
const length = Math.min(MAX_LENGTH, props.padding - GAP * 2);
|
|
3285
|
+
if (length < 2) return "";
|
|
3286
|
+
const left = Math.round(props.padding) + .5;
|
|
3287
|
+
const top = left;
|
|
3288
|
+
const right = Math.round(props.padding + props.width) - .5;
|
|
3289
|
+
const bottom = Math.round(props.padding + props.height) - .5;
|
|
3290
|
+
return [
|
|
3291
|
+
[
|
|
3292
|
+
left,
|
|
3293
|
+
top,
|
|
3294
|
+
-1,
|
|
3295
|
+
-1
|
|
3296
|
+
],
|
|
3297
|
+
[
|
|
3298
|
+
right,
|
|
3299
|
+
top,
|
|
3300
|
+
1,
|
|
3301
|
+
-1
|
|
3302
|
+
],
|
|
3303
|
+
[
|
|
3304
|
+
left,
|
|
3305
|
+
bottom,
|
|
3306
|
+
-1,
|
|
3307
|
+
1
|
|
3308
|
+
],
|
|
3309
|
+
[
|
|
3310
|
+
right,
|
|
3311
|
+
bottom,
|
|
3312
|
+
1,
|
|
3313
|
+
1
|
|
3314
|
+
]
|
|
3315
|
+
].map(([x, y, dx, dy]) => `M${x + dx * GAP} ${y}h${dx * length}M${x} ${y + dy * GAP}v${dy * length}`).join("");
|
|
3316
|
+
});
|
|
3317
|
+
return (_ctx, _cache) => {
|
|
3318
|
+
return path.value ? (openBlock(), createElementBlock("svg", {
|
|
3319
|
+
key: 0,
|
|
3320
|
+
class: "histoire-frame-aligners htw:absolute htw:inset-0 htw:size-full htw:pointer-events-none htw:text-text htw:opacity-15 htw:z-[1]",
|
|
3321
|
+
style: normalizeStyle({ color: color.value }),
|
|
3322
|
+
"aria-hidden": "true"
|
|
3323
|
+
}, [createElementVNode("path", {
|
|
3324
|
+
d: path.value,
|
|
3325
|
+
fill: "none",
|
|
3326
|
+
stroke: "currentColor",
|
|
3327
|
+
"stroke-width": "1",
|
|
3328
|
+
"shape-rendering": "crispEdges"
|
|
3329
|
+
}, null, 8, _hoisted_1)], 4)) : createCommentVNode("", true);
|
|
3330
|
+
};
|
|
3331
|
+
}
|
|
3332
|
+
});
|
|
3218
3333
|
// src/app/components/canvas/frame-admission.ts
|
|
3219
3334
|
/** Keep current previews during movement; rank the final viewport once input settles. */
|
|
3220
3335
|
function useCanvasFrameAdmission(options) {
|
|
@@ -3287,4 +3402,4 @@ function useCanvasFrameLedger() {
|
|
|
3287
3402
|
if (!ledger) throw new Error("Canvas frame budget requires provideCanvasFrameLedger().");
|
|
3288
3403
|
return ledger;
|
|
3289
3404
|
}
|
|
3290
|
-
export {
|
|
3405
|
+
export { wheelZoom as A, whenCanvasStartupIdle as C, clampZoom as D, canvasToClient as E, canvasContentKey as M, createCanvasContentSizes as N, clientToCanvas as O, provideCanvasStartupCoordinator as S, canvasContentRect as T, matchSearchText as _, FramePaddingAligners_default as a, observeCanvasStartupRuntime as b, canvasFrameBounds as c, layoutCanvasFrames as d, rankCanvasStartupFrames as f, createStandaloneSession as g, acquireStoryFrame as h, useCanvasFrameAdmission as i, zoomAroundPoint as j, fitCanvas as k, canvasTrackOffsets as l, CanvasReplicaPreview_default as m, provideCanvasFrameLedger as n, isFrameMenuShortcut as o, visibleCanvasFrames as p, useCanvasFrameLedger as r, openFrameMenu as s, holdCanvasFrameSlot as t, keepFrameLayouts as u, rankSearchMatches as v, CanvasLoadingIndicator_default as w, waitForCanvasStartup as x, createCanvasStartupReadiness as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as sendUiEvent, n as onUiDisconnect, r as onUiEvent } from "./ui-channel-BPYj8uw2.js";
|
|
2
|
-
import { n as getBackgroundCapture } from "./background-
|
|
2
|
+
import { n as getBackgroundCapture } from "./background-CUUIkZVL.js";
|
|
3
3
|
// src/app/components/canvas/frame-registration.ts
|
|
4
4
|
/** Capture one logical activation; A/B/A must never resurrect the first A. */
|
|
5
5
|
function captureFrameRegistration(resolve) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { U as WorkbenchEmptyState_default } from "./sandbox-shared-CwPQj187.js";
|
|
2
2
|
import { A as useLoadingDelay, j as LoadingDelayBoundary } from "./controls-DpdwHd4q.js";
|
|
3
|
-
import { A as mergePartClass, p as useExtensionView } from "./extensions-
|
|
3
|
+
import { A as mergePartClass, p as useExtensionView } from "./extensions-BtOjYv3e.js";
|
|
4
4
|
import { i as useExtensionHost } from "./extensions-DY0LLiE_.js";
|
|
5
5
|
import { t as WorkbenchErrorState_default } from "./WorkbenchErrorState-D97EoY89.js";
|
|
6
6
|
import { t as WorkbenchLoadingState_default } from "./WorkbenchLoadingState-CLA8IBL6.js";
|
|
7
7
|
import { t as WorkbenchPaneHeader_default } from "./WorkbenchPaneHeader-DBuiBHTT.js";
|
|
8
|
-
import { t as WorkbenchPanelAction_default } from "./WorkbenchPanelAction-
|
|
8
|
+
import { t as WorkbenchPanelAction_default } from "./WorkbenchPanelAction-SLby10Vh.js";
|
|
9
9
|
import { t as WorkbenchPaneList_default } from "./WorkbenchPaneList-cOz9-XSR.js";
|
|
10
10
|
import { t as WorkbenchPaneToolbar_default } from "./WorkbenchPaneToolbar-DEYUs_bD.js";
|
|
11
11
|
import { computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, provide, ref, renderSlot, resolveDynamicComponent, toDisplayString, unref, vShow, withCtx, withDirectives } from "@histoire/vendors/vue";
|
|
@@ -102,7 +102,8 @@ function mountLocalHistoireSurface(context, sourceBase, standalone = false) {
|
|
|
102
102
|
sourceBase,
|
|
103
103
|
controlsCustomOnly: customOnly,
|
|
104
104
|
standalone,
|
|
105
|
-
presentation: context.presentation
|
|
105
|
+
presentation: context.presentation,
|
|
106
|
+
padding: context.padding
|
|
106
107
|
});
|
|
107
108
|
return instance;
|
|
108
109
|
});
|