AI-native design editor. Open-source Figma alternative.
feat(text): share outline conversion for paths
Danila Poyarkovd927a2b4437b
diff --git a/desktop/generated/menu.json b/desktop/generated/menu.jsonindex 88528c70a..800e26c42 100644--- a/desktop/generated/menu.json+++ b/desktop/generated/menu.json@@ -214,6 +214,10 @@"id": "selection.flatten","label": "Flatten"},+ {+ "id": "selection.outlineText",+ "label": "Outline text"+ },{"type": "separator"},diff --git a/packages/core/src/canvas/boolean.ts b/packages/core/src/canvas/boolean.tsindex 28bd64022..94e34e730 100644--- a/packages/core/src/canvas/boolean.ts+++ b/packages/core/src/canvas/boolean.ts@@ -1,10 +1,10 @@import type { Canvas, Path, PathOp } from 'canvaskit-wasm'import type { SceneGraph, SceneNode } from '#core/scene-graph'-import { getGlyphOutlineMetricsSync, type OutlineCommand } from '#core/text/opentype'-import { fontManager, weightToStyle } from '#core/text/fonts'+import { getTextOutlineSupport } from '#core/text/outlines'import { makeArcPath } from './fills'+import { textNodeToOutlinePath } from './text-outlines'import type { SkiaRenderer } from './renderer'import { nodeHasRadius } from './shapes'@@ -44,9 +44,7 @@ function hasVisibleImageFill(node: SceneNode): boolean {}function canMakeTextSourcePath(node: SceneNode): boolean {- if (node.type !== 'TEXT' || !node.text) return false- const style = weightToStyle(node.fontWeight)- return fontManager.loadedData(node.fontFamily, style) !== null+ return getTextOutlineSupport(node).supported}export function canMakeBooleanSourcePath(node: SceneNode): boolean {@@ -71,54 +69,8 @@ function lineStrokePath(r: SkiaRenderer, node: SceneNode): Path | null {return path.stroke({ width: stroke?.weight ?? 1 })}-function appendOutlineCommand(path: Path, command: OutlineCommand, xOffset: number, yOffset: number): void {- switch (command.type) {- case 'M':- path.moveTo((command.x ?? 0) + xOffset, (command.y ?? 0) + yOffset)- break- case 'L':- path.lineTo((command.x ?? 0) + xOffset, (command.y ?? 0) + yOffset)- break- case 'C':- path.cubicTo(- (command.x1 ?? 0) + xOffset,- (command.y1 ?? 0) + yOffset,- (command.x2 ?? 0) + xOffset,- (command.y2 ?? 0) + yOffset,- (command.x ?? 0) + xOffset,- (command.y ?? 0) + yOffset- )- break- case 'Q':- path.quadTo(- (command.x1 ?? 0) + xOffset,- (command.y1 ?? 0) + yOffset,- (command.x ?? 0) + xOffset,- (command.y ?? 0) + yOffset- )- break- case 'Z':- path.close()- break- }-}--function textOutlinePath(r: SkiaRenderer, node: SceneNode): Path | null {- if (!node.text) return null- const fontSize = node.fontSize- const style = weightToStyle(node.fontWeight)- const glyphs = getGlyphOutlineMetricsSync(node.fontFamily, style, node.text, fontSize)- if (!glyphs) return null-- const path = new r.ck.Path()- for (const glyph of glyphs) {- for (const command of glyph.commands) appendOutlineCommand(path, command, glyph.x, fontSize)- }- return path-}-function baseShapePath(r: SkiaRenderer, node: SceneNode): Path | null {- if (node.type === 'TEXT') return textOutlinePath(r, node)+ if (node.type === 'TEXT') return textNodeToOutlinePath(r, node)if (node.type === 'LINE') return lineStrokePath(r, node)if (node.type === 'ELLIPSE' && node.arcData) return makeArcPath(r, node)diff --git a/packages/core/src/canvas/text-outlines.ts b/packages/core/src/canvas/text-outlines.tsnew file mode 100644index 000000000..2fb3182d4--- /dev/null+++ b/packages/core/src/canvas/text-outlines.ts@@ -0,0 +1,50 @@+import type { Path } from 'canvaskit-wasm'++import type { SceneNode } from '#core/scene-graph'+import { textNodeToOutlineLayout } from '#core/text/outlines'+import type { OutlineCommand } from '#core/text/opentype'++import type { SkiaRenderer } from './renderer'++function appendOutlineCommand(path: Path, command: OutlineCommand, xOffset: number, yOffset: number): void {+ switch (command.type) {+ case 'M':+ path.moveTo((command.x ?? 0) + xOffset, (command.y ?? 0) + yOffset)+ break+ case 'L':+ path.lineTo((command.x ?? 0) + xOffset, (command.y ?? 0) + yOffset)+ break+ case 'C':+ path.cubicTo(+ (command.x1 ?? 0) + xOffset,+ (command.y1 ?? 0) + yOffset,+ (command.x2 ?? 0) + xOffset,+ (command.y2 ?? 0) + yOffset,+ (command.x ?? 0) + xOffset,+ (command.y ?? 0) + yOffset+ )+ break+ case 'Q':+ path.quadTo(+ (command.x1 ?? 0) + xOffset,+ (command.y1 ?? 0) + yOffset,+ (command.x ?? 0) + xOffset,+ (command.y ?? 0) + yOffset+ )+ break+ case 'Z':+ path.close()+ break+ }+}++export function textNodeToOutlinePath(r: SkiaRenderer, node: SceneNode): Path | null {+ const layout = textNodeToOutlineLayout(node)+ if (!layout) return null++ const path = new r.ck.Path()+ for (const glyph of layout.glyphs) {+ for (const command of glyph.commands) appendOutlineCommand(path, command, glyph.x, glyph.y)+ }+ return path+}diff --git a/packages/core/src/editor/bridges/structure.ts b/packages/core/src/editor/bridges/structure.tsindex d64fd8877..1b64a4a15 100644--- a/packages/core/src/editor/bridges/structure.ts+++ b/packages/core/src/editor/bridges/structure.ts@@ -12,6 +12,7 @@ export function createStructureBridge(structure: StructureActions, selection: SebooleanOperationSelected: (operation: 'UNION' | 'SUBTRACT' | 'INTERSECT' | 'EXCLUDE') =>structure.booleanOperationSelected(selection.getSelectedNodes(), operation),flattenSelected: () => structure.flattenSelected(selection.getSelectedNodes()),+ outlineTextSelected: () => structure.outlineTextSelected(selection.getSelectedNodes()),ungroupSelected: () => structure.ungroupSelected(selection.getSelectedNode())}}diff --git a/packages/core/src/editor/structure.ts b/packages/core/src/editor/structure.tsindex 887826be0..46cfe3b29 100644--- a/packages/core/src/editor/structure.ts+++ b/packages/core/src/editor/structure.ts@@ -73,6 +73,11 @@ export function createStructureActions(ctx: EditorContext) {return flattenSelectedImpl(ctx, selectedNodes)}+ function outlineTextSelected(selectedNodes: SceneNode[]) {+ if (selectedNodes.length === 0 || selectedNodes.some((node) => node.type !== 'TEXT')) return null+ return flattenSelectedImpl(ctx, selectedNodes, 'Outline text')+ }+function moveToPage(pageId: string) {const targetPage = ctx.graph.getNode(pageId)if (targetPage?.type !== 'CANVAS') return@@ -101,6 +106,7 @@ export function createStructureActions(ctx: EditorContext) {booleanOperationSelected,ungroupSelected,flattenSelected,+ outlineTextSelected,...stateActions,moveToPage,renameNodediff --git a/packages/core/src/editor/structure/flatten.ts b/packages/core/src/editor/structure/flatten.tsindex 0412df2f2..5b6eaa8c5 100644--- a/packages/core/src/editor/structure/flatten.ts+++ b/packages/core/src/editor/structure/flatten.ts@@ -6,7 +6,7 @@ import type { SceneNode } from '#core/scene-graph'import { selectedNodesInSharedParent } from './selection'-export function flattenSelected(ctx: EditorContext, selectedNodes: SceneNode[]) {+export function flattenSelected(ctx: EditorContext, selectedNodes: SceneNode[], label = 'Flatten') {const renderer = ctx.getRenderer()if (!renderer) return null@@ -22,14 +22,14 @@ export function flattenSelected(ctx: EditorContext, selectedNodes: SceneNode[])const vectorProps = flattenNodesToVectorProps(renderer, ctx.graph, topLevel)if (!vectorProps) return null- const vector = ctx.graph.createNode('VECTOR', parentId, { ...vectorProps, strokes: [] })+ const vector = ctx.graph.createNode('VECTOR', parentId, { ...vectorProps, name: label, strokes: [] })const vectorSnapshot = structuredClone(vector)ctx.graph.insertChildAt(vector.id, parentId, firstIndex)for (const id of childIds) ctx.graph.deleteNode(id)ctx.setSelectedIds(new Set([vector.id]))ctx.undo.push({- label: 'Flatten',+ label,forward: () => {const restored = ctx.graph.createNode('VECTOR', parentId, vectorSnapshot)ctx.graph.insertChildAt(restored.id, parentId, firstIndex)diff --git a/packages/core/src/text/outlines.ts b/packages/core/src/text/outlines.tsnew file mode 100644index 000000000..01090d67a--- /dev/null+++ b/packages/core/src/text/outlines.ts@@ -0,0 +1,126 @@+import { prepareWithSegments, layoutWithLines } from '@chenglou/pretext'++import type { SceneNode } from '#core/scene-graph'+import { fontManager, weightToStyle } from '#core/text/fonts'+import { getGlyphOutlineMetricsSync, type OutlineCommand } from '#core/text/opentype'++export type TextOutlineUnsupportedReason =+ | 'not-text'+ | 'empty-text'+ | 'missing-font'+ | 'complex-script'+ | 'style-runs'++export type TextOutlineSupport =+ | { supported: true }+ | { supported: false; reason: TextOutlineUnsupportedReason }++export interface TextOutlineGlyph {+ commands: OutlineCommand[]+ x: number+ y: number+}++export interface TextOutlineLayout {+ glyphs: TextOutlineGlyph[]+ width: number+ height: number+}++const COMPLEX_SCRIPT_PATTERN = /[\u0590-\u08ff\u0900-\u0dff\ufb1d-\ufdff\ufe70-\ufeff]/++function textStyle(node: SceneNode): string {+ return weightToStyle(node.fontWeight, node.italic)+}++function textFamily(node: SceneNode): string {+ return node.fontFamily+}++export function getTextOutlineSupport(node: SceneNode): TextOutlineSupport {+ if (node.type !== 'TEXT') return { supported: false, reason: 'not-text' }+ if (!node.text) return { supported: false, reason: 'empty-text' }+ if (node.styleRuns.length > 0) return { supported: false, reason: 'style-runs' }+ if (COMPLEX_SCRIPT_PATTERN.test(node.text)) return { supported: false, reason: 'complex-script' }+ if (!fontManager.loadedData(textFamily(node), textStyle(node))) {+ return { supported: false, reason: 'missing-font' }+ }+ return { supported: true }+}++function lineHeight(node: SceneNode): number {+ return node.lineHeight ?? Math.ceil(node.fontSize * 1.2)+}++function textLines(node: SceneNode): string[] {+ const hardLines = node.text.split('\n')+ if (node.textAutoResize === 'WIDTH_AND_HEIGHT') return hardLines++ const result: string[] = []+ for (const hardLine of hardLines) {+ if (!hardLine) {+ result.push('')+ continue+ }+ try {+ const prepared = prepareWithSegments(hardLine, `${node.fontSize}px ${node.fontFamily}`)+ const layout = layoutWithLines(prepared, node.width, lineHeight(node))+ result.push(...layout.lines.map((line) => line.text))+ } catch {+ result.push(hardLine)+ }+ }+ return result+}++function lineOffsetX(node: SceneNode, width: number): number {+ switch (node.textAlignHorizontal) {+ case 'CENTER':+ return Math.max(0, (node.width - width) / 2)+ case 'RIGHT':+ return Math.max(0, node.width - width)+ default:+ return 0+ }+}++function verticalOffset(node: SceneNode, contentHeight: number): number {+ switch (node.textAlignVertical) {+ case 'CENTER':+ return Math.max(0, (node.height - contentHeight) / 2)+ case 'BOTTOM':+ return Math.max(0, node.height - contentHeight)+ default:+ return 0+ }+}++export function textNodeToOutlineLayout(node: SceneNode): TextOutlineLayout | null {+ if (!getTextOutlineSupport(node).supported) return null++ const lines = textLines(node)+ const lineH = lineHeight(node)+ const contentHeight = lines.length * lineH+ const yOffset = verticalOffset(node, contentHeight)+ const glyphs: TextOutlineGlyph[] = []+ let maxWidth = 0++ for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {+ const line = lines[lineIndex]+ const metrics = getGlyphOutlineMetricsSync(textFamily(node), textStyle(node), line, node.fontSize)+ if (!metrics) return null++ const lineWidth = metrics.reduce((width, glyph) => width + glyph.advance + node.letterSpacing, 0)+ maxWidth = Math.max(maxWidth, lineWidth)+ const xOffset = lineOffsetX(node, lineWidth)+ const baseline = yOffset + lineIndex * lineH + lineH++ let cursorX = xOffset+ for (const glyph of metrics) {+ glyphs.push({ commands: glyph.commands, x: cursorX, y: baseline })+ cursorX += glyph.advance + node.letterSpacing+ }+ }++ return { glyphs, width: maxWidth, height: contentHeight }+}diff --git a/packages/vue/src/editor/commands/registry.ts b/packages/vue/src/editor/commands/registry.tsindex 3211c3ffe..5794d202a 100644--- a/packages/vue/src/editor/commands/registry.ts+++ b/packages/vue/src/editor/commands/registry.ts@@ -88,6 +88,7 @@ export const EDITOR_COMMAND_METADATA = {keybinding: 'Alt+Shift+KeyF',contextTestId: 'context-flatten'},+ 'selection.outlineText': { contextTestId: 'context-outline-text' },'selection.moveToPage': {},'view.zoom100': { keybinding: '$mod+Digit0' },'view.zoomFit': { keybinding: ['$mod+Digit1', 'Shift+Digit1'] },diff --git a/packages/vue/src/editor/commands/selection.ts b/packages/vue/src/editor/commands/selection.tsindex 4df4a05e6..96eaa6a17 100644--- a/packages/vue/src/editor/commands/selection.ts+++ b/packages/vue/src/editor/commands/selection.ts@@ -199,6 +199,14 @@ export function createSelectionCommands({enabled: capabilities.canFlatten,run: () => editor.flattenSelected()},+ 'selection.outlineText': {+ id: 'selection.outlineText',+ get label() {+ return t.value.outlineText+ },+ enabled: capabilities.canOutlineText,+ run: () => editor.outlineTextSelected()+ },'selection.moveToPage': {id: 'selection.moveToPage',get label() {diff --git a/packages/vue/src/editor/commands/types.ts b/packages/vue/src/editor/commands/types.tsindex 94931a1e5..98c3a00e5 100644--- a/packages/vue/src/editor/commands/types.ts+++ b/packages/vue/src/editor/commands/types.ts@@ -26,6 +26,7 @@ export type EditorCommandId =| 'selection.booleanIntersect'| 'selection.booleanExclude'| 'selection.flatten'+ | 'selection.outlineText'| 'selection.moveToPage'| 'view.zoom100'| 'view.zoomFit'diff --git a/packages/vue/src/editor/menu-model/canvas.ts b/packages/vue/src/editor/menu-model/canvas.tsindex f99e0f795..335963a15 100644--- a/packages/vue/src/editor/menu-model/canvas.ts+++ b/packages/vue/src/editor/menu-model/canvas.ts@@ -36,7 +36,8 @@ const CANVAS_MENU_GROUPS = ['selection.frameSelection','selection.ungroupWhenGroup','selection.wrapInAutoLayout',- 'selection.flatten'+ 'selection.flatten',+ 'selection.outlineText'],['selection.componentAction', 'selection.componentSetAction', 'selection.instanceActions'],['selection.toggleVisibility', 'selection.toggleLock'],diff --git a/packages/vue/src/editor/selection-capabilities/use.ts b/packages/vue/src/editor/selection-capabilities/use.tsindex f14cd396c..b7a056653 100644--- a/packages/vue/src/editor/selection-capabilities/use.ts+++ b/packages/vue/src/editor/selection-capabilities/use.ts@@ -44,6 +44,13 @@ export function useSelectionCapabilities() {canFlip: computed(() => hasSelection.value),canBooleanOperation: computed(() => selectedCount.value >= 2 && selectedNodesCanFlatten.value),canFlatten: computed(() => selectedNodesCanFlatten.value),+ canOutlineText: useSceneComputed(() => {+ const nodes = editor.getSelectedNodes()+ return (+ nodes.length > 0 &&+ nodes.every((node) => node.type === 'TEXT' && canMakeBooleanSourceNode(node, editor.graph))+ )+ }),canGoToMainComponent: computed(() => selection.isInstance.value),canCreateInstance: computed(() => selectedNode.value?.type === 'COMPONENT'),canMoveToPage: useSceneComputed(() => hasSelection.value && editor.graph.getPages().length > 1),diff --git a/packages/vue/src/i18n/messages.ts b/packages/vue/src/i18n/messages.tsindex a01e6cb03..bf1b2aeee 100644--- a/packages/vue/src/i18n/messages.ts+++ b/packages/vue/src/i18n/messages.ts@@ -99,6 +99,7 @@ export const commandMessages = i18n('commands', {intersectSelection: 'Intersect selection',excludeSelection: 'Exclude selection',flattenSelection: 'Flatten',+ outlineText: 'Outline text',booleanOperations: 'Boolean operations',flipHorizontal: 'Flip horizontal',flipVertical: 'Flip vertical',diff --git a/packages/vue/src/locales/de.json b/packages/vue/src/locales/de.jsonindex c34bdfbdd..4b0434800 100644--- a/packages/vue/src/locales/de.json+++ b/packages/vue/src/locales/de.json@@ -74,7 +74,8 @@"booleanOperations": "Boolean operations","flipHorizontal": "Horizontal spiegeln","flipVertical": "Vertikal spiegeln",- "flattenSelection": "Flatten"+ "flattenSelection": "Flatten",+ "outlineText": "Outline text"},"tools": {"move": "Verschieben",diff --git a/packages/vue/src/locales/es.json b/packages/vue/src/locales/es.jsonindex ac6dca8e4..55c1a308d 100644--- a/packages/vue/src/locales/es.json+++ b/packages/vue/src/locales/es.json@@ -74,7 +74,8 @@"booleanOperations": "Boolean operations","flipHorizontal": "Voltear horizontalmente","flipVertical": "Voltear verticalmente",- "flattenSelection": "Flatten"+ "flattenSelection": "Flatten",+ "outlineText": "Outline text"},"tools": {"move": "Mover",diff --git a/packages/vue/src/locales/fr.json b/packages/vue/src/locales/fr.jsonindex c6933ee35..bb6118719 100644--- a/packages/vue/src/locales/fr.json+++ b/packages/vue/src/locales/fr.json@@ -74,7 +74,8 @@"booleanOperations": "Boolean operations","flipHorizontal": "Retourner horizontalement","flipVertical": "Retourner verticalement",- "flattenSelection": "Flatten"+ "flattenSelection": "Flatten",+ "outlineText": "Outline text"},"tools": {"move": "Déplacer",diff --git a/packages/vue/src/locales/it.json b/packages/vue/src/locales/it.jsonindex 305ec6aec..b701d94f1 100644--- a/packages/vue/src/locales/it.json+++ b/packages/vue/src/locales/it.json@@ -74,7 +74,8 @@"booleanOperations": "Boolean operations","flipHorizontal": "Rifletti orizzontalmente","flipVertical": "Rifletti verticalmente",- "flattenSelection": "Flatten"+ "flattenSelection": "Flatten",+ "outlineText": "Outline text"},"tools": {"move": "Sposta",diff --git a/packages/vue/src/locales/pl.json b/packages/vue/src/locales/pl.jsonindex fa50bb66c..e7c27f2f1 100644--- a/packages/vue/src/locales/pl.json+++ b/packages/vue/src/locales/pl.json@@ -74,7 +74,8 @@"booleanOperations": "Boolean operations","flipHorizontal": "Odbij poziomo","flipVertical": "Odbij pionowo",- "flattenSelection": "Flatten"+ "flattenSelection": "Flatten",+ "outlineText": "Outline text"},"tools": {"move": "Przesuń",diff --git a/packages/vue/src/locales/ru.json b/packages/vue/src/locales/ru.jsonindex cee5c0062..ea254a28c 100644--- a/packages/vue/src/locales/ru.json+++ b/packages/vue/src/locales/ru.json@@ -74,7 +74,8 @@"booleanOperations": "Boolean operations","flipHorizontal": "Отразить по горизонтали","flipVertical": "Отразить по вертикали",- "flattenSelection": "Flatten"+ "flattenSelection": "Flatten",+ "outlineText": "Outline text"},"tools": {"move": "Перемещение",diff --git a/packages/vue/src/locales/zh-CN.json b/packages/vue/src/locales/zh-CN.jsonindex c2e1b583f..7a896f07a 100644--- a/packages/vue/src/locales/zh-CN.json+++ b/packages/vue/src/locales/zh-CN.json@@ -74,7 +74,8 @@"booleanOperations": "Boolean operations","flipHorizontal": "水平翻转","flipVertical": "垂直翻转",- "flattenSelection": "Flatten"+ "flattenSelection": "Flatten",+ "outlineText": "Outline text"},"tools": {"move": "移动",diff --git a/src/app/shell/menu/schema.ts b/src/app/shell/menu/schema.tsindex 385ea4b81..217e5d2fc 100644--- a/src/app/shell/menu/schema.ts+++ b/src/app/shell/menu/schema.ts@@ -174,6 +174,11 @@ export const APP_MENU_SCHEMA = [label: 'Flatten',command: 'selection.flatten'},+ {+ id: 'selection.outlineText',+ label: 'Outline text',+ command: 'selection.outlineText'+ },{ type: 'separator' },{id: 'selection.createComponent',diff --git a/src/app/shell/menu/use.ts b/src/app/shell/menu/use.tsindex c1a266ba2..78c5cdffc 100644--- a/src/app/shell/menu/use.ts+++ b/src/app/shell/menu/use.ts@@ -30,6 +30,7 @@ const COMMAND_MENU_IDS = new Set<string>(['selection.booleanIntersect','selection.booleanExclude','selection.flatten',+ 'selection.outlineText','selection.bringToFront','selection.sendToBack','view.zoom100',diff --git a/src/components/CanvasMenu.vue b/src/components/CanvasMenu.vueindex 5e6fb4c0e..bbb335db9 100644--- a/src/components/CanvasMenu.vue+++ b/src/components/CanvasMenu.vue@@ -12,6 +12,7 @@ import IconCombine from '~icons/lucide/combine'import IconCopyMinus from '~icons/lucide/copy-minus'import IconCopyX from '~icons/lucide/copy-x'import IconListCollapse from '~icons/lucide/list-collapse'+import IconTypeOutline from '~icons/lucide/type-outline'import IconSquaresIntersect from '~icons/lucide/squares-intersect'import {vTestId,@@ -62,7 +63,8 @@ const booleanCommandIcons = {'selection.booleanSubtract': IconCopyMinus,'selection.booleanIntersect': IconSquaresIntersect,'selection.booleanExclude': IconCopyX,- 'selection.flatten': IconListCollapse+ 'selection.flatten': IconListCollapse,+ 'selection.outlineText': IconTypeOutline} satisfies Partial<Record<EditorCommandId, Component>>function contextCommandTestId(id: EditorCommandId | undefined): string | undefined {diff --git a/tests/engine/editor/structure/flatten.test.ts b/tests/engine/editor/structure/flatten.test.tsindex 217e2aaf7..3cde12257 100644--- a/tests/engine/editor/structure/flatten.test.ts+++ b/tests/engine/editor/structure/flatten.test.ts@@ -44,6 +44,31 @@ describe('flattenSelected', () => {surface.delete()})+ test('outlines loaded text through the shared text outline path', async () => {+ await loadInterRegular()+ const { editor, surface } = await createEditorWithRenderer()+ const pageId = editor.state.currentPageId+ const text = editor.graph.createNode('TEXT', pageId, {+ text: 'Hi',+ fontFamily: 'Inter',+ fontWeight: 400,+ fontSize: 32,+ width: 80,+ height: 40+ })++ editor.select([text.id])+ editor.outlineTextSelected()++ const [vectorId] = [...editor.state.selectedIds]+ const vector = editor.graph.getNode(vectorId)+ expect(vector?.type).toBe('VECTOR')+ expect(vector?.name).toBe('Outline text')+ expect(vector?.vectorNetwork?.vertices.length).toBeGreaterThan(0)+ expect(editor.graph.getNode(text.id)).toBeUndefined()+ surface.delete()+ })+test('flattens loaded text as outlines', async () => {await loadInterRegular()const { editor, surface } = await createEditorWithRenderer()diff --git a/tests/engine/vue/editor/menu-model/canvas.test.ts b/tests/engine/vue/editor/menu-model/canvas.test.tsindex dbcc3036f..1255372dc 100644--- a/tests/engine/vue/editor/menu-model/canvas.test.ts+++ b/tests/engine/vue/editor/menu-model/canvas.test.ts@@ -48,6 +48,7 @@ describe('buildCanvasContextMenu', () => {'selection.frameSelection','selection.wrapInAutoLayout','selection.flatten',+ 'selection.outlineText','---','selection.createComponent','---',