@docsector/docsector-reader 3.6.0 → 4.0.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 (56) hide show
  1. package/README.md +15 -15
  2. package/bin/docsector.js +1 -283
  3. package/package.json +1 -1
  4. package/src/components/{DPageBlockquote.vue → DBlockBlockquote.vue} +4 -0
  5. package/src/components/{DBlockCard.vue → DBlockCards.vue} +1 -1
  6. package/src/components/{DPageEmbeddedUrl.vue → DBlockEmbeddedUrl.vue} +1 -1
  7. package/src/components/{DPageExpandable.vue → DBlockExpandable.vue} +5 -0
  8. package/src/components/{DPageFile.vue → DBlockFile.vue} +1 -1
  9. package/src/components/{DPageImage.vue → DBlockImage.vue} +1 -1
  10. package/src/components/{DMermaidDiagram.vue → DBlockMermaidDiagram.vue} +4 -0
  11. package/src/components/{DQuickLinks.vue → DBlockQuickLinks.vue} +4 -0
  12. package/src/components/{DPageSourceCode.vue → DBlockSourceCode.vue} +6 -1
  13. package/src/components/DBlockStepper.vue +210 -0
  14. package/src/components/DBlockTimeline.vue +319 -0
  15. package/src/components/DPageSection.vue +5 -0
  16. package/src/components/DPageTokens.vue +56 -21
  17. package/src/components/DSubpage.vue +14 -2
  18. package/src/components/page-section-tokens.js +273 -10
  19. package/src/composables/useActiveAnchor.js +42 -0
  20. package/src/composables/useNavigator.js +24 -17
  21. package/src/home-page-mode.js +5 -0
  22. package/src/i18n/languages/en-US.hjson +5 -0
  23. package/src/i18n/languages/pt-BR.hjson +5 -0
  24. package/src/pages/guide/i18n-and-markdown.overview.en-US.md +6 -6
  25. package/src/pages/guide/i18n-and-markdown.overview.pt-BR.md +6 -6
  26. package/src/pages/guide/theming.overview.en-US.md +1 -1
  27. package/src/pages/guide/theming.overview.pt-BR.md +1 -1
  28. package/src/pages/manual/basic/d-page-anchor.overview.en-US.md +1 -1
  29. package/src/pages/manual/basic/d-page-anchor.overview.pt-BR.md +1 -1
  30. package/src/pages/manual/content/blocks/embedded-urls.overview.en-US.md +3 -3
  31. package/src/pages/manual/content/blocks/embedded-urls.overview.pt-BR.md +3 -3
  32. package/src/pages/manual/content/blocks/embedded-urls.showcase.en-US.md +8 -8
  33. package/src/pages/manual/content/blocks/embedded-urls.showcase.pt-BR.md +8 -8
  34. package/src/pages/manual/content/blocks/expandable.overview.en-US.md +8 -8
  35. package/src/pages/manual/content/blocks/expandable.overview.pt-BR.md +8 -8
  36. package/src/pages/manual/content/blocks/expandable.showcase.en-US.md +6 -6
  37. package/src/pages/manual/content/blocks/expandable.showcase.pt-BR.md +6 -6
  38. package/src/pages/manual/content/blocks/files.overview.en-US.md +3 -3
  39. package/src/pages/manual/content/blocks/files.overview.pt-BR.md +3 -3
  40. package/src/pages/manual/content/blocks/files.showcase.en-US.md +5 -5
  41. package/src/pages/manual/content/blocks/files.showcase.pt-BR.md +5 -5
  42. package/src/pages/manual/content/blocks/quick-links.overview.en-US.md +4 -4
  43. package/src/pages/manual/content/blocks/quick-links.overview.pt-BR.md +4 -4
  44. package/src/pages/manual/content/blocks/quick-links.showcase.en-US.md +9 -9
  45. package/src/pages/manual/content/blocks/quick-links.showcase.pt-BR.md +9 -9
  46. package/src/pages/manual/content/blocks/stepper.overview.en-US.md +59 -0
  47. package/src/pages/manual/content/blocks/stepper.overview.pt-BR.md +59 -0
  48. package/src/pages/manual/content/blocks/stepper.showcase.en-US.md +115 -0
  49. package/src/pages/manual/content/blocks/stepper.showcase.pt-BR.md +115 -0
  50. package/src/pages/manual/content/blocks/timeline.overview.en-US.md +47 -0
  51. package/src/pages/manual/content/blocks/timeline.overview.pt-BR.md +47 -0
  52. package/src/pages/manual/content/blocks/timeline.showcase.en-US.md +170 -0
  53. package/src/pages/manual/content/blocks/timeline.showcase.pt-BR.md +170 -0
  54. package/src/pages/manual.index.js +56 -0
  55. package/src/quasar.factory.js +13 -11
  56. package/src/store/Page.js +4 -2
@@ -683,6 +683,62 @@ export default {
683
683
  }
684
684
  },
685
685
 
