@jackuait/blok 0.21.1 → 0.23.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
@@ -59,7 +59,18 @@ new Blok({
59
59
 
60
60
  ### Other entry points
61
61
 
62
- - `@jackuait/blok/react` — a `useBlok` hook and a `BlokContent` component for React 18/19.
62
+ - `@jackuait/blok/react` — React 18/19 adapter. The recommended entry point is `<BlokEditor>`, an all-in-one component that forwards a ref to the live `Blok` instance:
63
+
64
+ ```tsx
65
+ const ref = useRef<Blok | null>(null);
66
+ <BlokEditor ref={ref} tools={tools} data={initialData} theme={theme} onReady={(editor) => {/* editor ready */}} />;
67
+ ```
68
+
69
+ `data` is the **initial content only** — the editor owns the document after mount. Read content via `onChange` or `ref.current.save()`; replace it via `ref.current.render(newData)`; passing a new `data` reference does not reload content.
70
+
71
+ Reactive props (`readOnly`, `theme`, `width`, `autofocus`) sync without remounting. When structural config like `tools` needs to change, pass a `deps` array — the editor is destroyed and recreated whenever any dep value changes.
72
+
73
+ For advanced control (e.g., rendering outside a single container), use `useBlok` + `BlokContent` directly.
63
74
  - `@jackuait/blok/markdown` — `markdownToBlocks(md)` to import Markdown (GFM, with optional math) as Blok data.
64
75
  - `@jackuait/blok/locales` — locale data, if you'd rather load it yourself.
65
76
 
package/dist/blok.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./chunks/blok-DrMzzi_n.cjs`),t=require(`./chunks/constants-DGJO_Nr-.cjs`);exports.Blok=e.t,exports.EditorJS=e.t,exports.default=e.t,exports.DATA_ATTR=t.ja,exports.version=e.n,exports.wrapLegacyInlineTool=e.r;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./chunks/blok-D4WXeg3t.cjs`),t=require(`./chunks/constants-BbCnmzAr.cjs`);exports.Blok=e.t,exports.EditorJS=e.t,exports.default=e.t,exports.DATA_ATTR=t.ja,exports.version=e.n,exports.wrapLegacyInlineTool=e.r;