@histoire/app 0.14.0 → 0.14.2

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.
@@ -2,7 +2,7 @@ import _sfc_main from "./StoryVariantGridItem.vue2.js";
2
2
  import "./StoryVariantGridItem.vue3.js";
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  "use strict";
5
- const StoryVariantGridItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f7c98176"]]);
5
+ const StoryVariantGridItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c1d28b37"]]);
6
6
  export {
7
7
  StoryVariantGridItem as default
8
8
  };
@@ -7,13 +7,14 @@ import { useScrollOnActive } from "../../util/scroll.js";
7
7
  import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
8
8
  import { getContrastColor } from "../../util/preview-settings.js";
9
9
  import { histoireConfig } from "../../util/config.js";
10
+ import { isDark } from "../../util/dark.js";
10
11
  import "./GenericRenderStory.vue.js";
11
12
  import "../toolbar/ToolbarNewTab.vue.js";
12
13
  import CheckerboardPattern from "../misc/CheckerboardPattern.vue.js";
13
14
  import _sfc_main$1 from "../toolbar/ToolbarNewTab.vue2.js";
14
15
  import _sfc_main$2 from "./GenericRenderStory.vue2.js";
15
16
  "use strict";
16
- const _withScopeId = (n) => (pushScopeId("data-v-f7c98176"), n = n(), popScopeId(), n);
17
+ const _withScopeId = (n) => (pushScopeId("data-v-c1d28b37"), n = n(), popScopeId(), n);
17
18
  const _hoisted_1 = { class: "htw-flex-none htw-flex htw-items-center" };
18
19
  const _hoisted_2 = { class: "htw-truncate htw-flex-1" };
19
20
  const _hoisted_3 = { class: "htw-flex-none htw-ml-auto htw-hidden group-hover:htw-flex htw-items-center" };
@@ -40,8 +41,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
40
41
  setup(__props, { emit }) {
41
42
  const props = __props;
42
43
  useCssVars((_ctx) => ({
43
- "edeb0368": unref(variant).iconColor,
44
- "f4b27ac2": unref(settings).backgroundColor
44
+ "d647bf7e": unref(variant).iconColor,
45
+ "772419ec": unref(settings).backgroundColor
45
46
  }));
46
47
  const { variant } = toRefs(props);
47
48
  const { isActive, targetRoute } = useCurrentVariantRoute(variant);
@@ -133,8 +134,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
133
134
  variant: unref(variant),
134
135
  story: __props.story,
135
136
  dir: unref(settings).textDirection,
137
+ class: normalizeClass({
138
+ [unref(histoireConfig).theme.darkClass]: unref(isDark)
139
+ }),
136
140
  onReady
137
- }, null, 8, ["variant", "story", "dir"]))
141
+ }, null, 8, ["variant", "story", "dir", "class"]))
138
142
  ], 4)
139
143
  ], 34)
140
144
  ], 512);
@@ -1,4 +1,4 @@
1
- const StoryVariantGridItem_vue_vue_type_style_index_0_scoped_f7c98176_lang = "";
1
+ const StoryVariantGridItem_vue_vue_type_style_index_0_scoped_c1d28b37_lang = "";
2
2
  export {
3
- StoryVariantGridItem_vue_vue_type_style_index_0_scoped_f7c98176_lang as default
3
+ StoryVariantGridItem_vue_vue_type_style_index_0_scoped_c1d28b37_lang as default
4
4
  };
@@ -50,7 +50,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
50
50
  key: `${__props.story.id}-${__props.variant.id}`,
51
51
  variant: __props.variant,
52
52
  story: __props.story,
53
- class: normalizeClass(["htw-h-full", [unref(isDark) ? unref(histoireConfig).sandboxDarkClass : void 0]]),
53
+ class: normalizeClass(["htw-h-full", {
54
+ [unref(histoireConfig).sandboxDarkClass]: unref(isDark),
55
+ // @TODO remove
56
+ [unref(histoireConfig).theme.darkClass]: unref(isDark)
57
+ }]),
54
58
  dir: unref(settings).textDirection,
55
59
  onReady
56
60
  }, null, 8, ["variant", "story", "class", "dir"]))
@@ -85,8 +85,10 @@ app.mount("#app");
85
85
  watch(isDark, (value) => {
86
86
  if (value) {
87
87
  document.documentElement.classList.add(histoireConfig.sandboxDarkClass);
88
+ document.documentElement.classList.add(histoireConfig.theme.darkClass);
88
89
  } else {
89
90
  document.documentElement.classList.remove(histoireConfig.sandboxDarkClass);
91
+ document.documentElement.classList.remove(histoireConfig.theme.darkClass);
90
92
  }
91
93
  }, {
92
94
  immediate: true
@@ -44,10 +44,6 @@
44
44
  color: var(--663732b6);
45
45
  }
46
46
 
47
- .bind-tree-padding[data-v-2d2e4786] {
48
- padding-left: var(--6851b0a7);
49
- }
50
-
51
47
  .bind-tree-margin[data-v-19810958] {
52
48
  margin-left: var(--444efc12);
53
49
  }
@@ -55,28 +51,32 @@
55
51
  color: var(--ae892164);
56
52
  }
57
53
 
