Skip to content

Commit 2a7b554

Browse files
authored
docs: bump docusaurus (#922)
1 parent b1ee2a9 commit 2a7b554

File tree

16 files changed

+5094
-6221
lines changed

16 files changed

+5094
-6221
lines changed
Lines changed: 331 additions & 331 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
nodeLinker: node-modules
22

3-
yarnPath: .yarn/releases/yarn-4.9.4.cjs
3+
yarnPath: .yarn/releases/yarn-4.12.0.cjs

docs/babel.config.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/docs/doc-picker-api/index.md

Lines changed: 309 additions & 149 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// @ts-check
2-
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
3-
const typedocSidebar = { items: []};
2+
/** @type {import("@docusaurus/plugin-content-docs").SidebarsConfig} */
3+
const typedocSidebar = {items:[]};
44
module.exports = typedocSidebar.items;

docs/docs/doc-viewer-api/index.md

Lines changed: 53 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,62 @@
44

55
### BaseOptions
66

7-
> **BaseOptions**: \{`grantPermissions`: `"read"` \| `"write"`;`headerTitle`: `string`;`mimeType`: `string`;`presentationStyle`: [`PresentationStyle`](index.md#presentationstyle); \}
7+
> **BaseOptions** = \{ `androidApplicationId?`: `string`; `grantPermissions?`: `"read"` \| `"write"`; `headerTitle?`: `string`; `mimeType?`: `string`; `presentationStyle?`: [`PresentationStyle`](#presentationstyle-1); \}
88
9-
#### Type declaration
9+
#### Properties
1010

11-
| Name | Type | Description |
12-
| ------ | ------ | ------ |
13-
| `grantPermissions`? | `"read"` \| `"write"` | Android only: The type of permission to grant to the receiving app that will open the document. This only has effect if you're viewing a file that lives in the app's sandboxed storage. |
14-
| `headerTitle`? | `string` | iOS only: The title to display in the header of the document viewer. If not provided, the filename will be used. |
15-
| `mimeType`? | `string` | Optional, but recommended: the mimetype of the document. This will help the Android OS to find the right app(s) to open the document. |
16-
| `presentationStyle`? | [`PresentationStyle`](index.md#presentationstyle) | iOS only - Controls how the picker is presented, e.g. on an iPad you may want to present it fullscreen. Defaults to `pageSheet`. |
11+
##### androidApplicationId?
12+
13+
> `optional` **androidApplicationId**: `string`
14+
15+
Android only - Optional, only provide a value if calling [viewDocument](#viewdocument) rejects with `IllegalArgumentException`. Represents the unique identifier for an Android application. Defaults to application package name, which usually is the same as the application id.
16+
17+
##### grantPermissions?
18+
19+
> `optional` **grantPermissions**: `"read"` \| `"write"`
20+
21+
Android only: The type of permission to grant to the receiving app that will open the document.
22+
This only has an effect if you're viewing a file that lives in the app's sandboxed storage.
23+
24+
##### headerTitle?
25+
26+
> `optional` **headerTitle**: `string`
27+
28+
iOS only: The title to display in the header of the document viewer.
29+
30+
###### Default
31+
32+
```ts
33+
the file name.
34+
```
35+
36+
##### mimeType?
37+
38+
> `optional` **mimeType**: `string`
39+
40+
Optional, but strongly recommended: the mimetype of the document. This helps the Android OS to find the right app(s) to open the document.
41+
42+
##### presentationStyle?
43+
44+
> `optional` **presentationStyle**: [`PresentationStyle`](#presentationstyle-1)
45+
46+
iOS only - Controls how the picker is presented, e.g. on an iPad you may want to present it fullscreen.
47+
48+
###### Default
49+
50+
`pageSheet`.
1751

1852
***
1953

2054
### OptionsViewBookmark
2155

22-
> **OptionsViewBookmark**: [`BaseOptions`](index.md#baseoptions) & \{`bookmark`: `string`; \}
56+
> **OptionsViewBookmark** = [`BaseOptions`](#baseoptions) & \{ `bookmark`: `string`; \}
2357
2458
BaseOptions with the bookmark data from the DocumentPicker module. Obtain the bookmark using the "open" mode, with `requestLongTermAccess` flag set to true.
2559

2660
A bookmark enables long-term access to a file.
2761

28-
#### Type declaration
62+
#### Type Declaration
2963

3064
| Name | Type | Description |
3165
| ------ | ------ | ------ |
@@ -35,11 +69,11 @@ A bookmark enables long-term access to a file.
3569

3670
### OptionsViewUri
3771

38-
> **OptionsViewUri**: [`BaseOptions`](index.md#baseoptions) & \{`uri`: `string`; \}
72+
> **OptionsViewUri** = [`BaseOptions`](#baseoptions) & \{ `uri`: `string`; \}
3973
4074
BaseOptions with the uri of the document to view
4175

42-
#### Type declaration
76+
#### Type Declaration
4377

4478
| Name | Type | Description |
4579
| ------ | ------ | ------ |
@@ -49,15 +83,15 @@ BaseOptions with the uri of the document to view
4983

5084
### PresentationStyle
5185

52-
> **PresentationStyle**: `"fullScreen"` \| `"pageSheet"` \| `"formSheet"` \| `"overFullScreen"` \| `undefined`
86+
> **PresentationStyle** = `"fullScreen"` \| `"pageSheet"` \| `"formSheet"` \| `"overFullScreen"` \| `undefined`
5387
5488
iOS only. Configure the presentation style of the picker.
5589

5690
***
5791

5892
### ViewDocumentOptions
5993

60-
> **ViewDocumentOptions**: [`OptionsViewBookmark`](index.md#optionsviewbookmark) \| [`OptionsViewUri`](index.md#optionsviewuri)
94+
> **ViewDocumentOptions** = [`OptionsViewBookmark`](#optionsviewbookmark) \| [`OptionsViewUri`](#optionsviewuri)
6195
6296
options for viewing a document
6397

@@ -67,21 +101,13 @@ If you're trying to open a file that you have long-term permission to access, yo
67101

68102
### errorCodes
69103

70-
> `const` **errorCodes**: `Readonly`\<\{`IN_PROGRESS`: `"ASYNC_OP_IN_PROGRESS"`;`OPERATION_CANCELED`: `"OPERATION_CANCELED"`;`UNABLE_TO_OPEN_FILE_TYPE`: `"UNABLE_TO_OPEN_FILE_TYPE"`; \}\>
71-
72-
#### Type declaration
73-
74-
| Name | Type |
75-
| ------ | ------ |
76-
| `IN_PROGRESS` | `"ASYNC_OP_IN_PROGRESS"` |
77-
| `OPERATION_CANCELED` | `"OPERATION_CANCELED"` |
78-
| `UNABLE_TO_OPEN_FILE_TYPE` | `"UNABLE_TO_OPEN_FILE_TYPE"` |
104+
> `const` **errorCodes**: `Readonly`\<\{ `NULL_PRESENTER`: `"NULL_PRESENTER"`; `UNABLE_TO_OPEN_FILE_TYPE`: `"UNABLE_TO_OPEN_FILE_TYPE"`; \}\>
79105
80106
## Functions
81107

82108
### isErrorWithCode()
83109

84-
> **isErrorWithCode**(`error`: `any`): `error is NativeModuleError`
110+
> **isErrorWithCode**(`error`: `unknown`): `error is NativeModuleError`
85111
86112
TypeScript helper to check if an object has the `code` property.
87113
This is used to avoid `as` casting when you access the `code` property on errors returned by the module.
@@ -90,7 +116,7 @@ This is used to avoid `as` casting when you access the `code` property on errors
90116

91117
| Parameter | Type |
92118
| ------ | ------ |
93-
| `error` | `any` |
119+
| `error` | `unknown` |
94120

95121
#### Returns
96122

@@ -100,13 +126,13 @@ This is used to avoid `as` casting when you access the `code` property on errors
100126

101127
### viewDocument()
102128

103-
> **viewDocument**(`data`: [`ViewDocumentOptions`](index.md#viewdocumentoptions)): `Promise`\<`null`\>
129+
> **viewDocument**(`data`: [`ViewDocumentOptions`](#viewdocumentoptions)): `Promise`\<`null`\>
104130
105131
#### Parameters
106132

107133
| Parameter | Type |
108134
| ------ | ------ |
109-
| `data` | [`ViewDocumentOptions`](index.md#viewdocumentoptions) |
135+
| `data` | [`ViewDocumentOptions`](#viewdocumentoptions) |
110136

111137
#### Returns
112138

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// @ts-check
2-
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
3-
const typedocSidebar = { items: []};
2+
/** @type {import("@docusaurus/plugin-content-docs").SidebarsConfig} */
3+
const typedocSidebar = {items:[]};
44
module.exports = typedocSidebar.items;

docs/docs/install.mdx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@ yarn add @react-native-documents/viewer
1717

1818
## Setting up
1919

20-
The packages are designed to support last 3 stable versions of RN. However, they very likely work with RN 0.73 and up.
21-
22-
:::warning
23-
The document picker package requires iOS 14 or later. If you use Expo, use Expo SDK >= 52 or [Expo build properties](https://docs.expo.dev/versions/latest/sdk/build-properties/#example-appjson-with-config-plugin) to update the `deploymentTarget` to `14`.
24-
25-
In regular React Native projects, use RN >= 0.76 or update the [settings in Xcode](https://stackoverflow.com/a/66798215/2070942).
26-
:::
20+
The packages are designed to support last 3 stable versions of RN. However, they very likely work with RN 0.76 and up.
2721

2822
### Expo
2923

docs/docusaurus.config.ts

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import type * as Preset from '@docusaurus/preset-classic'
55
const typedocWatch = false
66

77
const config: Config = {
8+
future: {
9+
v4: true,
10+
experimental_faster: true,
11+
},
812
title: 'React Native document picker & viewer',
913
tagline: 'Modules for picking and previewing documents in React Native applications',
1014
favicon: 'img/favicon.ico',
@@ -24,7 +28,11 @@ const config: Config = {
2428

2529
onBrokenLinks: 'throw',
2630
onBrokenAnchors: 'throw',
27-
onBrokenMarkdownLinks: 'throw',
31+
markdown: {
32+
hooks: {
33+
onBrokenMarkdownLinks: 'throw',
34+
},
35+
},
2836

2937
// Even if you don't use internationalization, you can use this field to set
3038
// useful metadata like html lang. For example, if your site is Chinese, you
@@ -63,6 +71,15 @@ const config: Config = {
6371
// themes: ['min-light', 'nord'],
6472
// },
6573
// ],
74+
[
75+
'docusaurus-plugin-llms',
76+
{
77+
// Enable both content cleaning options for optimal LLM output
78+
ignoreFiles: ['license**', 'other-libs**'],
79+
fullContent: true,
80+
removeDuplicateHeadings: true,
81+
},
82+
],
6683
...(process.env.ENABLE_DOC_GEN === 'true'
6784
? [
6885
[
@@ -71,6 +88,7 @@ const config: Config = {
7188
// https://typedoc.org/options/input
7289
id: 'docPickerAPI',
7390
entryPoints: ['../packages/document-picker/src/index.ts'],
91+
name: 'document-picker API',
7492
tsconfig: '../tsconfig.json',
7593
watch: typedocWatch,
7694
outputFileStrategy: 'modules',
@@ -80,7 +98,6 @@ const config: Config = {
8098
expandObjects: true,
8199
expandParameters: true, // this is nice and doesn't need much space
82100
readme: 'none',
83-
name: 'document-picker API',
84101
parametersFormat: 'table',
85102
typeDeclarationFormat: 'table',
86103
classPropertiesFormat: 'table',
@@ -92,6 +109,7 @@ const config: Config = {
92109
id: 'docViewerAPI',
93110
// https://typedoc.org/options/input
94111
entryPoints: ['../packages/document-viewer/src/index.ts'],
112+
name: 'document-viewer API',
95113
tsconfig: '../tsconfig.json',
96114
watch: typedocWatch,
97115
outputFileStrategy: 'modules',
@@ -101,7 +119,6 @@ const config: Config = {
101119
expandObjects: true,
102120
expandParameters: true, // this is nice and doesn't need much space
103121
readme: 'none',
104-
name: 'document-viewer API',
105122
parametersFormat: 'table',
106123
typeDeclarationFormat: 'table',
107124
classPropertiesFormat: 'table',
@@ -152,6 +169,20 @@ const config: Config = {
152169
},
153170
{ to: 'docs/doc-picker-api', label: 'Picker API', position: 'left' },
154171
{ to: 'docs/doc-viewer-api', label: 'Viewer API', position: 'left' },
172+
{
173+
label: 'LLMs',
174+
position: 'left',
175+
items: [
176+
{
177+
label: 'llms.txt',
178+
href: 'pathname:///llms.txt',
179+
},
180+
{
181+
label: 'llms-full.txt',
182+
href: 'pathname:///llms-full.txt',
183+
},
184+
],
185+
},
155186
{
156187
to: 'https://github.com/react-native-documents/document-picker/tree/main/example',
157188
label: 'Example app',
@@ -199,6 +230,4 @@ const config: Config = {
199230
} satisfies Preset.ThemeConfig,
200231
}
201232

202-
console.log({ config: JSON.stringify(config.plugins) })
203-
204233
export default config

docs/package.json

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,26 @@
1414
"typecheck": "tsc"
1515
},
1616
"dependencies": {
17-
"@docusaurus/core": "^3.6.2",
18-
"@docusaurus/plugin-ideal-image": "^3.6.2",
19-
"@docusaurus/preset-classic": "^3.6.2",
20-
"@mdx-js/react": "3.1.0",
17+
"@docusaurus/core": "^3.9.2",
18+
"@docusaurus/plugin-ideal-image": "^3.9.2",
19+
"@docusaurus/preset-classic": "^3.9.2",
20+
"@mdx-js/react": "3.1.1",
2121
"clsx": "^2.1.1",
22-
"docusaurus-lunr-search": "^3.5.0",
23-
"prism-react-renderer": "^2.4.0",
24-
"react": "^18.3.1",
25-
"react-dom": "^18.3.1"
22+
"docusaurus-lunr-search": "^3.6.1",
23+
"prism-react-renderer": "^2.4.1",
24+
"react": "^19.2.4",
25+
"react-dom": "^19.2.4"
2626
},
2727
"devDependencies": {
28-
"@docusaurus/module-type-aliases": "^3.6.2",
29-
"@docusaurus/tsconfig": "^3.6.2",
30-
"@docusaurus/types": "^3.6.2",
31-
"docusaurus-plugin-typedoc": "^1.0.5",
32-
"typedoc": "^0.26.7",
33-
"typedoc-plugin-markdown": "^4.2.7",
34-
"typescript": "~5.6.3"
28+
"@docusaurus/faster": "^3.9.2",
29+
"@docusaurus/module-type-aliases": "^3.9.2",
30+
"@docusaurus/tsconfig": "^3.9.2",
31+
"@docusaurus/types": "^3.9.2",
32+
"docusaurus-plugin-llms": "^0.2.2",
33+
"docusaurus-plugin-typedoc": "^1.4.2",
34+
"typedoc": "^0.28.16",
35+
"typedoc-plugin-markdown": "^4.9.0",
36+
"typescript": "~5.9.3"
3537
},
3638
"browserslist": {
3739
"production": [

0 commit comments

Comments
 (0)