@jackuait/blok 0.4.3-beta.3 → 0.4.3-beta.4

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/dist/blok.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { B as s, v as a } from "./chunks/blok-BmjQP37u.mjs";
2
- import { D as A } from "./chunks/inline-tool-convert-CreNXc4T.mjs";
1
+ import { B as s, v as a } from "./chunks/blok-N-sAekLt.mjs";
2
+ import { D as A } from "./chunks/inline-tool-convert-BBeAtLcM.mjs";
3
3
  export {
4
4
  s as Blok,
5
5
  A as DATA_ATTR,
@@ -19,7 +19,7 @@ var Yt = (a, t) => {
19
19
  t.indexOf(o) < 0 && Pe.call(a, o) && (e[o] = a[o]);
20
20
  return e;
21
21
  };
22
- import { i as N, g as Ho, a as f, b as be, c as E, l as I, S as y, d as Fo, e as _o, D as m, t as C, f as $, h as co, P as O, j as Ht, k as j, m as A, n as wt, o as ht, p as ho, q as J, T as jt, r as Ft, s as v, I as zo, u as Uo, v as ct, w as oe, x as Ko, y as Wo, z as $o, A as uo, B as Yo, C as po, E as fo, F as jo, G as Xo, H as Vo, J as qo, K as Go, L as ke, M as He, N as Zo, O as Fe, Q as _e, R as Jo, U as Qo, V as ts, W as es, X as os, Y as se, Z as _t, _ as ss, $ as ns, a0 as is, a1 as ze, a2 as rs, a3 as as, a4 as ls, a5 as cs, a6 as ds, a7 as hs, a8 as us } from "./inline-tool-convert-CreNXc4T.mjs";
22
+ import { i as N, g as Ho, a as f, b as be, c as E, l as I, S as y, d as Fo, e as _o, D as m, t as C, f as $, h as co, P as O, j as Ht, k as j, m as A, n as wt, o as ht, p as ho, q as J, T as jt, r as Ft, s as v, I as zo, u as Uo, v as ct, w as oe, x as Ko, y as Wo, z as $o, A as uo, B as Yo, C as po, E as fo, F as jo, G as Xo, H as Vo, J as qo, K as Go, L as ke, M as He, N as Zo, O as Fe, Q as _e, R as Jo, U as Qo, V as ts, W as es, X as os, Y as se, Z as _t, _ as ss, $ as ns, a0 as is, a1 as ze, a2 as rs, a3 as as, a4 as ls, a5 as cs, a6 as ds, a7 as hs, a8 as us } from "./inline-tool-convert-BBeAtLcM.mjs";
23
23
  function ps(a) {
24
24
  return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
25
25
  }
@@ -1458,7 +1458,7 @@ class As {
1458
1458
  * @returns {Promise<NotifierModule>} loaded notifier module
1459
1459
  */
1460
1460
  loadNotifierModule() {
1461
- return this.notifierModule !== null ? Promise.resolve(this.notifierModule) : (this.loadingPromise === null && (this.loadingPromise = import("./index-TdePW2Yb.mjs").then((t) => {
1461
+ return this.notifierModule !== null ? Promise.resolve(this.notifierModule) : (this.loadingPromise === null && (this.loadingPromise = import("./index-B6xvzBsa.mjs").then((t) => {
1462
1462
  const e = t;
1463
1463
  if (!this.isNotifierModule(e))
1464
1464
  throw new Error('notifier module does not expose a "show" method.');
@@ -6354,14 +6354,11 @@ class Pn extends T {
6354
6354
  * Uses lightweight i18n for English, loads i18next only for other locales.
6355
6355
  */
6356
6356
  async prepare() {
6357
- var o, s;
6357
+ var o;
6358
6358
  const t = this.config.i18n;
6359
- if (this.applyDefaultLocale(t == null ? void 0 : t.defaultLocale), (t == null ? void 0 : t.messages) !== void 0) {
6360
- this.lightweightI18n.setDictionary(t.messages), this.usingI18next = !1, this.updateConfigDirection((o = t.direction) != null ? o : "ltr");
6361
- return;
6362
- }
6359
+ this.applyDefaultLocale(t == null ? void 0 : t.defaultLocale);
6363
6360
  const e = t == null ? void 0 : t.locale;
6364
- e === void 0 || e === "auto" ? await this.detectAndSetLocale() : await this.setLocale(e), this.updateConfigDirection((s = t == null ? void 0 : t.direction) != null ? s : this.getDirection());
6361
+ e === void 0 || e === "auto" ? await this.detectAndSetLocale() : await this.setLocale(e), (t == null ? void 0 : t.messages) !== void 0 && this.setDictionary(t.messages), this.updateConfigDirection((o = t == null ? void 0 : t.direction) != null ? o : this.getDirection());
6365
6362
  }
6366
6363
  /**
6367
6364
  * Dynamically load i18next when needed for non-English locales
@@ -6369,7 +6366,7 @@ class Pn extends T {
6369
6366
  async ensureI18nextLoaded(t, e) {
6370
6367
  if (this.i18nextWrapper !== null)
6371
6368
  return;
6372
- const { loadI18next: o } = await import("./i18next-loader-DjtwmuRK.mjs");
6369
+ const { loadI18next: o } = await import("./i18next-loader-aMaQI76a.mjs");
6373
6370
  this.i18nextWrapper = await o(t, e);
6374
6371
  }
6375
6372
  /**
@@ -1,4 +1,4 @@
1
- import { e as i } from "./blok-BmjQP37u.mjs";
1
+ import { e as i } from "./blok-N-sAekLt.mjs";
2
2
  const l = async (e, r) => {
3
3
  const n = (await import("./i18next-CugVlwWp.mjs")).default.createInstance(), s = {
4
4
  lng: e,
@@ -1,4 +1,4 @@
1
- import { t as f, q as i } from "./inline-tool-convert-CreNXc4T.mjs";
1
+ import { t as f, q as i } from "./inline-tool-convert-BBeAtLcM.mjs";
2
2
  const a = {
3
3
  wrapper: i(
4
4
  "fixed z-[2] bottom-5 left-5",
@@ -18,7 +18,7 @@ let nt = (o = 21) => {
18
18
  return t;
19
19
  };
20
20
  var ot = /* @__PURE__ */ ((o) => (o.VERBOSE = "VERBOSE", o.INFO = "INFO", o.WARN = "WARN", o.ERROR = "ERROR", o))(ot || {});
21
- const rt = () => "0.4.3-beta.3", Ct = {
21
+ const rt = () => "0.4.3-beta.4", Ct = {
22
22
  BACKSPACE: 8,
23
23
  TAB: 9,
24
24
  ENTER: 13,
package/dist/full.mjs CHANGED
@@ -10,10 +10,10 @@ var e = (a, l, o) => l in a ? n(a, l, { enumerable: !0, configurable: !0, writab
10
10
  d.call(l, o) && e(a, o, l[o]);
11
11
  return a;
12
12
  }, r = (a, l) => t(a, c(l));
13
- import { B as v, v as A } from "./chunks/blok-BmjQP37u.mjs";
13
+ import { B as v, v as A } from "./chunks/blok-N-sAekLt.mjs";
14
14
  import { List as p, Header as f, Paragraph as I, Link as k, Italic as u, Bold as B } from "./tools.mjs";
15
15
  import { defaultBlockTools as H, defaultInlineTools as P } from "./tools.mjs";
16
- import { D as _ } from "./chunks/inline-tool-convert-CreNXc4T.mjs";
16
+ import { D as _ } from "./chunks/inline-tool-convert-BBeAtLcM.mjs";
17
17
  const m = {
18
18
  paragraph: {
19
19
  class: I,
package/dist/tools.mjs CHANGED
@@ -10,8 +10,8 @@ var U = (f, t, e) => t in f ? nt(f, t, { enumerable: !0, configurable: !0, writa
10
10
  it.call(t, e) && U(f, e, t[e]);
11
11
  return f;
12
12
  }, P = (f, t) => rt(f, st(t));
13
- import { t as L, D as g, a9 as et, aa as at, ab as lt, ac as ct, ad as dt, ae as ut, af as ht, ag as ft, ah as pt, ai as G, aj as j, ak as $, f as A, al as gt, am as mt, S as H, P as Et, an as Tt, l as Ct, J as At } from "./chunks/inline-tool-convert-CreNXc4T.mjs";
14
- import { a0 as Ot } from "./chunks/inline-tool-convert-CreNXc4T.mjs";
13
+ import { t as L, D as g, a9 as et, aa as at, ab as lt, ac as ct, ad as dt, ae as ut, af as ht, ag as ft, ah as pt, ai as G, aj as j, ak as $, f as A, al as gt, am as mt, S as H, P as Et, an as Tt, l as Ct, J as At } from "./chunks/inline-tool-convert-BBeAtLcM.mjs";
14
+ import { a0 as Ot } from "./chunks/inline-tool-convert-BBeAtLcM.mjs";
15
15
  const W = [
16
16
  "empty:before:pointer-events-none",
17
17
  "empty:before:text-gray-text",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jackuait/blok",
3
- "version": "0.4.3-beta.3",
3
+ "version": "0.4.3-beta.4",
4
4
  "description": "Blok — headless, highly extensible rich text editor built for developers who need to implement a block-based editing experience (similar to Notion) without building it from scratch",
5
5
  "module": "dist/blok.mjs",
6
6
  "types": "./types/index.d.ts",
@@ -204,17 +204,7 @@ export class I18n extends Module {
204
204
  // Set default locale if configured
205
205
  this.applyDefaultLocale(i18nConfig?.defaultLocale);
206
206
 
207
- // Handle custom messages (highest priority)
208
- if (i18nConfig?.messages !== undefined) {
209
- // For custom messages, use lightweight implementation with overrides
210
- this.lightweightI18n.setDictionary(i18nConfig.messages);
211
- this.usingI18next = false;
212
- // Set direction from config or default to 'ltr' for custom messages
213
- this.updateConfigDirection(i18nConfig.direction ?? 'ltr');
214
-
215
- return;
216
- }
217
-
207
+ // Load base translations first
218
208
  const requestedLocale = i18nConfig?.locale;
219
209
 
220
210
  if (requestedLocale === undefined || requestedLocale === 'auto') {
@@ -223,6 +213,11 @@ export class I18n extends Module {
223
213
  await this.setLocale(requestedLocale);
224
214
  }
225
215
 
216
+ // Merge custom messages on top of base translations (if provided)
217
+ if (i18nConfig?.messages !== undefined) {
218
+ this.setDictionary(i18nConfig.messages);
219
+ }
220
+
226
221
  // Update config.i18n.direction so other modules can access it via isRtl getter
227
222
  this.updateConfigDirection(i18nConfig?.direction ?? this.getDirection());
228
223
  }