@jackuait/blok 0.23.0 → 0.23.1

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.
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./chunk-5O_1xk2F.mjs";
2
- import { $i as t, $n as n, $r as r, A as i, Aa as a, Ai as o, Bi as s, C as c, Ca as l, D as u, Da as d, Di as f, Dt as p, E as m, Ea as h, Ei as g, Fi as _, Fn as v, Gi as y, Gn as ee, H as te, Hi as ne, Ii as re, Ji as ie, K as ae, Ki as oe, Li as se, Lt as ce, M as le, Ma as b, N as ue, Ni as de, Nr as fe, O as pe, Oa as me, Oi as he, On as ge, Q as _e, Qi as ve, Qn as ye, Qt as be, Ri as xe, Sa as Se, Si as Ce, T as we, Ta as x, Tn as Te, Ui as Ee, V as De, Vi as Oe, Vn as ke, Wi as Ae, Y as je, Yi as Me, Zi as S, Zr as Ne, _a as Pe, _i as Fe, ai as Ie, an as Le, b as Re, ba as C, bi as ze, ca as Be, ci as Ve, da as He, di as Ue, dn as We, ea as Ge, fa as Ke, fi as qe, ga as Je, gi as Ye, h as Xe, ha as Ze, hi as Qe, ia as w, j as $e, ja as T, ji as et, k as tt, ka as E, ki as D, la as nt, ln as rt, m as it, ma as at, mi as ot, mr as st, na as ct, ni as lt, oa as ut, oi as dt, or as ft, p as pt, pa as mt, qi as ht, qn as gt, qt as _t, ri as vt, rn as yt, sa as bt, ta as xt, ti as St, tn as Ct, tt as wt, u as Tt, ua as Et, ui as Dt, va as Ot, vi as kt, w as At, wa as jt, xa as O, xi as Mt, xt as Nt, ya as Pt, yi as Ft, zi as It } from "./constants-tXKHkDAG.mjs";
2
+ import { $i as t, $n as n, $r as r, A as i, Aa as a, Ai as o, Bi as s, C as c, Ca as l, D as u, Da as d, Di as f, Dt as p, E as m, Ea as h, Ei as g, Fi as _, Fn as v, Gi as y, Gn as ee, H as te, Hi as ne, Ii as re, Ji as ie, K as ae, Ki as oe, Li as se, Lt as ce, M as le, Ma as b, N as ue, Ni as de, Nr as fe, O as pe, Oa as me, Oi as he, On as ge, Q as _e, Qi as ve, Qn as ye, Qt as be, Ri as xe, Sa as Se, Si as Ce, T as we, Ta as x, Tn as Te, Ui as Ee, V as De, Vi as Oe, Vn as ke, Wi as Ae, Y as je, Yi as Me, Zi as S, Zr as Ne, _a as Pe, _i as Fe, ai as Ie, an as Le, b as Re, ba as C, bi as ze, ca as Be, ci as Ve, da as He, di as Ue, dn as We, ea as Ge, fa as Ke, fi as qe, ga as Je, gi as Ye, h as Xe, ha as Ze, hi as Qe, ia as w, j as $e, ja as T, ji as et, k as tt, ka as E, ki as D, la as nt, ln as rt, m as it, ma as at, mi as ot, mr as st, na as ct, ni as lt, oa as ut, oi as dt, or as ft, p as pt, pa as mt, qi as ht, qn as gt, qt as _t, ri as vt, rn as yt, sa as bt, ta as xt, ti as St, tn as Ct, tt as wt, u as Tt, ua as Et, ui as Dt, va as Ot, vi as kt, w as At, wa as jt, xa as O, xi as Mt, xt as Nt, ya as Pt, yi as Ft, zi as It } from "./constants-DR3sya6U.mjs";
3
3
  import { n as Lt, t as k } from "./objectSpread2-jlBcdYeb.mjs";
4
4
  import { n as A, t as Rt } from "./tw-DmW6-pCY.mjs";
