@poveste/app 0.13.0 → 0.14.0

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 (110) hide show
  1. package/dist/bundled/App.vue_vue_type_script_setup_true_lang.js +26 -34
  2. package/dist/bundled/app.css +18 -24
  3. package/dist/bundled/components/HomeView.vue_vue_type_script_setup_true_lang.js +1 -1
  4. package/dist/bundled/components/app/AppLogo.vue_vue_type_script_setup_true_lang.js +2 -2
  5. package/dist/bundled/components/app/Breadcrumb.js +1 -1
  6. package/dist/bundled/components/app/Breadcrumb.vue_vue_type_script_setup_true_lang.js +2 -2
  7. package/dist/bundled/components/app/TopBar.vue_vue_type_script_setup_true_lang.js +4 -3
  8. package/dist/bundled/components/base/BaseCheckbox.vue_vue_type_script_setup_true_lang.js +1 -1
  9. package/dist/bundled/components/base/BaseListItemLink.js +6 -3
  10. package/dist/bundled/components/base/BaseListItemLink.vue_vue_type_script_lang.js +10 -4
  11. package/dist/bundled/components/base/BaseOverflowMenu.vue_vue_type_script_setup_true_lang.js +5 -2
  12. package/dist/bundled/components/base/BaseOverflowTab.js +6 -3
  13. package/dist/bundled/components/base/BaseOverflowTab.vue_vue_type_script_lang.js +4 -0
  14. package/dist/bundled/components/base/BaseSplitPane.js +1 -1
  15. package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_script_setup_true_lang.js +6 -4
  16. package/dist/bundled/components/base/BaseTab.js +6 -3
  17. package/dist/bundled/components/base/BaseTab.vue_vue_type_script_lang.js +4 -0
  18. package/dist/bundled/components/command/CommandPrompts.vue_vue_type_script_setup_true_lang.js +1 -1
  19. package/dist/bundled/components/command/CommandPromptsModal.vue_vue_type_script_setup_true_lang.js +4 -3
  20. package/dist/bundled/components/command/PromptSelect.vue_vue_type_script_setup_true_lang.js +1 -1
  21. package/dist/bundled/components/command/PromptText.vue_vue_type_script_setup_true_lang.js +1 -1
  22. package/dist/bundled/components/panel/PaneTabs.vue_vue_type_script_setup_true_lang.js +4 -4
  23. package/dist/bundled/components/panel/StatePresets.vue_vue_type_script_setup_true_lang.js +30 -20
  24. package/dist/bundled/components/panel/StoryControls.vue_vue_type_script_setup_true_lang.js +1 -1
  25. package/dist/bundled/components/panel/StoryDocs.vue_vue_type_script_setup_true_lang.js +3 -1
  26. package/dist/bundled/components/panel/StoryEvent.vue_vue_type_script_setup_true_lang.js +5 -1
  27. package/dist/bundled/components/panel/StoryEvents.vue_vue_type_script_setup_true_lang.js +2 -1
  28. package/dist/bundled/components/panel/StorySidePanel.vue_vue_type_script_setup_true_lang.js +7 -5
  29. package/dist/bundled/components/panel/StorySourceCode.js +1 -1
  30. package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_script_setup_true_lang.js +6 -5
  31. package/dist/bundled/components/search/SearchPane.vue_vue_type_script_setup_true_lang.js +15 -7
  32. package/dist/bundled/components/story/GenericMountStory.vue_vue_type_script_setup_true_lang.js +2 -1
  33. package/dist/bundled/components/story/GenericRenderStory.vue_vue_type_script_setup_true_lang.js +2 -1
  34. package/dist/bundled/components/story/StoryResponsivePreview.js +1 -1
  35. package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_script_setup_true_lang.js +17 -6
  36. package/dist/bundled/components/story/StoryVariantGrid.js +1 -1
  37. package/dist/bundled/components/story/StoryVariantGrid.vue_vue_type_script_setup_true_lang.js +15 -10
  38. package/dist/bundled/components/story/StoryVariantSingle.js +1 -1
  39. package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_script_setup_true_lang.js +21 -33
  40. package/dist/bundled/components/story/StoryVariantSingleView.vue_vue_type_script_setup_true_lang.js +1 -1
  41. package/dist/bundled/components/story/StoryView.vue_vue_type_script_setup_true_lang.js +3 -2
  42. package/dist/bundled/components/story/StoryViewer.js +1 -1
  43. package/dist/bundled/components/story/StoryViewer.vue_vue_type_script_setup_true_lang.js +3 -3
  44. package/dist/bundled/components/toolbar/ToolbarBackground.js +1 -3
  45. package/dist/bundled/components/toolbar/ToolbarBackground.vue_vue_type_script_setup_true_lang.js +2 -6
  46. package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue_vue_type_script_setup_true_lang.js +17 -16
  47. package/dist/bundled/plugin.js +4 -3
  48. package/dist/bundled/sandbox.js +2 -2
  49. package/dist/bundled/stores/folder.js +1 -1
  50. package/dist/bundled/util/commands.js +20 -9
  51. package/dist/bundled/util/docs.js +2 -1
  52. package/dist/bundled/util/grid-slots.js +1 -1
  53. package/dist/bundled/util/highlighter.js +1 -1
  54. package/dist/bundled/util/icons.generated.js +0 -1
  55. package/dist/bundled/util/keyboard.js +1 -0
  56. package/dist/bundled/util/mapping.js +6 -2
  57. package/dist/bundled/util/preview-settings.js +1 -1
  58. package/dist/style.css +14 -2
  59. package/package.json +8 -6
  60. package/src/app/App.vue +36 -29
  61. package/src/app/components/HomeView.vue +1 -1
  62. package/src/app/components/app/AppLogo.vue +6 -2
  63. package/src/app/components/app/Breadcrumb.vue +2 -1
  64. package/src/app/components/app/TopBar.vue +7 -2
  65. package/src/app/components/base/BaseCheckbox.vue +1 -1
  66. package/src/app/components/base/BaseListItemLink.vue +12 -1
  67. package/src/app/components/base/BaseOverflowMenu.vue +9 -3
  68. package/src/app/components/base/BaseOverflowTab.vue +12 -1
  69. package/src/app/components/base/BaseSplitPane.vue +9 -4
  70. package/src/app/components/base/BaseTab.vue +12 -1
  71. package/src/app/components/command/CommandPrompts.vue +10 -2
  72. package/src/app/components/command/CommandPromptsModal.vue +1 -0
  73. package/src/app/components/command/PromptSelect.vue +2 -1
  74. package/src/app/components/command/PromptText.vue +7 -3
  75. package/src/app/components/panel/PaneTabs.vue +4 -4
  76. package/src/app/components/panel/StatePresets.vue +26 -5
  77. package/src/app/components/panel/StoryControls.vue +1 -1
  78. package/src/app/components/panel/StoryDocs.vue +3 -1
  79. package/src/app/components/panel/StoryEvent.vue +7 -2
  80. package/src/app/components/panel/StoryEvents.vue +4 -1
  81. package/src/app/components/panel/StorySidePanel.vue +2 -0
  82. package/src/app/components/panel/StorySourceCode.vue +11 -8
  83. package/src/app/components/search/SearchPane.vue +14 -5
  84. package/src/app/components/story/GenericMountStory.vue +2 -1
  85. package/src/app/components/story/GenericRenderStory.vue +2 -1
  86. package/src/app/components/story/StoryResponsivePreview.vue +30 -5
  87. package/src/app/components/story/StoryVariantGrid.vue +33 -16
  88. package/src/app/components/story/StoryVariantSingle.vue +44 -52
  89. package/src/app/components/story/StoryVariantSingleView.vue +1 -1
  90. package/src/app/components/story/StoryView.vue +7 -3
  91. package/src/app/components/story/StoryViewer.vue +3 -3
  92. package/src/app/components/toolbar/ToolbarBackground.vue +1 -8
  93. package/src/app/components/toolbar/ToolbarResponsiveSize.vue +23 -3
  94. package/src/app/components/tree/StoryGroup.vue +1 -1
  95. package/src/app/plugin.ts +7 -3
  96. package/src/app/sandbox.ts +1 -1
  97. package/src/app/stores/folder.ts +1 -1
  98. package/src/app/types.ts +2 -2
  99. package/src/app/util/commands.ts +26 -16
  100. package/src/app/util/docs.ts +2 -1
  101. package/src/app/util/grid-slots.ts +1 -1
  102. package/src/app/util/highlighter.ts +9 -1
  103. package/src/app/util/icons.generated.ts +1 -1
  104. package/src/app/util/keyboard.ts +3 -0
  105. package/src/app/util/mapping.ts +6 -2
  106. package/src/app/util/preview-settings.ts +1 -1
  107. package/src/app/util/scroll.ts +5 -1
  108. package/src/app/util/state.ts +1 -1
  109. package/src/app/util/variant.ts +4 -1
  110. package/src/app/components/base/BaseCopyIcon.vue +0 -34
