@lotics/ui 30.0.0 → 30.1.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/docs/catalog.md CHANGED
@@ -1333,8 +1333,12 @@ source (`src/<module>.tsx`/`.ts`) is the API reference.
1333
1333
  honestly-declared type is returned untouched; an *uninformative* one (`""`,
1334
1334
  `application/octet-stream` and friends — what an OS clipboard or drag hands
1335
1335
  over) is resolved from the filename extension instead, falling back to the
1336
- declaration when the extension is unknown too. It returns the same answer the
1337
- server stores, so a surface that filters on it agrees with what gets persisted.
1336
+ declaration when the extension is unknown too. Documents, images and A/V; on
1337
+ every extension it knows it returns exactly what the SERVER stores, pinned by
1338
+ `src/mime_parity.test.ts`. The server reads a far larger table, so an `accept`
1339
+ naming a MIME pattern (`audio/*`) for an extension outside this one drops a
1340
+ file the server would have kept — write that `accept` as an EXTENSION
1341
+ (`.dwg`), which never consults the table, or add the entry.
1338
1342
  - **`download`** — `downloadFileFromUrl(url, filename, { credentials? })`: fetch+blob+anchor
1339
1343
  download that works inside sandboxed iframes (where `window.open` is silently dropped);
1340
1344
  `credentials` defaults to `same-origin` — pass `"include"` only for auth-gated same-site
@@ -589,7 +589,11 @@ Finder/Explorer and pasted arrives with real bytes and a real filename but an un
589
589
  type — `""`, or just as often `application/octet-stream`, the same non-answer wearing the shape
590
590
  of one. Judging it on that reads silence as "not a PDF", the file is discarded, and since an
591
591
  unacceptable paste is deliberately left alone, the user sees nothing happen at all. Matching on
592
- the resolved type also means the surface agrees with what the server will store. Separately,
592
+ the resolved type also means the surface agrees with what the server will store. The kit's
593
+ extension table covers documents, images and A/V; the server reads a far larger one, so an
594
+ `accept` naming a MIME pattern (`audio/*`) for some exotic extension the kit does not list
595
+ drops a file the server would have stored — write that `accept` as an EXTENSION (`.dwg`), which
596
+ never consults the table, or add the entry. Separately,
593
597
  some clipboards carry only a file *reference* (a path/URL, no bytes): there is nothing to
594
598
  upload and no API that can go read it, so those pastes cannot work by any means — dragging the
595
599
  file is the path that always does.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/ui",
3
- "version": "30.0.0",
3
+ "version": "30.1.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./vite": {
package/src/mime.ts CHANGED
@@ -73,7 +73,10 @@ const GENERIC_MIME_TYPES: ReadonlySet<string> = new Set([
73
73
  ]);
74
74
 
75
75
  /**
76
- * Extension → MIME, for the document and image formats an intake surface names.
76
+ * Extension → MIME, for the document, image and A/V formats an intake surface
77
+ * names. Values are taken verbatim from the server`s table (`mime-types`, via
78
+ * `@lotics/shared/mime_resolution`) — `mime_parity.test.ts` pins them, and an
79
+ * intake that knows LESS than the server silently drops a storable file.
77
80
  * A `Map`, not an object literal, so a file named `x.constructor` looks up a
78
81
  * miss rather than `Object.prototype`'s member.
79
82
  */
@@ -101,6 +104,21 @@ const MIME_BY_EXTENSION: ReadonlyMap<string, string> = new Map([
101
104
  ["xls", "application/vnd.ms-excel"],
102
105
  ["docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
103
106
  ["doc", "application/msword"],
107
+ // A/V: an `audio/*` or `video/*` intake resolves a pasted recording only if
108
+ // its extension is here — the extension-pattern form (`.m4a`) never needed it.
109
+ ["m4a", "audio/mp4"],
110
+ ["mp3", "audio/mpeg"],
111
+ ["wav", "audio/wave"],
112
+ ["ogg", "audio/ogg"],
113
+ ["opus", "audio/ogg"],
114
+ ["flac", "audio/x-flac"],
115
+ ["aac", "audio/x-aac"],
116
+ ["mp4", "video/mp4"],
117
+ ["m4v", "video/x-m4v"],
118
+ ["mov", "video/quicktime"],
119
+ ["webm", "video/webm"],
120
+ ["avi", "video/x-msvideo"],
121
+ ["mkv", "video/x-matroska"],
104
122
  ]);
105
123
 
106
124
  /** What a filename's extension says the file is, or `""` when it says nothing. */