@peers-app/peers-ui 0.29.2 → 0.30.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.
@@ -16,7 +16,8 @@ export interface IUseFileUrlResult {
16
16
  * ```
17
17
  *
18
18
  * Reads through `hostContract(SystemFiles)` in the screen's data context, the active group.
19
- * The URL is revoked when the file id changes or the component unmounts, so don't keep it.
19
+ * The URL is revoked when the file id changes or the component unmounts, so don't keep it. A
20
+ * file over `FILES_WHOLE_READ_MAX_BYTES` (64 MiB) gives an error: read a video, say, in ranges.
20
21
  *
21
22
  * @param fileId - The file's id; nothing is read while it's undefined.
22
23
  */
@@ -12,7 +12,8 @@ const react_1 = require("react");
12
12
  * ```
13
13
  *
14
14
  * Reads through `hostContract(SystemFiles)` in the screen's data context, the active group.
15
- * The URL is revoked when the file id changes or the component unmounts, so don't keep it.
15
+ * The URL is revoked when the file id changes or the component unmounts, so don't keep it. A
16
+ * file over `FILES_WHOLE_READ_MAX_BYTES` (64 MiB) gives an error: read a video, say, in ranges.
16
17
  *
17
18
  * @param fileId - The file's id; nothing is read while it's undefined.
18
19
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Read a package's UI or routes bundle as text, through System Files in the context its
3
- * version is installed in.
3
+ * version is installed in. A bundle is evaluated whole, so it may be as large as any file.
4
4
  *
5
5
  * @param dataContextId - Context of the selected package version.
6
6
  * @param fileId - The bundle's file id.
@@ -16,13 +16,15 @@ function filesIn(dataContextId) {
16
16
  const decoder = new TextDecoder("utf-8", { ignoreBOM: true });
17
17
  /**
18
18
  * Read a package's UI or routes bundle as text, through System Files in the context its
19
- * version is installed in.
19
+ * version is installed in. A bundle is evaluated whole, so it may be as large as any file.
20
20
  *
21
21
  * @param dataContextId - Context of the selected package version.
22
22
  * @param fileId - The bundle's file id.
23
23
  */
24
24
  async function readBundleText(dataContextId, fileId) {
25
25
  const files = filesIn(dataContextId);
26
- const { bytes } = await (0, peers_sdk_1.readWholeFile)((input) => files.tools.read(input), fileId);
26
+ const { bytes } = await (0, peers_sdk_1.readWholeFile)((input) => files.tools.read(input), fileId, {
27
+ maxBytes: peers_sdk_1.FILES_MAX_FILE_BYTES,
28
+ });
27
29
  return decoder.decode(bytes);
28
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peers-app/peers-ui",
3
- "version": "0.29.2",
3
+ "version": "0.30.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/peers-app/peers-ui.git"
@@ -36,7 +36,7 @@
36
36
  "lint:fix": "biome check --write ."
37
37
  },
38
38
  "peerDependencies": {
39
- "@peers-app/peers-sdk": "^0.29.2",
39
+ "@peers-app/peers-sdk": "^0.30.1",
40
40
  "bootstrap": "^5.3.3",
41
41
  "react": "^18.0.0",
42
42
  "react-dom": "^18.0.0"
@@ -47,7 +47,7 @@
47
47
  "@babel/preset-react": "^7.24.1",
48
48
  "@babel/preset-typescript": "^7.27.1",
49
49
  "@biomejs/biome": "2.3.11",
50
- "@peers-app/peers-sdk": "0.29.2",
50
+ "@peers-app/peers-sdk": "0.30.1",
51
51
  "@testing-library/dom": "^10.4.0",
52
52
  "@testing-library/jest-dom": "^6.6.3",
53
53
  "@testing-library/react": "^16.3.0",