histoire 0.2.2 → 0.2.5

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 (112) hide show
  1. package/dist/client/app/App.vue +2 -2
  2. package/dist/client/app/codegen/vue3.js +11 -2
  3. package/dist/client/app/codegen/vue3.ts +9 -1
  4. package/dist/client/app/components/app/AppHeader.vue +2 -2
  5. package/dist/client/app/components/app/Breadcrumb.vue +1 -1
  6. package/dist/client/app/components/base/BaseListItemLink.vue +1 -1
  7. package/dist/client/app/components/base/BaseTab.vue +1 -1
  8. package/dist/client/app/components/exposed/Story.vue +5 -0
  9. package/dist/client/app/components/exposed/Variant.vue +7 -0
  10. package/dist/client/app/components/search/SearchItem.vue +1 -0
  11. package/dist/client/app/components/search/SearchModal.vue +7 -6
  12. package/dist/client/app/components/story/StoryResponsivePreview.vue +72 -77
  13. package/dist/client/app/components/story/StorySidePanel.vue +1 -1
  14. package/dist/client/app/components/story/StorySourceCode.vue +3 -17
  15. package/dist/client/app/components/story/StoryVariantGridItem.vue +3 -3
  16. package/dist/client/app/components/story/StoryVariantSingleView.vue +10 -11
  17. package/dist/client/app/components/story/StoryViewer.vue +2 -0
  18. package/dist/client/app/components/story/{variant → toolbar}/StoryVariantBackground.vue +4 -4
  19. package/dist/client/app/components/story/{variant → toolbar}/StoryVariantNewTab.vue +2 -2
  20. package/dist/client/app/components/story/{variant → toolbar}/StoryVariantResponsiveSize.vue +5 -5
  21. package/dist/client/app/components/story/{variant → toolbar}/StoryVariantTitle.vue +0 -0
  22. package/dist/client/app/components/tree/StoryGroup.vue +75 -0
  23. package/dist/client/app/components/{story → tree}/StoryList.vue +8 -2
  24. package/{src/client/app/components/story → dist/client/app/components/tree}/StoryListFolder.vue +6 -4
  25. package/{src/client/app/components/story → dist/client/app/components/tree}/StoryListItem.vue +3 -3
  26. package/dist/client/app/global-components.js +0 -1
  27. package/dist/client/app/index.js +0 -1
  28. package/dist/client/app/sandbox.js +0 -1
  29. package/dist/client/app/stores/preview-settings.d.ts +8 -0
  30. package/dist/client/app/stores/preview-settings.js +14 -0
  31. package/dist/client/app/stores/preview-settings.ts +17 -0
  32. package/dist/client/app/stores/story.d.ts +57 -21
  33. package/dist/client/app/stores/story.js +13 -9
  34. package/dist/client/app/stores/story.ts +13 -9
  35. package/dist/client/app/style/floating-vue.pcss +3 -1
  36. package/dist/client/app/types.d.ts +18 -2
  37. package/dist/client/app/types.ts +20 -2
  38. package/dist/client/app/util/keyboard.js +0 -1
  39. package/dist/client/app/util/mapping.js +10 -10
  40. package/dist/client/app/util/mapping.ts +10 -5
  41. package/dist/client/app/util/preview-settings.d.ts +1 -8
  42. package/dist/client/app/util/preview-settings.js +0 -11
  43. package/dist/client/app/util/preview-settings.ts +1 -19
  44. package/dist/client/app/util/reactivity.js +0 -1
  45. package/dist/client/app/util/scroll.js +0 -1
  46. package/dist/client/app/util/variant.js +0 -1
  47. package/dist/client/index.js +0 -1
  48. package/dist/client/server/Story.server.vue +8 -2
  49. package/dist/client/server/index.js +0 -1
  50. package/dist/controls.js +0 -1
  51. package/dist/node/collect/index.js +2 -2
  52. package/dist/node/config.d.ts +8 -2
  53. package/dist/node/plugin.js +15 -7
  54. package/dist/node/stories.js +6 -1
  55. package/dist/node/tree.d.ts +16 -12
  56. package/dist/node/tree.js +45 -5
  57. package/dist/node/types.d.ts +10 -0
  58. package/dist/style.css +164 -31
  59. package/package.json +19 -19
  60. package/src/client/app/App.vue +2 -2
  61. package/src/client/app/codegen/vue3.ts +9 -1
  62. package/src/client/app/components/app/AppHeader.vue +2 -2
  63. package/src/client/app/components/app/Breadcrumb.vue +1 -1
  64. package/src/client/app/components/base/BaseListItemLink.vue +1 -1
  65. package/src/client/app/components/base/BaseTab.vue +1 -1
  66. package/src/client/app/components/exposed/Story.vue +5 -0
  67. package/src/client/app/components/exposed/Variant.vue +7 -0
  68. package/src/client/app/components/search/SearchItem.vue +1 -0
  69. package/src/client/app/components/search/SearchModal.vue +7 -6
  70. package/src/client/app/components/story/StoryResponsivePreview.vue +72 -77
  71. package/src/client/app/components/story/StorySidePanel.vue +1 -1
  72. package/src/client/app/components/story/StorySourceCode.vue +3 -17
  73. package/src/client/app/components/story/StoryVariantGridItem.vue +3 -3
  74. package/src/client/app/components/story/StoryVariantSingleView.vue +10 -11
  75. package/src/client/app/components/story/StoryViewer.vue +2 -0
  76. package/src/client/app/components/story/{variant → toolbar}/StoryVariantBackground.vue +4 -4
  77. package/src/client/app/components/story/{variant → toolbar}/StoryVariantNewTab.vue +2 -2
  78. package/src/client/app/components/story/{variant → toolbar}/StoryVariantResponsiveSize.vue +5 -5
  79. package/src/client/app/components/story/{variant → toolbar}/StoryVariantTitle.vue +0 -0
  80. package/src/client/app/components/tree/StoryGroup.vue +75 -0
  81. package/src/client/app/components/{story → tree}/StoryList.vue +8 -2
  82. package/{dist/client/app/components/story → src/client/app/components/tree}/StoryListFolder.vue +6 -4
  83. package/{dist/client/app/components/story → src/client/app/components/tree}/StoryListItem.vue +3 -3
  84. package/src/client/app/stores/preview-settings.ts +17 -0
  85. package/src/client/app/stores/story.ts +13 -9
  86. package/src/client/app/style/floating-vue.pcss +3 -1
  87. package/src/client/app/types.ts +20 -2
  88. package/src/client/app/util/mapping.ts +10 -5
  89. package/src/client/app/util/preview-settings.ts +1 -19
  90. package/src/client/server/Story.server.vue +8 -2
  91. package/src/node/collect/index.ts +3 -3
  92. package/src/node/config.ts +9 -2
  93. package/src/node/plugin.ts +16 -7
  94. package/src/node/stories.ts +6 -1
  95. package/src/node/tree.spec.ts +35 -17
  96. package/src/node/tree.ts +64 -10
  97. package/src/node/types.ts +11 -0
  98. package/tsconfig.json +2 -0
  99. package/dist/client/app/codegen/vue3.js.map +0 -1
  100. package/dist/client/app/global-components.js.map +0 -1
  101. package/dist/client/app/index.js.map +0 -1
  102. package/dist/client/app/sandbox.js.map +0 -1
  103. package/dist/client/app/stores/story.js.map +0 -1
  104. package/dist/client/app/util/keyboard.js.map +0 -1
  105. package/dist/client/app/util/mapping.js.map +0 -1
  106. package/dist/client/app/util/preview-settings.js.map +0 -1
  107. package/dist/client/app/util/reactivity.js.map +0 -1
  108. package/dist/client/app/util/scroll.js.map +0 -1
  109. package/dist/client/app/util/variant.js.map +0 -1
  110. package/dist/client/index.js.map +0 -1
  111. package/dist/client/server/index.js.map +0 -1
  112. package/dist/controls.js.map +0 -1
