Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@blocknote/core

Package Overview
Dependencies
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blocknote/core - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1-alpha.0

117

dist/blocknote.js
var re = Object.defineProperty;
var ie = (o, e, t) => e in o ? re(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
var h = (o, e, t) => (ie(o, typeof e != "symbol" ? e + "" : e, t), t);
import { combineTransactionSteps as Q, getChangedRanges as X, findChildren as _, Node as w, mergeAttributes as N, InputRule as U, isTextSelection as se, isNodeSelection as ae, posToDOMRect as Z, Extension as E, findParentNode as de, getMarkRange as W, findChildrenInRange as le, extensions as P, Editor as ce } from "@tiptap/core";
import { combineTransactionSteps as Q, getChangedRanges as X, findChildren as _, Node as w, mergeAttributes as N, InputRule as U, isTextSelection as se, isNodeSelection as ae, posToDOMRect as Z, Extension as E, findParentNode as de, getMarkRange as K, findChildrenInRange as le, extensions as P, Editor as ce } from "@tiptap/core";
import ue from "@tiptap/extension-bold";

@@ -15,4 +15,4 @@ import he from "@tiptap/extension-code";

import ve from "@tiptap/extension-underline";
import { Slice as $, Fragment as ee } from "prosemirror-model";
import { PluginKey as I, Plugin as T, TextSelection as K, Selection as F, NodeSelection as Ie } from "prosemirror-state";
import { Slice as z, Fragment as ee } from "prosemirror-model";
import { PluginKey as v, Plugin as T, TextSelection as W, Selection as F, NodeSelection as Ie } from "prosemirror-state";
import * as Te from "prosemirror-view";

@@ -55,3 +55,3 @@ import { Decoration as L, DecorationSet as O } from "prosemirror-view";

}
const Y = new I("previous-blocks"), Me = {
const Y = new v("previous-blocks"), Me = {
listItemType: "list-item-type",

@@ -147,3 +147,3 @@ listItemIndex: "list-item-index",

}
}), Se = "_blockOuter_r256c_5", xe = "_block_r256c_5", Ee = "_blockContent_r256c_25", Pe = "_blockGroup_r256c_53", Ae = "_isEmpty_r256c_238", Ne = "_isFilter_r256c_239", He = "_hasAnchor_r256c_252", v = {
}), Se = "_blockOuter_r256c_5", xe = "_block_r256c_5", Ee = "_blockContent_r256c_25", Pe = "_blockGroup_r256c_53", Ae = "_isEmpty_r256c_238", Ne = "_isFilter_r256c_239", He = "_hasAnchor_r256c_252", I = {
blockOuter: Se,

@@ -199,3 +199,3 @@ block: xe,

N(e, {
class: v.blockOuter,
class: I.blockOuter,
"data-node-type": "block-outer"

@@ -206,3 +206,3 @@ }),

N(e, {
class: v.block,
class: I.block,
"data-node-type": this.name

@@ -226,3 +226,3 @@ }),

return n && (e.tr.deleteRange(a, d), e.tr.setSelection(
new K(e.doc.resolve(a + 1))
new W(e.doc.resolve(a + 1))
), t.focus()), !0;

@@ -249,3 +249,3 @@ },

return t && (e.tr.deleteRange(s, s + i.nodeSize), e.tr.insertText(i.textContent, u - 1), e.tr.setSelection(
new K(e.doc.resolve(u - 1))
new W(e.doc.resolve(u - 1))
)), !0;

@@ -268,3 +268,3 @@ },

s,
new $(f, c, c)
new z(f, c, c)
), !0;

@@ -424,3 +424,3 @@ },

N(this.options.HTMLAttributes, o, {
class: v.blockGroup,
class: I.blockGroup,
"data-node-type": "block-group"

@@ -448,3 +448,3 @@ }),

{
class: v.blockContent,
class: I.blockContent,
"data-content-type": this.name

@@ -508,3 +508,3 @@ },

