histoire 0.6.4 → 0.6.5

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.
@@ -1031,7 +1031,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
1031
1031
  }
1032
1032
  });
1033
1033
  var StoryVariantSingle_vue_vue_type_style_index_0_scoped_true_lang = "";
1034
- const _withScopeId$2 = (n) => (pushScopeId("data-v-a52efa6c"), n = n(), popScopeId(), n);
1034
+ const _withScopeId$2 = (n) => (pushScopeId("data-v-39eaa600"), n = n(), popScopeId(), n);
1035
1035
  const _hoisted_1$f = {
1036
1036
  key: 0,
1037
1037
  class: "htw-p-2 htw-h-full"
@@ -1052,11 +1052,14 @@ const _hoisted_6$3 = {
1052
1052
  };
1053
1053
  const _sfc_main$g = /* @__PURE__ */ defineComponent({
1054
1054
  name: "StoryVariantSingle",
1055
+ emits: {
1056
+ "open-variant-menu": () => true
1057
+ },
1055
1058
  setup(__props) {
1056
1059
  useCssVars((_ctx) => {
1057
1060
  var _a;
1058
1061
  return {
1059
- "ffdba94a": (_a = unref(variant)) == null ? void 0 : _a.iconColor
1062
+ "22451fc3": (_a = unref(variant)) == null ? void 0 : _a.iconColor
1060
1063
  };
1061
1064
  });
1062
1065
  const storyStore = useStoryStore();
@@ -1065,10 +1068,6 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
1065
1068
  return ((_a = storyStore.currentStory) == null ? void 0 : _a.variants.length) === 1;
1066
1069
  });
1067
1070
  const variant = computed(() => storyStore.currentVariant);
1068
- const isMenuOpened = ref(false);
1069
- function openMenu() {
1070
- isMenuOpened.value = true;
1071
- }
1072
1071
  return (_ctx, _cache) => {
1073
1072
  var _a;
1074
1073
  return unref(hasSingleVariant) && unref(storyStore).currentVariant ? (openBlock(), createElementBlock("div", _hoisted_1$f, [
@@ -1080,8 +1079,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
1080
1079
  ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1081
1080
  unref(isMobile) ? (openBlock(), createElementBlock("div", _hoisted_2$e, [
1082
1081
  createElementVNode("a", {
1083
- class: "htw-px-6 htw-h-12 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-flex htw-gap-2 htw-flex-wrap htw-w-full htw-items-center",
1084
- onClick: openMenu
1082
+ class: "htw-px-6 htw-h-12 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-flex htw-gap-2 htw-flex-wrap htw-w-full htw-items-center htw-flex-none",
1083
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("open-variant-menu"))
1085
1084
  }, [
1086
1085
  unref(variant) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1087
1086
  createVNode(unref(Icon), {
@@ -1138,9 +1137,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
1138
1137
  };
1139
1138
  }
1140
1139
  });
1141
- var StoryVariantSingle = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-a52efa6c"]]);
1140
+ var StoryVariantSingle = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-39eaa600"]]);
1142
1141
  var StoryViewer_vue_vue_type_style_index_0_scoped_true_lang = "";
1143
- const _withScopeId$1 = (n) => (pushScopeId("data-v-141c6b20"), n = n(), popScopeId(), n);
1142
+ const _withScopeId$1 = (n) => (pushScopeId("data-v-3c153cb8"), n = n(), popScopeId(), n);
1144
1143
  const _hoisted_1$e = { class: "htw-bg-gray-50 htw-h-full dark:htw-bg-gray-750" };
1145
1144
  const _sfc_main$f = /* @__PURE__ */ defineComponent({
1146
1145
  name: "StoryViewer",
@@ -1148,7 +1147,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
1148
1147
  useCssVars((_ctx) => {
1149
1148
  var _a;
1150
1149
  return {
1151
- "4ecaabeb": (_a = unref(variant)) == null ? void 0 : _a.iconColor
1150
+ "d1b61db4": (_a = unref(variant)) == null ? void 0 : _a.iconColor
1152
1151
  };
1153
1152
  });
1154
1153
  const storyStore = useStoryStore();
@@ -1163,7 +1162,10 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
1163
1162
  return (_ctx, _cache) => {
1164
1163
  return openBlock(), createElementBlock(Fragment, null, [
1165
1164
  createElementVNode("div", _hoisted_1$e, [
1166
- unref(storyStore).currentStory.layout.type === "grid" ? (openBlock(), createBlock(_sfc_main$s, { key: 0 })) : unref(storyStore).currentStory.layout.type === "single" ? (openBlock(), createBlock(StoryVariantSingle, { key: 1 })) : createCommentVNode("", true)
1165
+ unref(storyStore).currentStory.layout.type === "grid" ? (openBlock(), createBlock(_sfc_main$s, { key: 0 })) : unref(storyStore).currentStory.layout.type === "single" ? (openBlock(), createBlock(StoryVariantSingle, {
1166
+ key: 1,
1167
+ onOpenVariantMenu: _cache[0] || (_cache[0] = ($event) => isMenuOpened.value = true)
1168
+ })) : createCommentVNode("", true)
1167
1169
  ]),
1168
1170
  createVNode(_sfc_main$w, {
1169
1171
  title: "Select a variant",
@@ -1184,7 +1186,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
1184
1186
  };
1185
1187
  }
1186
1188
  });
1187
- var StoryViewer = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-141c6b20"]]);
1189
+ var StoryViewer = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-3c153cb8"]]);
1188
1190
  const _hoisted_1$d = { class: "htw-cursor-pointer htw-w-full htw-outline-none htw-px-2 htw-h-[27px] -htw-my-1 htw-border htw-border-solid htw-border-black/25 dark:htw-border-white/25 hover:htw-border-primary-500 dark:hover:htw-border-primary-500 htw-rounded-sm htw-flex htw-gap-2 htw-items-center htw-leading-normal" };
1189
1191
  const _hoisted_2$d = { class: "htw-flex-1 htw-truncate" };
1190
1192
  const _hoisted_3$7 = { class: "htw-flex htw-flex-col htw-bg-gray-50 dark:htw-bg-gray-700" };
@@ -63,12 +63,12 @@
63
63
  background-color: var(--700caecc);
64
64
  }
65
65
 
66
- .bind-icon-color[data-v-a52efa6c] {
67
- color: var(--ffdba94a);
66
+ .bind-icon-color[data-v-39eaa600] {
67
+ color: var(--22451fc3);
68
68
  }
69
69
 
70
- .bind-icon-color[data-v-141c6b20] {
71
- color: var(--4ecaabeb);
70
+ .bind-icon-color[data-v-3c153cb8] {
71
+ color: var(--d1b61db4);
72
72
  }
73
73
 
74
74
  .__histoire-code-placeholder[data-v-32cb8d14] {
@@ -7,17 +7,15 @@ import BaseSplitPane from '../base/BaseSplitPane.vue'
7
7
  import StoryVariantListItem from './StoryVariantListItem.vue'
8
8
  import StoryVariantSingleView from './StoryVariantSingleView.vue'
9
9
 
10
+ defineEmits({
11
+ 'open-variant-menu': () => true,
12
+ })
13
+
10
14
  const storyStore = useStoryStore()
11
15
 
12
16
  const hasSingleVariant = computed(() => (storyStore.currentStory?.variants.length === 1))
13
17
 
14
18
  const variant = computed(() => storyStore.currentVariant)
15
-
16
- const isMenuOpened = ref(false)
17
-
18
- function openMenu () {
19
- isMenuOpened.value = true
20
- }
21
19
  </script>
22
20
 
23
21
  <template>
@@ -37,8 +35,8 @@ function openMenu () {
37
35
  class="htw-divide-y htw-divide-gray-100 dark:htw-divide-gray-800 htw-h-full htw-flex htw-flex-col"
38
36
  >
39
37
  <a
40
- class="htw-px-6 htw-h-12 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-flex htw-gap-2 htw-flex-wrap htw-w-full htw-items-center"
41
- @click="openMenu"
38
+ class="htw-px-6 htw-h-12 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-flex htw-gap-2 htw-flex-wrap htw-w-full htw-items-center htw-flex-none"
39
+ @click="$emit('open-variant-menu')"
42
40
  >
43
41
  <template v-if="variant">
44
42
  <Icon
@@ -27,7 +27,10 @@ watch(variant, () => {
27
27
  <StoryVariantGrid
28
28
  v-if="storyStore.currentStory.layout.type === 'grid'"
29
29
  />
30
- <StoryVariantSingle v-else-if="storyStore.currentStory.layout.type === 'single'" />
30
+ <StoryVariantSingle
31
+ v-else-if="storyStore.currentStory.layout.type === 'single'"
32
+ @open-variant-menu="isMenuOpened = true"
33
+ />
31
34
  </div>
32
35
 
33
36
  <MobileOverlay
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "histoire",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "A fast story book powered by Vite",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -33,7 +33,7 @@
33
33
  "histoire": "./bin.mjs"
34
34
  },
35
35
  "dependencies": {
36
- "@histoire/controls": "^0.6.4",
36
+ "@histoire/controls": "^0.6.5",
37
37
  "@iconify/vue": "^3.2.1",
38
38
  "@types/markdown-it": "^12.2.3",
39
39
  "@vueuse/core": "^8.2.5",
@@ -7,17 +7,15 @@ import BaseSplitPane from '../base/BaseSplitPane.vue'
7
7
  import StoryVariantListItem from './StoryVariantListItem.vue'
8
8
  import StoryVariantSingleView from './StoryVariantSingleView.vue'
9
9
 
10
+ defineEmits({
11
+ 'open-variant-menu': () => true,
12
+ })
13
+
10
14
  const storyStore = useStoryStore()
11
15
 
12
16
  const hasSingleVariant = computed(() => (storyStore.currentStory?.variants.length === 1))
13
17
 
14
18
  const variant = computed(() => storyStore.currentVariant)
15
-
16
- const isMenuOpened = ref(false)
17
-
18
- function openMenu () {
19
- isMenuOpened.value = true
20
- }
21
19
  </script>
22
20
 
23
21
  <template>
@@ -37,8 +35,8 @@ function openMenu () {
37
35
  class="htw-divide-y htw-divide-gray-100 dark:htw-divide-gray-800 htw-h-full htw-flex htw-flex-col"
38
36
  >
39
37
  <a
40
- class="htw-px-6 htw-h-12 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-flex htw-gap-2 htw-flex-wrap htw-w-full htw-items-center"
41
- @click="openMenu"
38
+ class="htw-px-6 htw-h-12 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-flex htw-gap-2 htw-flex-wrap htw-w-full htw-items-center htw-flex-none"
39
+ @click="$emit('open-variant-menu')"
42
40
  >
43
41
  <template v-if="variant">
44
42
  <Icon
@@ -27,7 +27,10 @@ watch(variant, () => {
27
27
  <StoryVariantGrid
28
28
  v-if="storyStore.currentStory.layout.type === 'grid'"
29
29
  />
30
- <StoryVariantSingle v-else-if="storyStore.currentStory.layout.type === 'single'" />
30
+ <StoryVariantSingle
31
+ v-else-if="storyStore.currentStory.layout.type === 'single'"
32
+ @open-variant-menu="isMenuOpened = true"
33
+ />
31
34
  </div>
32
35
 
33
36
  <MobileOverlay