hazo_files 3.1.1 → 3.3.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.
- package/CHANGE_LOG.md +47 -0
- package/dist/background-upload/index.d.mts +1 -0
- package/dist/background-upload/index.d.ts +1 -0
- package/dist/background-upload/index.js +3 -0
- package/dist/background-upload/index.mjs +3 -0
- package/dist/background-upload/react/index.d.mts +1 -0
- package/dist/background-upload/react/index.d.ts +1 -0
- package/dist/background-upload/react/index.js +8 -0
- package/dist/background-upload/react/index.mjs +9 -1
- package/package.json +18 -27
package/CHANGE_LOG.md
CHANGED
|
@@ -5,6 +5,53 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## 3.3.0 — 2026-08-13
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
`HazoFileUploadProvider` handed the live tree a destroyed `UploadManager` after
|
|
13
|
+
a remount. The provider created the manager in a `useRef` and destroyed it in
|
|
14
|
+
its `useEffect` cleanup, but never rebuilt it. Under React StrictMode (dev
|
|
15
|
+
double-mount) or any real remount, the cleanup ran `manager.destroy()`, then the
|
|
16
|
+
re-run setup reused the same destroyed instance — so every `submit_batch` threw
|
|
17
|
+
`UploadManager is destroyed`. The effect now rebuilds the manager when it finds
|
|
18
|
+
a destroyed one and forces a re-render so the context value points at the fresh
|
|
19
|
+
instance.
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- `UploadManager.is_destroyed` getter, so consumers (and the provider) can check
|
|
24
|
+
lifecycle state without touching internals.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## 3.2.0 — 2026-08-04
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
Moved 3 packages from optional `peerDependencies` to `dependencies`. Each is imported
|
|
32
|
+
statically at the top level of this package's own `dist/`, but was declared as
|
|
33
|
+
an *optional* peer — and npm never auto-installs an optional peer, under any
|
|
34
|
+
`legacy-peer-deps` setting. The result was a package that could not run as
|
|
35
|
+
shipped: a consumer installed it, imported it, and the build failed with
|
|
36
|
+
module-not-found on packages it had never heard of and had no reason to
|
|
37
|
+
declare. They are implementation details of this package, so this package now
|
|
38
|
+
brings them.
|
|
39
|
+
|
|
40
|
+
- @dnd-kit/core@^6.0.0
|
|
41
|
+
- @dnd-kit/sortable@^8.0.0
|
|
42
|
+
- @dnd-kit/utilities@^3.0.0
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## 3.1.2 — 2026-08-04
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
|
|
49
|
+
Widened stale host-framework peer ranges that excluded currently-shipping
|
|
50
|
+
majors and made a strict install unsatisfiable for React 19 consumers:
|
|
51
|
+
|
|
52
|
+
- `react` / `react-dom`: `^18.0.0` -> `^18.0.0 || ^19.0.0`
|
|
53
|
+
|
|
54
|
+
|
|
8
55
|
## 3.1.0 — 2026-06-11
|
|
9
56
|
|
|
10
57
|
**Additive** — no breaking changes from 3.0.x.
|
|
@@ -152,6 +152,7 @@ declare class UploadManager {
|
|
|
152
152
|
private destroyed;
|
|
153
153
|
private readonly config;
|
|
154
154
|
constructor(config?: UploadManagerConfig);
|
|
155
|
+
get is_destroyed(): boolean;
|
|
155
156
|
on<K extends keyof UploadManagerEvents>(event: K, listener: (data: UploadManagerEvents[K]) => void): () => void;
|
|
156
157
|
submit_batch(options: CreateBatchOptions): string;
|
|
157
158
|
get_jobs_for_group(group_id: string): JobSnapshot[];
|
|
@@ -152,6 +152,7 @@ declare class UploadManager {
|
|
|
152
152
|
private destroyed;
|
|
153
153
|
private readonly config;
|
|
154
154
|
constructor(config?: UploadManagerConfig);
|
|
155
|
+
get is_destroyed(): boolean;
|
|
155
156
|
on<K extends keyof UploadManagerEvents>(event: K, listener: (data: UploadManagerEvents[K]) => void): () => void;
|
|
156
157
|
submit_batch(options: CreateBatchOptions): string;
|
|
157
158
|
get_jobs_for_group(group_id: string): JobSnapshot[];
|
|
@@ -201,6 +201,9 @@ var UploadManager = class {
|
|
|
201
201
|
this.emitter.on("job:completed", ({ job }) => this.on_job_settled(job));
|
|
202
202
|
this.emitter.on("job:error", ({ job }) => this.on_job_settled(job));
|
|
203
203
|
}
|
|
204
|
+
get is_destroyed() {
|
|
205
|
+
return this.destroyed;
|
|
206
|
+
}
|
|
204
207
|
on(event, listener) {
|
|
205
208
|
return this.emitter.on(event, listener);
|
|
206
209
|
}
|
|
@@ -172,6 +172,9 @@ var UploadManager = class {
|
|
|
172
172
|
this.emitter.on("job:completed", ({ job }) => this.on_job_settled(job));
|
|
173
173
|
this.emitter.on("job:error", ({ job }) => this.on_job_settled(job));
|
|
174
174
|
}
|
|
175
|
+
get is_destroyed() {
|
|
176
|
+
return this.destroyed;
|
|
177
|
+
}
|
|
175
178
|
on(event, listener) {
|
|
176
179
|
return this.emitter.on(event, listener);
|
|
177
180
|
}
|
|
@@ -118,6 +118,7 @@ declare class UploadManager {
|
|
|
118
118
|
private destroyed;
|
|
119
119
|
private readonly config;
|
|
120
120
|
constructor(config?: UploadManagerConfig);
|
|
121
|
+
get is_destroyed(): boolean;
|
|
121
122
|
on<K extends keyof UploadManagerEvents>(event: K, listener: (data: UploadManagerEvents[K]) => void): () => void;
|
|
122
123
|
submit_batch(options: CreateBatchOptions): string;
|
|
123
124
|
get_jobs_for_group(group_id: string): JobSnapshot[];
|
|
@@ -118,6 +118,7 @@ declare class UploadManager {
|
|
|
118
118
|
private destroyed;
|
|
119
119
|
private readonly config;
|
|
120
120
|
constructor(config?: UploadManagerConfig);
|
|
121
|
+
get is_destroyed(): boolean;
|
|
121
122
|
on<K extends keyof UploadManagerEvents>(event: K, listener: (data: UploadManagerEvents[K]) => void): () => void;
|
|
122
123
|
submit_batch(options: CreateBatchOptions): string;
|
|
123
124
|
get_jobs_for_group(group_id: string): JobSnapshot[];
|
|
@@ -217,6 +217,9 @@ var UploadManager = class {
|
|
|
217
217
|
this.emitter.on("job:completed", ({ job }) => this.on_job_settled(job));
|
|
218
218
|
this.emitter.on("job:error", ({ job }) => this.on_job_settled(job));
|
|
219
219
|
}
|
|
220
|
+
get is_destroyed() {
|
|
221
|
+
return this.destroyed;
|
|
222
|
+
}
|
|
220
223
|
on(event, listener) {
|
|
221
224
|
return this.emitter.on(event, listener);
|
|
222
225
|
}
|
|
@@ -381,7 +384,12 @@ function HazoFileUploadProvider({
|
|
|
381
384
|
if (!manager_ref.current) {
|
|
382
385
|
manager_ref.current = new UploadManager(config);
|
|
383
386
|
}
|
|
387
|
+
const [, force_render] = (0, import_react3.useReducer)((n) => n + 1, 0);
|
|
384
388
|
(0, import_react3.useEffect)(() => {
|
|
389
|
+
if (manager_ref.current.is_destroyed) {
|
|
390
|
+
manager_ref.current = new UploadManager(config);
|
|
391
|
+
force_render();
|
|
392
|
+
}
|
|
385
393
|
const m = manager_ref.current;
|
|
386
394
|
return () => {
|
|
387
395
|
m.destroy();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/background_upload/react/provider.tsx
|
|
2
|
-
import { useRef, useEffect as useEffect2 } from "react";
|
|
2
|
+
import { useRef, useReducer, useEffect as useEffect2 } from "react";
|
|
3
3
|
|
|
4
4
|
// src/background_upload/core/upload-manager.ts
|
|
5
5
|
import { generateRequestId as generateRequestId2 } from "hazo_core";
|
|
@@ -177,6 +177,9 @@ var UploadManager = class {
|
|
|
177
177
|
this.emitter.on("job:completed", ({ job }) => this.on_job_settled(job));
|
|
178
178
|
this.emitter.on("job:error", ({ job }) => this.on_job_settled(job));
|
|
179
179
|
}
|
|
180
|
+
get is_destroyed() {
|
|
181
|
+
return this.destroyed;
|
|
182
|
+
}
|
|
180
183
|
on(event, listener) {
|
|
181
184
|
return this.emitter.on(event, listener);
|
|
182
185
|
}
|
|
@@ -341,7 +344,12 @@ function HazoFileUploadProvider({
|
|
|
341
344
|
if (!manager_ref.current) {
|
|
342
345
|
manager_ref.current = new UploadManager(config);
|
|
343
346
|
}
|
|
347
|
+
const [, force_render] = useReducer((n) => n + 1, 0);
|
|
344
348
|
useEffect2(() => {
|
|
349
|
+
if (manager_ref.current.is_destroyed) {
|
|
350
|
+
manager_ref.current = new UploadManager(config);
|
|
351
|
+
force_render();
|
|
352
|
+
}
|
|
345
353
|
const m = manager_ref.current;
|
|
346
354
|
return () => {
|
|
347
355
|
m.destroy();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hazo_files",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "File management including integration to cloud files",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -86,8 +86,11 @@
|
|
|
86
86
|
},
|
|
87
87
|
"homepage": "https://github.com/pub12/hazo_files#readme",
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"
|
|
89
|
+
"@dnd-kit/core": "^6.0.0",
|
|
90
|
+
"@dnd-kit/sortable": "^8.0.0",
|
|
91
|
+
"@dnd-kit/utilities": "^3.0.0",
|
|
90
92
|
"googleapis": "^140",
|
|
93
|
+
"ini": "^4.1.3",
|
|
91
94
|
"mime-types": "^2.1.35"
|
|
92
95
|
},
|
|
93
96
|
"devDependencies": {
|
|
@@ -102,9 +105,9 @@
|
|
|
102
105
|
"@types/react": "^18.3.3",
|
|
103
106
|
"@types/react-dom": "^18.3.0",
|
|
104
107
|
"dropbox": "^10.34.0",
|
|
105
|
-
"hazo_core": "^
|
|
106
|
-
"hazo_jobs": "^0.
|
|
107
|
-
"hazo_llm_api": "^2.
|
|
108
|
+
"hazo_core": "^2.0.0",
|
|
109
|
+
"hazo_jobs": "^0.18.0",
|
|
110
|
+
"hazo_llm_api": "^2.3.0",
|
|
108
111
|
"jsdom": "^28.1.0",
|
|
109
112
|
"react": "^18.2.0",
|
|
110
113
|
"react-dom": "^18.2.0",
|
|
@@ -115,35 +118,23 @@
|
|
|
115
118
|
"xxhash-wasm": "^1.1.0"
|
|
116
119
|
},
|
|
117
120
|
"peerDependencies": {
|
|
118
|
-
"@dnd-kit/core": "^6.0.0",
|
|
119
|
-
"@dnd-kit/sortable": "^8.0.0",
|
|
120
|
-
"@dnd-kit/utilities": "^3.0.0",
|
|
121
121
|
"dropbox": "^10.0.0",
|
|
122
122
|
"googleapis": "^140.0.0",
|
|
123
|
-
"hazo_connect": "^
|
|
124
|
-
"hazo_core": "^
|
|
125
|
-
"hazo_debug": "^3.
|
|
126
|
-
"hazo_jobs": "^0.
|
|
127
|
-
"hazo_llm_api": "^2.
|
|
128
|
-
"hazo_logs": "^2.
|
|
129
|
-
"hazo_secure": "^1.
|
|
130
|
-
"hazo_ui": "^
|
|
131
|
-
"react": "^18.0.0",
|
|
132
|
-
"react-dom": "^18.0.0",
|
|
123
|
+
"hazo_connect": "^4.0.2",
|
|
124
|
+
"hazo_core": "^2.0.0",
|
|
125
|
+
"hazo_debug": "^3.2.0",
|
|
126
|
+
"hazo_jobs": "^0.18.0",
|
|
127
|
+
"hazo_llm_api": "^2.3.0",
|
|
128
|
+
"hazo_logs": "^2.2.1",
|
|
129
|
+
"hazo_secure": "^1.7.2",
|
|
130
|
+
"hazo_ui": "^6.9.0",
|
|
131
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
132
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
133
133
|
"server-only": "^0.0.1",
|
|
134
134
|
"sonner": "^2.0.7",
|
|
135
135
|
"xxhash-wasm": "^1.0.0"
|
|
136
136
|
},
|
|
137
137
|
"peerDependenciesMeta": {
|
|
138
|
-
"@dnd-kit/core": {
|
|
139
|
-
"optional": true
|
|
140
|
-
},
|
|
141
|
-
"@dnd-kit/sortable": {
|
|
142
|
-
"optional": true
|
|
143
|
-
},
|
|
144
|
-
"@dnd-kit/utilities": {
|
|
145
|
-
"optional": true
|
|
146
|
-
},
|
|
147
138
|
"dropbox": {
|
|
148
139
|
"optional": true
|
|
149
140
|
},
|