@univerjs-pro/engine-shape 1.0.0-alpha.2 → 1.0.0-alpha.4
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.
- package/README.md +9 -3
- package/lib/cjs/facade.js +1 -0
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +1 -0
- package/lib/es/index.js +1 -1
- package/lib/facade.js +1 -0
- package/lib/index.js +1 -1
- package/lib/types/config/config.d.ts +5 -0
- package/lib/types/facade/f-connector-shape.d.ts +257 -0
- package/lib/types/facade/f-enum.d.ts +246 -0
- package/lib/types/facade/f-shape-text.d.ts +281 -0
- package/lib/types/facade/f-shape.d.ts +625 -0
- package/lib/types/facade/index.d.ts +6 -0
- package/lib/types/index.d.ts +19 -196
- package/lib/types/models/shape-model.d.ts +3 -3
- package/lib/types/plugin.d.ts +13 -0
- package/lib/types/render-engine/shape-render-model.d.ts +0 -1
- package/lib/types/services/connector-shape-host-adapter.d.ts +40 -0
- package/lib/types/services/connector-shape-host-adapter.service.d.ts +55 -0
- package/lib/types/services/shape-host-adapter.service.d.ts +103 -0
- package/lib/types/shape-default-size.d.ts +9 -0
- package/lib/types/shape-default.d.ts +10 -2
- package/lib/types/shape-enum.d.ts +192 -1
- package/lib/types/shape-type.d.ts +101 -5
- package/lib/types/utils/connector.util.d.ts +15 -0
- package/lib/types/utils/shape-shadow.util.d.ts +8 -0
- package/lib/types/utils/shape-text-behavior.util.d.ts +21 -0
- package/lib/types/utils/shape-text-converter.d.ts +14 -0
- package/lib/umd/facade.js +1 -0
- package/lib/umd/index.js +1 -1
- package/package.json +16 -3
|
@@ -128,196 +128,387 @@ export declare enum ShapeOperatorEnum {
|
|
|
128
128
|
Sat2 = "sat2"
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
|
-
*
|
|
131
|
+
* Built-in vector shape types supported by the Univer shape engine.
|
|
132
|
+
*
|
|
133
|
+
* Board facade callers should access these values through `univerAPI.Enum.ShapeTypeEnum` so generated scripts remain
|
|
134
|
+
* copy-pasteable and do not need package-level imports.
|
|
132
135
|
*/
|
|
133
136
|
export declare enum ShapeTypeEnum {
|
|
137
|
+
/** No rendered geometry; reserve this value for an explicitly empty shape. */
|
|
134
138
|
None = "none",
|
|
139
|
+
/** Rectangle for generic process steps, cards, and diagram nodes. */
|
|
135
140
|
Rect = "rect",
|
|
141
|
+
/** Rounded rectangle for friendly process steps, states, and cards. */
|
|
136
142
|
RoundRect = "roundRect",
|
|
143
|
+
/** Ellipse for events, states, and circular diagram nodes. */
|
|
137
144
|
Ellipse = "ellipse",
|
|
145
|
+
/** Diamond for decisions, conditions, and branching points. */
|
|
138
146
|
Diamond = "diamond",
|
|
147
|
+
/** Upward-pointing triangle. */
|
|
139
148
|
Triangle = "triangle",
|
|
149
|
+
/** Right triangle with one vertical and one horizontal edge. */
|
|
140
150
|
RightTriangle = "rtTriangle",
|
|
151
|
+
/** Parallelogram commonly used for input and output steps. */
|
|
141
152
|
Parallelogram = "parallelogram",
|
|
153
|
+
/** Symmetric trapezoid. */
|
|
142
154
|
Trapezoid = "trapezoid",
|
|
155
|
+
/** Adjustable hexagon commonly used for preparation steps. */
|
|
143
156
|
Hexagon = "hexagon",// 这个跟Heptagon 不一样的点在于调节点
|
|
157
|
+
/** Eight-sided polygon commonly used for stop or warning nodes. */
|
|
144
158
|
Octagon = "octagon",
|
|
159
|
+
/** Plus-sign shape. */
|
|
145
160
|
Plus = "plus",
|
|
161
|
+
/** 5-point star shape. */
|
|
146
162
|
Star5 = "star5",
|
|
163
|
+
/** 6-point star shape. */
|
|
147
164
|
Star6 = "star6",
|
|
165
|
+
/** 7-point star shape. */
|
|
148
166
|
Star7 = "star7",
|
|
167
|
+
/** 8-point star shape. */
|
|
149
168
|
Star8 = "star8",
|
|
169
|
+
/** 10-point star shape. */
|
|
150
170
|
Star10 = "star10",
|
|
171
|
+
/** 12-point star shape. */
|
|
151
172
|
Star12 = "star12",
|
|
173
|
+
/** 16-point star shape. */
|
|
152
174
|
Star16 = "star16",
|
|
175
|
+
/** 24-point star shape. */
|
|
153
176
|
Star24 = "star24",
|
|
177
|
+
/** 32-point star shape. */
|
|
154
178
|
Star32 = "star32",
|
|
179
|
+
/** Round 1 rect shape. */
|
|
155
180
|
Round1Rect = "round1Rect",
|
|
181
|
+
/** Round 2 same rect shape. */
|
|
156
182
|
Round2SameRect = "round2SameRect",
|
|
183
|
+
/** Round 2 diag rect shape. */
|
|
157
184
|
Round2DiagRect = "round2DiagRect",
|
|
185
|
+
/** Snip 1 rect shape. */
|
|
158
186
|
Snip1Rect = "snip1Rect",
|
|
187
|
+
/** Snip round rect shape. */
|
|
159
188
|
SnipRoundRect = "snipRoundRect",
|
|
189
|
+
/** Snip 2 same rect shape. */
|
|
160
190
|
Snip2SameRect = "snip2SameRect",
|
|
191
|
+
/** Snip 2 diag rect shape. */
|
|
161
192
|
Snip2DiagRect = "snip2DiagRect",
|
|
193
|
+
/** Plaque shape. */
|
|
162
194
|
Plaque = "plaque",
|
|
195
|
+
/** Rectangular frame with an open center. */
|
|
163
196
|
Frame = "frame",
|
|
197
|
+
/** Two-sided partial frame. */
|
|
164
198
|
HalfFrame = "halfFrame",
|
|
199
|
+
/** Right-angle corner shape. */
|
|
165
200
|
Corner = "corner",
|
|
201
|
+
/** Diag stripe shape. */
|
|
166
202
|
DiagStripe = "diagStripe",
|
|
203
|
+
/** Circular segment bounded by a chord. */
|
|
167
204
|
Chord = "chord",
|
|
205
|
+
/** Open circular arc. */
|
|
168
206
|
Arc = "arc",
|
|
207
|
+
/** Left circular arrow shape for directional diagrams. */
|
|
169
208
|
LeftCircularArrow = "leftCircularArrow",
|
|
209
|
+
/** Left right circular arrow shape for directional diagrams. */
|
|
170
210
|
LeftRightCircularArrow = "leftRightCircularArrow",
|
|
211
|
+
/** Swoosh arrow shape for directional diagrams. */
|
|
171
212
|
SwooshArrow = "swooshArrow",
|
|
213
|
+
/** Left right ribbon shape. */
|
|
172
214
|
LeftRightRibbon = "leftRightRibbon",
|
|
215
|
+
/** Seven-sided polygon. */
|
|
173
216
|
Heptagon = "heptagon",
|
|
217
|
+
/** Home-plate pentagon for directional process nodes. */
|
|
174
218
|
HomePlate = "homePlate",
|
|
219
|
+
/** Right arrow shape for directional diagrams. */
|
|
175
220
|
RightArrow = "rightArrow",
|
|
221
|
+
/** Left arrow shape for directional diagrams. */
|
|
176
222
|
LeftArrow = "leftArrow",
|
|
223
|
+
/** Up arrow shape for directional diagrams. */
|
|
177
224
|
UpArrow = "upArrow",
|
|
225
|
+
/** Down arrow shape for directional diagrams. */
|
|
178
226
|
DownArrow = "downArrow",
|
|
227
|
+
/** Left right arrow shape for directional diagrams. */
|
|
179
228
|
LeftRightArrow = "leftRightArrow",
|
|
229
|
+
/** Up down arrow shape for directional diagrams. */
|
|
180
230
|
UpDownArrow = "upDownArrow",
|
|
231
|
+
/** Quad arrow shape for directional diagrams. */
|
|
181
232
|
QuadArrow = "quadArrow",
|
|
233
|
+
/** Left right up arrow shape for directional diagrams. */
|
|
182
234
|
LeftRightUpArrow = "leftRightUpArrow",
|
|
235
|
+
/** Bent arrow shape for directional diagrams. */
|
|
183
236
|
BentArrow = "bentArrow",
|
|
237
|
+
/** Uturn arrow shape for directional diagrams. */
|
|
184
238
|
UturnArrow = "uturnArrow",
|
|
239
|
+
/** Left up arrow shape for directional diagrams. */
|
|
185
240
|
LeftUpArrow = "leftUpArrow",
|
|
241
|
+
/** Bent up arrow shape for directional diagrams. */
|
|
186
242
|
BentUpArrow = "bentUpArrow",
|
|
243
|
+
/** Curved right arrow shape for directional diagrams. */
|
|
187
244
|
CurvedRightArrow = "curvedRightArrow",
|
|
245
|
+
/** Curved left arrow shape for directional diagrams. */
|
|
188
246
|
CurvedLeftArrow = "curvedLeftArrow",
|
|
247
|
+
/** Curved up arrow shape for directional diagrams. */
|
|
189
248
|
CurvedUpArrow = "curvedUpArrow",
|
|
249
|
+
/** Curved down arrow shape for directional diagrams. */
|
|
190
250
|
CurvedDownArrow = "curvedDownArrow",
|
|
251
|
+
/** Striped right arrow shape for directional diagrams. */
|
|
191
252
|
StripedRightArrow = "stripedRightArrow",
|
|
253
|
+
/** Notched right arrow shape for directional diagrams. */
|
|
192
254
|
NotchedRightArrow = "notchedRightArrow",
|
|
255
|
+
/** Five-sided polygon or home-style process node. */
|
|
193
256
|
Pentagon = "pentagon",
|
|
257
|
+
/** Chevron for sequences, progress, and directional stages. */
|
|
194
258
|
Chevron = "chevron",
|
|
259
|
+
/** Right arrow callout shape for directional diagrams. */
|
|
195
260
|
RightArrowCallout = "rightArrowCallout",
|
|
261
|
+
/** Down arrow callout shape for directional diagrams. */
|
|
196
262
|
DownArrowCallout = "downArrowCallout",
|
|
263
|
+
/** Left arrow callout shape for directional diagrams. */
|
|
197
264
|
LeftArrowCallout = "leftArrowCallout",
|
|
265
|
+
/** Up arrow callout shape for directional diagrams. */
|
|
198
266
|
UpArrowCallout = "upArrowCallout",
|
|
267
|
+
/** Left right arrow callout shape for directional diagrams. */
|
|
199
268
|
LeftRightArrowCallout = "leftRightArrowCallout",
|
|
269
|
+
/** Quad arrow callout shape for directional diagrams. */
|
|
200
270
|
QuadArrowCallout = "quadArrowCallout",
|
|
271
|
+
/** Circular arrow for cycles and repeated processes. */
|
|
201
272
|
CircularArrow = "circularArrow",
|
|
273
|
+
/** Equation symbol for plus. */
|
|
202
274
|
MathPlus = "mathPlus",
|
|
275
|
+
/** Equation symbol for minus. */
|
|
203
276
|
MathMinus = "mathMinus",
|
|
277
|
+
/** Equation symbol for multiply. */
|
|
204
278
|
MathMultiply = "mathMultiply",
|
|
279
|
+
/** Equation symbol for divide. */
|
|
205
280
|
MathDivide = "mathDivide",
|
|
281
|
+
/** Equation symbol for equal. */
|
|
206
282
|
MathEqual = "mathEqual",
|
|
283
|
+
/** Equation symbol for not equal. */
|
|
207
284
|
MathNotEqual = "mathNotEqual",
|
|
285
|
+
/** Flowchart process symbol for a standard operation. */
|
|
208
286
|
FlowchartProcess = "flowChartProcess",
|
|
287
|
+
/** Flowchart alternate-process symbol. */
|
|
209
288
|
FlowchartAlternateProcess = "flowChartAlternateProcess",
|
|
289
|
+
/** Flowchart decision symbol for branching conditions. */
|
|
210
290
|
FlowchartDecision = "flowChartDecision",
|
|
291
|
+
/** Flowchart input/output symbol for data entering or leaving a process. */
|
|
211
292
|
FlowChartInputOutput = "flowChartInputOutput",
|
|
293
|
+
/** Flowchart predefined-process symbol for a named subprocess. */
|
|
212
294
|
FlowchartPredefinedProcess = "flowChartPredefinedProcess",
|
|
295
|
+
/** Flowchart internal-storage symbol. */
|
|
213
296
|
FlowchartInternalStorage = "flowChartInternalStorage",
|
|
297
|
+
/** Flowchart document symbol for one document artifact. */
|
|
214
298
|
FlowchartDocument = "flowChartDocument",
|
|
299
|
+
/** Flowchart multiple-documents symbol. */
|
|
215
300
|
FlowchartMultiDocument = "flowChartMultidocument",
|
|
301
|
+
/** Flowchart terminator symbol for a start or end state. */
|
|
216
302
|
FlowchartTerminator = "flowChartTerminator",
|
|
303
|
+
/** Flowchart preparation symbol for initialization or setup. */
|
|
217
304
|
FlowchartPreparation = "flowChartPreparation",
|
|
305
|
+
/** Flowchart manual-input symbol. */
|
|
218
306
|
FlowchartManualInput = "flowChartManualInput",
|
|
307
|
+
/** Flowchart manual-operation symbol. */
|
|
219
308
|
FlowchartManualOperation = "flowChartManualOperation",
|
|
309
|
+
/** Flowchart on-page connector symbol. */
|
|
220
310
|
FlowchartConnector = "flowChartConnector",
|
|
311
|
+
/** Flowchart off-page connector symbol. */
|
|
221
312
|
FlowchartOffPageConnector = "flowChartOffpageConnector",
|
|
313
|
+
/** Flowchart punched-card data symbol. */
|
|
222
314
|
FlowchartPunchedCard = "flowChartPunchedCard",
|
|
315
|
+
/** Flowchart punched-tape data symbol. */
|
|
223
316
|
FlowchartPunchedTape = "flowChartPunchedTape",
|
|
317
|
+
/** Flowchart summing-junction symbol. */
|
|
224
318
|
FlowchartSummingJunction = "flowChartSummingJunction",
|
|
319
|
+
/** Flowchart logical OR junction symbol. */
|
|
225
320
|
FlowchartOr = "flowChartOr",
|
|
321
|
+
/** Flowchart collate symbol. */
|
|
226
322
|
FlowchartCollate = "flowChartCollate",
|
|
323
|
+
/** Flowchart sort symbol. */
|
|
227
324
|
FlowchartSort = "flowChartSort",
|
|
325
|
+
/** Flowchart extract symbol. */
|
|
228
326
|
FlowchartExtract = "flowChartExtract",
|
|
327
|
+
/** Flowchart merge symbol. */
|
|
229
328
|
FlowchartMerge = "flowChartMerge",
|
|
329
|
+
/** Flowchart online-storage symbol. */
|
|
230
330
|
FlowchartOnlineStorage = "flowChartOnlineStorage",
|
|
331
|
+
/** Flowchart delay or wait symbol. */
|
|
231
332
|
FlowchartDelay = "flowChartDelay",
|
|
333
|
+
/** Flowchart sequential-access magnetic-tape storage symbol. */
|
|
232
334
|
FlowchartMagneticTape = "flowChartMagneticTape",
|
|
335
|
+
/** Flowchart magnetic-disk storage symbol. */
|
|
233
336
|
FlowchartMagneticDisk = "flowChartMagneticDisk",
|
|
337
|
+
/** Flowchart direct-access magnetic-drum storage symbol. */
|
|
234
338
|
FlowchartMagneticDrum = "flowChartMagneticDrum",
|
|
339
|
+
/** Flowchart display or screen output symbol. */
|
|
235
340
|
FlowchartDisplay = "flowChartDisplay",
|
|
341
|
+
/** Wedge rect callout shape for annotated content. */
|
|
236
342
|
WedgeRectCallout = "wedgeRectCallout",
|
|
343
|
+
/** Wedge round rect callout shape for annotated content. */
|
|
237
344
|
WedgeRoundRectCallout = "wedgeRoundRectCallout",
|
|
345
|
+
/** Wedge ellipse callout shape for annotated content. */
|
|
238
346
|
WedgeEllipseCallout = "wedgeEllipseCallout",
|
|
347
|
+
/** Cloud callout shape for annotated content. */
|
|
239
348
|
CloudCallout = "cloudCallout",
|
|
349
|
+
/** Border callout 1 shape for annotated content. */
|
|
240
350
|
BorderCallout1 = "borderCallout1",
|
|
351
|
+
/** Border callout 2 shape for annotated content. */
|
|
241
352
|
BorderCallout2 = "borderCallout2",
|
|
353
|
+
/** Border callout 3 shape for annotated content. */
|
|
242
354
|
BorderCallout3 = "borderCallout3",
|
|
355
|
+
/** Accent callout 1 shape for annotated content. */
|
|
243
356
|
AccentCallout1 = "accentCallout1",
|
|
357
|
+
/** Accent callout 2 shape for annotated content. */
|
|
244
358
|
AccentCallout2 = "accentCallout2",
|
|
359
|
+
/** Accent callout 3 shape for annotated content. */
|
|
245
360
|
AccentCallout3 = "accentCallout3",
|
|
361
|
+
/** Callout 1 shape for annotated content. */
|
|
246
362
|
Callout1 = "callout1",
|
|
363
|
+
/** Callout 2 shape for annotated content. */
|
|
247
364
|
Callout2 = "callout2",
|
|
365
|
+
/** Callout 3 shape for annotated content. */
|
|
248
366
|
Callout3 = "callout3",
|
|
367
|
+
/** Accent border callout 1 shape for annotated content. */
|
|
249
368
|
AccentBorderCallout1 = "accentBorderCallout1",
|
|
369
|
+
/** Accent border callout 2 shape for annotated content. */
|
|
250
370
|
AccentBorderCallout2 = "accentBorderCallout2",
|
|
371
|
+
/** Accent border callout 3 shape for annotated content. */
|
|
251
372
|
AccentBorderCallout3 = "accentBorderCallout3",
|
|
373
|
+
/** Ribbon shape. */
|
|
252
374
|
Ribbon = "ribbon",
|
|
375
|
+
/** Ribbon 2 shape. */
|
|
253
376
|
Ribbon2 = "ribbon2",
|
|
377
|
+
/** Ellipse ribbon shape. */
|
|
254
378
|
EllipseRibbon = "ellipseRibbon",
|
|
379
|
+
/** Ellipse ribbon 2 shape. */
|
|
255
380
|
EllipseRibbon2 = "ellipseRibbon2",
|
|
381
|
+
/** Vertical scroll shape. */
|
|
256
382
|
VerticalScroll = "verticalScroll",
|
|
383
|
+
/** Horizontal scroll shape. */
|
|
257
384
|
HorizontalScroll = "horizontalScroll",
|
|
385
|
+
/** Wave shape. */
|
|
258
386
|
Wave = "wave",
|
|
387
|
+
/** Double wave shape. */
|
|
259
388
|
DoubleWave = "doubleWave",
|
|
389
|
+
/** Cube shape. */
|
|
260
390
|
Cube = "cube",
|
|
391
|
+
/** Can shape. */
|
|
261
392
|
Can = "can",
|
|
393
|
+
/** Lightning bolt shape. */
|
|
262
394
|
LightningBolt = "lightningBolt",
|
|
395
|
+
/** Heart shape. */
|
|
263
396
|
Heart = "heart",
|
|
397
|
+
/** Sun shape. */
|
|
264
398
|
Sun = "sun",
|
|
399
|
+
/** Moon shape. */
|
|
265
400
|
Moon = "moon",
|
|
401
|
+
/** Smiley face shape. */
|
|
266
402
|
SmileyFace = "smileyFace",
|
|
403
|
+
/** Irregular seal 1 shape. */
|
|
267
404
|
IrregularSeal1 = "irregularSeal1",
|
|
405
|
+
/** Irregular seal 2 shape. */
|
|
268
406
|
IrregularSeal2 = "irregularSeal2",
|
|
407
|
+
/** Folded corner shape. */
|
|
269
408
|
FoldedCorner = "foldedCorner",
|
|
409
|
+
/** Bevel shape. */
|
|
270
410
|
Bevel = "bevel",
|
|
411
|
+
/** Donut shape. */
|
|
271
412
|
Donut = "donut",
|
|
413
|
+
/** No smoking shape. */
|
|
272
414
|
NoSmoking = "noSmoking",
|
|
415
|
+
/** Block arc shape. */
|
|
273
416
|
BlockArc = "blockArc",
|
|
417
|
+
/** Teardrop shape. */
|
|
274
418
|
Teardrop = "teardrop",
|
|
419
|
+
/** Pie wedge shape. */
|
|
275
420
|
PieWedge = "pieWedge",
|
|
421
|
+
/** Pie shape. */
|
|
276
422
|
Pie = "pie",
|
|
423
|
+
/** Funnel shape. */
|
|
277
424
|
Funnel = "funnel",
|
|
425
|
+
/** Gear 6 shape. */
|
|
278
426
|
Gear6 = "gear6",
|
|
427
|
+
/** Gear 9 shape. */
|
|
279
428
|
Gear9 = "gear9",
|
|
429
|
+
/** Decagon shape. */
|
|
280
430
|
Decagon = "decagon",
|
|
431
|
+
/** Dodecagon shape. */
|
|
281
432
|
Dodecagon = "dodecagon",
|
|
433
|
+
/** Corner tabs shape. */
|
|
282
434
|
CornerTabs = "cornerTabs",
|
|
435
|
+
/** Left brace shape. */
|
|
283
436
|
LeftBrace = "leftBrace",
|
|
437
|
+
/** Right brace shape. */
|
|
284
438
|
RightBrace = "rightBrace",
|
|
439
|
+
/** Left bracket shape. */
|
|
285
440
|
LeftBracket = "leftBracket",
|
|
441
|
+
/** Right bracket shape. */
|
|
286
442
|
RightBracket = "rightBracket",
|
|
443
|
+
/** Action button for back previous. */
|
|
287
444
|
ActionButtonBackPrevious = "actionButtonBackPrevious",
|
|
445
|
+
/** Action button for forward next. */
|
|
288
446
|
ActionButtonForwardNext = "actionButtonForwardNext",
|
|
447
|
+
/** Action button for beginning. */
|
|
289
448
|
ActionButtonBeginning = "actionButtonBeginning",
|
|
449
|
+
/** Action button for end. */
|
|
290
450
|
ActionButtonEnd = "actionButtonEnd",
|
|
451
|
+
/** Action button for home. */
|
|
291
452
|
ActionButtonHome = "actionButtonHome",
|
|
453
|
+
/** Action button for information. */
|
|
292
454
|
ActionButtonInformation = "actionButtonInformation",
|
|
455
|
+
/** Action button for return. */
|
|
293
456
|
ActionButtonReturn = "actionButtonReturn",
|
|
457
|
+
/** Action button for movie. */
|
|
294
458
|
ActionButtonMovie = "actionButtonMovie",
|
|
459
|
+
/** Action button for document. */
|
|
295
460
|
ActionButtonDocument = "actionButtonDocument",
|
|
461
|
+
/** Action button for sound. */
|
|
296
462
|
ActionButtonSound = "actionButtonSound",
|
|
463
|
+
/** Action button for help. */
|
|
297
464
|
ActionButtonHelp = "actionButtonHelp",
|
|
465
|
+
/** Action button for blank. */
|
|
298
466
|
ActionButtonBlank = "actionButtonBlank",
|
|
467
|
+
/** Brace pair shape. */
|
|
299
468
|
BracePair = "bracePair",
|
|
469
|
+
/** Bracket pair shape. */
|
|
300
470
|
BracketPair = "bracketPair",
|
|
471
|
+
/** Chart plus shape. */
|
|
301
472
|
ChartPlus = "chartPlus",
|
|
473
|
+
/** Chart star shape. */
|
|
302
474
|
ChartStar = "chartStar",
|
|
475
|
+
/** Chart x shape. */
|
|
303
476
|
ChartX = "chartX",
|
|
477
|
+
/** Cloud shape. */
|
|
304
478
|
Cloud = "cloud",
|
|
479
|
+
/** Flowchart offline-storage symbol. */
|
|
305
480
|
FlowChartOfflineStorage = "flowChartOfflineStorage",
|
|
481
|
+
/** Line inv shape. */
|
|
306
482
|
LineInv = "lineInv",
|
|
483
|
+
/** Non isosceles trapezoid shape. */
|
|
307
484
|
NonIsoscelesTrapezoid = "nonIsoscelesTrapezoid",
|
|
485
|
+
/** Plaque tabs shape. */
|
|
308
486
|
PlaqueTabs = "plaqueTabs",
|
|
487
|
+
/** Square tabs shape. */
|
|
309
488
|
SquareTabs = "squareTabs",
|
|
489
|
+
/** 4-point star shape. */
|
|
310
490
|
Star4 = "star4",
|
|
491
|
+
/** Up down arrow callout shape for directional diagrams. */
|
|
311
492
|
UpDownArrowCallout = "upDownArrowCallout",
|
|
493
|
+
/** Simple line shape. */
|
|
312
494
|
Line = "line",
|
|
495
|
+
/** Straight connector shape with one segment. */
|
|
313
496
|
StraightConnector1 = "straightConnector1",
|
|
497
|
+
/** Orthogonal connector shape with two segments. */
|
|
314
498
|
BentConnector2 = "bentConnector2",
|
|
499
|
+
/** Orthogonal connector shape with three segments. */
|
|
315
500
|
BentConnector3 = "bentConnector3",
|
|
501
|
+
/** Orthogonal connector shape with four segments. */
|
|
316
502
|
BentConnector4 = "bentConnector4",
|
|
503
|
+
/** Orthogonal connector shape with five segments. */
|
|
317
504
|
BentConnector5 = "bentConnector5",
|
|
505
|
+
/** Curved connector shape with two control sections. */
|
|
318
506
|
CurvedConnector2 = "curvedConnector2",
|
|
507
|
+
/** Curved connector shape with three control sections. */
|
|
319
508
|
CurvedConnector3 = "curvedConnector3",
|
|
509
|
+
/** Curved connector shape with four control sections. */
|
|
320
510
|
CurvedConnector4 = "curvedConnector4",
|
|
511
|
+
/** Curved connector shape with five control sections. */
|
|
321
512
|
CurvedConnector5 = "curvedConnector5"
|
|
322
513
|
}
|
|
323
514
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HorizontalAlign, IDocumentData, VerticalAlign } from '@univerjs/core';
|
|
1
2
|
import type { BasicShapeEnum, ImageFillModeEnum, ImageSourceTypeEnum, ShapeArrowSizeEnum, ShapeArrowTypeEnum, ShapeFillEnum, ShapeGradientTypeEnum, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeLineTypeEnum, ShapeOperatorEnum, ShapePresetShadowValEnum, ShapeRenderModeEnum, ShapeSketchTypeEnum, ShapeTypeEnum } from './shape-enum';
|
|
2
3
|
/**
|
|
3
4
|
* GdContext 用来计算 OOXML Shape 的 Geometry Definitions (gd)
|
|
@@ -551,18 +552,96 @@ export interface IShapePath {
|
|
|
551
552
|
/** Parsed path data array (alternative to data string) */
|
|
552
553
|
dataArray?: IPathCommand[];
|
|
553
554
|
}
|
|
554
|
-
export
|
|
555
|
+
export declare enum ShapeTextDirection {
|
|
556
|
+
/** Horizontal text. */
|
|
557
|
+
Horz = "horz",
|
|
558
|
+
/** Vertical text. */
|
|
559
|
+
Vert = "vert",
|
|
560
|
+
/** Vertical text rotated 270 degrees from the horizontal baseline. */
|
|
561
|
+
Vert270 = "vert270",
|
|
562
|
+
/** Vertical WordArt text. */
|
|
563
|
+
WordArtVert = "wordArtVert",
|
|
564
|
+
/** East Asian vertical text. */
|
|
565
|
+
EaVert = "eaVert",
|
|
566
|
+
/** Mongolian vertical text. */
|
|
567
|
+
MongolianVert = "mongolianVert",
|
|
568
|
+
/** Right-to-left vertical WordArt text. */
|
|
569
|
+
WordArtVertRtl = "wordArtVertRtl"
|
|
570
|
+
}
|
|
571
|
+
export type ShapeTextHorizontalAnchor = 'center';
|
|
572
|
+
export declare enum ShapeTextWrapType {
|
|
573
|
+
/** Do not wrap text inside the shape text box. */
|
|
574
|
+
None = "none",
|
|
575
|
+
/** Wrap text inside the shape text box. */
|
|
576
|
+
Square = "square"
|
|
577
|
+
}
|
|
578
|
+
export type ShapeShadowAlignment = 'tl' | 't' | 'tr' | 'l' | 'ctr' | 'r' | 'bl' | 'b' | 'br';
|
|
579
|
+
export declare enum ShapeTextAutoFitType {
|
|
580
|
+
/** Do not automatically adjust overflowing text. */
|
|
581
|
+
NoAutoFit = "noAutoFit",
|
|
582
|
+
/** Shrink text when it overflows the shape. */
|
|
583
|
+
NormAutoFit = "normAutoFit",
|
|
584
|
+
/** Resize the shape to fit the text. */
|
|
585
|
+
SpAutoFit = "spAutoFit"
|
|
586
|
+
}
|
|
555
587
|
export interface IShapeTextAlign {
|
|
556
588
|
isHorizontal: boolean;
|
|
557
589
|
textDirection?: ShapeTextDirection;
|
|
558
590
|
}
|
|
559
591
|
export interface IShapeTextRectPadding {
|
|
592
|
+
/** Left inner text margin, in px. */
|
|
560
593
|
left: number;
|
|
594
|
+
/** Top inner text margin, in px. */
|
|
561
595
|
top: number;
|
|
596
|
+
/** Right inner text margin, in px. */
|
|
562
597
|
right: number;
|
|
598
|
+
/** Bottom inner text margin, in px. */
|
|
563
599
|
bottom: number;
|
|
564
600
|
}
|
|
565
|
-
export interface
|
|
601
|
+
export interface IShapeTextBoxOptions {
|
|
602
|
+
/**
|
|
603
|
+
* Text direction inside the shape text box.
|
|
604
|
+
*
|
|
605
|
+
* Use `univerAPI.Enum.ShapeTextDirection` in facade code.
|
|
606
|
+
*/
|
|
607
|
+
textDirection?: ShapeTextDirection;
|
|
608
|
+
/**
|
|
609
|
+
* How the hosted text fits when it overflows the shape.
|
|
610
|
+
*
|
|
611
|
+
* Use `univerAPI.Enum.ShapeTextAutoFitType` in facade code.
|
|
612
|
+
*/
|
|
613
|
+
autoFitType?: ShapeTextAutoFitType;
|
|
614
|
+
/**
|
|
615
|
+
* Whether hosted text wraps inside the shape text box.
|
|
616
|
+
*
|
|
617
|
+
* Use `univerAPI.Enum.ShapeTextWrapType` in facade code.
|
|
618
|
+
*/
|
|
619
|
+
textWrap?: ShapeTextWrapType;
|
|
620
|
+
/**
|
|
621
|
+
* Inner text margins of the shape text box, in px.
|
|
622
|
+
*
|
|
623
|
+
* Omitted sides keep their current resolved value.
|
|
624
|
+
*/
|
|
625
|
+
padding?: Partial<IShapeTextRectPadding>;
|
|
626
|
+
}
|
|
627
|
+
export interface IShapeTextBodyBehavior {
|
|
628
|
+
horizontalAnchor?: ShapeTextHorizontalAnchor;
|
|
629
|
+
textWrap?: ShapeTextWrapType;
|
|
630
|
+
autoFitType?: ShapeTextAutoFitType;
|
|
631
|
+
/**
|
|
632
|
+
* Legacy compatibility. New data should use `autoFitType`.
|
|
633
|
+
*/
|
|
634
|
+
autoFit?: boolean;
|
|
635
|
+
/**
|
|
636
|
+
* OOXML normAutofit fontScale. 100000 means 100%.
|
|
637
|
+
*/
|
|
638
|
+
fontScale?: number;
|
|
639
|
+
/**
|
|
640
|
+
* OOXML normAutofit lnSpcReduction.
|
|
641
|
+
*/
|
|
642
|
+
lineSpaceReduction?: number;
|
|
643
|
+
}
|
|
644
|
+
export interface IShapeText extends IShapeTextAlign, IShapeTextBodyBehavior {
|
|
566
645
|
isRichText: false;
|
|
567
646
|
text?: string;
|
|
568
647
|
color?: string;
|
|
@@ -572,9 +651,20 @@ export interface IShapeText extends IShapeTextAlign {
|
|
|
572
651
|
italic?: boolean;
|
|
573
652
|
underline?: boolean;
|
|
574
653
|
}
|
|
575
|
-
export interface
|
|
576
|
-
|
|
654
|
+
export interface IShapeTextDataModel {
|
|
655
|
+
doc?: IDocumentData;
|
|
656
|
+
ha?: HorizontalAlign;
|
|
657
|
+
va?: VerticalAlign;
|
|
658
|
+
}
|
|
659
|
+
export interface ICustomShapeTextData extends IShapeTextAlign, IShapeTextBodyBehavior {
|
|
660
|
+
/**
|
|
661
|
+
* Plain-text summary used by search, measurement, fallback rendering, and
|
|
662
|
+
* product-level display. Formatted content lives in `dataModel.doc`.
|
|
663
|
+
*/
|
|
664
|
+
text?: string;
|
|
665
|
+
dataModel?: IShapeTextDataModel;
|
|
577
666
|
}
|
|
667
|
+
export type IShapeTextData = IShapeText | ICustomShapeTextData;
|
|
578
668
|
/**
|
|
579
669
|
* A shape outer-shadow effect. Distances and blur radius use slide drawing
|
|
580
670
|
* units; direction is in degrees where 0 points right and 90 points down.
|
|
@@ -596,6 +686,12 @@ export interface IShapeShadowEffect {
|
|
|
596
686
|
sx?: number;
|
|
597
687
|
/** Vertical shadow scale factor; 1 means 100%. */
|
|
598
688
|
sy?: number;
|
|
689
|
+
/** Horizontal shadow skew angle in degrees. */
|
|
690
|
+
skewX?: number;
|
|
691
|
+
/** Vertical shadow skew angle in degrees. */
|
|
692
|
+
skewY?: number;
|
|
693
|
+
/** Alignment point used while scaling or skewing the shadow. */
|
|
694
|
+
alignment?: ShapeShadowAlignment;
|
|
599
695
|
/** Whether the shadow rotates together with the shape. */
|
|
600
696
|
rotateWithShape?: boolean;
|
|
601
697
|
}
|
|
@@ -669,7 +765,7 @@ export interface IBasicShapeData {
|
|
|
669
765
|
customGeometry?: IPresetShapeConfig;
|
|
670
766
|
/** Basic outer shadow effect applied while rendering the shape path. */
|
|
671
767
|
outerShadow?: IShapeShadowEffect;
|
|
672
|
-
shapeText?:
|
|
768
|
+
shapeText?: IShapeTextData;
|
|
673
769
|
/**
|
|
674
770
|
* Text box inset used to calculate the editable/rendered text rect.
|
|
675
771
|
* Values use the same drawing units as the shape rect.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IShapeSnapshot, IShapeUpdateInput } from '../services/shape-host-adapter.service';
|
|
2
|
+
import type { IConnectPointInfo, IShapePoint, IShapeRelation } from '../shape-type';
|
|
3
|
+
/** Resolves a Shape connection site into document coordinates. */
|
|
4
|
+
export declare function resolveShapeConnectionPoint(snapshot: IShapeSnapshot, connectionSiteIndex: number): IConnectPointInfo | null;
|
|
5
|
+
/** Resolves every Connector path point into document coordinates. */
|
|
6
|
+
export declare function resolveConnectorRoutePoints(snapshot: IShapeSnapshot): IShapePoint[];
|
|
7
|
+
/** Creates routing metadata for a free Connector endpoint. */
|
|
8
|
+
export declare function createFreeConnectorPointInfo(connectedPoint: IShapePoint, freePoint: IShapePoint): IConnectPointInfo;
|
|
9
|
+
/**
|
|
10
|
+
* Builds one complete Connector update from resolved endpoint routing metadata.
|
|
11
|
+
* The returned patch updates geometry, transform, relation, and Connector preset atomically.
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildConnectorEndpointUpdate(snapshot: IShapeSnapshot, start: IConnectPointInfo, end: IConnectPointInfo, relation?: IShapeRelation): IShapeUpdateInput | null;
|
|
14
|
+
/** Builds one complete Connector update from document-coordinate route points. */
|
|
15
|
+
export declare function buildConnectorRoutePointsUpdate(snapshot: IShapeSnapshot, routePoints: IShapePoint[], relation?: IShapeRelation): IShapeUpdateInput | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IShapeShadowEffect } from '../shape-type';
|
|
2
|
+
export interface IResolvedShapeShadow {
|
|
3
|
+
shadowColor: string;
|
|
4
|
+
shadowBlur: number;
|
|
5
|
+
shadowOffsetX: number;
|
|
6
|
+
shadowOffsetY: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function resolveShapeShadow(effect: IShapeShadowEffect | undefined): IResolvedShapeShadow | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IShapeData, IShapeTextBoxOptions, IShapeTextRectPadding, ShapeTextHorizontalAnchor } from '../shape-type';
|
|
2
|
+
import { ShapeTextAutoFitType, ShapeTextDirection, ShapeTextWrapType } from '../shape-type';
|
|
3
|
+
export interface IResolvedShapeTextBodyBehavior {
|
|
4
|
+
autoFitType: ShapeTextAutoFitType;
|
|
5
|
+
fontScale?: number;
|
|
6
|
+
horizontalAnchor?: ShapeTextHorizontalAnchor;
|
|
7
|
+
isTextBox: boolean;
|
|
8
|
+
lineSpaceReduction?: number;
|
|
9
|
+
textRectPadding: IShapeTextRectPadding;
|
|
10
|
+
textWrap: ShapeTextWrapType;
|
|
11
|
+
}
|
|
12
|
+
export interface IResolvedShapeTextBoxOptions {
|
|
13
|
+
textDirection: ShapeTextDirection;
|
|
14
|
+
autoFitType: ShapeTextAutoFitType;
|
|
15
|
+
textWrap: ShapeTextWrapType;
|
|
16
|
+
padding: IShapeTextRectPadding;
|
|
17
|
+
}
|
|
18
|
+
export declare function resolveShapeTextBodyBehavior(shapeData: IShapeData): IResolvedShapeTextBodyBehavior;
|
|
19
|
+
export declare function resolveShapeTextBoxOptions(shapeData: IShapeData): IResolvedShapeTextBoxOptions;
|
|
20
|
+
export declare function applyShapeTextBoxOptions<T extends IShapeData>(shapeData: T, options: IShapeTextBoxOptions): T;
|
|
21
|
+
export declare function shouldUseFullShapeTextRectForAutoFit(shapeData: IShapeData): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IDocumentData, ITextStyle } from '@univerjs/core';
|
|
2
|
+
import type { ICustomShapeTextData, IShapeData, IShapeTextData } from '../shape-type';
|
|
3
|
+
import { HorizontalAlign, RichTextValue, VerticalAlign } from '@univerjs/core';
|
|
4
|
+
export interface IShapeTextAlignmentOptions {
|
|
5
|
+
horizontalAlign?: HorizontalAlign;
|
|
6
|
+
verticalAlign?: VerticalAlign;
|
|
7
|
+
}
|
|
8
|
+
export declare function applyShapeTextAlignment(shapeData: IShapeData, options: IShapeTextAlignmentOptions): IShapeData;
|
|
9
|
+
export declare function shapeTextToRichTextValue(shapeText: IShapeTextData | undefined): RichTextValue | null;
|
|
10
|
+
export declare function applyRichTextToShapeText(current: IShapeTextData | undefined, richText: RichTextValue): ICustomShapeTextData;
|
|
11
|
+
export declare function applyTextToShapeText(current: IShapeTextData | undefined, text: string): ICustomShapeTextData;
|
|
12
|
+
export declare function applyShapeTextStyle(current: IShapeTextData | undefined, style: ITextStyle): ICustomShapeTextData;
|
|
13
|
+
export declare function applyDocumentToShapeText(current: IShapeTextData | undefined, documentData: IDocumentData): ICustomShapeTextData;
|
|
14
|
+
export declare function normalizeShapeTextData(shapeText: IShapeTextData | undefined): ICustomShapeTextData | null;
|