@poveste/app 0.12.2 → 0.13.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 (50) hide show
  1. package/dist/app/style/font.css +11 -7
  2. package/dist/app/style/fonts/LICENSE +93 -0
  3. package/dist/app/style/fonts/noto-sans-display-cyrillic-400-normal.woff2 +0 -0
  4. package/dist/app/style/fonts/noto-sans-display-cyrillic-ext-400-normal.woff2 +0 -0
  5. package/dist/app/style/fonts/noto-sans-display-greek-400-normal.woff2 +0 -0
  6. package/dist/app/style/fonts/noto-sans-display-greek-ext-400-normal.woff2 +0 -0
  7. package/dist/app/style/fonts/noto-sans-display-latin-400-normal.woff2 +0 -0
  8. package/dist/app/style/fonts/noto-sans-display-latin-ext-400-normal.woff2 +0 -0
  9. package/dist/app/style/fonts/noto-sans-display-vietnamese-400-normal.woff2 +0 -0
  10. package/dist/bundled/App.vue_vue_type_script_setup_true_lang.js +19 -19
  11. package/dist/bundled/app.css +10 -10
  12. package/dist/bundled/components/base/BaseSplitPane.js +1 -1
  13. package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_script_setup_true_lang.js +67 -29
  14. package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_script_setup_true_lang.js +1 -1
  15. package/dist/bundled/components/story/StoryVariantSingle.js +1 -1
  16. package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_script_setup_true_lang.js +20 -23
  17. package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue_vue_type_script_setup_true_lang.js +5 -2
  18. package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue_vue_type_script_setup_true_lang.js +4 -0
  19. package/dist/bundled/components/story/StoryVariantSingleView.vue_vue_type_script_setup_true_lang.js +23 -13
  20. package/dist/bundled/components/story/StoryView.vue_vue_type_script_setup_true_lang.js +8 -11
  21. package/dist/bundled/sandbox.js +6 -1
  22. package/dist/bundled/util/events.js +4 -1
  23. package/dist/bundled/util/highlighter.js +11 -4
  24. package/dist/bundled/util/occupant.js +16 -0
  25. package/dist/bundled/util/variant.js +12 -1
  26. package/dist/style.css +4 -4
  27. package/package.json +5 -5
  28. package/src/__tests__/font.spec.ts +48 -2
  29. package/src/app/App.vue +56 -46
  30. package/src/app/components/base/BaseSplitPane.vue +95 -29
  31. package/src/app/components/story/StoryVariantSingle.vue +72 -66
  32. package/src/app/components/story/StoryVariantSinglePreviewNative.vue +13 -2
  33. package/src/app/components/story/StoryVariantSinglePreviewRemote.vue +8 -0
  34. package/src/app/components/story/StoryVariantSingleView.vue +59 -13
  35. package/src/app/components/story/StoryView.vue +17 -17
  36. package/src/app/sandbox.ts +9 -1
  37. package/src/app/style/font.css +11 -7
  38. package/src/app/style/fonts/LICENSE +93 -0
  39. package/src/app/style/fonts/noto-sans-display-cyrillic-400-normal.woff2 +0 -0
  40. package/src/app/style/fonts/noto-sans-display-cyrillic-ext-400-normal.woff2 +0 -0
  41. package/src/app/style/fonts/noto-sans-display-greek-400-normal.woff2 +0 -0
  42. package/src/app/style/fonts/noto-sans-display-greek-ext-400-normal.woff2 +0 -0
  43. package/src/app/style/fonts/noto-sans-display-latin-400-normal.woff2 +0 -0
  44. package/src/app/style/fonts/noto-sans-display-latin-ext-400-normal.woff2 +0 -0
  45. package/src/app/style/fonts/noto-sans-display-vietnamese-400-normal.woff2 +0 -0
  46. package/src/app/util/events.ts +3 -0
  47. package/src/app/util/highlighter.ts +16 -9
  48. package/src/app/util/occupant.ts +13 -0
  49. package/src/app/util/variant.ts +13 -1
  50. package/LICENSE +0 -22
@@ -0,0 +1,13 @@
1
+ /**
2
+ * What the sandbox realm is currently showing.
3
+ *
4
+ * The realm is reused: a `SANDBOX_RETARGET` hands it another story rather than
5
+ * booting a new document, so a message can outlive the occupant that queued it.
6
+ * Every message `sandbox.ts` posts already carries these ids for that reason;
7
+ * this module exists so `logEvent` — which posts from wherever a story calls it,
8
+ * not from `sandbox.ts` — can carry them too (#328).
9
+ */
10
+ export const occupant: { storyId: string | null, variantId: string | null } = {
11
+ storyId: null,
12
+ variantId: null,
13
+ }
@@ -1,8 +1,20 @@
1
1
  import type { Ref } from 'vue'
2
- import type { Variant } from '../types'
2
+ import type { Story, Variant } from '../types'
3
3
  import { computed } from 'vue'
4
4
  import { useRoute } from 'vue-router'
5
5
 
6
+ /**
7
+ * Whether opening this story will put a variant in the route by itself.
8
+ *
9
+ * `StoryView` resolves the variant one tick after the story, so anything that
10
+ * has to tell "a variant is on its way" from "this story is waiting for the
11
+ * reader to pick one" needs the same answer it will give — hence one predicate
12
+ * rather than two copies of the condition (#328).
13
+ */
14
+ export function autoSelectsVariant(story: Story | null | undefined): boolean {
15
+ return !!story && (!!story.lastSelectedVariant || story.variants.length === 1)
16
+ }
17
+
6
18
  export function useCurrentVariantRoute(variant: Ref<Variant>) {
7
19
  const route = useRoute()
8
20
  const isActive = computed(() => route.query.variantId === variant.value.id)
package/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Guillaume Chau (original "histoire" project)
4
- Copyright (c) 2026 Sorin Gitlan (poveste fork)
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy
7
- of this software and associated documentation files (the "Software"), to deal
8
- in the Software without restriction, including without limitation the rights
9
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the Software is
11
- furnished to do so, subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in all
14
- copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- SOFTWARE.