Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
662 changes: 331 additions & 331 deletions .yarn/releases/yarn-4.9.4.cjs → .yarn/releases/yarn-4.12.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.9.4.cjs
yarnPath: .yarn/releases/yarn-4.12.0.cjs
3 changes: 0 additions & 3 deletions docs/babel.config.js

This file was deleted.

458 changes: 309 additions & 149 deletions docs/docs/doc-picker-api/index.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/docs/doc-picker-api/typedoc-sidebar.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @ts-check
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const typedocSidebar = { items: []};
/** @type {import("@docusaurus/plugin-content-docs").SidebarsConfig} */
const typedocSidebar = {items:[]};
module.exports = typedocSidebar.items;
80 changes: 53 additions & 27 deletions docs/docs/doc-viewer-api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,62 @@

### BaseOptions

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

#### Type declaration
#### Properties

| Name | Type | Description |
| ------ | ------ | ------ |
| `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. |
| `headerTitle`? | `string` | iOS only: The title to display in the header of the document viewer. If not provided, the filename will be used. |
| `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. |
| `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`. |
##### androidApplicationId?

> `optional` **androidApplicationId**: `string`

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.

##### grantPermissions?

> `optional` **grantPermissions**: `"read"` \| `"write"`

Android only: The type of permission to grant to the receiving app that will open the document.
This only has an effect if you're viewing a file that lives in the app's sandboxed storage.

##### headerTitle?

> `optional` **headerTitle**: `string`

iOS only: The title to display in the header of the document viewer.

###### Default

```ts
the file name.
```

##### mimeType?

> `optional` **mimeType**: `string`

Optional, but strongly recommended: the mimetype of the document. This helps the Android OS to find the right app(s) to open the document.

##### presentationStyle?