58
- .bind-icon-color[data-v-ab890d9c] {
59
- color: var(--89126aaa);
54
+ .bind-tree-padding[data-v-2d2e4786] {
55
+ padding-left: var(--6851b0a7);
56
+ }
57
+
58
+ .__histoire-code-placeholder[data-v-1bdf9905] {
59
+ color: inherit;
60
+ font-size: inherit;
60
61
  }
61
62
 
62
63
  .bind-icon-color[data-v-ddfc5b4f] {
63
64
  color: var(--4d25d048);
64
65
  }
65
66
 
66
- .__histoire-code-placeholder[data-v-1bdf9905] {
67
- color: inherit;
68
- font-size: inherit;
67
+ .bind-icon-color[data-v-ab890d9c] {
68
+ color: var(--89126aaa);
69
69
  }
70
70
 
71
71
  .bind-icon-color[data-v-6c8e9661] {
72
72
  color: var(--a8c1277e);
73
73
  }
74
74
 
75
- .bind-icon-color[data-v-f7c98176] {
76
- color: var(--edeb0368);
75
+ .bind-icon-color[data-v-c1d28b37] {
76
+ color: var(--d647bf7e);
77
77
  }
78
- .bind-preview-bg[data-v-f7c98176] {
79
- background-color: var(--f4b27ac2);
78
+ .bind-preview-bg[data-v-c1d28b37] {
79
+ background-color: var(--772419ec);
80
80
  }
81
81
 
82
82
  .bind-preview-bg[data-v-c48fb2b2] {
@@ -5,7 +5,8 @@ import { histoireConfig } from "./config.js";
5
5
  const isDark = useDark({
6
6
  valueDark: "htw-dark",
7
7
  initialValue: histoireConfig.theme.defaultColorScheme,
8
- storageKey: histoireConfig.theme.storeColorScheme ? "histoire-color-scheme" : null
8
+ storageKey: "histoire-color-scheme",
9
+ storage: histoireConfig.theme.storeColorScheme ? localStorage : sessionStorage
9
10
  });
10
11
  const toggleDark = useToggle(isDark);
11
12
  function applyDarkToControls() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@histoire/app",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
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.14.0",
28
- "@histoire/shared": "^0.14.0",
29
- "@histoire/vendors": "^0.14.0",
27
+ "@histoire/controls": "^0.14.2",
28
+ "@histoire/shared": "^0.14.2",
29
+ "@histoire/vendors": "^0.14.2",
30
30
  "@types/flexsearch": "^0.7.3",
31
31
  "flexsearch": "0.7.21",
32
32
  "shiki-es": "^0.2.0"
@@ -9,6 +9,7 @@ import { useScrollOnActive } from '../../util/scroll'
9
9
  import { usePreviewSettingsStore } from '../../stores/preview-settings'
10
10
  import { getContrastColor } from '../../util/preview-settings'
11
11
  import { histoireConfig } from '../../util/config'
12
+ import { isDark } from '../../util/dark'
12
13
  import GenericRenderStory from './GenericRenderStory.vue'
13
14
  import ToolbarNewTab from '../toolbar/ToolbarNewTab.vue'
14
15
  import CheckerboardPattern from '../misc/CheckerboardPattern.vue'
@@ -136,6 +137,9 @@ const autoApplyContrastColor = computed(() => !!histoireConfig.autoApplyContrast
136
137
  :variant="variant"
137
138
  :story="story"
138
139
  :dir="settings.textDirection"
140
+ :class="{
141
+ [histoireConfig.theme.darkClass]: isDark,
142
+ }"
139
143
  @ready="onReady"
140
144
  />
141
145
  </div>
@@ -54,7 +54,10 @@ const autoApplyContrastColor = computed(() => !!histoireConfig.autoApplyContrast
54
54
  :variant="variant"
55
55
  :story="story"
56
56
  class="htw-h-full"
57
- :class="[ isDark ? histoireConfig.sandboxDarkClass : undefined ]"
57
+ :class="{
58
+ [histoireConfig.sandboxDarkClass]: isDark, // @TODO remove
59
+ [histoireConfig.theme.darkClass]: isDark,
60
+ }"
58
61
  :dir="settings.textDirection"
59
62
  @ready="onReady"
60
63
  />
@@ -88,9 +88,11 @@ app.mount('#app')
88
88
 
89
89
  watch(isDark, value => {
90
90
  if (value) {
91
- document.documentElement.classList.add(histoireConfig.sandboxDarkClass)
91
+ document.documentElement.classList.add(histoireConfig.sandboxDarkClass) // @TODO remove
92
+ document.documentElement.classList.add(histoireConfig.theme.darkClass)
92
93
  } else {
93
- document.documentElement.classList.remove(histoireConfig.sandboxDarkClass)
94
+ document.documentElement.classList.remove(histoireConfig.sandboxDarkClass) // @TODO remove
95
+ document.documentElement.classList.remove(histoireConfig.theme.darkClass)
94
96
  }
95
97
  }, {
96
98
  immediate: true,
@@ -5,7 +5,8 @@ import { histoireConfig } from './config.js'
5
5
  export const isDark = useDark({
6
6
  valueDark: 'htw-dark',
7
7
  initialValue: histoireConfig.theme.defaultColorScheme,
8
- storageKey: histoireConfig.theme.storeColorScheme ? 'histoire-color-scheme' : null,
8
+ storageKey: 'histoire-color-scheme',
9
+ storage: histoireConfig.theme.storeColorScheme ? localStorage : sessionStorage,
9
10
  })
10
11
  export const toggleDark = useToggle(isDark)
11
12