Skip to content

v0.64.0 — Office files, spreadsheets and extra file types

Choose a tag to compare

@pabloiea1995 pabloiea1995 released this 24 Sep 08:04
6e831da

Attachments that used to be refused without a word now go through, and hosts can accept formats of their own.

  • Match by MIME type or extension. The browser takes File.type from the OS, which reports none for a .docx on a computer without Office (and for a .json on Windows): those files were refused and the file dialog did not even offer .docx. Every allowedFileTypes family now accepts by extension too. documents adds .odt and .rtf.
  • New spreadsheets family (.xlsx, .xls, .xlsm, .ods, .csv), off by default, so no host changes behaviour on upgrade.
  • additionalFileTypes?: string[] on ChatDrawer options and ChatInput: extra extensions ('.dwg', 'dxf') or MIME types, wildcards included ('application/zip', 'model/*'), on top of the families.
  • customPromptBox receives fileAccept (for its <input accept>) and checkFile(file) (null | 'type' | 'size'), the same rules as the default composer.
  • Refused files are reported above the input instead of only a console warning. Two new translatable texts: "{name}" cannot be attached: this file type is not allowed. and "{name}" is larger than {size} MB and cannot be attached.

Validated with 75 tests, typecheck, build, and a browser run of ChatInput inside a host app (.docx without MIME type attached; .xlsx refused unless spreadsheets is on; .exe refused; same run fails on 0.62.4). PR #72.