roosterjs 9.53.0 → 9.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1818,6 +1818,8 @@ var PasteTypeNewToOld = {
1818
1818
  asPlainText: 1 /* AsPlainText */,
1819
1819
  mergeFormat: 2 /* MergeFormat */,
1820
1820
  normal: 0 /* Normal */,
1821
+ // The old editor system has no markdown paste concept, fall back to normal paste
1822
+ asMarkdown: 0 /* Normal */,
1821
1823
  };
1822
1824
  var PasteTypeOldToNew = (_a = {},
1823
1825
  _a[3 /* AsImage */] = 'asImage',
@@ -1902,7 +1904,7 @@ exports.OldEventTypeToNewEventType = (_d = {},
1902
1904
  * @internal Convert legacy event object to new event object
1903
1905
  */
1904
1906
  function oldEventToNewEvent(input, refEvent, domToModelSettings) {
1905
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1907
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
1906
1908
  switch (input.eventType) {
1907
1909
  case 9 /* BeforeCutCopy */:
1908
1910
  return {
@@ -1946,7 +1948,7 @@ function oldEventToNewEvent(input, refEvent, domToModelSettings) {
1946
1948
  htmlAfter: input.htmlAfter,
1947
1949
  htmlAttributes: input.htmlAttributes,
1948
1950
  htmlBefore: input.htmlBefore,
1949
- pasteType: PasteTypeOldToNew[input.pasteType],
1951
+ pasteType: (_d = refBeforePasteEvent === null || refBeforePasteEvent === void 0 ? void 0 : refBeforePasteEvent.pasteType) !== null && _d !== void 0 ? _d : PasteTypeOldToNew[input.pasteType],
1950
1952
  };
1951
1953
  case 20 /* BeforeSetContent */:
1952
1954
  return {
@@ -1968,11 +1970,11 @@ function oldEventToNewEvent(input, refEvent, domToModelSettings) {
1968
1970
  changedEntities: refContentChangedEvent === null || refContentChangedEvent === void 0 ? void 0 : refContentChangedEvent.changedEntities,
1969
1971
  contentModel: refContentChangedEvent === null || refContentChangedEvent === void 0 ? void 0 : refContentChangedEvent.contentModel,
1970
1972
  data: input.data,
1971
- entityStates: (_f = (_e = (_d = input.additionalData) === null || _d === void 0 ? void 0 : _d.getEntityState) === null || _e === void 0 ? void 0 : _e.call(_d)) !== null && _f !== void 0 ? _f : refContentChangedEvent === null || refContentChangedEvent === void 0 ? void 0 : refContentChangedEvent.entityStates,
1973
+ entityStates: (_g = (_f = (_e = input.additionalData) === null || _e === void 0 ? void 0 : _e.getEntityState) === null || _f === void 0 ? void 0 : _f.call(_e)) !== null && _g !== void 0 ? _g : refContentChangedEvent === null || refContentChangedEvent === void 0 ? void 0 : refContentChangedEvent.entityStates,
1972
1974
  selection: refContentChangedEvent === null || refContentChangedEvent === void 0 ? void 0 : refContentChangedEvent.selection,
1973
1975
  source: input.source,
1974
- formatApiName: (_h = (_g = input.additionalData) === null || _g === void 0 ? void 0 : _g.formatApiName) !== null && _h !== void 0 ? _h : refContentChangedEvent === null || refContentChangedEvent === void 0 ? void 0 : refContentChangedEvent.formatApiName,
1975
- announceData: (_l = announceDataOldToNew((_k = (_j = input.additionalData) === null || _j === void 0 ? void 0 : _j.getAnnounceData) === null || _k === void 0 ? void 0 : _k.call(_j))) !== null && _l !== void 0 ? _l : refContentChangedEvent === null || refContentChangedEvent === void 0 ? void 0 : refContentChangedEvent.announceData,
1976
+ formatApiName: (_j = (_h = input.additionalData) === null || _h === void 0 ? void 0 : _h.formatApiName) !== null && _j !== void 0 ? _j : refContentChangedEvent === null || refContentChangedEvent === void 0 ? void 0 : refContentChangedEvent.formatApiName,
1977
+ announceData: (_m = announceDataOldToNew((_l = (_k = input.additionalData) === null || _k === void 0 ? void 0 : _k.getAnnounceData) === null || _l === void 0 ? void 0 : _l.call(_k))) !== null && _m !== void 0 ? _m : refContentChangedEvent === null || refContentChangedEvent === void 0 ? void 0 : refContentChangedEvent.announceData,
1976
1978
  };
1977
1979
  case 16 /* ContextMenu */:
1978
1980
  return {
@@ -1995,8 +1997,8 @@ function oldEventToNewEvent(input, refEvent, domToModelSettings) {
1995
1997
  return {
1996
1998
  eventType: 'editorReady',
1997
1999
  eventDataCache: input.eventDataCache,
1998
- addedBlockElements: (_m = refEditorReadyEvent === null || refEditorReadyEvent === void 0 ? void 0 : refEditorReadyEvent.addedBlockElements) !== null && _m !== void 0 ? _m : [],
1999
- removedBlockElements: (_o = refEditorReadyEvent === null || refEditorReadyEvent === void 0 ? void 0 : refEditorReadyEvent.removedBlockElements) !== null && _o !== void 0 ? _o : [],
2000
+ addedBlockElements: (_o = refEditorReadyEvent === null || refEditorReadyEvent === void 0 ? void 0 : refEditorReadyEvent.addedBlockElements) !== null && _o !== void 0 ? _o : [],
2001
+ removedBlockElements: (_p = refEditorReadyEvent === null || refEditorReadyEvent === void 0 ? void 0 : refEditorReadyEvent.removedBlockElements) !== null && _p !== void 0 ? _p : [],
2000
2002
  };
2001
2003
  case 17 /* EnteredShadowEdit */:
2002
2004
  return {
@@ -2070,7 +2072,7 @@ function oldEventToNewEvent(input, refEvent, domToModelSettings) {
2070
2072
  return {
2071
2073
  eventType: 'selectionChanged',
2072
2074
  eventDataCache: input.eventDataCache,
2073
- newSelection: (_p = refSelectionChangedEvent === null || refSelectionChangedEvent === void 0 ? void 0 : refSelectionChangedEvent.newSelection) !== null && _p !== void 0 ? _p : (0, selectionConverter_1.convertRangeExToDomSelection)(input.selectionRangeEx),
2075
+ newSelection: (_q = refSelectionChangedEvent === null || refSelectionChangedEvent === void 0 ? void 0 : refSelectionChangedEvent.newSelection) !== null && _q !== void 0 ? _q : (0, selectionConverter_1.convertRangeExToDomSelection)(input.selectionRangeEx),
2074
2076
  };
2075
2077
  case 21 /* ZoomChanged */:
2076
2078
  return {