@bygga.dev/editor 1.5.0 → 1.7.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/README.md CHANGED
@@ -197,11 +197,30 @@ editor.brand = {
197
197
  name: 'Acme Sans', // picker label; @font-face family for a font-file href
198
198
  href: 'https://static.example.com/fonts/acme-sans.css', // stylesheet URL (e.g. a Google Fonts embed), or a .woff2/.ttf file
199
199
  fontFamily: "'Acme Sans', Arial, sans-serif", // optional exact stack to write
200
+ // type: 'file' | 'stylesheet' — say it when the URL has no file extension (see below)
200
201
  },
201
202
  ],
202
203
  }
203
204
  ```
204
205
 
206
+ **`type` — required in practice for extensionless URLs.** An href is loaded either as a
207
+ **stylesheet** (`<link rel="stylesheet">`, CSS that declares its own `@font-face` rules —
208
+ a Google Fonts embed) or as a **font file** (an `@font-face` under the entry's `name`).
209
+ Without `type`, the file extension decides, and it defaults to `stylesheet`. That is right
210
+ for `…/acme-sans.css` and for `…/AcmeSans.woff2`, but a download endpoint like
211
+ `…/dlfile/<token>` or `…/download?id=42` that *streams* a woff2 has no extension to read —
212
+ it is taken for a stylesheet, the browser parses font bytes as CSS, and the face silently
213
+ never appears. Set `type: 'file'` on those:
214
+
215
+ ```js
216
+ {
217
+ name: 'Acme Sans Bold',
218
+ href: 'https://files.example.com/dlfile/Tu06mMvdlwNj9Dyxx', // no extension
219
+ fontFamily: "'Acme Sans Bold', Arial, sans-serif",
220
+ type: 'file', // ← without this it will not load
221
+ }
222
+ ```
223
+
205
224
  The email-safe faces are `arial`, `tahoma`, `trebuchet`, `verdana`, `georgia`,
206
225
  `times`, `courier`. Invalid entries (an unparseable colour, a non-http(s) font href)
207
226
  are dropped with a `[bygga-editor]` console warning rather than throwing — one typo
@@ -1,5 +1,5 @@
1
1
  import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, I as s, J as c, K as l, L as u, M as d, N as f, P as p, S as m, T as h, V as g, W as ee, Y as te, Z as _, _ as v, at as y, ct as b, f as x, ft as S, i as ne, j as C, k as w, lt as T, ot as E, q as re, rt as ie, t as ae, tt as oe, v as D, w as O, x as k, y as A, z as j } from "./providerKeys-BrTFiegH.js";
2
- import { $t as se, C as M, Ct as N, D as P, S as ce, St as le, X as ue, Y as de, _t as F, an as fe, at as I, b as L, bt as pe, c as me, ct as he, d as ge, dt as _e, en as ve, et as ye, fn as be, ft as xe, g as Se, gt as Ce, ht as R, in as we, it as Te, l as Ee, lt as De, mt as z, n as Oe, nn as ke, nt as Ae, on as je, ot as B, pt as Me, r as Ne, rn as Pe, rt as Fe, s as Ie, st as V, t as Le, tn as Re, tt as ze, u as Be, un as Ve, ut as He, v as Ue, vt as H, wt as We, xt as Ge, yt as U } from "./urls-DoSoJydy.js";
2
+ import { $t as se, C as M, Ct as N, D as P, S as ce, St as le, X as ue, Y as de, _t as F, an as fe, at as I, b as L, bt as pe, c as me, ct as he, d as ge, dt as _e, en as ve, et as ye, fn as be, ft as xe, g as Se, gt as Ce, ht as R, in as we, it as Te, l as Ee, lt as De, mt as z, n as Oe, nn as ke, nt as Ae, on as je, ot as B, pt as Me, r as Ne, rn as Pe, rt as Fe, s as Ie, st as V, t as Le, tn as Re, tt as ze, u as Be, un as Ve, ut as He, v as Ue, vt as H, wt as We, xt as Ge, yt as U } from "./urls-Ckq4mual.js";
3
3
  //#region ../../node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.js
4
4
  function Ke(e = {}) {
5
5
  return new F({ view(t) {