@harbour-enterprises/superdoc 0.17.0 → 0.18.0-next.1

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.
Files changed (51) hide show
  1. package/dist/chunks/{PdfViewer-GP6I2zIW.cjs → PdfViewer-CNZTqGHw.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-C9MkdsYe.es.js → PdfViewer-D5cujgSt.es.js} +1 -1
  3. package/dist/chunks/{index-DyzJFuXw.es.js → index-BDwD6Uex.es.js} +4 -3
  4. package/dist/chunks/{index-D__8AUF5.cjs → index-BDysJRQU.cjs} +4 -3
  5. package/dist/chunks/{super-editor.es-v-3xRSOD.es.js → super-editor.es-BoCmoEkp.es.js} +472 -257
  6. package/dist/chunks/{super-editor.es-JiSMNI00.cjs → super-editor.es-aOm7eWFU.cjs} +471 -256
  7. package/dist/core/SuperDoc.d.ts.map +1 -1
  8. package/dist/index.d.ts +2 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/super-editor/ai-writer.es.js +2 -2
  11. package/dist/super-editor/chunks/{converter-WThahWt0.js → converter-DvdFP4MZ.js} +339 -146
  12. package/dist/super-editor/chunks/{docx-zipper-6iJv_uCL.js → docx-zipper-CxFpxZUz.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-OX-YyKoc.js → editor-CeWNMKjc.js} +32 -4
  14. package/dist/super-editor/chunks/{toolbar-CUglet_U.js → toolbar-Di2oAvyr.js} +2 -2
  15. package/dist/super-editor/converter.es.js +1 -1
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/file-zipper.es.js +1 -1
  19. package/dist/super-editor/src/core/super-converter/exporter.d.ts +17 -0
  20. package/dist/super-editor/src/core/super-converter/v2/importer/lineBreakImporter.d.ts +3 -5
  21. package/dist/super-editor/src/core/super-converter/v2/importer/tabImporter.d.ts +2 -1
  22. package/dist/super-editor/src/core/super-converter/v2/importer/types/index.d.ts +75 -0
  23. package/dist/super-editor/src/core/super-converter/v2/types/index.d.ts +8 -0
  24. package/dist/super-editor/src/core/super-converter/v3/handlers/index.d.ts +8 -0
  25. package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/attributes/index.d.ts +2 -0
  26. package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/attributes/w-clear.d.ts +2 -0
  27. package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/attributes/w-line-break-type.d.ts +2 -0
  28. package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/br-translator.d.ts +7 -0
  29. package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/index.d.ts +1 -0
  30. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/index.d.ts +3 -0
  31. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/w-tab-leader.d.ts +2 -0
  32. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/w-tab-pos.d.ts +2 -0
  33. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/w-tab-size.d.ts +2 -0
  34. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/index.d.ts +1 -0
  35. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/tab-translator.d.ts +7 -0
  36. package/dist/super-editor/src/core/super-converter/v3/node-translator/index.d.ts +1 -0
  37. package/dist/super-editor/src/core/super-converter/v3/node-translator/node-translator.d.ts +203 -0
  38. package/dist/super-editor/src/extensions/block-node/block-node.d.ts +0 -1
  39. package/dist/super-editor/src/index.d.ts +2 -1
  40. package/dist/super-editor/super-editor.es.js +12 -7
  41. package/dist/super-editor/toolbar.es.js +2 -2
  42. package/dist/super-editor.cjs +2 -1
  43. package/dist/super-editor.es.js +2 -1
  44. package/dist/superdoc.cjs +3 -2
  45. package/dist/superdoc.es.js +3 -2
  46. package/dist/superdoc.umd.js +594 -378
  47. package/dist/superdoc.umd.js.map +1 -1
  48. package/package.json +1 -1
  49. package/dist/super-editor/src/core/super-converter/v2/handlers/index.d.ts +0 -1
  50. package/dist/super-editor/src/extensions/field-annotation/field-annotation-marks-impl.d.ts +0 -5
  51. /package/dist/super-editor/src/{extensions/document-attributes → core/super-converter/v3/handlers/types}/index.d.ts +0 -0
