@docsector/docsector-reader 2.3.0 → 3.0.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 (287) hide show
  1. package/README.md +49 -21
  2. package/bin/docsector.js +1 -1
  3. package/package.json +5 -3
  4. package/src/components/DMenu.vue +15 -8
  5. package/src/components/DPageExpandable.vue +78 -0
  6. package/src/components/DPageSection.vue +7 -572
  7. package/src/components/DPageSourceCode.vue +1 -1
  8. package/src/components/DPageTokens.vue +122 -0
  9. package/src/components/page-section-tokens.js +613 -0
  10. package/src/pages/guide/getting-started.overview.en-US.md +2 -2
  11. package/src/pages/guide/getting-started.overview.pt-BR.md +2 -2
  12. package/src/pages/guide/i18n-and-markdown.overview.en-US.md +16 -0
  13. package/src/pages/guide/i18n-and-markdown.overview.pt-BR.md +16 -0
  14. package/src/pages/guide.index.js +48 -0
  15. package/src/pages/manual/components/d-menu.overview.en-US.md +1 -1
  16. package/src/pages/manual/components/d-menu.overview.pt-BR.md +1 -1
  17. package/src/pages/manual/components/d-page-expandable.overview.en-US.md +58 -0
  18. package/src/pages/manual/components/d-page-expandable.overview.pt-BR.md +58 -0
  19. package/src/pages/manual/components/d-page-expandable.showcase.en-US.md +33 -0
  20. package/src/pages/manual/components/d-page-expandable.showcase.pt-BR.md +33 -0
  21. package/src/pages/manual.index.js +102 -0
  22. package/src/quasar.factory.js +158 -13
  23. package/src/search/book-search.js +25 -0
  24. package/public/Docsphere/flags/brazil.png +0 -0
  25. package/public/Docsphere/flags/united-states-of-america.png +0 -0
  26. package/src/i18n/tags.hjson +0 -46
  27. /package/public/{Docsphere → images}/flags/abkhazia.png +0 -0
  28. /package/public/{Docsphere → images}/flags/afghanistan.png +0 -0
  29. /package/public/{Docsphere → images}/flags/aland-islands.png +0 -0
  30. /package/public/{Docsphere → images}/flags/albania.png +0 -0
  31. /package/public/{Docsphere → images}/flags/algeria.png +0 -0
  32. /package/public/{Docsphere → images}/flags/american-samoa.png +0 -0
  33. /package/public/{Docsphere → images}/flags/andorra.png +0 -0
  34. /package/public/{Docsphere → images}/flags/angola.png +0 -0
  35. /package/public/{Docsphere → images}/flags/anguilla.png +0 -0
  36. /package/public/{Docsphere → images}/flags/antigua-and-barbuda.png +0 -0
  37. /package/public/{Docsphere → images}/flags/argentina.png +0 -0
  38. /package/public/{Docsphere → images}/flags/armenia.png +0 -0
  39. /package/public/{Docsphere → images}/flags/aruba.png +0 -0
  40. /package/public/{Docsphere → images}/flags/australia.png +0 -0
  41. /package/public/{Docsphere → images}/flags/austria.png +0 -0
  42. /package/public/{Docsphere → images}/flags/azerbaijan.png +0 -0
  43. /package/public/{Docsphere → images}/flags/azores-islands.png +0 -0
  44. /package/public/{Docsphere → images}/flags/bahamas.png +0 -0
  45. /package/public/{Docsphere → images}/flags/bahrain.png +0 -0
  46. /package/public/{Docsphere → images}/flags/balearic-islands.png +0 -0
  47. /package/public/{Docsphere → images}/flags/bangladesh.png +0 -0
  48. /package/public/{Docsphere → images}/flags/barbados.png +0 -0
  49. /package/public/{Docsphere → images}/flags/basque-country.png +0 -0
  50. /package/public/{Docsphere → images}/flags/belarus.png +0 -0
  51. /package/public/{Docsphere → images}/flags/belgium.png +0 -0
  52. /package/public/{Docsphere → images}/flags/belize.png +0 -0
  53. /package/public/{Docsphere → images}/flags/benin.png +0 -0
  54. /package/public/{Docsphere → images}/flags/bermuda.png +0 -0
  55. /package/public/{Docsphere → images}/flags/bhutan-1.png +0 -0
  56. /package/public/{Docsphere → images}/flags/bhutan.png +0 -0
  57. /package/public/{Docsphere → images}/flags/bolivia.png +0 -0
  58. /package/public/{Docsphere → images}/flags/bonaire.png +0 -0
  59. /package/public/{Docsphere → images}/flags/bosnia-and-herzegovina.png +0 -0
  60. /package/public/{Docsphere → images}/flags/botswana.png +0 -0
  61. /package/public/{Docsphere → images}/flags/british-columbia.png +0 -0
  62. /package/public/{Docsphere → images}/flags/british-indian-ocean-territory.png +0 -0
  63. /package/public/{Docsphere → images}/flags/british-virgin-islands.png +0 -0
  64. /package/public/{Docsphere → images}/flags/brunei.png +0 -0
  65. /package/public/{Docsphere → images}/flags/bulgaria.png +0 -0
  66. /package/public/{Docsphere → images}/flags/burkina-faso.png +0 -0
  67. /package/public/{Docsphere → images}/flags/burundi.png +0 -0
  68. /package/public/{Docsphere → images}/flags/cambodia.png +0 -0
  69. /package/public/{Docsphere → images}/flags/cameroon.png +0 -0
  70. /package/public/{Docsphere → images}/flags/canada.png +0 -0
  71. /package/public/{Docsphere → images}/flags/canary-islands.png +0 -0
  72. /package/public/{Docsphere → images}/flags/cape-verde.png +0 -0
  73. /package/public/{Docsphere → images}/flags/cayman-islands.png +0 -0
  74. /package/public/{Docsphere → images}/flags/central-african-republic.png +0 -0
  75. /package/public/{Docsphere → images}/flags/ceuta.png +0 -0
  76. /package/public/{Docsphere → images}/flags/chad.png +0 -0
  77. /package/public/{Docsphere → images}/flags/chile.png +0 -0
  78. /package/public/{Docsphere → images}/flags/china.png +0 -0
  79. /package/public/{Docsphere → images}/flags/christmas-island.png +0 -0
  80. /package/public/{Docsphere → images}/flags/cocos-island.png +0 -0
  81. /package/public/{Docsphere → images}/flags/colombia.png +0 -0
  82. /package/public/{Docsphere → images}/flags/comoros.png +0 -0
  83. /package/public/{Docsphere → images}/flags/cook-islands.png +0 -0
  84. /package/public/{Docsphere → images}/flags/corsica.png +0 -0
  85. /package/public/{Docsphere → images}/flags/costa-rica.png +0 -0
  86. /package/public/{Docsphere → images}/flags/croatia.png +0 -0
  87. /package/public/{Docsphere → images}/flags/cuba.png +0 -0
  88. /package/public/{Docsphere → images}/flags/curacao.png +0 -0
  89. /package/public/{Docsphere → images}/flags/cyprus.png +0 -0
  90. /package/public/{Docsphere → images}/flags/czech-republic.png +0 -0
  91. /package/public/{Docsphere → images}/flags/democratic-republic-of-congo.png +0 -0
  92. /package/public/{Docsphere → images}/flags/denmark.png +0 -0
  93. /package/public/{Docsphere → images}/flags/djibouti.png +0 -0
  94. /package/public/{Docsphere → images}/flags/dominica.png +0 -0
  95. /package/public/{Docsphere → images}/flags/dominican-republic.png +0 -0
  96. /package/public/{Docsphere → images}/flags/east-timor.png +0 -0
  97. /package/public/{Docsphere → images}/flags/ecuador.png +0 -0
  98. /package/public/{Docsphere → images}/flags/egypt.png +0 -0
  99. /package/public/{Docsphere → images}/flags/england.png +0 -0
  100. /package/public/{Docsphere → images}/flags/equatorial-guinea.png +0 -0
  101. /package/public/{Docsphere → images}/flags/eritrea.png +0 -0
  102. /package/public/{Docsphere → images}/flags/estonia.png +0 -0
  103. /package/public/{Docsphere → images}/flags/ethiopia.png +0 -0
  104. /package/public/{Docsphere → images}/flags/european-union.png +0 -0
  105. /package/public/{Docsphere → images}/flags/falkland-islands.png +0 -0
  106. /package/public/{Docsphere → images}/flags/faroe-islands.png +0 -0
  107. /package/public/{Docsphere → images}/flags/fiji.png +0 -0
  108. /package/public/{Docsphere → images}/flags/finland.png +0 -0
  109. /package/public/{Docsphere → images}/flags/france.png +0 -0
  110. /package/public/{Docsphere → images}/flags/french-polynesia.png +0 -0
  111. /package/public/{Docsphere → images}/flags/gabon.png +0 -0
  112. /package/public/{Docsphere → images}/flags/galapagos-islands.png +0 -0
  113. /package/public/{Docsphere → images}/flags/gambia.png +0 -0
  114. /package/public/{Docsphere → images}/flags/georgia.png +0 -0
  115. /package/public/{Docsphere → images}/flags/germany.png +0 -0
  116. /package/public/{Docsphere → images}/flags/ghana.png +0 -0
  117. /package/public/{Docsphere → images}/flags/gibraltar.png +0 -0
  118. /package/public/{Docsphere → images}/flags/greece.png +0 -0
  119. /package/public/{Docsphere → images}/flags/greenland.png +0 -0
  120. /package/public/{Docsphere → images}/flags/grenada.png +0 -0
  121. /package/public/{Docsphere → images}/flags/guam.png +0 -0
  122. /package/public/{Docsphere → images}/flags/guatemala.png +0 -0
  123. /package/public/{Docsphere → images}/flags/guernsey.png +0 -0
  124. /package/public/{Docsphere → images}/flags/guinea-bissau.png +0 -0
  125. /package/public/{Docsphere → images}/flags/guinea.png +0 -0
  126. /package/public/{Docsphere → images}/flags/guyana.png +0 -0
  127. /package/public/{Docsphere → images}/flags/haiti.png +0 -0
  128. /package/public/{Docsphere → images}/flags/hawaii.png +0 -0
  129. /package/public/{Docsphere → images}/flags/honduras.png +0 -0
  130. /package/public/{Docsphere → images}/flags/hong-kong.png +0 -0
  131. /package/public/{Docsphere → images}/flags/hungary.png +0 -0
  132. /package/public/{Docsphere → images}/flags/iceland.png +0 -0
  133. /package/public/{Docsphere → images}/flags/india.png +0 -0
  134. /package/public/{Docsphere → images}/flags/indonesia.png +0 -0
  135. /package/public/{Docsphere → images}/flags/iran.png +0 -0
  136. /package/public/{Docsphere → images}/flags/iraq.png +0 -0
  137. /package/public/{Docsphere → images}/flags/ireland.png +0 -0
  138. /package/public/{Docsphere → images}/flags/isle-of-man.png +0 -0
  139. /package/public/{Docsphere → images}/flags/israel.png +0 -0
  140. /package/public/{Docsphere → images}/flags/italy.png +0 -0
  141. /package/public/{Docsphere → images}/flags/ivory-coast.png +0 -0
  142. /package/public/{Docsphere → images}/flags/jamaica.png +0 -0
  143. /package/public/{Docsphere → images}/flags/japan.png +0 -0
  144. /package/public/{Docsphere → images}/flags/jersey.png +0 -0
  145. /package/public/{Docsphere → images}/flags/jordan.png +0 -0
  146. /package/public/{Docsphere → images}/flags/kazakhstan.png +0 -0
  147. /package/public/{Docsphere → images}/flags/kenya.png +0 -0
  148. /package/public/{Docsphere → images}/flags/kiribati.png +0 -0
  149. /package/public/{Docsphere → images}/flags/kosovo.png +0 -0
  150. /package/public/{Docsphere → images}/flags/kuwait.png +0 -0
  151. /package/public/{Docsphere → images}/flags/kyrgyzstan.png +0 -0
  152. /package/public/{Docsphere → images}/flags/laos.png +0 -0
  153. /package/public/{Docsphere → images}/flags/latvia.png +0 -0
  154. /package/public/{Docsphere → images}/flags/lebanon.png +0 -0
  155. /package/public/{Docsphere → images}/flags/lesotho.png +0 -0
  156. /package/public/{Docsphere → images}/flags/liberia.png +0 -0
  157. /package/public/{Docsphere → images}/flags/libya.png +0 -0
  158. /package/public/{Docsphere → images}/flags/liechtenstein.png +0 -0
  159. /package/public/{Docsphere → images}/flags/lithuania.png +0 -0
  160. /package/public/{Docsphere → images}/flags/luxembourg.png +0 -0
  161. /package/public/{Docsphere → images}/flags/macao.png +0 -0
  162. /package/public/{Docsphere → images}/flags/madagascar.png +0 -0
  163. /package/public/{Docsphere → images}/flags/madeira.png +0 -0
  164. /package/public/{Docsphere → images}/flags/malawi.png +0 -0
  165. /package/public/{Docsphere → images}/flags/malaysia.png +0 -0
  166. /package/public/{Docsphere → images}/flags/maldives.png +0 -0
  167. /package/public/{Docsphere → images}/flags/mali.png +0 -0
  168. /package/public/{Docsphere → images}/flags/malta.png +0 -0
  169. /package/public/{Docsphere → images}/flags/marshall-island.png +0 -0
  170. /package/public/{Docsphere → images}/flags/martinique.png +0 -0
  171. /package/public/{Docsphere → images}/flags/mauritania.png +0 -0
  172. /package/public/{Docsphere → images}/flags/mauritius.png +0 -0
  173. /package/public/{Docsphere → images}/flags/melilla.png +0 -0
  174. /package/public/{Docsphere → images}/flags/mexico.png +0 -0
  175. /package/public/{Docsphere → images}/flags/micronesia.png +0 -0
  176. /package/public/{Docsphere → images}/flags/moldova.png +0 -0
  177. /package/public/{Docsphere → images}/flags/monaco.png +0 -0
  178. /package/public/{Docsphere → images}/flags/mongolia.png +0 -0
  179. /package/public/{Docsphere → images}/flags/montenegro.png +0 -0
  180. /package/public/{Docsphere → images}/flags/montserrat.png +0 -0
  181. /package/public/{Docsphere → images}/flags/morocco.png +0 -0
  182. /package/public/{Docsphere → images}/flags/mozambique.png +0 -0
  183. /package/public/{Docsphere → images}/flags/myanmar.png +0 -0
  184. /package/public/{Docsphere → images}/flags/namibia.png +0 -0
  185. /package/public/{Docsphere → images}/flags/nato.png +0 -0
  186. /package/public/{Docsphere → images}/flags/nauru.png +0 -0
  187. /package/public/{Docsphere → images}/flags/nepal.png +0 -0
  188. /package/public/{Docsphere → images}/flags/netherlands.png +0 -0
  189. /package/public/{Docsphere → images}/flags/new-zealand.png +0 -0
  190. /package/public/{Docsphere → images}/flags/nicaragua.png +0 -0
  191. /package/public/{Docsphere → images}/flags/niger.png +0 -0
  192. /package/public/{Docsphere → images}/flags/nigeria.png +0 -0
  193. /package/public/{Docsphere → images}/flags/niue.png +0 -0
  194. /package/public/{Docsphere → images}/flags/norfolk-island.png +0 -0
  195. /package/public/{Docsphere → images}/flags/north-korea.png +0 -0
  196. /package/public/{Docsphere → images}/flags/northen-cyprus.png +0 -0
  197. /package/public/{Docsphere → images}/flags/northern-marianas-islands.png +0 -0
  198. /package/public/{Docsphere → images}/flags/norway.png +0 -0
  199. /package/public/{Docsphere → images}/flags/oman.png +0 -0
  200. /package/public/{Docsphere → images}/flags/orkney-islands.png +0 -0
  201. /package/public/{Docsphere → images}/flags/ossetia.png +0 -0
  202. /package/public/{Docsphere → images}/flags/pakistan.png +0 -0
  203. /package/public/{Docsphere → images}/flags/palau.png +0 -0
  204. /package/public/{Docsphere → images}/flags/palestine.png +0 -0
  205. /package/public/{Docsphere → images}/flags/panama.png +0 -0
  206. /package/public/{Docsphere → images}/flags/papua-new-guinea.png +0 -0
  207. /package/public/{Docsphere → images}/flags/paraguay.png +0 -0
  208. /package/public/{Docsphere → images}/flags/peru.png +0 -0
  209. /package/public/{Docsphere → images}/flags/philippines.png +0 -0
  210. /package/public/{Docsphere → images}/flags/pitcairn-islands.png +0 -0
  211. /package/public/{Docsphere → images}/flags/portugal.png +0 -0
  212. /package/public/{Docsphere → images}/flags/puerto-rico.png +0 -0
  213. /package/public/{Docsphere → images}/flags/qatar.png +0 -0
  214. /package/public/{Docsphere → images}/flags/rapa-nui.png +0 -0
  215. /package/public/{Docsphere → images}/flags/republic-of-macedonia.png +0 -0
  216. /package/public/{Docsphere → images}/flags/republic-of-poland.png +0 -0
  217. /package/public/{Docsphere → images}/flags/republic-of-the-congo.png +0 -0
  218. /package/public/{Docsphere → images}/flags/romania.png +0 -0
  219. /package/public/{Docsphere → images}/flags/russia.png +0 -0
  220. /package/public/{Docsphere → images}/flags/rwanda.png +0 -0
  221. /package/public/{Docsphere → images}/flags/saba-island.png +0 -0
  222. /package/public/{Docsphere → images}/flags/saint-kitts-and-nevis.png +0 -0
  223. /package/public/{Docsphere → images}/flags/salvador.png +0 -0
  224. /package/public/{Docsphere → images}/flags/samoa.png +0 -0
  225. /package/public/{Docsphere → images}/flags/san-marino.png +0 -0
  226. /package/public/{Docsphere → images}/flags/sao-tome-and-principe.png +0 -0
  227. /package/public/{Docsphere → images}/flags/sardinia.png +0 -0
  228. /package/public/{Docsphere → images}/flags/saudi-arabia.png +0 -0
  229. /package/public/{Docsphere → images}/flags/scotland.png +0 -0
  230. /package/public/{Docsphere → images}/flags/senegal.png +0 -0
  231. /package/public/{Docsphere → images}/flags/serbia.png +0 -0
  232. /package/public/{Docsphere → images}/flags/seychelles.png +0 -0
  233. /package/public/{Docsphere → images}/flags/sierra-leone.png +0 -0
  234. /package/public/{Docsphere → images}/flags/singapore.png +0 -0
  235. /package/public/{Docsphere → images}/flags/sint-eustatius.png +0 -0
  236. /package/public/{Docsphere → images}/flags/sint-maarten.png +0 -0
  237. /package/public/{Docsphere → images}/flags/slovakia.png +0 -0
  238. /package/public/{Docsphere → images}/flags/slovenia.png +0 -0
  239. /package/public/{Docsphere → images}/flags/solomon-islands.png +0 -0
  240. /package/public/{Docsphere → images}/flags/somalia.png +0 -0
  241. /package/public/{Docsphere → images}/flags/somaliland.png +0 -0
  242. /package/public/{Docsphere → images}/flags/south-africa.png +0 -0
  243. /package/public/{Docsphere → images}/flags/south-korea.png +0 -0
  244. /package/public/{Docsphere → images}/flags/south-sudan.png +0 -0
  245. /package/public/{Docsphere → images}/flags/spain.png +0 -0
  246. /package/public/{Docsphere → images}/flags/sri-lanka.png +0 -0
  247. /package/public/{Docsphere → images}/flags/st-barts.png +0 -0
  248. /package/public/{Docsphere → images}/flags/st-lucia.png +0 -0
  249. /package/public/{Docsphere → images}/flags/st-vincent-and-the-grenadines.png +0 -0
  250. /package/public/{Docsphere → images}/flags/sudan.png +0 -0
  251. /package/public/{Docsphere → images}/flags/suriname.png +0 -0
  252. /package/public/{Docsphere → images}/flags/swaziland.png +0 -0
  253. /package/public/{Docsphere → images}/flags/sweden.png +0 -0
  254. /package/public/{Docsphere → images}/flags/switzerland.png +0 -0
  255. /package/public/{Docsphere → images}/flags/syria.png +0 -0
  256. /package/public/{Docsphere → images}/flags/taiwan.png +0 -0
  257. /package/public/{Docsphere → images}/flags/tajikistan.png +0 -0
  258. /package/public/{Docsphere → images}/flags/tanzania.png +0 -0
  259. /package/public/{Docsphere → images}/flags/thailand.png +0 -0
  260. /package/public/{Docsphere → images}/flags/tibet.png +0 -0
  261. /package/public/{Docsphere → images}/flags/togo.png +0 -0
  262. /package/public/{Docsphere → images}/flags/tokelau.png +0 -0
  263. /package/public/{Docsphere → images}/flags/tonga.png +0 -0
  264. /package/public/{Docsphere → images}/flags/transnistria.png +0 -0
  265. /package/public/{Docsphere → images}/flags/trinidad-and-tobago.png +0 -0
  266. /package/public/{Docsphere → images}/flags/tunisia.png +0 -0
  267. /package/public/{Docsphere → images}/flags/turkey.png +0 -0
  268. /package/public/{Docsphere → images}/flags/turkmenistan.png +0 -0
  269. /package/public/{Docsphere → images}/flags/turks-and-caicos.png +0 -0
  270. /package/public/{Docsphere → images}/flags/tuvalu.png +0 -0
  271. /package/public/{Docsphere → images}/flags/uganda.png +0 -0
  272. /package/public/{Docsphere → images}/flags/ukraine.png +0 -0
  273. /package/public/{Docsphere → images}/flags/united-arab-emirates.png +0 -0
  274. /package/public/{Docsphere → images}/flags/united-kingdom.png +0 -0
  275. /package/public/{Docsphere → images}/flags/united-nations.png +0 -0
  276. /package/public/{Docsphere → images}/flags/uruguay.png +0 -0
  277. /package/public/{Docsphere → images}/flags/uzbekistn.png +0 -0
  278. /package/public/{Docsphere → images}/flags/vanuatu.png +0 -0
  279. /package/public/{Docsphere → images}/flags/vatican-city.png +0 -0
  280. /package/public/{Docsphere → images}/flags/venezuela.png +0 -0
  281. /package/public/{Docsphere → images}/flags/vietnam.png +0 -0
  282. /package/public/{Docsphere → images}/flags/virgin-islands.png +0 -0
  283. /package/public/{Docsphere → images}/flags/wales.png +0 -0
  284. /package/public/{Docsphere → images}/flags/western-sahara.png +0 -0
  285. /package/public/{Docsphere → images}/flags/yemen.png +0 -0
  286. /package/public/{Docsphere → images}/flags/zambia.png +0 -0
  287. /package/public/{Docsphere → images}/flags/zimbabwe.png +0 -0
