@histoire/app 0.17.16 → 0.17.17

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 (126) hide show
  1. package/dist/bundled/App.vue2.js +1 -1
  2. package/dist/bundled/components/app/AppHeader.vue2.js +1 -1
  3. package/dist/bundled/components/app/AppLogo.vue2.js +1 -1
  4. package/dist/bundled/components/app/Breadcrumb.vue.js +1 -1
  5. package/dist/bundled/components/app/Breadcrumb.vue2.js +3 -3
  6. package/dist/bundled/components/app/HomeCounter.vue2.js +2 -7
  7. package/dist/bundled/components/base/BaseCheckbox.vue2.js +1 -2
  8. package/dist/bundled/components/base/BaseIcon.vue.js +1 -1
  9. package/dist/bundled/components/base/BaseIcon.vue2.js +1 -1
  10. package/dist/bundled/components/base/BaseOverflowMenu.vue2.js +4 -4
  11. package/dist/bundled/components/base/BaseSplitPane.vue.js +1 -1
  12. package/dist/bundled/components/base/BaseSplitPane.vue2.js +2 -3
  13. package/dist/bundled/components/panel/PaneTabs.vue2.js +1 -1
  14. package/dist/bundled/components/panel/StoryDocs.vue2.js +4 -4
  15. package/dist/bundled/components/panel/StorySourceCode.vue.js +1 -1
  16. package/dist/bundled/components/panel/StorySourceCode.vue2.js +1 -1
  17. package/dist/bundled/components/search/SearchItem.vue.js +1 -1
  18. package/dist/bundled/components/search/SearchItem.vue2.js +2 -2
  19. package/dist/bundled/components/search/SearchPane.vue2.js +2 -2
  20. package/dist/bundled/components/story/StoryResponsivePreview.vue.js +1 -1
  21. package/dist/bundled/components/story/StoryResponsivePreview.vue2.js +5 -5
  22. package/dist/bundled/components/story/StoryVariantGrid.vue2.js +4 -4
  23. package/dist/bundled/components/story/StoryVariantGridItem.vue.js +1 -1
  24. package/dist/bundled/components/story/StoryVariantGridItem.vue2.js +6 -7
  25. package/dist/bundled/components/story/StoryVariantListItem.vue.js +1 -1
  26. package/dist/bundled/components/story/StoryVariantListItem.vue2.js +3 -3
  27. package/dist/bundled/components/story/StoryVariantSingle.vue.js +1 -1
  28. package/dist/bundled/components/story/StoryVariantSingle.vue2.js +5 -5
  29. package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue2.js +1 -1
  30. package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue2.js +1 -1
  31. package/dist/bundled/components/story/StoryView.vue2.js +1 -1
  32. package/dist/bundled/components/story/StoryViewer.vue.js +1 -1
  33. package/dist/bundled/components/story/StoryViewer.vue2.js +3 -3
  34. package/dist/bundled/components/tree/StoryGroup.vue2.js +2 -2
  35. package/dist/bundled/components/tree/StoryListFolder.vue.js +1 -1
  36. package/dist/bundled/components/tree/StoryListFolder.vue2.js +4 -4
  37. package/dist/bundled/components/tree/StoryListItem.vue.js +1 -1
  38. package/dist/bundled/components/tree/StoryListItem.vue2.js +5 -5
  39. package/dist/bundled/sandbox.js +1 -1
  40. package/dist/bundled/style.css +50 -50
  41. package/dist/bundled/util/commands.js +1 -1
  42. package/dist/bundled/util/state.js +2 -2
  43. package/dist/style.css +1 -1
  44. package/package.json +7 -7
  45. package/scripts/copy.mjs +1 -1
  46. package/scripts/watchAndCopy.mjs +4 -4
  47. package/src/app/App.vue +6 -6
  48. package/src/app/api.ts +1 -1
  49. package/src/app/components/HomeView.vue +4 -3
  50. package/src/app/components/app/AppHeader.vue +1 -1
  51. package/src/app/components/app/AppLogo.vue +3 -3
  52. package/src/app/components/app/Breadcrumb.vue +4 -4
  53. package/src/app/components/app/HomeCounter.vue +1 -10
  54. package/src/app/components/app/MobileOverlay.vue +1 -1
  55. package/src/app/components/base/BaseCheckbox.vue +2 -3
  56. package/src/app/components/base/BaseIcon.vue +2 -2
  57. package/src/app/components/base/BaseKeyboardShortcut.vue +1 -1
  58. package/src/app/components/base/BaseListItem.vue +2 -2
  59. package/src/app/components/base/BaseListItemLink.vue +3 -3
  60. package/src/app/components/base/BaseOverflowMenu.vue +4 -4
  61. package/src/app/components/base/BaseSelect.vue +5 -4
  62. package/src/app/components/base/BaseSplitPane.vue +19 -15
  63. package/src/app/components/command/CommandPrompts.vue +6 -5
  64. package/src/app/components/command/CommandPromptsModal.vue +2 -1
  65. package/src/app/components/command/PromptSelect.vue +6 -4
  66. package/src/app/components/command/PromptText.vue +4 -3
  67. package/src/app/components/panel/ControlsComponentPropItem.vue +1 -1
  68. package/src/app/components/panel/ControlsComponentProps.vue +1 -1
  69. package/src/app/components/panel/ControlsComponentState.vue +1 -1
  70. package/src/app/components/panel/PaneTabs.vue +1 -1
  71. package/src/app/components/panel/StatePresets.vue +13 -10
  72. package/src/app/components/panel/StoryControls.vue +2 -2
  73. package/src/app/components/panel/StoryDocs.vue +28 -24
  74. package/src/app/components/panel/StoryEvent.vue +2 -2
  75. package/src/app/components/panel/StoryEvents.vue +2 -2
  76. package/src/app/components/panel/StorySourceCode.vue +10 -6
  77. package/src/app/components/search/SearchItem.vue +4 -3
  78. package/src/app/components/search/SearchItemContent.vue +3 -3
  79. package/src/app/components/search/SearchModal.vue +2 -1
  80. package/src/app/components/search/SearchPane.vue +18 -18
  81. package/src/app/components/search/search-docs-data.ts +2 -2
  82. package/src/app/components/search/search-title-data.ts +2 -2
  83. package/src/app/components/story/GenericMountStory.vue +1 -1
  84. package/src/app/components/story/GenericRenderStory.vue +3 -2
  85. package/src/app/components/story/StoryResponsivePreview.vue +14 -13
  86. package/src/app/components/story/StoryVariantGrid.vue +9 -8
  87. package/src/app/components/story/StoryVariantGridItem.vue +7 -7
  88. package/src/app/components/story/StoryVariantListItem.vue +3 -2
  89. package/src/app/components/story/StoryVariantSingle.vue +3 -3
  90. package/src/app/components/story/StoryVariantSinglePreviewNative.vue +2 -2
  91. package/src/app/components/story/StoryVariantSinglePreviewRemote.vue +10 -10
  92. package/src/app/components/story/StoryView.vue +4 -4
  93. package/src/app/components/story/StoryViewer.vue +2 -3
  94. package/src/app/components/toolbar/ToolbarNewTab.vue +1 -1
  95. package/src/app/components/tree/StoryGroup.vue +4 -4
  96. package/src/app/components/tree/StoryList.vue +1 -1
  97. package/src/app/components/tree/StoryListFolder.vue +4 -4
  98. package/src/app/components/tree/StoryListItem.vue +3 -3
  99. package/src/app/index.ts +2 -3
  100. package/src/app/plugin.ts +4 -3
  101. package/src/app/router.ts +2 -2
  102. package/src/app/sandbox.ts +12 -11
  103. package/src/app/stores/command.ts +4 -3
  104. package/src/app/stores/events.ts +4 -4
  105. package/src/app/stores/folder.ts +9 -7
  106. package/src/app/stores/story.ts +4 -4
  107. package/src/app/types.ts +2 -2
  108. package/src/app/util/commands.ts +5 -4
  109. package/src/app/util/dark.ts +2 -2
  110. package/src/app/util/docs.ts +6 -4
  111. package/src/app/util/events.ts +4 -3
  112. package/src/app/util/keyboard.ts +9 -8
  113. package/src/app/util/mapping.ts +8 -5
  114. package/src/app/util/open-in-editor.ts +1 -1
  115. package/src/app/util/preview-settings.ts +3 -3
  116. package/src/app/util/sandbox.ts +2 -3
  117. package/src/app/util/scroll.ts +5 -4
  118. package/src/app/util/select.ts +5 -4
  119. package/src/app/util/state.ts +6 -5
  120. package/src/app/util/tooltip.ts +2 -2
  121. package/src/app/util/variant.ts +3 -2
  122. package/src/shim.d.ts +0 -6
  123. package/src/virtual.d.ts +1 -0
  124. package/tailwind.config.cjs +19 -20
  125. package/tsconfig.json +26 -26
  126. package/vite.config.ts +7 -6
@@ -1,9 +1,9 @@
1
1
  import { pushScopeId, popScopeId, useCssVars, computed, resolveComponent, openBlock, withKeys, unref, normalizeClass, createVNode, createElementVNode, toDisplayString, Fragment, createBlock, createElementBlock, renderList, createCommentVNode, defineComponent } from "@histoire/vendors/vue";
2
- import StoryListItem from "./StoryListItem.vue.js";
3
2
  import { Icon } from "@histoire/vendors/iconify";
4
3
  import { useFolderStore } from "../../stores/folder.js";
4
+ import StoryListItem from "./StoryListItem.vue.js";
5
5
  "use strict";
6
- const _withScopeId = (n) => (pushScopeId("data-v-2d2e4786"), n = n(), popScopeId(), n);
6
+ const _withScopeId = (n) => (pushScopeId("data-v-cace6303"), n = n(), popScopeId(), n);
7
7
  const _hoisted_1 = {
8
8
  "data-test-id": "story-list-folder",
9
9
  class: "histoire-story-list-folder"
@@ -23,7 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23
23
  },
24
24
  setup(__props) {
25
25
  useCssVars((_ctx) => ({
26
- "6851b0a7": folderPadding.value
26
+ "1ee776cd": folderPadding.value
27
27
  }));
28
28
  const props = __props;
29
29
  const folderStore = useFolderStore();
@@ -33,7 +33,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
33
33
  folderStore.toggleFolder(folderPath.value);
34
34
  }
35
35
  const folderPadding = computed(() => {
36
- return props.depth * 12 + "px";
36
+ return `${props.depth * 12}px`;
37
37
  });
38
38
  return (_ctx, _cache) => {
39
39
  const _component_StoryListFolder = resolveComponent("StoryListFolder", true);
@@ -2,7 +2,7 @@ import _sfc_main from "./StoryListItem.vue2.js";
2
2
  import "./StoryListItem.vue3.js";
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  "use strict";
5
- const StoryListItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-19810958"]]);
5
+ const StoryListItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c9b616b5"]]);
6
6
  export {
7
7
  StoryListItem as default
8
8
  };
@@ -1,10 +1,10 @@
1
1
  import { pushScopeId, popScopeId, useCssVars, computed, ref, openBlock, unref, normalizeClass, createVNode, toDisplayString, createElementVNode, createElementBlock, createCommentVNode, withCtx, defineComponent } from "@histoire/vendors/vue";
2
- import BaseListItemLink from "../base/BaseListItemLink.vue.js";
3
2
  import { Icon } from "@histoire/vendors/iconify";
4
3
  import { useRoute } from "@histoire/vendors/vue-router";
4
+ import BaseListItemLink from "../base/BaseListItemLink.vue.js";
5
5
  import { useScrollOnActive } from "../../util/scroll.js";
6
6
  "use strict";
7
- const _withScopeId = (n) => (pushScopeId("data-v-19810958"), n = n(), popScopeId(), n);
7
+ const _withScopeId = (n) => (pushScopeId("data-v-c9b616b5"), n = n(), popScopeId(), n);
8
8
  const _hoisted_1 = { class: "bind-tree-margin htw-flex htw-items-center htw-gap-2 htw-pl-4 htw-min-w-0" };
9
9
  const _hoisted_2 = { class: "htw-truncate" };
10
10
  const _hoisted_3 = {
@@ -19,12 +19,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
19
  },
20
20
  setup(__props) {
21
21
  useCssVars((_ctx) => ({
22
- "444efc12": filePadding.value,
23
- "ae892164": _ctx.story.iconColor
22
+ "c4f9d186": filePadding.value,
23
+ "7270060e": _ctx.story.iconColor
24
24
  }));
25
25
  const props = __props;
26
26
  const filePadding = computed(() => {
27
- return props.depth * 12 + "px";
27
+ return `${props.depth * 12}px`;
28
28
  });
29
29
  const route = useRoute();
30
30
  const isActive = computed(() => route.params.storyId === props.story.id);
@@ -2,10 +2,10 @@ import { parseQuery } from "@histoire/vendors/vue-router";
2
2
  import { ref, computed, watch, onMounted, h, createApp } from "@histoire/vendors/vue";
3
3
  import { createPinia } from "@histoire/vendors/pinia";
4
4
  import { applyState } from "@histoire/shared";
5
+ import { files } from "virtual:$histoire-stories";
5
6
  import "./components/story/GenericMountStory.vue.js";
6
7
  import "./components/story/GenericRenderStory.vue.js";
7
8
  import { mapFile } from "./util/mapping.js";
8
- import { files } from "virtual:$histoire-stories";
9
9
  import { STATE_SYNC, PREVIEW_SETTINGS_SYNC, SANDBOX_READY } from "./util/const.js";
10
10
  import { applyPreviewSettings } from "./util/preview-settings.js";
11
11
  import { isDark } from "./util/dark.js";
@@ -1,78 +1,75 @@
1
1
 
2
- .htw-base-empty[data-v-c5ecfead]:not(.no-animation) {
3
- animation: htw-base-empty-c5ecfead .15s .2s both;
4
- }
5
- @keyframes htw-base-empty-c5ecfead {
6
- 0% {
7
- opacity: 0;
8
- }
9
- 100% {
10
- opacity: 1;
11
- }
12
- }
13
-
14
- .bind-icon-color[data-v-36846ccf] {
15
- color: var(--5792748b);
16
- }
17
-
18
- .landscape > div > .dragger[data-v-ed925107] {
2
+ .landscape > div > .dragger[data-v-4f40a1bb] {
19
3
  width: .625rem;
20
4
  }
21
- .portrait > div > .dragger[data-v-ed925107] {
5
+ .portrait > div > .dragger[data-v-4f40a1bb] {
22
6
  height: .625rem;
23
7
  }
24
- .landscape > div > .dragger.dragger-offset-before[data-v-ed925107] {
8
+ .landscape > div > .dragger.dragger-offset-before[data-v-4f40a1bb] {
25
9
  right: 0;
26
10
  }
27
- .portrait > div > .dragger.dragger-offset-before[data-v-ed925107] {
11
+ .portrait > div > .dragger.dragger-offset-before[data-v-4f40a1bb] {
28
12
  bottom: 0;
29
13
  }
30
- .landscape > div > .dragger.dragger-offset-center[data-v-ed925107] {
14
+ .landscape > div > .dragger.dragger-offset-center[data-v-4f40a1bb] {
31
15
  right: -.3125rem;
32
16
  }
33
- .portrait > div > .dragger.dragger-offset-center[data-v-ed925107] {
17
+ .portrait > div > .dragger.dragger-offset-center[data-v-4f40a1bb] {
34
18
  bottom: -.3125rem;
35
19
  }
36
- .landscape > div > .dragger.dragger-offset-after[data-v-ed925107] {
20
+ .landscape > div > .dragger.dragger-offset-after[data-v-4f40a1bb] {
37
21
  right: -.625rem;
38
22
  }
39
- .portrait > div > .dragger.dragger-offset-after[data-v-ed925107] {
23
+ .portrait > div > .dragger.dragger-offset-after[data-v-4f40a1bb] {
40
24
  bottom: -.625rem;
41
25
  }
42
26
 
43
- .bind-icon-color[data-v-6046525f] {
44
- color: var(--663732b6);
27
+ .bind-icon-color[data-v-b8625753] {
28
+ color: var(--6509026e);
29
+ }
30
+
31
+ .htw-base-empty[data-v-c5ecfead]:not(.no-animation) {
32
+ animation: htw-base-empty-c5ecfead .15s .2s both;
33
+ }
34
+ @keyframes htw-base-empty-c5ecfead {
35
+ 0% {
36
+ opacity: 0;
37
+ }
38
+ 100% {
39
+ opacity: 1;
40
+ }
45
41
  }
46
42
 
47
- .bind-tree-padding[data-v-2d2e4786] {
48
- padding-left: var(--6851b0a7);
43
+ .bind-icon-color[data-v-a5a2e343] {
44
+ color: var(--597bf4c4);
49
45
  }
50
46
 
51
- .bind-icon-color[data-v-ddfc5b4f] {
52
- color: var(--4d25d048);
47
+ .bind-tree-padding[data-v-cace6303] {
48
+ padding-left: var(--1ee776cd);
53
49
  }
54
50
 
55
- .bind-tree-margin[data-v-19810958] {
56
- margin-left: var(--444efc12);
51
+ .bind-tree-margin[data-v-c9b616b5] {
52
+ margin-left: var(--c4f9d186);
53
+ }
54
+ .bind-icon-color[data-v-c9b616b5] {
55
+ color: var(--7270060e);
57
56
  }
58
- .bind-icon-color[data-v-19810958] {
59
- color: var(--ae892164);
57
+
58
+ .bind-icon-color[data-v-abf83c04] {
59
+ color: var(--02b8e3da);
60
60
  }
61
61
 
62
- .bind-icon-color[data-v-ab890d9c] {
63
- color: var(--89126aaa);
62
+ .bind-icon-color[data-v-f8e09a03] {
63
+ color: var(--2762f67a);
64
64
  }
65
65
 
66
- .__histoire-code-placeholder[data-v-1bdf9905] {
66
+ .__histoire-code-placeholder[data-v-f7d2e46a] {
67
67
  color: inherit;
68
68
  font-size: inherit;
69
69
  }
70
70
 
71
- .bind-icon-color[data-v-cf76cd68] {
72
- color: var(--29d8c174);
73
- }
74
- .bind-preview-bg[data-v-cf76cd68] {
75
- background-color: var(--0eff7465);
71
+ .bind-icon-color[data-v-d75a2748] {
72
+ color: var(--ddaae392);
76
73
  }
77
74
 
78
75
  .bind-preview-bg[data-v-c48fb2b2] {
@@ -80,12 +77,19 @@
80
77
  color: var(--35068428);
81
78
  }
82
79
 
83
- .bind-icon-color[data-v-6c8e9661] {
84
- color: var(--a8c1277e);
80
+ .bind-icon-color[data-v-d3ab4dd6] {
81
+ color: var(--bd0f30ce);
82
+ }
83
+ .bind-preview-bg[data-v-d3ab4dd6] {
84
+ background-color: var(--8da98e9c);
85
85
  }
86
86
 
87
- .bind-preview-bg[data-v-a09bd522] {
88
- background-color: var(--09fda46e);
87
+ img.colorize-black[data-v-2114f510] {
88
+ filter: grayscale(100) brightness(0);
89
+ }
90
+
91
+ .bind-preview-bg[data-v-9bc3d486] {
92
+ background-color: var(--321f9a07);
89
93
  }
90
94
 
91
95
  .__histoire-hatched-pattern[data-v-91561117] {
@@ -95,7 +99,3 @@
95
99
  currentColor 32px,
96
100
  currentColor 64px);
97
101
  }
98
-
99
- img.colorize-black[data-v-74182813] {
100
- filter: grayscale(100) brightness(0);
101
- }
@@ -1,6 +1,6 @@
1
1
  import { router } from "../router.js";
2
- import { openInEditor } from "./open-in-editor.js";
3
2
  import { useStoryStore } from "../stores/story.js";
3
+ import { openInEditor } from "./open-in-editor.js";
4
4
  "use strict";
5
5
  const builtinCommands = [
6
6
  {
@@ -28,14 +28,14 @@ function toRawDeep(val, clean = false, seen = /* @__PURE__ */ new WeakMap()) {
28
28
  return result;
29
29
  }
30
30
  }
31
- const toRawObject = (obj, target, clean = false, seen = /* @__PURE__ */ new WeakMap()) => {
31
+ function toRawObject(obj, target, clean = false, seen = /* @__PURE__ */ new WeakMap()) {
32
32
  Object.keys(obj).forEach((key) => {
33
33
  if (clean && typeof obj[key] === "function") {
34
34
  return;
35
35
  }
36
36
  target[key] = toRawDeep(obj[key], clean, seen);
37
37
  });
38
- };
38
+ }
39
39
  export {
40
40
  toRawDeep
41
41
  };
package/dist/style.css CHANGED
@@ -299,7 +299,7 @@
299
299
  grid-template-columns:repeat(auto-fill,minmax(var(--histoire-col-size),1fr))
300
300
  }
301
301
 
302
- .__histoire-json-code[data-v-9f3f2832] .cm-editor{
302
+ .__histoire-json-code[data-v-935458a7] .cm-editor{
303
303
  height:100%;
304
304
  min-width:280px
305
305
  }
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@histoire/app",
3
- "version": "0.17.16",
3
+ "type": "module",
4
+ "version": "0.17.17",
4
5
  "description": "Pre-bundled UI for Histoire",
5
- "license": "MIT",
6
6
  "author": {
7
7
  "name": "Guillaume Chau"
8
8
  },
9
+ "license": "MIT",
9
10
  "repository": {
10
11
  "url": "https://github.com/Akryum/histoire.git",
11
12
  "type": "git",
@@ -14,7 +15,6 @@
14
15
  "publishConfig": {
15
16
  "access": "public"
16
17
  },
17
- "type": "module",
18
18
  "exports": {
19
19
  ".": {
20
20
  "types": "./dist/index.d.ts",
@@ -27,9 +27,9 @@
27
27
  "@types/flexsearch": "^0.7.6",
28
28
  "flexsearch": "0.7.21",
29
29
  "shiki-es": "^0.2.0",
30
- "@histoire/controls": "^0.17.16",
31
- "@histoire/shared": "^0.17.16",
32
- "@histoire/vendors": "^0.17.16"
30
+ "@histoire/controls": "^0.17.17",
31
+ "@histoire/shared": "^0.17.17",
32
+ "@histoire/vendors": "^0.17.17"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@tailwindcss/typography": "^0.5.10",
@@ -45,7 +45,7 @@
45
45
  "postcss": "^8.4.31",
46
46
  "postcss-import": "^14.1.0",
47
47
  "tailwindcss": "^3.3.5",
48
- "typescript": "^4.9.5",
48
+ "typescript": "^5.4.4",
49
49
  "vite": "^5.0.11",
50
50
  "vue": "^3.3.8"
51
51
  },
package/scripts/copy.mjs CHANGED
@@ -2,7 +2,7 @@ import fs from 'fs-extra'
2
2
  import { globbySync } from 'globby'
3
3
  import { normalizePath } from 'vite'
4
4
 
5
- function toDist (file) {
5
+ function toDist(file) {
6
6
  return normalizePath(file).replace(/^src\//, 'dist/')
7
7
  }
8
8
 
@@ -2,7 +2,7 @@ import chokidar from 'chokidar'
2
2
  import fs from 'fs-extra'
3
3
  import { normalizePath } from 'vite'
4
4
 
5
- function toDist (file) {
5
+ function toDist(file) {
6
6
  return normalizePath(file).replace(/^src\//, 'dist/')
7
7
  }
8
8
 
@@ -10,6 +10,6 @@ function toDist (file) {
10
10
  // they change.
11
11
  chokidar
12
12
  .watch('src/**/!(*.ts|*.vue|tsconfig.json)')
13
- .on('change', (file) => fs.copy(file, toDist(file)))
14
- .on('add', (file) => fs.copy(file, toDist(file)))
15
- .on('unlink', (file) => fs.remove(toDist(file)))
13
+ .on('change', file => fs.copy(file, toDist(file)))
14
+ .on('add', file => fs.copy(file, toDist(file)))
15
+ .on('unlink', file => fs.remove(toDist(file)))
package/src/app/App.vue CHANGED
@@ -5,15 +5,15 @@ export default {
5
5
  </script>
6
6
 
7
7
  <script lang="ts" setup>
8
- import { files as rawFiles, tree as rawTree, onUpdate } from 'virtual:$histoire-stories'
8
+ import { onUpdate, files as rawFiles, tree as rawTree } from 'virtual:$histoire-stories'
9
+ import { computed, onMounted, ref, watch } from 'vue'
10
+ import { useTitle } from '@vueuse/core'
9
11
  import StoryList from './components/tree/StoryList.vue'
10
12
  import BaseSplitPane from './components/base/BaseSplitPane.vue'
11
- import { computed, onMounted, ref, watch } from 'vue'
12
13
  import AppHeader from './components/app/AppHeader.vue'
13
14
  import type { StoryFile, Tree } from './types'
14
15
  import { useStoryStore } from './stores/story'
15
16
  import { mapFile } from './util/mapping'
16
- import { useTitle } from '@vueuse/core'
17
17
  import { histoireConfig } from './util/config'
18
18
  import { onKeyboardShortcut } from './util/keyboard'
19
19
  import { isMobile } from './util/responsive'
@@ -29,7 +29,7 @@ const tree = ref<Tree>(rawTree)
29
29
 
30
30
  onUpdate((newFiles: StoryFile[], newTree: Tree) => {
31
31
  loading.value = false
32
- files.value = newFiles.map(file => {
32
+ files.value = newFiles.map((file) => {
33
33
  const existingFile = files.value.find(f => f.id === file.id)
34
34
  return mapFile(file, existingFile)
35
35
  })
@@ -44,7 +44,7 @@ const stories = computed(() => files.value.reduce((acc, file) => {
44
44
  // Store
45
45
 
46
46
  const storyStore = useStoryStore()
47
- watch(stories, value => {
47
+ watch(stories, (value) => {
48
48
  storyStore.setStories(value)
49
49
  }, {
50
50
  immediate: true,
@@ -66,7 +66,7 @@ useTitle(computed(() => {
66
66
  const loadSearch = ref(false)
67
67
  const isSearchOpen = ref(false)
68
68
 
69
- watch(isSearchOpen, value => {
69
+ watch(isSearchOpen, (value) => {
70
70
  if (value) {
71
71
  loadSearch.value = true
72
72
  }
package/src/app/api.ts CHANGED
@@ -4,6 +4,6 @@ export { logEvent } from './util/events.js'
4
4
 
5
5
  export { toggleDark } from './util/dark.js'
6
6
 
7
- export function isDark () {
7
+ export function isDark() {
8
8
  return _isDark.value
9
9
  }
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { computed } from 'vue'
3
- import { histoireConfig, customLogos } from '../util/config'
3
+ import { customLogos, histoireConfig } from '../util/config'
4
4
  import HistoireLogo from '../assets/histoire.svg'
5
5
  import { useStoryStore } from '../stores/story'
6
6
  import HomeCounter from './app/HomeCounter.vue'
@@ -13,10 +13,11 @@ const stats = computed(() => {
13
13
  let variantCount = 0
14
14
  let docsCount = 0;
15
15
 
16
- (storyStore.stories || []).forEach(story => {
16
+ (storyStore.stories || []).forEach((story) => {
17
17
  if (story.docsOnly) {
18
18
  docsCount++
19
- } else {
19
+ }
20
+ else {
20
21
  storyCount++
21
22
  if (story.variants) {
22
23
  variantCount += story.variants.length
@@ -1,11 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  import { Icon } from '@iconify/vue'
3
3
  import { computed } from 'vue'
4
- import AppLogo from './AppLogo.vue'
5
4
  import { isDark, toggleDark } from '../../util/dark'
6
5
  import { onKeyboardShortcut } from '../../util/keyboard'
7
6
  import { makeTooltip } from '../../util/tooltip'
8
7
  import { histoireConfig } from '../../util/config'
8
+ import AppLogo from './AppLogo.vue'
9
9
 
10
10
  defineEmits({
11
11
  search: () => true,
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" setup>
2
- import { isDark } from '../../util/dark'
3
2
  import { computed } from 'vue'
4
- import { histoireConfig, customLogos } from '../../util/config'
3
+ import { isDark } from '../../util/dark'
4
+ import { customLogos, histoireConfig } from '../../util/config'
5
5
 
6
6
  import HistoireLogoDark from '../../assets/histoire-text-dark.svg'
7
7
  import HistoireLogoLight from '../../assets/histoire-text.svg'
@@ -13,7 +13,7 @@ const logoUrl = computed(() => {
13
13
  return histoireConfig.theme.logo?.light ? customLogos.light : HistoireLogoLight
14
14
  })
15
15
 
16
- const altText = computed(() => histoireConfig.theme.title + ' logo')
16
+ const altText = computed(() => `${histoireConfig.theme.title} logo`)
17
17
  </script>
18
18
 
19
19
  <template>
@@ -2,9 +2,9 @@
2
2
  import { computed, ref, watch } from 'vue'
3
3
  import { Icon } from '@iconify/vue'
4
4
  import { useStoryStore } from '../../stores/story'
5
- import { Story, Tree } from '../../types'
6
- import MobileOverlay from './MobileOverlay.vue'
5
+ import type { Story, Tree } from '../../types'
7
6
  import StoryList from '../tree/StoryList.vue'
7
+ import MobileOverlay from './MobileOverlay.vue'
8
8
 
9
9
  defineProps<{
10
10
  tree: Tree
@@ -21,11 +21,11 @@ const folders = computed(() => {
21
21
 
22
22
  const isMenuOpened = ref(false)
23
23
 
24
- function openMenu () {
24
+ function openMenu() {
25
25
  isMenuOpened.value = true
26
26
  }
27
27
 
28
- function closeMenu () {
28
+ function closeMenu() {
29
29
  isMenuOpened.value = false
30
30
  }
31
31
 
@@ -1,6 +1,4 @@
1
1
  <script setup lang="ts">
2
- import { ref, toRefs } from 'vue'
3
- import { useTransition, syncRefs } from '@vueuse/core'
4
2
  import { Icon } from '@iconify/vue'
5
3
 
6
4
  const props = defineProps({
@@ -17,13 +15,6 @@ const props = defineProps({
17
15
  default: 0,
18
16
  },
19
17
  })
20
-
21
- const { count } = toRefs(props)
22
- const delayedCount = ref(0)
23
-
24
- const animatedCount = useTransition(delayedCount, { delay: 100, duration: 700 })
25
-
26
- syncRefs(count, delayedCount)
27
18
  </script>
28
19
 
29
20
  <template>
@@ -36,7 +27,7 @@ syncRefs(count, delayedCount)
36
27
  <span
37
28
  class="htw-text-primary-500 htw-min-w-[80px] htw-font-bold"
38
29
  >
39
- {{ animatedCount.toFixed() }}
30
+ {{ count }}
40
31
  </span>
41
32
  <span
42
33
  class="htw-text-sm htw-text-gray-900 dark:htw-text-gray-100"
@@ -6,7 +6,7 @@ defineProps<{
6
6
  opened: boolean
7
7
  }>()
8
8
 
9
- const emit = defineEmits<{(e: 'close'): void}>()
9
+ const emit = defineEmits<{ (e: 'close'): void }>()
10
10
  </script>
11
11
 
12
12
  <template>
@@ -9,11 +9,10 @@ const props = defineProps({
9
9
  })
10
10
 
11
11
  const emit = defineEmits({
12
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
13
- 'update:modelValue': (newValue: boolean) => true,
12
+ 'update:modelValue': (_newValue: boolean) => true,
14
13
  })
15
14
 
16
- function toggle () {
15
+ function toggle() {
17
16
  emit('update:modelValue', !props.modelValue)
18
17
  animationEnabled.value = true
19
18
  }
@@ -6,8 +6,8 @@ const props = defineProps<{
6
6
  icon: string
7
7
  }>()
8
8
 
9
- const isUrl = computed(() => props.icon.startsWith('http') || props.icon.startsWith('data:image') ||
10
- props.icon.startsWith('.') || props.icon.startsWith('/'))
9
+ const isUrl = computed(() => props.icon.startsWith('http') || props.icon.startsWith('data:image')
10
+ || props.icon.startsWith('.') || props.icon.startsWith('/'))
11
11
  </script>
12
12
 
13
13
  <template>
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
- import { formatKey } from '../../util/keyboard.js'
3
2
  import { computed } from 'vue'
3
+ import { formatKey } from '../../util/keyboard.js'
4
4
 
5
5
  const props = defineProps<{
6
6
  shortcut: string
@@ -7,7 +7,7 @@ const emit = defineEmits<{
7
7
  (e: 'navigate'): void
8
8
  }>()
9
9
 
10
- function handleNavigate () {
10
+ function handleNavigate() {
11
11
  emit('navigate')
12
12
  }
13
13
  </script>
@@ -19,7 +19,7 @@ function handleNavigate () {
19
19
  $attrs.class,
20
20
  isActive
21
21
  ? 'active htw-bg-primary-500 hover:htw-bg-primary-600 htw-text-white dark:htw-text-black'
22
- : 'hover:htw-bg-primary-100 dark:hover:htw-bg-primary-900'
22
+ : 'hover:htw-bg-primary-100 dark:hover:htw-bg-primary-900',
23
23
  ]"
24
24
  @click="handleNavigate()"
25
25
  @keyup.enter="handleNavigate()"
@@ -15,8 +15,8 @@ export default defineComponent({
15
15
  navigate: () => true,
16
16
  },
17
17
 
18
- setup (props, { emit }) {
19
- function handleNavigate (event, navigate: (event) => unknown) {
18
+ setup(props, { emit }) {
19
+ function handleNavigate(event, navigate: (event) => unknown) {
20
20
  emit('navigate')
21
21
  navigate(event)
22
22
  }
@@ -42,7 +42,7 @@ export default defineComponent({
42
42
  $attrs.class,
43
43
  (isActive != null ? isActive : linkIsActive)
44
44
  ? 'active htw-bg-primary-500 hover:htw-bg-primary-600 htw-text-white dark:htw-text-black'
45
- : 'hover:htw-bg-primary-100 dark:hover:htw-bg-primary-900'
45
+ : 'hover:htw-bg-primary-100 dark:hover:htw-bg-primary-900',
46
46
  ]"
47
47
  @click="handleNavigate($event, navigate)"
48
48
  @keyup.enter="handleNavigate($event, navigate)"
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { ref, h, onBeforeUnmount, reactive, computed } from 'vue'
2
+ import { computed, h, onBeforeUnmount, reactive, ref } from 'vue'
3
3
  import { useResizeObserver } from '@vueuse/core'
4
4
  import { Icon } from '@iconify/vue'
5
5
 
@@ -43,7 +43,7 @@ const visibleChildrenCount = computed(() => {
43
43
  const ChildWrapper = {
44
44
  name: 'ChildWrapper',
45
45
  props: ['index'],
46
- setup (props, { slots }) {
46
+ setup(props, { slots }) {
47
47
  const el = ref<HTMLDivElement>()
48
48
 
49
49
  const state = reactive({ width: 0, index: props.index })
@@ -69,7 +69,7 @@ const ChildWrapper = {
69
69
  /**
70
70
  * Wraps each child with a <ChildWrapper>
71
71
  */
72
- const ChildrenRender = (props, { slots }) => {
72
+ function ChildrenRender(props, { slots }) {
73
73
  const [fragment] = slots.default()
74
74
  return fragment.children.map((vnode, index) => h(ChildWrapper, { index }, () => [vnode]))
75
75
  }
@@ -77,7 +77,7 @@ const ChildrenRender = (props, { slots }) => {
77
77
  /**
78
78
  * Only renders a part of a children list
79
79
  */
80
- const ChildrenSlice = (props, { slots }) => {
80
+ function ChildrenSlice(props, { slots }) {
81
81
  const [fragment] = slots.default()
82
82
  return fragment.children.slice(props.start, props.end)
83
83
  }