@jackuait/blok 0.13.1 → 0.13.2
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.cjs +1 -1
- package/dist/blok.iife.js +2 -2
- package/dist/blok.mjs +2 -2
- package/dist/chunks/{blok-BF9i6G_n.mjs → blok-Du6vYONn.mjs} +2 -2
- package/dist/chunks/{blok-C7mseAhu.cjs → blok-Xu27QC2G.cjs} +2 -2
- package/dist/chunks/{constants-BZ9pK9tm.cjs → constants-DDTVRO2H.cjs} +1 -1
- package/dist/chunks/{constants-jfK6xPl6.mjs → constants-DUuYY64n.mjs} +1 -1
- package/dist/chunks/{tools-Duq42I9m.cjs → tools-DOuVjow8.cjs} +1 -1
- package/dist/chunks/{tools-CrrBwp7I.mjs → tools-Tt-NXbRZ.mjs} +1 -1
- package/dist/full.cjs +1 -1
- package/dist/full.mjs +3 -3
- package/dist/react.cjs +1 -1
- package/dist/react.mjs +1 -1
- package/dist/tools.cjs +1 -1
- package/dist/tools.mjs +2 -2
- package/package.json +1 -1
- package/src/components/modules/ui.ts +9 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as e, t } from "./chunk-Bbb9LtOc.mjs";
|
|
2
|
-
import { $ as n, $t as r, A as i, At as a, B as o, Bt as s, Cn as c, Ct as l, D as u, Dt as d, En as f, Et as p, F as m, Fn as h, Ft as g, G as _, Gn as v, H as y, Hn as b, Ht as x, I as S, In as C, J as w, Jt as T, K as E, Kn as D, Kt as O, L as k, Ln as ee, Lt as A, M as j, Mr as te, Mt as ne, N as re, Nn as M, Nt as N, O as ie, Ot as ae, P as oe, Pn as P, Pt as F, Q as se, Qt as ce, R as le, Rn as ue, Rr as I, Rt as de, Sn as fe, St as pe, Tn as me, Tt as he, U as ge, Ut as _e, V as ve, Vn as L, Vt as ye, W as be, Wt as xe, X as Se, Xt as Ce, Y as we, Yt as Te, Z as Ee, Zt as De, _n as Oe, _t as ke, a as Ae, an as je, at as Me, bn as Ne, bt as Pe, c as Fe, ct as Ie, d as Le, dn as Re, dt as ze, en as Be, et as Ve, f as He, fn as Ue, fr as R, ft as We, g as Ge, gn as Ke, gt as qe, h as Je, hn as Ye, ht as Xe, i as Ze, in as Qe, it as $e, j as et, jt as tt, k as nt, kn as rt, kt as it, l as at, ln as ot, lt as st, mn as ct, mt as lt, n as ut, nn as dt, nt as ft, o as pt, on as mt, ot as ht, p as gt, pn as _t, pt as vt, q as yt, qt as bt, r as xt, rn as St, rt as Ct, s as wt, sn as Tt, sr as Et, st as Dt, t as Ot, tn as kt, tt as At, u as z, un as jt, ut as Mt, v as Nt, vt as Pt, wn as Ft, wt as It, xn as Lt, xt as Rt, yn as zt, yt as Bt, z as Vt, zr as Ht, zt as Ut } from "./constants-
|
|
2
|
+
import { $ as n, $t as r, A as i, At as a, B as o, Bt as s, Cn as c, Ct as l, D as u, Dt as d, En as f, Et as p, F as m, Fn as h, Ft as g, G as _, Gn as v, H as y, Hn as b, Ht as x, I as S, In as C, J as w, Jt as T, K as E, Kn as D, Kt as O, L as k, Ln as ee, Lt as A, M as j, Mr as te, Mt as ne, N as re, Nn as M, Nt as N, O as ie, Ot as ae, P as oe, Pn as P, Pt as F, Q as se, Qt as ce, R as le, Rn as ue, Rr as I, Rt as de, Sn as fe, St as pe, Tn as me, Tt as he, U as ge, Ut as _e, V as ve, Vn as L, Vt as ye, W as be, Wt as xe, X as Se, Xt as Ce, Y as we, Yt as Te, Z as Ee, Zt as De, _n as Oe, _t as ke, a as Ae, an as je, at as Me, bn as Ne, bt as Pe, c as Fe, ct as Ie, d as Le, dn as Re, dt as ze, en as Be, et as Ve, f as He, fn as Ue, fr as R, ft as We, g as Ge, gn as Ke, gt as qe, h as Je, hn as Ye, ht as Xe, i as Ze, in as Qe, it as $e, j as et, jt as tt, k as nt, kn as rt, kt as it, l as at, ln as ot, lt as st, mn as ct, mt as lt, n as ut, nn as dt, nt as ft, o as pt, on as mt, ot as ht, p as gt, pn as _t, pt as vt, q as yt, qt as bt, r as xt, rn as St, rt as Ct, s as wt, sn as Tt, sr as Et, st as Dt, t as Ot, tn as kt, tt as At, u as z, un as jt, ut as Mt, v as Nt, vt as Pt, wn as Ft, wt as It, xn as Lt, xt as Rt, yn as zt, yt as Bt, z as Vt, zr as Ht, zt as Ut } from "./constants-DUuYY64n.mjs";
|
|
3
3
|
import { t as B } from "./objectSpread2-jlBcdYeb.mjs";
|
|
4
4
|
import { n as V } from "./tw-CqxBf-1Y.mjs";
|
|
5
5
|
import { n as Wt } from "./lightweight-i18n-DF9Pupws.mjs";
|
package/dist/full.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunks/chunk-CZKdLM9-.cjs`);const e=require(`./chunks/blok-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunks/chunk-CZKdLM9-.cjs`);const e=require(`./chunks/blok-Xu27QC2G.cjs`),t=require(`./chunks/constants-DDTVRO2H.cjs`),n=require(`./chunks/objectSpread2-iNkE6aJh.cjs`),r=require(`./chunks/tools-DOuVjow8.cjs`);var i={paragraph:{class:r.x,inlineToolbar:!0,config:{preserveBlank:!0}},header:{class:r.b,inlineToolbar:!0},list:{class:r.y,inlineToolbar:!0}},a=n.t(n.t({},i),{},{bold:{class:r.l},italic:{class:r.c},marker:{class:r.o},underline:{class:r.a},strikethrough:{class:r.i},link:{class:r.s}});exports.Blok=e.t,exports.Bold=r.l,exports.DATA_ATTR=t.Rr,exports.Header=r.b,exports.Italic=r.c,exports.Link=r.s,exports.List=r.y,exports.Marker=r.o,exports.Paragraph=r.x,exports.Strikethrough=r.i,exports.Toggle=r._,exports.Underline=r.a,exports.allTools=a,exports.defaultBlockTools=r.t,exports.defaultInlineTools=r.n,exports.defaultTools=i,exports.version=e.n;
|
package/dist/full.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as e, t } from "./chunks/blok-
|
|
2
|
-
import { Rr as n } from "./chunks/constants-
|
|
1
|
+
import { n as e, t } from "./chunks/blok-Du6vYONn.mjs";
|
|
2
|
+
import { Rr as n } from "./chunks/constants-DUuYY64n.mjs";
|
|
3
3
|
import { t as r } from "./chunks/objectSpread2-jlBcdYeb.mjs";
|
|
4
|
-
import { _ as i, a, b as o, c as s, i as c, l, n as u, o as d, s as f, t as p, x as m, y as h } from "./chunks/tools-
|
|
4
|
+
import { _ as i, a, b as o, c as s, i as c, l, n as u, o as d, s as f, t as p, x as m, y as h } from "./chunks/tools-Tt-NXbRZ.mjs";
|
|
5
5
|
//#region src/full.ts
|
|
6
6
|
var g = {
|
|
7
7
|
paragraph: {
|
package/dist/react.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunks/chunk-CZKdLM9-.cjs`);const e=require(`./chunks/blok-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunks/chunk-CZKdLM9-.cjs`);const e=require(`./chunks/blok-Xu27QC2G.cjs`),t=require(`./chunks/objectSpread2-iNkE6aJh.cjs`);let n=require(`react`),r=require(`react/jsx-runtime`);var i=new WeakMap;function a(e,t){i.set(e,t)}function o(e){return i.get(e)}function s(e){i.delete(e)}function c(r,i){let[o,c]=(0,n.useState)(null),u=(0,n.useRef)(r);u.current=r;let d=(0,n.useRef)({editor:null,holder:null,destroyTimeout:null,isDestroyed:!1,depsToken:null}),f=(0,n.useMemo)(()=>({}),i==null?[]:i);(0,n.useEffect)(()=>{if(typeof window>`u`)return;let n=d.current;if(n.destroyTimeout!==null&&(clearTimeout(n.destroyTimeout),n.destroyTimeout=null),n.editor!==null&&!n.isDestroyed&&n.depsToken===f)return c(n.editor),()=>{l(n,c)};if(n.editor!==null&&!n.isDestroyed){s(n.editor);try{n.editor.destroy()}catch(e){}n.editor=null,n.holder=null,n.isDestroyed=!0,c(null)}let r=document.createElement(`div`);n.holder=r,n.isDestroyed=!1,n.depsToken=f;let i=u.current,o=new e.t(t.t(t.t({},i),{},{holder:r,onReady:()=>{var e,t;(e=(t=u.current).onReady)==null||e.call(t)},onChange:(...e)=>{var t,n;(t=(n=u.current).onChange)==null||t.call(n,...e)}}));return n.editor=o,a(o,r),o.isReady.then(()=>{n.editor===o&&!n.isDestroyed&&c(o)}).catch(()=>{if(n.editor===o&&!n.isDestroyed){s(o);try{o.destroy()}catch(e){}n.editor=null,n.holder=null,n.isDestroyed=!0,c(null)}}),()=>{l(n,c)}},[f]);let{readOnly:p}=r;(0,n.useEffect)(()=>{o!==null&&o.readOnly.set(p==null?!1:p)},[o,p]);let{autofocus:m}=r;return(0,n.useEffect)(()=>{o===null||!m||o.focus()},[o,m]),o}function l(e,t){e.destroyTimeout=setTimeout(()=>{if(e.editor!==null){s(e.editor);try{e.editor.destroy()}catch(e){}e.editor=null,e.holder=null,e.isDestroyed=!0,e.destroyTimeout=null,t(null)}},0)}var u=[`editor`],d=(0,n.forwardRef)(function(i,a){let{editor:s}=i,c=e.r(i,u),l=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(s===null||l.current===null)return;let e=o(s);if(e!==void 0)return l.current.appendChild(e),()=>{e.remove()}},[s]),(0,r.jsx)(`div`,t.t({ref:e=>{if(l.current=e,typeof a==`function`)a(e);else if(a!=null){let t=a;t.current=e}}},c))});exports.BlokContent=d,exports.useBlok=c;
|
package/dist/react.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as e, t } from "./chunks/blok-
|
|
1
|
+
import { r as e, t } from "./chunks/blok-Du6vYONn.mjs";
|
|
2
2
|
import { t as n } from "./chunks/objectSpread2-jlBcdYeb.mjs";
|
|
3
3
|
import { forwardRef as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
4
4
|
import { jsx as c } from "react/jsx-runtime";
|
package/dist/tools.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunks/chunk-CZKdLM9-.cjs`);const e=require(`./chunks/constants-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunks/chunk-CZKdLM9-.cjs`);const e=require(`./chunks/constants-DDTVRO2H.cjs`),t=require(`./chunks/tools-DOuVjow8.cjs`);exports.Bold=t.l,exports.Callout=t.g,exports.Code=t.d,exports.Convert=e.m,exports.Database=t.h,exports.DatabaseRow=t.m,exports.Divider=t.p,exports.Header=t.b,exports.Image=t.u,exports.InlineCode=t.r,exports.Italic=t.c,exports.Link=t.s,exports.List=t.y,exports.Marker=t.o,exports.Paragraph=t.x,exports.Quote=t.f,exports.Strikethrough=t.i,exports.Table=t.v,exports.Toggle=t._,exports.Underline=t.a,exports.defaultBlockTools=t.t,exports.defaultInlineTools=t.n;
|
package/dist/tools.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { m as e } from "./chunks/constants-
|
|
2
|
-
import { _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, x as b, y as x } from "./chunks/tools-
|
|
1
|
+
import { m as e } from "./chunks/constants-DUuYY64n.mjs";
|
|
2
|
+
import { _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, x as b, y as x } from "./chunks/tools-Tt-NXbRZ.mjs";
|
|
3
3
|
export { u as Bold, s as Callout, a as Code, e as Convert, c as Database, d as DatabaseRow, m as Divider, r as Header, v as Image, h as InlineCode, i as Italic, g as Link, x as List, p as Marker, b as Paragraph, o as Quote, l as Strikethrough, y as Table, t as Toggle, n as Underline, _ as defaultBlockTools, f as defaultInlineTools };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jackuait/blok",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
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
|
"main": "./dist/blok.cjs",
|
|
@@ -256,6 +256,15 @@ export class UI extends Module<UINodes> {
|
|
|
256
256
|
* @param {boolean} readOnlyEnabled - "read only" state
|
|
257
257
|
*/
|
|
258
258
|
public toggleReadOnly(readOnlyEnabled: boolean): void {
|
|
259
|
+
/**
|
|
260
|
+
* Collapse the bottom zone in read-only mode. Its only purpose is to act as
|
|
261
|
+
* a clickable area below the last block for adding/focusing a block, which is
|
|
262
|
+
* disabled in read-only mode. Restore the configured min-height when editing.
|
|
263
|
+
*/
|
|
264
|
+
if (this.nodes.bottomZone) {
|
|
265
|
+
this.nodes.bottomZone.style.minHeight = readOnlyEnabled ? '0px' : `${this.config.minHeight}px`;
|
|
266
|
+
}
|
|
267
|
+
|
|
259
268
|
/**
|
|
260
269
|
* Prepare components based on read-only state
|
|
261
270
|
*/
|