Commit graph

334 commits

Author SHA1 Message Date
Oliver Ullman
1366c31201
feat(core): allow sourcing from multiple static directories (#4095)
* [WIP] Implementaion of multiple directory static sourcing

* Move default to validation

* Update test

* Refactor

* Port to MDX loader

* Fix

* Move dogfooding assets

* Doc writeup

* Restore assets

* Support absolute paths

* Dogfood absolute path

* Fix

* More tests

* Fix snapshots

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2021-11-18 22:26:26 +08:00
Joshua Chen
0374426ce3
chore: upgrade TypeScript & other ESLint related deps (#5963)
* chore: upgrade ESLint related deps

* Upgrade TS

* Fix lock

* Bump Babel

* Update config
2021-11-18 21:15:37 +08:00
Armano
2f7d6fea1e
refactor(content-docs): move isCategoriesShorthand to utils (#5962) 2021-11-18 08:25:07 +08:00
Joshua Chen
c5feac6ba2
refactor: move deps declarations into src (#5946) 2021-11-14 13:35:15 +08:00
Joshua Chen
d1308a8736
refactor: improve setup of type declaration files (#5914) 2021-11-12 17:47:27 +01:00
Swalah Amani
c541e2d83c
misc: replace all "Metadatas" with "Metadata" (#5871)
Co-authored-by: Josh-Cena <sidachen2003@gmail.com>
2021-11-09 19:46:10 +01:00
Joshua Chen
f12c390a17
fix(content-docs): do not echo git history to console (#5906) 2021-11-08 21:03:21 +08:00
Joshua Chen
a835c9bc48
misc(plugin-docs): fix Windows test snapshot for git history retrieval (#5905)
* misc(plugin-docs): fix test snapshot

* Fix again
2021-11-08 17:09:58 +08:00
Joshua Chen
334b4397e7
refactor(content-docs): use shelljs instead of execa (#5904) 2021-11-08 15:33:06 +08:00
Joshua Chen
1363a25819
refactor: use js-yaml to parse both JSON and YAML (#5806) 2021-11-03 17:55:14 +01:00
Alexey Pyltsyn
91ec2509b7
chore: prepare v2.0.0-beta.9 release (#5859)
* chore: prepare v2.0.0-beta.9 release

* v2.0.0-beta.9
2021-11-02 20:40:01 +03:00
Sébastien Lorber
3b66c68e92
feat: Support Node 17 (#5814) 2021-10-29 17:21:01 +02:00
Avi Vahl
96da25e422
feat(core): upgrade to webpack-dev-server@4 (#5420)
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-10-28 18:06:20 +02:00
Sébastien Lorber
1ce6253cc1
chore: require Node 14 (#5812) 2021-10-28 17:11:25 +02:00
Joshua Chen
7a6607cfa1
refactor: remove a few Lodash usages & ESLint enforcement (#5807)
* refactor: remove some lodash usage

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Enforce ESLint

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* More forbids

* Fixup

* Fix

* Fix website
2021-10-28 12:48:58 +08:00
Joshua Chen
68c970175a
refactor: migrate lqip-loader to TS, fix typing for Webpack Loaders (#5779) 2021-10-27 16:38:11 +02:00
Sébastien Lorber
68a116611f
chore: prepare v2.0.0-beta.8 release (#5762) 2021-10-21 18:52:17 +02:00
Joshua Chen
3127f12654
feat(content-docs): new front matter options to customize pagination (#5705) 2021-10-21 12:27:57 +02:00
Alexey Pyltsyn
877373e108
chore: prepare v2.0.0-beta.7 release (#5713)
* chore: prepare v2.0.0-beta.7 release

* v2.0.0-beta.7
2021-10-15 16:31:01 +03:00
Joshua Chen
8d92e9bcf5
refactor(content-docs): refactor sidebars, Joi validation, generator rework, expose config types (#5678) 2021-10-14 14:38:26 +02:00
Joshua Chen
eaacb0e98a
feat(theme-classic, plugin-docs): sidebar item level-specific className + allow customization (#5642)
* Initial work

* Complete function

* Avoid duplication

* More dedupe

* Make everything constants

* Change casing & docs
2021-10-07 16:59:02 +02:00
Joshua Chen
7f7b858cd4
refactor: make all Props defined as interface + readonly (#5636)
* Initial work

* Fix
2021-10-05 19:04:24 +02:00
Bharat Middha
09550b0535
feat: properly type-check the Docusaurus config of new sites (#5589)
* fix: makes types DocusaurusConfig optional to match docs

* add UserDocusaurusConfig with required keys for user config

* convert UserDocusaurusConfig to use util type

* Docusaurus website config should be type-checked by CI + fix all existing issues

* add doc for config typechecking

* Update template configs for TS autocompletion

* fix last config typechecking bugs

* reapply prettier

* reapply prettier-docs

* Fix TS doc: add missing ()

* fix some docu plugin types

* add "const config" for simpler jsdoc annotation

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-09-30 17:49:44 +02:00
Joshua Chen
3f1f8255a2
chore: upgrade Prettier + regenerate lock file (#5611)
* Bump deps

* Run prettier

* Format docs

* Minor refactor

* Collapse objects

* Fix type

* Update lock file
2021-09-30 12:54:17 +02:00
Erick Zhao
c86dfbda61
feat(v2): allow specifying TOC max depth (themeConfig + frontMatter) (#5578)
* feat: add all TOC levels to MDX loader

* feat: add theme-level config for heading depth

* test: add remark MDX loader test

* fix: limit maxDepth validation to H2 - H6

* refactor: set default `maxDepth` using `joi`

* refactor: `maxDepth` -> `maxHeadingLevel

* refactor: invert underlying TOC depth API

* refactor: make TOC algorithm level-aware

* feat: add support for per-doc TOC heading levels

* feat: support document-level heading levels for blog

* fix: correct validation for toc level frontmatter

* fix: ensure TOC doesn't generate redundant DOM

* perf: simpler TOC heading search alg

* docs: document heading level props for `TOCInline`

* Update website/docs/guides/markdown-features/markdown-features-inline-toc.mdx

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* docs: fix docs (again)

* create dedicated  test file for heading searching logic: exhaustive tests will be simpler to write

* toc search: add real-world test

* fix test

* add dogfooding tests for toc min/max

* add test for min/max toc frontmatter

* reverse min/max order

* add theme minHeadingLevel + tests

* simpler TOC rendering logic

* simplify TOC implementation (temp, WIP)

* reverse unnatural order for minHeadingLevel/maxHeadingLevel

* add TOC dogfooding tests to all content plugins

* expose toc min/max heading level frontmatter to all 3 content plugins

* refactor blogLayout: accept toc ReactElement directly

* move toc utils to theme-common

* add tests for filterTOC

* create new generic TOCItems component

* useless css file copied

* fix toc highlighting className conflicts

* update doc

* fix types

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-09-29 11:19:11 +02:00
Alexey Pyltsyn
b62a12bfc6
chore: upgrade dependencies (#5608)
* chore: upgrade dependencies

* Revert github-slugger

* Fixes

* Update snapshots

* Update Babel deps
2021-09-24 16:36:41 +02:00
Alexey Pyltsyn
e66e045b74
fix(docs): create tags route if only tags exists (#5606) 2021-09-23 13:02:54 +02:00
Alexey Pyltsyn
29e06d0677
feat: make tags route path configurable (#5545) 2021-09-21 19:19:18 +02:00
Joshua Chen
a839966cd2
polish: remove unused eslint-disable (#5560)
* fix eslint

* Add report unused disable to CI

* Fix two anys
2021-09-21 18:07:54 +02:00
swyx
194f429c1f
fix: add docs tag validation to solve #5478 (#5479)
* fix: add docs tag validation to solve #5478

fix: add docs tag validation to solve #5478

* Update docFrontMatter.ts

* Update docs-create-doc.mdx

* improve tag validation error messages + tests

* improve tags doc

* fix test

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-09-03 14:43:24 +02:00
Sébastien Lorber
2611bbb501
chore(v2): prepare v2.0.0-beta.6 release (#5473)
* add beta.6

* v2.0.0-beta.6
2021-09-02 18:31:42 +02:00
Joshua Chen
78d84006bb
refactor(theme-classic): completely migrate package to TypeScript (#5459)
* Migrate

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Migrate prism as well

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fix

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fix lock file

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fix typing

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* refactor a bit CodeBlock

* simplify versionBanner typing => use null instead of "none" (apart plugin options for retrocompatibility)

* Remove return signatures

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-09-01 14:34:26 +02:00
Sébastien Lorber
553f914639
feat: TypeScript presets/plugins should expose Options typing (#5456)
* each TS plugin should export option types + preset export option / themeConfig types + remove TS typechecking for the bootstrap theme

* each TS plugin should export option types + preset export option / themeConfig types + remove TS typechecking for the bootstrap theme

* fix remaining TS errors

* fix remaining TS errors

* TS fix

* Add JSDoc type annotations to init templates and TS docs

* missing title char
2021-09-01 12:14:40 +02:00
Sébastien Lorber
42e70e6d42
feat: new docs options: versions.{badge,className} (#5454)
* docs: add versions.{badge,className} options

* remove badge option test
2021-08-31 15:40:37 +02:00
Joshua Chen
df3752cc71
fix: fix a few TS errors (#5437)
* fix errors

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fix website

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Revert adding lib

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fix tsconfig

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Restore previous ordering

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* exclude sw.js from typechecking

* Tests: include typechecking of website

* cleanup @site/ alias in TS config

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-08-30 13:06:00 +02:00
Sébastien Lorber
f600d5a6d7
chore: prepare v2.0.0-beta.5 release (#5427)
* beta.5

* v2.0.0-beta.5
2021-08-26 17:33:31 +02:00
Joshua Chen
493225a3c6
feat(plugin-blog): multi-authors support + authors.yml global configuration (#5396)
* Complete function

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* A lot of blank lines

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* More lenient validation

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Remove or

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Simpler logic

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Expand docs

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Better docs

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Dogfood

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* More writeup

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Polish

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Polish

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Move mergeAuthorMap to authors.ts

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Unbreak relative assets

* Update docs

* Clarify in docs

* simplify feed authors

* rename authorMap -> authorsMap

* mergeAuthorsMap -> getBlogPostAuthors

* website => 5 blog posts per page

* improve authors map file

* Extract new theme authors components + display in row

* add comment for meta array syntaxes

* blog => getPathsToWatch should watch authorsMap file

* remove useless v1 blog FBID frontmatter

* keep older frontmatter syntax for now

* revert blog frontmatter

* Better console message

* better blog authors frontmatter impl

* add multi authors to beta blog post + fix some authors margins

* fix React key

* Refactor: mdx loader should support a more flexible assets system (poc, not documented yet)

* better display of blog post authors: adapt layout to authors count + add line clamp

* smaller local image

* fix blog feed tests

* fix blog frontmatter tests + improve validation schema

* add more frontmatter tests

* add tests for getAuthorsMapFilePath

* tests for validateAuthorsMapFile

* add tests for readAuthorsMapFile

* test getAuthorsMap

* exhaustive tests for getBlogPostAuthors

* fix remaining tests

* missing blog plugin author tests

* fix windows tests

* improve blog multi-author's doc

* Use new format in init template

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Improve error message

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* update feed snapshot

* blog authors: limit to 2 cols + fix margins for no authors

* minor doc improvements

* better init template blog posts, demonstrating Blog features

* replace the legacy blog author frontmatter in remaining places

* Prefer using clsx

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* cleanup getColClassName

* remove blog author name/title line-clamping

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-08-26 12:21:58 +02:00
John Reilly
08597045ed
feat: add metatags support for seo / blogposts #5373 (#5375)
* feat: add metatags support for seo / blogposts

* feat: different implementation

* feat: use isBlogPostPage

* feat: implement in BlogPostPage-remove Seo changes

* Revert "feat: implement in BlogPostPage-remove Seo changes"

This reverts commit 1cba459b

* Move Seo to BlogPostPage + some fixes

* fix social preview asset

* Fix blog social image + improve a bit Seo setup

* fix bootstrap theme

Co-authored-by: John <john.reilly@investec.co.uk>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-08-20 16:36:18 +02:00
Isaac Philip
f9c79cbd58
feat: doc tags (same as blog tags) (#3646)
* [v2] tags to doc, same as tags to blog - [IN PROGRESS]

- Addition of plugin-content-docs

- Addition of DocTagsListPage in `docusaurus-theme-classic`

! Error exists for this commit towards the theme aspect and help required.

Commit towards #3434

* docs: make tags list page work

* temp: disable onBrokenLinks

* theme bootstrap: create DocTagsListPage

* DocTagsPage added and functionality too

- individual doc tag page added to show docs for that specific tag

* Added all Docs Tags Link

* add some shared tag utils

* move tag tests to _dogfooding

* fix type

* fix some tests

* fix blog test

* refactor blog post tags handling

* better yaml tag examples

* better dogfood md files

* refactor and factorize theme tag components

* finish DocTagDocListPage

* Extract DocItemFooter + add inline tag list

* minor fix

* better typings

* fix versions.test.ts tests

* add tests for doc tags

* fix tests

* test toTagDocListProp

* move shared theme code to tagUtils

* Add new theme translation keys

* move common theme code to tagUtils + add tests

* update-code-translations should handle theme-common

* update french translation

* revert add translation

* fix pluralization problem in theme.docs.tagDocListPageTitle

* add theme component configuration options

* add more tags tests

* add documentation for docs tagging

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-08-19 10:31:15 +02:00
Paul O’Shannessy
8341527fc9
refactor: rename Git master branch to main (#5345)
* Prepare to renaming master branch to main

* Update CONTRIBUTING.md

* Update packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/package.json

* Update packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/package.json

* Update packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/package.json

* missing master -> main replaces

* useless char

* For GH Pages org deploy, DEPLOYMENT_BRANCH env is now required

* fix versioning page

* fix vercel links

* update deployment.mdx

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-08-17 18:41:53 +02:00
Joshua Chen
ee6ebc4877
refactor: better typing + remove unnecessary eslint-disable (#5335)
* Initial work

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fix a few errors

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Restore default value

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Update docs

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Use custom route config

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Address a few suggestions

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Revert logo change

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Restore key

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Oops

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Remove use of any

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Remove eslint-disable

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Put type reference back

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Remove

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
2021-08-11 16:07:17 +02:00
Joshua Chen
0a668366c2
refactor: properly type docs version (#5284)
* Type docs version

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Move non-null assertions

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Test again
2021-08-05 10:52:35 +02:00
Joshua Chen
650f989dbb
fix: fix various TS errors (#5261)
* Fix import errors

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Oops

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Mark contentLoaded async

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
2021-08-02 11:02:43 +02:00
Sébastien Lorber
fc64c12e41
chore(v2): prepare v2.0.0-beta.4 release (#5238)
* chore(v2): prepare v2.0.0-beta.4 release

* update publish

* v2.0.0-beta.4
2021-07-28 22:54:41 +02:00
Sébastien Lorber
083037d7a5
refactor: redesign admonitions/callouts/quotes (#5193)
* prepare admonitions redesign

* Docusaurus admonition cleanup

* cover more edge cases in Docusaurus admonitions page: interleaving code blocks and links

* cover more edge cases in Docusaurus admonitions page: interleaving code blocks and links

* update Infima with new alerts
2021-07-23 17:10:38 +02:00
Joshua Chen
24156efcfb
feat: docs plugin options sidebarCollapsible + sidebarCollapsed (#5203)
* Add prop

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Add `collapsible` option to sidebar item

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Add eslint-ignore

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Move new page

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Allow in autogenerated

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fix tests

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Move config options to plugin-docs

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Make non-collapsible items always expanded

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* docs versioning cli should receive a single options object

* Update cli.test.ts

* revert validateCategoryMetadataFile change

* remove theme usage of themeConfig.sidebarCollapsible

* better handling of sidebar item category inconsistencies + add warning message

* Update snapshot

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Handle plugin option inconsistencies

* improve doc for new sidebarCollapsible doc options

* remove warning in fixSidebarItemInconsistencies as it will be annoyed for versioned sites, as "collapsed" is already persisted in sidebar json files

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-07-23 14:24:36 +02:00
Sébastien Lorber
4d06f26c1f
fix(v2): Fix MDX docs being considered as partials when siteDir match the _ prefix convention (#5199)
* Add _ to dogfood docs folder to cover against edge case

* Fix edge case with MDX partials when site / content dir contains a _ prefix

* add globUtils tests

* proper dogfooding folder re-organization, all content plugins being used

* refactor dogfooding folder + expose /tests page index

* fix page plugin ignoring options.routeBasePath
2021-07-21 14:13:51 +02:00
Sébastien Lorber
8bdb3da233
feat(v2): generalize usage of _ prefix convention to exclude content files/folders (#5173)
* create a swizzleWarning partial for shared text

* Generalize usage of _ prefix convention to exclude content files/folders

* add api doc

* MDX loader should not expect metadata/frontmatter on MDX partial files
2021-07-15 13:21:41 +02:00
Joshua Chen
007e901354
feat(v2): allow any type of NavbarItem to be passed in a navbar dropdown (#5072)
* Initial work

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* More elegant `eslint-disable`

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fix typing

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Allow doc links in dropdown

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Allow more dropdowns to use linklike items

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Finalize

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Dogfood

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Disallow nested dropdowns

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Better typing

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Complete type fix

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Use flatmap

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Patch

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Test

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Try fix

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Style change

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Revert (to test)

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Hmmm

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* I know what's wrong

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Does this work?

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Nope

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Wrong class name

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Pass prop to render dropdown item differently

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* This looks better

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Tests passed

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Separate dropdown from default

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Pourquois?

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Better prop typing

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Make code simpler

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* There's some extra className

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Test

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* More test

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* A-ha!

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Test again?

* Add backward compatibility

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Incorporate my type fix

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Resolve conflict

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* minor refactor

* minor refactors

* allow usage of ES2019 in browser code

* revert NavLink rename

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-07-14 18:19:08 +02:00
Alexey Pyltsyn
9536ef900d
feat(v2): redesign mobile UX: inline TOC + doc sidebar in main menu (#4273)
* feat(v2): mobile TOC

* Bug fixes and various improvements

* Redesign

* extract TOCCollapsible component

* TS improvements

* Assign sidebar name directly to the doc route => no need for either permalinkToSidebar or GlobalData

* revert changes to useWindowSize, fix FOUC issues

* extract DocSidebarDesktop component

* remove now useless menu infima classes

* TOCHeadings => rename + remove unused onClick prop

* Extract DocSidebarItem

* minor renaming

* replace GlobalData usage by a React teleport system to render in the navbar mobile sidebar menu directly from the DocPage component

* useWindowSize => simulate SSR size in dev to make FOUC issues more obvious

* fix remaining sidebar layout shift

* update docs snapshots

* remove unused code translations

* remove unused code translations

* fix minor update-code-translations bug

* Add more build-size paths to watch

* Restyle back button

* Add  missing`menu` class

* extract useShallowMemoizedObject

* fix routes tests + better routes formatting

* use Translate api for labels

* use Translate api for labels

* Update translations

* Improve dark mode support for back button

* Merge branch 'master' into lex111/inline-color-code

# Conflicts:
#	packages/core/dist/css/default-dark/default-dark-rtl.min.css
#	packages/core/dist/css/default-dark/default-dark.min.css
#	packages/core/dist/css/default/default-rtl.min.css
#	packages/core/dist/css/default/default.min.css

* replace useCollapse by new useCollapsible

* Cleanup and use clean-btn for TOCCollapsible button

* Make TOC links clickable over full width

* Cleanup

* fix uncollapsible sidebar that can be collapsed + create <Collapsible> component

* dependency array typo

* rollback sidebars community commit typo

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-07-09 16:50:38 +02:00