@@ -3684,10 +3684,10 @@
3684
3684
  function createWatcher(raw, ctx2, publicThis, key) {
3685
3685
  let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
3686
3686
  if (isString(raw)) {
3687
- const handler = ctx2[raw];
3688
- if (isFunction$2(handler)) {
3687
+ const handler2 = ctx2[raw];
3688
+ if (isFunction$2(handler2)) {
3689
3689
  {
3690
- watch(getter, handler);
3690
+ watch(getter, handler2);
3691
3691
  }
3692
3692
  }
3693
3693
  } else if (isFunction$2(raw)) {
@@ -3698,9 +3698,9 @@
3698
3698
  if (isArray$3(raw)) {
3699
3699
  raw.forEach((r2) => createWatcher(r2, ctx2, publicThis, key));
3700
3700
  } else {
3701
- const handler = isFunction$2(raw.handler) ? raw.handler.bind(publicThis) : ctx2[raw.handler];
3702
- if (isFunction$2(handler)) {
3703
- watch(getter, handler, raw);
3701
+ const handler2 = isFunction$2(raw.handler) ? raw.handler.bind(publicThis) : ctx2[raw.handler];
3702
+ if (isFunction$2(handler2)) {
3703
+ watch(getter, handler2, raw);
3704
3704
  }
3705
3705
  }
3706
3706
  } else ;
@@ -5819,14 +5819,14 @@
5819
5819
  }
5820
5820
  }
5821
5821
  let handlerName;
5822
- let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
5822
+ let handler2 = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
5823
5823
  props[handlerName = toHandlerKey(camelize(event))];
5824
- if (!handler && isModelListener2) {
5825
- handler = props[handlerName = toHandlerKey(hyphenate(event))];
5824
+ if (!handler2 && isModelListener2) {
5825
+ handler2 = props[handlerName = toHandlerKey(hyphenate(event))];
5826
5826
  }
5827
- if (handler) {
5827
+ if (handler2) {
5828
5828
  callWithAsyncErrorHandling(
5829
- handler,
5829
+ handler2,
5830
5830
  instance,
5831
5831
  6,
5832
5832
  args
@@ -7313,11 +7313,11 @@
7313
7313
  }
7314
7314
  needRemove && el.removeAttribute(attrName || key);
7315
7315
  }
7316
- function addEventListener$1(el, event, handler, options) {
7317
- el.addEventListener(event, handler, options);
7316
+ function addEventListener$1(el, event, handler2, options) {
7317
+ el.addEventListener(event, handler2, options);
7318
7318
  }
7319
- function removeEventListener$1(el, event, handler, options) {
7320
- el.removeEventListener(event, handler, options);
7319
+ function removeEventListener$1(el, event, handler2, options) {
7320
+ el.removeEventListener(event, handler2, options);
7321
7321
  }
7322
7322
  const veiKey = Symbol("_vei");
7323
7323
  function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
@@ -9620,14 +9620,14 @@
9620
9620
  err.context = er;
9621
9621
  throw err;
9622
9622
  }
9623
- var handler = events2[type2];
9624
- if (handler === void 0)
9623
+ var handler2 = events2[type2];
9624
+ if (handler2 === void 0)
9625
9625
  return false;
9626
- if (typeof handler === "function") {
9627
- ReflectApply(handler, this, args);
9626
+ if (typeof handler2 === "function") {
9627
+ ReflectApply(handler2, this, args);
9628
9628
  } else {
9629
- var len2 = handler.length;
9630
- var listeners = arrayClone(handler, len2);
9629
+ var len2 = handler2.length;
9630
+ var listeners = arrayClone(handler2, len2);
9631
9631
  for (var i2 = 0; i2 < len2; ++i2)
9632
9632
  ReflectApply(listeners[i2], this, args);
9633
9633
  }
@@ -9867,9 +9867,9 @@
9867
9867
  }
9868
9868
  });
9869
9869
  }
9870
- function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
9870
+ function addErrorHandlerIfEventEmitter(emitter, handler2, flags) {
9871
9871
  if (typeof emitter.on === "function") {
9872
- eventTargetAgnosticAddListener(emitter, "error", handler, flags);
9872
+ eventTargetAgnosticAddListener(emitter, "error", handler2, flags);
9873
9873
  }
9874
9874
  }
9875
9875
  function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
@@ -14651,15 +14651,15 @@
14651
14651
  hasRequiredBrowser = 1;
14652
14652
  browser = deprecate;
14653
14653
  function deprecate(fn, msg2) {
14654
- if (config("noDeprecation")) {
14654
+ if (config2("noDeprecation")) {
14655
14655
  return fn;
14656
14656
  }
14657
14657
  var warned = false;
14658
14658
  function deprecated() {
14659
14659
  if (!warned) {
14660
- if (config("throwDeprecation")) {
14660
+ if (config2("throwDeprecation")) {
14661
14661
  throw new Error(msg2);
14662
- } else if (config("traceDeprecation")) {
14662
+ } else if (config2("traceDeprecation")) {
14663
14663
  console.trace(msg2);
14664
14664
  } else {
14665
14665
  console.warn(msg2);
@@ -14670,7 +14670,7 @@
14670
14670
  }
14671
14671
  return deprecated;
14672
14672
  }
14673
- function config(name) {
14673
+ function config2(name) {
14674
14674
  try {
14675
14675
  if (!commonjsGlobal.localStorage) return false;
14676
14676
  } catch (_2) {
@@ -17045,7 +17045,7 @@
17045
17045
  this._parser.end();
17046
17046
  return true;
17047
17047
  };
17048
- SAXStream.prototype.on = function(ev, handler) {
17048
+ SAXStream.prototype.on = function(ev, handler2) {
17049
17049
  var me = this;
17050
17050
  if (!me._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) {
17051
17051
  me._parser["on" + ev] = function() {
@@ -17054,7 +17054,7 @@
17054
17054
  me.emit.apply(me, args);
17055
17055
  };
17056
17056
  }
17057
- return Stream.prototype.on.call(me, ev, handler);
17057
+ return Stream.prototype.on.call(me, ev, handler2);
17058
17058
  };
17059
17059
  var CDATA = "[CDATA[";
17060
17060
  var DOCTYPE = "DOCTYPE";
@@ -19268,8 +19268,8 @@
19268
19268
  "useNamedReferences": false,
19269
19269
  "decimal": false
19270
19270
  };
19271
- var decode = function(html, options) {
19272
- options = merge2(options, decode.options);
19271
+ var decode2 = function(html, options) {
19272
+ options = merge2(options, decode2.options);
19273
19273
  var strict = options.strict;
19274
19274
  if (strict && regexInvalidEntity.test(html)) {
19275
19275
  parseError("malformed character reference");
@@ -19328,7 +19328,7 @@
19328
19328
  return $0;
19329
19329
  });
19330
19330
  };
19331
- decode.options = {
19331
+ decode2.options = {
19332
19332
  "isAttributeValue": false,
19333
19333
  "strict": false
19334
19334
  };
@@ -19340,9 +19340,9 @@
19340
19340
  var he2 = {
19341
19341
  "version": "1.2.0",
19342
19342
  "encode": encode2,
19343
- "decode": decode,
19343
+ "decode": decode2,
19344
19344
  "escape": escape2,
19345
- "unescape": decode
19345
+ "unescape": decode2
19346
19346
  };
19347
19347
  if (freeExports2 && !freeExports2.nodeType) {
19348
19348
  if (freeModule2) {
@@ -25108,24 +25108,24 @@
25108
25108
  }
25109
25109
  const baseFields = [
25110
25110
  new FieldDesc("doc", {
25111
- init(config) {
25112
- return config.doc || config.schema.topNodeType.createAndFill();
25111
+ init(config2) {
25112
+ return config2.doc || config2.schema.topNodeType.createAndFill();
25113
25113
  },
25114
25114
  apply(tr) {
25115
25115
  return tr.doc;
25116
25116
  }
25117
25117
  }),
25118
25118
  new FieldDesc("selection", {
25119
- init(config, instance) {
25120
- return config.selection || Selection.atStart(instance.doc);
25119
+ init(config2, instance) {
25120
+ return config2.selection || Selection.atStart(instance.doc);
25121
25121
  },
25122
25122
  apply(tr) {
25123
25123
  return tr.selection;
25124
25124
  }
25125
25125
  }),
25126
25126
  new FieldDesc("storedMarks", {
25127
- init(config) {
25128
- return config.storedMarks || null;
25127
+ init(config2) {
25128
+ return config2.storedMarks || null;
25129
25129
  },
25130
25130
  apply(tr, _marks, _old, state2) {
25131
25131
  return state2.selection.$cursor ? tr.storedMarks : null;
@@ -25161,8 +25161,8 @@
25161
25161
  /**
25162
25162
  @internal
25163
25163
  */
25164
- constructor(config) {
25165
- this.config = config;
25164
+ constructor(config2) {
25165
+ this.config = config2;
25166
25166
  }
25167
25167
  /**
25168
25168
  The schema of the state's document.
@@ -25253,11 +25253,11 @@
25253
25253
  /**
25254
25254
  Create a new state.
25255
25255
  */
25256
- static create(config) {
25257
- let $config = new Configuration(config.doc ? config.doc.type.schema : config.schema, config.plugins);
25256
+ static create(config2) {
25257
+ let $config = new Configuration(config2.doc ? config2.doc.type.schema : config2.schema, config2.plugins);
25258
25258
  let instance = new EditorState($config);
25259
25259
  for (let i2 = 0; i2 < $config.fields.length; i2++)
25260
- instance[$config.fields[i2].name] = $config.fields[i2].init(config, instance);
25260
+ instance[$config.fields[i2].name] = $config.fields[i2].init(config2, instance);
25261
25261
  return instance;
25262
25262
  }
25263
25263
  /**
@@ -25268,12 +25268,12 @@
25268
25268
  [`init`](https://prosemirror.net/docs/ref/#state.StateField.init) method, passing in the new
25269
25269
  configuration object..
25270
25270
  */
25271
- reconfigure(config) {
25272
- let $config = new Configuration(this.schema, config.plugins);
25271
+ reconfigure(config2) {
25272
+ let $config = new Configuration(this.schema, config2.plugins);
25273
25273
  let fields = $config.fields, instance = new EditorState($config);
25274
25274
  for (let i2 = 0; i2 < fields.length; i2++) {
25275
25275
  let name = fields[i2].name;
25276
- instance[name] = this.hasOwnProperty(name) ? this[name] : fields[i2].init(config, instance);
25276
+ instance[name] = this.hasOwnProperty(name) ? this[name] : fields[i2].init(config2, instance);
25277
25277
  }
25278
25278
  return instance;
25279
25279
  }
@@ -25305,31 +25305,31 @@
25305
25305
  to deserialize the state of plugins, by associating plugin
25306
25306
  instances with the property names they use in the JSON object.
25307
25307
  */
25308
- static fromJSON(config, json, pluginFields) {
25308
+ static fromJSON(config2, json, pluginFields) {
25309
25309
  if (!json)
25310
25310
  throw new RangeError("Invalid input for EditorState.fromJSON");
25311
- if (!config.schema)
25311
+ if (!config2.schema)
25312
25312
  throw new RangeError("Required config field 'schema' missing");
25313
- let $config = new Configuration(config.schema, config.plugins);
25313
+ let $config = new Configuration(config2.schema, config2.plugins);
25314
25314
  let instance = new EditorState($config);
25315
25315
  $config.fields.forEach((field) => {
25316
25316
  if (field.name == "doc") {
25317
- instance.doc = Node$1$1.fromJSON(config.schema, json.doc);
25317
+ instance.doc = Node$1$1.fromJSON(config2.schema, json.doc);
25318
25318
  } else if (field.name == "selection") {
25319
25319
  instance.selection = Selection.fromJSON(instance.doc, json.selection);
25320
25320
  } else if (field.name == "storedMarks") {
25321
25321
  if (json.storedMarks)
25322
- instance.storedMarks = json.storedMarks.map(config.schema.markFromJSON);
25322
+ instance.storedMarks = json.storedMarks.map(config2.schema.markFromJSON);
25323
25323
  } else {
25324
25324
  if (pluginFields)
25325
25325
  for (let prop in pluginFields) {
25326
25326
  let plugin2 = pluginFields[prop], state2 = plugin2.spec.state;
25327
25327
  if (plugin2.key == field.name && state2 && state2.fromJSON && Object.prototype.hasOwnProperty.call(json, prop)) {
25328
- instance[field.name] = state2.fromJSON.call(plugin2, config, json[prop], instance);
25328
+ instance[field.name] = state2.fromJSON.call(plugin2, config2, json[prop], instance);
25329
25329
  return;
25330
25330
  }
25331
25331
  }
25332
- instance[field.name] = field.init(config, instance);
25332
+ instance[field.name] = field.init(config2, instance);
25333
25333
  }
25334
25334
  });
25335
25335
  return instance;
@@ -31582,11 +31582,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
31582
31582
  return tempCont;
31583
31583
  }
31584
31584
  class InputRule {
31585
- constructor(config) {
31585
+ constructor(config2) {
31586
31586
  __publicField$2(this, "match");
31587
31587
  __publicField$2(this, "handler");
31588
- this.match = config.match;
31589
- this.handler = config.handler;
31588
+ this.match = config2.match;
31589
+ this.handler = config2.handler;
31590
31590
  }
31591
31591
  }
31592
31592
  const inputRuleMatcherHandler = (text, match) => {
@@ -31609,8 +31609,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
31609
31609
  }
31610
31610
  return result;
31611
31611
  };
31612
- const run = (config) => {
31613
- const { editor, from: from2, to, text, rules, plugin: plugin2 } = config;
31612
+ const run = (config2) => {
31613
+ const { editor, from: from2, to, text, rules, plugin: plugin2 } = config2;
31614
31614
  const { view } = editor;
31615
31615
  if (view.composing) {
31616
31616
  return false;
@@ -31639,7 +31639,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
31639
31639
  editor,
31640
31640
  state: state2
31641
31641
  });
31642
- const handler = rule.handler({
31642
+ const handler2 = rule.handler({
31643
31643
  state: state2,
31644
31644
  range: range2,
31645
31645
  match,
@@ -31647,7 +31647,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
31647
31647
  chain,
31648
31648
  can
31649
31649
  });
31650
- if (handler === null || !tr.steps.length) {
31650
+ if (handler2 === null || !tr.steps.length) {
31651
31651
  return;
31652
31652
  }
31653
31653
  tr.setMeta(plugin2, {
@@ -33136,6 +33136,241 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33136
33136
  ]
33137
33137
  };
33138
33138
  };
33139
+ const TranslatorTypes = Object.freeze({
33140
+ NODE: "node",
33141
+ ATTRIBUTE: "attribute"
33142
+ });
33143
+ const _NodeTranslator = class _NodeTranslator2 {
33144
+ /**
33145
+ * @param {string} xmlName
33146
+ * @param {string} sdNodeOrKeyName
33147
+ * @param {NodeTranslatorEncodeFn} encode
33148
+ * @param {NodeTranslatorDecodeFn} decode
33149
+ * @param {number} [priority]
33150
+ * @param {MatchesEncodeFn} [matchesEncode]
33151
+ * @param {MatchesDecodeFn} [matchesDecode]
33152
+ * @param {AttributesHandlerList[]} [attributes]
33153
+ */
33154
+ constructor(xmlName, sdNodeOrKeyName, encode2, decode2, priority, matchesEncode, matchesDecode, attributes) {
33155
+ __publicField$2(this, "xmlName");
33156
+ __publicField$2(this, "sdNodeOrKeyName");
33157
+ __publicField$2(this, "priority");
33158
+ __publicField$2(this, "encodeFn");
33159
+ __publicField$2(this, "decodeFn");
33160
+ __publicField$2(this, "matchesEncode");
33161
+ __publicField$2(this, "matchesDecode");
33162
+ __publicField$2(this, "attributes");
33163
+ this.xmlName = xmlName;
33164
+ this.sdNodeOrKeyName = sdNodeOrKeyName;
33165
+ this.encodeFn = encode2;
33166
+ this.decodeFn = decode2;
33167
+ this.attributes = attributes || [];
33168
+ this.priority = typeof priority === "number" ? priority : 0;
33169
+ this.matchesEncode = typeof matchesEncode === "function" ? matchesEncode : () => true;
33170
+ this.matchesDecode = typeof matchesDecode === "function" ? matchesDecode : () => true;
33171
+ }
33172
+ /**
33173
+ * Encode the attributes for the node.
33174
+ * @param {SCEncoderConfig} params
33175
+ * @returns {Object} Encoded attributes object.
33176
+ */
33177
+ encodeAttributes(params2) {
33178
+ const { nodes = [] } = params2 || {};
33179
+ const node2 = nodes[0];
33180
+ const { attributes = {} } = node2 || {};
33181
+ const encodedAttrs = {};
33182
+ this.attributes.forEach(({ sdName, encode: encode2 }) => {
33183
+ if (!encode2) return;
33184
+ const encodedAttr = encode2(attributes);
33185
+ if (encodedAttr !== void 0 && encodedAttr !== null) {
33186
+ encodedAttrs[sdName] = encodedAttr;
33187
+ }
33188
+ });
33189
+ return encodedAttrs;
33190
+ }
33191
+ /**
33192
+ * Decode the attributes for the node.
33193
+ * @param {SCDecoderConfig} params
33194
+ * @returns {Object} Decoded attributes object.
33195
+ */
33196
+ decodeAttributes(params2) {
33197
+ const { node: node2 } = params2 || {};
33198
+ const { attrs = {} } = node2 || {};
33199
+ const decodedAttrs = {};
33200
+ this.attributes.forEach(({ xmlName, decode: decode2 }) => {
33201
+ if (!decode2) return;
33202
+ const decodedAttr = decode2(attrs);
33203
+ if (decodedAttr !== void 0 && decodedAttr !== null) {
33204
+ decodedAttrs[xmlName] = decodedAttr;
33205
+ }
33206
+ });
33207
+ return decodedAttrs;
33208
+ }
33209
+ /**
33210
+ * Decode the attributes for the node.
33211
+ * @param {SCDecoderConfig} params
33212
+ * @returns {Object} Decoded attributes object.
33213
+ */
33214
+ decode(params2) {
33215
+ const decodedAttrs = this.decodeAttributes(params2);
33216
+ return this.decodeFn ? this.decodeFn(params2, decodedAttrs) : void 0;
33217
+ }
33218
+ /**
33219
+ * Encode the attributes for the node.
33220
+ * @param {SCEncoderConfig} params
33221
+ * @returns {Object} Encoded attributes object.
33222
+ */
33223
+ encode(params2) {
33224
+ const encodedAttrs = this.encodeAttributes(params2);
33225
+ return this.encodeFn ? this.encodeFn(params2, encodedAttrs) : void 0;
33226
+ }
33227
+ /**
33228
+ * Create a new NodeTranslator instance from a configuration object.
33229
+ * @param {NodeTranslatorConfig} config - The configuration object.
33230
+ * @returns {NodeTranslator} The created NodeTranslator instance.
33231
+ */
33232
+ static from(config2) {
33233
+ const { xmlName, sdNodeOrKeyName, encode: encode2, decode: decode2, priority = 0, matchesEncode, matchesDecode, attributes } = config2;
33234
+ if (typeof encode2 !== "function" || !!decode2 && typeof decode2 !== "function") {
33235
+ throw new TypeError(`${xmlName}: encode/decode must be functions`);
33236
+ }
33237
+ const inst = new _NodeTranslator2(
33238
+ xmlName,
33239
+ sdNodeOrKeyName,
33240
+ encode2,
33241
+ decode2,
33242
+ priority,
33243
+ matchesEncode,
33244
+ matchesDecode,
33245
+ attributes
33246
+ );
33247
+ return Object.freeze(inst);
33248
+ }
33249
+ /**
33250
+ * Convert the NodeTranslator instance to a string representation.
33251
+ * @returns {string} - The string representation of the NodeTranslator instance.
33252
+ */
33253
+ toString() {
33254
+ return `NodeTranslator(${this.xmlName}, priority=${this.priority})`;
33255
+ }
33256
+ };
33257
+ __publicField$2(_NodeTranslator, "translatorTypes", TranslatorTypes);
33258
+ let NodeTranslator = _NodeTranslator;
33259
+ const lineBreakTypeEncoder = (attributes) => {
33260
+ return attributes["w:type"];
33261
+ };
33262
+ const lineBreakTypeDecoder = (attrs) => {
33263
+ const { lineBreakType } = attrs;
33264
+ return lineBreakType;
33265
+ };
33266
+ const wClearEncoder = (attributes) => {
33267
+ const xmlAttrValue = attributes["w:clear"];
33268
+ return xmlAttrValue;
33269
+ };
33270
+ const wClearDecoder = (attrs) => {
33271
+ const { clear } = attrs;
33272
+ return clear;
33273
+ };
33274
+ const XML_NODE_NAME$1 = "w:br";
33275
+ const SD_NODE_NAME$1 = "lineBreak";
33276
+ const validXmlAttributes$1 = [
33277
+ { xmlName: "w:type", sdName: "lineBreakType", encode: lineBreakTypeEncoder, decode: lineBreakTypeDecoder },
33278
+ { xmlName: "w:clear", sdName: "clear", encode: wClearEncoder, decode: wClearDecoder }
33279
+ ];
33280
+ const encode$1 = (_2, encodedAttrs) => {
33281
+ const isPageBreak = encodedAttrs?.lineBreakType === "page";
33282
+ const translated = {
33283
+ type: isPageBreak ? "hardBreak" : "lineBreak"
33284
+ };
33285
+ if (encodedAttrs) {
33286
+ translated.attrs = { ...encodedAttrs };
33287
+ }
33288
+ return translated;
33289
+ };
33290
+ const decode$1 = (params2, decodedAttrs) => {
33291
+ const { node: node2 } = params2;
33292
+ if (!node2) return;
33293
+ const wBreak = { name: "w:br" };
33294
+ if (decodedAttrs) {
33295
+ wBreak.attributes = { ...decodedAttrs };
33296
+ }
33297
+ const isPageBreak = node2.type === "hardBreak";
33298
+ if (isPageBreak && (!wBreak.attributes || !wBreak.attributes["w:type"])) {
33299
+ wBreak.attributes = { ...wBreak.attributes, "w:type": "page" };
33300
+ }
33301
+ const translated = {
33302
+ name: "w:r",
33303
+ elements: [wBreak]
33304
+ };
33305
+ return translated;
33306
+ };
33307
+ const config$1 = {
33308
+ xmlName: XML_NODE_NAME$1,
33309
+ sdNodeOrKeyName: SD_NODE_NAME$1,
33310
+ type: NodeTranslator.translatorTypes.NODE,
33311
+ encode: encode$1,
33312
+ decode: decode$1,
33313
+ attributes: validXmlAttributes$1
33314
+ };
33315
+ const translator$1 = NodeTranslator.from(config$1);
33316
+ const tabSizeEncoder = (attributes) => {
33317
+ return attributes["w:val"];
33318
+ };
33319
+ const tabSizeDecoder = (attrs) => {
33320
+ const { tabSize } = attrs;
33321
+ return tabSize;
33322
+ };
33323
+ const tabLeaderEncoder = (attributes) => {
33324
+ return attributes["w:leader"];
33325
+ };
33326
+ const tabLeaderDecoder = (attrs) => {
33327
+ const { leader } = attrs;
33328
+ return leader;
33329
+ };
33330
+ const tabPositionEncoder = (attributes) => {
33331
+ return attributes["w:pos"];
33332
+ };
33333
+ const tabPositionDecoder = (attrs) => {
33334
+ const { pos } = attrs;
33335
+ return pos;
33336
+ };
33337
+ const XML_NODE_NAME = "w:tab";
33338
+ const SD_NODE_NAME = "tab";
33339
+ const validXmlAttributes = [
33340
+ { xmlName: "w:val", sdName: "tabSize", encode: tabSizeEncoder, decode: tabSizeDecoder },
33341
+ { xmlName: "w:pos", sdName: "pos", encode: tabPositionEncoder, decode: tabPositionDecoder },
33342
+ { xmlName: "w:leader", sdName: "leader", encode: tabLeaderEncoder, decode: tabLeaderDecoder }
33343
+ ];
33344
+ const encode$2 = (_2, encodedAttrs = {}) => {
33345
+ const translated = { type: "tab" };
33346
+ if (encodedAttrs) translated.attrs = { ...encodedAttrs };
33347
+ return translated;
33348
+ };
33349
+ const decode = (params2, decodedAttrs = {}) => {
33350
+ const { node: node2 } = params2 || {};
33351
+ if (!node2) return;
33352
+ const wTab = { name: "w:tab" };
33353
+ if (decodedAttrs) wTab.attributes = { ...decodedAttrs };
33354
+ const translated = {
33355
+ name: "w:r",
33356
+ elements: [wTab]
33357
+ };
33358
+ const { marks: nodeMarks = [] } = node2;
33359
+ const outputMarks = processOutputMarks(nodeMarks);
33360
+ if (outputMarks.length) {
33361
+ translated.elements.unshift(generateRunProps(outputMarks));
33362
+ }
33363
+ return translated;
33364
+ };
33365
+ const config = {
33366
+ xmlName: XML_NODE_NAME,
33367
+ sdNodeOrKeyName: SD_NODE_NAME,
33368
+ type: NodeTranslator.translatorTypes.NODE,
33369
+ encode: encode$2,
33370
+ decode,
33371
+ attributes: validXmlAttributes
33372
+ };
33373
+ const translator = NodeTranslator.from(config);
33139
33374
  function exportSchemaToJson(params2) {
33140
33375
  const { type: type2 } = params2.node || {};
33141
33376
  const router = {
@@ -33146,15 +33381,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33146
33381
  text: translateTextNode,
33147
33382
  bulletList: translateList,
33148
33383
  orderedList: translateList,
33149
- lineBreak: translateLineBreak,
33384
+ lineBreak: translator$1,
33150
33385
  table: translateTable,
33151
33386
  tableRow: translateTableRow,
33152
33387
  tableCell: translateTableCell,
33153
33388
  bookmarkStart: translateBookmarkStart,
33154
33389
  fieldAnnotation: translateFieldAnnotation,
33155
- tab: translateTab,
33390
+ tab: translator,
33156
33391
  image: translateImageNode,
33157
- hardBreak: translateHardBreak,
33392
+ hardBreak: translator$1,
33158
33393
  commentRangeStart: () => translateCommentNode(params2, "Start"),
33159
33394
  commentRangeEnd: () => translateCommentNode(params2, "End"),
33160
33395
  commentReference: () => null,
@@ -33167,11 +33402,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33167
33402
  "page-number": translatePageNumberNode,
33168
33403
  "total-page-number": translateTotalPageNumberNode
33169
33404
  };
33170
- if (!router[type2]) {
33405
+ let handler2 = router[type2];
33406
+ if (handler2 && "decode" in handler2 && typeof handler2.decode === "function") {
33407
+ return handler2.decode(params2);
33408
+ }
33409
+ if (!handler2) {
33171
33410
  console.error("No translation function found for node type:", type2);
33172
33411
  return null;
33173
33412
  }
33174
- return router[type2](params2);
33413
+ return handler2(params2);
33175
33414
  }
33176
33415
  function translateBodyNode(params2) {
33177
33416
  let sectPr = params2.bodyNode?.elements.find((n) => n.name === "w:sectPr") || {};
@@ -33365,9 +33604,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33365
33604
  const { tabStops } = attrs;
33366
33605
  if (tabStops && tabStops.length > 0) {
33367
33606
  const tabElements = tabStops.map((tab) => {
33607
+ const posValue = tab.originalPos !== void 0 ? tab.originalPos : pixelsToTwips(tab.pos).toString();
33368
33608
  const tabAttributes = {
33369
33609
  "w:val": tab.val || "start",
33370
- "w:pos": pixelsToTwips(tab.pos).toString()
33610
+ "w:pos": posValue
33371
33611
  };
33372
33612
  if (tab.leader) {
33373
33613
  tabAttributes["w:leader"] = tab.leader;
@@ -33791,23 +34031,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33791
34031
  ]
33792
34032
  };
33793
34033
  };
33794
- function translateLineBreak(params2) {
33795
- const attributes = {};
33796
- const { lineBreakType } = params2.node?.attrs || {};
33797
- if (lineBreakType) {
33798
- attributes["w:type"] = lineBreakType;
33799
- }
33800
- return {
33801
- name: "w:r",
33802
- elements: [
33803
- {
33804
- name: "w:br",
33805
- attributes
33806
- }
33807
- ],
33808
- attributes
33809
- };
33810
- }
33811
34034
  function translateTable(params2) {
33812
34035
  params2.node = preProcessVerticalMergeCells(params2.node, params2);
33813
34036
  const elements = translateChildNodes(params2);
@@ -33854,14 +34077,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33854
34077
  }
33855
34078
  return table;
33856
34079
  }
33857
- function translateTab(params2) {
33858
- const { marks = [] } = params2.node;
33859
- const outputMarks = processOutputMarks(marks);
33860
- const tabNode = {
33861
- name: "w:tab"
33862
- };
33863
- return wrapTextInRun(tabNode, outputMarks);
33864
- }
33865
34080
  function generateTableProperties(node2) {
33866
34081
  const elements = [];
33867
34082
  const { attrs } = node2;
@@ -34700,22 +34915,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34700
34915
  };
34701
34916
  return result;
34702
34917
  }
34703
- function translateHardBreak(params2) {
34704
- const { node: node2 = {} } = params2;
34705
- const { attrs = {} } = node2;
34706
- const { pageBreakSource } = attrs;
34707
- if (pageBreakSource === "sectPr") return null;
34708
- return {
34709
- name: "w:r",
34710
- elements: [
34711
- {
34712
- name: "w:br",
34713
- type: "element",
34714
- attributes: { "w:type": "page" }
34715
- }
34716
- ]
34717
- };
34718
- }
34719
34918
  function translateShapeContainer(params2) {
34720
34919
  const { node: node2 } = params2;
34721
34920
  const elements = translateChildNodes(params2);
@@ -36188,10 +36387,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36188
36387
  } else if (val == "right") {
36189
36388
  val = "end";
36190
36389
  }
36390
+ const rawPos = tab.attributes["w:pos"];
36191
36391
  const tabStop = {
36192
36392
  val,
36193
- pos: twipsToPixels(tab.attributes["w:pos"])
36393
+ pos: twipsToPixels(rawPos)
36194
36394
  };
36395
+ if (rawPos !== void 0) {
36396
+ tabStop.originalPos = rawPos;
36397
+ }
36195
36398
  if (tab.attributes["w:leader"]) {
36196
36399
  tabStop.leader = tab.attributes["w:leader"];
36197
36400
  }
@@ -36544,8 +36747,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36544
36747
  return { nodes: [], consumed: 0 };
36545
36748
  }
36546
36749
  const content = node2?.elements.find((el) => el.name === "w:sdtContent");
36547
- const handler = validGalleryTypeMap[docPartGalleryType];
36548
- const result = handler({ ...params2, nodes: [content] });
36750
+ const handler2 = validGalleryTypeMap[docPartGalleryType];
36751
+ const result = handler2({ ...params2, nodes: [content] });
36549
36752
  return {
36550
36753
  nodes: result,
36551
36754
  consumed: 1
@@ -36811,25 +37014,21 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36811
37014
  handlerName: "standardNodeHandler",
36812
37015
  handler: handleStandardNode
36813
37016
  };
36814
- const handleLineBreakNode = (params2) => {
37017
+ const handler = (params2) => {
36815
37018
  const { nodes } = params2;
36816
37019
  if (nodes.length === 0 || nodes[0].name !== "w:br") {
36817
37020
  return { nodes: [], consumed: 0 };
36818
37021
  }
36819
- const lineBreakType = nodes[0].attributes?.["w:type"];
36820
- const breakType = lineBreakType === "page" ? "hardBreak" : "lineBreak";
37022
+ const result = translator$1.encode(params2);
37023
+ if (!result) return { nodes: [], consumed: 0 };
36821
37024
  return {
36822
- nodes: [
36823
- {
36824
- type: breakType
36825
- }
36826
- ],
37025
+ nodes: [result],
36827
37026
  consumed: 1
36828
37027
  };
36829
37028
  };
36830
37029
  const lineBreakNodeHandlerEntity = {
36831
37030
  handlerName: "lineBreakNodeHandler",
36832
- handler: handleLineBreakNode
37031
+ handler
36833
37032
  };
36834
37033
  const handleBookmarkNode = (params2) => {
36835
37034
  const { nodes, nodeListHandler: nodeListHandler2, editor } = params2;
@@ -36954,34 +37153,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36954
37153
  handlerName: "autoTotalPageCountEntity",
36955
37154
  handler: handleAutoTotalPageNumber
36956
37155
  };
36957
- const handleTabNode = (params2) => {
36958
- const { nodes, docx, parentStyleId } = params2;
36959
- if (nodes.length === 0 || nodes[0].name !== "w:tab") {
36960
- return { nodes: [], consumed: 0 };
36961
- }
36962
- const node2 = nodes[0];
36963
- const styles = docx["word/styles.xml"];
36964
- if (styles && styles.elements?.length) {
36965
- const style2 = styles.elements[0]?.elements?.find((s) => s.attributes?.["w:styleId"] === parentStyleId);
36966
- const pPr = style2?.elements?.find((s) => s.name === "w:pPr");
36967
- const tabsDef = pPr?.elements?.find((s) => s.name === "w:tabs");
36968
- const firstTab = tabsDef?.elements?.find((s) => s.name === "w:tab");
36969
- twipsToPixels(firstTab?.attributes?.["w:pos"]);
36970
- }
36971
- const { attributes = {} } = node2;
36972
- const processedNode = {
36973
- type: "tab",
36974
- attrs: {
36975
- tabSize: attributes["w:val"] || 48
36976
- },
36977
- content: []
36978
- };
36979
- return { nodes: [processedNode], consumed: 1 };
36980
- };
36981
- const tabNodeEntityHandler = {
36982
- handlerName: "tabNodeHandler",
36983
- handler: handleTabNode
36984
- };
36985
37156
  const handlePictNode = (params2) => {
36986
37157
  const { nodes } = params2;
36987
37158
  if (!nodes.length || nodes[0].name !== "w:p") {
@@ -37281,6 +37452,18 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37281
37452
  };
37282
37453
  const IGNORED_NODE_NAMES = ["w:proofErr", "w:lastRenderedPageBreak"];
37283
37454
  const pruneIgnoredNodes = (nodes = []) => nodes.filter((node2) => !IGNORED_NODE_NAMES.includes(node2.name)).map((node2) => node2.elements ? { ...node2, elements: pruneIgnoredNodes(node2.elements) } : node2);
37455
+ const handleTabNode = (params2) => {
37456
+ const { nodes } = params2;
37457
+ if (!nodes.length || nodes[0].name !== "w:tab") {
37458
+ return { nodes: [], consumed: 0 };
37459
+ }
37460
+ const node2 = translator.encode(params2);
37461
+ return { nodes: [node2], consumed: 1 };
37462
+ };
37463
+ const tabNodeEntityHandler = {
37464
+ handlerName: "w:tabTranslator",
37465
+ handler: handleTabNode
37466
+ };
37284
37467
  const createDocumentJson = (docx, converter, editor) => {
37285
37468
  const json = carbonCopy(getInitialJSON(docx));
37286
37469
  if (!json) return null;
@@ -37365,11 +37548,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37365
37548
  autoPageHandlerEntity,
37366
37549
  autoTotalPageCountEntity,
37367
37550
  standardNodeHandlerEntity
37368
- // This is the last one as it can handle everything
37369
37551
  ];
37370
- const handler = createNodeListHandler(entities);
37552
+ const handler2 = createNodeListHandler(entities);
37371
37553
  return {
37372
- handler,
37554
+ handler: handler2,
37373
37555
  handlerEntities: entities
37374
37556
  };
37375
37557
  };
@@ -37414,9 +37596,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37414
37596
  continue;
37415
37597
  }
37416
37598
  const { nodes, consumed, unhandled } = nodeHandlers.reduce(
37417
- (res, handler) => {
37599
+ (res, handler2) => {
37418
37600
  if (res.consumed > 0) return res;
37419
- return handler.handler({
37601
+ return handler2.handler({
37420
37602
  nodes: nodesToHandle,
37421
37603
  docx,
37422
37604
  nodeListHandler: { handler: nodeListHandlerFn, handlerEntities: nodeHandlers },
@@ -37879,7 +38061,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37879
38061
  return;
37880
38062
  }
37881
38063
  }
37882
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.16.5") {
38064
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.17.0") {
37883
38065
  const customLocation = "docProps/custom.xml";
37884
38066
  if (!docx[customLocation]) {
37885
38067
  docx[customLocation] = generateCustomXml();
@@ -38361,7 +38543,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38361
38543
  function generateCustomXml() {
38362
38544
  return DEFAULT_CUSTOM_XML;
38363
38545
  }
38364
- function generateSuperdocVersion(pid = 2, version2 = "0.16.5") {
38546
+ function generateSuperdocVersion(pid = 2, version2 = "0.17.0") {
38365
38547
  return {
38366
38548
  type: "element",
38367
38549
  name: "property",
@@ -41426,10 +41608,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
41426
41608
  }
41427
41609
  const historyKey = new PluginKey("history");
41428
41610
  const closeHistoryKey = new PluginKey("closeHistory");
41429
- function history(config = {}) {
41430
- config = {
41431
- depth: config.depth || 100,
41432
- newGroupDelay: config.newGroupDelay || 500
41611
+ function history(config2 = {}) {
41612
+ config2 = {
41613
+ depth: config2.depth || 100,
41614
+ newGroupDelay: config2.newGroupDelay || 500
41433
41615
  };
41434
41616
  return new Plugin({
41435
41617
  key: historyKey,
@@ -41438,10 +41620,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
41438
41620
  return new HistoryState(Branch.empty, Branch.empty, null, 0, -1);
41439
41621
  },
41440
41622
  apply(tr, hist, state2) {
41441
- return applyTransaction(hist, state2, tr, config);
41623
+ return applyTransaction(hist, state2, tr, config2);
41442
41624
  }
41443
41625
  },
41444
- config,
41626
+ config: config2,
41445
41627
  props: {
41446
41628
  handleDOMEvents: {
41447
41629
  beforeinput(view, e) {
@@ -41480,7 +41662,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
41480
41662
  return hist ? hist.undone.eventCount : 0;
41481
41663
  }
41482
41664
  class Extension {
41483
- constructor(config) {
41665
+ constructor(config2) {
41484
41666
  __publicField$1(this, "type", "extension");
41485
41667
  __publicField$1(this, "name", "extension");
41486
41668
  __publicField$1(this, "options");
@@ -41490,7 +41672,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
41490
41672
  });
41491
41673
  this.config = {
41492
41674
  ...this.config,
41493
- ...config
41675
+ ...config2
41494
41676
  };
41495
41677
  this.name = this.config.name;
41496
41678
  if (this.config.addOptions) {
@@ -41574,7 +41756,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
41574
41756
  /**
41575
41757
  * @param {import('./types/index.js').EditorNodeConfig} config
41576
41758
  */
41577
- constructor(config) {
41759
+ constructor(config2) {
41578
41760
  __publicField$1(this, "type", "node");
41579
41761
  __publicField$1(this, "name", "node");
41580
41762
  __publicField$1(this, "options");
@@ -41587,7 +41769,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
41587
41769
  });
41588
41770
  this.config = {
41589
41771
  ...this.config,
41590
- ...config
41772
+ ...config2
41591
41773
  };
41592
41774
  this.name = this.config.name;
41593
41775
  this.group = this.config.group;
@@ -41611,12 +41793,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
41611
41793
  * @param {import('./types/index.js').EditorNodeConfig} config - The node configuration.
41612
41794
  * @returns {Node} A new Node instance.
41613
41795
  */
41614
- static create(config) {
41615
- return new Node2(config);
41796
+ static create(config2) {
41797
+ return new Node2(config2);
41616
41798
  }
41617
41799
  };
41618
41800
  class Mark {
41619
- constructor(config) {
41801
+ constructor(config2) {
41620
41802
  __publicField$1(this, "type", "mark");
41621
41803
  __publicField$1(this, "name", "mark");
41622
41804
  __publicField$1(this, "options");
@@ -41627,7 +41809,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
41627
41809
  });
41628
41810
  this.config = {
41629
41811
  ...this.config,
41630
- ...config
41812
+ ...config2
41631
41813
  };
41632
41814
  this.name = this.config.name;
41633
41815
  this.isExternal = Boolean(this.config.isExternal);
@@ -46880,10 +47062,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
46880
47062
  }
46881
47063
  function initInput(view) {
46882
47064
  for (let event in handlers) {
46883
- let handler = handlers[event];
47065
+ let handler2 = handlers[event];
46884
47066
  view.dom.addEventListener(event, view.input.eventHandlers[event] = (event2) => {
46885
47067
  if (eventBelongsToView(view, event2) && !runCustomHandler(view, event2) && (view.editable || !(event2.type in editHandlers)))
46886
- handler(view, event2);
47068
+ handler2(view, event2);
46887
47069
  }, passiveHandlers[event] ? { passive: true } : void 0);
46888
47070
  }
46889
47071
  if (safari)
@@ -46910,8 +47092,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
46910
47092
  }
46911
47093
  function runCustomHandler(view, event) {
46912
47094
  return view.someProp("handleDOMEvents", (handlers2) => {
46913
- let handler = handlers2[event.type];
46914
- return handler ? handler(view, event) || event.defaultPrevented : false;
47095
+ let handler2 = handlers2[event.type];
47096
+ return handler2 ? handler2(view, event) || event.defaultPrevented : false;
46915
47097
  });
46916
47098
  }
46917
47099
  function eventBelongsToView(view, event) {
@@ -53246,9 +53428,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
53246
53428
  yesno: annotateYesNo,
53247
53429
  date: annotateDate
53248
53430
  };
53249
- const handler = annotatorHandlers[type2];
53250
- if (!handler) return {};
53251
- return handler(value, input);
53431
+ const handler2 = annotatorHandlers[type2];
53432
+ if (!handler2) return {};
53433
+ return handler2(value, input);
53252
53434
  };
53253
53435
  const annotateHtml = (value) => ({ rawHtml: value });
53254
53436
  const annotateText = (value) => ({ displayLabel: value });
@@ -55221,7 +55403,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
55221
55403
  * @returns {Object | void} Migration results
55222
55404
  */
55223
55405
  processCollaborationMigrations() {
55224
- console.debug("[checkVersionMigrations] Current editor version", "0.16.5");
55406
+ console.debug("[checkVersionMigrations] Current editor version", "0.17.0");
55225
55407
  if (!this.options.ydoc) return;
55226
55408
  const metaMap = this.options.ydoc.getMap("meta");
55227
55409
  let docVersion = metaMap.get("version");
@@ -56361,15 +56543,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
56361
56543
  this.color = options.color === false ? void 0 : options.color || "black";
56362
56544
  this.class = options.class;
56363
56545
  this.handlers = ["dragover", "dragend", "drop", "dragleave"].map((name) => {
56364
- let handler = (e) => {
56546
+ let handler2 = (e) => {
56365
56547
  this[name](e);
56366
56548
  };
56367
- editorView.dom.addEventListener(name, handler);
56368
- return { name, handler };
56549
+ editorView.dom.addEventListener(name, handler2);
56550
+ return { name, handler: handler2 };
56369
56551
  });
56370
56552
  }
56371
56553
  destroy() {
56372
- this.handlers.forEach(({ name, handler }) => this.editorView.dom.removeEventListener(name, handler));
56554
+ this.handlers.forEach(({ name, handler: handler2 }) => this.editorView.dom.removeEventListener(name, handler2));
56373
56555
  }
56374
56556
  update(editorView, prevState) {
56375
56557
  if (this.cursorPos != null && prevState.doc != editorView.state.doc) {
@@ -58095,8 +58277,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
58095
58277
  }
58096
58278
  });
58097
58279
  const generateOrderedListIndex = ({ listLevel, lvlText, listNumberingType, customFormat }) => {
58098
- const handler = listIndexMap[listNumberingType];
58099
- return handler ? handler(listLevel, lvlText, customFormat) : null;
58280
+ const handler2 = listIndexMap[listNumberingType];
58281
+ return handler2 ? handler2(listLevel, lvlText, customFormat) : null;
58100
58282
  };
58101
58283
  const handleDecimal = (path, lvlText) => generateNumbering(path, lvlText, String);
58102
58284
  const handleRoman = (path, lvlText) => generateNumbering(path, lvlText, intToRoman);
@@ -59391,6 +59573,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
59391
59573
  renderDOM() {
59392
59574
  return ["br", {}];
59393
59575
  },
59576
+ addAttributes() {
59577
+ return {
59578
+ /**
59579
+ * @private
59580
+ * @category Attribute
59581
+ * @param {string} [lineBreakType] - Type of line break - passthrough in this node
59582
+ */
59583
+ lineBreakType: { rendered: false },
59584
+ /**
59585
+ * @private
59586
+ * @category Attribute
59587
+ * @param {string} [clear] - Clear attribute - passthrough in this node
59588
+ */
59589
+ clear: { rendered: false }
59590
+ };
59591
+ },
59394
59592
  addCommands() {
59395
59593
  return {
59396
59594
  /**
@@ -59447,7 +59645,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
59447
59645
  pageBreakType: {
59448
59646
  default: null,
59449
59647
  rendered: false
59450
- }
59648
+ },
59649
+ /**
59650
+ * @private
59651
+ * @category Attribute
59652
+ * @param {string} [lineBreakType] - Type of line break - passthrough in this node
59653
+ */
59654
+ lineBreakType: { rendered: false },
59655
+ /**
59656
+ * @private
59657
+ * @category Attribute
59658
+ * @param {string} [clear] - Clear attribute - passthrough in this node
59659
+ */
59660
+ clear: { rendered: false }
59451
59661
  };
59452
59662
  },
59453
59663
  parseDOM() {
@@ -64860,10 +65070,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
64860
65070
  * insertBookmark({ name: 'introduction', id: 'intro-001' })
64861
65071
  * @note Bookmarks are invisible markers for navigation and cross-references
64862
65072
  */
64863
- insertBookmark: (config) => ({ commands: commands2 }) => {
65073
+ insertBookmark: (config2) => ({ commands: commands2 }) => {
64864
65074
  return commands2.insertContent({
64865
65075
  type: this.name,
64866
- attrs: config
65076
+ attrs: config2
64867
65077
  });
64868
65078
  },
64869
65079
  /**
@@ -65420,10 +65630,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
65420
65630
  * })
65421
65631
  * @note Used for spacing, dividers, and special inline content
65422
65632
  */
65423
- insertContentBlock: (config) => ({ commands: commands2 }) => {
65633
+ insertContentBlock: (config2) => ({ commands: commands2 }) => {
65424
65634
  return commands2.insertContent({
65425
65635
  type: this.name,
65426
- attrs: config
65636
+ attrs: config2
65427
65637
  });
65428
65638
  }
65429
65639
  };
@@ -69238,17 +69448,17 @@ Please report this to https://github.com/markedjs/marked.`, e) {
69238
69448
  updateTransitionEndListener(box, "add", listener);
69239
69449
  currentTransitionEndListener = listener;
69240
69450
  }
69241
- function on2(eventType, handler, options) {
69451
+ function on2(eventType, handler2, options) {
69242
69452
  if (options === void 0) {
69243
69453
  options = false;
69244
69454
  }
69245
69455
  var nodes = normalizeToArray(instance.props.triggerTarget || reference2);
69246
69456
  nodes.forEach(function(node2) {
69247
- node2.addEventListener(eventType, handler, options);
69457
+ node2.addEventListener(eventType, handler2, options);
69248
69458
  listeners.push({
69249
69459
  node: node2,
69250
69460
  eventType,
69251
- handler,
69461
+ handler: handler2,
69252
69462
  options
69253
69463
  });
69254
69464
  });
@@ -69282,8 +69492,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
69282
69492
  }
69283
69493
  function removeListeners() {
69284
69494
  listeners.forEach(function(_ref) {
69285
- var node2 = _ref.node, eventType = _ref.eventType, handler = _ref.handler, options = _ref.options;
69286
- node2.removeEventListener(eventType, handler, options);
69495
+ var node2 = _ref.node, eventType = _ref.eventType, handler2 = _ref.handler, options = _ref.options;
69496
+ node2.removeEventListener(eventType, handler2, options);
69287
69497
  });
69288
69498
  listeners = [];
69289
69499
  }
@@ -70123,13 +70333,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
70123
70333
  }
70124
70334
  return coords;
70125
70335
  }
70126
- const computePosition$1 = async (reference2, floating, config) => {
70336
+ const computePosition$1 = async (reference2, floating, config2) => {
70127
70337
  const {
70128
70338
  placement = "bottom",
70129
70339
  strategy = "absolute",
70130
70340
  middleware = [],
70131
70341
  platform: platform2
70132
- } = config;
70342
+ } = config2;
70133
70343
  const validMiddleware = middleware.filter(Boolean);
70134
70344
  const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
70135
70345
  let rects = await platform2.getElementRects({
@@ -71734,15 +71944,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
71734
71944
  /**
71735
71945
  Create a query object.
71736
71946
  */
71737
- constructor(config) {
71738
- this.search = config.search;
71739
- this.caseSensitive = !!config.caseSensitive;
71740
- this.literal = !!config.literal;
71741
- this.regexp = !!config.regexp;
71742
- this.replace = config.replace || "";
71947
+ constructor(config2) {
71948
+ this.search = config2.search;
71949
+ this.caseSensitive = !!config2.caseSensitive;
71950
+ this.literal = !!config2.literal;
71951
+ this.regexp = !!config2.regexp;
71952
+ this.replace = config2.replace || "";
71743
71953
  this.valid = !!this.search && !(this.regexp && !validRegExp(this.search));
71744
- this.wholeWord = !!config.wholeWord;
71745
- this.filter = config.filter || null;
71954
+ this.wholeWord = !!config2.wholeWord;
71955
+ this.filter = config2.filter || null;
71746
71956
  this.impl = !this.valid ? nullQuery : this.regexp ? new RegExpQuery(this) : new StringQuery(this);
71747
71957
  }
71748
71958
  /**
@@ -73464,13 +73674,13 @@ ${unwrappedProps}
73464
73674
  return createCNode$1(instance, $2, props, null);
73465
73675
  }
73466
73676
  };
73467
- function CssRender$1(config = {}) {
73677
+ function CssRender$1(config2 = {}) {
73468
73678
  const cssr2 = {
73469
73679
  c: ((...args) => c$2$1(cssr2, ...args)),
73470
73680
  use: (plugin2, ...args) => plugin2.install(cssr2, ...args),
73471
73681
  find: queryElement$1,
73472
73682
  context: {},
73473
- config
73683
+ config: config2
73474
73684
  };
73475
73685
  return cssr2;
73476
73686
  }
@@ -73977,21 +74187,21 @@ ${unwrappedProps}
73977
74187
  );
73978
74188
  return {};
73979
74189
  }
73980
- function ensureTrapHandlers$1(name, el, handler) {
74190
+ function ensureTrapHandlers$1(name, el, handler2) {
73981
74191
  const handlers2 = traps$1[name];
73982
74192
  let elHandlers = handlers2.get(el);
73983
74193
  if (elHandlers === void 0) {
73984
74194
  handlers2.set(el, elHandlers = /* @__PURE__ */ new WeakMap());
73985
74195
  }
73986
- let trapHandler = elHandlers.get(handler);
74196
+ let trapHandler = elHandlers.get(handler2);
73987
74197
  if (trapHandler === void 0) {
73988
- elHandlers.set(handler, trapHandler = createTrapHandler$1(name, el, handler));
74198
+ elHandlers.set(handler2, trapHandler = createTrapHandler$1(name, el, handler2));
73989
74199
  }
73990
74200
  return trapHandler;
73991
74201
  }
73992
- function trapOn$1(name, el, handler, options) {
74202
+ function trapOn$1(name, el, handler2, options) {
73993
74203
  if (name === "mousemoveoutside" || name === "clickoutside") {
73994
- const trapHandlers = ensureTrapHandlers$1(name, el, handler);
74204
+ const trapHandlers = ensureTrapHandlers$1(name, el, handler2);
73995
74205
  Object.keys(trapHandlers).forEach((key) => {
73996
74206
  on$1(key, document, trapHandlers[key], options);
73997
74207
  });
@@ -73999,9 +74209,9 @@ ${unwrappedProps}
73999
74209
  }
74000
74210
  return false;
74001
74211
  }
74002
- function trapOff$1(name, el, handler, options) {
74212
+ function trapOff$1(name, el, handler2, options) {
74003
74213
  if (name === "mousemoveoutside" || name === "clickoutside") {
74004
- const trapHandlers = ensureTrapHandlers$1(name, el, handler);
74214
+ const trapHandlers = ensureTrapHandlers$1(name, el, handler2);
74005
74215
  Object.keys(trapHandlers).forEach((key) => {
74006
74216
  off$1(key, document, trapHandlers[key], options);
74007
74217
  });
@@ -74091,19 +74301,19 @@ ${unwrappedProps}
74091
74301
  const handlers2 = captureElToHandlers.get(target2);
74092
74302
  if (handlers2 !== void 0) {
74093
74303
  currentTargets.set(e, target2);
74094
- for (const handler of handlers2) {
74304
+ for (const handler2 of handlers2) {
74095
74305
  if (immediatePropagationStopped.has(e))
74096
74306
  break;
74097
- handler(e);
74307
+ handler2(e);
74098
74308
  }
74099
74309
  }
74100
74310
  if (i2 === 0 && !bubbles && bubbleElToHandlers !== void 0) {
74101
74311
  const bubbleHandlers = bubbleElToHandlers.get(target2);
74102
74312
  if (bubbleHandlers !== void 0) {
74103
- for (const handler of bubbleHandlers) {
74313
+ for (const handler2 of bubbleHandlers) {
74104
74314
  if (immediatePropagationStopped.has(e))
74105
74315
  break;
74106
- handler(e);
74316
+ handler2(e);
74107
74317
  }
74108
74318
  }
74109
74319
  }
@@ -74118,10 +74328,10 @@ ${unwrappedProps}
74118
74328
  const handlers2 = bubbleElToHandlers.get(target2);
74119
74329
  if (handlers2 !== void 0) {
74120
74330
  currentTargets.set(e, target2);
74121
- for (const handler of handlers2) {
74331
+ for (const handler2 of handlers2) {
74122
74332
  if (immediatePropagationStopped.has(e))
74123
74333
  break;
74124
- handler(e);
74334
+ handler2(e);
74125
74335
  }
74126
74336
  }
74127
74337
  }
@@ -74141,7 +74351,7 @@ ${unwrappedProps}
74141
74351
  const handlers2 = typeToWindowEventHandlers[type2];
74142
74352
  if (handlers2 === void 0)
74143
74353
  return;
74144
- handlers2.forEach((handler) => handler(e));
74354
+ handlers2.forEach((handler2) => handler2(e));
74145
74355
  };
74146
74356
  delegateHandler.displayName = "evtdUnifiedWindowEventHandler";
74147
74357
  return delegateHandler;
@@ -74171,35 +74381,35 @@ ${unwrappedProps}
74171
74381
  }
74172
74382
  return elHandlers;
74173
74383
  }
74174
- function handlerExist(el, phase, type2, handler) {
74384
+ function handlerExist(el, phase, type2, handler2) {
74175
74385
  const elToHandlers = phaseToTypeToElToHandlers[phase][type2];
74176
74386
  if (elToHandlers !== void 0) {
74177
74387
  const handlers2 = elToHandlers.get(el);
74178
74388
  if (handlers2 !== void 0) {
74179
- if (handlers2.has(handler))
74389
+ if (handlers2.has(handler2))
74180
74390
  return true;
74181
74391
  }
74182
74392
  }
74183
74393
  return false;
74184
74394
  }
74185
- function windowEventHandlerExist(type2, handler) {
74395
+ function windowEventHandlerExist(type2, handler2) {
74186
74396
  const handlers2 = typeToWindowEventHandlers[type2];
74187
74397
  if (handlers2 !== void 0) {
74188
- if (handlers2.has(handler)) {
74398
+ if (handlers2.has(handler2)) {
74189
74399
  return true;
74190
74400
  }
74191
74401
  }
74192
74402
  return false;
74193
74403
  }
74194
- function on2(type2, el, handler, options) {
74404
+ function on2(type2, el, handler2, options) {
74195
74405
  let mergedHandler;
74196
74406
  if (typeof options === "object" && options.once === true) {
74197
74407
  mergedHandler = (e) => {
74198
74408
  off2(type2, el, mergedHandler, options);
74199
- handler(e);
74409
+ handler2(e);
74200
74410
  };
74201
74411
  } else {
74202
- mergedHandler = handler;
74412
+ mergedHandler = handler2;
74203
74413
  }
74204
74414
  const trapped = trapOn$1(type2, el, mergedHandler, options);
74205
74415
  if (trapped)
@@ -74216,8 +74426,8 @@ ${unwrappedProps}
74216
74426
  }
74217
74427
  }
74218
74428
  }
74219
- function off2(type2, el, handler, options) {
74220
- const trapped = trapOff$1(type2, el, handler, options);
74429
+ function off2(type2, el, handler2, options) {
74430
+ const trapped = trapOff$1(type2, el, handler2, options);
74221
74431
  if (trapped)
74222
74432
  return;
74223
74433
  const capture = options === true || typeof options === "object" && options.capture === true;
@@ -74226,17 +74436,17 @@ ${unwrappedProps}
74226
74436
  const handlers2 = ensureHandlers(elToHandlers, el);
74227
74437
  if (el === window) {
74228
74438
  const mirrorPhase = capture ? "bubble" : "capture";
74229
- if (!handlerExist(el, mirrorPhase, type2, handler) && windowEventHandlerExist(type2, handler)) {
74439
+ if (!handlerExist(el, mirrorPhase, type2, handler2) && windowEventHandlerExist(type2, handler2)) {
74230
74440
  const windowEventHandlers = typeToWindowEventHandlers[type2];
74231
- windowEventHandlers.delete(handler);
74441
+ windowEventHandlers.delete(handler2);
74232
74442
  if (windowEventHandlers.size === 0) {
74233
74443
  window.removeEventListener(type2, unfiendWindowEventHandler);
74234
74444
  typeToWindowEventHandlers[type2] = void 0;
74235
74445
  }
74236
74446
  }
74237
74447
  }
74238
- if (handlers2.has(handler))
74239
- handlers2.delete(handler);
74448
+ if (handlers2.has(handler2))
74449
+ handlers2.delete(handler2);
74240
74450
  if (handlers2.size === 0) {
74241
74451
  elToHandlers.delete(el);
74242
74452
  }
@@ -74382,16 +74592,16 @@ ${unwrappedProps}
74382
74592
  Object.keys(keydown).forEach((key) => {
74383
74593
  if (key !== e.key)
74384
74594
  return;
74385
- const handler = keydown[key];
74386
- if (typeof handler === "function") {
74387
- handler(e);
74595
+ const handler2 = keydown[key];
74596
+ if (typeof handler2 === "function") {
74597
+ handler2(e);
74388
74598
  } else {
74389
- const { stop = false, prevent = false } = handler;
74599
+ const { stop = false, prevent = false } = handler2;
74390
74600
  if (stop)
74391
74601
  e.stopPropagation();
74392
74602
  if (prevent)
74393
74603
  e.preventDefault();
74394
- handler.handler(e);
74604
+ handler2.handler(e);
74395
74605
  }
74396
74606
  });
74397
74607
  }
@@ -74416,16 +74626,16 @@ ${unwrappedProps}
74416
74626
  Object.keys(keyup).forEach((key) => {
74417
74627
  if (key !== e.key)
74418
74628
  return;
74419
- const handler = keyup[key];
74420
- if (typeof handler === "function") {
74421
- handler(e);
74629
+ const handler2 = keyup[key];
74630
+ if (typeof handler2 === "function") {
74631
+ handler2(e);
74422
74632
  } else {
74423
- const { stop = false, prevent = false } = handler;
74633
+ const { stop = false, prevent = false } = handler2;
74424
74634
  if (stop)
74425
74635
  e.stopPropagation();
74426
74636
  if (prevent)
74427
74637
  e.preventDefault();
74428
- handler.handler(e);
74638
+ handler2.handler(e);
74429
74639
  }
74430
74640
  });
74431
74641
  }
@@ -74843,9 +75053,9 @@ ${unwrappedProps}
74843
75053
  }
74844
75054
  },
74845
75055
  unmounted(el) {
74846
- const { handler } = el[ctxKey$1$1];
74847
- if (handler) {
74848
- off$1("mousemoveoutside", el, handler);
75056
+ const { handler: handler2 } = el[ctxKey$1$1];
75057
+ if (handler2) {
75058
+ off$1("mousemoveoutside", el, handler2);
74849
75059
  }
74850
75060
  el[ctxKey$1$1].handler = void 0;
74851
75061
  }
@@ -74892,9 +75102,9 @@ ${unwrappedProps}
74892
75102
  }
74893
75103
  },
74894
75104
  unmounted(el, { modifiers: modifiers2 }) {
74895
- const { handler } = el[ctxKey$2];
74896
- if (handler) {
74897
- off$1("clickoutside", el, handler, {
75105
+ const { handler: handler2 } = el[ctxKey$2];
75106
+ if (handler2) {
75107
+ off$1("clickoutside", el, handler2, {
74898
75108
  capture: modifiers2.capture
74899
75109
  });
74900
75110
  }
@@ -75883,10 +76093,10 @@ ${style2}
75883
76093
  if (!trigger$1) {
75884
76094
  var toggle_1 = 0;
75885
76095
  var el_1 = document.createTextNode("");
75886
- var config = { characterData: true };
76096
+ var config2 = { characterData: true };
75887
76097
  new MutationObserver(function() {
75888
76098
  return notify$1();
75889
- }).observe(el_1, config);
76099
+ }).observe(el_1, config2);
75890
76100
  trigger$1 = function() {
75891
76101
  el_1.textContent = "".concat(toggle_1 ? toggle_1-- : toggle_1++);
75892
76102
  };
@@ -76130,14 +76340,14 @@ ${style2}
76130
76340
  }
76131
76341
  handleResize(entries) {
76132
76342
  for (const entry of entries) {
76133
- const handler = this.elHandlersMap.get(entry.target);
76134
- if (handler !== void 0) {
76135
- handler(entry);
76343
+ const handler2 = this.elHandlersMap.get(entry.target);
76344
+ if (handler2 !== void 0) {
76345
+ handler2(entry);
76136
76346
  }
76137
76347
  }
76138
76348
  }
76139
- registerHandler(el, handler) {
76140
- this.elHandlersMap.set(el, handler);
76349
+ registerHandler(el, handler2) {
76350
+ this.elHandlersMap.set(el, handler2);
76141
76351
  this.observer.observe(el);
76142
76352
  }
76143
76353
  unregisterHandler(el) {
@@ -80406,13 +80616,13 @@ ${style2}
80406
80616
  vNode.props = Object.assign({}, vNode.props);
80407
80617
  }
80408
80618
  const originalHandler = vNode.props[eventName];
80409
- const handler = events2[eventName];
80619
+ const handler2 = events2[eventName];
80410
80620
  if (!originalHandler) {
80411
- vNode.props[eventName] = handler;
80621
+ vNode.props[eventName] = handler2;
80412
80622
  } else {
80413
80623
  vNode.props[eventName] = (...args) => {
80414
80624
  originalHandler(...args);
80415
- handler(...args);
80625
+ handler2(...args);
80416
80626
  };
80417
80627
  }
80418
80628
  });
@@ -85722,7 +85932,7 @@ ${style2}
85722
85932
  * @param {ToolbarConfig} config - The configuration for the toolbar
85723
85933
  * @returns {void}
85724
85934
  */
85725
- constructor(config) {
85935
+ constructor(config2) {
85726
85936
  super();
85727
85937
  __privateAdd(this, _SuperToolbar_instances);
85728
85938
  __publicField(this, "config", {
@@ -86001,27 +86211,27 @@ ${style2}
86001
86211
  __privateMethod(this, _SuperToolbar_instances, deactivateAll_fn).call(this);
86002
86212
  }
86003
86213
  });
86004
- this.config = { ...this.config, ...config };
86214
+ this.config = { ...this.config, ...config2 };
86005
86215
  this.toolbarItems = [];
86006
86216
  this.overflowItems = [];
86007
- this.documentMode = config.documentMode || "editing";
86008
- this.isDev = config.isDev || false;
86009
- this.superdoc = config.superdoc;
86010
- this.role = config.role || "editor";
86217
+ this.documentMode = config2.documentMode || "editing";
86218
+ this.isDev = config2.isDev || false;
86219
+ this.superdoc = config2.superdoc;
86220
+ this.role = config2.role || "editor";
86011
86221
  this.toolbarContainer = null;
86012
86222
  if (this.config.editor) {
86013
86223
  this.config.mode = this.config.editor.options.mode;
86014
86224
  }
86015
86225
  this.config.icons = {
86016
86226
  ...toolbarIcons,
86017
- ...config.icons
86227
+ ...config2.icons
86018
86228
  };
86019
86229
  this.config.texts = {
86020
86230
  ...toolbarTexts,
86021
- ...config.texts
86231
+ ...config2.texts
86022
86232
  };
86023
- this.config.hideButtons = config.hideButtons ?? true;
86024
- this.config.responsiveToContainer = config.responsiveToContainer ?? false;
86233
+ this.config.hideButtons = config2.hideButtons ?? true;
86234
+ this.config.responsiveToContainer = config2.responsiveToContainer ?? false;
86025
86235
  if (!this.config.selector && this.config.element) {
86026
86236
  this.config.selector = this.config.element;
86027
86237
  }
@@ -86033,7 +86243,7 @@ ${style2}
86033
86243
  texts: this.config.texts,
86034
86244
  fonts: this.config.fonts,
86035
86245
  hideButtons: this.config.hideButtons,
86036
- isDev: config.isDev
86246
+ isDev: config2.isDev
86037
86247
  });
86038
86248
  if (this.config.selector && !this.toolbarContainer) {
86039
86249
  return;
@@ -86044,7 +86254,7 @@ ${style2}
86044
86254
  if (this.toolbarContainer) {
86045
86255
  this.toolbar = this.app.mount(this.toolbarContainer);
86046
86256
  }
86047
- this.activeEditor = config.editor || null;
86257
+ this.activeEditor = config2.editor || null;
86048
86258
  this.updateToolbarState();
86049
86259
  }
86050
86260
  findElementBySelector(selector) {
@@ -87751,6 +87961,10 @@ ${style2}
87751
87961
  }
87752
87962
  };
87753
87963
  const SuperInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$i, [["__scopeId", "data-v-4d5cff52"]]);
87964
+ const registeredHandlers = Object.freeze({
87965
+ "w:br": translator$1,
87966
+ "w:tab": translator
87967
+ });
87754
87968
  const Extensions = {
87755
87969
  Node: Node$1,
87756
87970
  Attribute,
@@ -88159,12 +88373,12 @@ ${style2}
88159
88373
  * Initialize telemetry service
88160
88374
  * @param {TelemetryConfig} config
88161
88375
  */
88162
- constructor(config = {}) {
88163
- this.enabled = config.enabled ?? true;
88164
- this.licenseKey = config.licenseKey ?? Telemetry.COMMUNITY_LICENSE_KEY;
88165
- this.endpoint = config.endpoint ?? Telemetry.DEFAULT_ENDPOINT;
88166
- this.superdocId = config.superdocId;
88167
- this.superdocVersion = config.superdocVersion;
88376
+ constructor(config2 = {}) {
88377
+ this.enabled = config2.enabled ?? true;
88378
+ this.licenseKey = config2.licenseKey ?? Telemetry.COMMUNITY_LICENSE_KEY;
88379
+ this.endpoint = config2.endpoint ?? Telemetry.DEFAULT_ENDPOINT;
88380
+ this.superdocId = config2.superdocId;
88381
+ this.superdocVersion = config2.superdocVersion;
88168
88382
  this.sessionId = this.generateId();
88169
88383
  }
88170
88384
  /**
@@ -90280,36 +90494,36 @@ ${reason}`);
90280
90494
  };
90281
90495
  context.emit("awareness-update", payload);
90282
90496
  }
90283
- function createProvider({ config, user, documentId, socket, superdocInstance }) {
90284
- if (!config.providerType) config.providerType = "superdoc";
90497
+ function createProvider({ config: config2, user, documentId, socket, superdocInstance }) {
90498
+ if (!config2.providerType) config2.providerType = "superdoc";
90285
90499
  const providers = {
90286
- hocuspocus: () => createHocuspocusProvider({ config, user, documentId, socket, superdocInstance }),
90287
- superdoc: () => createSuperDocProvider({ config, user, documentId, superdocInstance })
90500
+ hocuspocus: () => createHocuspocusProvider({ config: config2, user, documentId, socket, superdocInstance }),
90501
+ superdoc: () => createSuperDocProvider({ config: config2, user, documentId, superdocInstance })
90288
90502
  };
90289
- if (!providers) throw new Error(`Provider type ${config.providerType} is not supported.`);
90290
- return providers[config.providerType]();
90503
+ if (!providers) throw new Error(`Provider type ${config2.providerType} is not supported.`);
90504
+ return providers[config2.providerType]();
90291
90505
  }
90292
- function createSuperDocProvider({ config, user, documentId, superdocInstance }) {
90506
+ function createSuperDocProvider({ config: config2, user, documentId, superdocInstance }) {
90293
90507
  const ydoc = new Y.Doc({ gc: false });
90294
90508
  const options = {
90295
90509
  params: {
90296
- ...config.params
90510
+ ...config2.params
90297
90511
  }
90298
90512
  };
90299
- const provider2 = new WebsocketProvider(config.url, documentId, ydoc, options);
90513
+ const provider2 = new WebsocketProvider(config2.url, documentId, ydoc, options);
90300
90514
  provider2.awareness.setLocalStateField("user", user);
90301
90515
  provider2.awareness.on("update", (changes = {}) => {
90302
90516
  return awarenessHandler(superdocInstance, { changes, states: provider2.awareness.getStates() });
90303
90517
  });
90304
90518
  return { provider: provider2, ydoc };
90305
90519
  }
90306
- function createHocuspocusProvider({ config, user, documentId, socket, superdocInstance }) {
90520
+ function createHocuspocusProvider({ config: config2, user, documentId, socket, superdocInstance }) {
90307
90521
  const ydoc = new Y.Doc({ gc: false });
90308
90522
  const options = {
90309
90523
  websocketProvider: socket,
90310
90524
  document: ydoc,
90311
90525
  name: documentId,
90312
- token: config.token || "",
90526
+ token: config2.token || "",
90313
90527
  preserveConnection: false,
90314
90528
  onAuthenticationFailed: () => onAuthenticationFailed(documentId),
90315
90529
  onConnect: () => onConnect(superdocInstance, documentId),
@@ -90676,7 +90890,7 @@ ${reason}`);
90676
90890
  const id = params2.id;
90677
90891
  const type2 = initDocumentType(params2);
90678
90892
  const data = params2.data;
90679
- const config = superdocConfig;
90893
+ const config2 = superdocConfig;
90680
90894
  const state2 = params2.state;
90681
90895
  const role = params2.role;
90682
90896
  const html = params2.html;
@@ -90711,7 +90925,7 @@ ${reason}`);
90711
90925
  const conversations = ref$1(initConversations());
90712
90926
  const conversationsBackup = ref$1(conversations.value);
90713
90927
  function initConversations() {
90714
- if (!config.modules.comments) return [];
90928
+ if (!config2.modules.comments) return [];
90715
90929
  return params2.conversations?.map((c2) => useComment(c2)) || [];
90716
90930
  }
90717
90931
  const core = ref$1(null);
@@ -90725,7 +90939,7 @@ ${reason}`);
90725
90939
  html,
90726
90940
  markdown,
90727
90941
  type: type2,
90728
- config,
90942
+ config: config2,
90729
90943
  state: state2,
90730
90944
  role,
90731
90945
  core,
@@ -90787,14 +91001,14 @@ ${reason}`);
90787
91001
  scrollTop: 0,
90788
91002
  scrollLeft: 0
90789
91003
  });
90790
- const init2 = async (config) => {
91004
+ const init2 = async (config2) => {
90791
91005
  reset();
90792
- currentConfig.value = config;
90793
- const { documents: configDocs, modules: configModules, user: configUser, users: configUsers } = config;
91006
+ currentConfig.value = config2;
91007
+ const { documents: configDocs, modules: configModules, user: configUser, users: configUsers } = config2;
90794
91008
  documentUsers.value = configUsers || [];
90795
91009
  Object.assign(user, configUser);
90796
91010
  Object.assign(modules, configModules);
90797
- if (!configDocs?.length && !config.modules.collaboration) {
91011
+ if (!configDocs?.length && !config2.modules.collaboration) {
90798
91012
  const newDoc = await getFileObject(BlankDOCX, "blank.docx", DOCX);
90799
91013
  const newDocConfig = {
90800
91014
  type: DOCX,
@@ -90802,8 +91016,8 @@ ${reason}`);
90802
91016
  name: "blank.docx",
90803
91017
  isNewFile: true
90804
91018
  };
90805
- if (config.html) newDocConfig.html = config.html;
90806
- if (config.markdown) newDocConfig.markdown = config.markdown;
91019
+ if (config2.html) newDocConfig.html = config2.html;
91020
+ if (config2.markdown) newDocConfig.markdown = config2.markdown;
90807
91021
  configDocs.push(newDocConfig);
90808
91022
  }
90809
91023
  await initializeDocuments(configDocs);
@@ -90953,12 +91167,12 @@ ${reason}`);
90953
91167
  const isFloatingCommentsReady = ref$1(false);
90954
91168
  const generalCommentIds = ref$1([]);
90955
91169
  const pendingComment = ref$1(null);
90956
- const init2 = (config = {}) => {
90957
- const updatedConfig = { ...commentsConfig, ...config };
91170
+ const init2 = (config2 = {}) => {
91171
+ const updatedConfig = { ...commentsConfig, ...config2 };
90958
91172
  Object.assign(commentsConfig, updatedConfig);
90959
91173
  suppressInternalExternal.value = commentsConfig.suppressInternalExternal || false;
90960
- if (config.comments && config.comments.length) {
90961
- commentsList.value = config.comments?.map((c2) => useComment(c2)) || [];
91174
+ if (config2.comments && config2.comments.length) {
91175
+ commentsList.value = config2.comments?.map((c2) => useComment(c2)) || [];
90962
91176
  }
90963
91177
  };
90964
91178
  const getComment = (id) => {
@@ -91795,13 +92009,13 @@ ${unwrappedProps}
91795
92009
  return createCNode(instance, $2, props, null);
91796
92010
  }
91797
92011
  };
91798
- function CssRender(config = {}) {
92012
+ function CssRender(config2 = {}) {
91799
92013
  const cssr2 = {
91800
92014
  c: ((...args) => c$2(cssr2, ...args)),
91801
92015
  use: (plugin2, ...args) => plugin2.install(cssr2, ...args),
91802
92016
  find: queryElement,
91803
92017
  context: {},
91804
- config
92018
+ config: config2
91805
92019
  };
91806
92020
  return cssr2;
91807
92021
  }
@@ -92315,21 +92529,21 @@ ${unwrappedProps}
92315
92529
  );
92316
92530
  return {};
92317
92531
  }
92318
- function ensureTrapHandlers(name, el, handler) {
92532
+ function ensureTrapHandlers(name, el, handler2) {
92319
92533
  const handlers2 = traps[name];
92320
92534
  let elHandlers = handlers2.get(el);
92321
92535
  if (elHandlers === void 0) {
92322
92536
  handlers2.set(el, elHandlers = /* @__PURE__ */ new WeakMap());
92323
92537
  }
92324
- let trapHandler = elHandlers.get(handler);
92538
+ let trapHandler = elHandlers.get(handler2);
92325
92539
  if (trapHandler === void 0) {
92326
- elHandlers.set(handler, trapHandler = createTrapHandler(name, el, handler));
92540
+ elHandlers.set(handler2, trapHandler = createTrapHandler(name, el, handler2));
92327
92541
  }
92328
92542
  return trapHandler;
92329
92543
  }
92330
- function trapOn(name, el, handler, options) {
92544
+ function trapOn(name, el, handler2, options) {
92331
92545
  if (name === "mousemoveoutside" || name === "clickoutside") {
92332
- const trapHandlers = ensureTrapHandlers(name, el, handler);
92546
+ const trapHandlers = ensureTrapHandlers(name, el, handler2);
92333
92547
  Object.keys(trapHandlers).forEach((key) => {
92334
92548
  on(key, document, trapHandlers[key], options);
92335
92549
  });
@@ -92337,9 +92551,9 @@ ${unwrappedProps}
92337
92551
  }
92338
92552
  return false;
92339
92553
  }
92340
- function trapOff(name, el, handler, options) {
92554
+ function trapOff(name, el, handler2, options) {
92341
92555
  if (name === "mousemoveoutside" || name === "clickoutside") {
92342
- const trapHandlers = ensureTrapHandlers(name, el, handler);
92556
+ const trapHandlers = ensureTrapHandlers(name, el, handler2);
92343
92557
  Object.keys(trapHandlers).forEach((key) => {
92344
92558
  off(key, document, trapHandlers[key], options);
92345
92559
  });
@@ -92429,19 +92643,19 @@ ${unwrappedProps}
92429
92643
  const handlers2 = captureElToHandlers.get(target2);
92430
92644
  if (handlers2 !== void 0) {
92431
92645
  currentTargets.set(e, target2);
92432
- for (const handler of handlers2) {
92646
+ for (const handler2 of handlers2) {
92433
92647
  if (immediatePropagationStopped.has(e))
92434
92648
  break;
92435
- handler(e);
92649
+ handler2(e);
92436
92650
  }
92437
92651
  }
92438
92652
  if (i2 === 0 && !bubbles && bubbleElToHandlers !== void 0) {
92439
92653
  const bubbleHandlers = bubbleElToHandlers.get(target2);
92440
92654
  if (bubbleHandlers !== void 0) {
92441
- for (const handler of bubbleHandlers) {
92655
+ for (const handler2 of bubbleHandlers) {
92442
92656
  if (immediatePropagationStopped.has(e))
92443
92657
  break;
92444
- handler(e);
92658
+ handler2(e);
92445
92659
  }
92446
92660
  }
92447
92661
  }
@@ -92456,10 +92670,10 @@ ${unwrappedProps}
92456
92670
  const handlers2 = bubbleElToHandlers.get(target2);
92457
92671
  if (handlers2 !== void 0) {
92458
92672
  currentTargets.set(e, target2);
92459
- for (const handler of handlers2) {
92673
+ for (const handler2 of handlers2) {
92460
92674
  if (immediatePropagationStopped.has(e))
92461
92675
  break;
92462
- handler(e);
92676
+ handler2(e);
92463
92677
  }
92464
92678
  }
92465
92679
  }
@@ -92479,7 +92693,7 @@ ${unwrappedProps}
92479
92693
  const handlers2 = typeToWindowEventHandlers[type2];
92480
92694
  if (handlers2 === void 0)
92481
92695
  return;
92482
- handlers2.forEach((handler) => handler(e));
92696
+ handlers2.forEach((handler2) => handler2(e));
92483
92697
  };
92484
92698
  delegateHandler.displayName = "evtdUnifiedWindowEventHandler";
92485
92699
  return delegateHandler;
@@ -92509,35 +92723,35 @@ ${unwrappedProps}
92509
92723
  }
92510
92724
  return elHandlers;
92511
92725
  }
92512
- function handlerExist(el, phase, type2, handler) {
92726
+ function handlerExist(el, phase, type2, handler2) {
92513
92727
  const elToHandlers = phaseToTypeToElToHandlers[phase][type2];
92514
92728
  if (elToHandlers !== void 0) {
92515
92729
  const handlers2 = elToHandlers.get(el);
92516
92730
  if (handlers2 !== void 0) {
92517
- if (handlers2.has(handler))
92731
+ if (handlers2.has(handler2))
92518
92732
  return true;
92519
92733
  }
92520
92734
  }
92521
92735
  return false;
92522
92736
  }
92523
- function windowEventHandlerExist(type2, handler) {
92737
+ function windowEventHandlerExist(type2, handler2) {
92524
92738
  const handlers2 = typeToWindowEventHandlers[type2];
92525
92739
  if (handlers2 !== void 0) {
92526
- if (handlers2.has(handler)) {
92740
+ if (handlers2.has(handler2)) {
92527
92741
  return true;
92528
92742
  }
92529
92743
  }
92530
92744
  return false;
92531
92745
  }
92532
- function on2(type2, el, handler, options) {
92746
+ function on2(type2, el, handler2, options) {
92533
92747
  let mergedHandler;
92534
92748
  if (typeof options === "object" && options.once === true) {
92535
92749
  mergedHandler = (e) => {
92536
92750
  off2(type2, el, mergedHandler, options);
92537
- handler(e);
92751
+ handler2(e);
92538
92752
  };
92539
92753
  } else {
92540
- mergedHandler = handler;
92754
+ mergedHandler = handler2;
92541
92755
  }
92542
92756
  const trapped = trapOn(type2, el, mergedHandler, options);
92543
92757
  if (trapped)
@@ -92554,8 +92768,8 @@ ${unwrappedProps}
92554
92768
  }
92555
92769
  }
92556
92770
  }
92557
- function off2(type2, el, handler, options) {
92558
- const trapped = trapOff(type2, el, handler, options);
92771
+ function off2(type2, el, handler2, options) {
92772
+ const trapped = trapOff(type2, el, handler2, options);
92559
92773
  if (trapped)
92560
92774
  return;
92561
92775
  const capture = options === true || typeof options === "object" && options.capture === true;
@@ -92564,17 +92778,17 @@ ${unwrappedProps}
92564
92778
  const handlers2 = ensureHandlers(elToHandlers, el);
92565
92779
  if (el === window) {
92566
92780
  const mirrorPhase = capture ? "bubble" : "capture";
92567
- if (!handlerExist(el, mirrorPhase, type2, handler) && windowEventHandlerExist(type2, handler)) {
92781
+ if (!handlerExist(el, mirrorPhase, type2, handler2) && windowEventHandlerExist(type2, handler2)) {
92568
92782
  const windowEventHandlers = typeToWindowEventHandlers[type2];
92569
- windowEventHandlers.delete(handler);
92783
+ windowEventHandlers.delete(handler2);
92570
92784
  if (windowEventHandlers.size === 0) {
92571
92785
  window.removeEventListener(type2, unfiendWindowEventHandler);
92572
92786
  typeToWindowEventHandlers[type2] = void 0;
92573
92787
  }
92574
92788
  }
92575
92789
  }
92576
- if (handlers2.has(handler))
92577
- handlers2.delete(handler);
92790
+ if (handlers2.has(handler2))
92791
+ handlers2.delete(handler2);
92578
92792
  if (handlers2.size === 0) {
92579
92793
  elToHandlers.delete(el);
92580
92794
  }
@@ -92720,16 +92934,16 @@ ${unwrappedProps}
92720
92934
  Object.keys(keydown).forEach((key) => {
92721
92935
  if (key !== e.key)
92722
92936
  return;
92723
- const handler = keydown[key];
92724
- if (typeof handler === "function") {
92725
- handler(e);
92937
+ const handler2 = keydown[key];
92938
+ if (typeof handler2 === "function") {
92939
+ handler2(e);
92726
92940
  } else {
92727
- const { stop = false, prevent = false } = handler;
92941
+ const { stop = false, prevent = false } = handler2;
92728
92942
  if (stop)
92729
92943
  e.stopPropagation();
92730
92944
  if (prevent)
92731
92945
  e.preventDefault();
92732
- handler.handler(e);
92946
+ handler2.handler(e);
92733
92947
  }
92734
92948
  });
92735
92949
  }
@@ -92754,16 +92968,16 @@ ${unwrappedProps}
92754
92968
  Object.keys(keyup).forEach((key) => {
92755
92969
  if (key !== e.key)
92756
92970
  return;
92757
- const handler = keyup[key];
92758
- if (typeof handler === "function") {
92759
- handler(e);
92971
+ const handler2 = keyup[key];
92972
+ if (typeof handler2 === "function") {
92973
+ handler2(e);
92760
92974
  } else {
92761
- const { stop = false, prevent = false } = handler;
92975
+ const { stop = false, prevent = false } = handler2;
92762
92976
  if (stop)
92763
92977
  e.stopPropagation();
92764
92978
  if (prevent)
92765
92979
  e.preventDefault();
92766
- handler.handler(e);
92980
+ handler2.handler(e);
92767
92981
  }
92768
92982
  });
92769
92983
  }
@@ -93154,9 +93368,9 @@ ${unwrappedProps}
93154
93368
  }
93155
93369
  },
93156
93370
  unmounted(el) {
93157
- const { handler } = el[ctxKey$1];
93158
- if (handler) {
93159
- off("mousemoveoutside", el, handler);
93371
+ const { handler: handler2 } = el[ctxKey$1];
93372
+ if (handler2) {
93373
+ off("mousemoveoutside", el, handler2);
93160
93374
  }
93161
93375
  el[ctxKey$1].handler = void 0;
93162
93376
  }
@@ -93203,9 +93417,9 @@ ${unwrappedProps}
93203
93417
  }
93204
93418
  },
93205
93419
  unmounted(el, { modifiers: modifiers2 }) {
93206
- const { handler } = el[ctxKey];
93207
- if (handler) {
93208
- off("clickoutside", el, handler, {
93420
+ const { handler: handler2 } = el[ctxKey];
93421
+ if (handler2) {
93422
+ off("clickoutside", el, handler2, {
93209
93423
  capture: modifiers2.capture
93210
93424
  });
93211
93425
  }
@@ -94194,10 +94408,10 @@ ${style2}
94194
94408
  if (!trigger) {
94195
94409
  var toggle_1 = 0;
94196
94410
  var el_1 = document.createTextNode("");
94197
- var config = { characterData: true };
94411
+ var config2 = { characterData: true };
94198
94412
  new MutationObserver(function() {
94199
94413
  return notify();
94200
- }).observe(el_1, config);
94414
+ }).observe(el_1, config2);
94201
94415
  trigger = function() {
94202
94416
  el_1.textContent = "".concat(toggle_1 ? toggle_1-- : toggle_1++);
94203
94417
  };
@@ -94441,14 +94655,14 @@ ${style2}
94441
94655
  }
94442
94656
  handleResize(entries) {
94443
94657
  for (const entry of entries) {
94444
- const handler = this.elHandlersMap.get(entry.target);
94445
- if (handler !== void 0) {
94446
- handler(entry);
94658
+ const handler2 = this.elHandlersMap.get(entry.target);
94659
+ if (handler2 !== void 0) {
94660
+ handler2(entry);
94447
94661
  }
94448
94662
  }
94449
94663
  }
94450
- registerHandler(el, handler) {
94451
- this.elHandlersMap.set(el, handler);
94664
+ registerHandler(el, handler2) {
94665
+ this.elHandlersMap.set(el, handler2);
94452
94666
  this.observer.observe(el);
94453
94667
  }
94454
94668
  unregisterHandler(el) {
@@ -99383,13 +99597,13 @@ ${style2}
99383
99597
  vNode.props = Object.assign({}, vNode.props);
99384
99598
  }
99385
99599
  const originalHandler = vNode.props[eventName];
99386
- const handler = events2[eventName];
99600
+ const handler2 = events2[eventName];
99387
99601
  if (!originalHandler) {
99388
- vNode.props[eventName] = handler;
99602
+ vNode.props[eventName] = handler2;
99389
99603
  } else {
99390
99604
  vNode.props[eventName] = (...args) => {
99391
99605
  originalHandler(...args);
99392
- handler(...args);
99606
+ handler2(...args);
99393
99607
  };
99394
99608
  }
99395
99609
  });
@@ -104638,8 +104852,8 @@ ${style2}
104638
104852
  selectionLayer.value.style.pointerEvents = "none";
104639
104853
  };
104640
104854
  const shouldShowSelection = computed(() => {
104641
- const config = proxy.$superdoc.config.modules?.comments;
104642
- return !config.readOnly;
104855
+ const config2 = proxy.$superdoc.config.modules?.comments;
104856
+ return !config2.readOnly;
104643
104857
  });
104644
104858
  const handleSuperEditorPageMarginsChange = (doc2, params2) => {
104645
104859
  doc2.documentMarginsLastChange = params2.pageMargins;
@@ -104895,21 +105109,21 @@ ${style2}
104895
105109
  /**
104896
105110
  * @param {Config} config
104897
105111
  */
104898
- constructor(config) {
105112
+ constructor(config2) {
104899
105113
  super();
104900
- this.#init(config);
105114
+ this.#init(config2);
104901
105115
  }
104902
- async #init(config) {
105116
+ async #init(config2) {
104903
105117
  this.config = {
104904
105118
  ...this.config,
104905
- ...config
105119
+ ...config2
104906
105120
  };
104907
105121
  this.config.colors = shuffleArray(this.config.colors);
104908
105122
  this.userColorMap = /* @__PURE__ */ new Map();
104909
105123
  this.colorIndex = 0;
104910
- this.version = "0.16.5";
105124
+ this.version = "0.17.0";
104911
105125
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
104912
- this.superdocId = config.superdocId || v4();
105126
+ this.superdocId = config2.superdocId || v4();
104913
105127
  this.colors = this.config.colors;
104914
105128
  this.#initDocuments();
104915
105129
  await this.#initCollaboration(this.config.modules);
@@ -105057,6 +105271,7 @@ ${style2}
105057
105271
  /**
105058
105272
  * Initialize telemetry service.
105059
105273
  */
105274
+ // eslint-disable-next-line no-unused-private-class-members
105060
105275
  #initTelemetry() {
105061
105276
  this.telemetry = new Telemetry({
105062
105277
  enabled: this.config.telemetry?.enabled ?? true,
@@ -105168,7 +105383,7 @@ ${style2}
105168
105383
  const moduleConfig = this.config.modules?.toolbar || {};
105169
105384
  this.toolbarElement = this.config.modules?.toolbar?.selector || this.config.toolbar;
105170
105385
  this.toolbar = null;
105171
- const config = {
105386
+ const config2 = {
105172
105387
  selector: this.toolbarElement || null,
105173
105388
  isDev: this.isDev || false,
105174
105389
  toolbarGroups: this.config.modules?.toolbar?.groups || this.config.toolbarGroups,
@@ -105185,7 +105400,7 @@ ${style2}
105185
105400
  aiEndpoint: this.config.modules?.ai?.endpoint,
105186
105401
  ...moduleConfig
105187
105402
  };
105188
- this.toolbar = new SuperToolbar(config);
105403
+ this.toolbar = new SuperToolbar(config2);
105189
105404
  this.toolbar.on("superdoc-command", this.onToolbarCommand.bind(this));
105190
105405
  this.once("editorCreate", () => this.toolbar.updateToolbarState());
105191
105406
  }
@@ -105523,15 +105738,15 @@ ${style2}
105523
105738
  /**
105524
105739
  * @param {PDFJSConfig} config
105525
105740
  */
105526
- constructor(config) {
105741
+ constructor(config2) {
105527
105742
  super();
105528
- this.pdfLib = config.pdfLib;
105529
- this.pdfViewer = config.pdfViewer;
105530
- this.workerSrc = config.workerSrc;
105531
- this.textLayerMode = config.textLayerMode ?? 0;
105532
- if (config.setWorker) {
105743
+ this.pdfLib = config2.pdfLib;
105744
+ this.pdfViewer = config2.pdfViewer;
105745
+ this.workerSrc = config2.workerSrc;
105746
+ this.textLayerMode = config2.textLayerMode ?? 0;
105747
+ if (config2.setWorker) {
105533
105748
  if (this.workerSrc) {
105534
- this.pdfLib.GlobalWorkerOptions.workerSrc = config.workerSrc;
105749
+ this.pdfLib.GlobalWorkerOptions.workerSrc = config2.workerSrc;
105535
105750
  } else {
105536
105751
  this.pdfLib.GlobalWorkerOptions.workerSrc = getWorkerSrcFromCDN(this.pdfLib.version);
105537
105752
  }
@@ -105614,26 +105829,26 @@ ${style2}
105614
105829
  * @returns {PDFAdapter}
105615
105830
  * @throws {Error}
105616
105831
  */
105617
- static create(config) {
105832
+ static create(config2) {
105618
105833
  const adapters = {
105619
105834
  pdfjs: () => {
105620
- return new PDFJSAdapter(config);
105835
+ return new PDFJSAdapter(config2);
105621
105836
  },
105622
105837
  default: () => {
105623
105838
  throw new Error("Unsupported adapter");
105624
105839
  }
105625
105840
  };
105626
- const adapter = adapters[config.adapter] ?? adapters.default;
105841
+ const adapter = adapters[config2.adapter] ?? adapters.default;
105627
105842
  return adapter();
105628
105843
  }
105629
105844
  }
105630
- const createPDFConfig = (config) => {
105845
+ const createPDFConfig = (config2) => {
105631
105846
  const defaultConfig = {
105632
105847
  adapter: "pdfjs"
105633
105848
  };
105634
105849
  return {
105635
105850
  ...defaultConfig,
105636
- ...config
105851
+ ...config2
105637
105852
  };
105638
105853
  };
105639
105854
  async function getPdfjsPages(pdf, firstPage, lastPage) {
@@ -105799,6 +106014,7 @@ ${style2}
105799
106014
  exports2.fieldAnnotationHelpers = index$1;
105800
106015
  exports2.getFileObject = getFileObject;
105801
106016
  exports2.getRichTextExtensions = getRichTextExtensions;
106017
+ exports2.registeredHandlers = registeredHandlers;
105802
106018
  exports2.superEditorHelpers = helpers;
105803
106019
  exports2.trackChangesHelpers = index$2;
105804
106020
  Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });