@histoire/app 0.17.17 → 1.0.0-alpha.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.
Files changed (170) hide show
  1. package/dist/app/style/main.pcss +1 -1
  2. package/dist/app/style/sandbox.css +1 -1
  3. package/dist/bundle-main-dev.js +1 -1
  4. package/dist/bundle-main.js +2 -2
  5. package/dist/bundled/App.vue2.js +11 -11
  6. package/dist/bundled/{style.css → app.css} +41 -41
  7. package/dist/bundled/components/HomeView.vue2.js +1 -1
  8. package/dist/bundled/components/app/AppHeader.vue2.js +2 -2
  9. package/dist/bundled/components/app/AppLogo.vue2.js +3 -3
  10. package/dist/bundled/components/app/Breadcrumb.vue.js +2 -2
  11. package/dist/bundled/components/app/Breadcrumb.vue2.js +7 -9
  12. package/dist/bundled/components/app/InitialLoading.vue2.js +1 -1
  13. package/dist/bundled/components/base/BaseEmpty.vue.js +2 -3
  14. package/dist/bundled/components/base/BaseIcon.vue.js +1 -1
  15. package/dist/bundled/components/base/BaseIcon.vue2.js +1 -2
  16. package/dist/bundled/components/base/BaseListItemLink.vue.js +1 -1
  17. package/dist/bundled/components/base/BaseOverflowMenu.vue2.js +1 -1
  18. package/dist/bundled/components/base/BaseOverflowTab.vue.js +1 -1
  19. package/dist/bundled/components/base/BaseSelect.vue2.js +2 -2
  20. package/dist/bundled/components/base/BaseSplitPane.vue.js +1 -1
  21. package/dist/bundled/components/base/BaseSplitPane.vue2.js +2 -4
  22. package/dist/bundled/components/base/BaseTab.vue.js +1 -1
  23. package/dist/bundled/components/base/BaseTag.vue.js +1 -1
  24. package/dist/bundled/components/command/CommandPrompts.vue2.js +3 -7
  25. package/dist/bundled/components/command/CommandPromptsModal.vue2.js +1 -1
  26. package/dist/bundled/components/command/PromptSelect.vue2.js +3 -3
  27. package/dist/bundled/components/command/PromptText.vue2.js +1 -1
  28. package/dist/bundled/components/misc/CheckerboardPattern.vue.js +31 -34
  29. package/dist/bundled/components/misc/HatchedPattern.vue.js +2 -3
  30. package/dist/bundled/components/panel/ControlsComponentPropItem.vue2.js +1 -1
  31. package/dist/bundled/components/panel/ControlsComponentProps.vue2.js +2 -4
  32. package/dist/bundled/components/panel/ControlsComponentState.vue2.js +1 -2
  33. package/dist/bundled/components/panel/PaneTabs.vue2.js +11 -11
  34. package/dist/bundled/components/panel/StatePresets.vue2.js +3 -4
  35. package/dist/bundled/components/panel/StoryControls.vue2.js +5 -6
  36. package/dist/bundled/components/panel/StoryDocs.vue2.js +4 -4
  37. package/dist/bundled/components/panel/StoryEvents.vue2.js +2 -2
  38. package/dist/bundled/components/panel/StorySidePanel.vue2.js +10 -12
  39. package/dist/bundled/components/panel/StorySourceCode.vue.js +2 -2
  40. package/dist/bundled/components/panel/StorySourceCode.vue2.js +15 -20
  41. package/dist/bundled/components/search/SearchItem.vue.js +2 -2
  42. package/dist/bundled/components/search/SearchItem.vue2.js +4 -6
  43. package/dist/bundled/components/search/SearchLoading.vue2.js +2 -2
  44. package/dist/bundled/components/search/SearchModal.vue2.js +1 -1
  45. package/dist/bundled/components/search/SearchPane.vue2.js +41 -59
  46. package/dist/bundled/components/search/search-docs-data.js +1 -1
  47. package/dist/bundled/components/search/search-title-data.js +1 -1
  48. package/dist/bundled/components/story/GenericMountStory.vue2.js +1 -1
  49. package/dist/bundled/components/story/StoryResponsivePreview.vue.js +2 -2
  50. package/dist/bundled/components/story/StoryResponsivePreview.vue2.js +7 -10
  51. package/dist/bundled/components/story/StoryVariantGrid.vue2.js +4 -7
  52. package/dist/bundled/components/story/StoryVariantGridItem.vue.js +2 -2
  53. package/dist/bundled/components/story/StoryVariantGridItem.vue2.js +13 -15
  54. package/dist/bundled/components/story/StoryVariantListItem.vue.js +2 -2
  55. package/dist/bundled/components/story/StoryVariantListItem.vue2.js +3 -4
  56. package/dist/bundled/components/story/StoryVariantSingle.vue.js +2 -2
  57. package/dist/bundled/components/story/StoryVariantSingle.vue2.js +2 -3
  58. package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue2.js +2 -2
  59. package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue2.js +3 -3
  60. package/dist/bundled/components/story/StoryVariantSingleView.vue2.js +4 -4
  61. package/dist/bundled/components/story/StoryView.vue2.js +4 -4
  62. package/dist/bundled/components/story/StoryViewer.vue.js +2 -2
  63. package/dist/bundled/components/story/StoryViewer.vue2.js +3 -4
  64. package/dist/bundled/components/toolbar/ToolbarBackground.vue.js +1 -1
  65. package/dist/bundled/components/toolbar/ToolbarBackground.vue2.js +3 -4
  66. package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue2.js +16 -17
  67. package/dist/bundled/components/tree/StoryGroup.vue2.js +8 -10
  68. package/dist/bundled/components/tree/StoryList.vue2.js +3 -3
  69. package/dist/bundled/components/tree/StoryListFolder.vue.js +2 -2
  70. package/dist/bundled/components/tree/StoryListFolder.vue2.js +11 -13
  71. package/dist/bundled/components/tree/StoryListItem.vue.js +2 -2
  72. package/dist/bundled/components/tree/StoryListItem.vue2.js +4 -5
  73. package/dist/bundled/index.js +4 -4
  74. package/dist/bundled/plugin.js +1 -2
  75. package/dist/bundled/sandbox.js +14 -19
  76. package/dist/bundled/stores/folder.js +1 -1
  77. package/dist/bundled/stores/preview-settings.js +1 -1
  78. package/dist/bundled/util/dark.js +1 -1
  79. package/dist/bundled/util/events.js +2 -4
  80. package/dist/bundled/util/scroll.js +1 -1
  81. package/dist/style.css +281 -293
  82. package/package.json +22 -23
  83. package/src/app/App.vue +11 -11
  84. package/src/app/api.ts +2 -2
  85. package/src/app/components/HomeView.vue +1 -1
  86. package/src/app/components/app/AppHeader.vue +1 -1
  87. package/src/app/components/app/AppLogo.vue +3 -3
  88. package/src/app/components/app/Breadcrumb.vue +2 -2
  89. package/src/app/components/base/BaseOverflowMenu.vue +2 -2
  90. package/src/app/components/base/BaseSelect.vue +2 -2
  91. package/src/app/components/command/CommandPrompts.vue +3 -6
  92. package/src/app/components/command/PromptSelect.vue +1 -1
  93. package/src/app/components/panel/ControlsComponentPropItem.vue +3 -3
  94. package/src/app/components/panel/ControlsComponentProps.vue +1 -1
  95. package/src/app/components/panel/ControlsComponentState.vue +2 -2
  96. package/src/app/components/panel/ControlsComponentStateItem.vue +2 -2
  97. package/src/app/components/panel/PaneTabs.vue +2 -2
  98. package/src/app/components/panel/StatePresets.vue +4 -4
  99. package/src/app/components/panel/StoryControls.vue +4 -4
  100. package/src/app/components/panel/StoryDocs.vue +5 -5
  101. package/src/app/components/panel/StoryEvent.vue +1 -1
  102. package/src/app/components/panel/StoryEvents.vue +2 -2
  103. package/src/app/components/panel/StorySidePanel.vue +2 -2
  104. package/src/app/components/panel/StorySourceCode.vue +4 -4
  105. package/src/app/components/search/SearchItem.vue +2 -2
  106. package/src/app/components/search/SearchItemContent.vue +1 -1
  107. package/src/app/components/search/SearchPane.vue +49 -61
  108. package/src/app/components/search/search-docs-data.ts +2 -2
  109. package/src/app/components/search/search-title-data.ts +2 -2
  110. package/src/app/components/search/types.ts +1 -1
  111. package/src/app/components/story/GenericMountStory.vue +1 -1
  112. package/src/app/components/story/GenericRenderStory.vue +1 -1
  113. package/src/app/components/story/StoryResponsivePreview.vue +5 -5
  114. package/src/app/components/story/StoryVariantGrid.vue +1 -1
  115. package/src/app/components/story/StoryVariantGridItem.vue +8 -8
  116. package/src/app/components/story/StoryVariantListItem.vue +3 -3
  117. package/src/app/components/story/StoryVariantSingle.vue +1 -1
  118. package/src/app/components/story/StoryVariantSinglePreviewNative.vue +3 -3
  119. package/src/app/components/story/StoryVariantSinglePreviewRemote.vue +6 -6
  120. package/src/app/components/story/StoryVariantSingleView.vue +4 -4
  121. package/src/app/components/story/StoryView.vue +4 -4
  122. package/src/app/components/story/StoryViewer.vue +1 -1
  123. package/src/app/components/toolbar/ToolbarNewTab.vue +1 -1
  124. package/src/app/components/toolbar/ToolbarTitle.vue +1 -1
  125. package/src/app/components/tree/StoryGroup.vue +2 -2
  126. package/src/app/components/tree/StoryList.vue +2 -2
  127. package/src/app/components/tree/StoryListFolder.vue +1 -1
  128. package/src/app/components/tree/StoryListItem.vue +2 -2
  129. package/src/app/index.ts +4 -4
  130. package/src/app/sandbox.ts +13 -17
  131. package/src/app/stores/folder.ts +1 -1
  132. package/src/app/stores/preview-settings.ts +2 -2
  133. package/src/app/stores/story.ts +1 -1
  134. package/src/app/style/main.pcss +1 -1
  135. package/src/app/style/sandbox.css +1 -1
  136. package/src/app/types.ts +1 -1
  137. package/src/app/util/dark.ts +1 -1
  138. package/src/app/util/docs.ts +1 -1
  139. package/src/app/util/keyboard.ts +1 -1
  140. package/src/app/util/mapping.ts +1 -1
  141. package/src/app/util/preview-settings.ts +1 -1
  142. package/src/app/util/sandbox.ts +1 -1
  143. package/src/app/util/scroll.ts +1 -1
  144. package/src/app/util/variant.ts +1 -1
  145. package/src/bundle-main-dev.js +1 -1
  146. package/src/bundle-main.js +2 -2
  147. package/tailwind.config.cjs +1 -1
  148. package/vite.config.ts +2 -2
  149. package/dist/bundled/components/app/Breadcrumb.vue3.js +0 -1
  150. package/dist/bundled/components/base/BaseEmpty.vue2.js +0 -1
  151. package/dist/bundled/components/base/BaseIcon.vue3.js +0 -1
  152. package/dist/bundled/components/base/BaseSplitPane.vue3.js +0 -1
  153. package/dist/bundled/components/misc/HatchedPattern.vue2.js +0 -1
  154. package/dist/bundled/components/panel/StorySourceCode.vue3.js +0 -1
  155. package/dist/bundled/components/search/SearchItem.vue3.js +0 -1
  156. package/dist/bundled/components/story/StoryResponsivePreview.vue3.js +0 -1
  157. package/dist/bundled/components/story/StoryVariantGridItem.vue3.js +0 -1
  158. package/dist/bundled/components/story/StoryVariantListItem.vue3.js +0 -1
  159. package/dist/bundled/components/story/StoryVariantSingle.vue3.js +0 -1
  160. package/dist/bundled/components/story/StoryViewer.vue3.js +0 -1
  161. package/dist/bundled/components/toolbar/ToolbarBackground.vue3.js +0 -1
  162. package/dist/bundled/components/tree/StoryListFolder.vue3.js +0 -1
  163. package/dist/bundled/components/tree/StoryListItem.vue3.js +0 -1
  164. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/common.js +0 -52
  165. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/en.js +0 -10
  166. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/advanced.js +0 -16
  167. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/balance.js +0 -31
  168. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/simple.js +0 -15
  169. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang.js +0 -60
  170. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/type.js +0 -11