@@ -220,6 +220,59 @@ function resolvePageBook (config, fallbackBook = 'manual') {
220
220
  return config.book ?? config.type ?? fallbackBook
221
221
  }
222
222
 
223
+ function normalizePagePath (pagePath) {
224
+ const normalized = String(pagePath || '').trim()
225
+ if (normalized === '') return ''
226
+ return normalized.startsWith('/') ? normalized : `/${normalized}`
227
+ }
228
+
229
+ function extractTagsFromRoutes (routes = {}, fallbackBook = 'manual') {
230
+ const extracted = {}
231
+
232
+ for (const [pagePath, page] of Object.entries(routes || {})) {
233
+ if (!page || typeof page !== 'object') continue
234
+
235
+ const metadata = page.metadata
236
+ if (!metadata || typeof metadata !== 'object') continue
237
+
238
+ const pageTags = metadata.tags
239
+ if (!pageTags || typeof pageTags !== 'object' || Array.isArray(pageTags)) continue
240
+
241
+ const bookName = resolvePageBook(page.config, fallbackBook)
242
+ const normalizedPath = normalizePagePath(pagePath)
243
+ const unversionedPath = `/${bookName}${normalizedPath}`
244
+
245
+ for (const [locale, terms] of Object.entries(pageTags)) {
246
+ if (typeof terms !== 'string' || terms.trim().length === 0) continue
247
+
248
+ if (!extracted[locale]) {
249
+ extracted[locale] = {}
250
+ }
251
+
252
+ extracted[locale][unversionedPath] = terms
253
+ }
254
+ }
255
+
256
+ return extracted
257
+ }
258
+
259
+ function mergeBookTags (legacyTags = {}, metadataTags = {}) {
260
+ const merged = {}
261
+ const locales = new Set([
262
+ ...Object.keys(legacyTags || {}),
263
+ ...Object.keys(metadataTags || {})
264
+ ])
265
+
266
+ for (const locale of locales) {
267
+ merged[locale] = {
268
+ ...(legacyTags?.[locale] || {}),
269
+ ...(metadataTags?.[locale] || {})
270
+ }
271
+ }
272
+
273
+ return merged
274
+ }
275
+
223
276
  const DEFAULT_BOOK_COLORS = Object.freeze({
224
277
  active: 'white',
225
278
  inactive: 'rgba(255, 255, 255, 0.72)'
@@ -364,7 +417,8 @@ export const booksByVersion = {
364
417
  books: {
365
418
  manual: {
366
419
  config: defaultBook,
367
- routes: normalizedPages
420
+ routes: normalizedPages,
421
+ tags: {}
368
422
  }
369
423
  },
370
424
  allBooks: [defaultBook]
@@ -372,6 +426,12 @@ export const booksByVersion = {
372
426
  }
373
427
 
374
428
  export const books = booksByVersion[currentVersion.id].books
429
+ export const bookTagsByVersion = {
430
+ [currentVersion.id]: {
431
+ manual: {}
432
+ }
433
+ }
434
+ export const bookTags = bookTagsByVersion[currentVersion.id]
375
435
 
376
436
  export const pageEntries = Object.entries(normalizedPages).map(([pagePath, page]) => ({
377
437
  version: currentVersion.id,
@@ -398,8 +458,8 @@ export default books
398
458
 
399
459
  for (const [index, entry] of bookEntries.entries()) {
400
460
  imports.push(`import __book_${index} from 'pages/${entry.bookFile}'`)
401
- imports.push(`import __routes_${index} from 'pages/${entry.indexFile}'`)
402
- rows.push(` { versionId: ${JSON.stringify(entry.versionId)}, currentVersion: ${JSON.stringify(entry.currentVersion)}, routePrefix: ${JSON.stringify(entry.routePrefix)}, sourceRoot: ${JSON.stringify(entry.sourceRoot)}, fallbackId: ${JSON.stringify(entry.id)}, config: __book_${index}, routes: __routes_${index} }`)
461
+ imports.push(`import * as __index_${index} from 'pages/${entry.indexFile}'`)
462
+ rows.push(` { versionId: ${JSON.stringify(entry.versionId)}, currentVersion: ${JSON.stringify(entry.currentVersion)}, routePrefix: ${JSON.stringify(entry.routePrefix)}, sourceRoot: ${JSON.stringify(entry.sourceRoot)}, fallbackId: ${JSON.stringify(entry.id)}, config: __book_${index}, routes: __index_${index}.default || {}, legacyTags: __index_${index}.tags || {} }`)
403
463
  discoveredVersionIds.set(entry.versionId, {
404
464
  id: entry.versionId,
405
465
  current: entry.currentVersion,
@@ -482,6 +542,64 @@ const normalizeBookColor = (rawColor) => {
482
542
  return { ...DEFAULT_BOOK_COLORS }
483
543
  }
484
544
 
545
+ const resolvePageBook = (config, fallbackBook = 'manual') => {
546
+ if (!config || typeof config !== 'object') return fallbackBook
547
+ return config.book ?? config.type ?? fallbackBook
548
+ }
549
+
550
+ const normalizePagePath = (pagePath) => {
551
+ const normalized = String(pagePath || '').trim()
552
+ if (normalized === '') return ''
553
+ return normalized.startsWith('/') ? normalized : '/' + normalized
554
+ }
555
+
556
+ const extractTagsFromRoutes = (routes = {}, fallbackBook = 'manual') => {
557
+ const extracted = {}
558
+
559
+ for (const [pagePath, page] of Object.entries(routes || {})) {
560
+ if (!page || typeof page !== 'object') continue
561
+
562
+ const metadata = page.metadata
563
+ if (!metadata || typeof metadata !== 'object') continue
564
+
565
+ const pageTags = metadata.tags
566
+ if (!pageTags || typeof pageTags !== 'object' || Array.isArray(pageTags)) continue
567
+
568
+ const bookName = resolvePageBook(page.config, fallbackBook)
569
+ const normalizedPath = normalizePagePath(pagePath)
570
+ const unversionedPath = '/' + bookName + normalizedPath
571
+
572
+ for (const [locale, terms] of Object.entries(pageTags)) {
573
+ if (typeof terms !== 'string' || terms.trim().length === 0) continue
574
+
575
+ if (!extracted[locale]) {
576
+ extracted[locale] = {}
577
+ }
578
+
579
+ extracted[locale][unversionedPath] = terms
580
+ }
581
+ }
582
+
583
+ return extracted
584
+ }
585
+
586
+ const mergeBookTags = (legacyTags = {}, metadataTags = {}) => {
587
+ const merged = {}
588
+ const locales = new Set([
589
+ ...Object.keys(legacyTags || {}),
590
+ ...Object.keys(metadataTags || {})
591
+ ])
592
+
593
+ for (const locale of locales) {
594
+ merged[locale] = {
595
+ ...(legacyTags?.[locale] || {}),
596
+ ...(metadataTags?.[locale] || {})
597
+ }
598
+ }
599
+
600
+ return merged
601
+ }
602
+
485
603
  const normalizeVersionDescriptor = (raw, fallback = {}) => {
486
604
  const value = typeof raw === 'string' ? { id: raw, label: raw } : (raw || {})
487
605
  const current = value.current === true || fallback.current === true
@@ -571,6 +689,8 @@ export const booksByVersion = entries.reduce((accumulator, entry, index) => {
571
689
  const version = resolveEntryVersion(entry)
572
690
  const config = entry.config || {}
573
691
  const resolvedId = config.id || entry.fallbackId || ('book-' + (index + 1))
692
+ const metadataTags = extractTagsFromRoutes(entry.routes || {}, resolvedId)
693
+ const tags = mergeBookTags(entry.legacyTags || {}, metadataTags)
574
694
  const label = config.label || (resolvedId.charAt(0).toUpperCase() + resolvedId.slice(1))
575
695
  const normalizedConfig = {
576
696
  ...config,
@@ -593,7 +713,8 @@ export const booksByVersion = entries.reduce((accumulator, entry, index) => {
593
713
 
594
714
  accumulator[version.id].books[resolvedId] = {
595
715
  config: normalizedConfig,
596
- routes: entry.routes || {}
716
+ routes: entry.routes || {},
717
+ tags
597
718
  }
598
719
  accumulator[version.id].allBooks = Object.values(accumulator[version.id].books).map(book => book.config)
599
720
  return accumulator
@@ -609,6 +730,16 @@ export const allPages = Object.values(books).reduce((accumulator, book) => {
609
730
  }
610
731
  }, {})
611
732
 
733
+ export const bookTagsByVersion = Object.entries(booksByVersion).reduce((accumulator, [versionId, versionBooks]) => {
734
+ accumulator[versionId] = Object.entries(versionBooks?.books || {}).reduce((bookAccumulator, [bookId, book]) => {
735
+ bookAccumulator[bookId] = book?.tags || {}
736
+ return bookAccumulator
737
+ }, {})
738
+ return accumulator
739
+ }, {})
740
+
741
+ export const bookTags = bookTagsByVersion[currentVersion.id] || {}
742
+
612
743
  export const pageEntries = Object.entries(booksByVersion).flatMap(([versionId, versionBooks]) => {
613
744
  const version = versionBooks.version
614
745
 
@@ -644,7 +775,7 @@ export default books
644
775
  /**
645
776
  * Load books and merged pages for build-time plugins (Node context).
646
777
  */
647
- async function loadBooksRegistry (projectRoot) {
778
+ export async function loadBooksRegistry (projectRoot) {
648
779
  const entries = getBookRegistryEntries(projectRoot)
649
780
 
650
781
  // Legacy fallback
@@ -701,6 +832,14 @@ async function loadBooksRegistry (projectRoot) {
701
832
  allBooks: [defaultBook]
702
833
  }
703
834
  },
835
+ bookTagsByVersion: {
836
+ [currentVersion.id]: {
837
+ manual: {}
838
+ }
839
+ },
840
+ bookTags: {
841
+ manual: {}
842
+ },
704
843
  pageEntries,
705
844
  books,
706
845
  allBooks: [defaultBook],
@@ -822,19 +961,21 @@ async function loadBooksRegistry (projectRoot) {
822
961
  const booksByVersion = {}
823
962
  const currentBooks = {}
824
963
  const allPages = {}
964
+ const bookTagsByVersion = {}
825
965
 
826
966
  for (const [index, entry] of entries.entries()) {
827
967
  const rawVersion = entry.currentVersion || entry.versionId === CURRENT_VERSION_KEY
828
968
  ? currentVersion
829
969
  : (versionById[entry.versionId] || normalizeVersionDescriptor(null, entry))
830
970
  const { default: rawConfig = {} } = await import(pathToFileURL(entry.bookPath).href)
831
- const { default: routes = {} } = await import(pathToFileURL(entry.indexPath).href)
971
+ const { default: routes = {}, tags: legacyTags = {} } = await import(pathToFileURL(entry.indexPath).href)
832
972
 
833
973
  const config = {
834
974
  ...normalizeBookConfig(rawConfig, entry.id, index),
835
975
  version: rawVersion.id,
836
976
  versionPrefix: rawVersion.routePrefix
837
977
  }
978
+ const tags = mergeBookTags(legacyTags, extractTagsFromRoutes(routes, config.id))
838
979
 
839
980
  if (!booksByVersion[rawVersion.id]) {
840
981
  booksByVersion[rawVersion.id] = {
@@ -846,13 +987,20 @@ async function loadBooksRegistry (projectRoot) {
846
987
 
847
988
  booksByVersion[rawVersion.id].books[config.id] = {
848
989
  config,
849
- routes
990
+ routes,
991
+ tags
850
992
  }
851
993
 
994
+ if (!bookTagsByVersion[rawVersion.id]) {
995
+ bookTagsByVersion[rawVersion.id] = {}
996
+ }
997
+ bookTagsByVersion[rawVersion.id][config.id] = tags || {}
998
+
852
999
  if (rawVersion.current) {
853
1000
  currentBooks[config.id] = {
854
1001
  config,
855
- routes
1002
+ routes,
1003
+ tags
856
1004
  }
857
1005
  Object.assign(allPages, routes || {})
858
1006
  }
@@ -868,6 +1016,8 @@ async function loadBooksRegistry (projectRoot) {
868
1016
  return {
869
1017
  versions,
870
1018
  booksByVersion,
1019
+ bookTagsByVersion,
1020
+ bookTags: bookTagsByVersion[currentVersion.id] || {},
871
1021
  pageEntries,
872
1022
  books: currentBooks,
873
1023
  allBooks,
@@ -2887,11 +3037,6 @@ export function createQuasarConfig (options = {}) {
2887
3037
  viteConf.resolve.alias.pages = resolve(projectRoot, 'src/pages')
2888
3038
  }
2889
3039
 
2890
- // Tags for menu search — consumer's tags if available, else package's
2891
- const consumerTags = resolve(projectRoot, 'src/i18n/tags.hjson')
2892
- const packageTags = resolve(packageRoot, 'src/i18n/tags.hjson')
2893
- viteConf.resolve.alias['@docsector/tags'] = existsSync(consumerTags) ? consumerTags : packageTags
2894
-
2895
3040
  // docsector.config.js — always from consumer/project root
2896
3041
  viteConf.resolve.alias['docsector.config.js'] = resolve(projectRoot, 'docsector.config.js')
2897
3042
 
@@ -0,0 +1,25 @@
1
+ export function matchesBookSearchTerm (bookTags = {}, locale, path, term, fallbackLocale = 'en-US') {
2
+ const normalizedTerm = String(term || '').trim().toLowerCase()
3
+ if (!normalizedTerm) return false
4
+
5
+ const normalizedPath = String(path || '').trim()
6
+ if (!normalizedPath) return false
7
+
8
+ const localeTags = bookTags?.[locale]
9
+ const localeTagText = localeTags?.[normalizedPath]
10
+
11
+ if (typeof localeTagText === 'string' && localeTagText.toLowerCase().includes(normalizedTerm)) {
12
+ return true
13
+ }
14
+
15
+ if (locale !== fallbackLocale) {
16
+ const fallbackTags = bookTags?.[fallbackLocale]
17
+ const fallbackTagText = fallbackTags?.[normalizedPath]
18
+
19
+ if (typeof fallbackTagText === 'string' && fallbackTagText.toLowerCase().includes(normalizedTerm)) {
20
+ return true
21
+ }
22
+ }
23
+
24
+ return false
25
+ }
Binary file
@@ -1,46 +0,0 @@
1
- {
2
- "en-US": {
3
- "/guide/getting-started": "install setup start begin quick project structure",
4
- "/guide/configuration": "config branding logo name version language links github docsector.config.js",
5
- "/guide/pages-and-routing": "pages routes routing registry menu navigation path type status subpages",
6
- "/guide/i18n-and-markdown": "i18n internationalization language locale hjson markdown content translation",
7
- "/guide/alerts-and-blockquotes": "alerts blockquotes github note tip important warning caution markdown quote admonition",
8
- "/guide/theming": "theme dark light mode color css sass variables styling",
9
- "/guide/deployment": "deploy hosting production build static nginx netlify vercel github pages",
10
- "/guide/plugins": "plugins extensions addons customize",
11
- "/manual/components/d-page": "page container scroll toolbar drawer layout subpage tabs",
12
- "/manual/components/d-subpage": "subpage wrapper composition dh1 section hash",
13
- "/manual/components/d-page-section": "section markdown renderer tokenizer parser heading paragraph list table code",
14
- "/manual/components/d-headings": "h1 h2 h3 h4 h5 h6 heading title anchor navigation toc",
15
- "/manual/components/d-page-source-code": "code syntax highlight prism php bash html copy clipboard line numbers",
16
- "/manual/components/d-page-blockquote": "blockquote important warning note quote",
17
- "/manual/components/d-menu": "menu sidebar navigation search branding links tree expansion",
18
- "/manual/components/d-page-anchor": "anchor toc table contents tree drawer navigation scroll",
19
- "/manual/components/d-page-meta": "meta footer edit github translation progress prev next navigation",
20
- "/manual/components/q-zoom": "zoom overlay fullscreen scale mouse wheel escape",
21
- "/manual/composables/use-navigator": "navigator composable anchor scroll register navigate toc",
22
- "/manual/store/modules": "vuex store state mutations getters actions app i18n page layout settings"
23
- },
24
- "pt-BR": {
25
- "/guide/getting-started": "instalar configurar iniciar começar rápido projeto estrutura",
26
- "/guide/configuration": "config branding logo nome versão idioma links github docsector.config.js",
27
- "/guide/pages-and-routing": "páginas rotas roteamento registro menu navegação caminho tipo status subpages",
28
- "/guide/i18n-and-markdown": "i18n internacionalização idioma locale hjson markdown conteúdo tradução",
29
- "/guide/alerts-and-blockquotes": "alertas blockquotes github note tip important warning caution markdown citação admonition",
30
- "/guide/theming": "tema escuro claro modo cor css sass variáveis estilização",
31
- "/guide/deployment": "deploy hospedagem produção build estático nginx netlify vercel github pages",
32
- "/guide/plugins": "plugins extensões complementos customizar",
33
- "/manual/components/d-page": "página container scroll toolbar drawer layout subpágina abas",
34
- "/manual/components/d-subpage": "subpágina wrapper composição dh1 seção hash",
35
- "/manual/components/d-page-section": "seção markdown renderizador tokenizador parser título parágrafo lista tabela código",
36
- "/manual/components/d-headings": "h1 h2 h3 h4 h5 h6 título heading âncora navegação toc",
37
- "/manual/components/d-page-source-code": "código sintaxe highlight prism php bash html copiar clipboard números linha",
38
- "/manual/components/d-page-blockquote": "blockquote importante aviso nota citação",
39
- "/manual/components/d-menu": "menu lateral navegação busca branding links árvore expansão",
40
- "/manual/components/d-page-anchor": "âncora toc índice conteúdo árvore drawer navegação scroll",
41
- "/manual/components/d-page-meta": "meta rodapé editar github tradução progresso anterior próximo navegação",
42
- "/manual/components/q-zoom": "zoom overlay tela cheia escala roda mouse escape",
43
- "/manual/composables/use-navigator": "navegador composable âncora scroll registro navegar toc",
44
- "/manual/store/modules": "vuex store estado mutations getters actions app i18n page layout settings"
45
- }
46
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes