@histoire/app 0.9.0 → 0.9.1

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.
@@ -6,7 +6,7 @@ import CheckerboardPattern from "../misc/CheckerboardPattern.js";
6
6
  import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
7
7
  import "./StoryResponsivePreview.vue_vue_type_style_index_0_scoped_true_lang.js";
8
8
  import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
9
- const _withScopeId = (n) => (pushScopeId("data-v-04999d80"), n = n(), popScopeId(), n);
9
+ const _withScopeId = (n) => (pushScopeId("data-v-4514e446"), n = n(), popScopeId(), n);
10
10
  const _hoisted_1 = { class: "htw-w-full htw-h-full htw-flex-1 htw-border htw-border-gray-100 dark:htw-border-gray-800 htw-rounded-lg htw-relative htw-overflow-hidden" };
11
11
  const _hoisted_2 = {
12
12
  key: 0,
@@ -15,7 +15,7 @@ const _hoisted_2 = {
15
15
  const _hoisted_3 = { class: "htw-p-4 htw-h-full htw-relative" };
16
16
  const _hoisted_4 = { class: "htw-w-full htw-h-full htw-border htw-border-gray-100 dark:htw-border-gray-800 htw-rounded-sm htw-relative" };
17
17
  const _hoisted_5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "bind-preview-bg htw-absolute htw-inset-0" }, null, -1));
18
- const _hoisted_6 = /* @__PURE__ */ createStaticVNode('<div class="htw-absolute htw-top-1 htw-left-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-04999d80></div><div class="htw-absolute htw-top-1 htw-right-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-04999d80></div><div class="htw-absolute htw-bottom-1 htw-left-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-04999d80></div><div class="htw-absolute htw-bottom-1 htw-right-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-04999d80></div><div class="htw-absolute htw-left-1 htw-top-4 htw-w-2 htw-h-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-04999d80></div><div class="htw-absolute htw-left-1 htw-bottom-4 htw-w-2 htw-h-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-04999d80></div><div class="htw-absolute htw-right-1 htw-top-4 htw-w-2 htw-h-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-04999d80></div><div class="htw-absolute htw-right-1 htw-bottom-4 htw-w-2 htw-h-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-04999d80></div>', 8);
18
+ const _hoisted_6 = /* @__PURE__ */ createStaticVNode('<div class="htw-absolute htw-top-1 htw-left-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-top-1 htw-right-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-bottom-1 htw-left-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-bottom-1 htw-right-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-left-1 htw-top-4 htw-w-2 htw-h-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-left-1 htw-bottom-4 htw-w-2 htw-h-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-right-1 htw-top-4 htw-w-2 htw-h-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-right-1 htw-bottom-4 htw-w-2 htw-h-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div>', 8);
19
19
  const _sfc_main = /* @__PURE__ */ defineComponent({
20
20
  __name: "StoryResponsivePreview",
21
21
  props: {
@@ -24,7 +24,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
24
24
  setup(__props) {
25
25
  const props = __props;
26
26
  useCssVars((_ctx) => ({
27
- "95cca8b2": unref(settings).backgroundColor
27
+ "65757cd6": unref(settings).backgroundColor
28
28
  }));
29
29
  const settings = usePreviewSettingsStore().currentSettings;
30
30
  const resizing = ref(false);
@@ -43,10 +43,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
43
43
  }
44
44
  function useDragger(el, value, min, max, axis) {
45
45
  function onMouseDown(event) {
46
+ var _a;
46
47
  event.preventDefault();
47
48
  event.stopPropagation();
48
49
  const start = axis === "x" ? event.clientX : event.clientY;
49
- const startValue = value.value;
50
+ const startValue = (_a = value.value) != null ? _a : axis === "x" ? previewWrapper.value.clientWidth - 67 : previewWrapper.value.clientHeight - 70;
50
51
  resizing.value = true;
51
52
  const removeListeners = [
52
53
  addWindowListener("mousemove", onMouseMove),
@@ -176,5 +177,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
176
177
  };
177
178
  }
178
179
  });
179
- var StoryResponsivePreview = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-04999d80"]]);
180
+ var StoryResponsivePreview = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4514e446"]]);
180
181
  export { StoryResponsivePreview as default };
@@ -7,7 +7,7 @@ import { useCurrentVariantRoute } from "../../util/variant.js";
7
7
  import { useScrollOnActive } from "../../util/scroll.js";
8
8
  import "./StoryVariantGridItem.vue_vue_type_style_index_0_scoped_true_lang.js";
9
9
  import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
10
- const _withScopeId = (n) => (pushScopeId("data-v-b8b384dc"), n = n(), popScopeId(), n);
10
+ const _withScopeId = (n) => (pushScopeId("data-v-feb5bbb0"), n = n(), popScopeId(), n);
11
11
  const _hoisted_1 = { class: "htw-flex-none htw-flex htw-items-center" };
12
12
  const _sfc_main = /* @__PURE__ */ defineComponent({
13
13
  __name: "StoryVariantGridItem",
@@ -27,7 +27,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
27
27
  setup(__props, { emit }) {
28
28
  const props = __props;
29
29
  useCssVars((_ctx) => ({
30
- "6e7451a9": unref(variant).iconColor
30
+ "7761d6aa": unref(variant).iconColor
31
31
  }));
32
32
  const { variant } = toRefs(props);
33
33
  const { isActive, targetRoute } = useCurrentVariantRoute(variant);
@@ -89,7 +89,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
89
89
  "htw-border-gray-100 dark:htw-border-gray-800": !unref(isActive),
90
90
  "htw-border-primary-200 dark:htw-border-primary-900": unref(isActive)
91
91
  }]),
92
- onClick: _cache[0] || (_cache[0] = withModifiers(($event) => selectVariant(), ["stop", "prevent"])),
92
+ onClick: _cache[0] || (_cache[0] = withModifiers(($event) => selectVariant(), ["stop"])),
93
93
  onKeyup: _cache[1] || (_cache[1] = ($event) => selectVariant())
94
94
  }, [
95
95
  createVNode(_sfc_main$1, {
@@ -102,5 +102,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
102
102
  };
103
103
  }
104
104
  });
