@jackuait/blok 0.15.0 → 0.15.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.
package/dist/full.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunks/blok-CEYQZt_c.cjs`),t=require(`./chunks/constants-D5cYHg42.cjs`),n=require(`./chunks/objectSpread2-iNkE6aJh.cjs`),r=require(`./chunks/tools-D_HqQ7wn.cjs`);var i={paragraph:{class:r.E,inlineToolbar:!0,config:{preserveBlank:!0}},header:{class:r.T,inlineToolbar:!0},list:{class:r.w,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.hi,exports.Header=r.T,exports.Italic=r.c,exports.Link=r.s,exports.List=r.w,exports.Marker=r.o,exports.Paragraph=r.E,exports.Strikethrough=r.i,exports.Toggle=r.S,exports.Underline=r.a,exports.allTools=a,exports.defaultBlockTools=r.t,exports.defaultInlineTools=r.n,exports.defaultTools=i,exports.version=e.n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunks/blok-By8CgA9B.cjs`),t=require(`./chunks/constants-Cz29UuPH.cjs`),n=require(`./chunks/objectSpread2-iNkE6aJh.cjs`),r=require(`./chunks/tools-PKGRD99i.cjs`);var i={paragraph:{class:r.E,inlineToolbar:!0,config:{preserveBlank:!0}},header:{class:r.T,inlineToolbar:!0},list:{class:r.w,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.hi,exports.Header=r.T,exports.Italic=r.c,exports.Link=r.s,exports.List=r.w,exports.Marker=r.o,exports.Paragraph=r.E,exports.Strikethrough=r.i,exports.Toggle=r.S,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-CLpOs5vp.mjs";
2
- import { hi as n } from "./chunks/constants-Dsh6wwb1.mjs";
1
+ import { n as e, t } from "./chunks/blok-D8WF1Faf.mjs";
2
+ import { hi as n } from "./chunks/constants-B7YKRGs2.mjs";
3
3
  import { t as r } from "./chunks/objectSpread2-jlBcdYeb.mjs";
4
- import { E as i, S as a, T as o, a as s, c, i as l, l as u, n as d, o as f, s as p, t as m, w as h } from "./chunks/tools-D834YyD8.mjs";
4
+ import { E as i, S as a, T as o, a as s, c, i as l, l as u, n as d, o as f, s as p, t as m, w as h } from "./chunks/tools-D5QTbJRM.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-BL1yB9zm.cjs`);const e=require(`./chunks/blok-CEYQZt_c.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;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunks/chunk-BL1yB9zm.cjs`);const e=require(`./chunks/blok-By8CgA9B.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-CLpOs5vp.mjs";
1
+ import { r as e, t } from "./chunks/blok-D8WF1Faf.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`});const e=require(`./chunks/constants-D5cYHg42.cjs`),t=require(`./chunks/tools-D_HqQ7wn.cjs`);exports.Bold=t.l,exports.Bookmark=t.u,exports.Callout=t.x,exports.Code=t.g,exports.Column=t.p,exports.ColumnList=t.m,exports.Columns=t.f,exports.Convert=e.m,exports.Database=t.b,exports.DatabaseRow=t.y,exports.Divider=t.v,exports.Embed=t.d,exports.Header=t.T,exports.Image=t.h,exports.InlineCode=t.r,exports.Italic=t.c,exports.Link=t.s,exports.List=t.w,exports.Marker=t.o,exports.Paragraph=t.E,exports.Quote=t._,exports.Strikethrough=t.i,exports.Table=t.C,exports.Toggle=t.S,exports.Underline=t.a,exports.defaultBlockTools=t.t,exports.defaultInlineTools=t.n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunks/constants-Cz29UuPH.cjs`),t=require(`./chunks/tools-PKGRD99i.cjs`);exports.Bold=t.l,exports.Bookmark=t.u,exports.Callout=t.x,exports.Code=t.g,exports.Column=t.p,exports.ColumnList=t.m,exports.Columns=t.f,exports.Convert=e.m,exports.Database=t.b,exports.DatabaseRow=t.y,exports.Divider=t.v,exports.Embed=t.d,exports.Header=t.T,exports.Image=t.h,exports.InlineCode=t.r,exports.Italic=t.c,exports.Link=t.s,exports.List=t.w,exports.Marker=t.o,exports.Paragraph=t.E,exports.Quote=t._,exports.Strikethrough=t.i,exports.Table=t.C,exports.Toggle=t.S,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-Dsh6wwb1.mjs";
2
- import { C as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S, v as C, w, x as T, y as E } from "./chunks/tools-D834YyD8.mjs";
1
+ import { m as e } from "./chunks/constants-B7YKRGs2.mjs";
2
+ import { C as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S, v as C, w, x as T, y as E } from "./chunks/tools-D5QTbJRM.mjs";
3
3
  export { m as Bold, S as Bookmark, T as Callout, d as Code, v as Column, h as ColumnList, u as Columns, e as Convert, s as Database, E as DatabaseRow, C as Divider, l as Embed, i as Header, f as Image, y as InlineCode, c as Italic, b as Link, w as List, _ as Marker, n as Paragraph, a as Quote, p as Strikethrough, t as Table, r as Toggle, o as Underline, x as defaultBlockTools, g as defaultInlineTools };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jackuait/blok",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
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",
@@ -32,6 +32,8 @@ export const Database: BlockToolConstructable;
32
32
  export const DatabaseRow: BlockToolConstructable; // DatabaseRowTool (block tool), distinct from DatabaseRow interface in types/tools/database.d.ts
33
33
  export const Image: BlockToolConstructable;
34
34
  export const Code: BlockToolConstructable;
35
+ export const Embed: BlockToolConstructable;
36
+ export const Bookmark: BlockToolConstructable;
35
37
  export const ColumnList: ColumnListConstructable;
36
38
  export const Column: ColumnConstructable;
37
39
  /**
@@ -84,6 +86,8 @@ export const defaultBlockTools: {
84
86
  readonly image: {};
85
87
  readonly column_list: {};
86
88
  readonly column: {};
89
+ readonly embed: {};
90
+ readonly bookmark: {};
87
91
  };
88
92
 
89
93
  /**