@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.
Files changed (137) hide show
  1. package/dist/app/style/theme.css +8 -0
  2. package/dist/bundled/app.css +2 -2
  3. package/dist/bundled/chunks/{AboutSection-D3IIVsiV.js → AboutSection-mX7J6xrz.js} +2 -2
  4. package/dist/bundled/chunks/{AgentCursor-Cg5SLa2H.js → AgentCursor-DcVxonMC.js} +2 -2
  5. package/dist/bundled/chunks/{AgentPlanApproval-D4hnGlYs.js → AgentPlanApproval-22I_Lbhn.js} +1 -1
  6. package/dist/bundled/chunks/{AgentsSection-CJGS9C2q.js → AgentsSection-DWmUKCX-.js} +1 -1
  7. package/dist/bundled/chunks/{AiPanel-B9QWRuSg.js → AiPanel-BICtbtCE.js} +4 -4
  8. package/dist/bundled/chunks/{AppearanceSection-DMjmDr1Y.js → AppearanceSection-maVgcfMk.js} +6 -6
  9. package/dist/bundled/chunks/{BasePopover-CQQ8wKev.js → BasePopover-B3Y5H1gd.js} +1 -1
  10. package/dist/bundled/chunks/{CommentsCanvasOverlay-UX-oYgnx.js → CommentsCanvasOverlay-DhqtbJNX.js} +5 -5
  11. package/dist/bundled/chunks/{DevBrowseStatus-D2rIG8uC.js → DevBrowseStatus-B6cLRu19.js} +2 -2
  12. package/dist/bundled/chunks/{DocsTab-BR3BktyF.js → DocsTab-PpFKAC6Q.js} +4 -4
  13. package/dist/bundled/chunks/{EventsTab-BP0hCGqL.js → EventsTab-DLVYcX1N.js} +3 -3
  14. package/dist/bundled/chunks/{GeneralSection-CT_-32qT.js → GeneralSection-dvmJUgqN.js} +1 -1
  15. package/dist/bundled/chunks/{InspectionPanel-C6kUdJj9.js → InspectionPanel-DDuT3guJ.js} +2 -2
  16. package/dist/bundled/chunks/{InspectorGuideLink-Bqlz1aaY.js → InspectorGuideLink-7Ui_Y2Wd.js} +1 -1
  17. package/dist/bundled/chunks/{MarkdownPage-DD7XyGkq.js → MarkdownPage-D_LpsCvG.js} +3 -3
  18. package/dist/bundled/chunks/{MarketplaceUpdateBody-B1cn_zeo.js → MarketplaceUpdateBody-BtLPpA7F.js} +2 -2
  19. package/dist/bundled/chunks/{MarketplaceView-eDPLtc_x.js → MarketplaceView-C1sVFRsq.js} +39 -10
  20. package/dist/bundled/chunks/{MatrixInspector-eIr_N5eH.js → MatrixInspector-wqkJJnuf.js} +3 -3
  21. package/dist/bundled/chunks/{MatrixView-CDmN-Kl9.js → MatrixView-D-Snu47M.js} +82 -40
  22. package/dist/bundled/chunks/{MatrixVisualActions-Cx3QzDTD.js → MatrixVisualActions-D3b-cp7N.js} +2 -2
  23. package/dist/bundled/chunks/{McpActivity-CiK3jUTY.js → McpActivity-r2CFr-ny.js} +1 -1
  24. package/dist/bundled/chunks/{McpSection-DRGzPGXO.js → McpSection-swh7qlM0.js} +1 -1
  25. package/dist/bundled/chunks/{NeedsAttention-C5zjd6RT.js → NeedsAttention-Cf6ihlT0.js} +2 -2
  26. package/dist/bundled/chunks/{PermissionPrompt-i5VbZCCJ.js → PermissionPrompt-CXTPfiIu.js} +1 -1
  27. package/dist/bundled/chunks/{PluginsSection-B3ZWAjrk.js → PluginsSection-Dhv2haa3.js} +6 -3
  28. package/dist/bundled/chunks/{ScreenshotPopover-DWcV_NAf.js → ScreenshotPopover-BZ37-dfK.js} +4 -4
  29. package/dist/bundled/chunks/{SettingsPage-BvT1FOl7.js → SettingsPage-D6ZOAgS9.js} +11 -11
  30. package/dist/bundled/chunks/{ShortcutsSection-D3-4e5Ug.js → ShortcutsSection-EK2-e56v.js} +1 -1
  31. package/dist/bundled/chunks/{StoryInspector-BJKzoeHc.js → StoryInspector-DCNgw0x8.js} +14 -11
  32. package/dist/bundled/chunks/{TestsPanel-CpBld3wM.js → TestsPanel-D1USqA8I.js} +5 -5
  33. package/dist/bundled/chunks/{TestsSection-CEXW49Ge.js → TestsSection-CIkkHlyK.js} +1 -1
  34. package/dist/bundled/chunks/{TestsTab-B-ZNDgGi.js → TestsTab-ykf9zwmG.js} +3 -3
  35. package/dist/bundled/chunks/{ThreadMessage-CPRLVXXQ.js → ThreadMessage-DxrvoIea.js} +5 -5
  36. package/dist/bundled/chunks/{ToolbarPopover-Nd-us4Fg.js → ToolbarPopover-CXizdbQq.js} +3 -3
  37. package/dist/bundled/chunks/{ViewportsSection-3EWu6WSc.js → ViewportsSection-D6mpKTSM.js} +1 -1
  38. package/dist/bundled/chunks/{VisualViewer-DV5mNFT8.js → VisualViewer-BQqfw1ov.js} +2 -2
  39. package/dist/bundled/chunks/{WorkbenchPanelAction-Cl68QrDs.js → WorkbenchPanelAction-SLby10Vh.js} +6 -2
  40. package/dist/bundled/chunks/{WorkbenchVirtualList-CUTamRgO.js → WorkbenchVirtualList-HCZiNo7p.js} +1 -1
  41. package/dist/bundled/chunks/{background-CG5-SPiv.js → background-CUUIkZVL.js} +7 -1
  42. package/dist/bundled/chunks/{canvas-settings-EP62RnvB.js → canvas-settings-Cw7AXzFG.js} +31 -13
  43. package/dist/bundled/chunks/{capture-SFV9pF9b.js → capture-DxD6llwl.js} +1 -1
  44. package/dist/bundled/chunks/{color-scheme-mhmCnofm.js → color-scheme-zLURTKoT.js} +1 -0
  45. package/dist/bundled/chunks/{content-view-Bpn8As7f.js → content-view-ChEpdsxh.js} +2 -2
  46. package/dist/bundled/chunks/{controls-view-COcHf8Pm.js → controls-view-CtDADD0e.js} +3 -3
  47. package/dist/bundled/chunks/{explorer-view-5gTgnjcf.js → explorer-view-B717fDtg.js} +6 -4
  48. package/dist/bundled/chunks/{extensions-DUXM9uEy.js → extensions-BtOjYv3e.js} +11 -2
  49. package/dist/bundled/chunks/{frame-ledger-BHZ0nJjD.js → frame-ledger-C67dpCuY.js} +160 -45
  50. package/dist/bundled/chunks/{frame-screenshot-D9R_xDns.js → frame-screenshot-IEmQR7TR.js} +1 -1
  51. package/dist/bundled/chunks/{icons-Bd36WZPu.js → icons-DoUVE4X3.js} +2 -2
  52. package/dist/bundled/chunks/{local-mount-CCa2jcqi.js → local-mount-CQ14I_16.js} +2 -1
  53. package/dist/bundled/chunks/{marketplace-DKeNfni-.js → marketplace-BE5IMmf3.js} +9 -3
  54. package/dist/bundled/chunks/{measurement-DfNeNMZe.js → measurement-BPE7RMeb.js} +1 -1
  55. package/dist/bundled/chunks/{model-DhvdMZzS.js → model-CIFxQfDH.js} +1 -1
  56. package/dist/bundled/chunks/{navigation-view-GU5-aPWL.js → navigation-view-Co43QbrR.js} +2 -2
  57. package/dist/bundled/chunks/{ownership-004rrffQ.js → ownership-BVQ3d672.js} +1 -1
  58. package/dist/bundled/chunks/{selection-DQJWdqhl.js → selection-BTc1fRMu.js} +1 -1
  59. package/dist/bundled/chunks/{settings-DC0gilMg.js → settings-BbefKI5N.js} +1 -1
  60. package/dist/bundled/chunks/{src-BazVZNon.js → src-CDZfcmuw.js} +7 -1
  61. package/dist/bundled/chunks/{tests-view-B9J9Gvpt.js → tests-view-RYpujVD_.js} +2 -2
  62. package/dist/bundled/chunks/{use-install-plan-ChZg4Xyq.js → use-install-plan-D0tiW2wu.js} +1 -1
  63. package/dist/bundled/chunks/{visual-CId9zv09.js → visual-nnXRPOP8.js} +1 -1
  64. package/dist/bundled/index.js +580 -313
  65. package/dist/embed/EmbedDocument.vue_vue_type_script_setup_true_lang.js +6 -1
  66. package/dist/embed/adapters/explorer-session.js +2 -1
  67. package/dist/embed/adapters/explorer-view.js +1 -0
  68. package/dist/embed/adapters/local-mount.js +2 -1
  69. package/dist/embed/adapters/runtime-frame.js +7 -1
  70. package/dist/embed/adapters/sandbox-urls.d.ts +2 -0
  71. package/dist/embed/adapters/sandbox-urls.js +1 -0
  72. package/dist/embed/app.css +2 -2
  73. package/dist/embed/handshake.js +5 -2
  74. package/dist/embed/packages/histoire-vue/src/components/embed/HistoireEmbed.js +6 -0
  75. package/dist/embed/packages/histoire-vue/src/components/preview/surface.js +11 -2
  76. package/dist/embed/surfaces.d.ts +2 -0
  77. package/dist/style.css +57 -13
  78. package/package.json +8 -8
  79. package/src/app/components/base/overflow/BaseOverflowToolbar.vue +1 -1
  80. package/src/app/components/base/overflow/BaseOverflowToolbarItem.vue +1 -1
  81. package/src/app/components/base/popover/BasePopover.vue +1 -1
  82. package/src/app/components/canvas/CanvasFrame.vue +47 -8
  83. package/src/app/components/canvas/CanvasReplicaPreview.vue +3 -1
  84. package/src/app/components/canvas/CanvasSingleVariant.vue +10 -5
  85. package/src/app/components/canvas/CanvasStatus.vue +6 -2
  86. package/src/app/components/canvas/CanvasViewport.vue +29 -10
  87. package/src/app/components/canvas/FramePaddingAligners.vue +44 -0
  88. package/src/app/components/canvas/SingleVariantResizeHandles.vue +3 -0
  89. package/src/app/components/canvas/frame-layout.ts +44 -23
  90. package/src/app/components/canvas/frame-props-override.ts +16 -2
  91. package/src/app/components/canvas/matrix/MatrixCell.vue +19 -6
  92. package/src/app/components/canvas/matrix/MatrixView.vue +10 -8
  93. package/src/app/components/canvas/matrix/matrix-layout.ts +32 -14
  94. package/src/app/components/canvas/matrix/matrix-registration.ts +4 -4
  95. package/src/app/components/canvas/single-resize.ts +4 -2
  96. package/src/app/components/canvas/single-viewport.ts +5 -0
  97. package/src/app/components/canvas/story-frame-size.ts +15 -0
  98. package/src/app/components/canvas/toolbar/ArrangeSwitch.vue +1 -1
  99. package/src/app/components/canvas/toolbar/CanvasToolbar.vue +1 -1
  100. package/src/app/components/canvas/toolbar/SearchMatchStepper.vue +1 -1
  101. package/src/app/components/canvas/toolbar/ToolSwitch.vue +1 -1
  102. package/src/app/components/canvas/toolbar/ViewportMenu.vue +46 -16
  103. package/src/app/components/canvas/toolbar/ZoomMenu.vue +13 -11
  104. package/src/app/components/canvas/toolbar/viewport-size.ts +14 -0
  105. package/src/app/components/canvas/useCanvasVariantSize.ts +24 -6
  106. package/src/app/components/canvas/useSingleVariantGeometry.ts +7 -4
  107. package/src/app/components/comments/prompt/AttachMenuPanel.vue +1 -1
  108. package/src/app/components/comments/prompt/PromptSuggestions.vue +1 -1
  109. package/src/app/components/embed/EmbedMenu.vue +8 -6
  110. package/src/app/components/inspector/InspectorTabs.vue +1 -1
  111. package/src/app/components/inspector/inspection/plugin.ts +1 -1
  112. package/src/app/components/marketplace/browse/CatalogState.vue +3 -0
  113. package/src/app/components/marketplace/detail/DetailHeader.vue +13 -5
  114. package/src/app/components/marketplace/install/use-install-wizard.ts +7 -2
  115. package/src/app/components/menu/ContextMenu.vue +1 -1
  116. package/src/app/components/menu/SubMenu.vue +1 -1
  117. package/src/app/components/pages/settings/PluginsSection.vue +4 -0
  118. package/src/app/components/pages/settings/plugins/use-plugin-updates.ts +3 -3
  119. package/src/app/components/shell/WorkbenchApp.vue +2 -2
  120. package/src/app/components/shell/WorkbenchPanelAction.vue +5 -3
  121. package/src/app/composables/canvas-settings.ts +23 -9
  122. package/src/app/standalone/workbench.ts +2 -0
  123. package/src/app/stores/canvas.ts +47 -7
  124. package/src/app/stores/marketplace.ts +1 -0
  125. package/src/app/stores/story-canvas-views.ts +15 -2
  126. package/src/app/style/theme.css +8 -0
  127. package/src/app/util/background.ts +7 -0
  128. package/src/app/util/frame-actions.ts +6 -0
  129. package/src/app/util/marketplace-client.ts +5 -2
  130. package/src/embed/EmbedDocument.vue +1 -1
  131. package/src/embed/adapters/explorer-session.ts +2 -2
  132. package/src/embed/adapters/explorer-view.ts +1 -1
  133. package/src/embed/adapters/local-mount.ts +1 -1
  134. package/src/embed/adapters/runtime-frame.ts +6 -1
  135. package/src/embed/adapters/sandbox-urls.ts +3 -0
  136. package/src/embed/handshake.ts +4 -2
  137. package/src/embed/surfaces.ts +2 -0