@@ -37,5 +37,5 @@ export function applyPreviewSettings(settings: PreviewSettings) {
37
37
  }
38
38
 
39
39
  export function getContrastColor(setting: PreviewSettings) {
40
- return povesteConfig.backgroundPresets.find(preset => preset.color === setting.backgroundColor)?.contrastColor ?? 'unset'
40
+ return povesteConfig.backgroundPresets?.find(preset => preset.color === setting.backgroundColor)?.contrastColor ?? 'unset'
41
41
  }
@@ -2,7 +2,11 @@ import type { Ref } from 'vue'
2
2
  import scrollIntoView from 'scroll-into-view-if-needed'
3
3
  import { onMounted, watch } from 'vue'
4
4
 
5
- export function useScrollOnActive(active: Ref<boolean>, el: Ref<HTMLElement>) {
5
+ // `el` is a template ref, so it is undefined until the component mounts and
6
+ // again once it unmounts. `autoScroll` has always guarded for that; the
7
+ // signature was the only thing claiming otherwise, and it made four callers
8
+ // pass a `Ref<HTMLDivElement | undefined>` into a parameter that denied it.
9
+ export function useScrollOnActive(active: Ref<boolean>, el: Ref<HTMLElement | undefined>) {
6
10
  watch(active, (value) => {
7
11
  if (value) {
8
12
  autoScroll()
@@ -19,7 +19,7 @@ export function toRawDeep(val, clean = false, seen = new WeakMap()) {
19
19
  }
20
20
 
21
21
  if (Array.isArray(unwrappedValue)) {
22
- const result = []
22
+ const result: unknown[] = []
23
23
  seen.set(unwrappedValue, result)
24
24
  let list = unwrappedValue.map(value => toRawDeep(value, clean, seen))
25
25
  if (clean) {
@@ -11,7 +11,10 @@ import { useRoute } from 'vue-router'
11
11
  * reader to pick one" needs the same answer it will give — hence one predicate
12
12
  * rather than two copies of the condition (#328).
13
13
  */
14
- export function autoSelectsVariant(story: Story | null | undefined): boolean {
14
+ // A type predicate rather than `boolean`: the body already establishes that the
15
+ // story is there, and returning `boolean` threw that away at every call site —
16
+ // `StoryView` reads the story twice immediately after this returns true.
17
+ export function autoSelectsVariant(story: Story | null | undefined): story is Story {
15
18
  return !!story && (!!story.lastSelectedVariant || story.variants.length === 1)
16
19
  }
17
20
 
@@ -1,34 +0,0 @@
1
- <script lang="ts">
2
- export default {
3
- name: 'HstCopyIcon',
4
- }
5
- </script>
6
-
7
- <script lang="ts" setup>
8
- import { Icon } from '@iconify/vue'
9
- import { useClipboard } from '@vueuse/core'
10
- import { VTooltip as vTooltip } from 'floating-vue'
11
-
12
- const props = defineProps<{
13
- content: string
14
- }>()
15
-
16
- const { copy, copied } = useClipboard()
17
-
18
- const action = () => copy(props.content)
19
- </script>
20
-
21
- <template>
22
- <Icon
23
- v-tooltip="{
24
- content: 'Copied!',
25
- triggers: [],
26
- shown: copied,
27
- distance: 12,
28
- delay: 0,
29
- }"
30
- icon="carbon:copy-file"
31
- class="poveste-base-copy-icon w-4 h-4 opacity-50 hover:opacity-100 hover:text-primary-500 cursor-pointer"
32
- @click="action()"
33
- />
34
- </template>