package/dist/style.css CHANGED
@@ -238,6 +238,10 @@
238
238
  transition: transform .15s cubic-bezier(0, 1, .5, 1);
239
239
  }
240
240
 
241
+ .v-popper__popper:focus-visible {
242
+ outline: none;
243
+ }
244
+
241
245
  .__histoire-scale-x-enter-active,
242
246
  .__histoire-scale-x-leave-active {
243
247
  transition: transform .15s, opacity .15s;
@@ -868,10 +872,6 @@ button {
868
872
  z-index:20
869
873
  }
870
874
 
871
- .htw-m-1{
872
- margin:0.25rem
873
- }
874
-
875
875
  .htw-m-0{
876
876
  margin:0px
877
877
  }
@@ -880,6 +880,40 @@ button {
880
880
  margin:1rem
881
881
  }
882
882
 
883
+ .htw-m-1{
884
+ margin:0.25rem
885
+ }
886
+
887
+ .htw-my-2{
888
+ margin-top:0.5rem;
889
+ margin-bottom:0.5rem
890
+ }
891
+
892
+ .htw-mx-1{
893
+ margin-left:0.25rem;
894
+ margin-right:0.25rem
895
+ }
896
+
897
+ .htw-mx-2{
898
+ margin-left:0.5rem;
899
+ margin-right:0.5rem
900
+ }
901
+
902
+ .htw-my-0{
903
+ margin-top:0px;
904
+ margin-bottom:0px
905
+ }
906
+
907
+ .htw-my-8{
908
+ margin-top:2rem;
909
+ margin-bottom:2rem
910
+ }
911
+
912
+ .htw-mx-4{
913
+ margin-left:1rem;
914
+ margin-right:1rem
915
+ }
916
+
883
917
  .-htw-my-1{
884
918
  margin-top:-0.25rem;
885
919
  margin-bottom:-0.25rem
@@ -909,6 +943,10 @@ button {
909
943
  margin-right:auto
910
944
  }
911
945
 
946
+ .htw-mb-2{
947
+ margin-bottom:0.5rem
948
+ }
949
+
912
950
  .htw-box-border{
913
951
  box-sizing:border-box
914
952
  }
@@ -977,6 +1015,12 @@ button {
977
1015
  height:1rem
978
1016
  }
979
1017
 
1018
+ .htw-h-fit{
1019
+ height:-webkit-fit-content;
1020
+ height:-moz-fit-content;
1021
+ height:fit-content
1022
+ }
1023
+
980
1024
  .htw-h-2{
981
1025
  height:0.5rem
982
1026
  }
@@ -989,6 +1033,22 @@ button {
989
1033
  height:2.5rem
990
1034
  }
991
1035
 
1036
+ .htw-h-\[1px\]{
1037
+ height:1px
1038
+ }
1039
+
1040
+ .htw-h-\[100px\]{
1041
+ height:100px
1042
+ }
1043
+
1044
+ .htw-h-32{
1045
+ height:8rem
1046
+ }
1047
+
1048
+ .htw-h-20{
1049
+ height:5rem
1050
+ }
1051
+
992
1052
  .htw-max-h-full{
993
1053
  max-height:100%
994
1054
  }
@@ -1033,6 +1093,12 @@ button {
1033
1093
  width:1rem
1034
1094
  }
1035
1095
 
1096
+ .htw-w-fit{
1097
+ width:-webkit-fit-content;
1098
+ width:-moz-fit-content;
1099
+ width:fit-content
1100
+ }
1101
+
1036
1102
  .htw-w-px{
1037
1103
  width:1px
1038
1104
  }
@@ -1055,14 +1121,22 @@ button {
1055
1121
  width:7rem
1056
1122
  }
1057
1123
 
1058
- .htw-min-w-0{
1059
- min-width:0px
1124
+ .htw-w-16{
1125
+ width:4rem
1126
+ }
1127
+
1128
+ .htw-w-32{
1129
+ width:8rem
1060
1130
  }
1061
1131
 
1062
1132
  .htw-min-w-16{
1063
1133
  min-width:4rem
1064
1134
  }
1065
1135
 
1136
+ .htw-min-w-0{
1137
+ min-width:0px
1138
+ }
1139
+
1066
1140
  .htw-max-w-full{
1067
1141
  max-width:100%
1068
1142
  }
@@ -1087,6 +1161,10 @@ button {
1087
1161
  flex-shrink:0
1088
1162
  }
1089
1163
 
1164
+ .htw-shrink{
1165
+ flex-shrink:1
1166
+ }
1167
+
1090
1168
  .htw-grow{
1091
1169
  flex-grow:1
1092
1170
  }
@@ -1135,6 +1213,10 @@ button {
1135
1213
  resize:vertical
1136
1214
  }
1137
1215
 
1216
+ .htw-grid-cols-\[repeat\(auto-fill\,minmax\(200px\,1fr\)\)\]{
1217
+ grid-template-columns:repeat(auto-fill,minmax(200px,1fr))
1218
+ }
1219
+
1138
1220
  .htw-flex-col{
1139
1221
  flex-direction:column
1140
1222
  }
@@ -1147,6 +1229,10 @@ button {
1147
1229
  place-content:space-between
1148
1230
  }
1149
1231
 
1232
+ .htw-items-end{
1233
+ align-items:flex-end
1234
+ }
1235
+
1150
1236
  .htw-items-center{
1151
1237
  align-items:center
1152
1238
  }
@@ -1159,14 +1245,14 @@ button {
1159
1245
  justify-content:center
1160
1246
  }
1161
1247
 
1162
- .htw-gap-2{
1163
- gap:0.5rem
1164
- }
1165
-
1166
1248
  .htw-gap-1{
1167
1249
  gap:0.25rem
1168
1250
  }
1169
1251
 
1252
+ .htw-gap-2{
1253
+ gap:0.5rem
1254
+ }
1255
+
1170
1256
  .htw-gap-4{
1171
1257
  gap:1rem
1172
1258
  }
@@ -1269,6 +1355,10 @@ button {
1269
1355
  border-width:8px
1270
1356
  }
1271
1357
 
1358
+ .htw-border-2{
1359
+ border-width:2px
1360
+ }
1361
+
1272
1362
  .htw-border-b-2{
1273
1363
  border-bottom-width:2px
1274
1364
  }
@@ -1385,6 +1475,14 @@ button {
1385
1475
  background-color:rgb(var(--_histoire-color-gray-50) / var(--tw-bg-opacity))
1386
1476
  }
1387
1477
 
1478
+ .htw-bg-gray-500\/10{
1479
+ background-color:rgb(var(--_histoire-color-gray-500) / 0.1)
1480
+ }
1481
+
1482
+ .htw-bg-gray-500\/50{
1483
+ background-color:rgb(var(--_histoire-color-gray-500) / 0.5)
1484
+ }
1485
+
1388
1486
  .htw-stroke-white{
1389
1487
  stroke:#fff
1390
1488
  }
@@ -1439,21 +1537,6 @@ button {
1439
1537
  padding-bottom:1rem
1440
1538
  }
1441
1539
 
1442
- .htw-px-0\.5{
1443
- padding-left:0.125rem;
1444
- padding-right:0.125rem
1445
- }
1446
-
1447
- .htw-py-2{
1448
- padding-top:0.5rem;
1449
- padding-bottom:0.5rem
1450
- }
1451
-
1452
- .htw-px-0{
1453
- padding-left:0px;
1454
- padding-right:0px
1455
- }
1456
-
1457
1540
  .htw-px-2{
1458
1541
  padding-left:0.5rem;
1459
1542
  padding-right:0.5rem
@@ -1469,6 +1552,21 @@ button {
1469
1552
  padding-bottom:0px
1470
1553
  }
1471
1554
 
1555
+ .htw-py-2{
1556
+ padding-top:0.5rem;
1557
+ padding-bottom:0.5rem
1558
+ }
1559
+
1560
+ .htw-px-0\.5{
1561
+ padding-left:0.125rem;
1562
+ padding-right:0.125rem
1563
+ }
1564
+
1565
+ .htw-px-0{
1566
+ padding-left:0px;
1567
+ padding-right:0px
1568
+ }
1569
+
1472
1570
  .htw-py-1{
1473
1571
  padding-top:0.25rem;
1474
1572
  padding-bottom:0.25rem
@@ -1494,8 +1592,8 @@ button {
1494
1592
  padding-left:0.125rem
1495
1593
  }
1496
1594
 
1497
- .htw-pl-5{
1498
- padding-left:1.25rem
1595
+ .htw-pl-4{
1596
+ padding-left:1rem
1499
1597
  }
1500
1598
 
1501
1599
  .htw-pl-2{
@@ -1529,10 +1627,20 @@ button {
1529
1627
  line-height:1.75rem
1530
1628
  }
1531
1629
 
1630
+ .htw-text-5xl{
1631
+ font-size:3rem;
1632
+ line-height:1
1633
+ }
1634
+
1532
1635
  .htw-text-white\/40{
1533
1636
  color:rgb(255 255 255 / 0.4)
1534
1637
  }
1535
1638
 
1639
+ .htw-text-gray-900{
1640
+ --tw-text-opacity:1;
1641
+ color:rgb(var(--_histoire-color-gray-900) / var(--tw-text-opacity))
1642
+ }
1643
+
1536
1644
  .htw-text-primary-500{
1537
1645
  --tw-text-opacity:1;
1538
1646
  color:rgb(var(--_histoire-color-primary-500) / var(--tw-text-opacity))
@@ -1591,14 +1699,14 @@ button {
1591
1699
  opacity:0.5
1592
1700
  }
1593
1701
 
1594
- .htw-opacity-30{
1595
- opacity:0.3
1596
- }
1597
-
1598
1702
  .htw-opacity-20{
1599
1703
  opacity:0.2
1600
1704
  }
1601
1705
 
1706
+ .htw-opacity-30{
1707
+ opacity:0.3
1708
+ }
1709
+
1602
1710
  .htw-opacity-70{
1603
1711
  opacity:0.7
1604
1712
  }
@@ -1702,6 +1810,14 @@ body {
1702
1810
  visibility: hidden;
1703
1811
  }
1704
1812
 
1813
+ .first\:htw-mt-0:first-child{
1814
+ margin-top:0px
1815
+ }
1816
+
1817
+ .last\:htw-mb-0:last-child{
1818
+ margin-bottom:0px
1819
+ }
1820
+
1705
1821
  .hover\:htw-bg-primary-100:hover{
1706
1822
  --tw-bg-opacity:1;
1707
1823
  background-color:rgb(var(--_histoire-color-primary-100) / var(--tw-bg-opacity))
@@ -1736,6 +1852,10 @@ body {
1736
1852
  color:rgb(var(--_histoire-color-primary-500) / var(--tw-text-opacity))
1737
1853
  }
1738
1854
 
1855
+ .hover\:htw-opacity-100:hover{
1856
+ opacity:1
1857
+ }
1858
+
1739
1859
  .focus\:htw-border-primary-500:focus{
1740
1860
  --tw-border-opacity:1;
1741
1861
  border-color:rgb(var(--_histoire-color-primary-500) / var(--tw-border-opacity))
@@ -1750,10 +1870,18 @@ body {
1750
1870
  border-color:rgb(var(--_histoire-color-primary-500) / var(--tw-border-opacity))
1751
1871
  }
1752
1872
 
1873
+ .htw-group:hover .group-hover\:htw-block{
1874
+ display:block
1875
+ }
1876
+
1753
1877
  .htw-group:hover .group-hover\:htw-opacity-90{
1754
1878
  opacity:0.9
1755
1879
  }
1756
1880
 
1881
+ .htw-group:hover .group-hover\:htw-opacity-100{
1882
+ opacity:1
1883
+ }
1884
+
1757
1885
  .htw-group:active .group-active\:htw-bg-gray-500\/20{
1758
1886
  background-color:rgb(var(--_histoire-color-gray-500) / 0.2)
1759
1887
  }
@@ -1857,6 +1985,11 @@ body {
1857
1985
  background-color:rgb(var(--_histoire-color-gray-750) / var(--tw-bg-opacity))
1858
1986
  }
1859
1987
 
1988
+ .htw-dark .dark\:htw-bg-black{
1989
+ --tw-bg-opacity:1;
1990
+ background-color:rgb(0 0 0 / var(--tw-bg-opacity))
1991
+ }
1992
+
1860
1993
  .htw-dark .dark\:htw-text-gray-100{
1861
1994
  --tw-text-opacity:1;
1862
1995
  color:rgb(var(--_histoire-color-gray-100) / var(--tw-text-opacity))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "histoire",
3
- "version": "0.2.2",
3
+ "version": "0.2.5",
4
4
  "description": "A fast story book powered by Vite",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -33,35 +33,35 @@
33
33
  "histoire": "./bin.mjs"
34
34
  },
35
35
  "dependencies": {
36
- "@iconify/vue": "^3.1.3",
37
- "@histoire/controls": "^0.2.2",
36
+ "@histoire/controls": "^0.2.5",
37
+ "@iconify/vue": "^3.2.1",
38
38
  "@vitejs/plugin-vue": "^2.3.1",
39
- "@vueuse/core": "^8.1.1",
40
- "birpc": "^0.1.0",
39
+ "@vueuse/core": "^8.2.5",
40
+ "birpc": "^0.1.1",
41
41
  "case": "^1.6.3",
42
42
  "chokidar": "^3.5.3",
43
43
  "connect": "^3.7.0",
44
44
  "defu": "^5.0.1",
45
45
  "diacritics": "^1.3.0",
46
- "floating-vue": "^2.0.0-beta.6",
47
- "fs-extra": "^10.0.0",
46
+ "floating-vue": "^2.0.0-beta.14",
47
+ "fs-extra": "^10.0.1",
48
48
  "globby": "^13.1.1",
49
- "happy-dom": "^2.33.1",
49
+ "happy-dom": "^2.55.0",
50
50
  "markdown-it": "^12.3.2",
51
- "markdown-it-anchor": "^8.4.1",
51
+ "markdown-it-anchor": "^8.6.2",
52
52
  "markdown-it-attrs": "^4.1.3",
53
53
  "markdown-it-emoji": "^2.0.0",
54
54
  "mrmime": "^1.0.0",
55
55
  "pathe": "^0.2.0",
56
56
  "picocolors": "^1.0.0",
57
- "pinia": "^2.0.11",
57
+ "pinia": "^2.0.13",
58
58
  "sade": "^1.8.1",
59
59
  "scroll-into-view-if-needed": "^2.2.29",
60
60
  "shiki": "^0.10.1",
61
61
  "sirv": "^2.0.2",
62
62
  "tinypool": "^0.1.2",
63
- "vite-node": "=0.7.6",
64
- "vue-router": "^4.0.12"
63
+ "vite-node": "0.7.6",
64
+ "vue-router": "^4.0.14"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "vite": "^2.9.0",
@@ -72,14 +72,14 @@
72
72
  "@tailwindcss/typography": "^0.5.2",
73
73
  "@types/fs-extra": "^9.0.13",
74
74
  "@types/markdown-it": "^12.2.3",
75
- "@types/node": "^17.0.18",
76
- "autoprefixer": "^10.4.2",
77
- "concurrently": "^7.0.0",
78
- "postcss": "^8.4.6",
79
- "postcss-import": "^14.0.2",
75
+ "@types/node": "^17.0.23",
76
+ "autoprefixer": "^10.4.4",
77
+ "concurrently": "^7.1.0",
78
+ "postcss": "^8.4.12",
79
+ "postcss-import": "^14.1.0",
80
80
  "tailwindcss": "^3.0.23",
81
- "typescript": "^4.5.5",
82
- "vite": "^2.9.0",
81
+ "typescript": "^4.6.3",
82
+ "vite": "^2.9.1",
83
83
  "vue": "^3.2.31"
84
84
  },
85
85
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  // @ts-expect-error virtual module
3
3
  import { files as rawFiles, tree as rawTree, onUpdate } from '$histoire-stories'
4
- import StoryList from './components/story/StoryList.vue'
4
+ import StoryList from './components/tree/StoryList.vue'
5
5
  import BaseSplitPane from './components/base/BaseSplitPane.vue'
6
6
  import { computed, ref, watch, defineAsyncComponent } from 'vue'
7
7
  import AppHeader from './components/app/AppHeader.vue'
@@ -102,7 +102,7 @@ onKeyboardShortcut(['ctrl+k', 'meta+k'], (event) => {
102
102
  class="htw-h-full"
103
103
  >
104
104
  <template #first>
105
- <div class="htw-flex htw-flex-col htw-h-full htw-gap-2">
105
+ <div class="htw-flex htw-flex-col htw-h-full">
106
106
  <AppHeader
107
107
  class="htw-flex-none"
108
108
  @search="isSearchOpen = true"
@@ -33,7 +33,9 @@ async function printVNode (vnode: VNode): Promise<string[]> {
33
33
 
34
34
  const attrs: string[][] = []
35
35
  let multilineAttrs = false
36
- const skipProps: string[] = []
36
+ const skipProps: string[] = [
37
+ 'key',
38
+ ]
37
39
 
38
40
  // Directives
39
41
  function genDirective (dirName: string, dir, valueCode: string = null) {
@@ -138,6 +140,8 @@ async function printVNode (vnode: VNode): Promise<string[]> {
138
140
  if (typeof value === 'string' && value.startsWith('{{') && value.endsWith('}}')) {
139
141
  // It was formatted from auto building object (slot props)
140
142
  serialized = [value.substring(2, value.length - 2).trim()]
143
+ } else if (typeof value === 'function') {
144
+ serialized = [value.toString().replace(/'/g, '\\\'').replace(/"/g, '\'')]
141
145
  } else {
142
146
  serialized = serializeAndCleanJs(value)
143
147
  }
@@ -230,6 +234,10 @@ async function printVNode (vnode: VNode): Promise<string[]> {
230
234
  } else {
231
235
  lines.push(`${tag[0]} />`)
232
236
  }
237
+ } else if (vnode?.shapeFlag & 1 << 4) {
238
+ for (const child of vnode.children) {
239
+ lines.push(...await printVNode(child))
240
+ }
233
241
  }
234
242
 
235
243
  return lines
@@ -39,7 +39,7 @@ onKeyboardShortcut(['ctrl+shift+d', 'meta+shift+d'], (event) => {
39
39
  <div class="htw-ml-auto htw-flex-none htw-flex">
40
40
  <a
41
41
  v-tooltip="makeTooltip('Search', ({ isMac }) => isMac ? 'meta+k' : 'ctrl+k')"
42
- class="htw-p-2 sm:htw-p-1 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer"
42
+ class="htw-p-2 sm:htw-p-1 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-text-gray-900 dark:htw-text-gray-100"
43
43
  data-test-id="search-btn"
44
44
  @click="$emit('search')"
45
45
  >
@@ -51,7 +51,7 @@ onKeyboardShortcut(['ctrl+shift+d', 'meta+shift+d'], (event) => {
51
51
 
52
52
  <a
53
53
  v-tooltip="makeTooltip('Toggle dark mode', ({ isMac }) => isMac ? 'meta+shift+d' : 'ctrl+shift+d')"
54
- class="htw-p-2 sm:htw-p-1 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer"
54
+ class="htw-p-2 sm:htw-p-1 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-text-gray-900 dark:htw-text-gray-100"
55
55
  @click="toggleDark()"
56
56
  >
57
57
  <Icon
@@ -4,7 +4,7 @@ import { Icon } from '@iconify/vue'
4
4
  import { useStoryStore } from '../../stores/story'
5
5
  import { Story, Tree } from '../../types'
6
6
  import MobileOverlay from './MobileOverlay.vue'
7
- import StoryList from '../story/StoryList.vue'
7
+ import StoryList from '../tree/StoryList.vue'
8
8
 
9
9
  const props = defineProps<{
10
10
  tree: Tree
@@ -36,7 +36,7 @@ export default defineComponent({
36
36
  >
37
37
  <a
38
38
  :href="href"
39
- class="htw-flex htw-items-center htw-gap-2"
39
+ class="htw-flex htw-items-center htw-gap-2 htw-text-gray-900 dark:htw-text-gray-100"
40
40
  :class="[
41
41
  $attrs.class,
42
42
  (isActive != null ? isActive : linkIsActive)
@@ -27,7 +27,7 @@ export default defineComponent({
27
27
  <a
28
28
  v-bind="$attrs"
29
29
  :href="href"
30
- class="htw-px-4 htw-h-full htw-inline-flex htw-items-center hover:htw-bg-primary-50 dark:hover:htw-bg-primary-900 htw-relative"
30
+ class="htw-px-4 htw-h-full htw-inline-flex htw-items-center hover:htw-bg-primary-50 dark:hover:htw-bg-primary-900 htw-relative htw-text-gray-900 dark:htw-text-gray-100"
31
31
  :class="{
32
32
  'htw-text-primary-500 dark:htw-text-primary-400': matched != null ? matched : (exact && isExactActive) || (!exact && isActive),
33
33
  }"
@@ -52,6 +52,11 @@ export default defineComponent({
52
52
  if (!vnode.props.initState && !vnode.props['init-state']) {
53
53
  vnode.props.initState = this.initState
54
54
  }
55
+ for (const attr in this.$attrs) {
56
+ if (typeof vnode.props[attr] === 'undefined') {
57
+ vnode.props[attr] = this.$attrs[attr]
58
+ }
59
+ }
55
60
  index++
56
61
  } else if (vnode.children?.length) {
57
62
  applyAttrs(vnode.children as VNode[])
@@ -17,6 +17,11 @@ export default defineComponent({
17
17
  type: String,
18
18
  default: null,
19
19
  },
20
+
21
+ responsiveDisabled: {
22
+ type: Boolean,
23
+ default: false,
24
+ },
20
25
  },
21
26
 
22
27
  setup (props) {
@@ -35,6 +40,8 @@ export default defineComponent({
35
40
  },
36
41
  slots: () => vm.proxy.$slots,
37
42
  source: props.source,
43
+ responsiveDisabled: props.responsiveDisabled,
44
+ configReady: true,
38
45
  })
39
46
  }
40
47
  updateVariant()
@@ -51,6 +51,7 @@ const kindLabels = {
51
51
  <div
52
52
  ref="el"
53
53
  data-test-id="search-item"
54
+ :data-selected="selected ? '' : undefined"
54
55
  >
55
56
  <BaseListItemLink
56
57
  :to="result.route"
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { useFocus } from '@vueuse/core'
2
+ import { useFocus, useDebounce } from '@vueuse/core'
3
3
  import { computed, ref, watch } from 'vue'
4
4
  import { Icon } from '@iconify/vue'
5
5
  import { useStoryStore } from '../../stores/story'
@@ -40,7 +40,8 @@ watch(() => props.shown, value => {
40
40
 
41
41
  // Search
42
42
 
43
- const search = ref('')
43
+ const searchInputText = ref('')
44
+ const rateLimitedSearch = useDebounce(searchInputText, 300)
44
45
 
45
46
  const storyStore = useStoryStore()
46
47
 
@@ -85,8 +86,8 @@ function variantResultFactory (story: Story, variant: Variant, rank: number): Se
85
86
 
86
87
  const results = computed(() => {
87
88
  const list: SearchResult[] = []
88
- if (search.value) {
89
- const s = search.value.toLowerCase()
89
+ if (rateLimitedSearch.value) {
90
+ const s = rateLimitedSearch.value.toLowerCase()
90
91
  for (const story of storyStore.stories) {
91
92
  const storyMatched = story.title.toLowerCase().includes(s)
92
93
  let storyPathMatched = false
@@ -149,7 +150,7 @@ function selectPrevious () {
149
150
 
150
151
  <input
151
152
  ref="input"
152
- v-model="search"
153
+ v-model="searchInputText"
153
154
  placeholder="Search for stories, variants..."
154
155
  class="htw-bg-transparent htw-w-full htw-flex-1 htw-pl-0 htw-pr-6 htw-py-4 htw-outline-none"
155
156
  @keydown.down.prevent="selectNext()"
@@ -158,7 +159,7 @@ function selectPrevious () {
158
159
  >
159
160
  </div>
160
161
 
161
- <BaseEmpty v-if="search && !results.length">
162
+ <BaseEmpty v-if="rateLimitedSearch && !results.length">
162
163
  No results
163
164
  </BaseEmpty>
164
165