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/node.js
CHANGED
|
@@ -12274,6 +12274,28 @@ function toLocalTransformOp(op, containerMatrix, itemId) {
|
|
|
12274
12274
|
return op;
|
|
12275
12275
|
}
|
|
12276
12276
|
}
|
|
12277
|
+
// src/Overlay/OverlayIcons.ts
|
|
12278
|
+
var OVERLAY_SYMBOL_KEYS = {
|
|
12279
|
+
styleFill: "style.fill",
|
|
12280
|
+
styleStroke: "style.stroke",
|
|
12281
|
+
styleColor: "style.color",
|
|
12282
|
+
styleFontSize: "style.fontSize"
|
|
12283
|
+
};
|
|
12284
|
+
function symbolIcon(key, state) {
|
|
12285
|
+
return state ? { kind: "symbol", key, state } : { kind: "symbol", key };
|
|
12286
|
+
}
|
|
12287
|
+
function styleFillIcon(state) {
|
|
12288
|
+
return symbolIcon(OVERLAY_SYMBOL_KEYS.styleFill, state);
|
|
12289
|
+
}
|
|
12290
|
+
function styleStrokeIcon(state) {
|
|
12291
|
+
return symbolIcon(OVERLAY_SYMBOL_KEYS.styleStroke, state);
|
|
12292
|
+
}
|
|
12293
|
+
function styleColorIcon(state) {
|
|
12294
|
+
return symbolIcon(OVERLAY_SYMBOL_KEYS.styleColor, state);
|
|
12295
|
+
}
|
|
12296
|
+
function styleFontSizeIcon(state) {
|
|
12297
|
+
return symbolIcon(OVERLAY_SYMBOL_KEYS.styleFontSize, state);
|
|
12298
|
+
}
|
|
12277
12299
|
// src/Overlay/overlayRegistry.ts
|
|
12278
12300
|
var itemOverlays = {};
|
|
12279
12301
|
var toolOverlays = {};
|
|
@@ -40062,7 +40084,7 @@ var richTextOverlay = {
|
|
|
40062
40084
|
{
|
|
40063
40085
|
id: "text.fontSize",
|
|
40064
40086
|
label: "Font size",
|
|
40065
|
-
icon:
|
|
40087
|
+
icon: styleFontSizeIcon(),
|
|
40066
40088
|
target: "each",
|
|
40067
40089
|
controls: [
|
|
40068
40090
|
{
|
|
@@ -46301,6 +46323,7 @@ class Group extends BaseItem {
|
|
|
46301
46323
|
transformationRenderBlock = undefined;
|
|
46302
46324
|
isLockedGroup = false;
|
|
46303
46325
|
static movingGroupId = null;
|
|
46326
|
+
static reparentingGroupId = null;
|
|
46304
46327
|
constructor(board, id = "") {
|
|
46305
46328
|
super(board, id);
|
|
46306
46329
|
this.index = new SimpleSpatialIndex(this.board.camera, this.board.pointer);
|
|
@@ -46366,6 +46389,23 @@ class Group extends BaseItem {
|
|
|
46366
46389
|
this.apply(operation);
|
|
46367
46390
|
}
|
|
46368
46391
|
}
|
|
46392
|
+
applyAddChildren(childIds) {
|
|
46393
|
+
Group.reparentingGroupId = this.getId();
|
|
46394
|
+
super.applyAddChildren(childIds);
|
|
46395
|
+
Group.reparentingGroupId = null;
|
|
46396
|
+
for (const child of this.index?.listAll() || []) {
|
|
46397
|
+
child.subject.publish(child);
|
|
46398
|
+
}
|
|
46399
|
+
}
|
|
46400
|
+
applyRemoveChildren(childIds) {
|
|
46401
|
+
Group.reparentingGroupId = this.getId();
|
|
46402
|
+
super.applyRemoveChildren(childIds);
|
|
46403
|
+
Group.reparentingGroupId = null;
|
|
46404
|
+
for (const childId of childIds) {
|
|
46405
|
+
const child = this.board.items.getById(childId);
|
|
46406
|
+
child?.subject.publish(child);
|
|
46407
|
+
}
|
|
46408
|
+
}
|
|
46369
46409
|
setId(id) {
|
|
46370
46410
|
this.id = id;
|
|
46371
46411
|
this.transformation.setId(id);
|
|
@@ -46474,12 +46514,12 @@ var COLOR_PALETTE = [
|
|
|
46474
46514
|
"#118AB2",
|
|
46475
46515
|
"#7B61FF"
|
|
46476
46516
|
];
|
|
46477
|
-
var
|
|
46517
|
+
var symbolIcon2 = (key) => ({ kind: "symbol", key });
|
|
46478
46518
|
var lineStyleOptions = ConnectorLineStyles.map((style) => ({
|
|
46479
46519
|
id: style,
|
|
46480
46520
|
label: style[0].toUpperCase() + style.slice(1),
|
|
46481
46521
|
value: style,
|
|
46482
|
-
icon:
|
|
46522
|
+
icon: symbolIcon2(`connector.lineStyle.${style}`)
|
|
46483
46523
|
}));
|
|
46484
46524
|
var lineWidthOptions = ConnectionLineWidths.map((width) => ({
|
|
46485
46525
|
id: `${width}`,
|
|
@@ -46490,13 +46530,13 @@ var pointerOptions = CONNECTOR_POINTER_TYPES.map((pointer) => ({
|
|
|
46490
46530
|
id: pointer,
|
|
46491
46531
|
label: pointer,
|
|
46492
46532
|
value: pointer,
|
|
46493
|
-
icon:
|
|
46533
|
+
icon: symbolIcon2(`connector.pointer.${pointer}`)
|
|
46494
46534
|
}));
|
|
46495
46535
|
var borderStyleOptions = ["solid", "dot", "dash", "longDash"].map((style) => ({
|
|
46496
46536
|
id: style,
|
|
46497
46537
|
label: style,
|
|
46498
46538
|
value: style,
|
|
46499
|
-
icon:
|
|
46539
|
+
icon: symbolIcon2(`stroke.${style}`)
|
|
46500
46540
|
}));
|
|
46501
46541
|
var connectorStyleControls = [
|
|
46502
46542
|
{
|
|
@@ -46551,7 +46591,7 @@ var connectorStyleControls = [
|
|
|
46551
46591
|
{
|
|
46552
46592
|
id: "smartJump",
|
|
46553
46593
|
label: "Smart jump",
|
|
46554
|
-
icon:
|
|
46594
|
+
icon: symbolIcon2("connector.smartJump"),
|
|
46555
46595
|
valueSource: { kind: "itemProperty", property: "smartJump" },
|
|
46556
46596
|
editor: { kind: "toggle", trueLabel: "On", falseLabel: "Off" },
|
|
46557
46597
|
invoke: { kind: "setProperty", property: "smartJump" }
|
|
@@ -46610,7 +46650,7 @@ var connectorToolControls = [
|
|
|
46610
46650
|
{
|
|
46611
46651
|
id: "toolSmartJump",
|
|
46612
46652
|
label: "Smart jump",
|
|
46613
|
-
icon:
|
|
46653
|
+
icon: symbolIcon2("connector.smartJump"),
|
|
46614
46654
|
valueSource: { kind: "toolProperty", property: "smartJump" },
|
|
46615
46655
|
editor: { kind: "toggle", trueLabel: "On", falseLabel: "Off" },
|
|
46616
46656
|
invoke: { kind: "toolProperty", property: "smartJump" }
|
|
@@ -46622,21 +46662,21 @@ var connectorOverlay = {
|
|
|
46622
46662
|
{
|
|
46623
46663
|
id: "connector.switchPointers",
|
|
46624
46664
|
label: "Switch arrows",
|
|
46625
|
-
icon:
|
|
46665
|
+
icon: symbolIcon2("connector.switchPointers"),
|
|
46626
46666
|
target: "selection",
|
|
46627
46667
|
invoke: { kind: "operation", class: "Connector", method: "switchPointers" }
|
|
46628
46668
|
},
|
|
46629
46669
|
{
|
|
46630
46670
|
id: "connector.style",
|
|
46631
46671
|
label: "Connector style",
|
|
46632
|
-
icon:
|
|
46672
|
+
icon: symbolIcon2("connector.style"),
|
|
46633
46673
|
target: "each",
|
|
46634
46674
|
controls: connectorStyleControls,
|
|
46635
46675
|
groups: [
|
|
46636
46676
|
{
|
|
46637
46677
|
id: "connectorStyle",
|
|
46638
46678
|
label: "Connector style",
|
|
46639
|
-
icon:
|
|
46679
|
+
icon: symbolIcon2("connector.style"),
|
|
46640
46680
|
controlIds: connectorStyleControls.map((control) => control.id)
|
|
46641
46681
|
}
|
|
46642
46682
|
]
|
|
@@ -46663,7 +46703,7 @@ var addConnectorToolOverlay = {
|
|
|
46663
46703
|
{
|
|
46664
46704
|
id: "connectorToolStyle",
|
|
46665
46705
|
label: "Connector defaults",
|
|
46666
|
-
icon:
|
|
46706
|
+
icon: symbolIcon2("connector.style"),
|
|
46667
46707
|
controlIds: connectorToolControls.map((control) => control.id)
|
|
46668
46708
|
}
|
|
46669
46709
|
]
|
|
@@ -46815,7 +46855,7 @@ class Connector2 extends BaseItem {
|
|
|
46815
46855
|
}
|
|
46816
46856
|
this.text = new RichText(this.board, this.id);
|
|
46817
46857
|
this.text.container = this.getMbr();
|
|
46818
|
-
this.text.transformation =
|
|
46858
|
+
this.text.transformation = this.transformation;
|
|
46819
46859
|
this.text.linkTo = this.linkTo;
|
|
46820
46860
|
this.text.placeholderText = conf.i18n.t("connector.textPlaceholder", {
|
|
46821
46861
|
ns: "default"
|
|
@@ -46860,6 +46900,10 @@ class Connector2 extends BaseItem {
|
|
|
46860
46900
|
observerStartPointItem = () => {
|
|
46861
46901
|
const point3 = this.startPoint;
|
|
46862
46902
|
if (point3.pointType !== "Board") {
|
|
46903
|
+
const reparentingGroupId = Group.reparentingGroupId;
|
|
46904
|
+
if (reparentingGroupId !== null && (this.parent === reparentingGroupId || point3.item instanceof BaseItem && point3.item.parent === reparentingGroupId)) {
|
|
46905
|
+
return;
|
|
46906
|
+
}
|
|
46863
46907
|
const movingGroupId = Group.movingGroupId;
|
|
46864
46908
|
if (movingGroupId !== null && this.parent === movingGroupId && point3.item instanceof BaseItem && point3.item.parent === movingGroupId) {
|
|
46865
46909
|
return;
|
|
@@ -46878,6 +46922,10 @@ class Connector2 extends BaseItem {
|
|
|
46878
46922
|
observerEndPointItem = () => {
|
|
46879
46923
|
const point3 = this.endPoint;
|
|
46880
46924
|
if (point3.pointType !== "Board") {
|
|
46925
|
+
const reparentingGroupId = Group.reparentingGroupId;
|
|
46926
|
+
if (reparentingGroupId !== null && (this.parent === reparentingGroupId || point3.item instanceof BaseItem && point3.item.parent === reparentingGroupId)) {
|
|
46927
|
+
return;
|
|
46928
|
+
}
|
|
46881
46929
|
const movingGroupId = Group.movingGroupId;
|
|
46882
46930
|
if (movingGroupId !== null && this.parent === movingGroupId && point3.item instanceof BaseItem && point3.item.parent === movingGroupId) {
|
|
46883
46931
|
return;
|
|
@@ -60802,7 +60850,7 @@ var inlineShapeAsset = (folder, file2 = folder) => ({
|
|
|
60802
60850
|
path: `src/Items/Shape/Basic/${folder}/${file2}.icon.svg`,
|
|
60803
60851
|
mimeType: "image/svg+xml"
|
|
60804
60852
|
});
|
|
60805
|
-
var
|
|
60853
|
+
var symbolIcon3 = (key) => ({ kind: "symbol", key });
|
|
60806
60854
|
var BASIC_INLINE_OPTIONS = [
|
|
60807
60855
|
{ id: "rectangle", label: "Rectangle", value: "Rectangle", icon: inlineShapeAsset("Rectangle") },
|
|
60808
60856
|
{ id: "rounded-rectangle", label: "Rounded rectangle", value: "RoundedRectangle", icon: inlineShapeAsset("RoundedRectangle") },
|
|
@@ -60812,48 +60860,48 @@ var BASIC_INLINE_OPTIONS = [
|
|
|
60812
60860
|
];
|
|
60813
60861
|
var SHAPE_CATALOG_OPTIONS = [
|
|
60814
60862
|
...BASIC_INLINE_OPTIONS,
|
|
60815
|
-
{ id: "reversed-triangle", label: "Reversed triangle", value: "ReversedTriangle", icon:
|
|
60863
|
+
{ id: "reversed-triangle", label: "Reversed triangle", value: "ReversedTriangle", icon: symbolIcon3("shape.reversedTriangle") },
|
|
60816
60864
|
{ id: "arrow-left", label: "Arrow left", value: "ArrowLeft", icon: inlineShapeAsset("ArrowLeft") },
|
|
60817
60865
|
{ id: "arrow-right", label: "Arrow right", value: "ArrowRight", icon: inlineShapeAsset("ArrowRight") },
|
|
60818
60866
|
{ id: "arrow-left-right", label: "Arrow left right", value: "ArrowLeftRight", icon: inlineShapeAsset("ArrowLeftRight") },
|
|
60819
|
-
{ id: "arrow-block-left", label: "Arrow block left", value: "ArrowBlockLeft", icon:
|
|
60820
|
-
{ id: "arrow-block-right", label: "Arrow block right", value: "ArrowBlockRight", icon:
|
|
60867
|
+
{ id: "arrow-block-left", label: "Arrow block left", value: "ArrowBlockLeft", icon: symbolIcon3("shape.arrowBlockLeft") },
|
|
60868
|
+
{ id: "arrow-block-right", label: "Arrow block right", value: "ArrowBlockRight", icon: symbolIcon3("shape.arrowBlockRight") },
|
|
60821
60869
|
{ id: "cloud", label: "Cloud", value: "Cloud", icon: inlineShapeAsset("Cloud") },
|
|
60822
60870
|
{ id: "cross", label: "Cross", value: "Cross", icon: inlineShapeAsset("Cross") },
|
|
60823
60871
|
{ id: "cylinder", label: "Cylinder", value: "Cylinder", icon: inlineShapeAsset("Cylinder") },
|
|
60824
60872
|
{ id: "hexagon", label: "Hexagon", value: "Hexagon", icon: inlineShapeAsset("Hexagon") },
|
|
60825
60873
|
{ id: "octagon", label: "Octagon", value: "Octagon", icon: inlineShapeAsset("Octagon") },
|
|
60826
60874
|
{ id: "parallelogram", label: "Parallelogram", value: "Parallelogram", icon: inlineShapeAsset("Parallelogram") },
|
|
60827
|
-
{ id: "reversed-parallelogram", label: "Reversed parallelogram", value: "ReversedParallelogram", icon:
|
|
60875
|
+
{ id: "reversed-parallelogram", label: "Reversed parallelogram", value: "ReversedParallelogram", icon: symbolIcon3("shape.reversedParallelogram") },
|
|
60828
60876
|
{ id: "pentagon", label: "Pentagon", value: "Pentagon", icon: inlineShapeAsset("Pentagon") },
|
|
60829
|
-
{ id: "predefined-process", label: "Predefined process", value: "PredefinedProcess", icon:
|
|
60877
|
+
{ id: "predefined-process", label: "Predefined process", value: "PredefinedProcess", icon: symbolIcon3("shape.predefinedProcess") },
|
|
60830
60878
|
{ id: "speech-bubble", label: "Speech bubble", value: "SpeachBubble", icon: inlineShapeAsset("SpeachBubble") },
|
|
60831
60879
|
{ id: "star", label: "Star", value: "Star", icon: inlineShapeAsset("Star") },
|
|
60832
60880
|
{ id: "trapezoid", label: "Trapezoid", value: "Trapezoid", icon: inlineShapeAsset("Trapezoid") },
|
|
60833
60881
|
{ id: "braces-left", label: "Braces left", value: "BracesLeft", icon: inlineShapeAsset("BracesLeft", "BracesLeft") },
|
|
60834
60882
|
{ id: "braces-right", label: "Braces right", value: "BracesRight", icon: inlineShapeAsset("BracesRight", "BracesRight") },
|
|
60835
|
-
{ id: "bpmn-task", label: "BPMN task", value: "BPMN_Task", icon:
|
|
60836
|
-
{ id: "bpmn-gateway", label: "BPMN gateway", value: "BPMN_Gateway", icon:
|
|
60837
|
-
{ id: "bpmn-gateway-parallel", label: "BPMN gateway parallel", value: "BPMN_GatewayParallel", icon:
|
|
60838
|
-
{ id: "bpmn-gateway-xor", label: "BPMN gateway XOR", value: "BPMN_GatewayXOR", icon:
|
|
60839
|
-
{ id: "bpmn-start-event", label: "BPMN start event", value: "BPMN_StartEvent", icon:
|
|
60840
|
-
{ id: "bpmn-start-event-non-interrupting", label: "BPMN start event non interrupting", value: "BPMN_StartEventNoneInterrupting", icon:
|
|
60841
|
-
{ id: "bpmn-end-event", label: "BPMN end event", value: "BPMN_EndEvent", icon:
|
|
60842
|
-
{ id: "bpmn-intermediate-event", label: "BPMN intermediate event", value: "BPMN_IntermediateEvent", icon:
|
|
60843
|
-
{ id: "bpmn-intermediate-event-none-interrupting", label: "BPMN intermediate event none interrupting", value: "BPMN_IntermediateEventNoneInterrupting", icon:
|
|
60844
|
-
{ id: "bpmn-data-object", label: "BPMN data object", value: "BPMN_DataObject", icon:
|
|
60845
|
-
{ id: "bpmn-data-store", label: "BPMN data store", value: "BPMN_DataStore", icon:
|
|
60846
|
-
{ id: "bpmn-participant", label: "BPMN participant", value: "BPMN_Participant", icon:
|
|
60847
|
-
{ id: "bpmn-transaction", label: "BPMN transaction", value: "BPMN_Transaction", icon:
|
|
60848
|
-
{ id: "bpmn-event-subprocess", label: "BPMN event subprocess", value: "BPMN_EventSubprocess", icon:
|
|
60849
|
-
{ id: "bpmn-group", label: "BPMN group", value: "BPMN_Group", icon:
|
|
60850
|
-
{ id: "bpmn-annotation", label: "BPMN annotation", value: "BPMN_Annotation", icon:
|
|
60883
|
+
{ id: "bpmn-task", label: "BPMN task", value: "BPMN_Task", icon: symbolIcon3("shape.bpmn.task") },
|
|
60884
|
+
{ id: "bpmn-gateway", label: "BPMN gateway", value: "BPMN_Gateway", icon: symbolIcon3("shape.bpmn.gateway") },
|
|
60885
|
+
{ id: "bpmn-gateway-parallel", label: "BPMN gateway parallel", value: "BPMN_GatewayParallel", icon: symbolIcon3("shape.bpmn.gatewayParallel") },
|
|
60886
|
+
{ id: "bpmn-gateway-xor", label: "BPMN gateway XOR", value: "BPMN_GatewayXOR", icon: symbolIcon3("shape.bpmn.gatewayXor") },
|
|
60887
|
+
{ id: "bpmn-start-event", label: "BPMN start event", value: "BPMN_StartEvent", icon: symbolIcon3("shape.bpmn.startEvent") },
|
|
60888
|
+
{ id: "bpmn-start-event-non-interrupting", label: "BPMN start event non interrupting", value: "BPMN_StartEventNoneInterrupting", icon: symbolIcon3("shape.bpmn.startEventNoneInterrupting") },
|
|
60889
|
+
{ id: "bpmn-end-event", label: "BPMN end event", value: "BPMN_EndEvent", icon: symbolIcon3("shape.bpmn.endEvent") },
|
|
60890
|
+
{ id: "bpmn-intermediate-event", label: "BPMN intermediate event", value: "BPMN_IntermediateEvent", icon: symbolIcon3("shape.bpmn.intermediateEvent") },
|
|
60891
|
+
{ id: "bpmn-intermediate-event-none-interrupting", label: "BPMN intermediate event none interrupting", value: "BPMN_IntermediateEventNoneInterrupting", icon: symbolIcon3("shape.bpmn.intermediateEventNoneInterrupting") },
|
|
60892
|
+
{ id: "bpmn-data-object", label: "BPMN data object", value: "BPMN_DataObject", icon: symbolIcon3("shape.bpmn.dataObject") },
|
|
60893
|
+
{ id: "bpmn-data-store", label: "BPMN data store", value: "BPMN_DataStore", icon: symbolIcon3("shape.bpmn.dataStore") },
|
|
60894
|
+
{ id: "bpmn-participant", label: "BPMN participant", value: "BPMN_Participant", icon: symbolIcon3("shape.bpmn.participant") },
|
|
60895
|
+
{ id: "bpmn-transaction", label: "BPMN transaction", value: "BPMN_Transaction", icon: symbolIcon3("shape.bpmn.transaction") },
|
|
60896
|
+
{ id: "bpmn-event-subprocess", label: "BPMN event subprocess", value: "BPMN_EventSubprocess", icon: symbolIcon3("shape.bpmn.eventSubprocess") },
|
|
60897
|
+
{ id: "bpmn-group", label: "BPMN group", value: "BPMN_Group", icon: symbolIcon3("shape.bpmn.group") },
|
|
60898
|
+
{ id: "bpmn-annotation", label: "BPMN annotation", value: "BPMN_Annotation", icon: symbolIcon3("shape.bpmn.annotation") }
|
|
60851
60899
|
];
|
|
60852
60900
|
var BORDER_STYLE_OPTIONS = [
|
|
60853
|
-
{ id: "solid", label: "Solid", value: "solid", icon:
|
|
60854
|
-
{ id: "dot", label: "Dot", value: "dot", icon:
|
|
60855
|
-
{ id: "dash", label: "Dash", value: "dash", icon:
|
|
60856
|
-
{ id: "long-dash", label: "Long dash", value: "longDash", icon:
|
|
60901
|
+
{ id: "solid", label: "Solid", value: "solid", icon: symbolIcon3("stroke.solid") },
|
|
60902
|
+
{ id: "dot", label: "Dot", value: "dot", icon: symbolIcon3("stroke.dot") },
|
|
60903
|
+
{ id: "dash", label: "Dash", value: "dash", icon: symbolIcon3("stroke.dash") },
|
|
60904
|
+
{ id: "long-dash", label: "Long dash", value: "longDash", icon: symbolIcon3("stroke.longDash") }
|
|
60857
60905
|
];
|
|
60858
60906
|
var shapeTypeControl = {
|
|
60859
60907
|
id: "shapeType",
|
|
@@ -60876,14 +60924,10 @@ var fillControl = {
|
|
|
60876
60924
|
id: "backgroundColor",
|
|
60877
60925
|
label: "Fill",
|
|
60878
60926
|
valueSource: { kind: "itemProperty", property: "backgroundColor" },
|
|
60879
|
-
icon: {
|
|
60880
|
-
kind: "
|
|
60881
|
-
|
|
60882
|
-
|
|
60883
|
-
swatch: { kind: "itemProperty", property: "backgroundColor" },
|
|
60884
|
-
note: "UI can render the current fill color as a swatch inside the icon."
|
|
60885
|
-
}
|
|
60886
|
-
},
|
|
60927
|
+
icon: styleFillIcon({
|
|
60928
|
+
swatch: { kind: "itemProperty", property: "backgroundColor" },
|
|
60929
|
+
note: "UI can render the current fill color as a swatch inside the icon."
|
|
60930
|
+
}),
|
|
60887
60931
|
editor: {
|
|
60888
60932
|
kind: "color",
|
|
60889
60933
|
palette: COLOR_PALETTE2,
|
|
@@ -60934,7 +60978,7 @@ var shapeOverlay = {
|
|
|
60934
60978
|
{
|
|
60935
60979
|
id: "shape.shapeType",
|
|
60936
60980
|
label: "Shape type",
|
|
60937
|
-
icon:
|
|
60981
|
+
icon: symbolIcon3("shape.type"),
|
|
60938
60982
|
target: "each",
|
|
60939
60983
|
controls: [shapeTypeControl]
|
|
60940
60984
|
},
|
|
@@ -60948,14 +60992,14 @@ var shapeOverlay = {
|
|
|
60948
60992
|
{
|
|
60949
60993
|
id: "shape.strokeStyle",
|
|
60950
60994
|
label: "Stroke style",
|
|
60951
|
-
icon:
|
|
60995
|
+
icon: styleStrokeIcon(),
|
|
60952
60996
|
target: "each",
|
|
60953
60997
|
controls: strokeControls,
|
|
60954
60998
|
groups: [
|
|
60955
60999
|
{
|
|
60956
61000
|
id: "shapeStrokeStyle",
|
|
60957
61001
|
label: "Stroke style",
|
|
60958
|
-
icon:
|
|
61002
|
+
icon: styleStrokeIcon(),
|
|
60959
61003
|
controlIds: strokeControls.map((control) => control.id)
|
|
60960
61004
|
}
|
|
60961
61005
|
]
|
|
@@ -64321,6 +64365,9 @@ class AINode extends BaseItem {
|
|
|
64321
64365
|
getLinkTo() {
|
|
64322
64366
|
return this.linkTo.link;
|
|
64323
64367
|
}
|
|
64368
|
+
getRichText() {
|
|
64369
|
+
return this.text;
|
|
64370
|
+
}
|
|
64324
64371
|
renderButton(context) {
|
|
64325
64372
|
const { left, right, top, bottom } = this.buttonMbr;
|
|
64326
64373
|
const { ctx } = context;
|
|
@@ -66326,11 +66373,9 @@ var diceOverlay = {
|
|
|
66326
66373
|
{
|
|
66327
66374
|
id: "dice.fill",
|
|
66328
66375
|
label: "Fill",
|
|
66329
|
-
icon: {
|
|
66330
|
-
kind: "
|
|
66331
|
-
|
|
66332
|
-
state: { swatch: { kind: "itemProperty", property: "backgroundColor" } }
|
|
66333
|
-
},
|
|
66376
|
+
icon: styleFillIcon({
|
|
66377
|
+
swatch: { kind: "itemProperty", property: "backgroundColor" }
|
|
66378
|
+
}),
|
|
66334
66379
|
target: "each",
|
|
66335
66380
|
controls: [
|
|
66336
66381
|
{
|
|
@@ -76583,7 +76628,10 @@ class Board {
|
|
|
76583
76628
|
return parseHTML(el);
|
|
76584
76629
|
}
|
|
76585
76630
|
add(item, timeStamp) {
|
|
76586
|
-
const id = this.getNewItemId();
|
|
76631
|
+
const id = item.getId() || this.getNewItemId();
|
|
76632
|
+
if (!item.getId()) {
|
|
76633
|
+
item.setId(id);
|
|
76634
|
+
}
|
|
76587
76635
|
this.emit({
|
|
76588
76636
|
class: "Board",
|
|
76589
76637
|
method: "add",
|
|
@@ -76598,6 +76646,17 @@ class Board {
|
|
|
76598
76646
|
this.handleNesting(newItem);
|
|
76599
76647
|
return newItem;
|
|
76600
76648
|
}
|
|
76649
|
+
createItemAndAdd(itemType, data, timeStamp) {
|
|
76650
|
+
const id = data.id || this.getNewItemId();
|
|
76651
|
+
const fullData = { ...data, itemType, id };
|
|
76652
|
+
const item = this.createItem(id, fullData);
|
|
76653
|
+
if (item.itemType === "Connector" && data.startPoint && data.endPoint) {
|
|
76654
|
+
const conn = item;
|
|
76655
|
+
conn.apply({ class: "Connector", method: "setStartPoint", startPointData: data.startPoint });
|
|
76656
|
+
conn.apply({ class: "Connector", method: "setEndPoint", endPointData: data.endPoint });
|
|
76657
|
+
}
|
|
76658
|
+
return this.add(item, timeStamp);
|
|
76659
|
+
}
|
|
76601
76660
|
addLockedGroup(items) {
|
|
76602
76661
|
const id = this.getNewItemId();
|
|
76603
76662
|
const groupData = {
|
|
@@ -77467,6 +77526,165 @@ function validateTransformationData(transformationData) {
|
|
|
77467
77526
|
function validatePointData(pointData) {
|
|
77468
77527
|
return PointSchema.safeParse(pointData).success;
|
|
77469
77528
|
}
|
|
77529
|
+
// src/Import/Miro/MiroItemConverter.ts
|
|
77530
|
+
var SHAPE_TYPES = {
|
|
77531
|
+
round_rectangle: "RoundedRectangle",
|
|
77532
|
+
circle: "Circle",
|
|
77533
|
+
triangle: "Triangle",
|
|
77534
|
+
rhombus: "Rhombus",
|
|
77535
|
+
wedge_round_rectangle_callout: "SpeachBubble",
|
|
77536
|
+
parallelogram: "Parallelogram",
|
|
77537
|
+
star: "Star",
|
|
77538
|
+
right_arrow: "ArrowRight",
|
|
77539
|
+
left_arrow: "ArrowLeft",
|
|
77540
|
+
rectangle: "Rectangle",
|
|
77541
|
+
left_right_arrow: "ArrowLeftRight",
|
|
77542
|
+
pentagon: "Pentagon",
|
|
77543
|
+
octagon: "Octagon",
|
|
77544
|
+
hexagon: "Hexagon",
|
|
77545
|
+
flow_chart_predefined_process: "PredefinedProcess",
|
|
77546
|
+
trapezoid: "Trapezoid",
|
|
77547
|
+
cloud: "Cloud",
|
|
77548
|
+
cross: "Cross",
|
|
77549
|
+
can: "Cylinder",
|
|
77550
|
+
left_brace: "BracesRight",
|
|
77551
|
+
right_brace: "BracesLeft"
|
|
77552
|
+
};
|
|
77553
|
+
var BORDER_STYLES = {
|
|
77554
|
+
normal: "solid",
|
|
77555
|
+
dotted: "dot",
|
|
77556
|
+
dashed: "dash"
|
|
77557
|
+
};
|
|
77558
|
+
var STICKER_COLOR_MAP = {
|
|
77559
|
+
dark_blue: 2,
|
|
77560
|
+
blue: 2,
|
|
77561
|
+
light_blue: 3,
|
|
77562
|
+
red: 1,
|
|
77563
|
+
orange: 6,
|
|
77564
|
+
violet: 0,
|
|
77565
|
+
pink: 1,
|
|
77566
|
+
light_pink: 1,
|
|
77567
|
+
cyan: 5,
|
|
77568
|
+
dark_green: 4,
|
|
77569
|
+
green: 4,
|
|
77570
|
+
light_green: 4,
|
|
77571
|
+
yellow: 7,
|
|
77572
|
+
light_yellow: 7,
|
|
77573
|
+
gray: 8,
|
|
77574
|
+
black: 9
|
|
77575
|
+
};
|
|
77576
|
+
var FRAME_TYPES2 = {
|
|
77577
|
+
custom: "Custom",
|
|
77578
|
+
a4: "A4",
|
|
77579
|
+
letter: "Letter",
|
|
77580
|
+
ratio_16x9: "Frame16x9",
|
|
77581
|
+
ratio_4x3: "Frame4x3",
|
|
77582
|
+
ratio_1x1: "Frame1x1",
|
|
77583
|
+
phone: "Custom",
|
|
77584
|
+
tablet: "Custom",
|
|
77585
|
+
desktop: "Custom"
|
|
77586
|
+
};
|
|
77587
|
+
var CONNECTOR_LINE_STYLES = {
|
|
77588
|
+
straight: "straight",
|
|
77589
|
+
curved: "curved",
|
|
77590
|
+
elbowed: "orthogonal"
|
|
77591
|
+
};
|
|
77592
|
+
var CONNECTOR_POINTER_STYLES = {
|
|
77593
|
+
stealth: "ArrowBroad",
|
|
77594
|
+
"Arc Arrow": "ArrowThin",
|
|
77595
|
+
filled_triangle: "Angle",
|
|
77596
|
+
arrow: "ArrowThin",
|
|
77597
|
+
triangle: "TriangleEmpty",
|
|
77598
|
+
filled_diamond: "DiamondFilled",
|
|
77599
|
+
diamond: "DiamondEmpty",
|
|
77600
|
+
filled_oval: "CircleFilled",
|
|
77601
|
+
oval: "Zero",
|
|
77602
|
+
erd_one: "One",
|
|
77603
|
+
erd_many: "Many",
|
|
77604
|
+
erd_one_or_many: "ManyMandatory",
|
|
77605
|
+
erd_only_one: "OneMandatory",
|
|
77606
|
+
erd_zero_or_many: "ManyOptional",
|
|
77607
|
+
erd_zero_or_one: "OneOptional"
|
|
77608
|
+
};
|
|
77609
|
+
|
|
77610
|
+
class MiroItemConverter {
|
|
77611
|
+
static convert(miroItem) {
|
|
77612
|
+
const { type, style: style2, data, geometry, position: position4, id, linkTo, parent } = miroItem;
|
|
77613
|
+
const baseData = {
|
|
77614
|
+
id,
|
|
77615
|
+
parent: parent?.id || "Board",
|
|
77616
|
+
linkTo
|
|
77617
|
+
};
|
|
77618
|
+
switch (type) {
|
|
77619
|
+
case "shape":
|
|
77620
|
+
return {
|
|
77621
|
+
...baseData,
|
|
77622
|
+
itemType: "Shape",
|
|
77623
|
+
shapeType: SHAPE_TYPES[data?.shape] || "Rectangle",
|
|
77624
|
+
backgroundColor: MiroItemConverter.convertColor(style2?.fillColor, "transparent"),
|
|
77625
|
+
backgroundOpacity: style2?.fillOpacity ? parseFloat(style2.fillOpacity) : 1,
|
|
77626
|
+
borderColor: MiroItemConverter.convertColor(style2?.borderColor),
|
|
77627
|
+
borderOpacity: style2?.borderOpacity ? parseFloat(style2.borderOpacity) : 1,
|
|
77628
|
+
borderStyle: BORDER_STYLES[style2?.borderStyle || "normal"] || "solid",
|
|
77629
|
+
borderWidth: style2?.borderWidth ? parseFloat(style2.borderWidth) : 2
|
|
77630
|
+
};
|
|
77631
|
+
case "sticky_note":
|
|
77632
|
+
const colorIdx = STICKER_COLOR_MAP[style2?.fillColor || "yellow"] ?? 7;
|
|
77633
|
+
return {
|
|
77634
|
+
...baseData,
|
|
77635
|
+
itemType: "Sticker",
|
|
77636
|
+
backgroundColor: coerceColorValue(conf.STICKER_COLORS[colorIdx])
|
|
77637
|
+
};
|
|
77638
|
+
case "text":
|
|
77639
|
+
return {
|
|
77640
|
+
...baseData,
|
|
77641
|
+
itemType: "RichText"
|
|
77642
|
+
};
|
|
77643
|
+
case "frame":
|
|
77644
|
+
return {
|
|
77645
|
+
...baseData,
|
|
77646
|
+
itemType: "Frame",
|
|
77647
|
+
title: data?.title || "Frame",
|
|
77648
|
+
frameType: FRAME_TYPES2[data?.format] || "Custom",
|
|
77649
|
+
backgroundColor: MiroItemConverter.convertColor(style2?.fillColor)
|
|
77650
|
+
};
|
|
77651
|
+
case "connector":
|
|
77652
|
+
return {
|
|
77653
|
+
...baseData,
|
|
77654
|
+
itemType: "Connector",
|
|
77655
|
+
lineColor: MiroItemConverter.convertColor(style2?.strokeColor),
|
|
77656
|
+
lineStyle: CONNECTOR_LINE_STYLES[miroItem.shape || "straight"] || "straight",
|
|
77657
|
+
lineWidth: style2?.strokeWidth ? parseFloat(style2.strokeWidth) : 1,
|
|
77658
|
+
startPointerStyle: CONNECTOR_POINTER_STYLES[style2?.startStrokeCap || ""] || "None",
|
|
77659
|
+
endPointerStyle: CONNECTOR_POINTER_STYLES[style2?.endStrokeCap || ""] || "ArrowThin"
|
|
77660
|
+
};
|
|
77661
|
+
case "image":
|
|
77662
|
+
return {
|
|
77663
|
+
...baseData,
|
|
77664
|
+
itemType: "Image"
|
|
77665
|
+
};
|
|
77666
|
+
case "paint":
|
|
77667
|
+
return {
|
|
77668
|
+
...baseData,
|
|
77669
|
+
itemType: "Drawing",
|
|
77670
|
+
strokeColor: MiroItemConverter.convertColor(style2?.color),
|
|
77671
|
+
strokeWidth: style2?.strokeWidth ? parseFloat(style2.strokeWidth) : 2,
|
|
77672
|
+
strokeOpacity: style2?.strokeOpacity ?? 1
|
|
77673
|
+
};
|
|
77674
|
+
default:
|
|
77675
|
+
return {
|
|
77676
|
+
...baseData,
|
|
77677
|
+
itemType: "Placeholder"
|
|
77678
|
+
};
|
|
77679
|
+
}
|
|
77680
|
+
}
|
|
77681
|
+
static convertColor(color2, fallback = "black") {
|
|
77682
|
+
if (!color2)
|
|
77683
|
+
return coerceColorValue(fallback);
|
|
77684
|
+
const hex3 = color2 === "#ffffff" ? "transparent" : color2;
|
|
77685
|
+
return coerceColorValue(hex3);
|
|
77686
|
+
}
|
|
77687
|
+
}
|
|
77470
77688
|
// src/api/initI18N.ts
|
|
77471
77689
|
function initI18N(i18nInstance) {
|
|
77472
77690
|
conf.i18n = i18nInstance;
|
|
@@ -77661,6 +77879,11 @@ export {
|
|
|
77661
77879
|
toFiniteNumber,
|
|
77662
77880
|
tempStorage,
|
|
77663
77881
|
tagByType,
|
|
77882
|
+
symbolIcon,
|
|
77883
|
+
styleStrokeIcon,
|
|
77884
|
+
styleFontSizeIcon,
|
|
77885
|
+
styleFillIcon,
|
|
77886
|
+
styleColorIcon,
|
|
77664
77887
|
stickerColors,
|
|
77665
77888
|
srgbChannelToLinear,
|
|
77666
77889
|
sha256,
|
|
@@ -77787,6 +78010,8 @@ export {
|
|
|
77787
78010
|
PRESENCE_CURSOR_THROTTLE,
|
|
77788
78011
|
PRESENCE_CLEANUP_USER_TIMER,
|
|
77789
78012
|
PRESENCE_CLEANUP_IDLE_TIMER,
|
|
78013
|
+
OVERLAY_SYMBOL_KEYS,
|
|
78014
|
+
MiroItemConverter,
|
|
77790
78015
|
Mbr,
|
|
77791
78016
|
Matrix,
|
|
77792
78017
|
MIN_STROKE_WIDTH,
|
|
@@ -77815,6 +78040,7 @@ export {
|
|
|
77815
78040
|
Dice,
|
|
77816
78041
|
DefaultTransformationData,
|
|
77817
78042
|
DefaultShapeData,
|
|
78043
|
+
DefaultRichTextData,
|
|
77818
78044
|
DefaultPlaceholderData,
|
|
77819
78045
|
DefaultImageItemData,
|
|
77820
78046
|
DefaultGroupData,
|
package/dist/types/Board.d.ts
CHANGED
|
@@ -86,6 +86,11 @@ export declare class Board {
|
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
88
|
add<T extends Item>(item: T, timeStamp?: number): T;
|
|
89
|
+
/**
|
|
90
|
+
* High-level method to create and add an item in one step.
|
|
91
|
+
* Useful for UI components and converters.
|
|
92
|
+
*/
|
|
93
|
+
createItemAndAdd<T extends Item>(itemType: string, data: Partial<ItemData>, timeStamp?: number): T;
|
|
89
94
|
addLockedGroup(items: BaseItem[]): Group;
|
|
90
95
|
remove(item: Item, withConnectors?: boolean): void;
|
|
91
96
|
removeLockedGroup(item: Group): void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface MiroGeometry {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
}
|
|
5
|
+
export interface MiroPosition {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
relativeTo: string;
|
|
9
|
+
}
|
|
10
|
+
export interface MiroStyle {
|
|
11
|
+
fillColor?: string;
|
|
12
|
+
fillOpacity?: string;
|
|
13
|
+
borderColor?: string;
|
|
14
|
+
borderOpacity?: string;
|
|
15
|
+
borderStyle?: string;
|
|
16
|
+
borderWidth?: string;
|
|
17
|
+
color?: string;
|
|
18
|
+
fontSize?: string;
|
|
19
|
+
textAlign?: string;
|
|
20
|
+
textAlignVertical?: string;
|
|
21
|
+
strokeColor?: string;
|
|
22
|
+
strokeOpacity?: number;
|
|
23
|
+
strokeWidth?: string;
|
|
24
|
+
startStrokeCap?: string;
|
|
25
|
+
endStrokeCap?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface MiroItem {
|
|
28
|
+
id: string;
|
|
29
|
+
type: string;
|
|
30
|
+
shape?: string;
|
|
31
|
+
data?: any;
|
|
32
|
+
style?: MiroStyle;
|
|
33
|
+
geometry?: MiroGeometry;
|
|
34
|
+
position?: MiroPosition;
|
|
35
|
+
parent?: {
|
|
36
|
+
id: string;
|
|
37
|
+
};
|
|
38
|
+
linkTo?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare class MiroItemConverter {
|
|
41
|
+
static convert(miroItem: MiroItem): any;
|
|
42
|
+
private static convertColor;
|
|
43
|
+
}
|
|
@@ -44,6 +44,7 @@ export declare class AINode extends BaseItem<AINode> {
|
|
|
44
44
|
getPath(): Path | Paths;
|
|
45
45
|
apply(op: Operation): void;
|
|
46
46
|
getLinkTo(): string | undefined;
|
|
47
|
+
getRichText(): RichText;
|
|
47
48
|
renderButton(context: DrawingContext): void;
|
|
48
49
|
render(context: DrawingContext): void;
|
|
49
50
|
getPrevMbr(): Mbr | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ItemOverlayDefinition, type ToolOverlayDefinition } from "../../Overlay";
|
|
2
2
|
export declare const diceOverlay: ItemOverlayDefinition;
|
|
3
3
|
export declare const addDiceToolOverlay: ToolOverlayDefinition;
|
|
@@ -28,6 +28,7 @@ export declare class Group extends BaseItem<Group> {
|
|
|
28
28
|
* via recalculatePoint) and avoid persisting spurious setStartPoint/setEndPoint ops.
|
|
29
29
|
*/
|
|
30
30
|
static movingGroupId: string | null;
|
|
31
|
+
static reparentingGroupId: string | null;
|
|
31
32
|
constructor(board: Board, id?: string);
|
|
32
33
|
isClosed(): boolean;
|
|
33
34
|
getRichText(): null;
|
|
@@ -35,6 +36,8 @@ export declare class Group extends BaseItem<Group> {
|
|
|
35
36
|
protected updateVisuals(op: Operation, hint: UpdateHint): void;
|
|
36
37
|
protected getPropertyUpdateHint(property: string): UpdateHint;
|
|
37
38
|
emit(operation: GroupOperation): void;
|
|
39
|
+
applyAddChildren(childIds: string[]): void;
|
|
40
|
+
applyRemoveChildren(childIds: string[]): void;
|
|
38
41
|
setId(id: string): this;
|
|
39
42
|
getMbr(): Mbr;
|
|
40
43
|
updateMbr(): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ItemOverlayDefinition, type ToolOverlayDefinition } from "../../Overlay";
|
|
2
2
|
export declare const richTextOverlay: ItemOverlayDefinition;
|
|
3
3
|
export declare const addTextToolOverlay: ToolOverlayDefinition;
|
|
@@ -3,6 +3,7 @@ export type { RichTextOperation } from "./RichTextOperations";
|
|
|
3
3
|
export type { TextStyle, TextNode } from "./Editor/TextNode";
|
|
4
4
|
export type { BlockNode, ListType } from "./Editor/BlockNode";
|
|
5
5
|
export type { RichTextData } from "./RichTextData";
|
|
6
|
+
export { DefaultRichTextData } from "./RichTextData";
|
|
6
7
|
export { transformHtmlOrTextToMarkdown } from "./transformHtmlToMarkdown";
|
|
7
8
|
export { getSlateSelectionRect } from "./getSlateSelectionRect";
|
|
8
9
|
export { EditorContainer } from "./EditorContainer";
|