microboard-temp 0.14.16 → 0.14.18
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/dist/cjs/browser.js +281 -55
- package/dist/cjs/index.js +281 -55
- package/dist/cjs/node.js +281 -55
- package/dist/esm/browser.js +281 -55
- package/dist/esm/index.js +281 -55
- package/dist/esm/node.js +281 -55
- package/dist/types/Board.d.ts +5 -0
- package/dist/types/Import/Miro/MiroItemConverter.d.ts +43 -0
- package/dist/types/Items/AINode/AINode.d.ts +1 -0
- package/dist/types/Items/Dice/DiceOverlay.d.ts +1 -1
- package/dist/types/Items/Group/Group.d.ts +3 -0
- package/dist/types/Items/Image/Image.d.ts +1 -0
- package/dist/types/Items/RichText/RichTextOverlay.d.ts +1 -1
- package/dist/types/Items/RichText/index.d.ts +1 -0
- package/dist/types/Items/Shape/ShapeOverlay.d.ts +1 -1
- package/dist/types/Items/Video/Video.d.ts +1 -0
- package/dist/types/Overlay/OverlayIcons.d.ts +12 -0
- package/dist/types/Overlay/index.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -11491,6 +11491,28 @@ function toLocalTransformOp(op, containerMatrix, itemId) {
|
|
|
11491
11491
|
return op;
|
|
11492
11492
|
}
|
|
11493
11493
|
}
|
|
11494
|
+
// src/Overlay/OverlayIcons.ts
|
|
11495
|
+
var OVERLAY_SYMBOL_KEYS = {
|
|
11496
|
+
styleFill: "style.fill",
|
|
11497
|
+
styleStroke: "style.stroke",
|
|
11498
|
+
styleColor: "style.color",
|
|
11499
|
+
styleFontSize: "style.fontSize"
|
|
11500
|
+
};
|
|
11501
|
+
function symbolIcon(key, state) {
|
|
11502
|
+
return state ? { kind: "symbol", key, state } : { kind: "symbol", key };
|
|
11503
|
+
}
|
|
11504
|
+
function styleFillIcon(state) {
|
|
11505
|
+
return symbolIcon(OVERLAY_SYMBOL_KEYS.styleFill, state);
|
|
11506
|
+
}
|
|
11507
|
+
function styleStrokeIcon(state) {
|
|
11508
|
+
return symbolIcon(OVERLAY_SYMBOL_KEYS.styleStroke, state);
|
|
11509
|
+
}
|
|
11510
|
+
function styleColorIcon(state) {
|
|
11511
|
+
return symbolIcon(OVERLAY_SYMBOL_KEYS.styleColor, state);
|
|
11512
|
+
}
|
|
11513
|
+
function styleFontSizeIcon(state) {
|
|
11514
|
+
return symbolIcon(OVERLAY_SYMBOL_KEYS.styleFontSize, state);
|
|
11515
|
+
}
|
|
11494
11516
|
// src/Overlay/overlayRegistry.ts
|
|
11495
11517
|
var itemOverlays = {};
|
|
11496
11518
|
var toolOverlays = {};
|
|
@@ -37528,7 +37550,7 @@ var richTextOverlay = {
|
|
|
37528
37550
|
{
|
|
37529
37551
|
id: "text.fontSize",
|
|
37530
37552
|
label: "Font size",
|
|
37531
|
-
icon:
|
|
37553
|
+
icon: styleFontSizeIcon(),
|
|
37532
37554
|
target: "each",
|
|
37533
37555
|
controls: [
|
|
37534
37556
|
{
|
|
@@ -43834,6 +43856,7 @@ class Group extends BaseItem {
|
|
|
43834
43856
|
transformationRenderBlock = undefined;
|
|
43835
43857
|
isLockedGroup = false;
|
|
43836
43858
|
static movingGroupId = null;
|
|
43859
|
+
static reparentingGroupId = null;
|
|
43837
43860
|
constructor(board, id = "") {
|
|
43838
43861
|
super(board, id);
|
|
43839
43862
|
this.index = new SimpleSpatialIndex(this.board.camera, this.board.pointer);
|
|
@@ -43899,6 +43922,23 @@ class Group extends BaseItem {
|
|
|
43899
43922
|
this.apply(operation);
|
|
43900
43923
|
}
|
|
43901
43924
|
}
|
|
43925
|
+
applyAddChildren(childIds) {
|
|
43926
|
+
Group.reparentingGroupId = this.getId();
|
|
43927
|
+
super.applyAddChildren(childIds);
|
|
43928
|
+
Group.reparentingGroupId = null;
|
|
43929
|
+
for (const child of this.index?.listAll() || []) {
|
|
43930
|
+
child.subject.publish(child);
|
|
43931
|
+
}
|
|
43932
|
+
}
|
|
43933
|
+
applyRemoveChildren(childIds) {
|
|
43934
|
+
Group.reparentingGroupId = this.getId();
|
|
43935
|
+
super.applyRemoveChildren(childIds);
|
|
43936
|
+
Group.reparentingGroupId = null;
|
|
43937
|
+
for (const childId of childIds) {
|
|
43938
|
+
const child = this.board.items.getById(childId);
|
|
43939
|
+
child?.subject.publish(child);
|
|
43940
|
+
}
|
|
43941
|
+
}
|
|
43902
43942
|
setId(id) {
|
|
43903
43943
|
this.id = id;
|
|
43904
43944
|
this.transformation.setId(id);
|
|
@@ -44007,12 +44047,12 @@ var COLOR_PALETTE = [
|
|
|
44007
44047
|
"#118AB2",
|
|
44008
44048
|
"#7B61FF"
|
|
44009
44049
|
];
|
|
44010
|
-
var
|
|
44050
|
+
var symbolIcon2 = (key) => ({ kind: "symbol", key });
|
|
44011
44051
|
var lineStyleOptions = ConnectorLineStyles.map((style) => ({
|
|
44012
44052
|
id: style,
|
|
44013
44053
|
label: style[0].toUpperCase() + style.slice(1),
|
|
44014
44054
|
value: style,
|
|
44015
|
-
icon:
|
|
44055
|
+
icon: symbolIcon2(`connector.lineStyle.${style}`)
|
|
44016
44056
|
}));
|
|
44017
44057
|
var lineWidthOptions = ConnectionLineWidths.map((width) => ({
|
|
44018
44058
|
id: `${width}`,
|
|
@@ -44023,13 +44063,13 @@ var pointerOptions = CONNECTOR_POINTER_TYPES.map((pointer) => ({
|
|
|
44023
44063
|
id: pointer,
|
|
44024
44064
|
label: pointer,
|
|
44025
44065
|
value: pointer,
|
|
44026
|
-
icon:
|
|
44066
|
+
icon: symbolIcon2(`connector.pointer.${pointer}`)
|
|
44027
44067
|
}));
|
|
44028
44068
|
var borderStyleOptions = ["solid", "dot", "dash", "longDash"].map((style) => ({
|
|
44029
44069
|
id: style,
|
|
44030
44070
|
label: style,
|
|
44031
44071
|
value: style,
|
|
44032
|
-
icon:
|
|
44072
|
+
icon: symbolIcon2(`stroke.${style}`)
|
|
44033
44073
|
}));
|
|
44034
44074
|
var connectorStyleControls = [
|
|
44035
44075
|
{
|
|
@@ -44084,7 +44124,7 @@ var connectorStyleControls = [
|
|
|
44084
44124
|
{
|
|
44085
44125
|
id: "smartJump",
|
|
44086
44126
|
label: "Smart jump",
|
|
44087
|
-
icon:
|
|
44127
|
+
icon: symbolIcon2("connector.smartJump"),
|
|
44088
44128
|
valueSource: { kind: "itemProperty", property: "smartJump" },
|
|
44089
44129
|
editor: { kind: "toggle", trueLabel: "On", falseLabel: "Off" },
|
|
44090
44130
|
invoke: { kind: "setProperty", property: "smartJump" }
|
|
@@ -44143,7 +44183,7 @@ var connectorToolControls = [
|
|
|
44143
44183
|
{
|
|
44144
44184
|
id: "toolSmartJump",
|
|
44145
44185
|
label: "Smart jump",
|
|
44146
|
-
icon:
|
|
44186
|
+
icon: symbolIcon2("connector.smartJump"),
|
|
44147
44187
|
valueSource: { kind: "toolProperty", property: "smartJump" },
|
|
44148
44188
|
editor: { kind: "toggle", trueLabel: "On", falseLabel: "Off" },
|
|
44149
44189
|
invoke: { kind: "toolProperty", property: "smartJump" }
|
|
@@ -44155,21 +44195,21 @@ var connectorOverlay = {
|
|
|
44155
44195
|
{
|
|
44156
44196
|
id: "connector.switchPointers",
|
|
44157
44197
|
label: "Switch arrows",
|
|
44158
|
-
icon:
|
|
44198
|
+
icon: symbolIcon2("connector.switchPointers"),
|
|
44159
44199
|
target: "selection",
|
|
44160
44200
|
invoke: { kind: "operation", class: "Connector", method: "switchPointers" }
|
|
44161
44201
|
},
|
|
44162
44202
|
{
|
|
44163
44203
|
id: "connector.style",
|
|
44164
44204
|
label: "Connector style",
|
|
44165
|
-
icon:
|
|
44205
|
+
icon: symbolIcon2("connector.style"),
|
|
44166
44206
|
target: "each",
|
|
44167
44207
|
controls: connectorStyleControls,
|
|
44168
44208
|
groups: [
|
|
44169
44209
|
{
|
|
44170
44210
|
id: "connectorStyle",
|
|
44171
44211
|
label: "Connector style",
|
|
44172
|
-
icon:
|
|
44212
|
+
icon: symbolIcon2("connector.style"),
|
|
44173
44213
|
controlIds: connectorStyleControls.map((control) => control.id)
|
|
44174
44214
|
}
|
|
44175
44215
|
]
|
|
@@ -44196,7 +44236,7 @@ var addConnectorToolOverlay = {
|
|
|
44196
44236
|
{
|
|
44197
44237
|
id: "connectorToolStyle",
|
|
44198
44238
|
label: "Connector defaults",
|
|
44199
|
-
icon:
|
|
44239
|
+
icon: symbolIcon2("connector.style"),
|
|
44200
44240
|
controlIds: connectorToolControls.map((control) => control.id)
|
|
44201
44241
|
}
|
|
44202
44242
|
]
|
|
@@ -44348,7 +44388,7 @@ class Connector2 extends BaseItem {
|
|
|
44348
44388
|
}
|
|
44349
44389
|
this.text = new RichText(this.board, this.id);
|
|
44350
44390
|
this.text.container = this.getMbr();
|
|
44351
|
-
this.text.transformation =
|
|
44391
|
+
this.text.transformation = this.transformation;
|
|
44352
44392
|
this.text.linkTo = this.linkTo;
|
|
44353
44393
|
this.text.placeholderText = conf.i18n.t("connector.textPlaceholder", {
|
|
44354
44394
|
ns: "default"
|
|
@@ -44393,6 +44433,10 @@ class Connector2 extends BaseItem {
|
|
|
44393
44433
|
observerStartPointItem = () => {
|
|
44394
44434
|
const point3 = this.startPoint;
|
|
44395
44435
|
if (point3.pointType !== "Board") {
|
|
44436
|
+
const reparentingGroupId = Group.reparentingGroupId;
|
|
44437
|
+
if (reparentingGroupId !== null && (this.parent === reparentingGroupId || point3.item instanceof BaseItem && point3.item.parent === reparentingGroupId)) {
|
|
44438
|
+
return;
|
|
44439
|
+
}
|
|
44396
44440
|
const movingGroupId = Group.movingGroupId;
|
|
44397
44441
|
if (movingGroupId !== null && this.parent === movingGroupId && point3.item instanceof BaseItem && point3.item.parent === movingGroupId) {
|
|
44398
44442
|
return;
|
|
@@ -44411,6 +44455,10 @@ class Connector2 extends BaseItem {
|
|
|
44411
44455
|
observerEndPointItem = () => {
|
|
44412
44456
|
const point3 = this.endPoint;
|
|
44413
44457
|
if (point3.pointType !== "Board") {
|
|
44458
|
+
const reparentingGroupId = Group.reparentingGroupId;
|
|
44459
|
+
if (reparentingGroupId !== null && (this.parent === reparentingGroupId || point3.item instanceof BaseItem && point3.item.parent === reparentingGroupId)) {
|
|
44460
|
+
return;
|
|
44461
|
+
}
|
|
44414
44462
|
const movingGroupId = Group.movingGroupId;
|
|
44415
44463
|
if (movingGroupId !== null && this.parent === movingGroupId && point3.item instanceof BaseItem && point3.item.parent === movingGroupId) {
|
|
44416
44464
|
return;
|
|
@@ -58334,7 +58382,7 @@ var inlineShapeAsset = (folder, file2 = folder) => ({
|
|
|
58334
58382
|
path: `src/Items/Shape/Basic/${folder}/${file2}.icon.svg`,
|
|
58335
58383
|
mimeType: "image/svg+xml"
|
|
58336
58384
|
});
|
|
58337
|
-
var
|
|
58385
|
+
var symbolIcon3 = (key) => ({ kind: "symbol", key });
|
|
58338
58386
|
var BASIC_INLINE_OPTIONS = [
|
|
58339
58387
|
{ id: "rectangle", label: "Rectangle", value: "Rectangle", icon: inlineShapeAsset("Rectangle") },
|
|
58340
58388
|
{ id: "rounded-rectangle", label: "Rounded rectangle", value: "RoundedRectangle", icon: inlineShapeAsset("RoundedRectangle") },
|
|
@@ -58344,48 +58392,48 @@ var BASIC_INLINE_OPTIONS = [
|
|
|
58344
58392
|
];
|
|
58345
58393
|
var SHAPE_CATALOG_OPTIONS = [
|
|
58346
58394
|
...BASIC_INLINE_OPTIONS,
|
|
58347
|
-
{ id: "reversed-triangle", label: "Reversed triangle", value: "ReversedTriangle", icon:
|
|
58395
|
+
{ id: "reversed-triangle", label: "Reversed triangle", value: "ReversedTriangle", icon: symbolIcon3("shape.reversedTriangle") },
|
|
58348
58396
|
{ id: "arrow-left", label: "Arrow left", value: "ArrowLeft", icon: inlineShapeAsset("ArrowLeft") },
|
|
58349
58397
|
{ id: "arrow-right", label: "Arrow right", value: "ArrowRight", icon: inlineShapeAsset("ArrowRight") },
|
|
58350
58398
|
{ id: "arrow-left-right", label: "Arrow left right", value: "ArrowLeftRight", icon: inlineShapeAsset("ArrowLeftRight") },
|
|
58351
|
-
{ id: "arrow-block-left", label: "Arrow block left", value: "ArrowBlockLeft", icon:
|
|
58352
|
-
{ id: "arrow-block-right", label: "Arrow block right", value: "ArrowBlockRight", icon:
|
|
58399
|
+
{ id: "arrow-block-left", label: "Arrow block left", value: "ArrowBlockLeft", icon: symbolIcon3("shape.arrowBlockLeft") },
|
|
58400
|
+
{ id: "arrow-block-right", label: "Arrow block right", value: "ArrowBlockRight", icon: symbolIcon3("shape.arrowBlockRight") },
|
|
58353
58401
|
{ id: "cloud", label: "Cloud", value: "Cloud", icon: inlineShapeAsset("Cloud") },
|
|
58354
58402
|
{ id: "cross", label: "Cross", value: "Cross", icon: inlineShapeAsset("Cross") },
|
|
58355
58403
|
{ id: "cylinder", label: "Cylinder", value: "Cylinder", icon: inlineShapeAsset("Cylinder") },
|
|
58356
58404
|
{ id: "hexagon", label: "Hexagon", value: "Hexagon", icon: inlineShapeAsset("Hexagon") },
|
|
58357
58405
|
{ id: "octagon", label: "Octagon", value: "Octagon", icon: inlineShapeAsset("Octagon") },
|
|
58358
58406
|
{ id: "parallelogram", label: "Parallelogram", value: "Parallelogram", icon: inlineShapeAsset("Parallelogram") },
|
|
58359
|
-
{ id: "reversed-parallelogram", label: "Reversed parallelogram", value: "ReversedParallelogram", icon:
|
|
58407
|
+
{ id: "reversed-parallelogram", label: "Reversed parallelogram", value: "ReversedParallelogram", icon: symbolIcon3("shape.reversedParallelogram") },
|
|
58360
58408
|
{ id: "pentagon", label: "Pentagon", value: "Pentagon", icon: inlineShapeAsset("Pentagon") },
|
|
58361
|
-
{ id: "predefined-process", label: "Predefined process", value: "PredefinedProcess", icon:
|
|
58409
|
+
{ id: "predefined-process", label: "Predefined process", value: "PredefinedProcess", icon: symbolIcon3("shape.predefinedProcess") },
|
|
58362
58410
|
{ id: "speech-bubble", label: "Speech bubble", value: "SpeachBubble", icon: inlineShapeAsset("SpeachBubble") },
|
|
58363
58411
|
{ id: "star", label: "Star", value: "Star", icon: inlineShapeAsset("Star") },
|
|
58364
58412
|
{ id: "trapezoid", label: "Trapezoid", value: "Trapezoid", icon: inlineShapeAsset("Trapezoid") },
|
|
58365
58413
|
{ id: "braces-left", label: "Braces left", value: "BracesLeft", icon: inlineShapeAsset("BracesLeft", "BracesLeft") },
|
|
58366
58414
|
{ id: "braces-right", label: "Braces right", value: "BracesRight", icon: inlineShapeAsset("BracesRight", "BracesRight") },
|
|
58367
|
-
{ id: "bpmn-task", label: "BPMN task", value: "BPMN_Task", icon:
|
|
58368
|
-
{ id: "bpmn-gateway", label: "BPMN gateway", value: "BPMN_Gateway", icon:
|
|
58369
|
-
{ id: "bpmn-gateway-parallel", label: "BPMN gateway parallel", value: "BPMN_GatewayParallel", icon:
|
|
58370
|
-
{ id: "bpmn-gateway-xor", label: "BPMN gateway XOR", value: "BPMN_GatewayXOR", icon:
|
|
58371
|
-
{ id: "bpmn-start-event", label: "BPMN start event", value: "BPMN_StartEvent", icon:
|
|
58372
|
-
{ id: "bpmn-start-event-non-interrupting", label: "BPMN start event non interrupting", value: "BPMN_StartEventNoneInterrupting", icon:
|
|
58373
|
-
{ id: "bpmn-end-event", label: "BPMN end event", value: "BPMN_EndEvent", icon:
|
|
58374
|
-
{ id: "bpmn-intermediate-event", label: "BPMN intermediate event", value: "BPMN_IntermediateEvent", icon:
|
|
58375
|
-
{ id: "bpmn-intermediate-event-none-interrupting", label: "BPMN intermediate event none interrupting", value: "BPMN_IntermediateEventNoneInterrupting", icon:
|
|
58376
|
-
{ id: "bpmn-data-object", label: "BPMN data object", value: "BPMN_DataObject", icon:
|
|
58377
|
-
{ id: "bpmn-data-store", label: "BPMN data store", value: "BPMN_DataStore", icon:
|
|
58378
|
-
{ id: "bpmn-participant", label: "BPMN participant", value: "BPMN_Participant", icon:
|
|
58379
|
-
{ id: "bpmn-transaction", label: "BPMN transaction", value: "BPMN_Transaction", icon:
|
|
58380
|
-
{ id: "bpmn-event-subprocess", label: "BPMN event subprocess", value: "BPMN_EventSubprocess", icon:
|
|
58381
|
-
{ id: "bpmn-group", label: "BPMN group", value: "BPMN_Group", icon:
|
|
58382
|
-
{ id: "bpmn-annotation", label: "BPMN annotation", value: "BPMN_Annotation", icon:
|
|
58415
|
+
{ id: "bpmn-task", label: "BPMN task", value: "BPMN_Task", icon: symbolIcon3("shape.bpmn.task") },
|
|
58416
|
+
{ id: "bpmn-gateway", label: "BPMN gateway", value: "BPMN_Gateway", icon: symbolIcon3("shape.bpmn.gateway") },
|
|
58417
|
+
{ id: "bpmn-gateway-parallel", label: "BPMN gateway parallel", value: "BPMN_GatewayParallel", icon: symbolIcon3("shape.bpmn.gatewayParallel") },
|
|
58418
|
+
{ id: "bpmn-gateway-xor", label: "BPMN gateway XOR", value: "BPMN_GatewayXOR", icon: symbolIcon3("shape.bpmn.gatewayXor") },
|
|
58419
|
+
{ id: "bpmn-start-event", label: "BPMN start event", value: "BPMN_StartEvent", icon: symbolIcon3("shape.bpmn.startEvent") },
|
|
58420
|
+
{ id: "bpmn-start-event-non-interrupting", label: "BPMN start event non interrupting", value: "BPMN_StartEventNoneInterrupting", icon: symbolIcon3("shape.bpmn.startEventNoneInterrupting") },
|
|
58421
|
+
{ id: "bpmn-end-event", label: "BPMN end event", value: "BPMN_EndEvent", icon: symbolIcon3("shape.bpmn.endEvent") },
|
|
58422
|
+
{ id: "bpmn-intermediate-event", label: "BPMN intermediate event", value: "BPMN_IntermediateEvent", icon: symbolIcon3("shape.bpmn.intermediateEvent") },
|
|
58423
|
+
{ id: "bpmn-intermediate-event-none-interrupting", label: "BPMN intermediate event none interrupting", value: "BPMN_IntermediateEventNoneInterrupting", icon: symbolIcon3("shape.bpmn.intermediateEventNoneInterrupting") },
|
|
58424
|
+
{ id: "bpmn-data-object", label: "BPMN data object", value: "BPMN_DataObject", icon: symbolIcon3("shape.bpmn.dataObject") },
|
|
58425
|
+
{ id: "bpmn-data-store", label: "BPMN data store", value: "BPMN_DataStore", icon: symbolIcon3("shape.bpmn.dataStore") },
|
|
58426
|
+
{ id: "bpmn-participant", label: "BPMN participant", value: "BPMN_Participant", icon: symbolIcon3("shape.bpmn.participant") },
|
|
58427
|
+
{ id: "bpmn-transaction", label: "BPMN transaction", value: "BPMN_Transaction", icon: symbolIcon3("shape.bpmn.transaction") },
|
|
58428
|
+
{ id: "bpmn-event-subprocess", label: "BPMN event subprocess", value: "BPMN_EventSubprocess", icon: symbolIcon3("shape.bpmn.eventSubprocess") },
|
|
58429
|
+
{ id: "bpmn-group", label: "BPMN group", value: "BPMN_Group", icon: symbolIcon3("shape.bpmn.group") },
|
|
58430
|
+
{ id: "bpmn-annotation", label: "BPMN annotation", value: "BPMN_Annotation", icon: symbolIcon3("shape.bpmn.annotation") }
|
|
58383
58431
|
];
|
|
58384
58432
|
var BORDER_STYLE_OPTIONS = [
|
|
58385
|
-
{ id: "solid", label: "Solid", value: "solid", icon:
|
|
58386
|
-
{ id: "dot", label: "Dot", value: "dot", icon:
|
|
58387
|
-
{ id: "dash", label: "Dash", value: "dash", icon:
|
|
58388
|
-
{ id: "long-dash", label: "Long dash", value: "longDash", icon:
|
|
58433
|
+
{ id: "solid", label: "Solid", value: "solid", icon: symbolIcon3("stroke.solid") },
|
|
58434
|
+
{ id: "dot", label: "Dot", value: "dot", icon: symbolIcon3("stroke.dot") },
|
|
58435
|
+
{ id: "dash", label: "Dash", value: "dash", icon: symbolIcon3("stroke.dash") },
|
|
58436
|
+
{ id: "long-dash", label: "Long dash", value: "longDash", icon: symbolIcon3("stroke.longDash") }
|
|
58389
58437
|
];
|
|
58390
58438
|
var shapeTypeControl = {
|
|
58391
58439
|
id: "shapeType",
|
|
@@ -58408,14 +58456,10 @@ var fillControl = {
|
|
|
58408
58456
|
id: "backgroundColor",
|
|
58409
58457
|
label: "Fill",
|
|
58410
58458
|
valueSource: { kind: "itemProperty", property: "backgroundColor" },
|
|
58411
|
-
icon: {
|
|
58412
|
-
kind: "
|
|
58413
|
-
|
|
58414
|
-
|
|
58415
|
-
swatch: { kind: "itemProperty", property: "backgroundColor" },
|
|
58416
|
-
note: "UI can render the current fill color as a swatch inside the icon."
|
|
58417
|
-
}
|
|
58418
|
-
},
|
|
58459
|
+
icon: styleFillIcon({
|
|
58460
|
+
swatch: { kind: "itemProperty", property: "backgroundColor" },
|
|
58461
|
+
note: "UI can render the current fill color as a swatch inside the icon."
|
|
58462
|
+
}),
|
|
58419
58463
|
editor: {
|
|
58420
58464
|
kind: "color",
|
|
58421
58465
|
palette: COLOR_PALETTE2,
|
|
@@ -58466,7 +58510,7 @@ var shapeOverlay = {
|
|
|
58466
58510
|
{
|
|
58467
58511
|
id: "shape.shapeType",
|
|
58468
58512
|
label: "Shape type",
|
|
58469
|
-
icon:
|
|
58513
|
+
icon: symbolIcon3("shape.type"),
|
|
58470
58514
|
target: "each",
|
|
58471
58515
|
controls: [shapeTypeControl]
|
|
58472
58516
|
},
|
|
@@ -58480,14 +58524,14 @@ var shapeOverlay = {
|
|
|
58480
58524
|
{
|
|
58481
58525
|
id: "shape.strokeStyle",
|
|
58482
58526
|
label: "Stroke style",
|
|
58483
|
-
icon:
|
|
58527
|
+
icon: styleStrokeIcon(),
|
|
58484
58528
|
target: "each",
|
|
58485
58529
|
controls: strokeControls,
|
|
58486
58530
|
groups: [
|
|
58487
58531
|
{
|
|
58488
58532
|
id: "shapeStrokeStyle",
|
|
58489
58533
|
label: "Stroke style",
|
|
58490
|
-
icon:
|
|
58534
|
+
icon: styleStrokeIcon(),
|
|
58491
58535
|
controlIds: strokeControls.map((control) => control.id)
|
|
58492
58536
|
}
|
|
58493
58537
|
]
|
|
@@ -61853,6 +61897,9 @@ class AINode extends BaseItem {
|
|
|
61853
61897
|
getLinkTo() {
|
|
61854
61898
|
return this.linkTo.link;
|
|
61855
61899
|
}
|
|
61900
|
+
getRichText() {
|
|
61901
|
+
return this.text;
|
|
61902
|
+
}
|
|
61856
61903
|
renderButton(context) {
|
|
61857
61904
|
const { left, right, top, bottom } = this.buttonMbr;
|
|
61858
61905
|
const { ctx } = context;
|
|
@@ -63858,11 +63905,9 @@ var diceOverlay = {
|
|
|
63858
63905
|
{
|
|
63859
63906
|
id: "dice.fill",
|
|
63860
63907
|
label: "Fill",
|
|
63861
|
-
icon: {
|
|
63862
|
-
kind: "
|
|
63863
|
-
|
|
63864
|
-
state: { swatch: { kind: "itemProperty", property: "backgroundColor" } }
|
|
63865
|
-
},
|
|
63908
|
+
icon: styleFillIcon({
|
|
63909
|
+
swatch: { kind: "itemProperty", property: "backgroundColor" }
|
|
63910
|
+
}),
|
|
63866
63911
|
target: "each",
|
|
63867
63912
|
controls: [
|
|
63868
63913
|
{
|
|
@@ -74115,7 +74160,10 @@ class Board {
|
|
|
74115
74160
|
return parseHTML(el);
|
|
74116
74161
|
}
|
|
74117
74162
|
add(item, timeStamp) {
|
|
74118
|
-
const id = this.getNewItemId();
|
|
74163
|
+
const id = item.getId() || this.getNewItemId();
|
|
74164
|
+
if (!item.getId()) {
|
|
74165
|
+
item.setId(id);
|
|
74166
|
+
}
|
|
74119
74167
|
this.emit({
|
|
74120
74168
|
class: "Board",
|
|
74121
74169
|
method: "add",
|
|
@@ -74130,6 +74178,17 @@ class Board {
|
|
|
74130
74178
|
this.handleNesting(newItem);
|
|
74131
74179
|
return newItem;
|
|
74132
74180
|
}
|
|
74181
|
+
createItemAndAdd(itemType, data, timeStamp) {
|
|
74182
|
+
const id = data.id || this.getNewItemId();
|
|
74183
|
+
const fullData = { ...data, itemType, id };
|
|
74184
|
+
const item = this.createItem(id, fullData);
|
|
74185
|
+
if (item.itemType === "Connector" && data.startPoint && data.endPoint) {
|
|
74186
|
+
const conn = item;
|
|
74187
|
+
conn.apply({ class: "Connector", method: "setStartPoint", startPointData: data.startPoint });
|
|
74188
|
+
conn.apply({ class: "Connector", method: "setEndPoint", endPointData: data.endPoint });
|
|
74189
|
+
}
|
|
74190
|
+
return this.add(item, timeStamp);
|
|
74191
|
+
}
|
|
74133
74192
|
addLockedGroup(items) {
|
|
74134
74193
|
const id = this.getNewItemId();
|
|
74135
74194
|
const groupData = {
|
|
@@ -74999,6 +75058,165 @@ function validateTransformationData(transformationData) {
|
|
|
74999
75058
|
function validatePointData(pointData) {
|
|
75000
75059
|
return PointSchema.safeParse(pointData).success;
|
|
75001
75060
|
}
|
|
75061
|
+
// src/Import/Miro/MiroItemConverter.ts
|
|
75062
|
+
var SHAPE_TYPES = {
|
|
75063
|
+
round_rectangle: "RoundedRectangle",
|
|
75064
|
+
circle: "Circle",
|
|
75065
|
+
triangle: "Triangle",
|
|
75066
|
+
rhombus: "Rhombus",
|
|
75067
|
+
wedge_round_rectangle_callout: "SpeachBubble",
|
|
75068
|
+
parallelogram: "Parallelogram",
|
|
75069
|
+
star: "Star",
|
|
75070
|
+
right_arrow: "ArrowRight",
|
|
75071
|
+
left_arrow: "ArrowLeft",
|
|
75072
|
+
rectangle: "Rectangle",
|
|
75073
|
+
left_right_arrow: "ArrowLeftRight",
|
|
75074
|
+
pentagon: "Pentagon",
|
|
75075
|
+
octagon: "Octagon",
|
|
75076
|
+
hexagon: "Hexagon",
|
|
75077
|
+
flow_chart_predefined_process: "PredefinedProcess",
|
|
75078
|
+
trapezoid: "Trapezoid",
|
|
75079
|
+
cloud: "Cloud",
|
|
75080
|
+
cross: "Cross",
|
|
75081
|
+
can: "Cylinder",
|
|
75082
|
+
left_brace: "BracesRight",
|
|
75083
|
+
right_brace: "BracesLeft"
|
|
75084
|
+
};
|
|
75085
|
+
var BORDER_STYLES = {
|
|
75086
|
+
normal: "solid",
|
|
75087
|
+
dotted: "dot",
|
|
75088
|
+
dashed: "dash"
|
|
75089
|
+
};
|
|
75090
|
+
var STICKER_COLOR_MAP = {
|
|
75091
|
+
dark_blue: 2,
|
|
75092
|
+
blue: 2,
|
|
75093
|
+
light_blue: 3,
|
|
75094
|
+
red: 1,
|
|
75095
|
+
orange: 6,
|
|
75096
|
+
violet: 0,
|
|
75097
|
+
pink: 1,
|
|
75098
|
+
light_pink: 1,
|
|
75099
|
+
cyan: 5,
|
|
75100
|
+
dark_green: 4,
|
|
75101
|
+
green: 4,
|
|
75102
|
+
light_green: 4,
|
|
75103
|
+
yellow: 7,
|
|
75104
|
+
light_yellow: 7,
|
|
75105
|
+
gray: 8,
|
|
75106
|
+
black: 9
|
|
75107
|
+
};
|
|
75108
|
+
var FRAME_TYPES2 = {
|
|
75109
|
+
custom: "Custom",
|
|
75110
|
+
a4: "A4",
|
|
75111
|
+
letter: "Letter",
|
|
75112
|
+
ratio_16x9: "Frame16x9",
|
|
75113
|
+
ratio_4x3: "Frame4x3",
|
|
75114
|
+
ratio_1x1: "Frame1x1",
|
|
75115
|
+
phone: "Custom",
|
|
75116
|
+
tablet: "Custom",
|
|
75117
|
+
desktop: "Custom"
|
|
75118
|
+
};
|
|
75119
|
+
var CONNECTOR_LINE_STYLES = {
|
|
75120
|
+
straight: "straight",
|
|
75121
|
+
curved: "curved",
|
|
75122
|
+
elbowed: "orthogonal"
|
|
75123
|
+
};
|
|
75124
|
+
var CONNECTOR_POINTER_STYLES = {
|
|
75125
|
+
stealth: "ArrowBroad",
|
|
75126
|
+
"Arc Arrow": "ArrowThin",
|
|
75127
|
+
filled_triangle: "Angle",
|
|
75128
|
+
arrow: "ArrowThin",
|
|
75129
|
+
triangle: "TriangleEmpty",
|
|
75130
|
+
filled_diamond: "DiamondFilled",
|
|
75131
|
+
diamond: "DiamondEmpty",
|
|
75132
|
+
filled_oval: "CircleFilled",
|
|
75133
|
+
oval: "Zero",
|
|
75134
|
+
erd_one: "One",
|
|
75135
|
+
erd_many: "Many",
|
|
75136
|
+
erd_one_or_many: "ManyMandatory",
|
|
75137
|
+
erd_only_one: "OneMandatory",
|
|
75138
|
+
erd_zero_or_many: "ManyOptional",
|
|
75139
|
+
erd_zero_or_one: "OneOptional"
|
|
75140
|
+
};
|
|
75141
|
+
|
|
75142
|
+
class MiroItemConverter {
|
|
75143
|
+
static convert(miroItem) {
|
|
75144
|
+
const { type, style: style2, data, geometry, position: position4, id, linkTo, parent } = miroItem;
|
|
75145
|
+
const baseData = {
|
|
75146
|
+
id,
|
|
75147
|
+
parent: parent?.id || "Board",
|
|
75148
|
+
linkTo
|
|
75149
|
+
};
|
|
75150
|
+
switch (type) {
|
|
75151
|
+
case "shape":
|
|
75152
|
+
return {
|
|
75153
|
+
...baseData,
|
|
75154
|
+
itemType: "Shape",
|
|
75155
|
+
shapeType: SHAPE_TYPES[data?.shape] || "Rectangle",
|
|
75156
|
+
backgroundColor: MiroItemConverter.convertColor(style2?.fillColor, "transparent"),
|
|
75157
|
+
backgroundOpacity: style2?.fillOpacity ? parseFloat(style2.fillOpacity) : 1,
|
|
75158
|
+
borderColor: MiroItemConverter.convertColor(style2?.borderColor),
|
|
75159
|
+
borderOpacity: style2?.borderOpacity ? parseFloat(style2.borderOpacity) : 1,
|
|
75160
|
+
borderStyle: BORDER_STYLES[style2?.borderStyle || "normal"] || "solid",
|
|
75161
|
+
borderWidth: style2?.borderWidth ? parseFloat(style2.borderWidth) : 2
|
|
75162
|
+
};
|
|
75163
|
+
case "sticky_note":
|
|
75164
|
+
const colorIdx = STICKER_COLOR_MAP[style2?.fillColor || "yellow"] ?? 7;
|
|
75165
|
+
return {
|
|
75166
|
+
...baseData,
|
|
75167
|
+
itemType: "Sticker",
|
|
75168
|
+
backgroundColor: coerceColorValue(conf.STICKER_COLORS[colorIdx])
|
|
75169
|
+
};
|
|
75170
|
+
case "text":
|
|
75171
|
+
return {
|
|
75172
|
+
...baseData,
|
|
75173
|
+
itemType: "RichText"
|
|
75174
|
+
};
|
|
75175
|
+
case "frame":
|
|
75176
|
+
return {
|
|
75177
|
+
...baseData,
|
|
75178
|
+
itemType: "Frame",
|
|
75179
|
+
title: data?.title || "Frame",
|
|
75180
|
+
frameType: FRAME_TYPES2[data?.format] || "Custom",
|
|
75181
|
+
backgroundColor: MiroItemConverter.convertColor(style2?.fillColor)
|
|
75182
|
+
};
|
|
75183
|
+
case "connector":
|
|
75184
|
+
return {
|
|
75185
|
+
...baseData,
|
|
75186
|
+
itemType: "Connector",
|
|
75187
|
+
lineColor: MiroItemConverter.convertColor(style2?.strokeColor),
|
|
75188
|
+
lineStyle: CONNECTOR_LINE_STYLES[miroItem.shape || "straight"] || "straight",
|
|
75189
|
+
lineWidth: style2?.strokeWidth ? parseFloat(style2.strokeWidth) : 1,
|
|
75190
|
+
startPointerStyle: CONNECTOR_POINTER_STYLES[style2?.startStrokeCap || ""] || "None",
|
|
75191
|
+
endPointerStyle: CONNECTOR_POINTER_STYLES[style2?.endStrokeCap || ""] || "ArrowThin"
|
|
75192
|
+
};
|
|
75193
|
+
case "image":
|
|
75194
|
+
return {
|
|
75195
|
+
...baseData,
|
|
75196
|
+
itemType: "Image"
|
|
75197
|
+
};
|
|
75198
|
+
case "paint":
|
|
75199
|
+
return {
|
|
75200
|
+
...baseData,
|
|
75201
|
+
itemType: "Drawing",
|
|
75202
|
+
strokeColor: MiroItemConverter.convertColor(style2?.color),
|
|
75203
|
+
strokeWidth: style2?.strokeWidth ? parseFloat(style2.strokeWidth) : 2,
|
|
75204
|
+
strokeOpacity: style2?.strokeOpacity ?? 1
|
|
75205
|
+
};
|
|
75206
|
+
default:
|
|
75207
|
+
return {
|
|
75208
|
+
...baseData,
|
|
75209
|
+
itemType: "Placeholder"
|
|
75210
|
+
};
|
|
75211
|
+
}
|
|
75212
|
+
}
|
|
75213
|
+
static convertColor(color2, fallback = "black") {
|
|
75214
|
+
if (!color2)
|
|
75215
|
+
return coerceColorValue(fallback);
|
|
75216
|
+
const hex3 = color2 === "#ffffff" ? "transparent" : color2;
|
|
75217
|
+
return coerceColorValue(hex3);
|
|
75218
|
+
}
|
|
75219
|
+
}
|
|
75002
75220
|
// src/api/initI18N.ts
|
|
75003
75221
|
function initI18N(i18nInstance) {
|
|
75004
75222
|
conf.i18n = i18nInstance;
|
|
@@ -75026,6 +75244,11 @@ export {
|
|
|
75026
75244
|
toFiniteNumber,
|
|
75027
75245
|
tempStorage,
|
|
75028
75246
|
tagByType,
|
|
75247
|
+
symbolIcon,
|
|
75248
|
+
styleStrokeIcon,
|
|
75249
|
+
styleFontSizeIcon,
|
|
75250
|
+
styleFillIcon,
|
|
75251
|
+
styleColorIcon,
|
|
75029
75252
|
stickerColors,
|
|
75030
75253
|
srgbChannelToLinear,
|
|
75031
75254
|
sha256,
|
|
@@ -75152,6 +75375,8 @@ export {
|
|
|
75152
75375
|
PRESENCE_CURSOR_THROTTLE,
|
|
75153
75376
|
PRESENCE_CLEANUP_USER_TIMER,
|
|
75154
75377
|
PRESENCE_CLEANUP_IDLE_TIMER,
|
|
75378
|
+
OVERLAY_SYMBOL_KEYS,
|
|
75379
|
+
MiroItemConverter,
|
|
75155
75380
|
Mbr,
|
|
75156
75381
|
Matrix,
|
|
75157
75382
|
MIN_STROKE_WIDTH,
|
|
@@ -75180,6 +75405,7 @@ export {
|
|
|
75180
75405
|
Dice,
|
|
75181
75406
|
DefaultTransformationData,
|
|
75182
75407
|
DefaultShapeData,
|
|
75408
|
+
DefaultRichTextData,
|
|
75183
75409
|
DefaultPlaceholderData,
|
|
75184
75410
|
DefaultImageItemData,
|
|
75185
75411
|
DefaultGroupData,
|