@tutti-os/workspace-file-preview 0.0.190 → 0.0.192
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/README.md +25 -15
- package/dist/{chunk-SUQYO7VX.js → chunk-SDSS6OA5.js} +256 -178
- package/dist/chunk-SDSS6OA5.js.map +1 -0
- package/dist/core/index.d.ts +112 -26
- package/dist/core/index.js +17 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -11
- package/dist/react/index.d.ts +65 -2
- package/dist/react/index.js +121 -1
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-SUQYO7VX.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,26 +1,36 @@
|
|
|
1
1
|
# @tutti-os/workspace-file-preview
|
|
2
2
|
|
|
3
|
-
Shared, host-neutral file preview helpers
|
|
3
|
+
Shared, host-neutral workspace file preview helpers.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
**Authority for ownership and boundary decisions:**
|
|
6
|
+
[CONTRACT.md](./CONTRACT.md). Read that file before changing classification,
|
|
7
|
+
loading lifecycle, renderer hooks, or fallback behavior.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
image, text, loading, and readonly rendering shell while keeping host-specific
|
|
11
|
-
icons and localized copy outside this package.
|
|
9
|
+
## Package surface
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
This package ships:
|
|
12
|
+
|
|
13
|
+
- Flat `previewKind` classification (`directory` / media / text-family /
|
|
14
|
+
Office / `unsupported`), plus a separate coarser `visualKind` for icons
|
|
15
|
+
- `createWorkspaceFilePreviewController` for shared frontend loading lifecycle
|
|
16
|
+
(readiness, cancellation, stale-request fencing, decoding, object-URL cleanup)
|
|
17
|
+
- Built-in React preview shells for `image` / `video` / `text`
|
|
18
|
+
- Host renderer registry (by `previewKind`) and a resolve chain:
|
|
19
|
+
host hook → text degradation → unsupported state
|
|
20
|
+
- `toSurfaceState(controllerState, copy)` to project controller state into the
|
|
21
|
+
React surface
|
|
22
|
+
|
|
23
|
+
Hosts inject read/projection capabilities. Product controllers keep selection,
|
|
24
|
+
editing, persistence, transport wiring, and localized error presentation.
|
|
25
|
+
|
|
26
|
+
Open / reveal / open-with / browser activation are **not** owned here. Those
|
|
27
|
+
helpers live on the host edge (for Tutti:
|
|
28
|
+
`@tutti-os/workspace-file-manager/services`).
|
|
18
29
|
|
|
19
30
|
Sources may provide `canReadEntry` as a capability gate. Returning `false`
|
|
20
31
|
blocks reads for every non-directory entry, while returning `true` also allows
|
|
21
32
|
the injected reader to classify file types that local extension detection does
|
|
22
33
|
not recognize. Omitting the callback keeps the default local classification.
|
|
23
34
|
|
|
24
|
-
HTML files
|
|
25
|
-
belongs to a separate browser activation flow
|
|
26
|
-
preview surface.
|
|
35
|
+
HTML files degrade to source text in the built-in surface. Opening or executing
|
|
36
|
+
an HTML document belongs to a separate browser activation flow.
|