markupeditor 0.9.46 → 0.9.48

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.
@@ -15225,9 +15225,9 @@ let baseNodes = OrderedMap.from({
15225
15225
  //
15226
15226
  // 1. Changes to div here may need to be reflected in DivView found in markup.js.
15227
15227
  //
15228
- // 2. We use a style rule to require divs to include id, class, parentId. The div elements
15229
- // are used in the Swift MarkupEditor under these specific conditions, and requiring these
15230
- // attributes prevents issues when pasting (e.g., from GitHub READMEs) include divs.
15228
+ // 2. We use a tag rule with attribute selectors to require divs to include id, class, parentId.
15229
+ // The div elements are used in the Swift MarkupEditor under these specific conditions, and
15230
+ // requiring these attributes prevents issues when pasting (e.g., from GitHub READMEs) include divs.
15231
15231
  //
15232
15232
  // 3. It might be possible to exclude divs that don't conform to MarkupEditor expectations
15233
15233
  // by using a rule. For now, deriving a Node from html always removes divs and buttons, so
@@ -15251,7 +15251,7 @@ let baseNodes = OrderedMap.from({
15251
15251
  writingsuggestions: {default: false},
15252
15252
  },
15253
15253
  parseDOM: [{
15254
- style: "div[id, class, parentId]",
15254
+ tag: "div[id][class][parentId]",
15255
15255
  getAttrs(dom) {
15256
15256
  const id = dom.getAttribute("id");
15257
15257
  const parentId = dom.getAttribute("parentId");
@@ -34480,6 +34480,7 @@ function toggleFormatCommand(type) {
34480
34480
  } if (toggle && view) {
34481
34481
  toggle(state, view.dispatch);
34482
34482
  stateChanged(view);
34483
+ return true
34483
34484
  } else {
34484
34485
  return toggle
34485
34486
  }
@@ -34551,6 +34552,7 @@ function setStyleCommand(style) {
34551
34552
  const newState = view.state.apply(transaction);
34552
34553
  view.updateState(newState);
34553
34554
  stateChanged(view);
34555
+ return true
34554
34556
  } else { // When checking if active based on state, return true only if different
34555
34557
  return paragraphStyle(state) != style;
34556
34558
  }
@@ -36008,11 +36010,6 @@ function _testKeyCodeFor(key) {
36008
36010
  * @throws {Error} If `key` contains an unrecognized modifier
36009
36011
  * prefix, including the unsupported "Mod-".
36010
36012
  * @returns {boolean} Whether a handler returned `true` for the key.
36011
- * NOT a reliable "the document changed" signal:
36012
- * some commands (e.g. setStyleCommand,
36013
- * toggleFormatCommand) dispatch without returning
36014
- * `true`, so the document can still mutate while
36015
- * this returns `false`.
36016
36013
  */
36017
36014
  function testTypeKey(key) {
36018
36015
  const view = activeView();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markupeditor",
3
- "version": "0.9.46",
3
+ "version": "0.9.48",
4
4
  "description": "A web component and API for WYSIWYG HTML editing.",
5
5
  "keywords": [
6
6
  "wysiwyg",