@blocknote/core 0.31.1 → 0.32.0-hackdays.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/dist/blocknote.js CHANGED
@@ -1420,9 +1420,9 @@ function Ut(e, n, t, o) {
1420
1420
  if (!c)
1421
1421
  throw new Error(`style ${i} not found in styleSchema`);
1422
1422
  if (c.propSchema === "boolean")
1423
- r.push(n.mark(i));
1423
+ a && r.push(n.mark(i));
1424
1424
  else if (c.propSchema === "string")
1425
- r.push(n.mark(i, { stringValue: a }));
1425
+ a && r.push(n.mark(i, { stringValue: a }));
1426
1426
  else
1427
1427
  throw new j(c.propSchema);
1428
1428
  }
@@ -6955,11 +6955,19 @@ class Ia extends L {
6955
6955
  },
6956
6956
  props: {
6957
6957
  handleTextInput(r, s, i, a) {
6958
- return o.includes(a) ? (r.dispatch(r.state.tr.insertText(a)), r.dispatch(
6959
- r.state.tr.setMeta(me, {
6960
- triggerCharacter: a
6961
- }).scrollIntoView()
6962
- ), !0) : !1;
6958
+ if (s === i) {
6959
+ const c = r.state.doc;
6960
+ for (const l of o) {
6961
+ const d = l.length > 1 ? c.textBetween(s - l.length, s) + a : a;
6962
+ if (l === d)
6963
+ return r.dispatch(r.state.tr.insertText(a)), r.dispatch(
6964
+ r.state.tr.setMeta(me, {
6965
+ triggerCharacter: d
6966
+ }).scrollIntoView()
6967
+ ), !0;
6968
+ }
6969
+ }
6970
+ return !1;
6963
6971
  },
6964
6972
  // Setup decorator on the currently active suggestion.
6965
6973
  decorations(r) {