{"_id":"@amusendame/beakblock-core","_rev":"3-7d12e05973758c832253bba4ba1ee02a","name":"@amusendame/beakblock-core","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@amusendame/beakblock-core","version":"0.1.0","keywords":["editor","rich-text","prosemirror","block-editor","wysiwyg","notion-like","typescript","text-editor","content-editor","document-editor"],"license":"Apache-2.0","_id":"@amusendame/beakblock-core@0.1.0","maintainers":[{"name":"amusendame","email":"aurthurmusendame@gmail.com"}],"homepage":"https://github.com/aurthurm/beakblock#readme","bugs":{"url":"https://github.com/aurthurm/beakblock/issues"},"dist":{"shasum":"2c4cf57610d4d594369085041b9c8fe498ee3930","tarball":"https://registry.npmjs.org/@amusendame/beakblock-core/-/beakblock-core-0.1.0.tgz","fileCount":210,"integrity":"sha512-RYSpUgg2FAZYA9D0g8kNM+QdZNwtKJ7OldNJPexsCHnJplSLcSbmMgsy2JNPeCWI2qo0juMw1/6CyrlV9FGRMw==","signatures":[{"sig":"MEQCID6Htrg+sESxmSqMousJx4ZMB075DljxW4IbCCIbLq85AiAFWW3qq0BXQHg8l7OL6jZNudoUo0xQA9YttDm5t9Ngww==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2727138},"main":"./dist/index.js","type":"module","_from":"file:amusendame-beakblock-core-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./styles":"./dist/styles/editor.css","./styles/editor.css":"./dist/styles/editor.css"},"scripts":{"dev":"vite build --watch","lint":"eslint src","test":"vitest run","build":"vite build && cp -r src/styles dist/","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"amusendame","email":"aurthurmusendame@gmail.com"},"_resolved":"/tmp/72f930a8a995e4d81295809aa348b6fc/amusendame-beakblock-core-0.1.0.tgz","_integrity":"sha512-RYSpUgg2FAZYA9D0g8kNM+QdZNwtKJ7OldNJPexsCHnJplSLcSbmMgsy2JNPeCWI2qo0juMw1/6CyrlV9FGRMw==","repository":{"url":"git+https://github.com/aurthurm/beakblock.git","type":"git","directory":"packages/core"},"_npmVersion":"11.7.0","description":"Framework-agnostic core for BeakBlock editor","directories":{},"sideEffects":["*.css"],"_nodeVersion":"24.12.0","dependencies":{"uuid":"^11.0.5","unified":"^11.0.5","remark-gfm":"^4.0.1","remark-parse":"^11.0.0","mdast-util-gfm":"^3.1.0","prosemirror-view":"^1.37.1","hast-util-to-html":"^9.0.5","prosemirror-model":"^1.24.1","prosemirror-state":"^1.4.3","mdast-util-to-hast":"^13.2.1","prosemirror-keymap":"^1.2.2","prosemirror-history":"^1.4.1","prosemirror-commands":"^1.6.2","prosemirror-gapcursor":"^1.3.2","prosemirror-transform":"^1.10.2","mdast-util-to-markdown":"^2.1.2","prosemirror-dropcursor":"^1.8.1","prosemirror-inputrules":"^1.4.0","prosemirror-schema-list":"^1.4.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.7","jsdom":"^25.0.1","vitest":"^2.1.8","typescript":"^5.7.2","@types/uuid":"^10.0.0","@types/mdast":"^4.0.4","vite-plugin-dts":"^4.4.0"},"peerDependencies":{"yjs":"^13.0.0","y-prosemirror":"^1.0.0"},"peerDependenciesMeta":{"yjs":{"optional":true},"y-prosemirror":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/beakblock-core_0.1.0_1776513838096_0.6987300497345044","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@amusendame/beakblock-core","version":"0.1.1","keywords":["editor","rich-text","prosemirror","block-editor","wysiwyg","notion-like","typescript","text-editor","content-editor","document-editor"],"license":"Apache-2.0","_id":"@amusendame/beakblock-core@0.1.1","maintainers":[{"name":"amusendame","email":"aurthurmusendame@gmail.com"}],"homepage":"https://github.com/aurthurm/beakblock#readme","bugs":{"url":"https://github.com/aurthurm/beakblock/issues"},"dist":{"shasum":"4f0f135cd0850a39ef6ee574959e2a7279762763","tarball":"https://registry.npmjs.org/@amusendame/beakblock-core/-/beakblock-core-0.1.1.tgz","fileCount":214,"integrity":"sha512-EaBgi5r83mkgn+YZ0o+sax3pJuW69fRMK783WpErkQWOf7w8Z7W74mxbxIMuq11WZW7rLHByOYw25Z1CQyt9Rg==","signatures":[{"sig":"MEYCIQDozxrDTPBlvGYz6ic4nLTz+6UlQG95guyu2u+8Ee8XOwIhAJqK0kDMNSBu7aHlGkBgil8BJlZHafe+JqQNdTFn9gP9","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2765336},"main":"./dist/index.js","type":"module","_from":"file:amusendame-beakblock-core-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./styles":"./dist/styles/editor.css","./styles/editor.css":"./dist/styles/editor.css"},"scripts":{"dev":"vite build --watch","lint":"eslint src","test":"vitest run","build":"vite build && cp -r src/styles dist/","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"amusendame","email":"aurthurmusendame@gmail.com"},"_resolved":"/tmp/e7d4bdb6f13faf1ab033afd930ed9104/amusendame-beakblock-core-0.1.1.tgz","_integrity":"sha512-EaBgi5r83mkgn+YZ0o+sax3pJuW69fRMK783WpErkQWOf7w8Z7W74mxbxIMuq11WZW7rLHByOYw25Z1CQyt9Rg==","repository":{"url":"git+https://github.com/aurthurm/beakblock.git","type":"git","directory":"packages/core"},"_npmVersion":"11.7.0","description":"Framework-agnostic core for BeakBlock editor","directories":{},"sideEffects":["*.css"],"_nodeVersion":"24.12.0","dependencies":{"uuid":"^11.0.5","unified":"^11.0.5","remark-gfm":"^4.0.1","remark-parse":"^11.0.0","mdast-util-gfm":"^3.1.0","prosemirror-view":"^1.37.1","hast-util-to-html":"^9.0.5","prosemirror-model":"^1.24.1","prosemirror-state":"^1.4.3","mdast-util-to-hast":"^13.2.1","prosemirror-keymap":"^1.2.2","prosemirror-history":"^1.4.1","prosemirror-commands":"^1.6.2","prosemirror-gapcursor":"^1.3.2","prosemirror-transform":"^1.10.2","mdast-util-to-markdown":"^2.1.2","prosemirror-dropcursor":"^1.8.1","prosemirror-inputrules":"^1.4.0","prosemirror-schema-list":"^1.4.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.7","jsdom":"^25.0.1","vitest":"^2.1.8","typescript":"^5.7.2","@types/uuid":"^10.0.0","@types/mdast":"^4.0.4","vite-plugin-dts":"^4.4.0"},"peerDependencies":{"yjs":"^13.0.0","y-prosemirror":"^1.0.0"},"peerDependenciesMeta":{"yjs":{"optional":true},"y-prosemirror":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/beakblock-core_0.1.1_1776521329466_0.1597161590346603","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@amusendame/beakblock-core","version":"0.1.2","description":"Framework-agnostic core for BeakBlock editor","license":"Apache-2.0","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./styles":"./dist/styles/editor.css","./styles/editor.css":"./dist/styles/editor.css"},"keywords":["editor","rich-text","prosemirror","block-editor","wysiwyg","notion-like","typescript","text-editor","content-editor","document-editor"],"dependencies":{"hast-util-to-html":"^9.0.5","mdast-util-gfm":"^3.1.0","mdast-util-to-hast":"^13.2.1","mdast-util-to-markdown":"^2.1.2","prosemirror-commands":"^1.6.2","prosemirror-dropcursor":"^1.8.1","prosemirror-gapcursor":"^1.3.2","prosemirror-history":"^1.4.1","prosemirror-inputrules":"^1.4.0","prosemirror-keymap":"^1.2.2","prosemirror-model":"^1.24.1","prosemirror-schema-list":"^1.4.1","prosemirror-state":"^1.4.3","prosemirror-transform":"^1.10.2","prosemirror-view":"^1.37.1","remark-gfm":"^4.0.1","remark-parse":"^11.0.0","unified":"^11.0.5","uuid":"^11.0.5"},"devDependencies":{"@types/mdast":"^4.0.4","@types/uuid":"^10.0.0","jsdom":"^25.0.1","typescript":"^5.7.2","vite":"^6.0.7","vite-plugin-dts":"^4.4.0","vitest":"^2.1.8"},"peerDependencies":{"y-prosemirror":"^1.0.0","yjs":"^13.0.0"},"peerDependenciesMeta":{"yjs":{"optional":true},"y-prosemirror":{"optional":true}},"sideEffects":["*.css"],"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"repository":{"type":"git","url":"git+https://github.com/aurthurm/beakblock.git","directory":"packages/core"},"homepage":"https://github.com/aurthurm/beakblock#readme","bugs":{"url":"https://github.com/aurthurm/beakblock/issues"},"scripts":{"build":"vite build && cp -r src/styles dist/","dev":"vite build --watch","lint":"eslint src","test":"vitest run","test:watch":"vitest","clean":"rm -rf dist"},"_id":"@amusendame/beakblock-core@0.1.2","_integrity":"sha512-AD9fIbQgNyQls2U3ulT3nt5c0/ftrOzcLgZVuY+h9orY2JfouChm5nqgqv/1p1DkHCeo/NhMdj8C4Zv6hu0esQ==","_resolved":"/tmp/3a71f99943a3f90d08aef0878876eb3a/amusendame-beakblock-core-0.1.2.tgz","_from":"file:amusendame-beakblock-core-0.1.2.tgz","_nodeVersion":"22.22.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-AD9fIbQgNyQls2U3ulT3nt5c0/ftrOzcLgZVuY+h9orY2JfouChm5nqgqv/1p1DkHCeo/NhMdj8C4Zv6hu0esQ==","shasum":"c478e8d924cd74a30d518fd931e9ecf2597857a7","tarball":"https://registry.npmjs.org/@amusendame/beakblock-core/-/beakblock-core-0.1.2.tgz","fileCount":214,"unpackedSize":2778388,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDy0mKmKMIPOpMj8QuKUK4REERSK+X7RzS0A9y6uZ011AIgSEFZUiQhD05rJWGS36W+uSu2aTNjX6Z7VpXonwnRJMk="}]},"_npmUser":{"name":"amusendame","email":"aurthurmusendame@gmail.com"},"directories":{},"maintainers":[{"name":"amusendame","email":"aurthurmusendame@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/beakblock-core_0.1.2_1776580961775_0.4416127932784464"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-18T12:03:57.942Z","modified":"2026-04-19T06:42:42.066Z","0.1.0":"2026-04-18T12:03:58.292Z","0.1.1":"2026-04-18T14:08:49.743Z","0.1.2":"2026-04-19T06:42:41.972Z"},"bugs":{"url":"https://github.com/aurthurm/beakblock/issues"},"license":"Apache-2.0","homepage":"https://github.com/aurthurm/beakblock#readme","keywords":["editor","rich-text","prosemirror","block-editor","wysiwyg","notion-like","typescript","text-editor","content-editor","document-editor"],"repository":{"type":"git","url":"git+https://github.com/aurthurm/beakblock.git","directory":"packages/core"},"description":"Framework-agnostic core for BeakBlock editor","maintainers":[{"name":"amusendame","email":"aurthurmusendame@gmail.com"}],"readme":"# @beakblock/core\n\nFramework-agnostic core for the BeakBlock rich text editor.\n\n## Key Features\n\n- **Public API** - All ProseMirror internals are accessible via `editor.pm.*`\n- **Block-based** - JSON document format similar to BlockNote\n- **Extensible** - Add custom blocks, marks, and plugins\n- **TypeScript** - Full type safety\n- **Markdown** - `markdownToBlocks` / `blocksToMarkdown`, optional GFM, and clipboard paste (see **[docs/markdown](../../docs/markdown.md)**)\n\n## Block reference\n\nEvery built-in block type (`paragraph`, `heading`, `table`, …) is documented with JSON examples and props in **[docs/blocks](../../docs/blocks/README.md)**. Start at the index, or open **[inline content](../../docs/blocks/inline-content.md)** for `text` / `link` / `icon` inside blocks.\n\n## Installation\n\n```bash\nnpm install @beakblock/core\n# or\npnpm add @beakblock/core\n```\n\n## Quick Start\n\n```typescript\nimport { BeakBlockEditor } from '@beakblock/core';\nimport '@beakblock/core/styles/editor.css';\n\nconst editor = new BeakBlockEditor({\n  element: document.getElementById('editor'),\n  initialContent: [\n    {\n      type: 'heading',\n      props: { level: 1 },\n      content: [{ type: 'text', text: 'Hello World', styles: {} }],\n    },\n    {\n      type: 'paragraph',\n      content: [{ type: 'text', text: 'Start editing...', styles: {} }],\n    },\n  ],\n});\n\n// Access document\nconst blocks = editor.getDocument();\n\n// Listen to changes\neditor.on('change', ({ blocks }) => {\n  console.log('Document changed:', blocks);\n});\n```\n\n## ProseMirror Access\n\nUnlike other editors, BeakBlock exposes the full ProseMirror API:\n\n```typescript\n// Direct access to ProseMirror view and state\neditor.pm.view;        // EditorView\neditor.pm.state;       // EditorState\neditor.pm.doc;         // Document node\n\n// Create and dispatch transactions\nconst tr = editor.pm.createTransaction();\ntr.insertText('Hello');\neditor.pm.dispatch(tr);\n\n// Modify node attributes\neditor.pm.setNodeAttrs(pos, { level: 2 });\n\n// Toggle marks\neditor.pm.toggleMark('bold');\n\n// Add plugins at runtime\neditor.pm.addPlugin(myPlugin);\n```\n\n## Styling\n\nImport the default styles, which use CSS variables compatible with shadcn/ui:\n\n```typescript\nimport '@beakblock/core/styles/editor.css';\n```\n\nOr create your own styles targeting `.beakblock-editor` and `.ProseMirror`.\n\n## API Reference\n\n### BeakBlockEditor\n\nThe main editor class.\n\n```typescript\n// Constructor\nnew BeakBlockEditor(config?: EditorConfig)\n\n// Document operations\neditor.getDocument(): Block[]\neditor.setDocument(blocks: Block[]): void\neditor.getBlock(id: string): Block | undefined\neditor.getSelectedBlocks(): Block[]\n\n// Block operations\neditor.insertBlocks(blocks, referenceBlock, placement): void\neditor.updateBlock(block, update): void\neditor.removeBlocks(blocks): void\n\n// Formatting\neditor.toggleBold(): boolean\neditor.toggleItalic(): boolean\neditor.toggleUnderline(): boolean\neditor.toggleStrikethrough(): boolean\neditor.toggleCode(): boolean\neditor.setLink(href, title?): void\neditor.removeLink(): void\n\n// Focus\neditor.focus(position?): void\neditor.blur(): void\neditor.hasFocus: boolean\n\n// Serialization\neditor.toJSON(): Block[]\neditor.fromJSON(blocks): void\n\n// History (undo/redo)\neditor.undo(): boolean\neditor.redo(): boolean\neditor.enableHistory(): void\neditor.disableHistory(): void\neditor.isHistoryEnabled: boolean\n\n// Collaboration (Y.js)\neditor.enableCollaboration({ plugins }): void\neditor.disableCollaboration(): void\neditor.isCollaborating: boolean\n\n// Versioning (configure versioning.adapter)\neditor.saveVersion(options?): Promise<DocumentVersion>\neditor.listVersions(): Promise<DocumentVersion[]>\neditor.getVersion(id): Promise<DocumentVersion | null>\neditor.restoreVersion(id): Promise<boolean>\n\n// Track changes\neditor.enableTrackChanges({ authorId? }): void\neditor.disableTrackChanges(): void\neditor.isTrackChangesEnabled: boolean\neditor.getPendingTrackChanges(): TrackedChangeRecord[]\neditor.acceptTrackedChange(id: string): boolean\neditor.rejectTrackedChange(id: string): boolean\n\n// Lifecycle\neditor.mount(element): void\neditor.destroy(): void\neditor.isDestroyed: boolean\neditor.isEditable: boolean\neditor.setEditable(editable): void\n\n// Events\neditor.on(event, handler): () => void\neditor.off(event, handler): void\n```\n\n### ProseMirrorAPI\n\nPublic access to all ProseMirror functionality via `editor.pm`.\n\nSee [ProseMirrorAPI.ts](src/pm/ProseMirrorAPI.ts) for the full API.\n\n## Real-Time Collaboration\n\nBeakBlock supports real-time collaboration via Y.js. Enable and disable it at runtime without reloading the page:\n\n```typescript\nimport * as Y from 'yjs';\nimport { WebsocketProvider } from 'y-websocket';\nimport { ySyncPlugin, yCursorPlugin, yUndoPlugin } from 'y-prosemirror';\n\nconst ydoc = new Y.Doc();\nconst provider = new WebsocketProvider('ws://localhost:1234', 'room', ydoc);\nconst fragment = ydoc.getXmlFragment('prosemirror');\n\n// Enable (auto-disables prosemirror-history)\neditor.enableCollaboration({\n  plugins: [\n    ySyncPlugin(fragment),\n    yCursorPlugin(provider.awareness),\n    yUndoPlugin(),\n  ],\n});\n\n// Disable (auto-restores prosemirror-history)\neditor.disableCollaboration();\n```\n\nSee the [Collaboration guide](../../docs/collaboration.md) for full documentation.\n\n## Comments\n\n- Use a **`CommentStore`** (`InMemoryCommentStore` or your own) plus **`createCommentPlugin(store)`** in `EditorConfig.prosemirror.plugins`.\n- On every **`transaction`** with **`docChanged`**, call **`store.mapAnchors(transaction.mapping)`** so thread anchors stay aligned with the document.\n- Vue: **`CommentRail`**, **`CommentModal`**, and **`BubbleMenu`** `@comment` — see `@amusendame/beakblock-vue`.\n- React: **`CommentModal`** and **`BubbleMenu`** — see `@amusendame/beakblock-react`.\n\nSee [Comments](../../docs/comments.md) for the full API, anchoring rules, persistence notes, and troubleshooting.\n\n## Versioning and track changes\n\n- Configure `versioning: { adapter }` and use `saveVersion`, `listVersions`, `getVersion`, and `restoreVersion`.\n- Optional `trackChanges` in config, or `enableTrackChanges` / `disableTrackChanges` at runtime.\n\nSee [Versioning and track changes](../../docs/versioning.md) for adapter details, Y.js caveats, per-hunk accept/reject, and reviewer workflows.\n\n## Compliance lock and drag-drop configuration\n\n- **`complianceLock`** — Optional read-only policy for blocks with **`attrs.locked`**. See **[Compliance lock](../../docs/compliance-lock.md)** for the policy matrix, **`COMPLIANCE_LOCK_BYPASS_META`**, and collaboration notes.\n- **`dragDrop`** — Optional **`DragDropConfig | false`** merged into **`createPlugins`**. Use **`headingLockBadge: 'all-headings'`** to show a **clickable** lock control on every heading (toggle uses bypass meta). Omit or pass **`false`** to disable the drag-drop plugin.\n- **`setDocument(blocks)`** — Full document replacement sets compliance **bypass** meta so programmatic reloads can change locked headings when the lock plugin is enabled.\n\nTypes: **`EditorConfig`**, **`DragDropConfig`**, **`ComplianceLockPluginOptions`** are exported from `@amusendame/beakblock-core`.\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md"}