> `optional` **presentationStyle**: [`PresentationStyle`](#presentationstyle-1)

iOS only - Controls how the picker is presented, e.g. on an iPad you may want to present it fullscreen.

###### Default

`pageSheet`.

***

### OptionsViewBookmark

> **OptionsViewBookmark**: [`BaseOptions`](index.md#baseoptions) & \{`bookmark`: `string`; \}
> **OptionsViewBookmark** = [`BaseOptions`](#baseoptions) & \{ `bookmark`: `string`; \}

BaseOptions with the bookmark data from the DocumentPicker module. Obtain the bookmark using the "open" mode, with `requestLongTermAccess` flag set to true.

A bookmark enables long-term access to a file.

#### Type declaration
#### Type Declaration

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

### OptionsViewUri

> **OptionsViewUri**: [`BaseOptions`](index.md#baseoptions) & \{`uri`: `string`; \}
> **OptionsViewUri** = [`BaseOptions`](#baseoptions) & \{ `uri`: `string`; \}

BaseOptions with the uri of the document to view

#### Type declaration
#### Type Declaration

| Name | Type | Description |
| ------ | ------ | ------ |
Expand All @@ -49,15 +83,15 @@ BaseOptions with the uri of the document to view

### PresentationStyle

> **PresentationStyle**: `"fullScreen"` \| `"pageSheet"` \| `"formSheet"` \| `"overFullScreen"` \| `undefined`
> **PresentationStyle** = `"fullScreen"` \| `"pageSheet"` \| `"formSheet"` \| `"overFullScreen"` \| `undefined`

iOS only. Configure the presentation style of the picker.

***

### ViewDocumentOptions

> **ViewDocumentOptions**: [`OptionsViewBookmark`](index.md#optionsviewbookmark) \| [`OptionsViewUri`](index.md#optionsviewuri)
> **ViewDocumentOptions** = [`OptionsViewBookmark`](#optionsviewbookmark) \| [`OptionsViewUri`](#optionsviewuri)

options for viewing a document

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

### errorCodes

> `const` **errorCodes**: `Readonly`\<\{`IN_PROGRESS`: `"ASYNC_OP_IN_PROGRESS"`;`OPERATION_CANCELED`: `"OPERATION_CANCELED"`;`UNABLE_TO_OPEN_FILE_TYPE`: `"UNABLE_TO_OPEN_FILE_TYPE"`; \}\>

#### Type declaration

| Name | Type |
| ------ | ------ |
| `IN_PROGRESS` | `"ASYNC_OP_IN_PROGRESS"` |
| `OPERATION_CANCELED` | `"OPERATION_CANCELED"` |
| `UNABLE_TO_OPEN_FILE_TYPE` | `"UNABLE_TO_OPEN_FILE_TYPE"` |
> `const` **errorCodes**: `Readonly`\<\{ `NULL_PRESENTER`: `"NULL_PRESENTER"`; `UNABLE_TO_OPEN_FILE_TYPE`: `"UNABLE_TO_OPEN_FILE_TYPE"`; \}\>

## Functions

### isErrorWithCode()

> **isErrorWithCode**(`error`: `any`): `error is NativeModuleError`
> **isErrorWithCode**(`error`: `unknown`): `error is NativeModuleError`

TypeScript helper to check if an object has the `code` property.
This is used to avoid `as` casting when you access the `code` property on errors returned by the module.
Expand All @@ -90,7 +116,7 @@ This is used to avoid `as` casting when you access the `code` property on errors

| Parameter | Type |
| ------ | ------ |
| `error` | `any` |
| `error` | `unknown` |

#### Returns

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

### viewDocument()

> **viewDocument**(`data`: [`ViewDocumentOptions`](index.md#viewdocumentoptions)): `Promise`\<`null`\>
> **viewDocument**(`data`: [`ViewDocumentOptions`](#viewdocumentoptions)): `Promise`\<`null`\>

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `data` | [`ViewDocumentOptions`](index.md#viewdocumentoptions) |
| `data` | [`ViewDocumentOptions`](#viewdocumentoptions) |

#### Returns

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/doc-viewer-api/typedoc-sidebar.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @ts-check
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const typedocSidebar = { items: []};
/** @type {import("@docusaurus/plugin-content-docs").SidebarsConfig} */
const typedocSidebar = {items:[]};
module.exports = typedocSidebar.items;
8 changes: 1 addition & 7 deletions docs/docs/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@ yarn add @react-native-documents/viewer

## Setting up

The packages are designed to support last 3 stable versions of RN. However, they very likely work with RN 0.73 and up.

:::warning
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`.

In regular React Native projects, use RN >= 0.76 or update the [settings in Xcode](https://stackoverflow.com/a/66798215/2070942).
:::
The packages are designed to support last 3 stable versions of RN. However, they very likely work with RN 0.76 and up.

### Expo

Expand Down
39 changes: 34 additions & 5 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import type * as Preset from '@docusaurus/preset-classic'
const typedocWatch = false

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

onBrokenLinks: 'throw',
onBrokenAnchors: 'throw',
onBrokenMarkdownLinks: 'throw',
markdown: {
hooks: {
onBrokenMarkdownLinks: 'throw',
},
},

// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
Expand Down Expand Up @@ -63,6 +71,15 @@ const config: Config = {
// themes: ['min-light', 'nord'],
// },
// ],
[
'docusaurus-plugin-llms',
{
// Enable both content cleaning options for optimal LLM output
ignoreFiles: ['license**', 'other-libs**'],
fullContent: true,
removeDuplicateHeadings: true,
},
],
...(process.env.ENABLE_DOC_GEN === 'true'
? [
[
Expand All @@ -71,6 +88,7 @@ const config: Config = {
// https://typedoc.org/options/input
id: 'docPickerAPI',
entryPoints: ['../packages/document-picker/src/index.ts'],
name: 'document-picker API',
tsconfig: '../tsconfig.json',
watch: typedocWatch,
outputFileStrategy: 'modules',
Expand All @@ -80,7 +98,6 @@ const config: Config = {
expandObjects: true,
expandParameters: true, // this is nice and doesn't need much space
readme: 'none',
name: 'document-picker API',
parametersFormat: 'table',
typeDeclarationFormat: 'table',
classPropertiesFormat: 'table',
Expand All @@ -92,6 +109,7 @@ const config: Config = {
id: 'docViewerAPI',
// https://typedoc.org/options/input
entryPoints: ['../packages/document-viewer/src/index.ts'],
name: 'document-viewer API',
tsconfig: '../tsconfig.json',
watch: typedocWatch,
outputFileStrategy: 'modules',
Expand All @@ -101,7 +119,6 @@ const config: Config = {
expandObjects: true,
expandParameters: true, // this is nice and doesn't need much space
readme: 'none',
name: 'document-viewer API',
parametersFormat: 'table',
typeDeclarationFormat: 'table',
classPropertiesFormat: 'table',
Expand Down Expand Up @@ -152,6 +169,20 @@ const config: Config = {
},
{ to: 'docs/doc-picker-api', label: 'Picker API', position: 'left' },
{ to: 'docs/doc-viewer-api', label: 'Viewer API', position: 'left' },
{
label: 'LLMs',
position: 'left',
items: [
{
label: 'llms.txt',
href: 'pathname:///llms.txt',
},
{
label: 'llms-full.txt',
href: 'pathname:///llms-full.txt',
},
],
},
{
to: 'https://github.com/react-native-documents/document-picker/tree/main/example',
label: 'Example app',
Expand Down Expand Up @@ -199,6 +230,4 @@ const config: Config = {
} satisfies Preset.ThemeConfig,
}

console.log({ config: JSON.stringify(config.plugins) })

export default config
32 changes: 17 additions & 15 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,26 @@
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "^3.6.2",
"@docusaurus/plugin-ideal-image": "^3.6.2",
"@docusaurus/preset-classic": "^3.6.2",
"@mdx-js/react": "3.1.0",
"@docusaurus/core": "^3.9.2",
"@docusaurus/plugin-ideal-image": "^3.9.2",
"@docusaurus/preset-classic": "^3.9.2",
"@mdx-js/react": "3.1.1",
"clsx": "^2.1.1",
"docusaurus-lunr-search": "^3.5.0",
"prism-react-renderer": "^2.4.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"docusaurus-lunr-search": "^3.6.1",
"prism-react-renderer": "^2.4.1",
"react": "^19.2.4",
"react-dom": "^19.2.4"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.6.2",
"@docusaurus/tsconfig": "^3.6.2",
"@docusaurus/types": "^3.6.2",
"docusaurus-plugin-typedoc": "^1.0.5",
"typedoc": "^0.26.7",
"typedoc-plugin-markdown": "^4.2.7",
"typescript": "~5.6.3"
"@docusaurus/faster": "^3.9.2",
"@docusaurus/module-type-aliases": "^3.9.2",
"@docusaurus/tsconfig": "^3.9.2",
"@docusaurus/types": "^3.9.2",
"docusaurus-plugin-llms": "^0.2.2",
"docusaurus-plugin-typedoc": "^1.4.2",
"typedoc": "^0.28.16",
"typedoc-plugin-markdown": "^4.9.0",
"typescript": "~5.9.3"
},
"browserslist": {
"production": [
Expand Down
8 changes: 7 additions & 1 deletion docs/src/components/HomepageFeatures/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ const FeatureList: FeatureItem[] = [
title: 'Open-source and free',
Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default,
description: (
<>Support the project by contributing PRs on GitHub, or sponsor the author to say thanks!</>
<>
Support the project by contributing PRs on GitHub, or{' '}
<a href="https://github.com/sponsors/vonovak" target="_blank">
sponsor the author
</a>{' '}
to say thanks!
</>
),
},
{
Expand Down
Loading
Loading