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/browser.js
CHANGED
|
@@ -11498,6 +11498,28 @@ function toLocalTransformOp(op, containerMatrix, itemId) {
|
|
|
11498
11498
|
return op;
|
|
11499
11499
|
}
|
|
11500
11500
|
}
|
|
11501
|
+
// src/Overlay/OverlayIcons.ts
|
|
11502
|
+
var OVERLAY_SYMBOL_KEYS = {
|
|
11503
|
+
styleFill: "style.fill",
|
|
11504
|
+
styleStroke: "style.stroke",
|
|
11505
|
+
styleColor: "style.color",
|
|
11506
|
+
styleFontSize: "style.fontSize"
|
|
11507
|
+
};
|
|
11508
|
+
function symbolIcon(key, state) {
|
|
11509
|
+
return state ? { kind: "symbol", key, state } : { kind: "symbol", key };
|
|
11510
|
+
}
|
|
11511
|
+
function styleFillIcon(state) {
|
|
11512
|
+
return symbolIcon(OVERLAY_SYMBOL_KEYS.styleFill, state);
|
|
11513
|
+
}
|
|
11514
|
+
function styleStrokeIcon(state) {
|
|
11515
|
+
return symbolIcon(OVERLAY_SYMBOL_KEYS.styleStroke, state);
|
|
11516
|
+
}
|
|
11517
|
+
function styleColorIcon(state) {
|
|
11518
|
+
return symbolIcon(OVERLAY_SYMBOL_KEYS.styleColor, state);
|
|
11519
|
+
}
|
|
11520
|
+
function styleFontSizeIcon(state) {
|
|
11521
|
+
return symbolIcon(OVERLAY_SYMBOL_KEYS.styleFontSize, state);
|
|
11522
|
+
}
|
|
11501
11523
|
// src/Overlay/overlayRegistry.ts
|
|
11502
11524
|
var itemOverlays = {};
|
|
11503
11525
|
var toolOverlays = {};
|
|
@@ -37535,7 +37557,7 @@ var richTextOverlay = {
|
|
|
37535
37557
|
{
|
|
37536
37558
|
id: "text.fontSize",
|
|
37537
37559
|
label: "Font size",
|
|
37538
|
-
icon:
|
|
37560
|
+
icon: styleFontSizeIcon(),
|
|
37539
37561
|
target: "each",
|
|
37540
37562
|
controls: [
|
|
37541
37563
|
{
|
|
@@ -43841,6 +43863,7 @@ class Group extends BaseItem {
|
|
|
43841
43863
|
transformationRenderBlock = undefined;
|
|
43842
43864
|
isLockedGroup = false;
|
|
43843
43865
|
static movingGroupId = null;
|
|
43866
|
+
static reparentingGroupId = null;
|
|
43844
43867
|
constructor(board, id = "") {
|
|
43845
43868
|
super(board, id);
|
|
43846
43869
|
this.index = new SimpleSpatialIndex(this.board.camera, this.board.pointer);
|
|
@@ -43906,6 +43929,23 @@ class Group extends BaseItem {
|
|
|
43906
43929
|
this.apply(operation);
|
|
43907
43930
|
}
|
|
43908
43931
|
}
|
|
43932
|
+
applyAddChildren(childIds) {
|
|
43933
|
+
Group.reparentingGroupId = this.getId();
|
|
43934
|
+
super.applyAddChildren(childIds);
|
|
43935
|
+
Group.reparentingGroupId = null;
|
|
43936
|
+
for (const child of this.index?.listAll() || []) {
|
|
43937
|
+
child.subject.publish(child);
|
|
43938
|
+
}
|
|
43939
|
+
}
|
|
43940
|
+
applyRemoveChildren(childIds) {
|
|
43941
|
+
Group.reparentingGroupId = this.getId();
|
|
43942
|
+
super.applyRemoveChildren(childIds);
|
|
43943
|
+
Group.reparentingGroupId = null;
|
|
43944
|
+
for (const childId of childIds) {
|
|
43945
|
+
const child = this.board.items.getById(childId);
|
|
43946
|
+
child?.subject.publish(child);
|
|
43947
|
+
}
|
|
43948
|
+
}
|
|
43909
43949
|
setId(id) {
|
|
43910
43950
|
this.id = id;
|
|
43911
43951
|
this.transformation.setId(id);
|
|
@@ -44014,12 +44054,12 @@ var COLOR_PALETTE = [
|
|
|
44014
44054
|
"#118AB2",
|
|
44015
44055
|
"#7B61FF"
|
|
44016
44056
|
];
|
|
44017
|
-
var
|
|
44057
|
+
var symbolIcon2 = (key) => ({ kind: "symbol", key });
|
|
44018
44058
|
var lineStyleOptions = ConnectorLineStyles.map((style) => ({
|
|
44019
44059
|
id: style,
|
|
44020
44060
|
label: style[0].toUpperCase() + style.slice(1),
|
|
44021
44061
|
value: style,
|
|
44022
|
-
icon:
|
|
44062
|
+
icon: symbolIcon2(`connector.lineStyle.${style}`)
|
|
44023
44063
|
}));
|
|
44024
44064
|
var lineWidthOptions = ConnectionLineWidths.map((width) => ({
|
|
44025
44065
|
id: `${width}`,
|
|
@@ -44030,13 +44070,13 @@ var pointerOptions = CONNECTOR_POINTER_TYPES.map((pointer) => ({
|
|
|
44030
44070
|
id: pointer,
|
|
44031
44071
|
label: pointer,
|
|
44032
44072
|
value: pointer,
|
|
44033
|
-
icon:
|
|
44073
|
+
icon: symbolIcon2(`connector.pointer.${pointer}`)
|
|
44034
44074
|
}));
|
|
44035
44075
|
var borderStyleOptions = ["solid", "dot", "dash", "longDash"].map((style) => ({
|
|
44036
44076
|
id: style,
|
|
44037
44077
|
label: style,
|
|
44038
44078
|
value: style,
|
|
44039
|
-
icon:
|
|
44079
|
+
icon: symbolIcon2(`stroke.${style}`)
|
|
44040
44080
|
}));
|
|
44041
44081
|
var connectorStyleControls = [
|
|
44042
44082
|
{
|
|
@@ -44091,7 +44131,7 @@ var connectorStyleControls = [
|
|
|
44091
44131
|
{
|
|
44092
44132
|
id: "smartJump",
|
|
44093
44133
|
label: "Smart jump",
|
|
44094
|
-
icon:
|
|
44134
|
+
icon: symbolIcon2("connector.smartJump"),
|
|
44095
44135
|
valueSource: { kind: "itemProperty", property: "smartJump" },
|
|
44096
44136
|
editor: { kind: "toggle", trueLabel: "On", falseLabel: "Off" },
|
|
44097
44137
|
invoke: { kind: "setProperty", property: "smartJump" }
|
|
@@ -44150,7 +44190,7 @@ var connectorToolControls = [
|
|
|
44150
44190
|
{
|
|
44151
44191
|
id: "toolSmartJump",
|
|
44152
44192
|
label: "Smart jump",
|
|
44153
|
-
icon:
|
|
44193
|
+
icon: symbolIcon2("connector.smartJump"),
|
|
44154
44194
|
valueSource: { kind: "toolProperty", property: "smartJump" },
|
|
44155
44195
|
editor: { kind: "toggle", trueLabel: "On", falseLabel: "Off" },
|
|
44156
44196
|
invoke: { kind: "toolProperty", property: "smartJump" }
|
|
@@ -44162,21 +44202,21 @@ var connectorOverlay = {
|
|
|
44162
44202
|
{
|
|
44163
44203
|
id: "connector.switchPointers",
|
|
44164
44204
|
label: "Switch arrows",
|
|
44165
|
-
icon:
|
|
44205
|
+
icon: symbolIcon2("connector.switchPointers"),
|
|
44166
44206
|
target: "selection",
|
|
44167
44207
|
invoke: { kind: "operation", class: "Connector", method: "switchPointers" }
|
|
44168
44208
|
},
|
|
44169
44209
|
{
|
|
44170
44210
|
id: "connector.style",
|
|
44171
44211
|
label: "Connector style",
|
|
44172
|
-
icon:
|
|
44212
|
+
icon: symbolIcon2("connector.style"),
|
|
44173
44213
|
target: "each",
|
|
44174
44214
|
controls: connectorStyleControls,
|
|
44175
44215
|
groups: [
|
|
44176
44216
|
{
|
|
44177
44217
|
id: "connectorStyle",
|
|
44178
44218
|
label: "Connector style",
|
|
44179
|
-
icon:
|
|
44219
|
+
icon: symbolIcon2("connector.style"),
|
|
44180
44220
|
controlIds: connectorStyleControls.map((control) => control.id)
|
|
44181
44221
|
}
|
|
44182
44222
|
]
|
|
@@ -44203,7 +44243,7 @@ var addConnectorToolOverlay = {
|
|
|
44203
44243
|
{
|
|
44204
44244
|
id: "connectorToolStyle",
|
|
44205
44245
|
label: "Connector defaults",
|
|
44206
|
-
icon:
|
|
44246
|
+
icon: symbolIcon2("connector.style"),
|
|
44207
44247
|
controlIds: connectorToolControls.map((control) => control.id)
|
|
44208
44248
|
}
|
|
44209
44249
|
]
|
|
@@ -44355,7 +44395,7 @@ class Connector2 extends BaseItem {
|
|
|
44355
44395
|
}
|
|
44356
44396
|
this.text = new RichText(this.board, this.id);
|
|
44357
44397
|
this.text.container = this.getMbr();
|
|
44358
|
-
this.text.transformation =
|
|
44398
|
+
this.text.transformation = this.transformation;
|
|
44359
44399
|
this.text.linkTo = this.linkTo;
|
|
44360
44400
|
this.text.placeholderText = conf.i18n.t("connector.textPlaceholder", {
|
|
44361
44401
|
ns: "default"
|
|
@@ -44400,6 +44440,10 @@ class Connector2 extends BaseItem {
|
|
|
44400
44440
|
observerStartPointItem = () => {
|
|
44401
44441
|
const point3 = this.startPoint;
|
|
44402
44442
|
if (point3.pointType !== "Board") {
|
|
44443
|
+
const reparentingGroupId = Group.reparentingGroupId;
|
|
44444
|
+
if (reparentingGroupId !== null && (this.parent === reparentingGroupId || point3.item instanceof BaseItem && point3.item.parent === reparentingGroupId)) {
|
|
44445
|
+
return;
|
|
44446
|
+
}
|
|
44403
44447
|
const movingGroupId = Group.movingGroupId;
|
|
44404
44448
|
if (movingGroupId !== null && this.parent === movingGroupId && point3.item instanceof BaseItem && point3.item.parent === movingGroupId) {
|
|
44405
44449
|
return;
|
|
@@ -44418,6 +44462,10 @@ class Connector2 extends BaseItem {
|
|
|
44418
44462
|
observerEndPointItem = () => {
|
|
44419
44463
|
const point3 = this.endPoint;
|
|
44420
44464
|
if (point3.pointType !== "Board") {
|
|
44465
|
+
const reparentingGroupId = Group.reparentingGroupId;
|
|
44466
|
+
if (reparentingGroupId !== null && (this.parent === reparentingGroupId || point3.item instanceof BaseItem && point3.item.parent === reparentingGroupId)) {
|
|
44467
|
+
return;
|
|
44468
|
+
}
|
|
44421
44469
|
const movingGroupId = Group.movingGroupId;
|
|
44422
44470
|
if (movingGroupId !== null && this.parent === movingGroupId && point3.item instanceof BaseItem && point3.item.parent === movingGroupId) {
|
|
44423
44471
|
return;
|
|
@@ -58341,7 +58389,7 @@ var inlineShapeAsset = (folder, file2 = folder) => ({
|
|
|
58341
58389
|
path: `src/Items/Shape/Basic/${folder}/${file2}.icon.svg`,
|
|
58342
58390
|
mimeType: "image/svg+xml"
|
|
58343
58391
|
});
|
|
58344
|
-
var
|
|
58392
|
+
var symbolIcon3 = (key) => ({ kind: "symbol", key });
|
|
58345
58393
|
var BASIC_INLINE_OPTIONS = [
|
|
58346
58394
|
{ id: "rectangle", label: "Rectangle", value: "Rectangle", icon: inlineShapeAsset("Rectangle") },
|
|
58347
58395
|
{ id: "rounded-rectangle", label: "Rounded rectangle", value: "RoundedRectangle", icon: inlineShapeAsset("RoundedRectangle") },
|
|
@@ -58351,48 +58399,48 @@ var BASIC_INLINE_OPTIONS = [
|
|
|
58351
58399
|
];
|
|
58352
58400
|
var SHAPE_CATALOG_OPTIONS = [
|
|
58353
58401
|
...BASIC_INLINE_OPTIONS,
|
|
58354
|
-
{ id: "reversed-triangle", label: "Reversed triangle", value: "ReversedTriangle", icon:
|
|
58402
|
+
{ id: "reversed-triangle", label: "Reversed triangle", value: "ReversedTriangle", icon: symbolIcon3("shape.reversedTriangle") },
|
|
58355
58403
|
{ id: "arrow-left", label: "Arrow left", value: "ArrowLeft", icon: inlineShapeAsset("ArrowLeft") },
|
|
58356
58404
|
{ id: "arrow-right", label: "Arrow right", value: "ArrowRight", icon: inlineShapeAsset("ArrowRight") },
|
|
58357
58405
|
{ id: "arrow-left-right", label: "Arrow left right", value: "ArrowLeftRight", icon: inlineShapeAsset("ArrowLeftRight") },
|
|
58358
|
-
{ id: "arrow-block-left", label: "Arrow block left", value: "ArrowBlockLeft", icon:
|
|
58359
|
-
{ id: "arrow-block-right", label: "Arrow block right", value: "ArrowBlockRight", icon:
|
|
58406
|
+
{ id: "arrow-block-left", label: "Arrow block left", value: "ArrowBlockLeft", icon: symbolIcon3("shape.arrowBlockLeft") },
|
|
58407
|
+
{ id: "arrow-block-right", label: "Arrow block right", value: "ArrowBlockRight", icon: symbolIcon3("shape.arrowBlockRight") },
|
|
58360
58408
|
{ id: "cloud", label: "Cloud", value: "Cloud", icon: inlineShapeAsset("Cloud") },
|
|
58361
58409
|
{ id: "cross", label: "Cross", value: "Cross", icon: inlineShapeAsset("Cross") },
|
|
58362
58410
|
{ id: "cylinder", label: "Cylinder", value: "Cylinder", icon: inlineShapeAsset("Cylinder") },
|
|
58363
58411
|
{ id: "hexagon", label: "Hexagon", value: "Hexagon", icon: inlineShapeAsset("Hexagon") },
|
|
58364
58412
|
{ id: "octagon", label: "Octagon", value: "Octagon", icon: inlineShapeAsset("Octagon") },
|
|
58365
58413
|
{ id: "parallelogram", label: "Parallelogram", value: "Parallelogram", icon: inlineShapeAsset("Parallelogram") },
|
|
58366
|
-
{ id: "reversed-parallelogram", label: "Reversed parallelogram", value: "ReversedParallelogram", icon:
|
|
58414
|
+
{ id: "reversed-parallelogram", label: "Reversed parallelogram", value: "ReversedParallelogram", icon: symbolIcon3("shape.reversedParallelogram") },
|
|
58367
58415
|
{ id: "pentagon", label: "Pentagon", value: "Pentagon", icon: inlineShapeAsset("Pentagon") },
|
|
58368
|
-
{ id: "predefined-process", label: "Predefined process", value: "PredefinedProcess", icon:
|
|
58416
|
+
{ id: "predefined-process", label: "Predefined process", value: "PredefinedProcess", icon: symbolIcon3("shape.predefinedProcess") },
|
|
58369
58417
|
{ id: "speech-bubble", label: "Speech bubble", value: "SpeachBubble", icon: inlineShapeAsset("SpeachBubble") },
|
|
58370
58418
|
{ id: "star", label: "Star", value: "Star", icon: inlineShapeAsset("Star") },
|
|
58371
58419
|
{ id: "trapezoid", label: "Trapezoid", value: "Trapezoid", icon: inlineShapeAsset("Trapezoid") },
|
|
58372
58420
|
{ id: "braces-left", label: "Braces left", value: "BracesLeft", icon: inlineShapeAsset("BracesLeft", "BracesLeft") },
|
|
58373
58421
|
{ id: "braces-right", label: "Braces right", value: "BracesRight", icon: inlineShapeAsset("BracesRight", "BracesRight") },
|
|
58374
|
-
{ id: "bpmn-task", label: "BPMN task", value: "BPMN_Task", icon:
|
|
58375
|
-
{ id: "bpmn-gateway", label: "BPMN gateway", value: "BPMN_Gateway", icon:
|
|
58376
|
-
{ id: "bpmn-gateway-parallel", label: "BPMN gateway parallel", value: "BPMN_GatewayParallel", icon:
|
|
58377
|
-
{ id: "bpmn-gateway-xor", label: "BPMN gateway XOR", value: "BPMN_GatewayXOR", icon:
|
|
58378
|
-
{ id: "bpmn-start-event", label: "BPMN start event", value: "BPMN_StartEvent", icon:
|
|
58379
|
-
{ id: "bpmn-start-event-non-interrupting", label: "BPMN start event non interrupting", value: "BPMN_StartEventNoneInterrupting", icon:
|
|
58380
|
-
{ id: "bpmn-end-event", label: "BPMN end event", value: "BPMN_EndEvent", icon:
|
|
58381
|
-
{ id: "bpmn-intermediate-event", label: "BPMN intermediate event", value: "BPMN_IntermediateEvent", icon:
|
|
58382
|
-
{ id: "bpmn-intermediate-event-none-interrupting", label: "BPMN intermediate event none interrupting", value: "BPMN_IntermediateEventNoneInterrupting", icon:
|
|
58383
|
-
{ id: "bpmn-data-object", label: "BPMN data object", value: "BPMN_DataObject", icon:
|
|
58384
|
-
{ id: "bpmn-data-store", label: "BPMN data store", value: "BPMN_DataStore", icon:
|
|
58385
|
-
{ id: "bpmn-participant", label: "BPMN participant", value: "BPMN_Participant", icon:
|
|
58386
|
-
{ id: "bpmn-transaction", label: "BPMN transaction", value: "BPMN_Transaction", icon:
|
|
58387
|
-
{ id: "bpmn-event-subprocess", label: "BPMN event subprocess", value: "BPMN_EventSubprocess", icon:
|
|
58388
|
-
{ id: "bpmn-group", label: "BPMN group", value: "BPMN_Group", icon:
|
|
58389
|
-
{ id: "bpmn-annotation", label: "BPMN annotation", value: "BPMN_Annotation", icon:
|
|
58422
|
+
{ id: "bpmn-task", label: "BPMN task", value: "BPMN_Task", icon: symbolIcon3("shape.bpmn.task") },
|
|
58423
|
+
{ id: "bpmn-gateway", label: "BPMN gateway", value: "BPMN_Gateway", icon: symbolIcon3("shape.bpmn.gateway") },
|
|
58424
|
+
{ id: "bpmn-gateway-parallel", label: "BPMN gateway parallel", value: "BPMN_GatewayParallel", icon: symbolIcon3("shape.bpmn.gatewayParallel") },
|
|
58425
|
+
{ id: "bpmn-gateway-xor", label: "BPMN gateway XOR", value: "BPMN_GatewayXOR", icon: symbolIcon3("shape.bpmn.gatewayXor") },
|
|
58426
|
+
{ id: "bpmn-start-event", label: "BPMN start event", value: "BPMN_StartEvent", icon: symbolIcon3("shape.bpmn.startEvent") },
|
|
58427
|
+
{ id: "bpmn-start-event-non-interrupting", label: "BPMN start event non interrupting", value: "BPMN_StartEventNoneInterrupting", icon: symbolIcon3("shape.bpmn.startEventNoneInterrupting") },
|
|
58428
|
+
{ id: "bpmn-end-event", label: "BPMN end event", value: "BPMN_EndEvent", icon: symbolIcon3("shape.bpmn.endEvent") },
|
|
58429
|
+
{ id: "bpmn-intermediate-event", label: "BPMN intermediate event", value: "BPMN_IntermediateEvent", icon: symbolIcon3("shape.bpmn.intermediateEvent") },
|
|
58430
|
+
{ id: "bpmn-intermediate-event-none-interrupting", label: "BPMN intermediate event none interrupting", value: "BPMN_IntermediateEventNoneInterrupting", icon: symbolIcon3("shape.bpmn.intermediateEventNoneInterrupting") },
|
|
58431
|
+
{ id: "bpmn-data-object", label: "BPMN data object", value: "BPMN_DataObject", icon: symbolIcon3("shape.bpmn.dataObject") },
|
|
58432
|
+
{ id: "bpmn-data-store", label: "BPMN data store", value: "BPMN_DataStore", icon: symbolIcon3("shape.bpmn.dataStore") },
|
|
58433
|
+
{ id: "bpmn-participant", label: "BPMN participant", value: "BPMN_Participant", icon: symbolIcon3("shape.bpmn.participant") },
|
|
58434
|
+
{ id: "bpmn-transaction", label: "BPMN transaction", value: "BPMN_Transaction", icon: symbolIcon3("shape.bpmn.transaction") },
|
|
58435
|
+
{ id: "bpmn-event-subprocess", label: "BPMN event subprocess", value: "BPMN_EventSubprocess", icon: symbolIcon3("shape.bpmn.eventSubprocess") },
|
|
58436
|
+
{ id: "bpmn-group", label: "BPMN group", value: "BPMN_Group", icon: symbolIcon3("shape.bpmn.group") },
|
|
58437
|
+
{ id: "bpmn-annotation", label: "BPMN annotation", value: "BPMN_Annotation", icon: symbolIcon3("shape.bpmn.annotation") }
|
|
58390
58438
|
];
|
|
58391
58439
|
var BORDER_STYLE_OPTIONS = [
|
|
58392
|
-
{ id: "solid", label: "Solid", value: "solid", icon:
|
|
58393
|
-
{ id: "dot", label: "Dot", value: "dot", icon:
|
|
58394
|
-
{ id: "dash", label: "Dash", value: "dash", icon:
|
|
58395
|
-
{ id: "long-dash", label: "Long dash", value: "longDash", icon:
|
|
58440
|
+
{ id: "solid", label: "Solid", value: "solid", icon: symbolIcon3("stroke.solid") },
|
|
58441
|
+
{ id: "dot", label: "Dot", value: "dot", icon: symbolIcon3("stroke.dot") },
|
|
58442
|
+
{ id: "dash", label: "Dash", value: "dash", icon: symbolIcon3("stroke.dash") },
|
|
58443
|
+
{ id: "long-dash", label: "Long dash", value: "longDash", icon: symbolIcon3("stroke.longDash") }
|
|
58396
58444
|
];
|
|
58397
58445
|
var shapeTypeControl = {
|
|
58398
58446
|
id: "shapeType",
|
|
@@ -58415,14 +58463,10 @@ var fillControl = {
|
|
|
58415
58463
|
id: "backgroundColor",
|
|
58416
58464
|
label: "Fill",
|
|
58417
58465
|
valueSource: { kind: "itemProperty", property: "backgroundColor" },
|
|
58418
|
-
icon: {
|
|
58419
|
-
kind: "
|
|
58420
|
-
|
|
58421
|
-
|
|
58422
|
-
swatch: { kind: "itemProperty", property: "backgroundColor" },
|
|
58423
|
-
note: "UI can render the current fill color as a swatch inside the icon."
|
|
58424
|
-
}
|
|
58425
|
-
},
|
|
58466
|
+
icon: styleFillIcon({
|
|
58467
|
+
swatch: { kind: "itemProperty", property: "backgroundColor" },
|
|
58468
|
+
note: "UI can render the current fill color as a swatch inside the icon."
|
|
58469
|
+
}),
|
|
58426
58470
|
editor: {
|
|
58427
58471
|
kind: "color",
|
|
58428
58472
|
palette: COLOR_PALETTE2,
|
|
@@ -58473,7 +58517,7 @@ var shapeOverlay = {
|
|
|
58473
58517
|
{
|
|
58474
58518
|
id: "shape.shapeType",
|
|
58475
58519
|
label: "Shape type",
|
|
58476
|
-
icon:
|
|
58520
|
+
icon: symbolIcon3("shape.type"),
|
|
58477
58521
|
target: "each",
|
|
58478
58522
|
controls: [shapeTypeControl]
|
|
58479
58523
|
},
|
|
@@ -58487,14 +58531,14 @@ var shapeOverlay = {
|
|
|
58487
58531
|
{
|
|
58488
58532
|
id: "shape.strokeStyle",
|
|
58489
58533
|
label: "Stroke style",
|
|
58490
|
-
icon:
|
|
58534
|
+
icon: styleStrokeIcon(),
|
|
58491
58535
|
target: "each",
|
|
58492
58536
|
controls: strokeControls,
|
|
58493
58537
|
groups: [
|
|
58494
58538
|
{
|
|
58495
58539
|
id: "shapeStrokeStyle",
|
|
58496
58540
|
label: "Stroke style",
|
|
58497
|
-
icon:
|
|
58541
|
+
icon: styleStrokeIcon(),
|
|
58498
58542
|
controlIds: strokeControls.map((control) => control.id)
|
|
58499
58543
|
}
|
|
58500
58544
|
]
|
|
@@ -61860,6 +61904,9 @@ class AINode extends BaseItem {
|
|
|
61860
61904
|
getLinkTo() {
|
|
61861
61905
|
return this.linkTo.link;
|
|
61862
61906
|
}
|
|
61907
|
+
getRichText() {
|
|
61908
|
+
return this.text;
|
|
61909
|
+
}
|
|
61863
61910
|
renderButton(context) {
|
|
61864
61911
|
const { left, right, top, bottom } = this.buttonMbr;
|
|
61865
61912
|
const { ctx } = context;
|
|
@@ -63865,11 +63912,9 @@ var diceOverlay = {
|
|
|
63865
63912
|
{
|
|
63866
63913
|
id: "dice.fill",
|
|
63867
63914
|
label: "Fill",
|
|
63868
|
-
icon: {
|
|
63869
|
-
kind: "
|
|
63870
|
-
|
|
63871
|
-
state: { swatch: { kind: "itemProperty", property: "backgroundColor" } }
|
|
63872
|
-
},
|
|
63915
|
+
icon: styleFillIcon({
|
|
63916
|
+
swatch: { kind: "itemProperty", property: "backgroundColor" }
|
|
63917
|
+
}),
|
|
63873
63918
|
target: "each",
|
|
63874
63919
|
controls: [
|
|
63875
63920
|
{
|
|
@@ -74122,7 +74167,10 @@ class Board {
|
|
|
74122
74167
|
return parseHTML(el);
|
|
74123
74168
|
}
|
|
74124
74169
|
add(item, timeStamp) {
|
|
74125
|
-
const id = this.getNewItemId();
|
|
74170
|
+
const id = item.getId() || this.getNewItemId();
|
|
74171
|
+
if (!item.getId()) {
|
|
74172
|
+
item.setId(id);
|
|
74173
|
+
}
|
|
74126
74174
|
this.emit({
|
|
74127
74175
|
class: "Board",
|
|
74128
74176
|
method: "add",
|
|
@@ -74137,6 +74185,17 @@ class Board {
|
|
|
74137
74185
|
this.handleNesting(newItem);
|
|
74138
74186
|
return newItem;
|
|
74139
74187
|
}
|
|
74188
|
+
createItemAndAdd(itemType, data, timeStamp) {
|
|
74189
|
+
const id = data.id || this.getNewItemId();
|
|
74190
|
+
const fullData = { ...data, itemType, id };
|
|
74191
|
+
const item = this.createItem(id, fullData);
|
|
74192
|
+
if (item.itemType === "Connector" && data.startPoint && data.endPoint) {
|
|
74193
|
+
const conn = item;
|
|
74194
|
+
conn.apply({ class: "Connector", method: "setStartPoint", startPointData: data.startPoint });
|
|
74195
|
+
conn.apply({ class: "Connector", method: "setEndPoint", endPointData: data.endPoint });
|
|
74196
|
+
}
|
|
74197
|
+
return this.add(item, timeStamp);
|
|
74198
|
+
}
|
|
74140
74199
|
addLockedGroup(items) {
|
|
74141
74200
|
const id = this.getNewItemId();
|
|
74142
74201
|
const groupData = {
|
|
@@ -75006,6 +75065,165 @@ function validateTransformationData(transformationData) {
|
|
|
75006
75065
|
function validatePointData(pointData) {
|
|
75007
75066
|
return PointSchema.safeParse(pointData).success;
|
|
75008
75067
|
}
|
|
75068
|
+
// src/Import/Miro/MiroItemConverter.ts
|
|
75069
|
+
var SHAPE_TYPES = {
|
|
75070
|
+
round_rectangle: "RoundedRectangle",
|
|
75071
|
+
circle: "Circle",
|
|
75072
|
+
triangle: "Triangle",
|
|
75073
|
+
rhombus: "Rhombus",
|
|
75074
|
+
wedge_round_rectangle_callout: "SpeachBubble",
|
|
75075
|
+
parallelogram: "Parallelogram",
|
|
75076
|
+
star: "Star",
|
|
75077
|
+
right_arrow: "ArrowRight",
|
|
75078
|
+
left_arrow: "ArrowLeft",
|
|
75079
|
+
rectangle: "Rectangle",
|
|
75080
|
+
left_right_arrow: "ArrowLeftRight",
|
|
75081
|
+
pentagon: "Pentagon",
|
|
75082
|
+
octagon: "Octagon",
|
|
75083
|
+
hexagon: "Hexagon",
|
|
75084
|
+
flow_chart_predefined_process: "PredefinedProcess",
|
|
75085
|
+
trapezoid: "Trapezoid",
|
|
75086
|
+
cloud: "Cloud",
|
|
75087
|
+
cross: "Cross",
|
|
75088
|
+
can: "Cylinder",
|
|
75089
|
+
left_brace: "BracesRight",
|
|
75090
|
+
right_brace: "BracesLeft"
|
|
75091
|
+
};
|
|
75092
|
+
var BORDER_STYLES = {
|
|
75093
|
+
normal: "solid",
|
|
75094
|
+
dotted: "dot",
|
|
75095
|
+
dashed: "dash"
|
|
75096
|
+
};
|
|
75097
|
+
var STICKER_COLOR_MAP = {
|
|
75098
|
+
dark_blue: 2,
|
|
75099
|
+
blue: 2,
|
|
75100
|
+
light_blue: 3,
|
|
75101
|
+
red: 1,
|
|
75102
|
+
orange: 6,
|
|
75103
|
+
violet: 0,
|
|
75104
|
+
pink: 1,
|
|
75105
|
+
light_pink: 1,
|
|
75106
|
+
cyan: 5,
|
|
75107
|
+
dark_green: 4,
|
|
75108
|
+
green: 4,
|
|
75109
|
+
light_green: 4,
|
|
75110
|
+
yellow: 7,
|
|
75111
|
+
light_yellow: 7,
|
|
75112
|
+
gray: 8,
|
|
75113
|
+
black: 9
|
|
75114
|
+
};
|
|
75115
|
+
var FRAME_TYPES2 = {
|
|
75116
|
+
custom: "Custom",
|
|
75117
|
+
a4: "A4",
|
|
75118
|
+
letter: "Letter",
|
|
75119
|
+
ratio_16x9: "Frame16x9",
|
|
75120
|
+
ratio_4x3: "Frame4x3",
|
|
75121
|
+
ratio_1x1: "Frame1x1",
|
|
75122
|
+
phone: "Custom",
|
|
75123
|
+
tablet: "Custom",
|
|
75124
|
+
desktop: "Custom"
|
|
75125
|
+
};
|
|
75126
|
+
var CONNECTOR_LINE_STYLES = {
|
|
75127
|
+
straight: "straight",
|
|
75128
|
+
curved: "curved",
|
|
75129
|
+
elbowed: "orthogonal"
|
|
75130
|
+
};
|
|
75131
|
+
var CONNECTOR_POINTER_STYLES = {
|
|
75132
|
+
stealth: "ArrowBroad",
|
|
75133
|
+
"Arc Arrow": "ArrowThin",
|
|
75134
|
+
filled_triangle: "Angle",
|
|
75135
|
+
arrow: "ArrowThin",
|
|
75136
|
+
triangle: "TriangleEmpty",
|
|
75137
|
+
filled_diamond: "DiamondFilled",
|
|
75138
|
+
diamond: "DiamondEmpty",
|
|
75139
|
+
filled_oval: "CircleFilled",
|
|
75140
|
+
oval: "Zero",
|
|
75141
|
+
erd_one: "One",
|
|
75142
|
+
erd_many: "Many",
|
|
75143
|
+
erd_one_or_many: "ManyMandatory",
|
|
75144
|
+
erd_only_one: "OneMandatory",
|
|
75145
|
+
erd_zero_or_many: "ManyOptional",
|
|
75146
|
+
erd_zero_or_one: "OneOptional"
|
|
75147
|
+
};
|
|
75148
|
+
|
|
75149
|
+
class MiroItemConverter {
|
|
75150
|
+
static convert(miroItem) {
|
|
75151
|
+
const { type, style: style2, data, geometry, position: position4, id, linkTo, parent } = miroItem;
|
|
75152
|
+
const baseData = {
|
|
75153
|
+
id,
|
|
75154
|
+
parent: parent?.id || "Board",
|
|
75155
|
+
linkTo
|
|
75156
|
+
};
|
|
75157
|
+
switch (type) {
|
|
75158
|
+
case "shape":
|
|
75159
|
+
return {
|
|
75160
|
+
...baseData,
|
|
75161
|
+
itemType: "Shape",
|
|
75162
|
+
shapeType: SHAPE_TYPES[data?.shape] || "Rectangle",
|
|
75163
|
+
backgroundColor: MiroItemConverter.convertColor(style2?.fillColor, "transparent"),
|
|
75164
|
+
backgroundOpacity: style2?.fillOpacity ? parseFloat(style2.fillOpacity) : 1,
|
|
75165
|
+
borderColor: MiroItemConverter.convertColor(style2?.borderColor),
|
|
75166
|
+
borderOpacity: style2?.borderOpacity ? parseFloat(style2.borderOpacity) : 1,
|
|
75167
|
+
borderStyle: BORDER_STYLES[style2?.borderStyle || "normal"] || "solid",
|
|
75168
|
+
borderWidth: style2?.borderWidth ? parseFloat(style2.borderWidth) : 2
|
|
75169
|
+
};
|
|
75170
|
+
case "sticky_note":
|
|
75171
|
+
const colorIdx = STICKER_COLOR_MAP[style2?.fillColor || "yellow"] ?? 7;
|
|
75172
|
+
return {
|
|
75173
|
+
...baseData,
|
|
75174
|
+
itemType: "Sticker",
|
|
75175
|
+
backgroundColor: coerceColorValue(conf.STICKER_COLORS[colorIdx])
|
|
75176
|
+
};
|
|
75177
|
+
case "text":
|
|
75178
|
+
return {
|
|
75179
|
+
...baseData,
|
|
75180
|
+
itemType: "RichText"
|
|
75181
|
+
};
|
|
75182
|
+
case "frame":
|
|
75183
|
+
return {
|
|
75184
|
+
...baseData,
|
|
75185
|
+
itemType: "Frame",
|
|
75186
|
+
title: data?.title || "Frame",
|
|
75187
|
+
frameType: FRAME_TYPES2[data?.format] || "Custom",
|
|
75188
|
+
backgroundColor: MiroItemConverter.convertColor(style2?.fillColor)
|
|
75189
|
+
};
|
|
75190
|
+
case "connector":
|
|
75191
|
+
return {
|
|
75192
|
+
...baseData,
|
|
75193
|
+
itemType: "Connector",
|
|
75194
|
+
lineColor: MiroItemConverter.convertColor(style2?.strokeColor),
|
|
75195
|
+
lineStyle: CONNECTOR_LINE_STYLES[miroItem.shape || "straight"] || "straight",
|
|
75196
|
+
lineWidth: style2?.strokeWidth ? parseFloat(style2.strokeWidth) : 1,
|
|
75197
|
+
startPointerStyle: CONNECTOR_POINTER_STYLES[style2?.startStrokeCap || ""] || "None",
|
|
75198
|
+
endPointerStyle: CONNECTOR_POINTER_STYLES[style2?.endStrokeCap || ""] || "ArrowThin"
|
|
75199
|
+
};
|
|
75200
|
+
case "image":
|
|
75201
|
+
return {
|
|
75202
|
+
...baseData,
|
|
75203
|
+
itemType: "Image"
|
|
75204
|
+
};
|
|
75205
|
+
case "paint":
|
|
75206
|
+
return {
|
|
75207
|
+
...baseData,
|
|
75208
|
+
itemType: "Drawing",
|
|
75209
|
+
strokeColor: MiroItemConverter.convertColor(style2?.color),
|
|
75210
|
+
strokeWidth: style2?.strokeWidth ? parseFloat(style2.strokeWidth) : 2,
|
|
75211
|
+
strokeOpacity: style2?.strokeOpacity ?? 1
|
|
75212
|
+
};
|
|
75213
|
+
default:
|
|
75214
|
+
return {
|
|
75215
|
+
...baseData,
|
|
75216
|
+
itemType: "Placeholder"
|
|
75217
|
+
};
|
|
75218
|
+
}
|
|
75219
|
+
}
|
|
75220
|
+
static convertColor(color2, fallback = "black") {
|
|
75221
|
+
if (!color2)
|
|
75222
|
+
return coerceColorValue(fallback);
|
|
75223
|
+
const hex3 = color2 === "#ffffff" ? "transparent" : color2;
|
|
75224
|
+
return coerceColorValue(hex3);
|
|
75225
|
+
}
|
|
75226
|
+
}
|
|
75009
75227
|
// src/api/initI18N.ts
|
|
75010
75228
|
function initI18N(i18nInstance) {
|
|
75011
75229
|
conf.i18n = i18nInstance;
|
|
@@ -75128,6 +75346,11 @@ export {
|
|
|
75128
75346
|
toFiniteNumber,
|
|
75129
75347
|
tempStorage,
|
|
75130
75348
|
tagByType,
|
|
75349
|
+
symbolIcon,
|
|
75350
|
+
styleStrokeIcon,
|
|
75351
|
+
styleFontSizeIcon,
|
|
75352
|
+
styleFillIcon,
|
|
75353
|
+
styleColorIcon,
|
|
75131
75354
|
stickerColors,
|
|
75132
75355
|
srgbChannelToLinear,
|
|
75133
75356
|
sha256,
|
|
@@ -75254,6 +75477,8 @@ export {
|
|
|
75254
75477
|
PRESENCE_CURSOR_THROTTLE,
|
|
75255
75478
|
PRESENCE_CLEANUP_USER_TIMER,
|
|
75256
75479
|
PRESENCE_CLEANUP_IDLE_TIMER,
|
|
75480
|
+
OVERLAY_SYMBOL_KEYS,
|
|
75481
|
+
MiroItemConverter,
|
|
75257
75482
|
Mbr,
|
|
75258
75483
|
Matrix,
|
|
75259
75484
|
MIN_STROKE_WIDTH,
|
|
@@ -75282,6 +75507,7 @@ export {
|
|
|
75282
75507
|
Dice,
|
|
75283
75508
|
DefaultTransformationData,
|
|
75284
75509
|
DefaultShapeData,
|
|
75510
|
+
DefaultRichTextData,
|
|
75285
75511
|
DefaultPlaceholderData,
|
|
75286
75512
|
DefaultImageItemData,
|
|
75287
75513
|
DefaultGroupData,
|