Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
feat: doc support horizontal line (#4813)
Ran Luocde1824026f5
diff --git a/e2e/visual-comparison/docs/docs-visual-comparison.spec.ts-snapshots/default-doc-ci-chromium-linux.png b/e2e/visual-comparison/docs/docs-visual-comparison.spec.ts-snapshots/default-doc-ci-chromium-linux.pngindex d3e945f768..d2302d5790 100644Binary files a/e2e/visual-comparison/docs/docs-visual-comparison.spec.ts-snapshots/default-doc-ci-chromium-linux.png and b/e2e/visual-comparison/docs/docs-visual-comparison.spec.ts-snapshots/default-doc-ci-chromium-linux.png differdiff --git a/mockdata/src/docs/default-document-data-cn.ts b/mockdata/src/docs/default-document-data-cn.tsindex 098dc35c8d..3780368cf8 100644--- a/mockdata/src/docs/default-document-data-cn.ts+++ b/mockdata/src/docs/default-document-data-cn.ts@@ -15,7 +15,7 @@*/import type { IDocumentData } from '@univerjs/core';-import { BlockType, BooleanNumber, DocumentFlavor, DrawingTypeEnum, ObjectRelativeFromH, ObjectRelativeFromV, PositionedObjectLayoutType, WrapTextType } from '@univerjs/core';+import { BooleanNumber, DashStyleType, DocumentFlavor, DrawingTypeEnum, ObjectRelativeFromH, ObjectRelativeFromV, PositionedObjectLayoutType, WrapTextType } from '@univerjs/core';import { ptToPixel } from '@univerjs/engine-render';export const DEFAULT_DOCUMENT_DATA_CN: IDocumentData = {@@ -57,7 +57,7 @@ export const DEFAULT_DOCUMENT_DATA_CN: IDocumentData = {footers: {},body: {dataStream:- '荷塘月色\r\r作者:朱自清\r\r\b几天心里颇不宁静。今晚在院子里坐着乘凉,忽然想起日日走过的荷塘,在这满月的光里,总该另有一番样子吧。月亮渐渐地升高了,墙外马路上孩子们的欢笑,已经听不见了;妻在屋里拍着闰儿,迷迷糊糊地哼着眠歌。我悄悄地披了大衫,带上门出去。\r\r沿着荷塘,是一条曲折的小煤屑路。这是一条幽僻的路;白天也少人走,夜晚更加寂寞。荷塘四面,长着许多树,蓊蓊郁郁的。路图片一片是些杨柳,和一些不知道名字的树。没有月光的晚上,这路上阴森森的,有些怕人。今晚却很好,虽然月光也还是淡淡的。\r\r路上只我一个人,背着手踱着。这一片天地好像是我的;我也像超出了平常的自己,到了另一个世界里。我爱热闹,也爱冷静;爱群居,也爱独处。像今晚上,一个人在这苍茫的月下,什么都可以想,什么都可以不想,便觉是个自由的人。白天里一定要做的事,一定要说的话是现在都可不理。这是独处的妙处,我且受用这无边的荷香月色好了。\r\r曲曲折折的荷塘上面,弥望的是田田的叶子。叶子出水很高,像亭亭的舞女的裙。层层的叶子中间,零星地点缀着些白花,有袅娜地开着的,有羞涩地打着朵儿的;正如一粒粒的明珠,又如碧天里的星星,又如刚出浴的美人。微风过处,送来缕缕清香,仿佛远处高楼上渺茫的歌声似的。这时候叶子与花也有一丝的颤动,像闪电般,霎时传过荷塘的那边去了。叶子本是肩并肩密密地挨着,这便宛然有了一道凝碧的波痕。叶子底下是脉脉的流水,遮住了,不能见一些颜色;而叶子却更见风致了。\r\r月光如流水一般,静静地泻在这一片叶子和花上。薄薄的青雾浮起在荷塘里。叶子和花仿佛在牛乳中洗过一样,又像笼着轻纱的梦。虽然是满月,天上却有一层淡淡的云,所以不能朗照;但我以为这恰是到了好处——酣眠固不可少,小睡也别有风味的。月光是隔了树照过来的,高处丛生的灌木,落下参差的斑驳的黑影,峭楞楞如鬼一般;弯弯的杨柳的稀疏的倩影,却又像是画在荷叶上。塘中的月色并不均匀;但光与影有着和谐的旋律,如梵婀玲上奏着的名曲。\r\r荷塘的四面,远远近近,高高低低都是树,而杨柳最多。这些树将一片荷塘重重围住;只在小路一旁,漏着几段空隙,像是特为月光留下的。树色一例是阴阴的,乍看像一团烟雾;但杨柳的丰姿,便在烟雾里也辨得出。树梢上隐隐约约的是一带远山,只有些大意罢了。树缝里也漏着一两点路灯光,没精打采的,是渴睡人的眼。这时候最热闹的,要数树上的蝉声与水里的蛙声;但热闹是它们的,我什么也没有。\r\r忽然想起采莲的事情来了。采莲是江南的旧俗,似乎很早就有,而六朝时为盛;从诗歌里可以约略知道。采莲的是少年的女子,她们是荡着小船,唱着艳歌去的。采莲人不用说很多,还有看采莲的人。那是一个热闹的季节,也是一个风流的季节。梁元帝《采莲赋》里说得好:\r\r于是妖童女,荡舟心许;鷁首徐回,兼传羽杯;櫂将移而藻挂,船欲动而萍开。尔其纤腰束素,迁延顾步;夏始春余,叶嫩花初,恐沾裳而浅笑,畏倾船而敛裾。\r\r可见当时嬉游的光景了。这真是有趣的事,可惜我们现在早已无福消受了。\r\r于是又记起,《西洲曲》里的句子:\r\r采莲南塘秋,莲花过人头;低头弄莲子,莲子清如水。\r\r今晚若有采莲人,这儿的莲花也算得“过人头”了;只不见一些流水的影子,是不行的。这令我到底惦着江南了。——这样想着,猛一抬头,不觉已是自己的门前;轻轻地推门进去,什么声息也没有,妻已睡熟好久了。\r\r一九二七年七月,北京清华园。\r\r\r\r《荷塘月色》语言朴素典雅,准确生动,贮满诗意,满溢着朱自清的散文语言一贯有朴素的美,不用浓墨重彩,画的是淡墨水彩。\r\r朱自清先生一笔写景一笔说情,看起来松散不知所云,可仔细体会下,就能感受到先生在字里行间表述出的苦闷,而随之读者也被先生的文字所感染,被带进了他当时那苦闷而无法明喻的心情。这就是优异散文的必须品质之一。\r\r扩展资料:\r一首长诗《毁灭》奠定了朱自清在文坛新诗人的地位,而《桨声灯影里的秦淮河》则被公认为白话美文的典范。朱自清用白话美文向复古派宣战,有力地回击了复古派“白话不能作美文”之说,他是“五四”新文学运动的开拓者之一。\r\r朱自清的美文影响了一代又一代人。作家贾平凹说:来到扬州,第一个想到的人是朱自清,他是知识分子中最最了不起的人物。\r\r实际上,朱自清的写作路程是非常曲折的,他早期的时候大多数作品都是诗歌,但是他的诗歌和我国古代诗人的诗有很大区别,他的诗是用白话文写的,这其实也是他写作的惯用风格。\r\r后来,朱自清开始写一些关于社会的文章,因为那个时候社会比较混乱,这时候的作品大多抨击社会的黑暗面,文体风格大多硬朗,基调伉俪。到了后期,大多是写关于山水的文章,这类文章的写作格调大多以清丽雅致为主。\r\r朱自清的写作风格虽然在不同的时期随着他的人生阅历和社会形态的不同而发生着变化,但是他文章的主基调是没有变的,他这一生,所写的所有文章风格上都有一个非常显著的特点,那就是简约平淡,他不是类似古代花间词派的诗人们,不管是他的诗词还是他的文章从来都不用过于华丽的辞藻,他崇尚的是平淡。\r\r英国友人戴立克试过英译朱自清几篇散文,译完一读显得单薄,远远不如原文流利。他不服气,改用稍微古奥的英文重译,好多了:“那是说,朱先生外圆内方,文字尽管浅白,心思却很深沉,译笔只好朝深处经营。”朱自清的很多文章,譬如《背影》《祭亡妇》,读来自有一番只可意会不可言传的东西。\r\r平淡就是朱自清的写作风格。他不是豪放派的作家,他在创作的时候钟情于清新的风格,给人耳目一新的感觉。在他的文章中包含了他对生活的向往,由此可见他的写作风格和他待人处事的态度也是有几分相似的。他的文章非常优美,但又不会让人觉得狭隘,给人一种豁达渊博的感觉,这就是朱自清的写作风格,更是朱自清的为人品质。\r\r写有《荷塘月色》《背影》等名篇的著名散文家朱自清先生,不仅自己一生风骨正气,还用无形的家风涵养子孙。良好的家风家规意蕴深远,催人向善,是凝聚情感、涵养德行、砥砺成才的人生信条。“北有朱自清,南有朱物华,一文一武,一南一北,双星闪耀”,这是中国知识界、教育界对朱家两兄弟的赞誉。\r\r朱自清性格温和,为人和善,对待年轻人平易近人,是个平和的人。他取字“佩弦”,意思要像弓弦那样将自己绷紧,给人的感觉是自我要求高,偶尔有呆气。朱自清教学负责,对学生要求严格,修他的课的学生都受益不少。\r\r1948 年 6 月,患胃病多年的朱自清,在《抗议美国扶日政策并拒绝领取美援面粉宣言》上,一丝不苟地签下了自己的名字。随后,朱自清还将面粉配购证以及面粉票退了回去。1948 年 8 月 12 日,朱自清因不堪胃病折磨,离开人世。在新的时代即将到来时,朱自清却匆匆地离人们远去。他为人们留下了无数经典的诗歌和文字,还有永不屈服的精神。\r\r朱自清没有豪言壮语,他只是用坚定的行动、朴实的语言,向世人展示了中国知识分子在祖国危难之际坚定的革命性,体现了中国人的骨气,表现了无比高贵的民族气节,呈现了人生最有价值的一面,谱就了生命中最华丽的乐章。\r\r他以“自清”为名,自勉在困境中不丧志;他身患重病,至死拒领美援面粉,其气节令世人感佩;他的《背影》《荷塘月色》《匆匆》脍炙人口;他的文字追求“真”,没有半点矫饰,却蕴藏着动人心弦的力量。\r\r朱自清不但在文学创作方面有很高的造诣,也是一名革命民主主义战士,在反饥饿、反内战的斗争中,他始终保持着一个正直的爱国知识分子的气节和情操。毛泽东对朱自清宁肯饿死不领美国“救济粉”的精神给予称赞,赞扬他“表现了我们民族的英雄气概”。\r\n',+ '荷塘月色\r\r作者:朱自清\r\r这几天心里颇不宁静。今晚在院子里坐着乘凉,忽然想起日日走过的荷塘,在这满月的光里,总该另有一番样子吧。月亮渐渐地升高了,墙外马路上孩子们的欢笑,已经听不见了;妻在屋里拍着闰儿,迷迷糊糊地哼着眠歌。我悄悄地披了大衫,带上门出去。\r\r沿着荷塘,是一条曲折的小煤屑路。这是一条幽僻的路;白天也少人走,夜晚更加寂寞。荷塘四面,长着许多树,蓊蓊郁郁的。路图片一片是些杨柳,和一些不知道名字的树。没有月光的晚上,这路上阴森森的,有些怕人。今晚却很好,虽然月光也还是淡淡的。\r\r路上只我一个人,背着手踱着。这一片天地好像是我的;我也像超出了平常的自己,到了另一个世界里。我爱热闹,也爱冷静;爱群居,也爱独处。像今晚上,一个人在这苍茫的月下,什么都可以想,什么都可以不想,便觉是个自由的人。白天里一定要做的事,一定要说的话是现在都可不理。这是独处的妙处,我且受用这无边的荷香月色好了。\r\r曲曲折折的荷塘上面,弥望的是田田的叶子。叶子出水很高,像亭亭的舞女的裙。层层的叶子中间,零星地点缀着些白花,有袅娜地开着的,有羞涩地打着朵儿的;正如一粒粒的明珠,又如碧天里的星星,又如刚出浴的美人。微风过处,送来缕缕清香,仿佛远处高楼上渺茫的歌声似的。这时候叶子与花也有一丝的颤动,像闪电般,霎时传过荷塘的那边去了。叶子本是肩并肩密密地挨着,这便宛然有了一道凝碧的波痕。叶子底下是脉脉的流水,遮住了,不能见一些颜色;而叶子却更见风致了。\r\r月光如流水一般,静静地泻在这一片叶子和花上。薄薄的青雾浮起在荷塘里。叶子和花仿佛在牛乳中洗过一样,又像笼着轻纱的梦。虽然是满月,天上却有一层淡淡的云,所以不能朗照;但我以为这恰是到了好处——酣眠固不可少,小睡也别有风味的。月光是隔了树照过来的,高处丛生的灌木,落下参差的斑驳的黑影,峭楞楞如鬼一般;弯弯的杨柳的稀疏的倩影,却又像是画在荷叶上。塘中的月色并不均匀;但光与影有着和谐的旋律,如梵婀玲上奏着的名曲。\r\r荷塘的四面,远远近近,高高低低都是树,而杨柳最多。这些树将一片荷塘重重围住;只在小路一旁,漏着几段空隙,像是特为月光留下的。树色一例是阴阴的,乍看像一团烟雾;但杨柳的丰姿,便在烟雾里也辨得出。树梢上隐隐约约的是一带远山,只有些大意罢了。树缝里也漏着一两点路灯光,没精打采的,是渴睡人的眼。这时候最热闹的,要数树上的蝉声与水里的蛙声;但热闹是它们的,我什么也没有。\r\r忽然想起采莲的事情来了。采莲是江南的旧俗,似乎很早就有,而六朝时为盛;从诗歌里可以约略知道。采莲的是少年的女子,她们是荡着小船,唱着艳歌去的。采莲人不用说很多,还有看采莲的人。那是一个热闹的季节,也是一个风流的季节。梁元帝《采莲赋》里说得好:\r\r于是妖童女,荡舟心许;鷁首徐回,兼传羽杯;櫂将移而藻挂,船欲动而萍开。尔其纤腰束素,迁延顾步;夏始春余,叶嫩花初,恐沾裳而浅笑,畏倾船而敛裾。\r\r可见当时嬉游的光景了。这真是有趣的事,可惜我们现在早已无福消受了。\r\r于是又记起,《西洲曲》里的句子:\r\r采莲南塘秋,莲花过人头;低头弄莲子,莲子清如水。\r\r今晚若有采莲人,这儿的莲花也算得“过人头”了;只不见一些流水的影子,是不行的。这令我到底惦着江南了。——这样想着,猛一抬头,不觉已是自己的门前;轻轻地推门进去,什么声息也没有,妻已睡熟好久了。\r\r一九二七年七月,北京清华园。\r\r\r\r《荷塘月色》语言朴素典雅,准确生动,贮满诗意,满溢着朱自清的散文语言一贯有朴素的美,不用浓墨重彩,画的是淡墨水彩。\r\r朱自清先生一笔写景一笔说情,看起来松散不知所云,可仔细体会下,就能感受到先生在字里行间表述出的苦闷,而随之读者也被先生的文字所感染,被带进了他当时那苦闷而无法明喻的心情。这就是优异散文的必须品质之一。\r\r扩展资料:\r一首长诗《毁灭》奠定了朱自清在文坛新诗人的地位,而《桨声灯影里的秦淮河》则被公认为白话美文的典范。朱自清用白话美文向复古派宣战,有力地回击了复古派“白话不能作美文”之说,他是“五四”新文学运动的开拓者之一。\r\r朱自清的美文影响了一代又一代人。作家贾平凹说:来到扬州,第一个想到的人是朱自清,他是知识分子中最最了不起的人物。\r\r实际上,朱自清的写作路程是非常曲折的,他早期的时候大多数作品都是诗歌,但是他的诗歌和我国古代诗人的诗有很大区别,他的诗是用白话文写的,这其实也是他写作的惯用风格。\r\r后来,朱自清开始写一些关于社会的文章,因为那个时候社会比较混乱,这时候的作品大多抨击社会的黑暗面,文体风格大多硬朗,基调伉俪。到了后期,大多是写关于山水的文章,这类文章的写作格调大多以清丽雅致为主。\r\r朱自清的写作风格虽然在不同的时期随着他的人生阅历和社会形态的不同而发生着变化,但是他文章的主基调是没有变的,他这一生,所写的所有文章风格上都有一个非常显著的特点,那就是简约平淡,他不是类似古代花间词派的诗人们,不管是他的诗词还是他的文章从来都不用过于华丽的辞藻,他崇尚的是平淡。\r\r英国友人戴立克试过英译朱自清几篇散文,译完一读显得单薄,远远不如原文流利。他不服气,改用稍微古奥的英文重译,好多了:“那是说,朱先生外圆内方,文字尽管浅白,心思却很深沉,译笔只好朝深处经营。”朱自清的很多文章,譬如《背影》《祭亡妇》,读来自有一番只可意会不可言传的东西。\r\r平淡就是朱自清的写作风格。他不是豪放派的作家,他在创作的时候钟情于清新的风格,给人耳目一新的感觉。在他的文章中包含了他对生活的向往,由此可见他的写作风格和他待人处事的态度也是有几分相似的。他的文章非常优美,但又不会让人觉得狭隘,给人一种豁达渊博的感觉,这就是朱自清的写作风格,更是朱自清的为人品质。\r\r写有《荷塘月色》《背影》等名篇的著名散文家朱自清先生,不仅自己一生风骨正气,还用无形的家风涵养子孙。良好的家风家规意蕴深远,催人向善,是凝聚情感、涵养德行、砥砺成才的人生信条。“北有朱自清,南有朱物华,一文一武,一南一北,双星闪耀”,这是中国知识界、教育界对朱家两兄弟的赞誉。\r\r朱自清性格温和,为人和善,对待年轻人平易近人,是个平和的人。他取字“佩弦”,意思要像弓弦那样将自己绷紧,给人的感觉是自我要求高,偶尔有呆气。朱自清教学负责,对学生要求严格,修他的课的学生都受益不少。\r\r1948 年 6 月,患胃病多年的朱自清,在《抗议美国扶日政策并拒绝领取美援面粉宣言》上,一丝不苟地签下了自己的名字。随后,朱自清还将面粉配购证以及面粉票退了回去。1948 年 8 月 12 日,朱自清因不堪胃病折磨,离开人世。在新的时代即将到来时,朱自清却匆匆地离人们远去。他为人们留下了无数经典的诗歌和文字,还有永不屈服的精神。\r\r朱自清没有豪言壮语,他只是用坚定的行动、朴实的语言,向世人展示了中国知识分子在祖国危难之际坚定的革命性,体现了中国人的骨气,表现了无比高贵的民族气节,呈现了人生最有价值的一面,谱就了生命中最华丽的乐章。\r\r他以“自清”为名,自勉在困境中不丧志;他身患重病,至死拒领美援面粉,其气节令世人感佩;他的《背影》《荷塘月色》《匆匆》脍炙人口;他的文字追求“真”,没有半点矫饰,却蕴藏着动人心弦的力量。\r\r朱自清不但在文学创作方面有很高的造诣,也是一名革命民主主义战士,在反饥饿、反内战的斗争中,他始终保持着一个正直的爱国知识分子的气节和情操。毛泽东对朱自清宁肯饿死不领美国“救济粉”的精神给予称赞,赞扬他“表现了我们民族的英雄气概”。\r\n',textRuns: [{st: 0,@@ -135,6 +135,14 @@ export const DEFAULT_DOCUMENT_DATA_CN: IDocumentData = {spaceAbove: { v: 10 },lineSpacing: 2,spaceBelow: { v: 0 },+ borderBottom: {+ color: {+ rgb: '#CDD0D8',+ },+ width: 2,+ dashStyle: DashStyleType.SOLID,+ padding: 5,+ },},},{@@ -629,11 +637,13 @@ export const DEFAULT_DOCUMENT_DATA_CN: IDocumentData = {// contentDirection: textDirection!,},],- customBlocks: [{- startIndex: 14,- blockType: BlockType.CUSTOM,- blockId: 'shapeTest1',- }],+ customBlocks: [+ // {+ // startIndex: 14,+ // blockType: BlockType.CUSTOM,+ // blockId: 'shapeTest1',+ // }+ ],tables: [],},documentStyle: {diff --git a/packages/docs-ui/src/commands/commands/break-line.command.ts b/packages/docs-ui/src/commands/commands/break-line.command.tsindex 661bf1c671..527868d22e 100644--- a/packages/docs-ui/src/commands/commands/break-line.command.ts+++ b/packages/docs-ui/src/commands/commands/break-line.command.ts@@ -14,7 +14,7 @@* limitations under the License.*/-import type { DocumentDataModel, ICommand, IDocumentBody, IParagraph } from '@univerjs/core';+import type { DocumentDataModel, ICommand, IDocumentBody, IParagraph, IParagraphBorder } from '@univerjs/core';import { CommandType, DataStreamTreeTokenType, ICommandService, IUniverInstanceService, PresetListType, Tools, UniverInstanceType } from '@univerjs/core';import { DocSelectionManagerService } from '@univerjs/docs';import { getTextRunAtPosition } from '../../basics/paragraph';@@ -22,7 +22,11 @@ import { DocMenuStyleService } from '../../services/doc-menu-style.service';import { InsertCommand } from './core-editing.command';import { ToggleCheckListCommand } from './list.command';-export function generateParagraphs(dataStream: string, prevParagraph?: IParagraph): IParagraph[] {+export function generateParagraphs(+ dataStream: string,+ prevParagraph?: IParagraph,+ borderBottom?: IParagraphBorder+): IParagraph[] {const paragraphs: IParagraph[] = [];for (let i = 0, len = dataStream.length; i < len; i++) {@@ -45,20 +49,34 @@ export function generateParagraphs(dataStream: string, prevParagraph?: IParagrapif (prevParagraph.paragraphStyle) {paragraph.paragraphStyle = Tools.deepClone(prevParagraph.paragraphStyle);+ delete paragraph.paragraphStyle.borderBottom;}}}+ if (borderBottom) {+ for (const paragraph of paragraphs) {+ if (!paragraph.paragraphStyle) {+ paragraph.paragraphStyle = {};+ }+ paragraph.paragraphStyle.borderBottom = borderBottom;+ }+ }+return paragraphs;}-export const BreakLineCommand: ICommand = {+interface IBreakLineCommandParams {+ horizontalLine?: IParagraphBorder;+}++export const BreakLineCommand: ICommand<IBreakLineCommandParams> = {id: 'doc.command.break-line',type: CommandType.COMMAND,// eslint-disable-next-line max-lines-per-function- handler: async (accessor) => {+ handler: async (accessor, params: IBreakLineCommandParams) => {const docSelectionManagerService = accessor.get(DocSelectionManagerService);const univerInstanceService = accessor.get(IUniverInstanceService);const commandService = accessor.get(ICommandService);@@ -81,9 +99,11 @@ export const BreakLineCommand: ICommand = {return true;}+ const { horizontalLine } = params ?? {};const { segmentId } = activeTextRange;const docDataModel = univerInstanceService.getCurrentUnitForType<DocumentDataModel>(UniverInstanceType.UNIVER_DOC);const body = docDataModel?.getSelfOrHeaderFooterModel(segmentId ?? '').getBody();+if (docDataModel == null || body == null) {return false;}@@ -94,6 +114,7 @@ export const BreakLineCommand: ICommand = {const paragraphs = body.paragraphs ?? [];const prevParagraph = paragraphs.find((p) => p.startIndex >= startOffset);+if (!prevParagraph) {return false;}@@ -106,7 +127,11 @@ export const BreakLineCommand: ICommand = {const insertBody: IDocumentBody = {dataStream: DataStreamTreeTokenType.PARAGRAPH,- paragraphs: generateParagraphs(DataStreamTreeTokenType.PARAGRAPH, prevParagraph),+ paragraphs: generateParagraphs(+ DataStreamTreeTokenType.PARAGRAPH,+ prevParagraph,+ horizontalLine+ ),textRuns: [{st: 0,ed: 1,diff --git a/packages/docs-ui/src/commands/commands/doc-delete.command.ts b/packages/docs-ui/src/commands/commands/doc-delete.command.tsindex 7e2bc74910..20a64ce38d 100644--- a/packages/docs-ui/src/commands/commands/doc-delete.command.ts+++ b/packages/docs-ui/src/commands/commands/doc-delete.command.ts@@ -134,9 +134,7 @@ interface IMergeTwoParagraphParams {}export const MergeTwoParagraphCommand: ICommand<IMergeTwoParagraphParams> = {-id: 'doc.command.merge-two-paragraph',-type: CommandType.COMMAND,// eslint-disable-next-line max-lines-per-functionhandler: async (accessor, params: IMergeTwoParagraphParams) => {@@ -253,6 +251,102 @@ export const MergeTwoParagraphCommand: ICommand<IMergeTwoParagraphParams> = {},};+export const RemoveHorizontalLineCommand: ICommand = {+ id: 'doc.command.remove-horizontal-line',+ type: CommandType.COMMAND,+ // eslint-disable-next-line max-lines-per-function+ handler: async (accessor) => {+ const docSelectionManagerService = accessor.get(DocSelectionManagerService);+ const univerInstanceService = accessor.get(IUniverInstanceService);+ const commandService = accessor.get(ICommandService);++ const activeRange = docSelectionManagerService.getActiveTextRange();+ const ranges = docSelectionManagerService.getTextRanges();++ if (activeRange == null || ranges == null) {+ return false;+ }+ const { segmentId, style } = activeRange;+ const docDataModel = univerInstanceService.getCurrentUnitForType<DocumentDataModel>(UniverInstanceType.UNIVER_DOC);+ const originBody = docDataModel?.getSelfOrHeaderFooterModel(segmentId).getBody();+ if (docDataModel == null || originBody == null) {+ return false;+ }++ const actualRange = activeRange;+ const unitId = docDataModel.getUnitId();++ const { startOffset, collapsed } = actualRange;+ if (!collapsed) {+ return false;+ }++ const paragraph = originBody.paragraphs?.find((p) => p.startIndex === startOffset - 1);++ if (paragraph == null) {+ return false;+ }++ const textRanges = [+ {+ startOffset,+ endOffset: startOffset,+ style,+ },+ ] as ITextRangeWithStyle[];++ const doMutation: IMutationInfo<IRichTextEditingMutationParams> = {+ id: RichTextEditingMutation.id,+ params: {+ unitId,+ actions: [],+ textRanges,+ },+ };++ const textX = new TextX();+ const jsonX = JSONX.getInstance();++ if (paragraph.startIndex > 0) {+ textX.push({+ t: TextXActionType.RETAIN,+ len: paragraph.startIndex,+ });+ }++ textX.push({+ t: TextXActionType.RETAIN,+ len: 1,+ coverType: UpdateDocsAttributeType.REPLACE,+ body: {+ dataStream: '',+ paragraphs: [+ {+ ...Tools.deepClone({+ ...paragraph,+ paragraphStyle: {+ ...paragraph.paragraphStyle,+ borderBottom: undefined,+ },+ }),+ startIndex: 0,+ },+ ],+ },+ });++ const path = getRichTextEditPath(docDataModel, segmentId);+ doMutation.params.actions = jsonX.editOp(textX.serialize(), path);++ const result = commandService.syncExecuteCommand<+ IRichTextEditingMutationParams,+ IRichTextEditingMutationParams+ >(doMutation.id, doMutation.params);++ return Boolean(result);+ },+};+export function getCursorWhenDelete(textRanges: Readonly<Nullable<ITextRangeWithStyle[]>>, rectRanges: readonly IRectRangeWithStyle[]): number {let cursor = 0;@@ -442,10 +536,16 @@ export const DeleteLeftCommand: ICommand = {return true;}if (preGlyph.content === '\r') {- result = await commandService.executeCommand(MergeTwoParagraphCommand.id, {- direction: DeleteDirection.LEFT,- range: actualRange,- });+ const paragraph = body.paragraphs?.find((p) => p.startIndex === startOffset - 1);++ if (paragraph?.paragraphStyle?.borderBottom) {+ result = await commandService.executeCommand(RemoveHorizontalLineCommand.id);+ } else {+ result = await commandService.executeCommand(MergeTwoParagraphCommand.id, {+ direction: DeleteDirection.LEFT,+ range: actualRange,+ });+ }} else if (preGlyph.streamType === '\b') {const drawing = docDataModel.getSnapshot().drawings?.[preGlyph.drawingId ?? ''];diff --git a/packages/docs-ui/src/commands/commands/doc-horizontal-line.command.ts b/packages/docs-ui/src/commands/commands/doc-horizontal-line.command.tsnew file mode 100644index 0000000000..ee1f357a20--- /dev/null+++ b/packages/docs-ui/src/commands/commands/doc-horizontal-line.command.ts@@ -0,0 +1,42 @@+/**+ * Copyright 2023-present DreamNum Co., Ltd.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++import type { ICommand } from '@univerjs/core';+import { CommandType, DashStyleType, ICommandService } from '@univerjs/core';+import { BreakLineCommand } from './break-line.command';++interface IHorizontalCommandParams {}++export const HorizontalLineCommand: ICommand<IHorizontalCommandParams> = {+ id: 'doc.command.horizontal-line',++ type: CommandType.COMMAND,++ handler: (accessor, _params: IHorizontalCommandParams) => {+ const commandService = accessor.get(ICommandService);++ return commandService.executeCommand(BreakLineCommand.id, {+ horizontalLine: {+ padding: 5,+ color: {+ rgb: '#CDD0D8',+ },+ width: 1,+ dashStyle: DashStyleType.SOLID,+ },+ });+ },+};diff --git a/packages/docs-ui/src/controllers/menu.schema.ts b/packages/docs-ui/src/controllers/menu.schema.tsindex 061bca3cf2..3fee8cd082 100644--- a/packages/docs-ui/src/controllers/menu.schema.ts+++ b/packages/docs-ui/src/controllers/menu.schema.ts@@ -19,9 +19,10 @@ import { ContextMenuGroup, ContextMenuPosition, RibbonStartGroup } from '@univerimport { DocCopyCommand, DocCutCommand, DocPasteCommand } from '../commands/commands/clipboard.command';import { DeleteLeftCommand } from '../commands/commands/doc-delete.command';import { OpenHeaderFooterPanelCommand } from '../commands/commands/doc-header-footer.command';+import { HorizontalLineCommand } from '../commands/commands/doc-horizontal-line.command';import { ResetInlineFormatTextBackgroundColorCommand, SetInlineFormatBoldCommand, SetInlineFormatFontFamilyCommand, SetInlineFormatFontSizeCommand, SetInlineFormatItalicCommand, SetInlineFormatStrikethroughCommand, SetInlineFormatSubscriptCommand, SetInlineFormatSuperscriptCommand, SetInlineFormatTextBackgroundColorCommand, SetInlineFormatTextColorCommand, SetInlineFormatUnderlineCommand } from '../commands/commands/inline-format.command';-import { BulletListCommand, CheckListCommand, OrderListCommand } from '../commands/commands/list.command';+import { BulletListCommand, CheckListCommand, OrderListCommand } from '../commands/commands/list.command';import { AlignCenterCommand, AlignJustifyCommand, AlignLeftCommand, AlignRightCommand } from '../commands/commands/paragraph-align.command';import { SwitchDocModeCommand } from '../commands/commands/switch-doc-mode.command';import { DocTableDeleteColumnsCommand, DocTableDeleteRowsCommand, DocTableDeleteTableCommand } from '../commands/commands/table/doc-table-delete.command';@@ -59,6 +60,7 @@ import {FontFamilySelectorMenuItemFactory,FontSizeSelectorMenuItemFactory,HeaderFooterMenuItemFactory,+ HorizontalLineFactory,InsertTableMenuFactory,ItalicMenuItemFactory,OrderListMenuItemFactory,@@ -144,24 +146,28 @@ export const menuSchema: MenuSchemaType = {order: 5,menuItemFactory: AlignJustifyMenuItemFactory,},- [OrderListCommand.id]: {+ [HorizontalLineCommand.id]: {order: 6,+ menuItemFactory: HorizontalLineFactory,+ },+ [OrderListCommand.id]: {+ order: 7,menuItemFactory: OrderListMenuItemFactory,},[BulletListCommand.id]: {- order: 7,+ order: 8,menuItemFactory: BulletListMenuItemFactory,},[CheckListCommand.id]: {- order: 8,+ order: 9,menuItemFactory: CheckListMenuItemFactory,},[OpenHeaderFooterPanelCommand.id]: {- order: 9,+ order: 10,menuItemFactory: HeaderFooterMenuItemFactory,},[SwitchDocModeCommand.id]: {- order: 10,+ order: 11,menuItemFactory: DocSwitchModeMenuItemFactory,},},diff --git a/packages/docs-ui/src/controllers/menu/menu.ts b/packages/docs-ui/src/controllers/menu/menu.tsindex 1db196633d..acb9c065ab 100644--- a/packages/docs-ui/src/controllers/menu/menu.ts+++ b/packages/docs-ui/src/controllers/menu/menu.ts@@ -48,6 +48,7 @@ import {import { combineLatest, map, Observable } from 'rxjs';import { OpenHeaderFooterPanelCommand } from '../../commands/commands/doc-header-footer.command';+import { HorizontalLineCommand } from '../../commands/commands/doc-horizontal-line.command';import { getStyleInTextRange, ResetInlineFormatTextBackgroundColorCommand, SetInlineFormatBoldCommand, SetInlineFormatCommand, SetInlineFormatFontFamilyCommand, SetInlineFormatFontSizeCommand, SetInlineFormatItalicCommand, SetInlineFormatStrikethroughCommand, SetInlineFormatSubscriptCommand, SetInlineFormatSuperscriptCommand, SetInlineFormatTextBackgroundColorCommand, SetInlineFormatTextColorCommand, SetInlineFormatUnderlineCommand } from '../../commands/commands/inline-format.command';import { BulletListCommand, CheckListCommand, getParagraphsInRange, OrderListCommand } from '../../commands/commands/list.command';import { AlignCenterCommand, AlignJustifyCommand, AlignLeftCommand, AlignOperationCommand, AlignRightCommand } from '../../commands/commands/paragraph-align.command';@@ -742,6 +743,17 @@ export function AlignJustifyMenuItemFactory(accessor: IAccessor): IMenuButtonIte};}+export function HorizontalLineFactory(accessor: IAccessor): IMenuButtonItem {+ return {+ id: HorizontalLineCommand.id,+ type: MenuItemType.BUTTON,+ icon: 'ReduceSingle',+ tooltip: 'toolbar.horizontalLine',+ disabled$: disableMenuWhenNoDocRange(accessor),+ hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_DOC, undefined, DOCS_ZEN_EDITOR_UNIT_ID_KEY),+ };+}+const listValueFactory$ = (accessor: IAccessor) => {return new Observable<PresetListType>((subscriber) => {const univerInstanceService = accessor.get(IUniverInstanceService);diff --git a/packages/docs-ui/src/docs-ui-plugin.ts b/packages/docs-ui/src/docs-ui-plugin.tsindex c7bb188748..679d66f0da 100644--- a/packages/docs-ui/src/docs-ui-plugin.ts+++ b/packages/docs-ui/src/docs-ui-plugin.ts@@ -39,8 +39,9 @@ import { BreakLineCommand } from './commands/commands/break-line.command';import { DocCopyCommand, DocCutCommand, DocPasteCommand } from './commands/commands/clipboard.command';import { CutContentCommand, InnerPasteCommand } from './commands/commands/clipboard.inner.command';import { DeleteCommand, InsertCommand, UpdateCommand } from './commands/commands/core-editing.command';-import { DeleteCustomBlockCommand, DeleteLeftCommand, DeleteRightCommand, MergeTwoParagraphCommand } from './commands/commands/doc-delete.command';+import { DeleteCustomBlockCommand, DeleteLeftCommand, DeleteRightCommand, MergeTwoParagraphCommand, RemoveHorizontalLineCommand } from './commands/commands/doc-delete.command';import { CloseHeaderFooterCommand } from './commands/commands/doc-header-footer.command';+import { HorizontalLineCommand } from './commands/commands/doc-horizontal-line.command';import { DocParagraphSettingCommand } from './commands/commands/doc-paragraph-setting.command';import { DocSelectAllCommand } from './commands/commands/doc-select-all.command';import { IMEInputCommand } from './commands/commands/ime-input.command';@@ -210,6 +211,7 @@ export class UniverDocsUIPlugin extends Plugin {DeleteCustomBlockCommand,UpdateCommand,MergeTwoParagraphCommand,+ RemoveHorizontalLineCommand,SetDocZoomRatioOperation,OrderListCommand,BulletListCommand,@@ -219,6 +221,7 @@ export class UniverDocsUIPlugin extends Plugin {AlignRightCommand,AlignOperationCommand,AlignJustifyCommand,+ HorizontalLineCommand,CreateDocTableCommand,DocTableInsertRowCommand,DocTableInsertRowAboveCommand,diff --git a/packages/docs-ui/src/locale/en-US.ts b/packages/docs-ui/src/locale/en-US.tsindex 40e716c089..04f1c72127 100644--- a/packages/docs-ui/src/locale/en-US.ts+++ b/packages/docs-ui/src/locale/en-US.ts@@ -51,6 +51,7 @@ const locale: typeof zhCN = {alignCenter: 'Align Center',alignRight: 'Align Right',alignJustify: 'Justify',+ horizontalLine: 'Horizontal line',headerFooter: 'Header & Footer',},table: {diff --git a/packages/docs-ui/src/locale/fa-IR.ts b/packages/docs-ui/src/locale/fa-IR.tsindex cda428f5b2..908b0fbb1c 100644--- a/packages/docs-ui/src/locale/fa-IR.ts+++ b/packages/docs-ui/src/locale/fa-IR.ts@@ -51,6 +51,7 @@ const locale: typeof zhCN = {alignCenter: 'تراز وسط',alignRight: 'تراز راست',alignJustify: 'توجیه',+ horizontalLine: 'Horizontal line',headerFooter: 'هدر و فوتر',},table: {diff --git a/packages/docs-ui/src/locale/fr-FR.ts b/packages/docs-ui/src/locale/fr-FR.tsindex 46c99b407b..37d286e466 100644--- a/packages/docs-ui/src/locale/fr-FR.ts+++ b/packages/docs-ui/src/locale/fr-FR.ts@@ -51,6 +51,7 @@ const locale: typeof enUS = {alignCenter: 'Aligner au centre',alignRight: 'Aligner à droite',alignJustify: 'Justifier',+ horizontalLine: 'Horizontal line',headerFooter: 'En-tête et pied de page',},table: {diff --git a/packages/docs-ui/src/locale/ru-RU.ts b/packages/docs-ui/src/locale/ru-RU.tsindex 99d239ba8a..97382cd724 100644--- a/packages/docs-ui/src/locale/ru-RU.ts+++ b/packages/docs-ui/src/locale/ru-RU.ts@@ -49,6 +49,7 @@ const locale: typeof zhCN = {alignCenter: 'Выровнять по центру',alignRight: 'Выровнять по правому краю',alignJustify: 'Выровнять по ширине',+ horizontalLine: 'Horizontal line',headerFooter: 'Header & Footer',checklist: 'Task list',documentFlavor: 'Modern Mode',diff --git a/packages/docs-ui/src/locale/vi-VN.ts b/packages/docs-ui/src/locale/vi-VN.tsindex 7df47e82b2..cf6804c5fe 100644--- a/packages/docs-ui/src/locale/vi-VN.ts+++ b/packages/docs-ui/src/locale/vi-VN.ts@@ -49,6 +49,7 @@ const locale: typeof zhCN = {alignCenter: 'Căn giữa',alignRight: 'Căn phải',alignJustify: 'Căn đều hai bên',+ horizontalLine: 'Horizontal line',headerFooter: 'Đầu trang và chân trang',checklist: 'Task list',documentFlavor: 'Modern Mode',diff --git a/packages/docs-ui/src/locale/zh-CN.ts b/packages/docs-ui/src/locale/zh-CN.tsindex c4cd1e0b96..e10f6b25aa 100644--- a/packages/docs-ui/src/locale/zh-CN.ts+++ b/packages/docs-ui/src/locale/zh-CN.ts@@ -49,6 +49,7 @@ const locale = {alignCenter: '居中对齐',alignRight: '右对齐',alignJustify: '两端对齐',+ horizontalLine: '水平分割线',headerFooter: '页眉页脚',},table: {diff --git a/packages/docs-ui/src/locale/zh-TW.ts b/packages/docs-ui/src/locale/zh-TW.tsindex 8dd1aa8b79..6e565817b7 100644--- a/packages/docs-ui/src/locale/zh-TW.ts+++ b/packages/docs-ui/src/locale/zh-TW.ts@@ -49,6 +49,7 @@ const locale: typeof zhCN = {alignCenter: '居中對齊',alignRight: '右對齊',alignJustify: '兩端對齊',+ horizontalLine: 'Horizontal line',headerFooter: '頁眉頁腳',checklist: '任務列表',documentFlavor: '现代模式',diff --git a/packages/engine-render/src/basics/i-document-skeleton-cached.ts b/packages/engine-render/src/basics/i-document-skeleton-cached.tsindex e7671edde3..ced396ab73 100644--- a/packages/engine-render/src/basics/i-document-skeleton-cached.ts+++ b/packages/engine-render/src/basics/i-document-skeleton-cached.ts@@ -22,6 +22,7 @@ import type {IDocumentRenderConfig,INestingLevel,IParagraph,+ IParagraphBorder,IParagraphProperties,ITable,ITableRow,@@ -168,7 +169,6 @@ export interface IDocumentSkeletonLine {// line坐标系相对于columndivides: IDocumentSkeletonDivide[]; // divides 受到对象影响,把行切分为N部分divideLen: number; // divideLen 被对象分割为多少块-lineHeight: number; // 行总体高度 lineHeight =max(glyph.fontBoundingBoxAscent + glyph.fontBoundingBoxDescent, glyph2.....) + spacecontentHeight: number; // contentHeight 行内容高度,contentHeight,=max(glyph.fontBoundingBoxAscent + glyph.fontBoundingBoxDescent, glyph2.....)top: number; // top paragraph(spaceAbove, spaceBelow, lineSpacing*PreLineHeight)@@ -179,17 +179,16 @@ export interface IDocumentSkeletonLine {marginTop: number; // marginTop 针对段落的spaceAbovemarginBottom: number; // marginBottom 针对段落的spaceBlowspaceBelowApply: number; // spaceBelowApply 计算后的下间距,只参与计算- width?: number; // the actual width of a linest: number; // startIndex 文本开始索引ed: number; // endIndex 文本结束索引-lineIndex: number; // lineIndex 行号- bullet?: IDocumentSkeletonBullet; // 无序和有序列表标题paragraphStart: boolean; // Paragraph start 默认 false-isBehindTable: boolean; // 在 DataStream 中,如果段落包含 table,那么段落第一行 isBehindTable 为 true, 并且 tableId 不为空,主要用来计算 st\ed.tableId: string; // tableId 如果段落包含 table,那么 tableId 不为空,主要用来计算 st\ed.+ borderBottom?: IParagraphBorder; // borderBottom+ bullet?: IDocumentSkeletonBullet; // 无序和有序列表标题+ width?: number; // the actual width of a line// dtId: string[]; // drawingTBIds 影响行的元素id集合,会切割divide,影响上下// bmt: number; // benchmarkTop, drawing的位置是根据paragraph的位置进行相对定位的,段落跨页后,需要一个校准parent?: IDocumentSkeletonColumn;diff --git a/packages/engine-render/src/components/docs/document.ts b/packages/engine-render/src/components/docs/document.tsindex ea136bf9d9..ff694bc47e 100644--- a/packages/engine-render/src/components/docs/document.ts+++ b/packages/engine-render/src/components/docs/document.ts@@ -440,6 +440,10 @@ export class Documents extends DocComponent {this._drawLiquid.translateRestore();}++ if (line.borderBottom) {+ this._drawBorderBottom(ctx, page, line);+ }this._drawLiquid.translateRestore();}}@@ -544,6 +548,35 @@ export class Documents extends DocComponent {}}+ private _drawBorderBottom(+ ctx: UniverRenderingContext,+ page: IDocumentSkeletonPage,+ line: IDocumentSkeletonLine,+ left = 0,+ top = 0+ ) {+ if (this._drawLiquid == null) {+ return;+ }+ let { x, y } = this._drawLiquid;+ const { pageWidth, marginLeft, marginRight, marginTop } = page;++ x += marginLeft + (left ?? 0);+ y -= line.marginTop;+ y -= line.paddingTop;+ y += marginTop + top + line.lineHeight + (line.borderBottom?.padding ?? 0);++ ctx.save();+ ctx.strokeStyle = line.borderBottom?.color.rgb ?? '#CDD0D8';+ drawLineByBorderType(ctx, BORDER_LTRB.BOTTOM, 0, {+ startX: x,+ startY: y,+ endX: x + pageWidth - marginLeft - marginRight,+ endY: y,+ });+ ctx.restore();+ }+// TODO: @JOCS, DRY!!!private _drawTableCell(ctx: UniverRenderingContext,@@ -706,6 +739,10 @@ export class Documents extends DocComponent {this._drawLiquid.translateRestore();}+ if (line.borderBottom) {+ this._drawBorderBottom(ctx, cell, line, page.marginLeft, page.marginTop);+ }+this._drawLiquid.translateRestore();}}@@ -927,6 +964,10 @@ export class Documents extends DocComponent {this._drawLiquid.translateRestore();}+ if (line.borderBottom) {+ this._drawBorderBottom(ctx, page, line, parentPage.marginLeft);+ }+this._drawLiquid.translateRestore();}}diff --git a/packages/engine-render/src/components/docs/layout/doc-skeleton.ts b/packages/engine-render/src/components/docs/layout/doc-skeleton.tsindex 146a38248f..d0611e06b9 100644--- a/packages/engine-render/src/components/docs/layout/doc-skeleton.ts+++ b/packages/engine-render/src/components/docs/layout/doc-skeleton.ts@@ -35,7 +35,7 @@ import { Hyphen } from './hyphenation/hyphen';import { LanguageDetector } from './hyphenation/language-detector';import { createSkeletonPage } from './model/page';import { createSkeletonSection } from './model/section';-import { getLastPage, getNullSkeleton, getPageFromPath, prepareSectionBreakConfig, resetContext, setPageParent, updateBlockIndex, updateInlineDrawingCoords } from './tools';+import { getLastPage, getNullSkeleton, getPageFromPath, prepareSectionBreakConfig, resetContext, setPageParent, updateBlockIndex, updateInlineDrawingCoordsAndBorder } from './tools';export enum DocumentSkeletonState {PENDING = 'pending',@@ -1174,15 +1174,15 @@ export class DocumentSkeleton extends Skeleton {removeDupPages(ctx);updateBlockIndex(skeleton.pages);// Calculate inline drawing position and update.- updateInlineDrawingCoords(ctx, skeleton.pages);+ updateInlineDrawingCoordsAndBorder(ctx, skeleton.pages);for (const hSkeMap of skeleton.skeHeaders.values()) {for (const page of hSkeMap.values()) {- updateInlineDrawingCoords(ctx, [page]);+ updateInlineDrawingCoordsAndBorder(ctx, [page]);}}for (const fSkeMap of skeleton.skeFooters.values()) {for (const page of fSkeMap.values()) {- updateInlineDrawingCoords(ctx, [page]);+ updateInlineDrawingCoordsAndBorder(ctx, [page]);}}setPageParent(skeleton.pages, skeleton);diff --git a/packages/engine-render/src/components/docs/layout/model/page.ts b/packages/engine-render/src/components/docs/layout/model/page.tsindex 920f014c2c..2681445e76 100644--- a/packages/engine-render/src/components/docs/layout/model/page.ts+++ b/packages/engine-render/src/components/docs/layout/model/page.ts@@ -27,7 +27,7 @@ import type { ILayoutContext } from '../tools';import { BooleanNumber, PageOrientType } from '@univerjs/core';import { BreakType, DocumentSkeletonPageType } from '../../../../basics/i-document-skeleton-cached';import { dealWithSection } from '../block/section';-import { resetContext, updateBlockIndex } from '../tools';+import { resetContext, updateBlockIndex, updateInlineDrawingCoordsAndBorder } from '../tools';import { createSkeletonSection } from './section';function getHeaderFooterMaxHeight(pageHeight: number) {@@ -383,6 +383,8 @@ export function createSkeletonCellPages(updateBlockIndex(pages, cellNode.startIndex);+ updateInlineDrawingCoordsAndBorder(ctx, pages);+return pages;}diff --git a/packages/engine-render/src/components/docs/layout/tools.ts b/packages/engine-render/src/components/docs/layout/tools.tsindex 1929a3bc55..ef6ca3ad8c 100644--- a/packages/engine-render/src/components/docs/layout/tools.ts+++ b/packages/engine-render/src/components/docs/layout/tools.ts@@ -49,6 +49,7 @@ import {AlignTypeV,BooleanNumber,ColumnSeparatorType,+ DataStreamTreeTokenType,DocumentFlavor,GridType,HorizontalAlign,@@ -467,15 +468,25 @@ export function updateBlockIndex(pages: IDocumentSkeletonPage[], start: number =}}-export function updateInlineDrawingCoords(ctx: ILayoutContext, pages: IDocumentSkeletonPage[]) {+export function updateInlineDrawingCoordsAndBorder(ctx: ILayoutContext, pages: IDocumentSkeletonPage[]) {lineIterator(pages, (line, _, __, page) => {const { segmentId } = page;- const affectInlineDrawings = ctx.paragraphConfigCache.get(segmentId)?.get(line.paragraphIndex)?.paragraphInlineSkeDrawings;+ const paragraphConfig = ctx.paragraphConfigCache.get(segmentId)?.get(line.paragraphIndex);++ const affectInlineDrawings = paragraphConfig?.paragraphInlineSkeDrawings;const drawingAnchor = ctx.skeletonResourceReference?.drawingAnchor?.get(segmentId)?.get(line.paragraphIndex);// Update inline drawings after the line is layout.if (affectInlineDrawings && affectInlineDrawings.size > 0) {updateInlineDrawingPosition(line, affectInlineDrawings, drawingAnchor?.top);}++ const paragraphStyle = paragraphConfig?.paragraphStyle;+ const lastDivide = line.divides[line.divides.length - 1];+ const lastGlyph = lastDivide.glyphGroup[lastDivide.glyphGroup.length - 1];++ if (lastGlyph.streamType === DataStreamTreeTokenType.PARAGRAPH && paragraphStyle?.borderBottom) {+ line.borderBottom = paragraphStyle.borderBottom;+ }});}diff --git a/packages/ui/src/common/component-manager.ts b/packages/ui/src/common/component-manager.tsindex 9791319849..a3a5315d81 100644--- a/packages/ui/src/common/component-manager.ts+++ b/packages/ui/src/common/component-manager.ts@@ -101,6 +101,7 @@ import {RedoSingle,Reduce,ReduceDigitsSingle,+ ReduceSingle,RightBorder,RightDoubleDiagonalSingle,RightInsertColumn,@@ -190,6 +191,7 @@ export class ComponentManager {RightBorder,RightJustifyingSingle,AlignTextBothSingle,+ ReduceSingle,RightRotationFortyFiveDegreesSingle,RightRotationNinetyDegreesSingle,StrikethroughSingle,