@@ -27,8 +27,13 @@ var EmbedDocument_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
27
27
  default: withCtx(() => [createVNode(unref(HistoireEmbed), {
28
28
  scope: __props.options.variantId === void 0 ? "story" : "variant",
29
29
  panels: __props.options.panels,
30
+ padding: __props.options.padding,
30
31
  onError: _cache[0] || (_cache[0] = ($event) => emit("error", $event))
31
- }, null, 8, ["scope", "panels"])]),
32
+ }, null, 8, [
33
+ "scope",
34
+ "panels",
35
+ "padding"
36
+ ])]),
32
37
  _: 1
33
38
  }, 8, ["session"])) : (openBlock(), createElementBlock("div", _hoisted_1, [__props.error ? (openBlock(), createBlock(WorkbenchEmptyState_default, {
34
39
  key: 0,
@@ -24,7 +24,7 @@ function createExplorerViewSession(context) {
24
24
  });
25
25
  const session = {
26
26
  ...context.session,
27
- mount(container, { surface }) {
27
+ mount(container, { surface, padding }) {
28
28
  if (!active) throw new HistoireSdkError("DISPOSED", "Explorer detached");
29
29
  const isPrimary = surface === "preview";
30
30
  if (surface === "explorer" || isPrimary && primary) throw new HistoireSdkError("RUNTIME_IN_USE", "Explorer already owns primary runtime");
@@ -36,6 +36,7 @@ function createExplorerViewSession(context) {
36
36
  sessionId: owner.sessionId,
37
37
  mountId,
38
38
  surface,
39
+ padding,
39
40
  hidden: false,
40
41
  container,
41
42
  target: snapshot.selection,
@@ -47,6 +47,7 @@ function createEmbedExplorerView(context) {
47
47
  }, { default: () => context.presentation ? h(HistoireEmbed, {
48
48
  scope: context.presentation.scope,
49
49
  panels: context.presentation.panels,
50
+ padding: context.padding,
50
51
  onReady: () => resolve(owner.runtime()),
51
52
  onError: reject
52
53
  }) : h(HistoireExplorer, {
@@ -83,7 +83,8 @@ function mountLocalHistoireSurface(context, sourceBase, standalone = false) {
83
83
  sourceBase,
84
84
  controlsCustomOnly: customOnly,
85
85
  standalone,
86
- presentation: context.presentation
86
+ presentation: context.presentation,
87
+ padding: context.padding
87
88
  });
88
89
  return instance;
89
90
  });
@@ -218,6 +218,11 @@ function createEmbedRuntimeFrame(context) {
218
218
  if (status === "absent") selected = null;
219
219
  if (publishNow) publish(status);
220
220
  }
221
+ /** Mount override first, then the story layout, then the project default; embeds draw no aligners. */
222
+ function embedPadding(target) {
223
+ const story = context.session.getSnapshot().catalog.stories.find((item) => item.id === target.storyId);
224
+ return context.padding ?? story?.layout?.padding ?? context.descriptor.framePadding ?? 0;
225
+ }
221
226
  /** New document minted before assigning src; WindowProxy equality cannot resurrect predecessor. */
222
227
  function navigate(target) {
223
228
  requests.invalidate();
@@ -235,7 +240,8 @@ function createEmbedRuntimeFrame(context) {
235
240
  target,
236
241
  documentId: owner.id,
237
242
  selectionVersion: owner.selectionVersion,
238
- standalone: context.standalone
243
+ standalone: context.standalone,
244
+ padding: embedPadding(target)
239
245
  });
240
246
  if (!iframe.isConnected) context.container.append(iframe);
241
247
  settings();
@@ -9,6 +9,8 @@ export interface RuntimeFrameUrlOptions {
9
9
  selectionVersion: number;
10
10
  /** Standalone workbench host, which forwards its own base presentation flags. */
11
11
  standalone?: boolean;
12
+ /** Embed gutter in CSS pixels; the canvas draws its own, so standalone hosts never pass it. */
13
+ padding?: number;
12
14
  }
13
15
  /**
14
16
  * Interactive primary runtime document (also used by canvas replicas and Matrix
@@ -18,6 +18,7 @@ function createRuntimeFrameUrl(base, options) {
18
18
  url.searchParams.set("selectionVersion", String(options.selectionVersion));
19
19
  url.searchParams.set("embed", "true");
20
20
  if (options.standalone) url.searchParams.set("standalone", "true");
21
+ else if (options.padding) url.searchParams.set("padding", String(options.padding));
21
22
  if (options.standalone && base.searchParams.get("nativeScroll") === "true") url.searchParams.set("nativeScroll", "true");
22
23
  if (options.standalone && base.searchParams.get("matrix") === "true") url.searchParams.set("matrix", "true");
23
24
  return url.href;
@@ -149,7 +149,7 @@ img.colorize-black[data-v-80027ef8] { filter: grayscale(100) brightness(0);
149
149
  --histoire-control-resolved-on-accent: var(--histoire-control-on-accent, var(--histoire-accent-foreground, #0d0e11));
150
150
  color-scheme: dark;
151
151
  }.histoire-wrapper { display: flex; flex-direction: column; gap: var(--histoire-control-gap, 8px); min-width: 0; max-width: 100%; padding: var(--histoire-control-wrapper-padding, 8px); margin: 0 0 var(--histoire-control-margin, 10px); }.histoire-wrapper:where([data-layout="inline"]) { display: inline-flex; padding: 0; margin: 0; vertical-align: middle; }.histoire-wrapper:where([data-layout="horizontal"]) { flex-direction: row; align-items: center; }.histoire-control-label { width: 100%; display: flex; align-items: baseline; gap: 8px; min-width: 0; font-family: var(--histoire-font-mono, "JetBrains Mono", ui-monospace, monospace); }.histoire-control-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.histoire-control-label-actions { display: inline-flex; flex: none; align-items: center; }.histoire-control-type { margin-inline-start: auto; color: var(--histoire-control-resolved-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.histoire-control-content { display: flex; align-items: center; gap: 6px; min-width: 0; width: 100%; }.histoire-control-value { display: block; flex: 1; min-width: 0; max-width: 100%; }.histoire-control-actions { display: inline-flex; flex: none; align-items: center; gap: 4px; }.histoire-prop-control { border-radius: var(--histoire-radius-button, 9px); }.histoire-prop-control:is(:hover, :focus-within) { background: color-mix(in srgb, var(--histoire-control-resolved-text) 3%, transparent); }:where(.histoire-prop-control) .histoire-control-label-actions { visibility: hidden; opacity: 0; pointer-events: none; }:where(.histoire-prop-control):is(:hover, :focus-within) .histoire-control-label-actions { visibility: visible; opacity: 1; pointer-events: auto; }:where(.histoire-prop-control) .histoire-control-label,
152
- :where(.histoire-prop-control-unavailable) .histoire-control-label { align-items: center; }.histoire-prop-control-reset { --histoire-icon-button-size: 24px; border-radius: 6px; }.histoire-prop-control-reset-icon { display: block; flex: none; color: var(--histoire-control-resolved-text); }.histoire-prop-control-unavailable { display: flex; flex-direction: column; gap: var(--histoire-control-gap, 8px); padding: var(--histoire-control-wrapper-padding, 8px); margin: 0 0 var(--histoire-control-margin, 10px); }:where(.histoire-wrapper):where([data-layout="horizontal"]) .histoire-control-label { width: auto; flex: none; }:where(.histoire-wrapper):where([data-layout="horizontal"]) .histoire-control-content { width: auto; flex: 1; }:where(.histoire-wrapper):where([data-layout="horizontal"]):has(.histoire-switch-input, .histoire-simple-checkbox) .histoire-control-label { flex: 1; }:where(.histoire-wrapper):where([data-layout="horizontal"]):has(.histoire-switch-input, .histoire-simple-checkbox) .histoire-control-content { flex: none; }.histoire-control-field, .histoire-select-trigger, .__histoire-json-code { box-sizing: border-box; width: 100%; min-width: 0; min-height: var(--histoire-control-height, 34px); margin: 0; padding: var(--histoire-control-padding, 7px) 9px; border: 1px solid var(--histoire-control-resolved-border); border-radius: 7px; background: var(--histoire-control-resolved-input); color: inherit; font: inherit; }textarea.histoire-control-field { resize: vertical; }.histoire-control-field::placeholder { color: var(--histoire-control-resolved-muted); opacity: 1; }:is(.histoire-control-field, .histoire-select-trigger):focus, .__histoire-json-code:focus-within { outline: none; border-color: var(--histoire-control-resolved-accent); }.histoire-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; padding: var(--histoire-control-padding, 7px) 10px; border: 1px solid var(--histoire-control-resolved-border); border-radius: 9px; background: var(--histoire-control-resolved-surface); cursor: pointer; }.histoire-button:where([data-color="flat"]):is([aria-pressed="true"], [aria-selected="true"], [aria-current="page"], [aria-checked="true"]) { background: var(--histoire-control-resolved-chip); color: var(--histoire-control-resolved-text); }.histoire-button:where([data-color="primary"]) { border-color: transparent; background: var(--histoire-control-resolved-accent); color: var(--histoire-control-resolved-on-accent); }.histoire-button:where([data-color="flat"]) { border-color: transparent; background: transparent; }.histoire-button:where(:not(:disabled)):hover { background: var(--histoire-control-resolved-chip); }.histoire-button:where([data-color="primary"]):where(:not(:disabled)):hover { background: color-mix(in srgb, var(--histoire-control-resolved-accent) 88%, #000); }.histoire-button:focus-visible { outline: 2px solid var(--histoire-control-resolved-accent); outline-offset: 2px; }/* Explicit opacity can hide disabled actions; disabled cursors still outrank field defaults. */:is(.histoire-button, .histoire-control-field, .histoire-select-trigger):where(:disabled), .histoire-wrapper:where([aria-disabled="true"]) { opacity: .45; }:is(.histoire-button, .histoire-control-field, .histoire-select-trigger):disabled, .histoire-wrapper[aria-disabled="true"] { cursor: default; }.histoire-select-trigger { display: flex; align-items: center; gap: 8px; text-align: start; cursor: pointer; }.histoire-select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }:is(.histoire-control-menu, .histoire-controls-options) { display: flex; flex-direction: column; max-height: min(360px, 80vh, var(--histoire-control-menu-boundary, 100vh)); overflow-y: auto; padding: 4px; border: 1px solid var(--histoire-control-resolved-border); border-radius: 9px; box-shadow: 0 8px 24px rgb(0 0 0 / .12); background: var(--histoire-control-resolved-surface); }:where(.histoire-control-menu, .histoire-controls-options) .histoire-button { flex: none; justify-content: flex-start; text-align: start; white-space: normal; overflow-wrap: anywhere; padding: 7px 9px; border-radius: 6px; }:where(.histoire-control-menu, .histoire-controls-options) .histoire-button:is([aria-selected="true"], :focus-visible) { background: var(--histoire-control-resolved-accent-soft); }.histoire-button-group-options { display: flex; flex-wrap: nowrap; gap: 3px; min-width: 0; padding: 3px; border-radius: 7px; background: var(--histoire-control-resolved-chip); }:where(.histoire-button-group-options) .histoire-button { flex: 1 1 0; min-width: 0; max-width: 100%; padding: max(2px, calc((var(--histoire-control-height, 34px) - 24px) / 2)) 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; border-radius: 6px; color: var(--histoire-control-resolved-muted); }:where(.histoire-button-group-options) .histoire-button:is([aria-pressed="true"], [aria-selected="true"]) { color: var(--histoire-control-resolved-text); background: var(--histoire-control-resolved-surface); box-shadow: 0 1px 3px rgb(0 0 0 / .08); font-weight: 700; }/* Bound both axes so flex/grid stretching and surrounding button padding cannot
152
+ :where(.histoire-prop-control-unavailable) .histoire-control-label { align-items: center; }.histoire-prop-control-reset { --histoire-icon-button-size: 24px; border-radius: 6px; }.histoire-prop-control-reset-icon { display: block; flex: none; color: var(--histoire-control-resolved-text); }.histoire-prop-control-unavailable { display: flex; flex-direction: column; gap: var(--histoire-control-gap, 8px); padding: var(--histoire-control-wrapper-padding, 8px); margin: 0 0 var(--histoire-control-margin, 10px); }:where(.histoire-wrapper):where([data-layout="horizontal"]) .histoire-control-label { width: auto; flex: none; }:where(.histoire-wrapper):where([data-layout="horizontal"]) .histoire-control-content { width: auto; flex: 1; }:where(.histoire-wrapper):where([data-layout="horizontal"]):has(.histoire-switch-input, .histoire-simple-checkbox) .histoire-control-label { flex: 1; }:where(.histoire-wrapper):where([data-layout="horizontal"]):has(.histoire-switch-input, .histoire-simple-checkbox) .histoire-control-content { flex: none; }.histoire-control-field, .histoire-select-trigger, .__histoire-json-code { box-sizing: border-box; width: 100%; min-width: 0; min-height: var(--histoire-control-height, 34px); margin: 0; padding: var(--histoire-control-padding, 7px) 9px; border: 1px solid var(--histoire-control-resolved-border); border-radius: 7px; background: var(--histoire-control-resolved-input); color: inherit; font: inherit; }textarea.histoire-control-field { resize: vertical; }.histoire-control-field::placeholder { color: var(--histoire-control-resolved-muted); opacity: 1; }:is(.histoire-control-field, .histoire-select-trigger):focus, .__histoire-json-code:focus-within { outline: none; border-color: var(--histoire-control-resolved-accent); }.histoire-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; padding: var(--histoire-control-padding, 7px) 10px; border: 1px solid var(--histoire-control-resolved-border); border-radius: 9px; background: var(--histoire-control-resolved-surface); cursor: pointer; }.histoire-button:where([data-color="flat"]):is([aria-pressed="true"], [aria-selected="true"], [aria-current="page"], [aria-checked="true"]) { background: var(--histoire-control-resolved-chip); color: var(--histoire-control-resolved-text); }.histoire-button:where([data-color="primary"]) { border-color: transparent; background: var(--histoire-control-resolved-accent); color: var(--histoire-control-resolved-on-accent); }.histoire-button:where([data-color="flat"]) { border-color: transparent; background: transparent; }.histoire-button:where(:not(:disabled)):hover { background: var(--histoire-control-resolved-chip); }.histoire-button:where([data-color="primary"]):where(:not(:disabled)):hover { background: color-mix(in srgb, var(--histoire-control-resolved-accent) 88%, #000); }.histoire-button:focus-visible { outline: 2px solid var(--histoire-control-resolved-accent); outline-offset: 2px; }/* Explicit opacity can hide disabled actions; disabled cursors still outrank field defaults. */:is(.histoire-button, .histoire-control-field, .histoire-select-trigger):where(:disabled), .histoire-wrapper:where([aria-disabled="true"]) { opacity: .45; }:is(.histoire-button, .histoire-control-field, .histoire-select-trigger):disabled, .histoire-wrapper[aria-disabled="true"] { cursor: default; }.histoire-select-trigger { display: flex; align-items: center; gap: 8px; text-align: start; cursor: pointer; }.histoire-select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }:is(.histoire-control-menu, .histoire-controls-options) { display: flex; flex-direction: column; row-gap: 1px; max-height: min(360px, 80vh, var(--histoire-control-menu-boundary, 100vh)); overflow-y: auto; padding: 4px; border: 1px solid var(--histoire-control-resolved-border); border-radius: 9px; box-shadow: 0 8px 24px rgb(0 0 0 / .12); background: var(--histoire-control-resolved-surface); }:where(.histoire-control-menu, .histoire-controls-options) .histoire-button { flex: none; justify-content: flex-start; text-align: start; white-space: normal; overflow-wrap: anywhere; padding: 7px 9px; border-radius: 6px; }:where(.histoire-control-menu, .histoire-controls-options) .histoire-button:is([aria-selected="true"], :focus-visible) { background: var(--histoire-control-resolved-accent-soft); }.histoire-button-group-options { display: flex; flex-wrap: nowrap; gap: 3px; min-width: 0; padding: 3px; border-radius: 7px; background: var(--histoire-control-resolved-chip); }:where(.histoire-button-group-options) .histoire-button { flex: 1 1 0; min-width: 0; max-width: 100%; padding: max(2px, calc((var(--histoire-control-height, 34px) - 24px) / 2)) 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; border-radius: 6px; color: var(--histoire-control-resolved-muted); }:where(.histoire-button-group-options) .histoire-button:is([aria-pressed="true"], [aria-selected="true"]) { color: var(--histoire-control-resolved-text); background: var(--histoire-control-resolved-surface); box-shadow: 0 1px 3px rgb(0 0 0 / .08); font-weight: 700; }/* Bound both axes so flex/grid stretching and surrounding button padding cannot
153
153
  turn an icon action into a rectangle. Hosts customize only the shared size. */:where(.histoire-button).histoire-icon-button, a.histoire-icon-button {
154
154
  box-sizing: border-box;
155
155
  display: inline-flex; align-items: center; justify-content: center;
@@ -161,7 +161,7 @@ img.colorize-black[data-v-80027ef8] { filter: grayscale(100) brightness(0);
161
161
  min-height: var(--histoire-icon-button-size, var(--histoire-control-height, 32px));
162
162
  max-height: var(--histoire-icon-button-size, var(--histoire-control-height, 32px));
163
163
  padding: 0;
164
- }.histoire-switch-input { appearance: none; display: block; flex: none; width: 36px; height: 20px; margin: 0; border: 0; border-radius: 12px; background: var(--histoire-control-resolved-border); cursor: pointer; }.histoire-switch-input::before { content: ''; display: block; width: 16px; height: 16px; margin: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .14); transition: transform 120ms ease-out; }.histoire-switch-input:checked { background: var(--histoire-control-resolved-accent); }.histoire-switch-input:checked::before { transform: translateX(16px); }.histoire-switch-input:focus-visible { outline: 2px solid var(--histoire-control-resolved-accent); outline-offset: 3px; }.histoire-switch-input:disabled { opacity: .45; cursor: default; }.histoire-checkbox { cursor: pointer; }.histoire-checkbox:focus-visible { outline: 2px solid var(--histoire-control-resolved-accent); outline-offset: -2px; border-radius: 7px; }/* Keep the line box stable when the checkmark changes the inline grid's baseline. */.histoire-simple-checkbox { display: inline-grid; vertical-align: middle; place-items: center; width: 16px; height: 16px; border: 1px solid var(--histoire-control-resolved-border); border-radius: 4px; background: var(--histoire-control-resolved-input); }.histoire-simple-checkbox:where([data-checked="true"]) { background: var(--histoire-control-resolved-accent); border-color: var(--histoire-control-resolved-accent); color: #fff; }.histoire-choice-list { display: flex; flex-direction: column; gap: 6px; }.histoire-choice-list label { position: relative; display: flex; align-items: center; gap: 8px; cursor: pointer; }.histoire-choice-list input { accent-color: var(--histoire-control-resolved-accent); }.__histoire-json-code { height: 192px; min-height: 128px; padding: 0; overflow: auto; resize: vertical; }:where(.__histoire-json-code) .cm-editor { min-width: 0; }.histoire-controls-tooltip { padding: 4px 8px; background: var(--histoire-control-resolved-surface); border: 1px solid var(--histoire-control-resolved-border); border-radius: 7px; box-shadow: 0 4px 12px rgb(0 0 0 / .1); }:is(.histoire-wrapper, .histoire-control-menu) ::selection { color: var(--histoire-control-resolved-text); background: var(--histoire-control-resolved-accent-soft); }@media (prefers-reduced-motion: reduce) { .histoire-switch-input::before { transition: none; } }:is(.histoire-token-grid, .histoire-token-list, .histoire-color-shades, .histoire-controls-floating-tooltip, .histoire-control-popover, .histoire-button-group-options) pre { font-family: var(--histoire-font-mono, "JetBrains Mono", ui-monospace, monospace); font-size: 13px; }:where(.histoire-control-content):has(.histoire-switch-input, .histoire-simple-checkbox) .histoire-control-value { flex: none; }.histoire-color-fields { display: flex; gap: 6px; }.histoire-color-fields > input:where([type="color"]) { flex: none; width: var(--histoire-control-height, 34px); height: var(--histoire-control-height, 34px); padding: 2px; border: 1px solid var(--histoire-control-resolved-border); border-radius: 7px; background: var(--histoire-control-resolved-input); }:where(.histoire-controls-floating-tooltip) .v-popper__inner { font: inherit; color: var(--histoire-control-resolved-text); background: var(--histoire-control-resolved-surface); border: 1px solid var(--histoire-control-resolved-border); border-radius: 7px; padding: 4px 8px; box-shadow: 0 4px 12px rgb(0 0 0 / .1); }:where(.histoire-controls-floating-tooltip) .v-popper__arrow-container { display: none; }.histoire-choice-list label:has(input:disabled) { opacity: .45; cursor: default; }.histoire-choice-list input:where([type="checkbox"]) { position: absolute; opacity: 0; width: 16px; height: 16px; margin: 0; }:where(.histoire-choice-list) input:where([type="checkbox"]) + .histoire-simple-checkbox { pointer-events: none; }.histoire-choice-list input:focus-visible { outline: 2px solid var(--histoire-control-resolved-accent); outline-offset: 3px; }:where(.histoire-choice-list) input:where([type="checkbox"]):focus-visible + .histoire-simple-checkbox { outline: 2px solid var(--histoire-control-resolved-accent); outline-offset: 3px; }.histoire-choice-list input:where([type="radio"]) { appearance: none; flex: none; width: 16px; height: 16px; margin: 0; border: 1px solid var(--histoire-control-resolved-border); border-radius: 50%; background: var(--histoire-control-resolved-input); }.histoire-choice-list input:where([type="radio"]):checked { border-color: var(--histoire-control-resolved-accent); background: radial-gradient(circle, var(--histoire-control-resolved-accent) 0 4px, var(--histoire-control-resolved-input) 4.5px); }.histoire-control-popover { overflow: auto; padding: 6px; border: 1px solid var(--histoire-control-resolved-border); border-radius: 9px; background: var(--histoire-control-resolved-surface); box-shadow: 0 8px 24px rgb(0 0 0 / .12); }:where(.histoire-control-popover) .histoire-button:where([role="menuitem"]):focus-visible { background: var(--histoire-control-resolved-chip); }.htw-range-input:focus-visible { outline: 2px solid var(--histoire-control-resolved-accent); outline-offset: 2px; border-radius: 7px; }.htw-range-input:disabled { opacity: .45; cursor: default; }/* Explicit tones retain state-level priority, including pressed buttons. */.histoire-button:where([data-color="flat"])[data-tone="accent"] { color: var(--histoire-control-resolved-accent); }.histoire-wrapper:where([data-block]),
164
+ }/* Anchor the thumb to the track so Firefox cannot collapse its top margin. */.histoire-switch-input { appearance: none; position: relative; display: block; flex: none; width: 36px; height: 20px; margin: 0; border: 0; border-radius: 12px; background: var(--histoire-control-resolved-border); cursor: pointer; }.histoire-switch-input::before { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .14); transition: transform 120ms ease-out; }.histoire-switch-input:checked { background: var(--histoire-control-resolved-accent); }.histoire-switch-input:checked::before { transform: translateX(16px); }.histoire-switch-input:focus-visible { outline: 2px solid var(--histoire-control-resolved-accent); outline-offset: 3px; }.histoire-switch-input:disabled { opacity: .45; cursor: default; }.histoire-checkbox { cursor: pointer; }.histoire-checkbox:focus-visible { outline: 2px solid var(--histoire-control-resolved-accent); outline-offset: -2px; border-radius: 7px; }/* Keep the line box stable when the checkmark changes the inline grid's baseline. */.histoire-simple-checkbox { display: inline-grid; vertical-align: middle; place-items: center; width: 16px; height: 16px; border: 1px solid var(--histoire-control-resolved-border); border-radius: 4px; background: var(--histoire-control-resolved-input); }.histoire-simple-checkbox:where([data-checked="true"]) { background: var(--histoire-control-resolved-accent); border-color: var(--histoire-control-resolved-accent); color: #fff; }.histoire-choice-list { display: flex; flex-direction: column; gap: 6px; }.histoire-choice-list label { position: relative; display: flex; align-items: center; gap: 8px; cursor: pointer; }.histoire-choice-list input { accent-color: var(--histoire-control-resolved-accent); }.__histoire-json-code { height: 192px; min-height: 128px; padding: 0; overflow: auto; resize: vertical; }:where(.__histoire-json-code) .cm-editor { min-width: 0; }.histoire-controls-tooltip { padding: 4px 8px; background: var(--histoire-control-resolved-surface); border: 1px solid var(--histoire-control-resolved-border); border-radius: 7px; box-shadow: 0 4px 12px rgb(0 0 0 / .1); }:is(.histoire-wrapper, .histoire-control-menu) ::selection { color: var(--histoire-control-resolved-text); background: var(--histoire-control-resolved-accent-soft); }@media (prefers-reduced-motion: reduce) { .histoire-switch-input::before { transition: none; } }:is(.histoire-token-grid, .histoire-token-list, .histoire-color-shades, .histoire-controls-floating-tooltip, .histoire-control-popover, .histoire-button-group-options) pre { font-family: var(--histoire-font-mono, "JetBrains Mono", ui-monospace, monospace); font-size: 13px; }:where(.histoire-control-content):has(.histoire-switch-input, .histoire-simple-checkbox) .histoire-control-value { flex: none; }.histoire-color-fields { display: flex; gap: 6px; }.histoire-color-fields > input:where([type="color"]) { flex: none; width: var(--histoire-control-height, 34px); height: var(--histoire-control-height, 34px); padding: 2px; border: 1px solid var(--histoire-control-resolved-border); border-radius: 7px; background: var(--histoire-control-resolved-input); }:where(.histoire-controls-floating-tooltip) .v-popper__inner { font: inherit; color: var(--histoire-control-resolved-text); background: var(--histoire-control-resolved-surface); border: 1px solid var(--histoire-control-resolved-border); border-radius: 7px; padding: 4px 8px; box-shadow: 0 4px 12px rgb(0 0 0 / .1); }:where(.histoire-controls-floating-tooltip) .v-popper__arrow-container { display: none; }.histoire-choice-list label:has(input:disabled) { opacity: .45; cursor: default; }.histoire-choice-list input:where([type="checkbox"]) { position: absolute; opacity: 0; width: 16px; height: 16px; margin: 0; }:where(.histoire-choice-list) input:where([type="checkbox"]) + .histoire-simple-checkbox { pointer-events: none; }.histoire-choice-list input:focus-visible { outline: 2px solid var(--histoire-control-resolved-accent); outline-offset: 3px; }:where(.histoire-choice-list) input:where([type="checkbox"]):focus-visible + .histoire-simple-checkbox { outline: 2px solid var(--histoire-control-resolved-accent); outline-offset: 3px; }.histoire-choice-list input:where([type="radio"]) { appearance: none; flex: none; width: 16px; height: 16px; margin: 0; border: 1px solid var(--histoire-control-resolved-border); border-radius: 50%; background: var(--histoire-control-resolved-input); }.histoire-choice-list input:where([type="radio"]):checked { border-color: var(--histoire-control-resolved-accent); background: radial-gradient(circle, var(--histoire-control-resolved-accent) 0 4px, var(--histoire-control-resolved-input) 4.5px); }.histoire-control-popover { overflow: auto; padding: 6px; border: 1px solid var(--histoire-control-resolved-border); border-radius: 9px; background: var(--histoire-control-resolved-surface); box-shadow: 0 8px 24px rgb(0 0 0 / .12); }:where(.histoire-control-popover) .histoire-button:where([role="menuitem"]):focus-visible { background: var(--histoire-control-resolved-chip); }.htw-range-input:focus-visible { outline: 2px solid var(--histoire-control-resolved-accent); outline-offset: 2px; border-radius: 7px; }.htw-range-input:disabled { opacity: .45; cursor: default; }/* Explicit tones retain state-level priority, including pressed buttons. */.histoire-button:where([data-color="flat"])[data-tone="accent"] { color: var(--histoire-control-resolved-accent); }.histoire-wrapper:where([data-block]),
165
165
  :where(.histoire-wrapper[data-block]) > .histoire-control-content,
166
166
  :where(.histoire-wrapper[data-block] > .histoire-control-content) > .histoire-control-value,
167
167
  .histoire-button-group-options:where([data-block]) { width: 100%; }.histoire-button:where([data-color="flat"])[data-tone="danger"] { color: var(--histoire-danger-text, var(--histoire-control-resolved-danger)); }
@@ -2,7 +2,7 @@ import { dispatchEmbedCommand, projectEmbedDescriptor } from "./commands.js";
2
2
  import { createEmbedDocumentLifecycle } from "./lifecycle.js";
3
3
  import { assertEmbedSurface, mountEmbedSurface } from "./surfaces.js";
4
4
  import { createParentViewSession } from "./view-session.js";
5
- import { HistoireSdkError, negotiateHistoireProtocol, parseEmbedPresentation, validateEmbedOrigin, validateHistoireHello } from "@histoire/protocol";
5
+ import { HistoireSdkError, negotiateHistoireProtocol, parseEmbedPadding, parseEmbedPresentation, validateEmbedOrigin, validateHistoireHello } from "@histoire/protocol";
6
6
  import { createBridgePort, getBridgeSurfaceRole } from "@histoire/sdk/internal";
7
7
  // src/embed/handshake.ts
8
8
  /** Install immediately so descriptor fetch cannot lose initial parent hello. */
@@ -41,6 +41,8 @@ function installEmbedHandshake(sourcePromise, window = globalThis.window) {
41
41
  if (surface) assertEmbedSurface(surface);
42
42
  const presentation = parseEmbedPresentation(hints);
43
43
  if (presentation && surface !== "explorer") throw new HistoireSdkError("INVALID_ARGUMENT", "Embed presentation requires explorer surface");
44
+ const padding = parseEmbedPadding(hints);
45
+ if (padding !== void 0 && surface !== "preview" && !presentation) throw new HistoireSdkError("INVALID_ARGUMENT", "Embed padding requires a preview surface or an explorer embed presentation");
44
46
  const descriptor = projectEmbedDescriptor(source.descriptor, parentOrigin, window.location.origin, source.allowedOrigins);
45
47
  const owner = {
46
48
  protocolVersion,
@@ -85,7 +87,8 @@ function installEmbedHandshake(sourcePromise, window = globalThis.window) {
85
87
  signal: lifecycle.signal,
86
88
  controlsCustomOnly,
87
89
  sourceBase: new URL("./", window.location.href).href,
88
- presentation
90
+ presentation,
91
+ padding
89
92
  });
90
93
  lifecycle.add(() => instance?.close());
91
94
  const capture = {
@@ -20,6 +20,11 @@ var HistoireEmbed = defineComponent({
20
20
  panels: {
21
21
  type: Array,
22
22
  default: () => ["controls"]
23
+ },
24
+ /** Gutter in CSS pixels around the variant, replacing the story and project padding. */
25
+ padding: {
26
+ type: Number,
27
+ default: void 0
23
28
  }
24
29
  },
25
30
  emits: ["ready", "error"],
@@ -81,6 +86,7 @@ var HistoireEmbed = defineComponent({
81
86
  "class": "histoire-embed-canvas",
82
87
  "aria-label": "Canvas"
83
88
  }, [h(HistoirePreview, {
89
+ padding: props.padding,
84
90
  onReady: () => active && emit("ready"),
85
91
  onError: error
86
92
  }, slots.canvas)]), panels.value.length ? h(EmbedPanels, {
@@ -11,13 +11,19 @@ function createHistoirePrimary(name, surface) {
11
11
  return defineComponent({
12
12
  name,
13
13
  inheritAttrs: false,
14
+ props: {
15
+ /** Gutter in CSS pixels around the variant, replacing the story and project padding. */
16
+ padding: {
17
+ type: Number,
18
+ default: void 0
19
+ } },
14
20
  emits: {
15
21
  /** Fires after source runtime readiness, including explicit empty-book readiness. */
16
22
  ready: () => true,
17
23
  /** Typed source/runtime or primary ownership failure. */
18
24
  error: (_error) => true
19
25
  },
20
- setup(_props, { attrs, slots, emit, expose }) {
26
+ setup(props, { attrs, slots, emit, expose }) {
21
27
  const context = useHistoireContext();
22
28
  const session = context.session;
23
29
  const initial = session.getSnapshot();
@@ -72,7 +78,10 @@ function createHistoirePrimary(name, surface) {
72
78
  onMounted(() => {
73
79
  if (removed || !container.value) return;
74
80
  try {
75
- mount = session.mount(container.value, { surface });
81
+ mount = session.mount(container.value, {
82
+ surface,
83
+ ...props.padding === void 0 ? {} : { padding: props.padding }
84
+ });
76
85
  stopReadiness = session.subscribe(synchronizeReadiness);
77
86
  stopFocus = subscribeHistoireMountEvents(mount, (event) => {
78
87
  if (event.event !== "focus.changed") return;
@@ -6,6 +6,8 @@ export interface EmbedSurfaceContext {
6
6
  standalone?: boolean;
7
7
  /** Scoped explorer UI, independent of parent bridge authority. */
8
8
  presentation?: HistoireEmbedPresentation;
9
+ /** Variant gutter override in CSS pixels, replacing the story and project padding. */
10
+ padding?: number;
9
11
  /** Explicit source base for local standalone mounts whose route changes independently. */
10
12
  sourceBase?: string;
11
13
  /** Native provider renders generic editors locally; independent iframe defaults to full panel. */
package/dist/style.css CHANGED
@@ -1,8 +1,6 @@
1
1
 
2
- @layer properties;
3
- @layer histoire-document-reset, theme, base, histoire-base, components, histoire-components, utilities, histoire-utilities;
4
- @layer properties;
5
- @layer histoire-document-reset, theme, base, histoire-base, histoire-base, components, histoire-components, histoire-components, utilities, histoire-utilities, histoire-utilities;
2
+ @layer histoire-document-reset;
3
+ @layer histoire-document-reset;
6
4
  @property --tw-border-style {
7
5
  syntax: "*";
8
6
  inherits: false;
@@ -779,6 +777,7 @@
779
777
  background: var(--histoire-control-resolved-surface);
780
778
  border-radius: 9px;
781
779
  flex-direction: column;
780
+ row-gap: 1px;
782
781
  padding: 4px;
783
782
  display: flex;
784
783
  overflow-y: auto;
@@ -848,6 +847,7 @@
848
847
  height: 20px;
849
848
  margin: 0;
850
849
  display: block;
850
+ position: relative;
851
851
  }
852
852
  .histoire-switch-input:before {
853
853
  content: "";
@@ -855,9 +855,10 @@
855
855
  border-radius: 50%;
856
856
  width: 16px;
857
857
  height: 16px;
858
- margin: 2px;
859
858
  transition: transform .12s ease-out;
860
- display: block;
859
+ position: absolute;
860
+ top: 2px;
861
+ left: 2px;
861
862
  box-shadow: 0 1px 2px #00000024;
862
863
  }
863
864
  .histoire-switch-input:checked {
@@ -1547,6 +1548,7 @@
1547
1548
  background: var(--histoire-control-resolved-surface);
1548
1549
  border-radius: 9px;
1549
1550
  flex-direction: column;
1551
+ row-gap: 1px;
1550
1552
  padding: 4px;
1551
1553
  display: flex;
1552
1554
  overflow-y: auto;
@@ -1616,6 +1618,7 @@
1616
1618
  height: 20px;
1617
1619
  margin: 0;
1618
1620
  display: block;
1621
+ position: relative;
1619
1622
  }
1620
1623
  :where(.histoire-provider) .histoire-switch-input:before {
1621
1624
  content: "";
@@ -1623,9 +1626,10 @@
1623
1626
  border-radius: 50%;
1624
1627
  width: 16px;
1625
1628
  height: 16px;
1626
- margin: 2px;
1627
1629
  transition: transform .12s ease-out;
1628
- display: block;
1630
+ position: absolute;
1631
+ top: 2px;
1632
+ left: 2px;
1629
1633
  box-shadow: 0 1px 2px #00000024;
1630
1634
  }
1631
1635
  :where(.histoire-provider) .histoire-switch-input:checked {
@@ -2300,6 +2304,9 @@
2300
2304
  color: var(--histoire-tests-failed-text);
2301
2305
  }
2302
2306
  :where(.histoire-provider) .histoire-tests-run-menu {
2307
+ display: flex;
2308
+ flex-direction: column;
2309
+ row-gap: 1px;
2303
2310
  min-width: 156px;
2304
2311
  }
2305
2312
  :where(.histoire-provider) .histoire-tests-run-menu .histoire-button {
@@ -2667,6 +2674,7 @@
2667
2674
  :where(.histoire-provider) .histoire-preset-menu {
2668
2675
  display: flex;
2669
2676
  flex-direction: column;
2677
+ row-gap: 1px;
2670
2678
  }
2671
2679
  :where(.histoire-provider) .histoire-preset-menu :where(button) {
2672
2680
  width: 100%;
@@ -3923,6 +3931,12 @@
3923
3931
  .htw\:box-border {
3924
3932
  box-sizing: border-box;
3925
3933
  }
3934
+ .htw\:menu-rows {
3935
+ display: grid;
3936
+ grid-template-columns: minmax(0, 1fr);
3937
+ align-content: start;
3938
+ row-gap: 1px;
3939
+ }
3926
3940
  .htw\:block {
3927
3941
  display: block;
3928
3942
  }
@@ -5406,6 +5420,9 @@
5406
5420
  .htw\:px-0 {
5407
5421
  padding-inline: 0px;
5408
5422
  }
5423
+ .htw\:px-0\.5 {
5424
+ padding-inline: calc(var(--htw-spacing) * 0.5);
5425
+ }
5409
5426
  .htw\:px-1 {
5410
5427
  padding-inline: var(--htw-spacing);
5411
5428
  }
@@ -6090,6 +6107,9 @@
6090
6107
  .htw\:opacity-0 {
6091
6108
  opacity: 0%;
6092
6109
  }
6110
+ .htw\:opacity-15 {
6111
+ opacity: 15%;
6112
+ }
6093
6113
  .htw\:opacity-40 {
6094
6114
  opacity: 40%;
6095
6115
  }
@@ -6166,6 +6186,15 @@
6166
6186
  transition-timing-function: var(--tw-ease, var(--htw-default-transition-timing-function));
6167
6187
  transition-duration: var(--tw-duration, var(--htw-default-transition-duration));
6168
6188
  }
6189
+ .htw\:transition-transform {
6190
+ transition-property: transform, translate, scale, rotate;
6191
+ transition-timing-function: var(--tw-ease, var(--htw-default-transition-timing-function));
6192
+ transition-duration: var(--tw-duration, var(--htw-default-transition-duration));
6193
+ }
6194
+ .htw\:duration-500 {
6195
+ --tw-duration: 500ms;
6196
+ transition-duration: 500ms;
6197
+ }
6169
6198
  .htw\:duration-\[160ms\] {
6170
6199
  --tw-duration: 160ms;
6171
6200
  transition-duration: 160ms;
@@ -6376,6 +6405,9 @@
6376
6405
  .htw\:group-hover\/file\:text-accent:is(:where(.htw\:group\/file):hover *) {
6377
6406
  color: rgb(var(--histoire-accent-rgb) / var(--histoire-accent-alpha, 1));
6378
6407
  }
6408
+ .htw\:group-hover\/frame\:opacity-100:is(:where(.htw\:group\/frame):hover *) {
6409
+ opacity: 100%;
6410
+ }
6379
6411
  .htw\:group-hover\/visual-row\:opacity-100:is(:where(.htw\:group\/visual-row):hover *) {
6380
6412
  opacity: 100%;
6381
6413
  }
@@ -6469,6 +6501,9 @@
6469
6501
  .htw\:group-data-\[selected\=true\]\/frame\:text-accent:is(:where(.htw\:group\/frame)[data-selected="true"] *) {
6470
6502
  color: rgb(var(--histoire-accent-rgb) / var(--histoire-accent-alpha, 1));
6471
6503
  }
6504
+ .htw\:group-data-\[selected\=true\]\/frame\:opacity-100:is(:where(.htw\:group\/frame)[data-selected="true"] *) {
6505
+ opacity: 100%;
6506
+ }
6472
6507
  .htw\:group-data-\[dimmed\=true\]\/frame\:group-data-\[selected\=true\]\/frame\:opacity-35:is(:where(.htw\:group\/frame)[data-dimmed="true"] *):is(:where(.htw\:group\/frame)[data-selected="true"] *) {
6473
6508
  opacity: 35%;
6474
6509
  }
@@ -6525,8 +6560,8 @@
6525
6560
  .htw\:group-data-\[toolbar-presentation\=menu\]\/overflow-item\:items-stretch:is(:where(.htw\:group\/overflow-item)[data-toolbar-presentation="menu"] *) {
6526
6561
  align-items: stretch;
6527
6562
  }
6528
- .htw\:group-data-\[toolbar-presentation\=menu\]\/overflow-item\:gap-0:is(:where(.htw\:group\/overflow-item)[data-toolbar-presentation="menu"] *) {
6529
- gap: 0px;
6563
+ .htw\:group-data-\[toolbar-presentation\=menu\]\/overflow-item\:gap-px:is(:where(.htw\:group\/overflow-item)[data-toolbar-presentation="menu"] *) {
6564
+ gap: 1px;
6530
6565
  }
6531
6566
  .htw\:placeholder\:text-muted::placeholder {
6532
6567
  color: rgb(var(--histoire-muted-rgb) / var(--histoire-muted-alpha, 1));
@@ -7158,12 +7193,12 @@
7158
7193
  .htw\:data-\[presentation\=menu\]\:justify-start[data-presentation="menu"] {
7159
7194
  justify-content: flex-start;
7160
7195
  }
7161
- .htw\:data-\[presentation\=menu\]\:gap-0[data-presentation="menu"] {
7162
- gap: 0px;
7163
- }
7164
7196
  .htw\:data-\[presentation\=menu\]\:gap-\[9px\][data-presentation="menu"] {
7165
7197
  gap: 9px;
7166
7198
  }
7199
+ .htw\:data-\[presentation\=menu\]\:gap-px[data-presentation="menu"] {
7200
+ gap: 1px;
7201
+ }
7167
7202
  .htw\:data-\[presentation\=menu\]\:bg-transparent[data-presentation="menu"] {
7168
7203
  background-color: transparent;
7169
7204
  }
@@ -7182,6 +7217,15 @@
7182
7217
  .htw\:data-\[presentation\=menu\]\:whitespace-normal[data-presentation="menu"] {
7183
7218
  white-space: normal;
7184
7219
  }
7220
+ .htw\:data-\[remount\=true\]\:pe-6[data-remount="true"] {
7221
+ padding-inline-end: calc(var(--htw-spacing) * 6);
7222
+ }
7223
+ .htw\:data-\[remounting\=true\]\:text-accent[data-remounting="true"] {
7224
+ color: rgb(var(--histoire-accent-rgb) / var(--histoire-accent-alpha, 1));
7225
+ }
7226
+ .htw\:data-\[remounting\=true\]\:opacity-100[data-remounting="true"] {
7227
+ opacity: 100%;
7228
+ }
7185
7229
  .htw\:data-\[resizing\=true\]\:after\:bg-accent[data-resizing="true"]::after {
7186
7230
  content: var(--tw-content);
7187
7231
  background-color: rgb(var(--histoire-accent-rgb) / var(--histoire-accent-alpha, 1));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@histoire/app",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.2",
4
+ "version": "1.0.0-beta.3",
5
5
  "description": "Pre-bundled UI for Histoire",
6
6
  "author": {
7
7
  "name": "Guillaume Chau"
@@ -36,13 +36,13 @@
36
36
  "fuse.js": "^7.0.0",
37
37
  "markdown-it": "^14.1.0",
38
38
  "shiki": "^3.0.0",
39
- "@histoire/controls": "^1.0.0-beta.2",
40
- "@histoire/plugin-kit": "1.0.0-beta.2",
41
- "@histoire/protocol": "^1.0.0-beta.2",
42
- "@histoire/sdk": "^1.0.0-beta.2",
43
- "@histoire/vendors": "^1.0.0-beta.2",
44
- "@histoire/vue": "^1.0.0-beta.2",
45
- "@histoire/shared": "^1.0.0-beta.2"
39
+ "@histoire/controls": "^1.0.0-beta.3",
40
+ "@histoire/plugin-kit": "1.0.0-beta.3",
41
+ "@histoire/protocol": "^1.0.0-beta.3",
42
+ "@histoire/sdk": "^1.0.0-beta.3",
43
+ "@histoire/shared": "^1.0.0-beta.3",
44
+ "@histoire/vue": "^1.0.0-beta.3",
45
+ "@histoire/vendors": "^1.0.0-beta.3"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@fontsource-variable/jetbrains-mono": "^5.3.0",
@@ -103,7 +103,7 @@ function keyboard(event: KeyboardEvent): void {
103
103
  </div>
104
104
  <ToolbarButton :ref="setTrigger" class="htw:flex-none htw:[&[hidden]]:hidden" :hidden="!overflowing" :label="overflowLabel" icon="chevron-down" aria-haspopup="menu" :aria-expanded="open" @click="open ? close(true) : show()" @keydown="triggerKey" />
105
105
  <BasePopover :open="open" :anchor="trigger" :label="overflowLabel" role="menu" :scope="scope" :overlay-target="props.overlayTarget" :bounds="props.bounds" :focus-last="focusLast" persistent @update:open="close">
106
- <div @keydown="keyboard">
106
+ <div class="htw:menu-rows" @keydown="keyboard">
107
107
  <div v-for="item in items" :key="item.id" :ref="element => setHost(item.id, element)" class="htw:[&[hidden]]:hidden" :hidden="!item.overflow.value || item.empty.value" />
108
108
  </div>
109
109
  </BasePopover>
@@ -28,7 +28,7 @@ onBeforeUnmount(() => dispose?.())
28
28
  <span ref="marker" class="htw:hidden" aria-hidden="true" />
29
29
  <Teleport :disabled="!overflow" :to="toolbar.hosts.get(id) ?? 'body'">
30
30
  <div ref="element" class="overflow-toolbar-item htw:group/overflow-item htw:flex htw:flex-none htw:items-center htw:gap-[3px] htw:w-max htw:[&[hidden]]:hidden htw:data-[toolbar-presentation=menu]:flex-col htw:data-[toolbar-presentation=menu]:items-stretch htw:data-[toolbar-presentation=menu]:w-full htw:data-[toolbar-presentation=menu]:gap-0 htw:data-[separator=true]:before:content-[''] htw:before:hidden htw:data-[separator=true]:before:block htw:before:flex-none htw:before:w-px htw:before:h-4 htw:before:mx-[3px] htw:before:bg-border htw:data-[toolbar-presentation=menu]:before:w-auto htw:data-[toolbar-presentation=menu]:before:h-px htw:data-[toolbar-presentation=menu]:before:my-[5px]" :data-toolbar-presentation="overflow ? 'menu' : 'inline'" :data-separator="separator" :hidden="empty">
31
- <div class="htw:flex htw:items-center htw:gap-[3px] htw:w-max htw:group-data-[toolbar-presentation=menu]/overflow-item:flex-col htw:group-data-[toolbar-presentation=menu]/overflow-item:items-stretch htw:group-data-[toolbar-presentation=menu]/overflow-item:w-full htw:group-data-[toolbar-presentation=menu]/overflow-item:gap-0">
31
+ <div class="htw:flex htw:items-center htw:gap-[3px] htw:w-max htw:group-data-[toolbar-presentation=menu]/overflow-item:flex-col htw:group-data-[toolbar-presentation=menu]/overflow-item:items-stretch htw:group-data-[toolbar-presentation=menu]/overflow-item:w-full htw:group-data-[toolbar-presentation=menu]/overflow-item:gap-px">
32
32
  <slot />
33
33
  </div>
34
34
  </div>
@@ -140,7 +140,7 @@ defineExpose({ panel, close, place })
140
140
 
141
141
  <template>
142
142
  <Teleport :to="overlayTarget ?? overlay">
143
- <div v-if="persistent || open" v-show="open" ref="panel" v-bind="$attrs" class="histoire-base-popover histoire-control-popover htw:fixed htw:box-border htw:max-w-[calc(100vw-16px)]" :role="role" :aria-label="label" tabindex="-1" :style="{ left: `${position.left}px`, top: `${position.top}px`, width: `${position.width}px`, maxHeight: `${position.maxHeight}px`, zIndex: 50 + scope.depth }" @wheel.stop @pointerdown.stop>
143
+ <div v-if="persistent || open" v-show="open" ref="panel" v-bind="$attrs" class="histoire-base-popover histoire-control-popover htw:fixed htw:box-border htw:max-w-[calc(100vw-16px)]" :class="{ 'htw:menu-rows': role === 'menu' }" :role="role" :aria-label="label" tabindex="-1" :style="{ left: `${position.left}px`, top: `${position.top}px`, width: `${position.width}px`, maxHeight: `${position.maxHeight}px`, zIndex: 50 + scope.depth }" @wheel.stop @pointerdown.stop>
144
144
  <slot :close="close" />
145
145
  </div>
146
146
  </Teleport>