@bygga.dev/editor 1.5.0 → 1.6.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) {
package/bygga-editor.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { B as e, C as t, D as n, E as r, F as i, G as a, H as o, I as s, K as c, L as l, M as u, N as d, O as f, P as p, S as m, T as h, U as g, V as _, W as v, X as y, Y as b, a as x, at as S, c as C, ct as w, d as T, dt as E, ft as D, g as ee, h as O, i as k, it as te, j as A, k as j, l as ne, lt as M, n as N, o as re, pt as ie, q as P, r as ae, s as oe, t as se, ut as F, v as ce, w as I, x as L, y as R, z } from "./providerKeys-BrTFiegH.js";
2
- import { $ as le, A as B, At as ue, B as de, Bt as fe, C as V, D as H, Dt as pe, E as me, Et as U, F as he, Ft as ge, G as _e, Gt as ve, H as ye, Ht as be, I as xe, It as Se, J as Ce, Jt as we, K as Te, Kt as Ee, L as De, Lt as Oe, M as ke, Mt as Ae, N as je, Nt as Me, O as Ne, Ot as Pe, P as Fe, Pt as Ie, Q as Le, Qt as Re, R as ze, Rt as Be, S as Ve, T as He, Tt as Ue, U as We, Ut as Ge, V as Ke, Vt as qe, W as Je, Wt as Ye, X as W, Xt as Xe, Yt as Ze, Z as Qe, Zt as $e, _ as et, _n as tt, a as nt, an as rt, b as G, bn as it, c as at, cn as ot, d as st, dn as ct, f as lt, fn as ut, g as dt, gn as ft, h as pt, hn as mt, i as ht, in as gt, j as _t, jt as vt, k as yt, kt as bt, l as xt, ln as St, m as Ct, mn as wt, nn as Tt, o as Et, p as Dt, pn as Ot, q as kt, qt as At, r as jt, s as Mt, sn as Nt, t as Pt, u as Ft, v as It, vn as Lt, w as Rt, x as zt, y as Bt, yn as Vt, z as Ht, zt as Ut } from "./urls-DoSoJydy.js";
2
+ import { $ as le, A as B, At as ue, B as de, Bt as fe, C as V, D as H, Dt as pe, E as me, Et as U, F as he, Ft as ge, G as _e, Gt as ve, H as ye, Ht as be, I as xe, It as Se, J as Ce, Jt as we, K as Te, Kt as Ee, L as De, Lt as Oe, M as ke, Mt as Ae, N as je, Nt as Me, O as Ne, Ot as Pe, P as Fe, Pt as Ie, Q as Le, Qt as Re, R as ze, Rt as Be, S as Ve, T as He, Tt as Ue, U as We, Ut as Ge, V as Ke, Vt as qe, W as Je, Wt as Ye, X as W, Xt as Xe, Yt as Ze, Z as Qe, Zt as $e, _ as et, _n as tt, a as nt, an as rt, b as G, bn as it, c as at, cn as ot, d as st, dn as ct, f as lt, fn as ut, g as dt, gn as ft, h as pt, hn as mt, i as ht, in as gt, j as _t, jt as vt, k as yt, kt as bt, l as xt, ln as St, m as Ct, mn as wt, nn as Tt, o as Et, p as Dt, pn as Ot, q as kt, qt as At, r as jt, s as Mt, sn as Nt, t as Pt, u as Ft, v as It, vn as Lt, w as Rt, x as zt, y as Bt, yn as Vt, z as Ht, zt as Ut } from "./urls-Ckq4mual.js";
3
3
  //#region ../core/src/anchors.ts
4
4
  function Wt(e) {
5
5
  let t = /* @__PURE__ */ new Set(), n = (e) => {
@@ -702,7 +702,8 @@ function vr(e) {
702
702
  t.some((e) => e.name === n.name) || t.push({
703
703
  name: n.name.trim(),
704
704
  href: n.href,
705
- ...n.fontFamily ? { fontFamily: n.fontFamily } : {}
705
+ ...n.fontFamily ? { fontFamily: n.fontFamily } : {},
706
+ ...n.type === "file" || n.type === "stylesheet" ? { type: n.type } : {}
706
707
  });
707
708
  }
708
709
  return t;
@@ -4580,7 +4581,7 @@ var nl = ["innerHTML"], rl = /*@__PURE__*/ j({
4580
4581
  }),
4581
4582
  emits: /*@__PURE__*/ d(["delete", "duplicate"], ["update:modelValue"]),
4582
4583
  setup(e, { emit: i }) {
4583
- let o = a(e, "modelValue"), s = i, l = f(() => import("./TextEditor-CIqROgaO.js")), d = c("settingsDialog"), p = S(!1), g = ka(), v = u(x);
4584
+ let o = a(e, "modelValue"), s = i, l = f(() => import("./TextEditor-G1pjeq9o.js")), d = c("settingsDialog"), p = S(!1), g = ka(), v = u(x);
4584
4585
  function y() {
4585
4586
  e.blockId && v && g?.request({
4586
4587
  data: o.value,
@@ -5129,7 +5130,7 @@ var nl = ["innerHTML"], rl = /*@__PURE__*/ j({
5129
5130
  font: i.font,
5130
5131
  width: i.width
5131
5132
  }));
5132
- e(nr, f(() => import("./TextEditor-CIqROgaO.js"))), e(Zn, f(() => Promise.resolve().then(() => il)));
5133
+ e(nr, f(() => import("./TextEditor-G1pjeq9o.js"))), e(Zn, f(() => Promise.resolve().then(() => il)));
5133
5134
  function v(e) {
5134
5135
  e.type === "columns" && (r.value = e);
5135
5136
  }
@@ -5347,7 +5348,7 @@ var nl = ["innerHTML"], rl = /*@__PURE__*/ j({
5347
5348
  emits: ["add"],
5348
5349
  setup(r, { emit: i }) {
5349
5350
  let a = i, { t: o } = G(), s = u(dt), c = u(Bt, L(() => [])), l = u(x), d = u(re), p = L(() => c.value.filter((e) => e.content.kind === (l?.value ?? "email"))), g = ys(), v = Ve();
5350
- e(nr, f(() => import("./TextEditor-CIqROgaO.js"))), e(Zn, f(() => Promise.resolve().then(() => il)));
5351
+ e(nr, f(() => import("./TextEditor-G1pjeq9o.js"))), e(Zn, f(() => Promise.resolve().then(() => il)));
5351
5352
  let y = L(() => !!d?.value.preview), b = L(() => typeof s?.value?.deleteSavedBlock == "function"), C = S(/* @__PURE__ */ new Set());
5352
5353
  function T(e, t) {
5353
5354
  g?.start({
package/element.d.ts CHANGED
@@ -3,6 +3,7 @@ type BrandCustomFont = {
3
3
  name: string;
4
4
  href: string;
5
5
  fontFamily?: string;
6
+ type?: 'file' | 'stylesheet';
6
7
  };
7
8
  type Brand = {
8
9
  colors?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bygga.dev/editor",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Visual content builder shipped as the <bygga-editor> custom element",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",