@blocksuite/blocks
Advanced tools
Comparing version 0.4.0-20230114095726-16babb2 to 0.4.0-20230114163139-bef702b
@@ -53,3 +53,9 @@ // operations used in rich-text level | ||
} | ||
const id = page.addBlock({ flavour: model.flavour, text: right, type: model.type }, newParent, newBlockIndex); | ||
const children = [...model.children]; | ||
page.updateBlockById(model.id, { children: [] }); | ||
const id = page.addBlockByFlavour(model.flavour, { | ||
text: right, | ||
type: model.type, | ||
children, | ||
}, newParent, newBlockIndex); | ||
asyncFocusRichText(page, id); | ||
@@ -202,3 +208,5 @@ } | ||
model.text?.length && previousSibling.text?.join(model.text); | ||
page.deleteBlock(model); | ||
page.deleteBlock(model, { | ||
bringChildrenTo: previousSibling, | ||
}); | ||
const richText = getRichTextByModel(previousSibling); | ||
@@ -205,0 +213,0 @@ richText?.quill?.setSelection(preTextLength, 0); |
@@ -1,2 +0,2 @@ | ||
import { aL as k, aJ as S, ar as y, ak as C, as as h, aM as u, at as M, al as P, aI as D, am as v, aK as T, aH as x, ai as E, an as F, aN as f, aj as L, aP as A, aO as I, aQ as b, ab as N, a as R, av as z, aa as H, ah as j, e as q, c as w, b as O, ao as G, ac as K, ag as Q, ap as U, ax as J, d as W, A as _, f as V, j as X, r as Y, q as Z, x as $, w as aa, p as ea, au as oa, aB as ta, v as sa, u as la, n as na, m as ca, k as ra, o as ia, l as Ba, y as da, t as pa, g as ma, s as ga, z as ka, aF as Sa, aC as ya, aA as Ca, aD as ha, aE as ua, i as Ma, a9 as Pa, ad as Da, aw as va, ae as Ta, a8 as xa, af as Ea, aq as Fa, az as fa, aG as La, ay as Aa } from "./index-02aef2b5.js"; | ||
import { aL as k, aJ as S, ar as y, ak as C, as as h, aM as u, at as M, al as P, aI as D, am as v, aK as T, aH as x, ai as E, an as F, aN as f, aj as L, aP as A, aO as I, aQ as b, ab as N, a as R, av as z, aa as H, ah as j, e as q, c as w, b as O, ao as G, ac as K, ag as Q, ap as U, ax as J, d as W, A as _, f as V, j as X, r as Y, q as Z, x as $, w as aa, p as ea, au as oa, aB as ta, v as sa, u as la, n as na, m as ca, k as ra, o as ia, l as Ba, y as da, t as pa, g as ma, s as ga, z as ka, aF as Sa, aC as ya, aA as Ca, aD as ha, aE as ua, i as Ma, a9 as Pa, ad as Da, aw as va, ae as Ta, a8 as xa, af as Ea, aq as Fa, az as fa, aG as La, ay as Aa } from "./index-5f3a1666.js"; | ||
import { g as ba, l as Na, C as Ra, D as za, m as Ha, E as ja, p as qa, F as wa, k as Oa, L as Ga, j as Ka, i as Qa, n as Ua, f as Ja, d as Wa, o as _a, h as Va, T as Xa, e as Ya } from "./models-71847931.js"; | ||
@@ -3,0 +3,0 @@ import "lit"; |
import { B as e, a, P as s, A as t, H as o, M as i, S as l, b as n, h as r, C as c, f as g, D as d, p as B, g as S, F as p, e as T, T as m, d as R } from "./models-71847931.js"; | ||
import { a as u, i as y, d as E, c as k, b as C, e as L, P as h, R as f, h as N, g as D, f as _, j as v, k as P, l as x, m as I, n as M, o as O, p as A, q as F, r as b, s as H, t as z, u as K, v as V, w as j, x as G, y as U, z as q, A as w, B as Q, C as W, D as Y, E as J, F as X, G as Z, H as $, I as ee, J as ae, K as se, L as te, M as oe, N as ie, O as le, Q as ne, S as re, T as ce, U as ge, V as de, W as Be, X as Se, Y as pe, Z as Te, _ as me, $ as Re, a0 as ue, a1 as ye, a2 as Ee, a3 as ke, a4 as Ce, a5 as Le, a6 as he, a7 as fe, a8 as Ne, a9 as De, aa as _e, ab as ve, ac as Pe, ad as xe, ae as Ie, af as Me, ag as Oe, ah as Ae, ai as Fe } from "./index-02aef2b5.js"; | ||
import { a as u, i as y, d as E, c as k, b as C, e as L, P as h, R as f, h as N, g as D, f as _, j as v, k as P, l as x, m as I, n as M, o as O, p as A, q as F, r as b, s as H, t as z, u as K, v as V, w as j, x as G, y as U, z as q, A as w, B as Q, C as W, D as Y, E as J, F as X, G as Z, H as $, I as ee, J as ae, K as se, L as te, M as oe, N as ie, O as le, Q as ne, S as re, T as ce, U as ge, V as de, W as Be, X as Se, Y as pe, Z as Te, _ as me, $ as Re, a0 as ue, a1 as ye, a2 as Ee, a3 as ke, a4 as Ce, a5 as Le, a6 as he, a7 as fe, a8 as Ne, a9 as De, aa as _e, ab as ve, ac as Pe, ad as xe, ae as Ie, af as Me, ag as Oe, ah as Ae, ai as Fe } from "./index-5f3a1666.js"; | ||
import "@blocksuite/store"; | ||
@@ -4,0 +4,0 @@ import "lit/static-html.js"; |
{ | ||
"name": "@blocksuite/blocks", | ||
"version": "0.4.0-20230114095726-16babb2", | ||
"version": "0.4.0-20230114163139-bef702b", | ||
"description": "Default BlockSuite editable blocks.", | ||
@@ -11,5 +11,5 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@blocksuite/global": "0.4.0-20230114095726-16babb2", | ||
"@blocksuite/phasor": "0.4.0-20230114095726-16babb2", | ||
"@blocksuite/store": "0.4.0-20230114095726-16babb2", | ||
"@blocksuite/global": "0.4.0-20230114163139-bef702b", | ||
"@blocksuite/phasor": "0.4.0-20230114163139-bef702b", | ||
"@blocksuite/store": "0.4.0-20230114163139-bef702b", | ||
"@tldraw/intersect": "^1.8.0", | ||
@@ -19,3 +19,3 @@ "autosize": "^5.0.2", | ||
"hotkeys-js": "^3.10.1", | ||
"lit": "^2.6.0", | ||
"lit": "^2.6.1", | ||
"perfect-freehand": "^1.2.0", | ||
@@ -22,0 +22,0 @@ "quill": "=1.3.7", |
@@ -91,4 +91,11 @@ // operations used in rich-text level | ||
} | ||
const id = page.addBlock( | ||
{ flavour: model.flavour, text: right, type: model.type }, | ||
const children = [...model.children]; | ||
page.updateBlockById(model.id, { children: [] }); | ||
const id = page.addBlockByFlavour( | ||
model.flavour, | ||
{ | ||
text: right, | ||
type: model.type, | ||
children, | ||
}, | ||
newParent, | ||
@@ -265,3 +272,5 @@ newBlockIndex | ||
model.text?.length && previousSibling.text?.join(model.text as Text); | ||
page.deleteBlock(model); | ||
page.deleteBlock(model, { | ||
bringChildrenTo: previousSibling, | ||
}); | ||
const richText = getRichTextByModel(previousSibling); | ||
@@ -268,0 +277,0 @@ richText?.quill?.setSelection(preTextLength, 0); |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1982888
40602
+ Added@blocksuite/global@0.4.0-20230114163139-bef702b(transitive)
+ Added@blocksuite/phasor@0.4.0-20230114163139-bef702b(transitive)
+ Added@blocksuite/store@0.4.0-20230114163139-bef702b(transitive)
- Removed@blocksuite/global@0.4.0-20230114095726-16babb2(transitive)
- Removed@blocksuite/phasor@0.4.0-20230114095726-16babb2(transitive)
- Removed@blocksuite/store@0.4.0-20230114095726-16babb2(transitive)
Updatedlit@^2.6.1