roosterjs-content-model-dom 9.58.0 → 9.60.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.
Files changed (49) hide show
  1. package/lib/config/defaultHTMLStyleMap.js +3 -0
  2. package/lib/config/defaultHTMLStyleMap.js.map +1 -1
  3. package/lib/formatHandlers/common/borderColorFormatHandler.js +25 -31
  4. package/lib/formatHandlers/common/borderColorFormatHandler.js.map +1 -1
  5. package/lib/index.d.ts +1 -0
  6. package/lib/index.js +4 -2
  7. package/lib/index.js.map +1 -1
  8. package/lib/modelApi/editing/applyTableFormat.js +152 -52
  9. package/lib/modelApi/editing/applyTableFormat.js.map +1 -1
  10. package/lib/modelApi/editing/canMergeCells.d.ts +10 -0
  11. package/lib/modelApi/editing/canMergeCells.js +62 -0
  12. package/lib/modelApi/editing/canMergeCells.js.map +1 -0
  13. package/lib/modelApi/editing/mergeModel.js +36 -3
  14. package/lib/modelApi/editing/mergeModel.js.map +1 -1
  15. package/lib/modelApi/editing/retrieveModelFormatState.js +6 -1
  16. package/lib/modelApi/editing/retrieveModelFormatState.js.map +1 -1
  17. package/lib-amd/config/defaultHTMLStyleMap.js +3 -0
  18. package/lib-amd/config/defaultHTMLStyleMap.js.map +1 -1
  19. package/lib-amd/formatHandlers/common/borderColorFormatHandler.js +25 -31
  20. package/lib-amd/formatHandlers/common/borderColorFormatHandler.js.map +1 -1
  21. package/lib-amd/index.d.ts +1 -0
  22. package/lib-amd/index.js +3 -2
  23. package/lib-amd/index.js.map +1 -1
  24. package/lib-amd/modelApi/editing/applyTableFormat.js +152 -52
  25. package/lib-amd/modelApi/editing/applyTableFormat.js.map +1 -1
  26. package/lib-amd/modelApi/editing/canMergeCells.d.ts +10 -0
  27. package/lib-amd/modelApi/editing/canMergeCells.js +64 -0
  28. package/lib-amd/modelApi/editing/canMergeCells.js.map +1 -0
  29. package/lib-amd/modelApi/editing/mergeModel.js +36 -3
  30. package/lib-amd/modelApi/editing/mergeModel.js.map +1 -1
  31. package/lib-amd/modelApi/editing/retrieveModelFormatState.js +6 -2
  32. package/lib-amd/modelApi/editing/retrieveModelFormatState.js.map +1 -1
  33. package/lib-mjs/config/defaultHTMLStyleMap.js +3 -0
  34. package/lib-mjs/config/defaultHTMLStyleMap.js.map +1 -1
  35. package/lib-mjs/formatHandlers/common/borderColorFormatHandler.js +25 -31
  36. package/lib-mjs/formatHandlers/common/borderColorFormatHandler.js.map +1 -1
  37. package/lib-mjs/index.d.ts +1 -0
  38. package/lib-mjs/index.js +1 -0
  39. package/lib-mjs/index.js.map +1 -1
  40. package/lib-mjs/modelApi/editing/applyTableFormat.js +153 -53
  41. package/lib-mjs/modelApi/editing/applyTableFormat.js.map +1 -1
  42. package/lib-mjs/modelApi/editing/canMergeCells.d.ts +10 -0
  43. package/lib-mjs/modelApi/editing/canMergeCells.js +58 -0
  44. package/lib-mjs/modelApi/editing/canMergeCells.js.map +1 -0
  45. package/lib-mjs/modelApi/editing/mergeModel.js +37 -4
  46. package/lib-mjs/modelApi/editing/mergeModel.js.map +1 -1
  47. package/lib-mjs/modelApi/editing/retrieveModelFormatState.js +6 -1
  48. package/lib-mjs/modelApi/editing/retrieveModelFormatState.js.map +1 -1
  49. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"retrieveModelFormatState.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-dom/lib/modelApi/editing/retrieveModelFormatState.ts"],"names":[],"mappings":";;;;AAAA,kEAAwE;AACxE,yFAAwF;AACxF,uEAAmE;AACnE,uEAAmE;AACnE,sDAAqD;AACrD,oEAAmE;AACnE,oFAAmF;AAiBnF;;;;;;;;;;GAUG;AACH,SAAgB,wBAAwB,CACpC,KAAmC,EACnC,aAA+C,EAC/C,WAAoC,EACpC,gBAAmD,EACnD,SAAqB,EACrB,YAAsB,EACtB,YAA+B;IAH/B,iCAAA,EAAA,2BAAmD;IAKnD,IAAI,iBAA4D,CAAC;IACjE,IAAI,UAAiD,CA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AM;SACb;KACJ;AACL,CAAC;AAED,SAAS,KAAK,CAAC,EAAU;IACrB,IAAI,EAAE,EAAE;QACJ,IAAM,KAAK,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;YACzC,8HAA8H;YAC9H,wBAAwB;YACxB,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC;SAC9D;KACJ;IACD,OAAO,EAAE,CAAC;AACd,CAAC;AAED,SAAS,oBAAoB,CAAC,MAAiC;IAC3D,OAAO,CAAC,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;AAC1E,CAAC","sourcesContent":["import { extractBorderValues } from '../../domUtils/style/borderValues';\nimport { getClosestAncestorBlockGroupIndex } from './getClosestAncestorBlockGroupIndex';\nimport { getImageMetadata } from '../metadata/updateImageMetadata';\nimport { getTableMetadata } from '../metadata/updateTableMetadata';\nimport { isBold } from '../../domUtils/style/isBold';\nimport { iterateSelections } from '../selection/iterateSelections';\nimport { parseValueWithUnit } from '../../formatHandlers/utils/parseValueWithUnit';\nimport type {\n ConflictFormatSolution,\n ContentModelFormatState,\n ContentModelSegmentFormat,\n ReadonlyContentModelBlockGroup,\n ReadonlyContentModelBlock,\n ReadonlyContentModelImage,\n ReadonlyTableSelectionContext,\n ReadonlyContentModelParagraph,\n ReadonlyContentModelFormatContainer,\n ReadonlyContentModelListItem,\n ReadonlyContentModelDocument,\n DOMHelper,\n DarkColorHandler,\n} from 'roosterjs-content-model-types';\n\n/**\n * Retrieve format state from the given Content Model\n * @param model The Content Model to retrieve format state from\n * @param pendingFormat Existing pending format, if any\n * @param formatState Existing format state object, used for receiving the result\n * @param conflictSolution The strategy for handling format conflicts\n * @param domHelper Optional DOMHelper to retrieve container format\n * @param isInDarkMode Optional flag to indicate if the environment is in dark mode\n * @param colorHandler Optional DarkColorHandler to handle dark mode colors\n *\n */\nexport function retrieveModelFormatState(\n model: ReadonlyContentModelDocument,\n pendingFormat: ContentModelSegmentFormat | null,\n formatState: ContentModelFormatState,\n conflictSolution: ConflictFormatSolution = 'remove',\n domHelper?: DOMHelper,\n isInDarkMode?: boolean,\n colorHandler?: DarkColorHandler\n) {\n let firstTableContext: ReadonlyTableSelectionContext | undefined;\n let firstBlock: ReadonlyContentModelBlock | undefined;\n let isFirst = true;\n let isFirstImage = true;\n let isFirstSegment = true;\n let containerFormat: ContentModelSegmentFormat | undefined = undefined;\n\n const modelFormat = { ...model.format };\n\n delete modelFormat.italic;\n delete modelFormat.underline;\n delete modelFormat.fontWeight;\n\n iterateSelections(\n model,\n (path, tableContext, block, segments) => {\n // Structure formats\n retrieveStructureFormat(formatState, path, isFirst, conflictSolution);\n\n // Multiple line format\n if (block) {\n if (firstBlock) {\n formatState.isMultilineSelection = true;\n } else {\n firstBlock = block;\n }\n }\n\n if (block?.blockType == 'Paragraph') {\n // Paragraph formats\n retrieveParagraphFormat(formatState, block, isFirst, conflictSolution);\n\n // Segment formats\n segments?.forEach(segment => {\n if (isFirstSegment || segment.segmentType != 'SelectionMarker') {\n let currentFormat = Object.assign(\n {},\n block.format,\n block.decorator?.format,\n segment.format,\n segment.code?.format,\n segment.link?.format,\n pendingFormat\n );\n\n // Sometimes the content may not specify all required format but just leverage the container format to do so.\n // In this case, we need to merge the container format into the current format\n // to make sure the current format contains all required format.\n if (!hasAllRequiredFormat(currentFormat)) {\n if (!containerFormat) {\n containerFormat =\n domHelper?.getContainerFormat(isInDarkMode, colorHandler) ??\n modelFormat;\n }\n\n currentFormat = Object.assign({}, containerFormat, currentFormat);\n }\n\n retrieveSegmentFormat(\n formatState,\n isFirst,\n currentFormat,\n conflictSolution\n );\n\n mergeValue(\n formatState,\n 'isCodeInline',\n !!segment?.code,\n isFirst,\n conflictSolution\n );\n }\n\n // We only care the format of selection marker when it is the first selected segment. This is because when selection marker\n // is after some other selected segments, it mostly like appears at the beginning of a seconde line when the whole first line\n // is selected (e.g. triple-click on a line) then the second selection marker doesn't contain a correct format, so we need to\n // ignore it\n isFirstSegment = false;\n\n formatState.canUnlink = formatState.canUnlink || !!segment.link;\n formatState.canAddImageAltText =\n formatState.canAddImageAltText ||\n segments.some(segment => segment.segmentType == 'Image');\n\n isFirst = false;\n\n if (segment.segmentType === 'Image') {\n if (isFirstImage) {\n retrieveImageFormat(segment, formatState);\n isFirstImage = false;\n } else {\n formatState.imageFormat = undefined;\n formatState.imageEditingMetadata = undefined;\n }\n }\n });\n\n isFirst = false;\n }\n\n if (tableContext) {\n if (firstTableContext) {\n const { table, colIndex, rowIndex } = firstTableContext;\n\n // Merge table format\n if (\n tableContext.table == table &&\n (tableContext.colIndex != colIndex || tableContext.rowIndex != rowIndex)\n ) {\n formatState.canMergeTableCell = true;\n formatState.isMultilineSelection = true;\n }\n } else {\n // Table formats\n retrieveTableFormat(tableContext, formatState);\n firstTableContext = tableContext;\n }\n }\n },\n {\n includeListFormatHolder: 'never',\n }\n );\n\n if (formatState.fontSize) {\n formatState.fontSize = px2Pt(formatState.fontSize);\n }\n}\n\nfunction retrieveSegmentFormat(\n result: ContentModelFormatState,\n isFirst: boolean,\n mergedFormat: ContentModelSegmentFormat,\n conflictSolution: ConflictFormatSolution = 'remove'\n) {\n const superOrSubscript = mergedFormat.superOrSubScriptSequence?.split(' ')?.pop();\n\n mergeValue(result, 'isBold', isBold(mergedFormat.fontWeight), isFirst, conflictSolution);\n mergeValue(result, 'isItalic', mergedFormat.italic, isFirst, conflictSolution);\n mergeValue(result, 'isUnderline', mergedFormat.underline, isFirst, conflictSolution);\n mergeValue(result, 'isStrikeThrough', mergedFormat.strikethrough, isFirst, conflictSolution);\n mergeValue(result, 'isSuperscript', superOrSubscript == 'super', isFirst, conflictSolution);\n mergeValue(result, 'isSubscript', superOrSubscript == 'sub', isFirst, conflictSolution);\n mergeValue(result, 'letterSpacing', mergedFormat.letterSpacing, isFirst, conflictSolution);\n\n mergeValue(result, 'fontName', mergedFormat.fontFamily, isFirst, conflictSolution);\n mergeValue(\n result,\n 'fontSize',\n mergedFormat.fontSize,\n isFirst,\n conflictSolution,\n val => parseValueWithUnit(val, undefined, 'pt') + 'pt'\n );\n mergeValue(result, 'backgroundColor', mergedFormat.backgroundColor, isFirst, conflictSolution);\n mergeValue(result, 'textColor', mergedFormat.textColor, isFirst, conflictSolution);\n mergeValue(result, 'fontWeight', mergedFormat.fontWeight, isFirst, conflictSolution);\n mergeValue(result, 'lineHeight', mergedFormat.lineHeight, isFirst, conflictSolution);\n}\n\nfunction retrieveParagraphFormat(\n result: ContentModelFormatState,\n paragraph: ReadonlyContentModelParagraph,\n isFirst: boolean,\n conflictSolution: ConflictFormatSolution = 'remove'\n) {\n const headingLevel = parseInt((paragraph.decorator?.tagName || '').substring(1));\n const validHeadingLevel = headingLevel >= 1 && headingLevel <= 6 ? headingLevel : undefined;\n\n mergeValue(result, 'marginBottom', paragraph.format.marginBottom, isFirst, conflictSolution);\n mergeValue(result, 'marginTop', paragraph.format.marginTop, isFirst, conflictSolution);\n mergeValue(result, 'headingLevel', validHeadingLevel, isFirst, conflictSolution);\n mergeValue(result, 'textAlign', paragraph.format.textAlign, isFirst, conflictSolution);\n mergeValue(result, 'direction', paragraph.format.direction, isFirst, conflictSolution);\n}\n\nfunction retrieveStructureFormat(\n result: ContentModelFormatState,\n path: ReadonlyContentModelBlockGroup[],\n isFirst: boolean,\n conflictSolution: ConflictFormatSolution = 'remove'\n) {\n const listItemIndex = getClosestAncestorBlockGroupIndex(path, ['ListItem'], []);\n const containerIndex = getClosestAncestorBlockGroupIndex(path, ['FormatContainer'], []);\n\n if (listItemIndex >= 0) {\n const listItem = path[listItemIndex] as ReadonlyContentModelListItem;\n const listType = listItem?.levels[listItem.levels.length - 1]?.listType;\n\n mergeValue(result, 'isBullet', listType == 'UL', isFirst, conflictSolution);\n mergeValue(result, 'isNumbering', listType == 'OL', isFirst, conflictSolution);\n }\n\n mergeValue(\n result,\n 'isBlockQuote',\n containerIndex >= 0 &&\n (path[containerIndex] as ReadonlyContentModelFormatContainer)?.tagName == 'blockquote',\n isFirst,\n conflictSolution\n );\n}\n\nfunction retrieveTableFormat(\n tableContext: ReadonlyTableSelectionContext,\n result: ContentModelFormatState\n) {\n const tableFormat = getTableMetadata(tableContext.table);\n\n result.isInTable = true;\n result.tableHasHeader = tableContext.table.rows.some(row =>\n row.cells.some(cell => cell.isHeader)\n );\n\n if (tableFormat) {\n result.tableFormat = tableFormat;\n }\n}\n\nfunction retrieveImageFormat(image: ReadonlyContentModelImage, result: ContentModelFormatState) {\n const { format } = image;\n const borderKey = 'borderTop';\n const extractedBorder = extractBorderValues(format[borderKey]);\n const borderColor = extractedBorder.color;\n const borderWidth = extractedBorder.width;\n const borderStyle = extractedBorder.style;\n\n result.imageFormat = {\n borderColor,\n borderWidth,\n borderStyle,\n boxShadow: format.boxShadow,\n borderRadius: format.borderRadius,\n };\n result.imageEditingMetadata = getImageMetadata(image);\n}\n\nfunction mergeValue<K extends keyof ContentModelFormatState>(\n format: ContentModelFormatState,\n key: K,\n newValue: ContentModelFormatState[K] | undefined,\n isFirst: boolean,\n conflictSolution: ConflictFormatSolution = 'remove',\n parseFn: (val: ContentModelFormatState[K]) => ContentModelFormatState[K] = val => val\n) {\n if (isFirst) {\n if (newValue !== undefined) {\n format[key] = newValue;\n }\n } else if (parseFn(newValue) !== parseFn(format[key])) {\n switch (conflictSolution) {\n case 'remove':\n delete format[key];\n break;\n case 'keepFirst':\n break;\n case 'returnMultiple':\n if (typeof format[key] === 'string') {\n (format[key] as string) = 'Multiple';\n } else {\n delete format[key];\n }\n break;\n }\n }\n}\n\nfunction px2Pt(px: string) {\n if (px) {\n const index = px.indexOf('px');\n if (index !== -1 && index === px.length - 2) {\n // Edge may not handle the floating computing well which causes the calculated value to be a little less than the actual value\n // So add 0.05 to fix it\n return Math.round(parseFloat(px) * 75 + 0.05) / 100 + 'pt';\n }\n }\n return px;\n}\n\nfunction hasAllRequiredFormat(format: ContentModelSegmentFormat) {\n return !!format.fontFamily && !!format.fontSize && !!format.textColor;\n}\n"]}
1
+ {"version":3,"file":"retrieveModelFormatState.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-dom/lib/modelApi/editing/retrieveModelFormatState.ts"],"names":[],"mappings":";;;;AAAA,kEAAwE;AACxE,iDAAgD;AAChD,yFAAwF;AACxF,uEAAmE;AACnE,uEAAmE;AACnE,sDAAqD;AACrD,oEAAmE;AACnE,oFAAmF;AAiBnF;;;;;;;;;;GAUG;AACH,SAAgB,wBAAwB,CACpC,KAAmC,EACnC,aAA+C,EAC/C,WAAoC,EACpC,gBAAmD,EACnD,SAAqB,EACrB,YAAsB,EACtB,YAA+B;IAH/B,iCAAA,EAAA,2BAAmD;IAKnD,IAAI,iBAA4D,CAAC;IACjE,IAAI,gBAA2D,CAAC;IAChE,IAAI,UAAiD,CAAC;IACtD,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,YAAY,GAAG,IAAI,CAAC;IACxB,IAAI,cAAc,GAAG,IAAI,CAAC;IAC1B,IAAI,eAAe,GAA0C,SAAS,CAAC;IAEvE,IAAM,WAAW,6BAAQ,KAAK,CAAC,MAAM,CAAE,CAAC;IAExC,OAAO,WAAW,CAAC,MAAM,CAAC;IAC1B,OAAO,WAAW,CAAC,SAAS,CAAC;IAC7B,OAAO,WAAW,CAAC,UAAU,CAAC;IAE9B,IAAA,qCAAiB,EACb,KAAK,EACL,UAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ;QAChC,oBAAoB;QACpB,uBAAuB,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC;QAEtE,uBAAuB;QACvB,IAAI,KAAK,EAAE;YACP,IAAI,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AAU,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC;SAC9D;KACJ;IACD,OAAO,EAAE,CAAC;AACd,CAAC;AAED,SAAS,oBAAoB,CAAC,MAAiC;IAC3D,OAAO,CAAC,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;AAC1E,CAAC","sourcesContent":["import { extractBorderValues } from '../../domUtils/style/borderValues';\nimport { canMergeCells } from './canMergeCells';\nimport { getClosestAncestorBlockGroupIndex } from './getClosestAncestorBlockGroupIndex';\nimport { getImageMetadata } from '../metadata/updateImageMetadata';\nimport { getTableMetadata } from '../metadata/updateTableMetadata';\nimport { isBold } from '../../domUtils/style/isBold';\nimport { iterateSelections } from '../selection/iterateSelections';\nimport { parseValueWithUnit } from '../../formatHandlers/utils/parseValueWithUnit';\nimport type {\n ConflictFormatSolution,\n ContentModelFormatState,\n ContentModelSegmentFormat,\n ReadonlyContentModelBlockGroup,\n ReadonlyContentModelBlock,\n ReadonlyContentModelImage,\n ReadonlyTableSelectionContext,\n ReadonlyContentModelParagraph,\n ReadonlyContentModelFormatContainer,\n ReadonlyContentModelListItem,\n ReadonlyContentModelDocument,\n DOMHelper,\n DarkColorHandler,\n} from 'roosterjs-content-model-types';\n\n/**\n * Retrieve format state from the given Content Model\n * @param model The Content Model to retrieve format state from\n * @param pendingFormat Existing pending format, if any\n * @param formatState Existing format state object, used for receiving the result\n * @param conflictSolution The strategy for handling format conflicts\n * @param domHelper Optional DOMHelper to retrieve container format\n * @param isInDarkMode Optional flag to indicate if the environment is in dark mode\n * @param colorHandler Optional DarkColorHandler to handle dark mode colors\n *\n */\nexport function retrieveModelFormatState(\n model: ReadonlyContentModelDocument,\n pendingFormat: ContentModelSegmentFormat | null,\n formatState: ContentModelFormatState,\n conflictSolution: ConflictFormatSolution = 'remove',\n domHelper?: DOMHelper,\n isInDarkMode?: boolean,\n colorHandler?: DarkColorHandler\n) {\n let firstTableContext: ReadonlyTableSelectionContext | undefined;\n let lastTableContext: ReadonlyTableSelectionContext | undefined;\n let firstBlock: ReadonlyContentModelBlock | undefined;\n let isFirst = true;\n let isFirstImage = true;\n let isFirstSegment = true;\n let containerFormat: ContentModelSegmentFormat | undefined = undefined;\n\n const modelFormat = { ...model.format };\n\n delete modelFormat.italic;\n delete modelFormat.underline;\n delete modelFormat.fontWeight;\n\n iterateSelections(\n model,\n (path, tableContext, block, segments) => {\n // Structure formats\n retrieveStructureFormat(formatState, path, isFirst, conflictSolution);\n\n // Multiple line format\n if (block) {\n if (firstBlock) {\n formatState.isMultilineSelection = true;\n } else {\n firstBlock = block;\n }\n }\n\n if (block?.blockType == 'Paragraph') {\n // Paragraph formats\n retrieveParagraphFormat(formatState, block, isFirst, conflictSolution);\n\n // Segment formats\n segments?.forEach(segment => {\n if (isFirstSegment || segment.segmentType != 'SelectionMarker') {\n let currentFormat = Object.assign(\n {},\n block.format,\n block.decorator?.format,\n segment.format,\n segment.code?.format,\n segment.link?.format,\n pendingFormat\n );\n\n // Sometimes the content may not specify all required format but just leverage the container format to do so.\n // In this case, we need to merge the container format into the current format\n // to make sure the current format contains all required format.\n if (!hasAllRequiredFormat(currentFormat)) {\n if (!containerFormat) {\n containerFormat =\n domHelper?.getContainerFormat(isInDarkMode, colorHandler) ??\n modelFormat;\n }\n\n currentFormat = Object.assign({}, containerFormat, currentFormat);\n }\n\n retrieveSegmentFormat(\n formatState,\n isFirst,\n currentFormat,\n conflictSolution\n );\n\n mergeValue(\n formatState,\n 'isCodeInline',\n !!segment?.code,\n isFirst,\n conflictSolution\n );\n }\n\n // We only care the format of selection marker when it is the first selected segment. This is because when selection marker\n // is after some other selected segments, it mostly like appears at the beginning of a seconde line when the whole first line\n // is selected (e.g. triple-click on a line) then the second selection marker doesn't contain a correct format, so we need to\n // ignore it\n isFirstSegment = false;\n\n formatState.canUnlink = formatState.canUnlink || !!segment.link;\n formatState.canAddImageAltText =\n formatState.canAddImageAltText ||\n segments.some(segment => segment.segmentType == 'Image');\n\n isFirst = false;\n\n if (segment.segmentType === 'Image') {\n if (isFirstImage) {\n retrieveImageFormat(segment, formatState);\n isFirstImage = false;\n } else {\n formatState.imageFormat = undefined;\n formatState.imageEditingMetadata = undefined;\n }\n }\n });\n\n isFirst = false;\n }\n\n if (tableContext) {\n if (firstTableContext) {\n const { table, colIndex, rowIndex } = firstTableContext;\n\n // Merge table format\n if (\n tableContext.table == table &&\n (tableContext.colIndex != colIndex || tableContext.rowIndex != rowIndex)\n ) {\n lastTableContext = tableContext;\n formatState.isMultilineSelection = true;\n }\n } else {\n // Table formats\n retrieveTableFormat(tableContext, formatState);\n firstTableContext = tableContext;\n }\n }\n },\n {\n includeListFormatHolder: 'never',\n }\n );\n\n if (firstTableContext && lastTableContext) {\n formatState.canMergeTableCell = canMergeCells(\n firstTableContext.table.rows,\n firstTableContext.rowIndex,\n firstTableContext.colIndex,\n lastTableContext.rowIndex,\n lastTableContext.colIndex\n );\n }\n\n if (formatState.fontSize) {\n formatState.fontSize = px2Pt(formatState.fontSize);\n }\n}\n\nfunction retrieveSegmentFormat(\n result: ContentModelFormatState,\n isFirst: boolean,\n mergedFormat: ContentModelSegmentFormat,\n conflictSolution: ConflictFormatSolution = 'remove'\n) {\n const superOrSubscript = mergedFormat.superOrSubScriptSequence?.split(' ')?.pop();\n\n mergeValue(result, 'isBold', isBold(mergedFormat.fontWeight), isFirst, conflictSolution);\n mergeValue(result, 'isItalic', mergedFormat.italic, isFirst, conflictSolution);\n mergeValue(result, 'isUnderline', mergedFormat.underline, isFirst, conflictSolution);\n mergeValue(result, 'isStrikeThrough', mergedFormat.strikethrough, isFirst, conflictSolution);\n mergeValue(result, 'isSuperscript', superOrSubscript == 'super', isFirst, conflictSolution);\n mergeValue(result, 'isSubscript', superOrSubscript == 'sub', isFirst, conflictSolution);\n mergeValue(result, 'letterSpacing', mergedFormat.letterSpacing, isFirst, conflictSolution);\n\n mergeValue(result, 'fontName', mergedFormat.fontFamily, isFirst, conflictSolution);\n mergeValue(\n result,\n 'fontSize',\n mergedFormat.fontSize,\n isFirst,\n conflictSolution,\n val => parseValueWithUnit(val, undefined, 'pt') + 'pt'\n );\n mergeValue(result, 'backgroundColor', mergedFormat.backgroundColor, isFirst, conflictSolution);\n mergeValue(result, 'textColor', mergedFormat.textColor, isFirst, conflictSolution);\n mergeValue(result, 'fontWeight', mergedFormat.fontWeight, isFirst, conflictSolution);\n mergeValue(result, 'lineHeight', mergedFormat.lineHeight, isFirst, conflictSolution);\n}\n\nfunction retrieveParagraphFormat(\n result: ContentModelFormatState,\n paragraph: ReadonlyContentModelParagraph,\n isFirst: boolean,\n conflictSolution: ConflictFormatSolution = 'remove'\n) {\n const headingLevel = parseInt((paragraph.decorator?.tagName || '').substring(1));\n const validHeadingLevel = headingLevel >= 1 && headingLevel <= 6 ? headingLevel : undefined;\n\n mergeValue(result, 'marginBottom', paragraph.format.marginBottom, isFirst, conflictSolution);\n mergeValue(result, 'marginTop', paragraph.format.marginTop, isFirst, conflictSolution);\n mergeValue(result, 'headingLevel', validHeadingLevel, isFirst, conflictSolution);\n mergeValue(result, 'textAlign', paragraph.format.textAlign, isFirst, conflictSolution);\n mergeValue(result, 'direction', paragraph.format.direction, isFirst, conflictSolution);\n}\n\nfunction retrieveStructureFormat(\n result: ContentModelFormatState,\n path: ReadonlyContentModelBlockGroup[],\n isFirst: boolean,\n conflictSolution: ConflictFormatSolution = 'remove'\n) {\n const listItemIndex = getClosestAncestorBlockGroupIndex(path, ['ListItem'], []);\n const containerIndex = getClosestAncestorBlockGroupIndex(path, ['FormatContainer'], []);\n\n if (listItemIndex >= 0) {\n const listItem = path[listItemIndex] as ReadonlyContentModelListItem;\n const listType = listItem?.levels[listItem.levels.length - 1]?.listType;\n\n mergeValue(result, 'isBullet', listType == 'UL', isFirst, conflictSolution);\n mergeValue(result, 'isNumbering', listType == 'OL', isFirst, conflictSolution);\n }\n\n mergeValue(\n result,\n 'isBlockQuote',\n containerIndex >= 0 &&\n (path[containerIndex] as ReadonlyContentModelFormatContainer)?.tagName == 'blockquote',\n isFirst,\n conflictSolution\n );\n}\n\nfunction retrieveTableFormat(\n tableContext: ReadonlyTableSelectionContext,\n result: ContentModelFormatState\n) {\n const tableFormat = getTableMetadata(tableContext.table);\n\n result.isInTable = true;\n result.tableHasHeader = tableContext.table.rows.some(row =>\n row.cells.some(cell => cell.isHeader)\n );\n\n if (tableFormat) {\n result.tableFormat = tableFormat;\n }\n}\n\nfunction retrieveImageFormat(image: ReadonlyContentModelImage, result: ContentModelFormatState) {\n const { format } = image;\n const borderKey = 'borderTop';\n const extractedBorder = extractBorderValues(format[borderKey]);\n const borderColor = extractedBorder.color;\n const borderWidth = extractedBorder.width;\n const borderStyle = extractedBorder.style;\n\n result.imageFormat = {\n borderColor,\n borderWidth,\n borderStyle,\n boxShadow: format.boxShadow,\n borderRadius: format.borderRadius,\n };\n result.imageEditingMetadata = getImageMetadata(image);\n}\n\nfunction mergeValue<K extends keyof ContentModelFormatState>(\n format: ContentModelFormatState,\n key: K,\n newValue: ContentModelFormatState[K] | undefined,\n isFirst: boolean,\n conflictSolution: ConflictFormatSolution = 'remove',\n parseFn: (val: ContentModelFormatState[K]) => ContentModelFormatState[K] = val => val\n) {\n if (isFirst) {\n if (newValue !== undefined) {\n format[key] = newValue;\n }\n } else if (parseFn(newValue) !== parseFn(format[key])) {\n switch (conflictSolution) {\n case 'remove':\n delete format[key];\n break;\n case 'keepFirst':\n break;\n case 'returnMultiple':\n if (typeof format[key] === 'string') {\n (format[key] as string) = 'Multiple';\n } else {\n delete format[key];\n }\n break;\n }\n }\n}\n\nfunction px2Pt(px: string) {\n if (px) {\n const index = px.indexOf('px');\n if (index !== -1 && index === px.length - 2) {\n // Edge may not handle the floating computing well which causes the calculated value to be a little less than the actual value\n // So add 0.05 to fix it\n return Math.round(parseFloat(px) * 75 + 0.05) / 100 + 'pt';\n }\n }\n return px;\n}\n\nfunction hasAllRequiredFormat(format: ContentModelSegmentFormat) {\n return !!format.fontFamily && !!format.fontSize && !!format.textColor;\n}\n"]}
@@ -35,6 +35,9 @@ define(["require", "exports", "tslib"], function (require, exports, tslib_1) {
35
35
  marginBottom: '1em',
36
36
  },
37
37
  dt: blockElement,
38
+ del: {
39
+ textDecoration: 'line-through',
40
+ },
38
41
  em: {
39
42
  fontStyle: 'italic',
40
43
  },
@@ -1 +1 @@
1
- {"version":3,"file":"defaultHTMLStyleMap.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-dom/lib/config/defaultHTMLStyleMap.ts"],"names":[],"mappings":";;;;IAEA,IAAM,YAAY,GAAiC;QAC/C,OAAO,EAAE,OAAO;KACnB,CAAC;IAEF;;OAEG;IACU,QAAA,mBAAmB,GAAoB;QAChD,OAAO,EAAE,YAAY;QACrB,OAAO,EAAE,YAAY;QACrB,KAAK,EAAE,YAAY;QACnB,CAAC,EAAE;YACC,UAAU,EAAE,MAAM;SACrB;QACD,UAAU,EAAE;YACR,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,KAAK;YACnB,UAAU,EAAE,MAAM;YAClB,WAAW,EAAE,MAAM;SACtB;QACD,EAAE,EAAE,YAAY;QAChB,MAAM,EAAE;YACJ,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,QAAQ;SACtB;QACD,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE;QACnD,GAAG,EAAE,YAAY;QACjB,EAAE,EAAE;YACA,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,KAAK;SACtB;QACD,EAAE,EAAE,YAAY;QAChB,EAAE,EAAE;YACA,SAAS,EAAE,QAAQ;SACtB;QACD,QAAQ,EAAE,YAAY;QACtB,UAAU,EAAE,YAAY;QACxB,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE,YAAY;QACpB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YACD,aAAa,EAAE,KAAK;YACpB,QAAQ,EAAE,SAAS;SACtB;QACD,GAAG,EAAE;YACD,aAAa,EAAE,OAAO;YACtB,QAAQ,EAAE,SAAS;SACtB;QACD,KAAK,EAAE;YACH,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,YAAY;SAC1B;QACD,EAAE,EAAE;YACA,OAAO,EAAE,YAAY;SACxB;QACD,EAAE,EAAE;YACA,OAAO,EAAE,YAAY;YACrB,UAAU,EAAE,MAAM;SACrB;QACD,CAAC,EAAE;YACC,cAAc,EAAE,WAAW;SAC9B;QACD,EAAE,kDAAO,YAAY,KAAE,kBAAkB,EAAE,MAAM,GAAE;KACtD,CAAC","sourcesContent":["import type { DefaultStyleMap } from 'roosterjs-content-model-types';\n\nconst blockElement: Partial<CSSStyleDeclaration> = {\n display: 'block',\n};\n\n/**\n * @internal\n */\nexport const defaultHTMLStyleMap: DefaultStyleMap = {\n address: blockElement,\n article: blockElement,\n aside: blockElement,\n b: {\n fontWeight: 'bold',\n },\n blockquote: {\n display: 'block',\n marginTop: '1em',\n marginBottom: '1em',\n marginLeft: '40px',\n marginRight: '40px',\n },\n br: blockElement,\n center: {\n display: 'block',\n textAlign: 'center',\n },\n dd: { display: 'block', marginInlineStart: '40px' },\n div: blockElement,\n dl: {\n display: 'block',\n marginTop: '1em',\n marginBottom: '1em',\n },\n dt: blockElement,\n em: {\n fontStyle: 'italic',\n },\n fieldset: blockElement,\n figcaption: blockElement,\n figure: blockElement,\n footer: blockElement,\n form: blockElement,\n h1: {\n display: 'block',\n fontWeight: 'bold',\n fontSize: '2em',\n },\n h2: {\n display: 'block',\n fontWeight: 'bold',\n fontSize: '1.5em',\n },\n h3: {\n display: 'block',\n fontWeight: 'bold',\n fontSize: '1.17em',\n },\n h4: {\n display: 'block',\n fontWeight: 'bold',\n },\n h5: {\n display: 'block',\n fontWeight: 'bold',\n fontSize: '0.83em',\n },\n h6: {\n display: 'block',\n fontWeight: 'bold',\n fontSize: '0.67em',\n },\n header: blockElement,\n hr: blockElement,\n i: {\n fontStyle: 'italic',\n },\n li: {\n display: 'list-item',\n },\n main: blockElement,\n nav: blockElement,\n ol: { ...blockElement, paddingInlineStart: '40px' },\n p: {\n display: 'block',\n marginTop: '1em',\n marginBottom: '1em',\n },\n pre: {\n display: 'block',\n fontFamily: 'monospace',\n whiteSpace: 'pre',\n marginTop: '1em',\n marginBottom: '1em',\n },\n s: {\n textDecoration: 'line-through',\n },\n section: blockElement,\n strike: {\n textDecoration: 'line-through',\n },\n strong: {\n fontWeight: 'bold',\n },\n sub: {\n verticalAlign: 'sub',\n fontSize: 'smaller',\n },\n sup: {\n verticalAlign: 'super',\n fontSize: 'smaller',\n },\n table: {\n display: 'table',\n boxSizing: 'border-box',\n },\n td: {\n display: 'table-cell',\n },\n th: {\n display: 'table-cell',\n fontWeight: 'bold',\n },\n u: {\n textDecoration: 'underline',\n },\n ul: { ...blockElement, paddingInlineStart: '40px' },\n};\n"]}
1
+ {"version":3,"file":"defaultHTMLStyleMap.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-dom/lib/config/defaultHTMLStyleMap.ts"],"names":[],"mappings":";;;;IAEA,IAAM,YAAY,GAAiC;QAC/C,OAAO,EAAE,OAAO;KACnB,CAAC;IAEF;;OAEG;IACU,QAAA,mBAAmB,GAAoB;QAChD,OAAO,EAAE,YAAY;QACrB,OAAO,EAAE,YAAY;QACrB,KAAK,EAAE,YAAY;QACnB,CAAC,EAAE;YACC,UAAU,EAAE,MAAM;SACrB;QACD,UAAU,EAAE;YACR,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,KAAK;YACnB,UAAU,EAAE,MAAM;YAClB,WAAW,EAAE,MAAM;SACtB;QACD,EAAE,EAAE,YAAY;QAChB,MAAM,EAAE;YACJ,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,QAAQ;SACtB;QACD,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,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K;YAChB,YAAY,EAAE,KAAK;SACtB;QACD,GAAG,EAAE;YACD,OAAO,EAAE,OAAO;YAChB,UAAU,EAAE,WAAW;YACvB,UAAU,EAAE,KAAK;YACjB,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,KAAK;SACtB;QACD,CAAC,EAAE;YACC,cAAc,EAAE,cAAc;SACjC;QACD,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE;YACJ,cAAc,EAAE,cAAc;SACjC;QACD,MAAM,EAAE;YACJ,UAAU,EAAE,MAAM;SACrB;QACD,GAAG,EAAE;YACD,aAAa,EAAE,KAAK;YACpB,QAAQ,EAAE,SAAS;SACtB;QACD,GAAG,EAAE;YACD,aAAa,EAAE,OAAO;YACtB,QAAQ,EAAE,SAAS;SACtB;QACD,KAAK,EAAE;YACH,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,YAAY;SAC1B;QACD,EAAE,EAAE;YACA,OAAO,EAAE,YAAY;SACxB;QACD,EAAE,EAAE;YACA,OAAO,EAAE,YAAY;YACrB,UAAU,EAAE,MAAM;SACrB;QACD,CAAC,EAAE;YACC,cAAc,EAAE,WAAW;SAC9B;QACD,EAAE,kDAAO,YAAY,KAAE,kBAAkB,EAAE,MAAM,GAAE;KACtD,CAAC","sourcesContent":["import type { DefaultStyleMap } from 'roosterjs-content-model-types';\n\nconst blockElement: Partial<CSSStyleDeclaration> = {\n display: 'block',\n};\n\n/**\n * @internal\n */\nexport const defaultHTMLStyleMap: DefaultStyleMap = {\n address: blockElement,\n article: blockElement,\n aside: blockElement,\n b: {\n fontWeight: 'bold',\n },\n blockquote: {\n display: 'block',\n marginTop: '1em',\n marginBottom: '1em',\n marginLeft: '40px',\n marginRight: '40px',\n },\n br: blockElement,\n center: {\n display: 'block',\n textAlign: 'center',\n },\n dd: { display: 'block', marginInlineStart: '40px' },\n div: blockElement,\n dl: {\n display: 'block',\n marginTop: '1em',\n marginBottom: '1em',\n },\n dt: blockElement,\n del: {\n textDecoration: 'line-through',\n },\n em: {\n fontStyle: 'italic',\n },\n fieldset: blockElement,\n figcaption: blockElement,\n figure: blockElement,\n footer: blockElement,\n form: blockElement,\n h1: {\n display: 'block',\n fontWeight: 'bold',\n fontSize: '2em',\n },\n h2: {\n display: 'block',\n fontWeight: 'bold',\n fontSize: '1.5em',\n },\n h3: {\n display: 'block',\n fontWeight: 'bold',\n fontSize: '1.17em',\n },\n h4: {\n display: 'block',\n fontWeight: 'bold',\n },\n h5: {\n display: 'block',\n fontWeight: 'bold',\n fontSize: '0.83em',\n },\n h6: {\n display: 'block',\n fontWeight: 'bold',\n fontSize: '0.67em',\n },\n header: blockElement,\n hr: blockElement,\n i: {\n fontStyle: 'italic',\n },\n li: {\n display: 'list-item',\n },\n main: blockElement,\n nav: blockElement,\n ol: { ...blockElement, paddingInlineStart: '40px' },\n p: {\n display: 'block',\n marginTop: '1em',\n marginBottom: '1em',\n },\n pre: {\n display: 'block',\n fontFamily: 'monospace',\n whiteSpace: 'pre',\n marginTop: '1em',\n marginBottom: '1em',\n },\n s: {\n textDecoration: 'line-through',\n },\n section: blockElement,\n strike: {\n textDecoration: 'line-through',\n },\n strong: {\n fontWeight: 'bold',\n },\n sub: {\n verticalAlign: 'sub',\n fontSize: 'smaller',\n },\n sup: {\n verticalAlign: 'super',\n fontSize: 'smaller',\n },\n table: {\n display: 'table',\n boxSizing: 'border-box',\n },\n td: {\n display: 'table-cell',\n },\n th: {\n display: 'table-cell',\n fontWeight: 'bold',\n },\n u: {\n textDecoration: 'underline',\n },\n ul: { ...blockElement, paddingInlineStart: '40px' },\n};\n"]}
@@ -26,41 +26,35 @@ define(["require", "exports", "../utils/color", "../utils/borderKeys", "../../do
26
26
  */
27
27
  exports.borderColorFormatHandler = {
28
28
  parse: function (format, element, context) {
29
- if (context.experimentalFeatures &&
30
- context.experimentalFeatures.indexOf('TransformTableBorderColors') > -1) {
31
- borderKeys_1.BorderKeys.forEach(function (key) {
32
- var width = element.style.getPropertyValue(BorderWidthKeyMap[key]);
33
- var style = element.style.getPropertyValue(BorderStyleKeyMap[key]);
34
- var color = (0, color_1.retrieveElementColor)(element, key);
35
- var borderColor = color == 'initial' ? DEFAULT_COLOR : color;
36
- if (borderColor) {
37
- var lightModeColor = (0, color_1.getLightModeColor)(borderColor, !!context.isDarkMode, context.darkColorHandler);
38
- format[key] = (0, borderValues_1.combineBorderValue)({
39
- width: width,
40
- style: style,
41
- color: lightModeColor,
42
- });
43
- }
44
- });
45
- }
29
+ borderKeys_1.BorderKeys.forEach(function (key) {
30
+ var width = element.style.getPropertyValue(BorderWidthKeyMap[key]);
31
+ var style = element.style.getPropertyValue(BorderStyleKeyMap[key]);
32
+ var color = (0, color_1.retrieveElementColor)(element, key);
33
+ var borderColor = color == 'initial' ? DEFAULT_COLOR : color;
34
+ if (borderColor) {
35
+ var lightModeColor = (0, color_1.getLightModeColor)(borderColor, !!context.isDarkMode, context.darkColorHandler);
36
+ format[key] = (0, borderValues_1.combineBorderValue)({
37
+ width: width,
38
+ style: style,
39
+ color: lightModeColor,
40
+ });
41
+ }
42
+ });
46
43
  },
47
44
  apply: function (format, element, context) {
48
- if (context.experimentalFeatures &&
49
- context.experimentalFeatures.indexOf('TransformTableBorderColors') > -1) {
50
- borderKeys_1.BorderKeys.forEach(function (key) {
51
- var value = format[key];
52
- if (value) {
53
- var borderValues = (0, borderValues_1.extractBorderValues)(value);
54
- var borderColorProperty = borderKeys_1.BorderColorKeyMap[key];
55
- if (borderValues.color) {
56
- var transformedColor = (0, color_1.adaptColor)(element, borderValues.color, 'border', !!context.isDarkMode, context.darkColorHandler);
57
- if (transformedColor) {
58
- element.style.setProperty(borderColorProperty, transformedColor);
59
- }
45
+ borderKeys_1.BorderKeys.forEach(function (key) {
46
+ var value = format[key];
47
+ if (value) {
48
+ var borderValues = (0, borderValues_1.extractBorderValues)(value);
49
+ var borderColorProperty = borderKeys_1.BorderColorKeyMap[key];
50
+ if (borderValues.color) {
51
+ var transformedColor = (0, color_1.adaptColor)(element, borderValues.color, 'border', !!context.isDarkMode, context.darkColorHandler);
52
+ if (transformedColor) {
53
+ element.style.setProperty(borderColorProperty, transformedColor);
60
54
  }
61
55
  }
62
- });
63
- }
56
+ }
57
+ });
64
58
  },
65
59
  };
66
60
  });
@@ -1 +1 @@
1
- {"version":3,"file":"borderColorFormatHandler.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-dom/lib/formatHandlers/common/borderColorFormatHandler.ts"],"names":[],"mappings":";;;;IAMA;;OAEG;IACH,IAAM,iBAAiB,GAEnB;QACA,SAAS,EAAE,kBAAkB;QAC7B,WAAW,EAAE,oBAAoB;QACjC,YAAY,EAAE,qBAAqB;QACnC,UAAU,EAAE,mBAAmB;KAClC,CAAC;IAEF;;OAEG;IACH,IAAM,iBAAiB,GAEnB;QACA,SAAS,EAAE,kBAAkB;QAC7B,WAAW,EAAE,oBAAoB;QACjC,YAAY,EAAE,qBAAqB;QACnC,UAAU,EAAE,mBAAmB;KAClC,CAAC;IAEF,IAAM,aAAa,GAAG,SAAS,CAAC;IAEhC;;OAEG;IACU,QAAA,wBAAwB,GAAgC;QACjE,KAAK,EAAE,UAAC,MAAM,EAAE,OAAO,EAAE,OAAO;YAC5B,IACI,OAAO,CAAC,oBAAoB;gBAC5B,OAAO,CAAC,oBAAoB,CAAC,OAAO,CAAC,4BAA4B,CAAC,GAAG,CAAC,CAAC,EACzE;gBACE,uBAAU,CAAC,OAAO,CAAC,UAAA,GAAG;oBAClB,IAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC;oBACrE,IAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC;oBACrE,IAAM,KAAK,GAAG,IAAA,4BAAoB,EAAC,OAAO,EAAE,GAAG,CAAC,CAAC;oBACjD,IAAM,WAAW,GAAG,KAAK,IAAI,SAAS,CAAC,CAAC,C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BorderColorKeyMap, BorderKeys } from '../utils/borderKeys';\nimport { combineBorderValue, extractBorderValues } from '../../domUtils/style/borderValues';\nimport type { BorderFormat, BorderKey } from 'roosterjs-content-model-types';\nimport type { FormatHandler } from '../FormatHandler';\n\n/**\n * Keys of border width\n */\nconst BorderWidthKeyMap: {\n [key in BorderKey]: string;\n} = {\n borderTop: 'border-top-width',\n borderRight: 'border-right-width',\n borderBottom: 'border-bottom-width',\n borderLeft: 'border-left-width',\n};\n\n/**\n * Keys of border styles\n */\nconst BorderStyleKeyMap: {\n [key in BorderKey]: string;\n} = {\n borderTop: 'border-top-style',\n borderRight: 'border-right-style',\n borderBottom: 'border-bottom-style',\n borderLeft: 'border-left-style',\n};\n\nconst DEFAULT_COLOR = '#000000';\n\n/**\n * @internal\n */\nexport const borderColorFormatHandler: FormatHandler<BorderFormat> = {\n parse: (format, element, context) => {\n if (\n context.experimentalFeatures &&\n context.experimentalFeatures.indexOf('TransformTableBorderColors') > -1\n ) {\n BorderKeys.forEach(key => {\n const width = element.style.getPropertyValue(BorderWidthKeyMap[key]);\n const style = element.style.getPropertyValue(BorderStyleKeyMap[key]);\n const color = retrieveElementColor(element, key);\n const borderColor = color == 'initial' ? DEFAULT_COLOR : color;\n\n if (borderColor) {\n const lightModeColor = getLightModeColor(\n borderColor,\n !!context.isDarkMode,\n context.darkColorHandler\n );\n\n format[key] = combineBorderValue({\n width,\n style,\n color: lightModeColor,\n });\n }\n });\n }\n },\n apply: (format, element, context) => {\n if (\n context.experimentalFeatures &&\n context.experimentalFeatures.indexOf('TransformTableBorderColors') > -1\n ) {\n BorderKeys.forEach(key => {\n const value = format[key];\n if (value) {\n const borderValues = extractBorderValues(value);\n const borderColorProperty = BorderColorKeyMap[key];\n if (borderValues.color) {\n const transformedColor = adaptColor(\n element,\n borderValues.color,\n 'border',\n !!context.isDarkMode,\n context.darkColorHandler\n );\n if (transformedColor) {\n element.style.setProperty(borderColorProperty, transformedColor);\n }\n }\n }\n });\n }\n },\n};\n"]}
1
+ {"version":3,"file":"borderColorFormatHandler.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-dom/lib/formatHandlers/common/borderColorFormatHandler.ts"],"names":[],"mappings":";;;;IAMA;;OAEG;IACH,IAAM,iBAAiB,GAEnB;QACA,SAAS,EAAE,kBAAkB;QAC7B,WAAW,EAAE,oBAAoB;QACjC,YAAY,EAAE,qBAAqB;QACnC,UAAU,EAAE,mBAAmB;KAClC,CAAC;IAEF;;OAEG;IACH,IAAM,iBAAiB,GAEnB;QACA,SAAS,EAAE,kBAAkB;QAC7B,WAAW,EAAE,oBAAoB;QACjC,YAAY,EAAE,qBAAqB;QACnC,UAAU,EAAE,mBAAmB;KAClC,CAAC;IAEF,IAAM,aAAa,GAAG,SAAS,CAAC;IAEhC;;OAEG;IACU,QAAA,wBAAwB,GAAgC;QACjE,KAAK,EAAE,UAAC,MAAM,EAAE,OAAO,EAAE,OAAO;YAC5B,uBAAU,CAAC,OAAO,CAAC,UAAA,GAAG;gBAClB,IAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC;gBACrE,IAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC;gBACrE,IAAM,KAAK,GAAG,IAAA,4BAAoB,EAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBACjD,IAAM,WAAW,GAAG,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC;gBAE/D,IAAI,WAAW,EAAE;oBACb,IAAM,cAAc,GAAG,IAAA,yBAAiB,EACpC,WAAW,EACX,CAAC,CAAC,OAAO,CAAC,UAAU,EACpB,OAAO,CAAC,gBAAgB,CAC3B,CAAC;oBAEF,MAAM,CAAC,GAAG,CAAC,GAAG,IAAA,iCAAkB,EAAC;wBAC7B,KAAK,OAAA;wBACL,KAAK,OAAA;wBACL,KAAK,EAAE,cAAc;qBACxB,CAAC,CAAC;iBACN;YACL,CAAC,CAAC,CAAC;QACP,CAAC;QACD,KAAK,EAAE,UAAC,MAAM,EAAE,OAAO,EAAE,OAAO;YAC5B,uBAAU,CAAC,OAAO,CAAC,UAAA,GAAG;gBAClB,IAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC1B,IAAI,KAAK,EAAE;oBACP,IAAM,YAAY,GAAG,IAAA,kCAAmB,EAAC,KAAK,CAAC,CAAC;oBAChD,IAAM,mBAAmB,GAAG,8BAAiB,CAAC,GAAG,CAAC,CAAC;oBACnD,IAAI,YAAY,CAAC,KAAK,EAAE;wBACpB,IAAM,gBAAgB,GAAG,IAAA,kBAAU,EAC/B,OAAO,EACP,YAAY,CAAC,KAAK,EAClB,QAAQ,EACR,CAAC,CAAC,OAAO,CAAC,UAAU,EACpB,OAAO,CAAC,gBAAgB,CAC3B,CAAC;wBACF,IAAI,gBAAgB,EAAE;4BAClB,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAC;yBACpE;qBACJ;iBACJ;YACL,CAAC,CAAC,CAAC;QACP,CAAC;KACJ,CAAC","sourcesContent":["import { adaptColor, getLightModeColor, retrieveElementColor } from '../utils/color';\nimport { BorderColorKeyMap, BorderKeys } from '../utils/borderKeys';\nimport { combineBorderValue, extractBorderValues } from '../../domUtils/style/borderValues';\nimport type { BorderFormat, BorderKey } from 'roosterjs-content-model-types';\nimport type { FormatHandler } from '../FormatHandler';\n\n/**\n * Keys of border width\n */\nconst BorderWidthKeyMap: {\n [key in BorderKey]: string;\n} = {\n borderTop: 'border-top-width',\n borderRight: 'border-right-width',\n borderBottom: 'border-bottom-width',\n borderLeft: 'border-left-width',\n};\n\n/**\n * Keys of border styles\n */\nconst BorderStyleKeyMap: {\n [key in BorderKey]: string;\n} = {\n borderTop: 'border-top-style',\n borderRight: 'border-right-style',\n borderBottom: 'border-bottom-style',\n borderLeft: 'border-left-style',\n};\n\nconst DEFAULT_COLOR = '#000000';\n\n/**\n * @internal\n */\nexport const borderColorFormatHandler: FormatHandler<BorderFormat> = {\n parse: (format, element, context) => {\n BorderKeys.forEach(key => {\n const width = element.style.getPropertyValue(BorderWidthKeyMap[key]);\n const style = element.style.getPropertyValue(BorderStyleKeyMap[key]);\n const color = retrieveElementColor(element, key);\n const borderColor = color == 'initial' ? DEFAULT_COLOR : color;\n\n if (borderColor) {\n const lightModeColor = getLightModeColor(\n borderColor,\n !!context.isDarkMode,\n context.darkColorHandler\n );\n\n format[key] = combineBorderValue({\n width,\n style,\n color: lightModeColor,\n });\n }\n });\n },\n apply: (format, element, context) => {\n BorderKeys.forEach(key => {\n const value = format[key];\n if (value) {\n const borderValues = extractBorderValues(value);\n const borderColorProperty = BorderColorKeyMap[key];\n if (borderValues.color) {\n const transformedColor = adaptColor(\n element,\n borderValues.color,\n 'border',\n !!context.isDarkMode,\n context.darkColorHandler\n );\n if (transformedColor) {\n element.style.setProperty(borderColorProperty, transformedColor);\n }\n }\n }\n });\n },\n};\n"]}
@@ -95,6 +95,7 @@ export { hasSelectionInSegment } from './modelApi/selection/hasSelectionInSegmen
95
95
  export { hasSelectionInBlockGroup } from './modelApi/selection/hasSelectionInBlockGroup';
96
96
  export { setSelection } from './modelApi/selection/setSelection';
97
97
  export { cloneModel, cloneModelForPaste } from './modelApi/editing/cloneModel';
98
+ export { canMergeCells } from './modelApi/editing/canMergeCells';
98
99
  export { mergeModel } from './modelApi/editing/mergeModel';
99
100
  export { deleteSelection } from './modelApi/editing/deleteSelection';
100
101
  export { deleteSegment } from './modelApi/editing/deleteSegment';
package/lib-amd/index.js CHANGED
@@ -1,7 +1,7 @@
1
- define(["require", "exports", "./domToModel/domToContentModel", "./modelToDom/contentModelToDom", "./modelToText/contentModelToText", "./domToModel/processors/childProcessor", "./domToModel/processors/entityProcessor", "./domToModel/processors/tableProcessor", "./domToModel/processors/formatContainerProcessor", "./domToModel/utils/getRegularSelectionOffsets", "./domToModel/utils/parseFormat", "./domToModel/utils/areSameFormats", "./domToModel/utils/isBlockElement", "./domToModel/utils/buildSelectionMarker", "./modelApi/metadata/updateMetadata", "./domUtils/isNodeOfType", "./domUtils/isElementOfType", "./domUtils/getObjectKeys", "./domUtils/getSafeIdSelector", "./domUtils/toArray", "./domUtils/moveChildNodes", "./domUtils/wrap", "./domUtils/unwrap", "./domUtils/entityUtils", "./domUtils/reuseCachedElement", "./domUtils/isWhiteSpacePreserved", "./domUtils/normalizeRect", "./domUtils/scrollRectIntoView", "./domUtils/hiddenProperties/undeletableLink", "./modelApi/creators/createBr", "./modelApi/creators/createListItem", "./modelApi/creators/createFormatContainer", "./modelApi/creators/createParagraph", "./modelApi/creators/createSelectionMarker", "./modelApi/creators/createTable", "./modelApi/creators/createTableCell", "./modelApi/creators/createText", "./modelApi/creators/createImage", "./modelApi/creators/createContentModelDocument", "./modelApi/creators/createParagraphDecorator", "./modelApi/creators/createGeneralSegment", "./modelApi/creators/createGeneralBlock", "./modelApi/creators/createEntity", "./modelApi/creators/createDivider", "./modelApi/creators/createListLevel", "./modelApi/creators/createEmptyModel", "./modelApi/creators/createTableRow", "./modelApi/common/mutate", "./modelApi/common/addBlock", "./modelApi/common/addDecorators", "./modelApi/common/addDecorators", "./modelApi/common/addDecorators", "./modelApi/common/addTextSegment", "./modelApi/common/normalizeParagraph", "./modelApi/common/normalizeContentModel", "./modelApi/typeCheck/isGeneralSegment", "./modelApi/common/unwrapBlock", "./modelApi/common/addSegment", "./modelApi/common/isEmpty", "./modelApi/common/normalizeSegment", "./modelApi/common/mergeTextSegments", "./modelApi/common/normalizeSegmentFormat", "./modelApi/block/setParagraphNotImplicit", "./modelApi/block/copyFormat", "./modelApi/list/getOrderedListNumberStr", "./modelApi/list/getAutoListStyleType", "./formatHandlers/utils/parseValueWithUnit", "./formatHandlers/utils/borderKeys", "./formatHandlers/utils/color", "./domToModel/context/createDomToModelContext", "./modelToDom/context/createModelToDomContext", "./domUtils/style/isBold", "./domUtils/selection/getSelectionRootNode", "./domUtils/selection/getDOMInsertPointRect", "./domUtils/selection/trimModelForSelection", "./domUtils/event/eventUtils", "./domUtils/event/getNodePositionFromEvent", "./domUtils/style/borderValues", "./domUtils/stringUtil", "./domUtils/table/parseTableCells", "./domUtils/readFile", "./domUtils/retrieveDocumentMetadata", "./domUtils/style/transformColor", "./domUtils/style/normalizeFontFamily", "./domUtils/event/extractClipboardItems", "./domUtils/event/createPasteFragment", "./domUtils/event/cacheGetEventData", "./domUtils/hiddenProperties/paragraphMarker", "./domUtils/hiddenProperties/imageState", "./domUtils/getRangesByText", "./modelApi/typeCheck/isBlockGroupOfType", "./modelApi/selection/iterateSelections", "./modelApi/selection/collectSelections", "./modelApi/selection/getSelectedCells", "./modelApi/selection/hasSelectionInBlock", "./modelApi/selection/hasSelectionInSegment", "./modelApi/selection/hasSelectionInBlockGroup", "./modelApi/selection/setSelection", "./modelApi/editing/cloneModel", "./modelApi/editing/mergeModel", "./modelApi/editing/deleteSelection", "./modelApi/editing/deleteSegment", "./modelApi/editing/deleteBlock", "./modelApi/editing/applyTableFormat", "./modelApi/editing/normalizeTable", "./modelApi/editing/setTableCellBackgroundColor", "./modelApi/editing/retrieveModelFormatState", "./modelApi/editing/getListStyleTypeFromString", "./modelApi/editing/getSegmentTextFormat", "./modelApi/editing/getClosestAncestorBlockGroupIndex", "./modelApi/editing/runEditSteps", "./modelApi/metadata/updateImageMetadata", "./modelApi/metadata/updateTableCellMetadata", "./modelApi/metadata/updateTableMetadata", "./modelApi/metadata/updateListMetadata", "./constants/ChangeSource", "./constants/BulletListType", "./constants/NumberingListType", "./constants/TableBorderFormat", "./constants/OrderedListStyleMap", "./constants/UnorderedListStyleMap", "./constants/EmptySegmentFormat"], function (require, exports, domToContentModel_1, contentModelToDom_1, contentModelToText_1, childProcessor_1, entityProcessor_1, tableProcessor_1, formatContainerProcessor_1, getRegularSelectionOffsets_1, parseFormat_1, areSameFormats_1, isBlockElement_1, buildSelectionMarker_1, updateMetadata_1, isNodeOfType_1, isElementOfType_1, getObjectKeys_1, getSafeIdSelector_1, toArray_1, moveChildNodes_1, wrap_1, unwrap_1, entityUtils_1, reuseCachedElement_1, isWhiteSpacePreserved_1, normalizeRect_1, scrollRectIntoView_1, undeletableLink_1, createBr_1, createListItem_1, createFormatContainer_1, createParagraph_1, createSelectionMarker_1, createTable_1, createTableCell_1, createText_1, createImage_1, createContentModelDocument_1, createParagraphDecorator_1, createGeneralSegment_1, createGeneralBlock_1, createEntity_1, createDivider_1, createListLevel_1, createEmptyModel_1, createTableRow_1, mutate_1, addBlock_1, addDecorators_1, addDecorators_2, addDecorators_3, addTextSegment_1, normalizeParagraph_1, normalizeContentModel_1, isGeneralSegment_1, unwrapBlock_1, addSegment_1, isEmpty_1, normalizeSegment_1, mergeTextSegments_1, normalizeSegmentFormat_1, setParagraphNotImplicit_1, copyFormat_1, getOrderedListNumberStr_1, getAutoListStyleType_1, parseValueWithUnit_1, borderKeys_1, color_1, createDomToModelContext_1, createModelToDomContext_1, isBold_1, getSelectionRootNode_1, getDOMInsertPointRect_1, trimModelForSelection_1, eventUtils_1, getNodePositionFromEvent_1, borderValues_1, stringUtil_1, parseTableCells_1, readFile_1, retrieveDocumentMetadata_1, transformColor_1, normalizeFontFamily_1, extractClipboardItems_1, createPasteFragment_1, cacheGetEventData_1, paragraphMarker_1, imageState_1, getRangesByText_1, isBlockGroupOfType_1, iterateSelections_1, collectSelections_1, getSelectedCells_1, hasSelectionInBlock_1, hasSelectionInSegment_1, hasSelectionInBlockGroup_1, setSelection_1, cloneModel_1, mergeModel_1, deleteSelection_1, deleteSegment_1, deleteBlock_1, applyTableFormat_1, normalizeTable_1, setTableCellBackgroundColor_1, retrieveModelFormatState_1, getListStyleTypeFromString_1, getSegmentTextFormat_1, getClosestAncestorBlockGroupIndex_1, runEditSteps_1, updateImageMetadata_1, updateTableCellMetadata_1, updateTableMetadata_1, updateListMetadata_1, ChangeSource_1, BulletListType_1, NumberingListType_1, TableBorderFormat_1, OrderedListStyleMap_1, UnorderedListStyleMap_1, EmptySegmentFormat_1) {
1
+ define(["require", "exports", "./domToModel/domToContentModel", "./modelToDom/contentModelToDom", "./modelToText/contentModelToText", "./domToModel/processors/childProcessor", "./domToModel/processors/entityProcessor", "./domToModel/processors/tableProcessor", "./domToModel/processors/formatContainerProcessor", "./domToModel/utils/getRegularSelectionOffsets", "./domToModel/utils/parseFormat", "./domToModel/utils/areSameFormats", "./domToModel/utils/isBlockElement", "./domToModel/utils/buildSelectionMarker", "./modelApi/metadata/updateMetadata", "./domUtils/isNodeOfType", "./domUtils/isElementOfType", "./domUtils/getObjectKeys", "./domUtils/getSafeIdSelector", "./domUtils/toArray", "./domUtils/moveChildNodes", "./domUtils/wrap", "./domUtils/unwrap", "./domUtils/entityUtils", "./domUtils/reuseCachedElement", "./domUtils/isWhiteSpacePreserved", "./domUtils/normalizeRect", "./domUtils/scrollRectIntoView", "./domUtils/hiddenProperties/undeletableLink", "./modelApi/creators/createBr", "./modelApi/creators/createListItem", "./modelApi/creators/createFormatContainer", "./modelApi/creators/createParagraph", "./modelApi/creators/createSelectionMarker", "./modelApi/creators/createTable", "./modelApi/creators/createTableCell", "./modelApi/creators/createText", "./modelApi/creators/createImage", "./modelApi/creators/createContentModelDocument", "./modelApi/creators/createParagraphDecorator", "./modelApi/creators/createGeneralSegment", "./modelApi/creators/createGeneralBlock", "./modelApi/creators/createEntity", "./modelApi/creators/createDivider", "./modelApi/creators/createListLevel", "./modelApi/creators/createEmptyModel", "./modelApi/creators/createTableRow", "./modelApi/common/mutate", "./modelApi/common/addBlock", "./modelApi/common/addDecorators", "./modelApi/common/addDecorators", "./modelApi/common/addDecorators", "./modelApi/common/addTextSegment", "./modelApi/common/normalizeParagraph", "./modelApi/common/normalizeContentModel", "./modelApi/typeCheck/isGeneralSegment", "./modelApi/common/unwrapBlock", "./modelApi/common/addSegment", "./modelApi/common/isEmpty", "./modelApi/common/normalizeSegment", "./modelApi/common/mergeTextSegments", "./modelApi/common/normalizeSegmentFormat", "./modelApi/block/setParagraphNotImplicit", "./modelApi/block/copyFormat", "./modelApi/list/getOrderedListNumberStr", "./modelApi/list/getAutoListStyleType", "./formatHandlers/utils/parseValueWithUnit", "./formatHandlers/utils/borderKeys", "./formatHandlers/utils/color", "./domToModel/context/createDomToModelContext", "./modelToDom/context/createModelToDomContext", "./domUtils/style/isBold", "./domUtils/selection/getSelectionRootNode", "./domUtils/selection/getDOMInsertPointRect", "./domUtils/selection/trimModelForSelection", "./domUtils/event/eventUtils", "./domUtils/event/getNodePositionFromEvent", "./domUtils/style/borderValues", "./domUtils/stringUtil", "./domUtils/table/parseTableCells", "./domUtils/readFile", "./domUtils/retrieveDocumentMetadata", "./domUtils/style/transformColor", "./domUtils/style/normalizeFontFamily", "./domUtils/event/extractClipboardItems", "./domUtils/event/createPasteFragment", "./domUtils/event/cacheGetEventData", "./domUtils/hiddenProperties/paragraphMarker", "./domUtils/hiddenProperties/imageState", "./domUtils/getRangesByText", "./modelApi/typeCheck/isBlockGroupOfType", "./modelApi/selection/iterateSelections", "./modelApi/selection/collectSelections", "./modelApi/selection/getSelectedCells", "./modelApi/selection/hasSelectionInBlock", "./modelApi/selection/hasSelectionInSegment", "./modelApi/selection/hasSelectionInBlockGroup", "./modelApi/selection/setSelection", "./modelApi/editing/cloneModel", "./modelApi/editing/canMergeCells", "./modelApi/editing/mergeModel", "./modelApi/editing/deleteSelection", "./modelApi/editing/deleteSegment", "./modelApi/editing/deleteBlock", "./modelApi/editing/applyTableFormat", "./modelApi/editing/normalizeTable", "./modelApi/editing/setTableCellBackgroundColor", "./modelApi/editing/retrieveModelFormatState", "./modelApi/editing/getListStyleTypeFromString", "./modelApi/editing/getSegmentTextFormat", "./modelApi/editing/getClosestAncestorBlockGroupIndex", "./modelApi/editing/runEditSteps", "./modelApi/metadata/updateImageMetadata", "./modelApi/metadata/updateTableCellMetadata", "./modelApi/metadata/updateTableMetadata", "./modelApi/metadata/updateListMetadata", "./constants/ChangeSource", "./constants/BulletListType", "./constants/NumberingListType", "./constants/TableBorderFormat", "./constants/OrderedListStyleMap", "./constants/UnorderedListStyleMap", "./constants/EmptySegmentFormat"], function (require, exports, domToContentModel_1, contentModelToDom_1, contentModelToText_1, childProcessor_1, entityProcessor_1, tableProcessor_1, formatContainerProcessor_1, getRegularSelectionOffsets_1, parseFormat_1, areSameFormats_1, isBlockElement_1, buildSelectionMarker_1, updateMetadata_1, isNodeOfType_1, isElementOfType_1, getObjectKeys_1, getSafeIdSelector_1, toArray_1, moveChildNodes_1, wrap_1, unwrap_1, entityUtils_1, reuseCachedElement_1, isWhiteSpacePreserved_1, normalizeRect_1, scrollRectIntoView_1, undeletableLink_1, createBr_1, createListItem_1, createFormatContainer_1, createParagraph_1, createSelectionMarker_1, createTable_1, createTableCell_1, createText_1, createImage_1, createContentModelDocument_1, createParagraphDecorator_1, createGeneralSegment_1, createGeneralBlock_1, createEntity_1, createDivider_1, createListLevel_1, createEmptyModel_1, createTableRow_1, mutate_1, addBlock_1, addDecorators_1, addDecorators_2, addDecorators_3, addTextSegment_1, normalizeParagraph_1, normalizeContentModel_1, isGeneralSegment_1, unwrapBlock_1, addSegment_1, isEmpty_1, normalizeSegment_1, mergeTextSegments_1, normalizeSegmentFormat_1, setParagraphNotImplicit_1, copyFormat_1, getOrderedListNumberStr_1, getAutoListStyleType_1, parseValueWithUnit_1, borderKeys_1, color_1, createDomToModelContext_1, createModelToDomContext_1, isBold_1, getSelectionRootNode_1, getDOMInsertPointRect_1, trimModelForSelection_1, eventUtils_1, getNodePositionFromEvent_1, borderValues_1, stringUtil_1, parseTableCells_1, readFile_1, retrieveDocumentMetadata_1, transformColor_1, normalizeFontFamily_1, extractClipboardItems_1, createPasteFragment_1, cacheGetEventData_1, paragraphMarker_1, imageState_1, getRangesByText_1, isBlockGroupOfType_1, iterateSelections_1, collectSelections_1, getSelectedCells_1, hasSelectionInBlock_1, hasSelectionInSegment_1, hasSelectionInBlockGroup_1, setSelection_1, cloneModel_1, canMergeCells_1, mergeModel_1, deleteSelection_1, deleteSegment_1, deleteBlock_1, applyTableFormat_1, normalizeTable_1, setTableCellBackgroundColor_1, retrieveModelFormatState_1, getListStyleTypeFromString_1, getSegmentTextFormat_1, getClosestAncestorBlockGroupIndex_1, runEditSteps_1, updateImageMetadata_1, updateTableCellMetadata_1, updateTableMetadata_1, updateListMetadata_1, ChangeSource_1, BulletListType_1, NumberingListType_1, TableBorderFormat_1, OrderedListStyleMap_1, UnorderedListStyleMap_1, EmptySegmentFormat_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.EmptySegmentFormat = exports.UnorderedListStyleMap = exports.OrderedListStyleMap = exports.TableBorderFormat = exports.NumberingListType = exports.BulletListType = exports.ChangeSource = exports.ListMetadataDefinition = exports.getListMetadata = exports.updateListMetadata = exports.getTableMetadata = exports.updateTableMetadata = exports.getTableCellMetadata = exports.updateTableCellMetadata = exports.getImageMetadata = exports.updateImageMetadata = exports.runEditSteps = exports.getClosestAncestorBlockGroupIndex = exports.getSegmentTextFormat = exports.getListStyleTypeFromString = exports.retrieveModelFormatState = exports.setTableCellBackgroundColor = exports.MIN_ALLOWED_TABLE_CELL_HEIGHT = exports.MIN_ALLOWED_TABLE_CELL_WIDTH = exports.normalizeTable = exports.setFirstColumnFormatBorders = exports.applyTableFormat = exports.deleteBlock = exports.deleteSegment = exports.deleteSelection = exports.mergeModel = exports.cloneModelForPaste = exports.cloneModel = exports.setSelection = exports.hasSelectionInBlockGroup = exports.hasSelectionInSegment = exports.hasSelectionInBlock = exports.getSelectedCells = exports.getSelectedSegmentsAndParagraphs = exports.getSelectedSegments = exports.getSelectedParagraphs = exports.getOperationalBlocks = exports.getFirstSelectedTable = exports.getFirstSelectedListItem = exports.iterateSelections = exports.isBlockGroupOfType = exports.getRangesByText = exports.getImageState = exports.setImageState = exports.getParagraphMarker = exports.setParagraphMarker = exports.cacheGetEventData = exports.createPasteFragment = exports.extractClipboardItems = exports.normalizeFontFamily = exports.transformColor = exports.retrieveDocumentMetadata = exports.readFile = exports.parseTableCells = exports.normalizeText = exports.isSpace = exports.isPunctuation = exports.extractBorderValues = exports.combineBorderValue = exports.getNodePositionFromEvent = exports.isCursorMovingKey = exports.isModifierKey = exports.isCharacterValue = exports.trimModelForSelection = exports.getDOMInsertPointRect = exports.getSelectionRootNode = exports.isBold = exports.createModelToDomConfig = exports.createModelToDomContextWithConfig = exports.createModelToDomContext = exports.createDomToModelConfig = exports.createDomToModelContextWithConfig = exports.createDomToModelContext = exports.defaultGenerateColorKey = exports.parseColor = exports.setColor = exports.getColor = exports.DeprecatedColors = exports.BorderKeys = exports.parseValueWithUnit = exports.getAutoListStyleType = exports.getOrderedListNumberStr = exports.ParagraphFormats = exports.ListFormatsToMove = exports.ListFormatsToKeep = exports.ListFormats = exports.copyFormat = exports.setParagraphNotImplicit = exports.normalizeSegmentFormat = exports.mergeTextSegments = exports.normalizeSingleSegment = exports.isEmpty = exports.addSegment = exports.unwrapBlock = exports.isGeneralSegment = exports.normalizeContentModel = exports.normalizeParagraph = exports.addTextSegment = exports.addLink = exports.addData = exports.addCode = exports.addBlock = exports.mutateSegment = exports.mutateSegments = exports.mutateBlock = exports.createTableRow = exports.createEmptyModel = exports.createListLevel = exports.createDivider = exports.createEntity = exports.createGeneralBlock = exports.createGeneralSegment = exports.createParagraphDecorator = exports.createContentModelDocument = exports.createImage = exports.createText = exports.createTableCell = exports.createTable = exports.createSelectionMarker = exports.createParagraph = exports.createFormatContainer = exports.createListItem = exports.createBr = exports.isLinkUndeletable = exports.setLinkUndeletable = exports.scrollRectIntoView = exports.normalizeRect = exports.isWhiteSpacePreserved = exports.reuseCachedElement = exports.findClosestBlockEntityContainer = exports.isBlockEntityContainer = exports.isEntityDelimiter = exports.addDelimiters = exports.generateEntityClassNames = exports.parseEntityFormat = exports.getAllEntityWrappers = exports.findClosestEntityWrapper = exports.isEntityElement = exports.unwrap = exports.wrap = exports.wrapAllChildNodes = exports.moveChildNodes = exports.toArray = exports.getSafeIdSelector = exports.getObjectKeys = exports.isElementOfType = exports.isNodeOfType = exports.hasMetadata = exports.getMetadata = exports.updateMetadata = exports.buildSelectionMarker = exports.isBlockElement = exports.areSameFormats = exports.parseFormat = exports.getRegularSelectionOffsets = exports.formatContainerProcessor = exports.tableProcessor = exports.entityProcessor = exports.processChildNode = exports.handleRegularSelection = exports.childProcessor = exports.contentModelToText = exports.contentModelToDom = exports.domToContentModel = void 0;
4
+ exports.EmptySegmentFormat = exports.UnorderedListStyleMap = exports.OrderedListStyleMap = exports.TableBorderFormat = exports.NumberingListType = exports.BulletListType = exports.ChangeSource = exports.ListMetadataDefinition = exports.getListMetadata = exports.updateListMetadata = exports.getTableMetadata = exports.updateTableMetadata = exports.getTableCellMetadata = exports.updateTableCellMetadata = exports.getImageMetadata = exports.updateImageMetadata = exports.runEditSteps = exports.getClosestAncestorBlockGroupIndex = exports.getSegmentTextFormat = exports.getListStyleTypeFromString = exports.retrieveModelFormatState = exports.setTableCellBackgroundColor = exports.MIN_ALLOWED_TABLE_CELL_HEIGHT = exports.MIN_ALLOWED_TABLE_CELL_WIDTH = exports.normalizeTable = exports.setFirstColumnFormatBorders = exports.applyTableFormat = exports.deleteBlock = exports.deleteSegment = exports.deleteSelection = exports.mergeModel = exports.canMergeCells = exports.cloneModelForPaste = exports.cloneModel = exports.setSelection = exports.hasSelectionInBlockGroup = exports.hasSelectionInSegment = exports.hasSelectionInBlock = exports.getSelectedCells = exports.getSelectedSegmentsAndParagraphs = exports.getSelectedSegments = exports.getSelectedParagraphs = exports.getOperationalBlocks = exports.getFirstSelectedTable = exports.getFirstSelectedListItem = exports.iterateSelections = exports.isBlockGroupOfType = exports.getRangesByText = exports.getImageState = exports.setImageState = exports.getParagraphMarker = exports.setParagraphMarker = exports.cacheGetEventData = exports.createPasteFragment = exports.extractClipboardItems = exports.normalizeFontFamily = exports.transformColor = exports.retrieveDocumentMetadata = exports.readFile = exports.parseTableCells = exports.normalizeText = exports.isSpace = exports.isPunctuation = exports.extractBorderValues = exports.combineBorderValue = exports.getNodePositionFromEvent = exports.isCursorMovingKey = exports.isModifierKey = exports.isCharacterValue = exports.trimModelForSelection = exports.getDOMInsertPointRect = exports.getSelectionRootNode = exports.isBold = exports.createModelToDomConfig = exports.createModelToDomContextWithConfig = exports.createModelToDomContext = exports.createDomToModelConfig = exports.createDomToModelContextWithConfig = exports.createDomToModelContext = exports.defaultGenerateColorKey = exports.parseColor = exports.setColor = exports.getColor = exports.DeprecatedColors = exports.BorderKeys = exports.parseValueWithUnit = exports.getAutoListStyleType = exports.getOrderedListNumberStr = exports.ParagraphFormats = exports.ListFormatsToMove = exports.ListFormatsToKeep = exports.ListFormats = exports.copyFormat = exports.setParagraphNotImplicit = exports.normalizeSegmentFormat = exports.mergeTextSegments = exports.normalizeSingleSegment = exports.isEmpty = exports.addSegment = exports.unwrapBlock = exports.isGeneralSegment = exports.normalizeContentModel = exports.normalizeParagraph = exports.addTextSegment = exports.addLink = exports.addData = exports.addCode = exports.addBlock = exports.mutateSegment = exports.mutateSegments = exports.mutateBlock = exports.createTableRow = exports.createEmptyModel = exports.createListLevel = exports.createDivider = exports.createEntity = exports.createGeneralBlock = exports.createGeneralSegment = exports.createParagraphDecorator = exports.createContentModelDocument = exports.createImage = exports.createText = exports.createTableCell = exports.createTable = exports.createSelectionMarker = exports.createParagraph = exports.createFormatContainer = exports.createListItem = exports.createBr = exports.isLinkUndeletable = exports.setLinkUndeletable = exports.scrollRectIntoView = exports.normalizeRect = exports.isWhiteSpacePreserved = exports.reuseCachedElement = exports.findClosestBlockEntityContainer = exports.isBlockEntityContainer = exports.isEntityDelimiter = exports.addDelimiters = exports.generateEntityClassNames = exports.parseEntityFormat = exports.getAllEntityWrappers = exports.findClosestEntityWrapper = exports.isEntityElement = exports.unwrap = exports.wrap = exports.wrapAllChildNodes = exports.moveChildNodes = exports.toArray = exports.getSafeIdSelector = exports.getObjectKeys = exports.isElementOfType = exports.isNodeOfType = exports.hasMetadata = exports.getMetadata = exports.updateMetadata = exports.buildSelectionMarker = exports.isBlockElement = exports.areSameFormats = exports.parseFormat = exports.getRegularSelectionOffsets = exports.formatContainerProcessor = exports.tableProcessor = exports.entityProcessor = exports.processChildNode = exports.handleRegularSelection = exports.childProcessor = exports.contentModelToText = exports.contentModelToDom = exports.domToContentModel = void 0;
5
5
  Object.defineProperty(exports, "domToContentModel", { enumerable: true, get: function () { return domToContentModel_1.domToContentModel; } });
6
6
  Object.defineProperty(exports, "contentModelToDom", { enumerable: true, get: function () { return contentModelToDom_1.contentModelToDom; } });
7
7
  Object.defineProperty(exports, "contentModelToText", { enumerable: true, get: function () { return contentModelToText_1.contentModelToText; } });
@@ -140,6 +140,7 @@ define(["require", "exports", "./domToModel/domToContentModel", "./modelToDom/co
140
140
  Object.defineProperty(exports, "setSelection", { enumerable: true, get: function () { return setSelection_1.setSelection; } });
141
141
  Object.defineProperty(exports, "cloneModel", { enumerable: true, get: function () { return cloneModel_1.cloneModel; } });
142
142
  Object.defineProperty(exports, "cloneModelForPaste", { enumerable: true, get: function () { return cloneModel_1.cloneModelForPaste; } });
143
+ Object.defineProperty(exports, "canMergeCells", { enumerable: true, get: function () { return canMergeCells_1.canMergeCells; } });
143
144
  Object.defineProperty(exports, "mergeModel", { enumerable: true, get: function () { return mergeModel_1.mergeModel; } });
144
145
  Object.defineProperty(exports, "deleteSelection", { enumerable: true, get: function () { return deleteSelection_1.deleteSelection; } });
145
146
  Object.defineProperty(exports, "deleteSegment", { enumerable: true, get: function () { return deleteSegment_1.deleteSegment; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/roosterjs-content-model-dom/lib/index.ts"],"names":[],"mappings":";;;;IAAS,sHAAA,iBAAiB,OAAA;IACjB,sHAAA,iBAAiB,OAAA;IACjB,wHAAA,kBAAkB,OAAA;IAGvB,gHAAA,cAAc,OAAA;IACd,wHAAA,sBAAsB,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,OAAA;IACd,8HAAA,4BAA4B,OAAA;IAC5B,+HAAA,6BAA6B,OAAA;IAExB,0IAAA,2BAA2B,OAAA;IAC3B,oIAAA,wBAAwB,OAAA;IACxB,wIAAA,0BAA0B,OAAA;IAC1B,4HAAA,oBAAoB,OAAA;IACpB,sJAAA,iCAAiC,OAAA;IACjC,4GAAA,YAAY,OAAA;IAEZ,0HAAA,mBAAmB,OAAA;IAAE,uHAAA,gBAAgB,OAAA;IAE1C,kIAAA,uBAAuB,OAAA;IACvB,+HAAA,oBAAoB,OAAA;IAEf,0HAAA,mBAAmB,OAAA;IAAE,uHAAA,gBAAgB,OAAA;IAE1C,wHAAA,kBAAkB,OAAA;IAClB,qHAAA,eAAe,OAAA;IACf,4HAAA,sBAAsB,OAAA;IAGjB,4GAAA,YAAY,OAAA;IACZ,gHAAA,cAAc,OAAA;IACd,sHAAA,iBAAiB,OAAA;IACjB,sHAAA,iBAAiB,OAAA;IACjB,0HAAA,mBAAmB,OAAA;IACnB,8HAAA,qBAAqB,OAAA;IACrB,wHAAA,kBAAkB,OAAA","sourcesContent":["export { domToContentModel } from './domToModel/domToContentModel';\nexport { contentModelToDom } from './modelToDom/contentModelToDom';\nexport { contentModelToText } from './modelToText/contentModelToText';\n\nexport {\n childProcessor,\n handleRegularSelection,\n processChildNode,\n} from './domToModel/processors/childProcessor';\nexport { entityProcessor } from './domToModel/processors/entityProcessor';\nexport { tableProcessor } from './domToModel/processors/tableProcessor';\nexport { formatContainerProcessor } from './domToModel/processors/formatContainerProcessor';\nexport { getRegularSelectionOffsets } from './domToModel/utils/getRegularSelectionOffsets';\nexport { parseFormat } from './domToModel/utils/parseFormat';\nexport { areSameFormats } from './domToModel/utils/areSameFormats';\nexport { isBlockElement } from './domToModel/utils/isBlockElement';\nexport { buildSelectionMarker } from './domToModel/utils/buildSelectionMarker';\n\nexport { updateMetadata, getMetadata, hasMetadata } from './modelApi/metadata/updateMetadata';\nexport { isNodeOfType } from './domUtils/isNodeOfType';\nexport { isElementOfType } from './domUtils/isElementOfType';\nexport { getObjectKeys } from './domUtils/getObjectKeys';\nexport { getSafeIdSelector } from './domUtils/getSafeIdSelector';\nexport { toArray } from './domUtils/toArray';\nexport { moveChildNodes, wrapAllChildNodes } from './domUtils/moveChildNodes';\nexport { wrap } from './domUtils/wrap';\nexport { unwrap } from './domUtils/unwrap';\nexport {\n isEntityElement,\n findClosestEntityWrapper,\n getAllEntityWrappers,\n parseEntityFormat,\n generateEntityClassNames,\n addDelimiters,\n isEntityDelimiter,\n isBlockEntityContainer,\n findClosestBlockEntityContainer,\n} from './domUtils/entityUtils';\nexport { reuseCachedElement } from './domUtils/reuseCachedElement';\nexport { isWhiteSpacePreserved } from './domUtils/isWhiteSpacePreserved';\nexport { normalizeRect } from './domUtils/normalizeRect';\nexport { scrollRectIntoView } from './domUtils/scrollRectIntoView';\n\nexport { setLinkUndeletable, isLinkUndeletable } from './domUtils/hiddenProperties/undeletableLink';\n\nexport { createBr } from './modelApi/creators/createBr';\nexport { createListItem } from './modelApi/creators/createListItem';\nexport { createFormatContainer } from './modelApi/creators/createFormatContainer';\nexport { createParagraph } from './modelApi/creators/createParagraph';\nexport { createSelectionMarker } from './modelApi/creators/createSelectionMarker';\nexport { createTable } from './modelApi/creators/createTable';\nexport { createTableCell } from './modelApi/creators/createTableCell';\nexport { createText } from './modelApi/creators/createText';\nexport { createImage } from './modelApi/creators/createImage';\nexport { createContentModelDocument } from './modelApi/creators/createContentModelDocument';\nexport { createParagraphDecorator } from './modelApi/creators/createParagraphDecorator';\nexport { createGeneralSegment } from './modelApi/creators/createGeneralSegment';\nexport { createGeneralBlock } from './modelApi/creators/createGeneralBlock';\nexport { createEntity } from './modelApi/creators/createEntity';\nexport { createDivider } from './modelApi/creators/createDivider';\nexport { createListLevel } from './modelApi/creators/createListLevel';\nexport { createEmptyModel } from './modelApi/creators/createEmptyModel';\nexport { createTableRow } from './modelApi/creators/createTableRow';\n\nexport { mutateBlock, mutateSegments, mutateSegment } from './modelApi/common/mutate';\nexport { addBlock } from './modelApi/common/addBlock';\nexport { addCode } from './modelApi/common/addDecorators';\nexport { addData } from './modelApi/common/addDecorators';\nexport { addLink } from './modelApi/common/addDecorators';\nexport { addTextSegment } from './modelApi/common/addTextSegment';\nexport { normalizeParagraph } from './modelApi/common/normalizeParagraph';\n\nexport { normalizeContentModel } from './modelApi/common/normalizeContentModel';\nexport { isGeneralSegment } from './modelApi/typeCheck/isGeneralSegment';\nexport { unwrapBlock } from './modelApi/common/unwrapBlock';\nexport { addSegment } from './modelApi/common/addSegment';\nexport { isEmpty } from './modelApi/common/isEmpty';\nexport { normalizeSingleSegment } from './modelApi/common/normalizeSegment';\nexport { mergeTextSegments } from './modelApi/common/mergeTextSegments';\nexport { normalizeSegmentFormat } from './modelApi/common/normalizeSegmentFormat';\n\nexport { setParagraphNotImplicit } from './modelApi/block/setParagraphNotImplicit';\nexport {\n copyFormat,\n ListFormats,\n ListFormatsToKeep,\n ListFormatsToMove,\n ParagraphFormats,\n} from './modelApi/block/copyFormat';\nexport { getOrderedListNumberStr } from './modelApi/list/getOrderedListNumberStr';\nexport { getAutoListStyleType } from './modelApi/list/getAutoListStyleType';\n\nexport { parseValueWithUnit } from './formatHandlers/utils/parseValueWithUnit';\nexport { BorderKeys } from './formatHandlers/utils/borderKeys';\nexport {\n DeprecatedColors,\n getColor,\n setColor,\n parseColor,\n defaultGenerateColorKey,\n} from './formatHandlers/utils/color';\n\nexport {\n createDomToModelContext,\n createDomToModelContextWithConfig,\n createDomToModelConfig,\n} from './domToModel/context/createDomToModelContext';\nexport {\n createModelToDomContext,\n createModelToDomContextWithConfig,\n createModelToDomConfig,\n} from './modelToDom/context/createModelToDomContext';\n\nexport { isBold } from './domUtils/style/isBold';\nexport { getSelectionRootNode } from './domUtils/selection/getSelectionRootNode';\nexport { getDOMInsertPointRect } from './domUtils/selection/getDOMInsertPointRect';\nexport { trimModelForSelection } from './domUtils/selection/trimModelForSelection';\nexport { isCharacterValue, isModifierKey, isCursorMovingKey } from './domUtils/event/eventUtils';\nexport { getNodePositionFromEvent } from './domUtils/event/getNodePositionFromEvent';\nexport { combineBorderValue, extractBorderValues } from './domUtils/style/borderValues';\nexport { isPunctuation, isSpace, normalizeText } from './domUtils/stringUtil';\nexport { parseTableCells } from './domUtils/table/parseTableCells';\nexport { readFile } from './domUtils/readFile';\nexport { retrieveDocumentMetadata } from './domUtils/retrieveDocumentMetadata';\nexport { transformColor, TransformColorOptions } from './domUtils/style/transformColor';\nexport { normalizeFontFamily } from './domUtils/style/normalizeFontFamily';\nexport { extractClipboardItems } from './domUtils/event/extractClipboardItems';\nexport { createPasteFragment } from './domUtils/event/createPasteFragment';\nexport { cacheGetEventData } from './domUtils/event/cacheGetEventData';\nexport {\n setParagraphMarker,\n getParagraphMarker,\n} from './domUtils/hiddenProperties/paragraphMarker';\nexport { setImageState, getImageState } from './domUtils/hiddenProperties/imageState';\nexport { getRangesByText } from './domUtils/getRangesByText';\n\nexport { isBlockGroupOfType } from './modelApi/typeCheck/isBlockGroupOfType';\n\nexport { iterateSelections } from './modelApi/selection/iterateSelections';\nexport {\n getFirstSelectedListItem,\n getFirstSelectedTable,\n getOperationalBlocks,\n getSelectedParagraphs,\n getSelectedSegments,\n getSelectedSegmentsAndParagraphs,\n} from './modelApi/selection/collectSelections';\nexport { getSelectedCells } from './modelApi/selection/getSelectedCells';\nexport { hasSelectionInBlock } from './modelApi/selection/hasSelectionInBlock';\nexport { hasSelectionInSegment } from './modelApi/selection/hasSelectionInSegment';\nexport { hasSelectionInBlockGroup } from './modelApi/selection/hasSelectionInBlockGroup';\nexport { setSelection } from './modelApi/selection/setSelection';\n\nexport { cloneModel, cloneModelForPaste } from './modelApi/editing/cloneModel';\nexport { mergeModel } from './modelApi/editing/mergeModel';\nexport { deleteSelection } from './modelApi/editing/deleteSelection';\nexport { deleteSegment } from './modelApi/editing/deleteSegment';\nexport { deleteBlock } from './modelApi/editing/deleteBlock';\nexport { applyTableFormat, setFirstColumnFormatBorders } from './modelApi/editing/applyTableFormat';\nexport {\n normalizeTable,\n MIN_ALLOWED_TABLE_CELL_WIDTH,\n MIN_ALLOWED_TABLE_CELL_HEIGHT,\n} from './modelApi/editing/normalizeTable';\nexport { setTableCellBackgroundColor } from './modelApi/editing/setTableCellBackgroundColor';\nexport { retrieveModelFormatState } from './modelApi/editing/retrieveModelFormatState';\nexport { getListStyleTypeFromString } from './modelApi/editing/getListStyleTypeFromString';\nexport { getSegmentTextFormat } from './modelApi/editing/getSegmentTextFormat';\nexport { getClosestAncestorBlockGroupIndex } from './modelApi/editing/getClosestAncestorBlockGroupIndex';\nexport { runEditSteps } from './modelApi/editing/runEditSteps';\n\nexport { updateImageMetadata, getImageMetadata } from './modelApi/metadata/updateImageMetadata';\nexport {\n updateTableCellMetadata,\n getTableCellMetadata,\n} from './modelApi/metadata/updateTableCellMetadata';\nexport { updateTableMetadata, getTableMetadata } from './modelApi/metadata/updateTableMetadata';\nexport {\n updateListMetadata,\n getListMetadata,\n ListMetadataDefinition,\n} from './modelApi/metadata/updateListMetadata';\n\nexport { ChangeSource } from './constants/ChangeSource';\nexport { BulletListType } from './constants/BulletListType';\nexport { NumberingListType } from './constants/NumberingListType';\nexport { TableBorderFormat } from './constants/TableBorderFormat';\nexport { OrderedListStyleMap } from './constants/OrderedListStyleMap';\nexport { UnorderedListStyleMap } from './constants/UnorderedListStyleMap';\nexport { EmptySegmentFormat } from './constants/EmptySegmentFormat';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/roosterjs-content-model-dom/lib/index.ts"],"names":[],"mappings":";;;;IAAS,sHAAA,iBAAiB,OAAA;IACjB,sHAAA,iBAAiB,OAAA;IACjB,wHAAA,kBAAkB,OAAA;IAGvB,gHAAA,cAAc,OAAA;IACd,wHAAA,sBAAsB,OAAA;IACtB,kHAAA,gBAAgB,OAAA;IAEX,kHAAA,eAAe,OAAA;IACf,gHAAA,cAAc,OAAA;IACd,oIAAA,wBAAwB,OAAA;IACx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;IAC3B,oIAAA,wBAAwB,OAAA;IACxB,wIAAA,0BAA0B,OAAA;IAC1B,4HAAA,oBAAoB,OAAA;IACpB,sJAAA,iCAAiC,OAAA;IACjC,4GAAA,YAAY,OAAA;IAEZ,0HAAA,mBAAmB,OAAA;IAAE,uHAAA,gBAAgB,OAAA;IAE1C,kIAAA,uBAAuB,OAAA;IACvB,+HAAA,oBAAoB,OAAA;IAEf,0HAAA,mBAAmB,OAAA;IAAE,uHAAA,gBAAgB,OAAA;IAE1C,wHAAA,kBAAkB,OAAA;IAClB,qHAAA,eAAe,OAAA;IACf,4HAAA,sBAAsB,OAAA;IAGjB,4GAAA,YAAY,OAAA;IACZ,gHAAA,cAAc,OAAA;IACd,sHAAA,iBAAiB,OAAA;IACjB,sHAAA,iBAAiB,OAAA;IACjB,0HAAA,mBAAmB,OAAA;IACnB,8HAAA,qBAAqB,OAAA;IACrB,wHAAA,kBAAkB,OAAA","sourcesContent":["export { domToContentModel } from './domToModel/domToContentModel';\nexport { contentModelToDom } from './modelToDom/contentModelToDom';\nexport { contentModelToText } from './modelToText/contentModelToText';\n\nexport {\n childProcessor,\n handleRegularSelection,\n processChildNode,\n} from './domToModel/processors/childProcessor';\nexport { entityProcessor } from './domToModel/processors/entityProcessor';\nexport { tableProcessor } from './domToModel/processors/tableProcessor';\nexport { formatContainerProcessor } from './domToModel/processors/formatContainerProcessor';\nexport { getRegularSelectionOffsets } from './domToModel/utils/getRegularSelectionOffsets';\nexport { parseFormat } from './domToModel/utils/parseFormat';\nexport { areSameFormats } from './domToModel/utils/areSameFormats';\nexport { isBlockElement } from './domToModel/utils/isBlockElement';\nexport { buildSelectionMarker } from './domToModel/utils/buildSelectionMarker';\n\nexport { updateMetadata, getMetadata, hasMetadata } from './modelApi/metadata/updateMetadata';\nexport { isNodeOfType } from './domUtils/isNodeOfType';\nexport { isElementOfType } from './domUtils/isElementOfType';\nexport { getObjectKeys } from './domUtils/getObjectKeys';\nexport { getSafeIdSelector } from './domUtils/getSafeIdSelector';\nexport { toArray } from './domUtils/toArray';\nexport { moveChildNodes, wrapAllChildNodes } from './domUtils/moveChildNodes';\nexport { wrap } from './domUtils/wrap';\nexport { unwrap } from './domUtils/unwrap';\nexport {\n isEntityElement,\n findClosestEntityWrapper,\n getAllEntityWrappers,\n parseEntityFormat,\n generateEntityClassNames,\n addDelimiters,\n isEntityDelimiter,\n isBlockEntityContainer,\n findClosestBlockEntityContainer,\n} from './domUtils/entityUtils';\nexport { reuseCachedElement } from './domUtils/reuseCachedElement';\nexport { isWhiteSpacePreserved } from './domUtils/isWhiteSpacePreserved';\nexport { normalizeRect } from './domUtils/normalizeRect';\nexport { scrollRectIntoView } from './domUtils/scrollRectIntoView';\n\nexport { setLinkUndeletable, isLinkUndeletable } from './domUtils/hiddenProperties/undeletableLink';\n\nexport { createBr } from './modelApi/creators/createBr';\nexport { createListItem } from './modelApi/creators/createListItem';\nexport { createFormatContainer } from './modelApi/creators/createFormatContainer';\nexport { createParagraph } from './modelApi/creators/createParagraph';\nexport { createSelectionMarker } from './modelApi/creators/createSelectionMarker';\nexport { createTable } from './modelApi/creators/createTable';\nexport { createTableCell } from './modelApi/creators/createTableCell';\nexport { createText } from './modelApi/creators/createText';\nexport { createImage } from './modelApi/creators/createImage';\nexport { createContentModelDocument } from './modelApi/creators/createContentModelDocument';\nexport { createParagraphDecorator } from './modelApi/creators/createParagraphDecorator';\nexport { createGeneralSegment } from './modelApi/creators/createGeneralSegment';\nexport { createGeneralBlock } from './modelApi/creators/createGeneralBlock';\nexport { createEntity } from './modelApi/creators/createEntity';\nexport { createDivider } from './modelApi/creators/createDivider';\nexport { createListLevel } from './modelApi/creators/createListLevel';\nexport { createEmptyModel } from './modelApi/creators/createEmptyModel';\nexport { createTableRow } from './modelApi/creators/createTableRow';\n\nexport { mutateBlock, mutateSegments, mutateSegment } from './modelApi/common/mutate';\nexport { addBlock } from './modelApi/common/addBlock';\nexport { addCode } from './modelApi/common/addDecorators';\nexport { addData } from './modelApi/common/addDecorators';\nexport { addLink } from './modelApi/common/addDecorators';\nexport { addTextSegment } from './modelApi/common/addTextSegment';\nexport { normalizeParagraph } from './modelApi/common/normalizeParagraph';\n\nexport { normalizeContentModel } from './modelApi/common/normalizeContentModel';\nexport { isGeneralSegment } from './modelApi/typeCheck/isGeneralSegment';\nexport { unwrapBlock } from './modelApi/common/unwrapBlock';\nexport { addSegment } from './modelApi/common/addSegment';\nexport { isEmpty } from './modelApi/common/isEmpty';\nexport { normalizeSingleSegment } from './modelApi/common/normalizeSegment';\nexport { mergeTextSegments } from './modelApi/common/mergeTextSegments';\nexport { normalizeSegmentFormat } from './modelApi/common/normalizeSegmentFormat';\n\nexport { setParagraphNotImplicit } from './modelApi/block/setParagraphNotImplicit';\nexport {\n copyFormat,\n ListFormats,\n ListFormatsToKeep,\n ListFormatsToMove,\n ParagraphFormats,\n} from './modelApi/block/copyFormat';\nexport { getOrderedListNumberStr } from './modelApi/list/getOrderedListNumberStr';\nexport { getAutoListStyleType } from './modelApi/list/getAutoListStyleType';\n\nexport { parseValueWithUnit } from './formatHandlers/utils/parseValueWithUnit';\nexport { BorderKeys } from './formatHandlers/utils/borderKeys';\nexport {\n DeprecatedColors,\n getColor,\n setColor,\n parseColor,\n defaultGenerateColorKey,\n} from './formatHandlers/utils/color';\n\nexport {\n createDomToModelContext,\n createDomToModelContextWithConfig,\n createDomToModelConfig,\n} from './domToModel/context/createDomToModelContext';\nexport {\n createModelToDomContext,\n createModelToDomContextWithConfig,\n createModelToDomConfig,\n} from './modelToDom/context/createModelToDomContext';\n\nexport { isBold } from './domUtils/style/isBold';\nexport { getSelectionRootNode } from './domUtils/selection/getSelectionRootNode';\nexport { getDOMInsertPointRect } from './domUtils/selection/getDOMInsertPointRect';\nexport { trimModelForSelection } from './domUtils/selection/trimModelForSelection';\nexport { isCharacterValue, isModifierKey, isCursorMovingKey } from './domUtils/event/eventUtils';\nexport { getNodePositionFromEvent } from './domUtils/event/getNodePositionFromEvent';\nexport { combineBorderValue, extractBorderValues } from './domUtils/style/borderValues';\nexport { isPunctuation, isSpace, normalizeText } from './domUtils/stringUtil';\nexport { parseTableCells } from './domUtils/table/parseTableCells';\nexport { readFile } from './domUtils/readFile';\nexport { retrieveDocumentMetadata } from './domUtils/retrieveDocumentMetadata';\nexport { transformColor, TransformColorOptions } from './domUtils/style/transformColor';\nexport { normalizeFontFamily } from './domUtils/style/normalizeFontFamily';\nexport { extractClipboardItems } from './domUtils/event/extractClipboardItems';\nexport { createPasteFragment } from './domUtils/event/createPasteFragment';\nexport { cacheGetEventData } from './domUtils/event/cacheGetEventData';\nexport {\n setParagraphMarker,\n getParagraphMarker,\n} from './domUtils/hiddenProperties/paragraphMarker';\nexport { setImageState, getImageState } from './domUtils/hiddenProperties/imageState';\nexport { getRangesByText } from './domUtils/getRangesByText';\n\nexport { isBlockGroupOfType } from './modelApi/typeCheck/isBlockGroupOfType';\n\nexport { iterateSelections } from './modelApi/selection/iterateSelections';\nexport {\n getFirstSelectedListItem,\n getFirstSelectedTable,\n getOperationalBlocks,\n getSelectedParagraphs,\n getSelectedSegments,\n getSelectedSegmentsAndParagraphs,\n} from './modelApi/selection/collectSelections';\nexport { getSelectedCells } from './modelApi/selection/getSelectedCells';\nexport { hasSelectionInBlock } from './modelApi/selection/hasSelectionInBlock';\nexport { hasSelectionInSegment } from './modelApi/selection/hasSelectionInSegment';\nexport { hasSelectionInBlockGroup } from './modelApi/selection/hasSelectionInBlockGroup';\nexport { setSelection } from './modelApi/selection/setSelection';\n\nexport { cloneModel, cloneModelForPaste } from './modelApi/editing/cloneModel';\nexport { canMergeCells } from './modelApi/editing/canMergeCells';\nexport { mergeModel } from './modelApi/editing/mergeModel';\nexport { deleteSelection } from './modelApi/editing/deleteSelection';\nexport { deleteSegment } from './modelApi/editing/deleteSegment';\nexport { deleteBlock } from './modelApi/editing/deleteBlock';\nexport { applyTableFormat, setFirstColumnFormatBorders } from './modelApi/editing/applyTableFormat';\nexport {\n normalizeTable,\n MIN_ALLOWED_TABLE_CELL_WIDTH,\n MIN_ALLOWED_TABLE_CELL_HEIGHT,\n} from './modelApi/editing/normalizeTable';\nexport { setTableCellBackgroundColor } from './modelApi/editing/setTableCellBackgroundColor';\nexport { retrieveModelFormatState } from './modelApi/editing/retrieveModelFormatState';\nexport { getListStyleTypeFromString } from './modelApi/editing/getListStyleTypeFromString';\nexport { getSegmentTextFormat } from './modelApi/editing/getSegmentTextFormat';\nexport { getClosestAncestorBlockGroupIndex } from './modelApi/editing/getClosestAncestorBlockGroupIndex';\nexport { runEditSteps } from './modelApi/editing/runEditSteps';\n\nexport { updateImageMetadata, getImageMetadata } from './modelApi/metadata/updateImageMetadata';\nexport {\n updateTableCellMetadata,\n getTableCellMetadata,\n} from './modelApi/metadata/updateTableCellMetadata';\nexport { updateTableMetadata, getTableMetadata } from './modelApi/metadata/updateTableMetadata';\nexport {\n updateListMetadata,\n getListMetadata,\n ListMetadataDefinition,\n} from './modelApi/metadata/updateListMetadata';\n\nexport { ChangeSource } from './constants/ChangeSource';\nexport { BulletListType } from './constants/BulletListType';\nexport { NumberingListType } from './constants/NumberingListType';\nexport { TableBorderFormat } from './constants/TableBorderFormat';\nexport { OrderedListStyleMap } from './constants/OrderedListStyleMap';\nexport { UnorderedListStyleMap } from './constants/UnorderedListStyleMap';\nexport { EmptySegmentFormat } from './constants/EmptySegmentFormat';\n"]}