@brillout/docpress 0.16.50 → 0.17.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.
@@ -30,9 +30,11 @@ function Link({
30
30
  href.startsWith('/') || href.startsWith('#'),
31
31
  `<Link href /> prop \`href==='${href}'\` but should start with '/' or '#'`,
32
32
  )
33
- assertUsage(!text || !children, 'Cannot use both `text` or `children`')
34
- // assertWarning(!text, 'prop `text` is deprecated')
35
- text = text ?? children
33
+ assertUsage(
34
+ !text,
35
+ 'The `text` prop of `<Link>` is deprecated, use `<Link>...</Link>` instead of `<Link text="..." />`',
36
+ )
37
+ text = children
36
38
 
37
39
  const linkTextData = getLinkTextData({ href, pageContext, doNotInferSectionTitle, noWarning })
38
40
  if (!text) {
@@ -7,9 +7,8 @@ import pc from '@brillout/picocolors';
7
7
  function Link({ href, text, noBreadcrumb, doNotInferSectionTitle, noWarning, children, ...props }) {
8
8
  const pageContext = usePageContext();
9
9
  assertUsage(href.startsWith('/') || href.startsWith('#'), `<Link href /> prop \`href==='${href}'\` but should start with '/' or '#'`);
10
- assertUsage(!text || !children, 'Cannot use both `text` or `children`');
11
- // assertWarning(!text, 'prop `text` is deprecated')
12
- text = text ?? children;
10
+ assertUsage(!text, 'The `text` prop of `<Link>` is deprecated, use `<Link>...</Link>` instead of `<Link text="..." />`');
11
+ text = children;
13
12
  const linkTextData = getLinkTextData({ href, pageContext, doNotInferSectionTitle, noWarning });
14
13
  if (!text) {
15
14
  if (linkTextData) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/docpress",
3
- "version": "0.16.50",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@brillout/picocolors": "^1.0.10",