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.
@@ -1819,6 +1819,8 @@ var PasteTypeNewToOld = {
1819
1819
  asPlainText: 1 /* AsPlainText */,
1820
1820
  mergeFormat: 2 /* MergeFormat */,
1821
1821
  normal: 0 /* Normal */,
1822
+ // The old editor system has no markdown paste concept, fall back to normal paste
1823
+ asMarkdown: 0 /* Normal */,
1822
1824
  };
1823
1825
  var PasteTypeOldToNew = (_a = {},
1824
1826
  _a[3 /* AsImage */] = 'asImage',
@@ -1903,7 +1905,7 @@ exports.OldEventTypeToNewEventType = (_d = {},
1903
1905
  * @internal Convert legacy event object to new event object
1904
1906
  */
1905
1907
  function oldEventToNewEvent(input, refEvent, domToModelSettings) {
1906
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1908
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
1907
1909
  switch (input.eventType) {
1908
1910
  case 9 /* BeforeCutCopy */:
1909
1911
  return {
@@ -1947,7 +1949,7 @@ function oldEventToNewEvent(input, refEvent, domToModelSettings) {
1947
1949
  htmlAfter: input.htmlAfter,
1948
1950
  htmlAttributes: input.htmlAttributes,
1949
1951
  htmlBefore: input.htmlBefore,
1950
- pasteType: PasteTypeOldToNew[input.pasteType],
1952
+ pasteType: (_d = refBeforePasteEvent === null || refBeforePasteEvent === void 0 ? void 0 : refBeforePasteEvent.pasteType) !== null && _d !== void 0 ? _d : PasteTypeOldToNew[input.pasteType],
1951
1953
  };
1952
1954
  case 20 /* BeforeSetContent */:
1953
1955
  return {
@@ -1969,11 +1971,11 @@ function oldEventToNewEvent(input, refEvent, domToModelSettings) {
1969
1971
  changedEntities: refContentChangedEvent === null || refContentChangedEvent === void 0 ? void 0 : refContentChangedEvent.changedEntities,
1970
1972
  contentModel: refContentChangedEvent === null || refContentChangedEvent === void 0 ? void 0 : refContentChangedEvent.contentModel,
1971
1973
  data: input.data,
1972
- 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,
1974
+ 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,
1973
1975
  selection: refContentChangedEvent === null || refContentChangedEvent === void 0 ? void 0 : refContentChangedEvent.selection,
1974
1976
  source: input.source,
1975
- 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,
1976
- 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,
1977
+ 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,
1978
+ 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,
1977
1979
  };
1978
1980
  case 16 /* ContextMenu */:
1979
1981
  return {
@@ -1996,8 +1998,8 @@ function oldEventToNewEvent(input, refEvent, domToModelSettings) {
1996
1998
  return {
1997
1999
  eventType: 'editorReady',
1998
2000
  eventDataCache: input.eventDataCache,
1999
- addedBlockElements: (_m = refEditorReadyEvent === null || refEditorReadyEvent === void 0 ? void 0 : refEditorReadyEvent.addedBlockElements) !== null && _m !== void 0 ? _m : [],
2000
- removedBlockElements: (_o = refEditorReadyEvent === null || refEditorReadyEvent === void 0 ? void 0 : refEditorReadyEvent.removedBlockElements) !== null && _o !== void 0 ? _o : [],
2001
+ addedBlockElements: (_o = refEditorReadyEvent === null || refEditorReadyEvent === void 0 ? void 0 : refEditorReadyEvent.addedBlockElements) !== null && _o !== void 0 ? _o : [],
2002
+ removedBlockElements: (_p = refEditorReadyEvent === null || refEditorReadyEvent === void 0 ? void 0 : refEditorReadyEvent.removedBlockElements) !== null && _p !== void 0 ? _p : [],
2001
2003
  };
2002
2004
  case 17 /* EnteredShadowEdit */:
2003
2005
  return {
@@ -2071,7 +2073,7 @@ function oldEventToNewEvent(input, refEvent, domToModelSettings) {
2071
2073
  return {
2072
2074
  eventType: 'selectionChanged',
2073
2075
  eventDataCache: input.eventDataCache,
2074
- newSelection: (_p = refSelectionChangedEvent === null || refSelectionChangedEvent === void 0 ? void 0 : refSelectionChangedEvent.newSelection) !== null && _p !== void 0 ? _p : (0, selectionConverter_1.convertRangeExToDomSelection)(input.selectionRangeEx),
2076
+ newSelection: (_q = refSelectionChangedEvent === null || refSelectionChangedEvent === void 0 ? void 0 : refSelectionChangedEvent.newSelection) !== null && _q !== void 0 ? _q : (0, selectionConverter_1.convertRangeExToDomSelection)(input.selectionRangeEx),
2075
2077
  };
2076
2078
  case 21 /* ZoomChanged */:
2077
2079
  return {