@@ -5,9 +5,9 @@ export default {
5
5
  </script>
6
6
 
7
7
  <script lang="ts" setup>
8
+ import type { Story } from '../../types'
8
9
  import { clientSupportPlugins } from 'virtual:$histoire-support-plugins-client'
9
10
  import { markRaw, ref, watchEffect } from 'vue'
10
- import type { Story } from '../../types'
11
11
 
12
12
  const props = defineProps<{
13
13
  story: Story
@@ -5,9 +5,9 @@ export default {
5
5
  </script>
6
6
 
7
7
  <script lang="ts" setup>
8
+ import type { Story } from '../../types'
8
9
  import { clientSupportPlugins } from 'virtual:$histoire-support-plugins-client'
9
10
  import { markRaw, ref, watchEffect } from 'vue'
10
- import type { Story } from '../../types'
11
11
 
12
12
  const props = defineProps<{
13
13
  story: Story
@@ -1,13 +1,13 @@
1
1
  <script lang="ts" setup>
2
2
  import type { Ref } from 'vue'
3
- import { computed, onUnmounted, ref } from 'vue'
4
- import { useEventListener } from '@vueuse/core'
3
+ import type { Variant } from '../../types'
5
4
  import { Icon } from '@iconify/vue'
5
+ import { useEventListener } from '@vueuse/core'
6
6
  import { VTooltip as vTooltip } from 'floating-vue'
7
- import HatchedPattern from '../misc/HatchedPattern.vue'
8
- import CheckerboardPattern from '../misc/CheckerboardPattern.vue'
7
+ import { computed, onUnmounted, ref } from 'vue'
9
8
  import { usePreviewSettingsStore } from '../../stores/preview-settings'
10
- import type { Variant } from '../../types'
9
+ import CheckerboardPattern from '../misc/CheckerboardPattern.vue'
10
+ import HatchedPattern from '../misc/HatchedPattern.vue'
11
11
 
12
12
  const props = defineProps<{
13
13
  variant: Variant
@@ -3,9 +3,9 @@ import { useResizeObserver } from '@vueuse/core'
3
3
  import { computed, onMounted, ref, watch } from 'vue'
4
4
  import { useStoryStore } from '../../stores/story'
5
5
  import { isMobile } from '../../util/responsive'
6
+ import DevOnlyToolbarOpenInEditor from '../toolbar/DevOnlyToolbarOpenInEditor.vue'
6
7
  import ToolbarBackground from '../toolbar/ToolbarBackground.vue'
7
8
  import ToolbarTextDirection from '../toolbar/ToolbarTextDirection.vue'
8
- import DevOnlyToolbarOpenInEditor from '../toolbar/DevOnlyToolbarOpenInEditor.vue'
9
9
  import StoryVariantGridItem from './StoryVariantGridItem.vue'
10
10
 
11
11
  const storyStore = useStoryStore()
@@ -1,20 +1,20 @@
1
1
  <script lang="ts" setup>
2
2
  import type { PropType } from 'vue'
3
- import { computed, ref, toRefs } from 'vue'
3
+ import type { Story, Variant } from '../../types'
4
+ import { HstCopyIcon } from '@histoire/controls'
4
5
  import { Icon } from '@iconify/vue'
5
- import { useRouter } from 'vue-router'
6
6
  import { useResizeObserver } from '@vueuse/core'
7
- import { HstCopyIcon } from '@histoire/controls'
8
- import { useCurrentVariantRoute } from '../../util/variant'
9
- import type { Story, Variant } from '../../types'
10
- import { useScrollOnActive } from '../../util/scroll'
7
+ import { computed, ref, toRefs } from 'vue'
8
+ import { useRouter } from 'vue-router'
11
9
  import { usePreviewSettingsStore } from '../../stores/preview-settings'
12
- import { getContrastColor } from '../../util/preview-settings'
13
10
  import { histoireConfig } from '../../util/config'
14
11
  import { isDark } from '../../util/dark'
15
12
  import { getSourceCode } from '../../util/docs'
16
- import ToolbarNewTab from '../toolbar/ToolbarNewTab.vue'
13
+ import { getContrastColor } from '../../util/preview-settings'
14
+ import { useScrollOnActive } from '../../util/scroll'
15
+ import { useCurrentVariantRoute } from '../../util/variant'
17
16
  import CheckerboardPattern from '../misc/CheckerboardPattern.vue'
17
+ import ToolbarNewTab from '../toolbar/ToolbarNewTab.vue'
18
18
  import GenericRenderStory from './GenericRenderStory.vue'
19
19
 
20
20
  const props = defineProps({
@@ -1,11 +1,11 @@
1
1
  <script lang="ts" setup>
2
2
  import type { PropType } from 'vue'
3
- import { ref, toRefs } from 'vue'
3
+ import type { Variant } from '../../types'
4
4
  import { Icon } from '@iconify/vue'
5
+ import { ref, toRefs } from 'vue'
6
+ import { useScrollOnActive } from '../../util/scroll'
5
7
  import { useCurrentVariantRoute } from '../../util/variant'
6
- import type { Variant } from '../../types'
7
8
  import BaseListItemLink from '../base/BaseListItemLink.vue'
8
- import { useScrollOnActive } from '../../util/scroll'
9
9
 
10
10
  const props = defineProps({
11
11
  variant: {
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
- import { computed } from 'vue'
3
2
  import { Icon } from '@iconify/vue'
3
+ import { computed } from 'vue'
4
4
  import { useStoryStore } from '../../stores/story'
5
5
  import { isMobile } from '../../util/responsive'
6
6
  import BaseSplitPane from '../base/BaseSplitPane.vue'
@@ -1,9 +1,9 @@
1
1
  <script lang="ts" setup>
2
- import { computed } from 'vue'
3
2
  import type { Story, Variant } from '../../types'
4
- import { isDark } from '../../util/dark'
5
- import { histoireConfig } from '../../util/config'
3
+ import { computed } from 'vue'
6
4
  import { usePreviewSettingsStore } from '../../stores/preview-settings'
5
+ import { histoireConfig } from '../../util/config'
6
+ import { isDark } from '../../util/dark'
7
7
  import { getContrastColor } from '../../util/preview-settings'
8
8
  import GenericRenderStory from './GenericRenderStory.vue'
9
9
  import StoryResponsivePreview from './StoryResponsivePreview.vue'
@@ -1,13 +1,13 @@
1
1
  <script lang="ts" setup>
2
- import { computed, ref, toRaw, watch } from 'vue'
3
- import { useEventListener } from '@vueuse/core'
2
+ import type { HstEvent } from '../../stores/events'
3
+ import type { Story, Variant } from '../../types'
4
4
  import { applyState } from '@histoire/shared'
5
+ import { useEventListener } from '@vueuse/core'
6
+ import { computed, ref, toRaw, watch } from 'vue'
7
+ import { useEventsStore } from '../../stores/events'
8
+ import { usePreviewSettingsStore } from '../../stores/preview-settings'
5
9
  import { EVENT_SEND, PREVIEW_SETTINGS_SYNC, SANDBOX_READY, STATE_SYNC } from '../../util/const'
6
- import type { Story, Variant } from '../../types'
7
10
  import { getSandboxUrl } from '../../util/sandbox'
8
- import { usePreviewSettingsStore } from '../../stores/preview-settings'
9
- import type { HstEvent } from '../../stores/events'
10
- import { useEventsStore } from '../../stores/events'
11
11
  import { toRawDeep } from '../../util/state'
12
12
  import StoryResponsivePreview from './StoryResponsivePreview.vue'
13
13
 
@@ -1,12 +1,12 @@
1
1
  <script lang="ts" setup>
2
2
  import type { Story, Variant } from '../../types'
3
3
  import { isMobile } from '../../util/responsive'
4
- import ToolbarTitle from '../toolbar/ToolbarTitle.vue'
5
- import ToolbarResponsiveSize from '../toolbar/ToolbarResponsiveSize.vue'
4
+ import DevOnlyToolbarOpenInEditor from '../toolbar/DevOnlyToolbarOpenInEditor.vue'
6
5
  import ToolbarBackground from '../toolbar/ToolbarBackground.vue'
7
- import ToolbarTextDirection from '../toolbar/ToolbarTextDirection.vue'
8
6
  import ToolbarNewTab from '../toolbar/ToolbarNewTab.vue'
9
- import DevOnlyToolbarOpenInEditor from '../toolbar/DevOnlyToolbarOpenInEditor.vue'
7
+ import ToolbarResponsiveSize from '../toolbar/ToolbarResponsiveSize.vue'
8
+ import ToolbarTextDirection from '../toolbar/ToolbarTextDirection.vue'
9
+ import ToolbarTitle from '../toolbar/ToolbarTitle.vue'
10
10
  import StoryVariantSinglePreviewNative from './StoryVariantSinglePreviewNative.vue'
11
11
  import StoryVariantSinglePreviewRemote from './StoryVariantSinglePreviewRemote.vue'
12
12
 
@@ -1,14 +1,14 @@
1
1
  <script lang="ts" setup>
2
+ import { Icon } from '@iconify/vue'
2
3
  import { ref, watch } from 'vue'
3
4
  import { useRoute, useRouter } from 'vue-router'
4
- import { Icon } from '@iconify/vue'
5
5
  import { useStoryStore } from '../../stores/story'
6
6
 
7
- import BaseSplitPane from '../base/BaseSplitPane.vue'
8
- import BaseEmpty from '../base/BaseEmpty.vue'
9
7
  import { isMobile } from '../../util/responsive'
10
- import StorySidePanel from '../panel/StorySidePanel.vue'
8
+ import BaseEmpty from '../base/BaseEmpty.vue'
9
+ import BaseSplitPane from '../base/BaseSplitPane.vue'
11
10
  import StoryDocs from '../panel/StoryDocs.vue'
11
+ import StorySidePanel from '../panel/StorySidePanel.vue'
12
12
  import StoryViewer from './StoryViewer.vue'
13
13
 
14
14
  const storyStore = useStoryStore()
@@ -2,8 +2,8 @@
2
2
  import { computed, ref, watch } from 'vue'
3
3
  import { useStoryStore } from '../../stores/story'
4
4
  import MobileOverlay from '../app/MobileOverlay.vue'
5
- import StoryVariantListItem from './StoryVariantListItem.vue'
6
5
  import StoryVariantGrid from './StoryVariantGrid.vue'
6
+ import StoryVariantListItem from './StoryVariantListItem.vue'
7
7
  import StoryVariantSingle from './StoryVariantSingle.vue'
8
8
 
9
9
  const storyStore = useStoryStore()
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" setup>
2
+ import type { Story, Variant } from '../../types'
2
3
  import { Icon } from '@iconify/vue'
3
4
  import { computed } from 'vue'
4
- import type { Story, Variant } from '../../types'
5
5
  import { getSandboxUrl } from '../../util/sandbox'
6
6
 
7
7
  const props = defineProps<{
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
- import { Icon } from '@iconify/vue'
3
2
  import type { Variant } from '../../types'
3
+ import { Icon } from '@iconify/vue'
4
4
 
5
5
  defineProps<{
6
6
  variant: Variant
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" setup>
2
+ import type { Story, TreeGroup } from '../../types'
2
3
  import { Icon } from '@iconify/vue'
3
4
  import { computed, withDefaults } from 'vue'
4
- import type { Story, TreeGroup } from '../../types'
5
5
  import { useFolderStore } from '../../stores/folder'
6
- import StoryListItem from './StoryListItem.vue'
7
6
  import StoryListFolder from './StoryListFolder.vue'
7
+ import StoryListItem from './StoryListItem.vue'
8
8
 
9
9
  const props = withDefaults(defineProps<{
10
10
  path?: Array<string>
@@ -1,8 +1,8 @@
1
1
  <script lang="ts" setup>
2
2
  import type { Story, Tree, TreeFolder, TreeGroup, TreeLeaf } from '../../types'
3
- import StoryListItem from './StoryListItem.vue'
4
- import StoryListFolder from './StoryListFolder.vue'
5
3
  import StoryGroup from './StoryGroup.vue'
4
+ import StoryListFolder from './StoryListFolder.vue'
5
+ import StoryListItem from './StoryListItem.vue'
6
6
 
7
7
  defineProps<{
8
8
  tree: Tree
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" setup>
2
+ import type { Story, TreeFolder, TreeLeaf } from '../../types'
2
3
  import { Icon } from '@iconify/vue'
3
4
  import { computed, withDefaults } from 'vue'
4
- import type { Story, TreeFolder, TreeLeaf } from '../../types'
5
5
  import { useFolderStore } from '../../stores/folder'
6
6
  import StoryListItem from './StoryListItem.vue'
7
7
 
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" setup>
2
+ import type { Story } from '../../types'
2
3
  import { Icon } from '@iconify/vue'
3
4
  import { computed, ref, withDefaults } from 'vue'
4
5
  import { useRoute } from 'vue-router'
5
- import BaseListItemLink from '../base/BaseListItemLink.vue'
6
- import type { Story } from '../../types'
7
6
  import { useScrollOnActive } from '../../util/scroll'
7
+ import BaseListItemLink from '../base/BaseListItemLink.vue'
8
8
 
9
9
  const props = withDefaults(defineProps<{
10
10
  story: Story
package/src/app/index.ts CHANGED
@@ -1,10 +1,10 @@
1
- import 'virtual:$histoire-theme'
2
- import { createApp } from 'vue'
3
- import { createPinia } from 'pinia'
4
1
  import FloatingVue from 'floating-vue'
2
+ import { createPinia } from 'pinia'
3
+ import { createApp } from 'vue'
5
4
  import App from './App.vue'
6
- import { router } from './router'
7
5
  import { setupPluginApi } from './plugin.js'
6
+ import { router } from './router'
7
+ import 'virtual:$histoire-theme'
8
8
 
9
9
  export async function mountMainApp() {
10
10
  const app = createApp(App)
@@ -1,18 +1,18 @@
1
- import { parseQuery } from 'vue-router'
2
- import { computed, createApp, h, onMounted, ref, watch } from 'vue'
3
- import { createPinia } from 'pinia'
1
+ import type { StoryFile } from './types'
4
2
  import { applyState } from '@histoire/shared'
3
+ import { createPinia } from 'pinia'
5
4
  import { files } from 'virtual:$histoire-stories'
5
+ import { computed, createApp, h, onMounted, ref, watch } from 'vue'
6
+ import { parseQuery } from 'vue-router'
6
7
  import GenericMountStory from './components/story/GenericMountStory.vue'
7
8
  import GenericRenderStory from './components/story/GenericRenderStory.vue'
8
- import type { StoryFile } from './types'
9
- import { mapFile } from './util/mapping'
9
+ import { setupPluginApi } from './plugin.js'
10
+ import { histoireConfig } from './util/config.js'
10
11
  import { PREVIEW_SETTINGS_SYNC, SANDBOX_READY, STATE_SYNC } from './util/const.js'
11
- import { applyPreviewSettings } from './util/preview-settings.js'
12
12
  import { isDark } from './util/dark.js'
13
- import { histoireConfig } from './util/config.js'
13
+ import { mapFile } from './util/mapping'
14
+ import { applyPreviewSettings } from './util/preview-settings.js'
14
15
  import { toRawDeep } from './util/state.js'
15
- import { setupPluginApi } from './plugin.js'
16
16
 
17
17
  const query = parseQuery(window.location.search)
18
18
  const file = ref<StoryFile>(mapFile(files.find(f => f.id === query.storyId)))
@@ -71,15 +71,11 @@ const app = createApp({
71
71
  }),
72
72
  ]),
73
73
  this.story && this.variant
74
- ? h(GenericRenderStory, {
75
- story: this.story,
76
- variant: this.variant,
77
- onReady: () => {
78
- window.parent?.postMessage({
79
- type: SANDBOX_READY,
80
- })
81
- },
82
- })
74
+ ? h(GenericRenderStory, { story: this.story, variant: this.variant, onReady: () => {
75
+ window.parent?.postMessage({
76
+ type: SANDBOX_READY,
77
+ })
78
+ } })
83
79
  : null,
84
80
  ]
85
81
  },
@@ -1,6 +1,6 @@
1
+ import { useStorage } from '@vueuse/core'
1
2
  import { defineStore } from 'pinia'
2
3
  import { watch } from 'vue'
3
- import { useStorage } from '@vueuse/core'
4
4
  import { useStoryStore } from './story'
5
5
 
6
6
  export const useFolderStore = defineStore('folder', () => {
@@ -1,6 +1,6 @@
1
- import { defineStore } from 'pinia'
2
- import { useStorage } from '@vueuse/core'
3
1
  import type { PreviewSettings } from '../types'
2
+ import { useStorage } from '@vueuse/core'
3
+ import { defineStore } from 'pinia'
4
4
 
5
5
  export const usePreviewSettingsStore = defineStore('preview-settings', () => {
6
6
  const currentSettings = useStorage<PreviewSettings>('_histoire-sandbox-settings-v3', {
@@ -1,7 +1,7 @@
1
+ import type { Story, Variant } from '../types'
1
2
  import { defineStore } from 'pinia'
2
3
  import { computed, ref } from 'vue'
3
4
  import { router } from '../router'
4
- import type { Story, Variant } from '../types'
5
5
 
6
6
  export const useStoryStore = defineStore('story', () => {
7
7
  const stories = ref<Story[]>([])
@@ -1,6 +1,6 @@
1
1
  @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Display&display=swap');
2
2
  @import 'floating-vue/dist/style.css';
3
- @import '@histoire/controls/dist/style.css';
3
+ @import '@histoire/controls/dist/index.es.css';
4
4
 
5
5
  @import 'floating.pcss';
6
6
  @import 'transitions.pcss';
@@ -1,4 +1,4 @@
1
- @import '@histoire/controls/dist/style.css';
1
+ @import '@histoire/controls/dist/index.es.css';
2
2
 
3
3
  html,
4
4
  body {
package/src/app/types.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type { RouteLocationRaw } from 'vue-router'
2
2
 
3
3
  export type {
4
+ Story,
4
5
  StoryFile,
5
6
  StoryLayout,
6
- Story,
7
7
  Variant,
8
8
  } from '@histoire/shared'
9
9
 
@@ -1,5 +1,5 @@
1
- import { watch } from 'vue'
2
1
  import { useDark, useToggle } from '@vueuse/core'
2
+ import { watch } from 'vue'
3
3
  import { histoireConfig } from './config.js'
4
4
 
5
5
  export const isDark = useDark({
@@ -1,6 +1,6 @@
1
+ import type { Story, Variant } from '../types'
1
2
  import { unindent } from '@histoire/shared'
2
3
  import { clientSupportPlugins } from 'virtual:$histoire-support-plugins-client'
3
- import type { Story, Variant } from '../types'
4
4
 
5
5
  export async function getSourceCode(story: Story, variant: Variant) {
6
6
  if (variant.source) {
@@ -1,5 +1,5 @@
1
- import { useEventListener } from '@vueuse/core'
2
1
  import type { Ref } from 'vue'
2
+ import { useEventListener } from '@vueuse/core'
3
3
  import { isRef } from 'vue'
4
4
  import { isMac } from './env.js'
5
5
 
@@ -1,5 +1,5 @@
1
- import { markRaw, reactive } from 'vue'
2
1
  import type { StoryFile, Variant } from '../types'
2
+ import { markRaw, reactive } from 'vue'
3
3
 
4
4
  const copiedFromExistingVariant = [
5
5
  'state',
@@ -1,5 +1,5 @@
1
- import { reactive } from 'vue'
2
1
  import type { PreviewSettings } from '../types'
2
+ import { reactive } from 'vue'
3
3
  import { histoireConfig } from './config'
4
4
 
5
5
  export const receivedSettings = reactive<PreviewSettings>({} as PreviewSettings)
@@ -1,5 +1,5 @@
1
- import { base } from '../router'
2
1
  import type { Story, Variant } from '../types'
2
+ import { base } from '../router'
3
3
 
4
4
  export function getSandboxUrl(story: Story, variant: Variant) {
5
5
  const url = new URLSearchParams()
@@ -1,6 +1,6 @@
1
1
  import type { Ref } from 'vue'
2
- import { onMounted, watch } from 'vue'
3
2
  import scrollIntoView from 'scroll-into-view-if-needed'
3
+ import { onMounted, watch } from 'vue'
4
4
 
5
5
  export function useScrollOnActive(active: Ref<boolean>, el: Ref<HTMLElement>) {
6
6
  watch(active, (value) => {
@@ -1,7 +1,7 @@
1
1
  import type { Ref } from 'vue'
2
+ import type { Variant } from '../types'
2
3
  import { computed } from 'vue'
3
4
  import { useRoute } from 'vue-router'
4
- import type { Variant } from '../types'
5
5
 
6
6
  export function useCurrentVariantRoute(variant: Ref<Variant>) {
7
7
  const route = useRoute()
@@ -1,4 +1,4 @@
1
- import './app/style/main.pcss'
2
1
  import { mountMainApp } from './app/index'
2
+ import './app/style/main.pcss'
3
3
 
4
4
  mountMainApp()
@@ -1,5 +1,5 @@
1
- import './style.css'
2
- import './bundled/style.css'
3
1
  import { mountMainApp } from './bundled/index.js'
2
+ import './style.css'
3
+ import './bundled/app.css'
4
4
 
5
5
  mountMainApp()
@@ -1,5 +1,5 @@
1
- const defaultColors = require('tailwindcss/colors')
2
1
  const path = require('pathe')
2
+ const defaultColors = require('tailwindcss/colors')
3
3
  const inheritedConfig = require('../../tailwind.config.cjs')
4
4
 
5
5
  // Colors
package/vite.config.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { defineConfig } from 'vite'
2
1
  import vue from '@vitejs/plugin-vue'
3
2
  import fs from 'fs-extra'
4
3
  import { globbySync } from 'globby'
4
+ import { defineConfig } from 'vite'
5
5
 
6
6
  export default defineConfig({
7
7
  plugins: [
@@ -56,7 +56,7 @@ export default defineConfig({
56
56
  external: [
57
57
  /\$histoire/,
58
58
  /@histoire/,
59
- // eslint-disable-next-line ts/no-var-requires, ts/no-require-imports
59
+ // eslint-disable-next-line ts/no-require-imports
60
60
  ...Object.keys(require('./package.json').dependencies),
61
61
  ],
62
62
 
@@ -1,52 +0,0 @@
1
- function parse_option(a, b) {
2
- return "undefined" == typeof a ? b : a;
3
- }
4
- function create_object_array(a) {
5
- const b = Array(a);
6
- for (let c = 0; c < a; c++)
7
- b[c] = create_object();
8
- return b;
9
- }
10
- function create_arrays(a) {
11
- const b = Array(a);
12
- for (let c = 0; c < a; c++)
13
- b[c] = [];
14
- return b;
15
- }
16
- function get_keys(a) {
17
- return Object.keys(a);
18
- }
19
- function create_object() {
20
- return /* @__PURE__ */ Object.create(null);
21
- }
22
- function concat(a) {
23
- return [].concat.apply([], a);
24
- }
25
- function sort_by_length_down(c, a) {
26
- return a.length - c.length;
27
- }
28
- function is_array(a) {
29
- return a.constructor === Array;
30
- }
31
- function is_string(a) {
32
- return "string" == typeof a;
33
- }
34
- function is_object(a) {
35
- return "object" == typeof a;
36
- }
37
- function is_function(a) {
38
- return "function" == typeof a;
39
- }
40
- export {
41
- concat,
42
- create_arrays,
43
- create_object,
44
- create_object_array,
45
- get_keys,
46
- is_array,
47
- is_function,
48
- is_object,
49
- is_string,
50
- parse_option,
51
- sort_by_length_down
52
- };
@@ -1,10 +0,0 @@
1
- const filter = ["a", "about", "above", "after", "again", "against", "all", "also", "am", "an", "and", "any", "are", "aren't", "as", "at", "be", "because", "been", "before", "being", "below", "both", "but", "by", "can", "cannot", "can't", "come", "could", "couldn't", "did", "didn't", "do", "does", "doesn't", "doing", "dont", "down", "during", "each", "even", "few", "first", "for", "from", "further", "get", "go", "had", "hadn't", "has", "hasn't", "have", "haven't", "having", "he", "hed", "her", "here", "here's", "hers", "herself", "hes", "him", "himself", "his", "how", "how's", "i", "id", "if", "ill", "im", "in", "into", "is", "isn't", "it", "it's", "itself", "i've", "just", "know", "let's", "like", "make", "me", "more", "most", "mustn't", "my", "myself", "new", "no", "nor", "not", "now", "of", "off", "on", "once", "only", "or", "other", "ought", "our", "our's", "ourselves", "out", "over", "own", "same", "say", "see", "shan't", "she", "she'd", "shell", "shes", "should", "shouldn't", "so", "some", "such", "than", "that", "that's", "the", "their", "theirs", "them", "themselves", "then", "there", "there's", "these", "they", "they'd", "they'll", "they're", "they've", "this", "those", "through", "time", "to", "too", "until", "up", "us", "very", "want", "was", "wasn't", "way", "we", "wed", "well", "were", "weren't", "we've", "what", "what's", "when", "when's", "where", "where's", "which", "while", "who", "whom", "who's", "why", "why's", "will", "with", "won't", "would", "wouldn't", "you", "you'd", "you'll", "your", "you're", "your's", "yourself", "yourselves", "you've"];
2
- const stemmer = { ational: "ate", iveness: "ive", fulness: "ful", ousness: "ous", ization: "ize", tional: "tion", biliti: "ble", icate: "ic", ative: "", alize: "al", iciti: "ic", entli: "ent", ousli: "ous", alism: "al", ation: "ate", aliti: "al", iviti: "ive", ement: "", enci: "ence", anci: "ance", izer: "ize", alli: "al", ator: "ate", logi: "log", ical: "ic", ance: "", ence: "", ness: "", able: "", ible: "", ment: "", eli: "e", bli: "ble", ful: "", ant: "", ent: "", ism: "", ate: "", iti: "", ous: "", ive: "", ize: "", al: "", ou: "", er: "", ic: "" };
3
- const matcher = {};
4
- const language = { filter, stemmer, matcher };
5
- export {
6
- language as default,
7
- filter,
8
- matcher,
9
- stemmer
10
- };