105
- var StoryVariantGridItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b8b384dc"]]);
105
+ var StoryVariantGridItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-feb5bbb0"]]);
106
106
  export { StoryVariantGridItem as default };
@@ -81,16 +81,16 @@
81
81
  font-size: inherit;
82
82
  }
83
83
 
84
- .bind-icon-color[data-v-b8b384dc] {
85
- color: var(--6e7451a9);
84
+ .bind-icon-color[data-v-feb5bbb0] {
85
+ color: var(--7761d6aa);
86
86
  }
87
87
 
88
88
  .bind-preview-bg[data-v-bc4883a4] {
89
89
  background-color: var(--6bcdf233);
90
90
  }
91
91
 
92
- .bind-preview-bg[data-v-04999d80] {
93
- background-color: var(--95cca8b2);
92
+ .bind-preview-bg[data-v-4514e446] {
93
+ background-color: var(--65757cd6);
94
94
  }
95
95
 
96
96
  .__histoire-hatched-pattern[data-v-0bb8c4e8] {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@histoire/app",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Pre-bundled UI for Histoire",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -24,9 +24,9 @@
24
24
  },
25
25
  "types": "./src/index.ts",
26
26
  "dependencies": {
27
- "@histoire/controls": "^0.9.0",
28
- "@histoire/shared": "^0.9.0",
29
- "@histoire/vendors": "^0.9.0",
27
+ "@histoire/controls": "^0.9.1",
28
+ "@histoire/shared": "^0.9.1",
29
+ "@histoire/vendors": "^0.9.1",
30
30
  "@types/flexsearch": "^0.7.3",
31
31
  "flexsearch": "^0.7.21",
32
32
  "shiki": "0.10.1"
@@ -37,7 +37,7 @@ function useDragger (el: Ref<HTMLDivElement>, value: Ref<number>, min: number, m
37
37
  event.preventDefault()
38
38
  event.stopPropagation()
39
39
  const start = axis === 'x' ? event.clientX : event.clientY
40
- const startValue = value.value
40
+ const startValue = value.value ?? (axis === 'x' ? previewWrapper.value.clientWidth - 67 : previewWrapper.value.clientHeight - 70)
41
41
  resizing.value = true
42
42
 
43
43
  const removeListeners = [
@@ -91,7 +91,7 @@ useResizeObserver(el, () => {
91
91
  'htw-border-gray-100 dark:htw-border-gray-800': !isActive,
92
92
  'htw-border-primary-200 dark:htw-border-primary-900': isActive,
93
93
  }"
94
- @click.stop.prevent="selectVariant()"
94
+ @click.stop="selectVariant()"
95
95
  @keyup="selectVariant()"
96
96
  >
97
97
  <GenericRenderStory