686
+ '/content/blocks/stepper': {
687
+ config: {
688
+ icon: 'format_list_numbered',
689
+ status: 'new',
690
+ meta: {
691
+ description: {
692
+ 'en-US': 'Stepper — Documentation of Docsector Reader',
693
+ 'pt-BR': 'Stepper — Documentação do Docsector Reader'
694
+ }
695
+ },
696
+ book: 'manual',
697
+ menu: {},
698
+ subpages: {
699
+ showcase: true
700
+ }
701
+ },
702
+ data: {
703
+ 'en-US': { title: 'Stepper' },
704
+ 'pt-BR': { title: 'Stepper' }
705
+ },
706
+ metadata: {
707
+ tags: {
708
+ 'en-US': 'stepper steps walkthrough tutorial numbered sequence guide process gitbook',
709
+ 'pt-BR': 'stepper etapas passo a passo tutorial sequência numerada guia processo gitbook'
710
+ }
711
+ }
712
+ },
713
+
714
+ '/content/blocks/timeline': {
715
+ config: {
716
+ icon: 'timeline',
717
+ status: 'new',
718
+ meta: {
719
+ description: {
720
+ 'en-US': 'Timeline — Documentation of Docsector Reader',
721
+ 'pt-BR': 'Timeline — Documentação do Docsector Reader'
722
+ }
723
+ },
724
+ book: 'manual',
725
+ menu: {},
726
+ subpages: {
727
+ showcase: true
728
+ }
729
+ },
730
+ data: {
731
+ 'en-US': { title: 'Timeline' },
732
+ 'pt-BR': { title: 'Linha do tempo' }
733
+ },
734
+ metadata: {
735
+ tags: {
736
+ 'en-US': 'timeline updates changelog release notes chronology tags anchor gitbook',
737
+ 'pt-BR': 'timeline linha do tempo atualizações changelog notas de versão cronologia tags âncora gitbook'
738
+ }
739
+ }
740
+ },
741
+
686
742
  '/content/blocks/tables': {
687
743
  config: {
688
744
  icon: 'table_chart',
@@ -1504,7 +1504,7 @@ async function fetchRemoteMarkdown (url, timeoutMs = 8000) {
1504
1504
  }
1505
1505
  }
1506
1506
 
1507
- async function resolveHomePageSources (projectRoot, config = {}, options = {}) {
1507
+ export async function resolveHomePageSources (projectRoot, config = {}, options = {}) {
1508
1508
  const { logPrefix = '[docsector]' } = options
1509
1509
  const pagesDir = resolve(projectRoot, 'src', 'pages')
1510
1510
  const { defaultLang, langs } = getConfiguredLanguages(config)
@@ -1551,18 +1551,17 @@ async function resolveHomePageSources (projectRoot, config = {}, options = {}) {
1551
1551
  function createHomePageOverridePlugin (projectRoot) {
1552
1552
  const virtualId = 'virtual:docsector-homepage-override'
1553
1553
  const resolvedId = '\0' + virtualId
1554
- let byLang = null
1554
+ let homePageSources = null
1555
1555
  let loadPromise = null
1556
1556
 
1557
1557
  const ensureSources = async () => {
1558
- if (byLang) return byLang
1558
+ if (homePageSources) return homePageSources
1559
1559
  if (!loadPromise) {
1560
1560
  loadPromise = (async () => {
1561
1561
  const configUrl = pathToFileURL(resolve(projectRoot, 'docsector.config.js')).href
1562
1562
  const { default: config } = await import(configUrl)
1563
- const sources = await resolveHomePageSources(projectRoot, config, { logPrefix: '[docsector]' })
1564
- byLang = sources.byLang
1565
- return byLang
1563
+ homePageSources = await resolveHomePageSources(projectRoot, config, { logPrefix: '[docsector]' })
1564
+ return homePageSources
1566
1565
  })().finally(() => {
1567
1566
  loadPromise = null
1568
1567
  })
@@ -1586,18 +1585,21 @@ function createHomePageOverridePlugin (projectRoot) {
1586
1585
  },
1587
1586
  async load (id) {
1588
1587
  if (id === resolvedId) {
1589
- await ensureSources()
1590
- return `export default ${JSON.stringify(byLang || {})}`
1588
+ const sources = await ensureSources()
1589
+ return [
1590
+ `export const homePageSourceMode = ${JSON.stringify(sources?.mode || 'local')}`,
1591
+ `export default ${JSON.stringify(sources?.byLang || {})}`
1592
+ ].join('\n')
1591
1593
  }
1592
1594
 
1593
- await ensureSources()
1594
- if (!byLang) return null
1595
+ const sources = await ensureSources()
1596
+ if (!sources?.byLang) return null
1595
1597
 
1596
1598
  const match = id.match(/Homepage\.([A-Za-z0-9-]+)\.md\?raw(?:$|&)/)
1597
1599
  if (!match) return null
1598
1600
 
1599
1601
  const lang = match[1]
1600
- const content = byLang[lang]
1602
+ const content = sources.byLang[lang]
1601
1603
  if (typeof content !== 'string') return null
1602
1604
 
1603
1605
  return `export default ${JSON.stringify(content)}`
package/src/store/Page.js CHANGED
@@ -46,7 +46,7 @@ export default {
46
46
  pushAnchors (state, value) {
47
47
  if (value === false) {
48
48
  state.anchors = []
49
- } else {
49
+ } else if (!state.anchors.includes(value)) {
50
50
  // index: id
51
51
  state.anchors.push(value)
52
52
  }
@@ -82,7 +82,9 @@ export default {
82
82
  state.nodesExpanded = [0]
83
83
  },
84
84
  pushNodesExpanded (state, nodeId) {
85
- state.nodesExpanded.push(nodeId)
85
+ if (!state.nodesExpanded.includes(nodeId)) {
86
+ state.nodesExpanded.push(nodeId)
87
+ }
86
88
  },
87
89
 
88
90
  setScrolling (state, val) {