5
5
  import { t as zt } from "./types-Csz3ou4X.mjs";
@@ -605,6 +605,10 @@ var rn = class {
605
605
  setReadOnly(e) {
606
606
  this.readOnly !== e && (this.readOnly = e, e ? (this.inputManager.removeInputEvents(), this.mutationHandler.unwatch()) : (this.inputManager.addInputEvents(), this.mutationHandler.watch()), typeof this.toolInstance.setReadOnly == "function" && this.toolInstance.setReadOnly(e));
607
607
  }
608
+ setPlaceholder(e) {
609
+ let t = this.toolInstance;
610
+ typeof t.setPlaceholder == "function" && t.setPlaceholder(e);
611
+ }
608
612
  async getActiveToolboxEntry() {
609
613
  var e = this;
610
614
  let t = e.tool.toolbox;
@@ -7532,6 +7536,13 @@ var _d = (e, t) => {
7532
7536
  get blocks() {
7533
7537
  return this.repository.blocks;
7534
7538
  }
7539
+ setPlaceholder(e) {
7540
+ var t, n;
7541
+ this.config.placeholder = e;
7542
+ let r = (t = this.config.defaultBlock) == null ? "paragraph" : t;
7543
+ (n = this.Blok.Tools.blockTools.get(r)) == null || n.setDefaultPlaceholder(e);
7544
+ for (let t of this.blocks) t.setPlaceholder(e);
7545
+ }
7535
7546
  get isBlokEmpty() {
7536
7547
  return this.repository.isBlokEmpty();
7537
7548
  }
@@ -13809,6 +13820,9 @@ var Wm = class {
13809
13820
  constructor({ name: e, constructable: t, config: n, api: r, isDefault: i, isInternal: a = !1, defaultPlaceholder: o }) {
13810
13821
  this.api = r, this.name = e, this.constructable = t, this.config = n, this.isDefault = i, this.isInternal = a, this.defaultPlaceholder = o;
13811
13822
  }
13823
+ setDefaultPlaceholder(e) {
13824
+ this.defaultPlaceholder = e;
13825
+ }
13812
13826
  get settings() {
13813
13827
  var e;
13814
13828
  let t = (e = this.config[ah.Config]) == null ? {} : e, n = {};
@@ -15591,6 +15605,20 @@ var sg, cg = me(), lg = class e {
15591
15605
  get: () => l(),
15592
15606
  set: (e) => u(e),
15593
15607
  toggle: () => u(l() === "full" ? "narrow" : "full")
15608
+ };
15609
+ let d = { pending: null }, f = () => r.moduleInstances.BlockManager, p = (e) => {
15610
+ d.pending = e;
15611
+ let t = f();
15612
+ t !== void 0 && t.setPlaceholder(e);
15613
+ };
15614
+ this.placeholder = {
15615
+ get: () => {
15616
+ var e;
15617
+ if (d.pending !== null) return d.pending;
15618
+ let t = this.initialConfiguration;
15619
+ return O(t) ? (e = t.placeholder) == null ? !1 : e : !1;
15620
+ },
15621
+ set: (e) => p(e)
15594
15622
  }, this.isReady = r.isReady.then(() => {
15595
15623
  if (i.pendingDestroy) {
15596
15624
  Object.values(r.moduleInstances).forEach((e) => {
@@ -15613,6 +15641,10 @@ var sg, cg = me(), lg = class e {
15613
15641
  let e = r.moduleInstances.UI;
15614
15642
  e !== void 0 && e.setWidthMode(s.pendingMode), s.pendingMode = null;
15615
15643
  }
15644
+ if (d.pending !== null) {
15645
+ let e = r.moduleInstances.BlockManager;
15646
+ e !== void 0 && e.setPlaceholder(d.pending), d.pending = null;
15647
+ }
15616
15648
  let t = window.location.hash.slice(1), o = t ? e.safeDecodeHash(t) : "";
15617
15649
  if (o) {
15618
15650
  let t = document.querySelector(`[data-blok-id="${CSS.escape(o)}"]`);