N(e, {
class: v.blockContent,
class: I.blockContent,
"data-content-type": this.name

@@ -515,3 +515,3 @@ }),

}
}), De = new I("ordered-list-item-index"), _e = () => new T({
}), De = new v("ordered-list-item-index"), _e = () => new T({
key: De,

@@ -632,3 +632,3 @@ appendTransaction: (o, e, t) => {

N(o, {
class: v.blockContent,
class: I.blockContent,
"data-content-type": this.name

@@ -639,3 +639,3 @@ }),

}
}), ze = [
}), $e = [
Re,

@@ -652,3 +652,3 @@ Fe,

];
class $e {
class ze {
constructor({

@@ -791,4 +791,4 @@ editor: e,

const qe = (o) => new T({
key: new I("FormattingToolbarPlugin"),
view: (e) => new $e({ view: e, ...o })
key: new v("FormattingToolbarPlugin"),
view: (e) => new ze({ view: e, ...o })
}), Ge = E.create({

@@ -805,3 +805,3 @@ name: "FormattingToolbarExtension",

formattingToolbarFactory: this.options.formattingToolbarFactory,
pluginKey: new I("FormattingToolbarPlugin")
pluginKey: new v("FormattingToolbarPlugin")
})

@@ -825,3 +825,3 @@ ];

content() {
return new $(ee.from(this.nodes), 0, 0);
return new z(ee.from(this.nodes), 0, 0);
}

@@ -847,4 +847,4 @@ eq(t) {

}
const We = de((o) => o.type.name === "block");
function Ke(o, e) {
const Ke = de((o) => o.type.name === "block");
function We(o, e) {
if (!e.empty)

@@ -977,3 +977,3 @@ return;

} else if (s.active) {
const g = Ke(
const g = We(
s.type === "slash" ? t : "",

@@ -1034,3 +1034,3 @@ p.selection

if (u === "drag") {
const l = We(i.selection);
const l = Ke(i.selection);
if (l)

@@ -1150,3 +1150,3 @@ return O.create(i.doc, [

)
}, q = new I("suggestions-slash-commands"), Qe = E.create({
}, q = new v("suggestions-slash-commands"), Qe = E.create({
name: "slash-command",

@@ -1180,3 +1180,3 @@ addOptions() {

}
}), Xe = "_bnEditor_xixap_3", Ze = "_bnRoot_xixap_13", et = "_dragPreview_xixap_27", z = {
}), Xe = "_bnEditor_xixap_3", Ze = "_bnRoot_xixap_13", et = "_dragPreview_xixap_27", $ = {
bnEditor: Xe,

@@ -1253,3 +1253,3 @@ bnRoot: Ze,

(s > i || s < d) && n.removeChild(n.children[s]);
M = n, M.className = z.dragPreview, document.body.appendChild(M);
M = n, M.className = $.dragPreview, document.body.appendChild(M);
}

@@ -1385,3 +1385,3 @@ function at() {

const ct = (o) => new T({
key: new I("DraggableBlocksPlugin"),
key: new v("DraggableBlocksPlugin"),
view: () => new lt({

@@ -1407,3 +1407,3 @@ editor: o.editor,

}
}), ht = new I("HyperlinkToolbarPlugin");
}), ht = new v("HyperlinkToolbarPlugin");
class pt {

@@ -1433,3 +1433,3 @@ constructor({ editor: e, hyperlinkToolbarFactory: t }) {

if (s.type.name === e.schema.mark("link").type.name) {
this.mouseHoveredHyperlinkMark = s, this.mouseHoveredHyperlinkMarkRange = W(
this.mouseHoveredHyperlinkMark = s, this.mouseHoveredHyperlinkMarkRange = K(
d,

@@ -1454,3 +1454,3 @@ s.type,

if (i.type.name === this.editor.schema.mark("link").type.name) {
this.keyboardHoveredHyperlinkMark = i, this.keyboardHoveredHyperlinkMarkRange = W(
this.keyboardHoveredHyperlinkMark = i, this.keyboardHoveredHyperlinkMarkRange = K(
this.editor.state.selection.$from,

@@ -1550,3 +1550,3 @@ i.type,

})
}), kt = E.create({
}), kt = new v("blocknote-placeholder"), yt = E.create({
name: "placeholder",

@@ -1568,2 +1568,3 @@ addOptions() {

new T({
key: kt,
props: {

@@ -1590,6 +1591,6 @@ decorations: (o) => {

}
}), yt = E.create({
}), bt = E.create({
name: "trailingNode",
addProseMirrorPlugins() {
const o = new I(this.name);
const o = new v(this.name);
return [

@@ -1624,3 +1625,3 @@ new T({

});
function bt(o, e = JSON.stringify) {
function vt(o, e = JSON.stringify) {
const t = {};

@@ -1632,9 +1633,9 @@ return o.filter((n) => {

}
function vt(o) {
function It(o) {
const e = o.filter(
(n, r) => o.indexOf(n) !== r
);
return bt(e);
return vt(e);
}
const It = E.create({
const Tt = E.create({
name: "uniqueID",

@@ -1679,3 +1680,3 @@ priority: 1e4,

new T({
key: new I("uniqueID"),
key: new v("uniqueID"),
appendTransaction: (t, n, r) => {

@@ -1698,3 +1699,3 @@ console.log("appendTransaction");

(C) => s.includes(C.type.name)
), b = y.map(({ node: C }) => C.attrs[c]).filter((C) => C !== null), g = vt(b);
), b = y.map(({ node: C }) => C.attrs[c]).filter((C) => C !== null), g = It(b);
y.forEach(({ node: C, pos: H }) => {

@@ -1763,3 +1764,3 @@ var R;

};
return e = !1, new $(
return e = !1, new z(
a(t.content),

@@ -1774,7 +1775,7 @@ t.openStart,

}
}), Gt = w.create({
}), Kt = w.create({
name: "doc",
topNode: !0,
content: "block+"
}), Tt = (o) => {
}), Ct = (o) => {
const e = [

@@ -1787,10 +1788,10 @@ P.ClipboardTextSerializer,

me,
kt.configure({
emptyNodeClass: v.isEmpty,
hasAnchorClass: v.hasAnchor,
isFilterClass: v.isFilter,
yt.configure({
emptyNodeClass: I.isEmpty,
hasAnchorClass: I.hasAnchor,
isFilterClass: I.isFilter,
includeChildren: !0,
showOnlyCurrent: !1
}),
It.configure({
Tt.configure({
types: ["block"]

@@ -1806,6 +1807,6 @@ }),

gt,
...ze,
...$e,
pe.configure({ width: 5, color: "#ddeeff" }),
ge,
yt
bt
];

@@ -1829,3 +1830,3 @@ return o.blockSideMenuFactory && e.push(

), e;
}, Ct = {
}, Bt = {
enableInputRules: !0,

@@ -1839,3 +1840,3 @@ enablePasteRules: !0,

var a, d, i;
const t = Tt(
const t = Ct(
e.uiFactories || {}

@@ -1845,3 +1846,3 @@ );

const r = {
...Ct,
...Bt,
...e,

@@ -1853,4 +1854,4 @@ extensions: e.enableBlockNoteExtensions === !1 ? e.extensions : [...e.extensions || [], ...n],

class: [
z.bnEditor,
z.bnRoot,
$.bnEditor,
$.bnRoot,
((i = (d = e.editorProps) == null ? void 0 : d.attributes) == null ? void 0 : i.class) || ""

@@ -1866,7 +1867,7 @@ ].join(" ")

Wt as BlockNoteEditor,
Gt as Document,
Kt as Document,
B as SlashMenuGroups,
x as SlashMenuItem,
Tt as getBlockNoteExtensions
Ct as getBlockNoteExtensions
};
//# sourceMappingURL=blocknote.js.map

@@ -6,3 +6,3 @@ {

"license": "MPL-2.0",
"version": "0.2.0",
"version": "0.2.1-alpha.0",
"files": [

@@ -53,18 +53,18 @@ "dist",

"@emotion/utils": "^1.2.0",
"@tiptap/core": "^2.0.0-beta.182",
"@tiptap/extension-bold": "^2.0.0-beta.28",
"@tiptap/extension-code": "^2.0.0-beta.28",
"@tiptap/extension-collaboration": "^2.0.0-beta.38",
"@tiptap/extension-collaboration-cursor": "^2.0.0-beta.37",
"@tiptap/extension-dropcursor": "^2.0.0-beta.29",
"@tiptap/extension-gapcursor": "^2.0.0-beta.39",
"@tiptap/extension-hard-break": "^2.0.0-beta.33",
"@tiptap/extension-history": "^2.0.0-beta.26",
"@tiptap/extension-horizontal-rule": "^2.0.0-beta.36",
"@tiptap/extension-italic": "^2.0.0-beta.28",
"@tiptap/extension-link": "^2.0.0-beta.43",
"@tiptap/extension-paragraph": "^2.0.0-beta.26",
"@tiptap/extension-strike": "^2.0.0-beta.29",
"@tiptap/extension-text": "^2.0.0-beta.17",
"@tiptap/extension-underline": "^2.0.0-beta.25",
"@tiptap/core": "2.0.0-beta.199",
"@tiptap/extension-bold": "2.0.0-beta.199",
"@tiptap/extension-code": "2.0.0-beta.199",
"@tiptap/extension-collaboration": "2.0.0-beta.199",
"@tiptap/extension-collaboration-cursor": "2.0.0-beta.199",
"@tiptap/extension-dropcursor": "2.0.0-beta.199",
"@tiptap/extension-gapcursor": "2.0.0-beta.199",
"@tiptap/extension-hard-break": "2.0.0-beta.199",
"@tiptap/extension-history": "2.0.0-beta.199",
"@tiptap/extension-horizontal-rule": "2.0.0-beta.199",
"@tiptap/extension-italic": "2.0.0-beta.199",
"@tiptap/extension-link": "2.0.0-beta.199",
"@tiptap/extension-paragraph": "2.0.0-beta.199",
"@tiptap/extension-strike": "2.0.0-beta.199",
"@tiptap/extension-text": "2.0.0-beta.199",
"@tiptap/extension-underline": "2.0.0-beta.199",
"lodash": "^4.17.21",

@@ -99,3 +99,3 @@ "prosemirror-model": "1.18.1",

},
"gitHead": "5ccf86c22d62e87813d4314a5f9f0b24d8e1c9d5"
"gitHead": "a3e0765d1dbb7976e83223de41036f9dc6f8793a"
}

@@ -5,3 +5,3 @@ # BlockNote

[![npm version](https://badge.fury.io/js/%40blocknote%2Fcore.svg)](https://badge.fury.io/js/%40blocknote%2Fcore)
[![npm version](https://badge.fury.io/js/%40blocknote%2Freact.svg)](https://badge.fury.io/js/%40blocknote%2Freact)

@@ -8,0 +8,0 @@ **Welcome to BlockNote editor: a "Notion-style" block-based extensible text editor built on top of [Prosemirror](https://prosemirror.net/) and [Tiptap](https://tiptap.dev/).**

import { Editor, Extension } from "@tiptap/core";
import { Node as ProsemirrorNode } from "prosemirror-model";
import { Plugin } from "prosemirror-state";
import { Plugin, PluginKey } from "prosemirror-state";
import { Decoration, DecorationSet } from "prosemirror-view";
import { SlashMenuPluginKey } from "../SlashMenu/SlashMenuExtension";
const PLUGIN_KEY = new PluginKey(`blocknote-placeholder`);
/**

@@ -51,2 +53,3 @@ * This is a modified version of the tiptap

new Plugin({
key: PLUGIN_KEY,
props: {

@@ -53,0 +56,0 @@ decorations: (state) => {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc