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.
@@ -639,6 +639,11 @@ __export(exports_browser, {
639
639
  toFiniteNumber: () => toFiniteNumber,
640
640
  tempStorage: () => tempStorage,
641
641
  tagByType: () => tagByType,
642
+ symbolIcon: () => symbolIcon,
643
+ styleStrokeIcon: () => styleStrokeIcon,
644
+ styleFontSizeIcon: () => styleFontSizeIcon,
645
+ styleFillIcon: () => styleFillIcon,
646
+ styleColorIcon: () => styleColorIcon,
642
647
  stickerColors: () => stickerColors,
643
648
  srgbChannelToLinear: () => srgbChannelToLinear,
644
649
  sha256: () => sha256,
@@ -765,6 +770,8 @@ __export(exports_browser, {
765
770
  PRESENCE_CURSOR_THROTTLE: () => PRESENCE_CURSOR_THROTTLE,
766
771
  PRESENCE_CLEANUP_USER_TIMER: () => PRESENCE_CLEANUP_USER_TIMER,
767
772
  PRESENCE_CLEANUP_IDLE_TIMER: () => PRESENCE_CLEANUP_IDLE_TIMER,
773
+ OVERLAY_SYMBOL_KEYS: () => OVERLAY_SYMBOL_KEYS,
774
+ MiroItemConverter: () => MiroItemConverter,
768
775
  Mbr: () => Mbr,
769
776
  Matrix: () => Matrix,
770
777
  MIN_STROKE_WIDTH: () => MIN_STROKE_WIDTH,
@@ -793,6 +800,7 @@ __export(exports_browser, {
793
800
  Dice: () => Dice,
794
801
  DefaultTransformationData: () => DefaultTransformationData,
795
802
  DefaultShapeData: () => DefaultShapeData,
803
+ DefaultRichTextData: () => DefaultRichTextData,
796
804
  DefaultPlaceholderData: () => DefaultPlaceholderData,
797
805
  DefaultImageItemData: () => DefaultImageItemData,
798
806
  DefaultGroupData: () => DefaultGroupData,
@@ -11709,6 +11717,28 @@ function toLocalTransformOp(op, containerMatrix, itemId) {
11709
11717
  return op;
11710
11718
  }
11711
11719
  }
11720
+ // src/Overlay/OverlayIcons.ts
11721
+ var OVERLAY_SYMBOL_KEYS = {
11722
+ styleFill: "style.fill",
11723
+ styleStroke: "style.stroke",
11724
+ styleColor: "style.color",
11725
+ styleFontSize: "style.fontSize"
11726
+ };
11727
+ function symbolIcon(key, state) {
11728
+ return state ? { kind: "symbol", key, state } : { kind: "symbol", key };
11729
+ }
11730
+ function styleFillIcon(state) {
11731
+ return symbolIcon(OVERLAY_SYMBOL_KEYS.styleFill, state);
11732
+ }
11733
+ function styleStrokeIcon(state) {
11734
+ return symbolIcon(OVERLAY_SYMBOL_KEYS.styleStroke, state);
11735
+ }
11736
+ function styleColorIcon(state) {
11737
+ return symbolIcon(OVERLAY_SYMBOL_KEYS.styleColor, state);
11738
+ }
11739
+ function styleFontSizeIcon(state) {
11740
+ return symbolIcon(OVERLAY_SYMBOL_KEYS.styleFontSize, state);
11741
+ }
11712
11742
  // src/Overlay/overlayRegistry.ts
11713
11743
  var itemOverlays = {};
11714
11744
  var toolOverlays = {};
@@ -37738,7 +37768,7 @@ var richTextOverlay = {
37738
37768
  {
37739
37769
  id: "text.fontSize",
37740
37770
  label: "Font size",
37741
- icon: { kind: "symbol", key: "text.fontSize" },
37771
+ icon: styleFontSizeIcon(),
37742
37772
  target: "each",
37743
37773
  controls: [
37744
37774
  {
@@ -44044,6 +44074,7 @@ class Group extends BaseItem {
44044
44074
  transformationRenderBlock = undefined;
44045
44075
  isLockedGroup = false;
44046
44076
  static movingGroupId = null;
44077
+ static reparentingGroupId = null;
44047
44078
  constructor(board, id = "") {
44048
44079
  super(board, id);
44049
44080
  this.index = new SimpleSpatialIndex(this.board.camera, this.board.pointer);
@@ -44109,6 +44140,23 @@ class Group extends BaseItem {
44109
44140
  this.apply(operation);
44110
44141
  }
44111
44142
  }
44143
+ applyAddChildren(childIds) {
44144
+ Group.reparentingGroupId = this.getId();
44145
+ super.applyAddChildren(childIds);
44146
+ Group.reparentingGroupId = null;
44147
+ for (const child of this.index?.listAll() || []) {
44148
+ child.subject.publish(child);
44149
+ }
44150
+ }
44151
+ applyRemoveChildren(childIds) {
44152
+ Group.reparentingGroupId = this.getId();
44153
+ super.applyRemoveChildren(childIds);
44154
+ Group.reparentingGroupId = null;
44155
+ for (const childId of childIds) {
44156
+ const child = this.board.items.getById(childId);
44157
+ child?.subject.publish(child);
44158
+ }
44159
+ }
44112
44160
  setId(id) {
44113
44161
  this.id = id;
44114
44162
  this.transformation.setId(id);
@@ -44217,12 +44265,12 @@ var COLOR_PALETTE = [
44217
44265
  "#118AB2",
44218
44266
  "#7B61FF"
44219
44267
  ];
44220
- var symbolIcon = (key) => ({ kind: "symbol", key });
44268
+ var symbolIcon2 = (key) => ({ kind: "symbol", key });
44221
44269
  var lineStyleOptions = ConnectorLineStyles.map((style) => ({
44222
44270
  id: style,
44223
44271
  label: style[0].toUpperCase() + style.slice(1),
44224
44272
  value: style,
44225
- icon: symbolIcon(`connector.lineStyle.${style}`)
44273
+ icon: symbolIcon2(`connector.lineStyle.${style}`)
44226
44274
  }));
44227
44275
  var lineWidthOptions = ConnectionLineWidths.map((width) => ({
44228
44276
  id: `${width}`,
@@ -44233,13 +44281,13 @@ var pointerOptions = CONNECTOR_POINTER_TYPES.map((pointer) => ({
44233
44281
  id: pointer,
44234
44282
  label: pointer,
44235
44283
  value: pointer,
44236
- icon: symbolIcon(`connector.pointer.${pointer}`)
44284
+ icon: symbolIcon2(`connector.pointer.${pointer}`)
44237
44285
  }));
44238
44286
  var borderStyleOptions = ["solid", "dot", "dash", "longDash"].map((style) => ({
44239
44287
  id: style,
44240
44288
  label: style,
44241
44289
  value: style,
44242
- icon: symbolIcon(`stroke.${style}`)
44290
+ icon: symbolIcon2(`stroke.${style}`)
44243
44291
  }));
44244
44292
  var connectorStyleControls = [
44245
44293
  {
@@ -44294,7 +44342,7 @@ var connectorStyleControls = [
44294
44342
  {
44295
44343
  id: "smartJump",
44296
44344
  label: "Smart jump",
44297
- icon: symbolIcon("connector.smartJump"),
44345
+ icon: symbolIcon2("connector.smartJump"),
44298
44346
  valueSource: { kind: "itemProperty", property: "smartJump" },
44299
44347
  editor: { kind: "toggle", trueLabel: "On", falseLabel: "Off" },
44300
44348
  invoke: { kind: "setProperty", property: "smartJump" }
@@ -44353,7 +44401,7 @@ var connectorToolControls = [
44353
44401
  {
44354
44402
  id: "toolSmartJump",
44355
44403
  label: "Smart jump",
44356
- icon: symbolIcon("connector.smartJump"),
44404
+ icon: symbolIcon2("connector.smartJump"),
44357
44405
  valueSource: { kind: "toolProperty", property: "smartJump" },
44358
44406
  editor: { kind: "toggle", trueLabel: "On", falseLabel: "Off" },
44359
44407
  invoke: { kind: "toolProperty", property: "smartJump" }
@@ -44365,21 +44413,21 @@ var connectorOverlay = {
44365
44413
  {
44366
44414
  id: "connector.switchPointers",
44367
44415
  label: "Switch arrows",
44368
- icon: symbolIcon("connector.switchPointers"),
44416
+ icon: symbolIcon2("connector.switchPointers"),
44369
44417
  target: "selection",
44370
44418
  invoke: { kind: "operation", class: "Connector", method: "switchPointers" }
44371
44419
  },
44372
44420
  {
44373
44421
  id: "connector.style",
44374
44422
  label: "Connector style",
44375
- icon: symbolIcon("connector.style"),
44423
+ icon: symbolIcon2("connector.style"),
44376
44424
  target: "each",
44377
44425
  controls: connectorStyleControls,
44378
44426
  groups: [
44379
44427
  {
44380
44428
  id: "connectorStyle",
44381
44429
  label: "Connector style",
44382
- icon: symbolIcon("connector.style"),
44430
+ icon: symbolIcon2("connector.style"),
44383
44431
  controlIds: connectorStyleControls.map((control) => control.id)
44384
44432
  }
44385
44433
  ]
@@ -44406,7 +44454,7 @@ var addConnectorToolOverlay = {
44406
44454
  {
44407
44455
  id: "connectorToolStyle",
44408
44456
  label: "Connector defaults",
44409
- icon: symbolIcon("connector.style"),
44457
+ icon: symbolIcon2("connector.style"),
44410
44458
  controlIds: connectorToolControls.map((control) => control.id)
44411
44459
  }
44412
44460
  ]
@@ -44558,7 +44606,7 @@ class Connector2 extends BaseItem {
44558
44606
  }
44559
44607
  this.text = new RichText(this.board, this.id);
44560
44608
  this.text.container = this.getMbr();
44561
- this.text.transformation = new Transformation;
44609
+ this.text.transformation = this.transformation;
44562
44610
  this.text.linkTo = this.linkTo;
44563
44611
  this.text.placeholderText = conf.i18n.t("connector.textPlaceholder", {
44564
44612
  ns: "default"
@@ -44603,6 +44651,10 @@ class Connector2 extends BaseItem {
44603
44651
  observerStartPointItem = () => {
44604
44652
  const point3 = this.startPoint;
44605
44653
  if (point3.pointType !== "Board") {
44654
+ const reparentingGroupId = Group.reparentingGroupId;
44655
+ if (reparentingGroupId !== null && (this.parent === reparentingGroupId || point3.item instanceof BaseItem && point3.item.parent === reparentingGroupId)) {
44656
+ return;
44657
+ }
44606
44658
  const movingGroupId = Group.movingGroupId;
44607
44659
  if (movingGroupId !== null && this.parent === movingGroupId && point3.item instanceof BaseItem && point3.item.parent === movingGroupId) {
44608
44660
  return;
@@ -44621,6 +44673,10 @@ class Connector2 extends BaseItem {
44621
44673
  observerEndPointItem = () => {
44622
44674
  const point3 = this.endPoint;
44623
44675
  if (point3.pointType !== "Board") {
44676
+ const reparentingGroupId = Group.reparentingGroupId;
44677
+ if (reparentingGroupId !== null && (this.parent === reparentingGroupId || point3.item instanceof BaseItem && point3.item.parent === reparentingGroupId)) {
44678
+ return;
44679
+ }
44624
44680
  const movingGroupId = Group.movingGroupId;
44625
44681
  if (movingGroupId !== null && this.parent === movingGroupId && point3.item instanceof BaseItem && point3.item.parent === movingGroupId) {
44626
44682
  return;
@@ -58544,7 +58600,7 @@ var inlineShapeAsset = (folder, file2 = folder) => ({
58544
58600
  path: `src/Items/Shape/Basic/${folder}/${file2}.icon.svg`,
58545
58601
  mimeType: "image/svg+xml"
58546
58602
  });
58547
- var symbolIcon2 = (key) => ({ kind: "symbol", key });
58603
+ var symbolIcon3 = (key) => ({ kind: "symbol", key });
58548
58604
  var BASIC_INLINE_OPTIONS = [
58549
58605
  { id: "rectangle", label: "Rectangle", value: "Rectangle", icon: inlineShapeAsset("Rectangle") },
58550
58606
  { id: "rounded-rectangle", label: "Rounded rectangle", value: "RoundedRectangle", icon: inlineShapeAsset("RoundedRectangle") },
@@ -58554,48 +58610,48 @@ var BASIC_INLINE_OPTIONS = [
58554
58610
  ];
58555
58611
  var SHAPE_CATALOG_OPTIONS = [
58556
58612
  ...BASIC_INLINE_OPTIONS,
58557
- { id: "reversed-triangle", label: "Reversed triangle", value: "ReversedTriangle", icon: symbolIcon2("shape.reversedTriangle") },
58613
+ { id: "reversed-triangle", label: "Reversed triangle", value: "ReversedTriangle", icon: symbolIcon3("shape.reversedTriangle") },
58558
58614
  { id: "arrow-left", label: "Arrow left", value: "ArrowLeft", icon: inlineShapeAsset("ArrowLeft") },
58559
58615
  { id: "arrow-right", label: "Arrow right", value: "ArrowRight", icon: inlineShapeAsset("ArrowRight") },
58560
58616
  { id: "arrow-left-right", label: "Arrow left right", value: "ArrowLeftRight", icon: inlineShapeAsset("ArrowLeftRight") },
58561
- { id: "arrow-block-left", label: "Arrow block left", value: "ArrowBlockLeft", icon: symbolIcon2("shape.arrowBlockLeft") },
58562
- { id: "arrow-block-right", label: "Arrow block right", value: "ArrowBlockRight", icon: symbolIcon2("shape.arrowBlockRight") },
58617
+ { id: "arrow-block-left", label: "Arrow block left", value: "ArrowBlockLeft", icon: symbolIcon3("shape.arrowBlockLeft") },
58618
+ { id: "arrow-block-right", label: "Arrow block right", value: "ArrowBlockRight", icon: symbolIcon3("shape.arrowBlockRight") },
58563
58619
  { id: "cloud", label: "Cloud", value: "Cloud", icon: inlineShapeAsset("Cloud") },
58564
58620
  { id: "cross", label: "Cross", value: "Cross", icon: inlineShapeAsset("Cross") },
58565
58621
  { id: "cylinder", label: "Cylinder", value: "Cylinder", icon: inlineShapeAsset("Cylinder") },
58566
58622
  { id: "hexagon", label: "Hexagon", value: "Hexagon", icon: inlineShapeAsset("Hexagon") },
58567
58623
  { id: "octagon", label: "Octagon", value: "Octagon", icon: inlineShapeAsset("Octagon") },
58568
58624
  { id: "parallelogram", label: "Parallelogram", value: "Parallelogram", icon: inlineShapeAsset("Parallelogram") },
58569
- { id: "reversed-parallelogram", label: "Reversed parallelogram", value: "ReversedParallelogram", icon: symbolIcon2("shape.reversedParallelogram") },
58625
+ { id: "reversed-parallelogram", label: "Reversed parallelogram", value: "ReversedParallelogram", icon: symbolIcon3("shape.reversedParallelogram") },
58570
58626
  { id: "pentagon", label: "Pentagon", value: "Pentagon", icon: inlineShapeAsset("Pentagon") },
58571
- { id: "predefined-process", label: "Predefined process", value: "PredefinedProcess", icon: symbolIcon2("shape.predefinedProcess") },
58627
+ { id: "predefined-process", label: "Predefined process", value: "PredefinedProcess", icon: symbolIcon3("shape.predefinedProcess") },
58572
58628
  { id: "speech-bubble", label: "Speech bubble", value: "SpeachBubble", icon: inlineShapeAsset("SpeachBubble") },
58573
58629
  { id: "star", label: "Star", value: "Star", icon: inlineShapeAsset("Star") },
58574
58630
  { id: "trapezoid", label: "Trapezoid", value: "Trapezoid", icon: inlineShapeAsset("Trapezoid") },
58575
58631
  { id: "braces-left", label: "Braces left", value: "BracesLeft", icon: inlineShapeAsset("BracesLeft", "BracesLeft") },
58576
58632
  { id: "braces-right", label: "Braces right", value: "BracesRight", icon: inlineShapeAsset("BracesRight", "BracesRight") },
58577
- { id: "bpmn-task", label: "BPMN task", value: "BPMN_Task", icon: symbolIcon2("shape.bpmn.task") },
58578
- { id: "bpmn-gateway", label: "BPMN gateway", value: "BPMN_Gateway", icon: symbolIcon2("shape.bpmn.gateway") },
58579
- { id: "bpmn-gateway-parallel", label: "BPMN gateway parallel", value: "BPMN_GatewayParallel", icon: symbolIcon2("shape.bpmn.gatewayParallel") },
58580
- { id: "bpmn-gateway-xor", label: "BPMN gateway XOR", value: "BPMN_GatewayXOR", icon: symbolIcon2("shape.bpmn.gatewayXor") },
58581
- { id: "bpmn-start-event", label: "BPMN start event", value: "BPMN_StartEvent", icon: symbolIcon2("shape.bpmn.startEvent") },
58582
- { id: "bpmn-start-event-non-interrupting", label: "BPMN start event non interrupting", value: "BPMN_StartEventNoneInterrupting", icon: symbolIcon2("shape.bpmn.startEventNoneInterrupting") },
58583
- { id: "bpmn-end-event", label: "BPMN end event", value: "BPMN_EndEvent", icon: symbolIcon2("shape.bpmn.endEvent") },
58584
- { id: "bpmn-intermediate-event", label: "BPMN intermediate event", value: "BPMN_IntermediateEvent", icon: symbolIcon2("shape.bpmn.intermediateEvent") },
58585
- { id: "bpmn-intermediate-event-none-interrupting", label: "BPMN intermediate event none interrupting", value: "BPMN_IntermediateEventNoneInterrupting", icon: symbolIcon2("shape.bpmn.intermediateEventNoneInterrupting") },
58586
- { id: "bpmn-data-object", label: "BPMN data object", value: "BPMN_DataObject", icon: symbolIcon2("shape.bpmn.dataObject") },
58587
- { id: "bpmn-data-store", label: "BPMN data store", value: "BPMN_DataStore", icon: symbolIcon2("shape.bpmn.dataStore") },
58588
- { id: "bpmn-participant", label: "BPMN participant", value: "BPMN_Participant", icon: symbolIcon2("shape.bpmn.participant") },
58589
- { id: "bpmn-transaction", label: "BPMN transaction", value: "BPMN_Transaction", icon: symbolIcon2("shape.bpmn.transaction") },
58590
- { id: "bpmn-event-subprocess", label: "BPMN event subprocess", value: "BPMN_EventSubprocess", icon: symbolIcon2("shape.bpmn.eventSubprocess") },
58591
- { id: "bpmn-group", label: "BPMN group", value: "BPMN_Group", icon: symbolIcon2("shape.bpmn.group") },
58592
- { id: "bpmn-annotation", label: "BPMN annotation", value: "BPMN_Annotation", icon: symbolIcon2("shape.bpmn.annotation") }
58633
+ { id: "bpmn-task", label: "BPMN task", value: "BPMN_Task", icon: symbolIcon3("shape.bpmn.task") },
58634
+ { id: "bpmn-gateway", label: "BPMN gateway", value: "BPMN_Gateway", icon: symbolIcon3("shape.bpmn.gateway") },
58635
+ { id: "bpmn-gateway-parallel", label: "BPMN gateway parallel", value: "BPMN_GatewayParallel", icon: symbolIcon3("shape.bpmn.gatewayParallel") },
58636
+ { id: "bpmn-gateway-xor", label: "BPMN gateway XOR", value: "BPMN_GatewayXOR", icon: symbolIcon3("shape.bpmn.gatewayXor") },
58637
+ { id: "bpmn-start-event", label: "BPMN start event", value: "BPMN_StartEvent", icon: symbolIcon3("shape.bpmn.startEvent") },
58638
+ { id: "bpmn-start-event-non-interrupting", label: "BPMN start event non interrupting", value: "BPMN_StartEventNoneInterrupting", icon: symbolIcon3("shape.bpmn.startEventNoneInterrupting") },
58639
+ { id: "bpmn-end-event", label: "BPMN end event", value: "BPMN_EndEvent", icon: symbolIcon3("shape.bpmn.endEvent") },
58640
+ { id: "bpmn-intermediate-event", label: "BPMN intermediate event", value: "BPMN_IntermediateEvent", icon: symbolIcon3("shape.bpmn.intermediateEvent") },
58641
+ { id: "bpmn-intermediate-event-none-interrupting", label: "BPMN intermediate event none interrupting", value: "BPMN_IntermediateEventNoneInterrupting", icon: symbolIcon3("shape.bpmn.intermediateEventNoneInterrupting") },
58642
+ { id: "bpmn-data-object", label: "BPMN data object", value: "BPMN_DataObject", icon: symbolIcon3("shape.bpmn.dataObject") },
58643
+ { id: "bpmn-data-store", label: "BPMN data store", value: "BPMN_DataStore", icon: symbolIcon3("shape.bpmn.dataStore") },
58644
+ { id: "bpmn-participant", label: "BPMN participant", value: "BPMN_Participant", icon: symbolIcon3("shape.bpmn.participant") },
58645
+ { id: "bpmn-transaction", label: "BPMN transaction", value: "BPMN_Transaction", icon: symbolIcon3("shape.bpmn.transaction") },
58646
+ { id: "bpmn-event-subprocess", label: "BPMN event subprocess", value: "BPMN_EventSubprocess", icon: symbolIcon3("shape.bpmn.eventSubprocess") },
58647
+ { id: "bpmn-group", label: "BPMN group", value: "BPMN_Group", icon: symbolIcon3("shape.bpmn.group") },
58648
+ { id: "bpmn-annotation", label: "BPMN annotation", value: "BPMN_Annotation", icon: symbolIcon3("shape.bpmn.annotation") }
58593
58649
  ];
58594
58650
  var BORDER_STYLE_OPTIONS = [
58595
- { id: "solid", label: "Solid", value: "solid", icon: symbolIcon2("stroke.solid") },
58596
- { id: "dot", label: "Dot", value: "dot", icon: symbolIcon2("stroke.dot") },
58597
- { id: "dash", label: "Dash", value: "dash", icon: symbolIcon2("stroke.dash") },
58598
- { id: "long-dash", label: "Long dash", value: "longDash", icon: symbolIcon2("stroke.longDash") }
58651
+ { id: "solid", label: "Solid", value: "solid", icon: symbolIcon3("stroke.solid") },
58652
+ { id: "dot", label: "Dot", value: "dot", icon: symbolIcon3("stroke.dot") },
58653
+ { id: "dash", label: "Dash", value: "dash", icon: symbolIcon3("stroke.dash") },
58654
+ { id: "long-dash", label: "Long dash", value: "longDash", icon: symbolIcon3("stroke.longDash") }
58599
58655
  ];
58600
58656
  var shapeTypeControl = {
58601
58657
  id: "shapeType",
@@ -58618,14 +58674,10 @@ var fillControl = {
58618
58674
  id: "backgroundColor",
58619
58675
  label: "Fill",
58620
58676
  valueSource: { kind: "itemProperty", property: "backgroundColor" },
58621
- icon: {
58622
- kind: "symbol",
58623
- key: "shape.fill",
58624
- state: {
58625
- swatch: { kind: "itemProperty", property: "backgroundColor" },
58626
- note: "UI can render the current fill color as a swatch inside the icon."
58627
- }
58628
- },
58677
+ icon: styleFillIcon({
58678
+ swatch: { kind: "itemProperty", property: "backgroundColor" },
58679
+ note: "UI can render the current fill color as a swatch inside the icon."
58680
+ }),
58629
58681
  editor: {
58630
58682
  kind: "color",
58631
58683
  palette: COLOR_PALETTE2,
@@ -58676,7 +58728,7 @@ var shapeOverlay = {
58676
58728
  {
58677
58729
  id: "shape.shapeType",
58678
58730
  label: "Shape type",
58679
- icon: symbolIcon2("shape.type"),
58731
+ icon: symbolIcon3("shape.type"),
58680
58732
  target: "each",
58681
58733
  controls: [shapeTypeControl]
58682
58734
  },
@@ -58690,14 +58742,14 @@ var shapeOverlay = {
58690
58742
  {
58691
58743
  id: "shape.strokeStyle",
58692
58744
  label: "Stroke style",
58693
- icon: symbolIcon2("shape.stroke"),
58745
+ icon: styleStrokeIcon(),
58694
58746
  target: "each",
58695
58747
  controls: strokeControls,
58696
58748
  groups: [
58697
58749
  {
58698
58750
  id: "shapeStrokeStyle",
58699
58751
  label: "Stroke style",
58700
- icon: symbolIcon2("shape.stroke"),
58752
+ icon: styleStrokeIcon(),
58701
58753
  controlIds: strokeControls.map((control) => control.id)
58702
58754
  }
58703
58755
  ]
@@ -62063,6 +62115,9 @@ class AINode extends BaseItem {
62063
62115
  getLinkTo() {
62064
62116
  return this.linkTo.link;
62065
62117
  }
62118
+ getRichText() {
62119
+ return this.text;
62120
+ }
62066
62121
  renderButton(context) {
62067
62122
  const { left, right, top, bottom } = this.buttonMbr;
62068
62123
  const { ctx } = context;
@@ -64068,11 +64123,9 @@ var diceOverlay = {
64068
64123
  {
64069
64124
  id: "dice.fill",
64070
64125
  label: "Fill",
64071
- icon: {
64072
- kind: "symbol",
64073
- key: "shape.fill",
64074
- state: { swatch: { kind: "itemProperty", property: "backgroundColor" } }
64075
- },
64126
+ icon: styleFillIcon({
64127
+ swatch: { kind: "itemProperty", property: "backgroundColor" }
64128
+ }),
64076
64129
  target: "each",
64077
64130
  controls: [
64078
64131
  {
@@ -74325,7 +74378,10 @@ class Board {
74325
74378
  return parseHTML(el);
74326
74379
  }
74327
74380
  add(item, timeStamp) {
74328
- const id = this.getNewItemId();
74381
+ const id = item.getId() || this.getNewItemId();
74382
+ if (!item.getId()) {
74383
+ item.setId(id);
74384
+ }
74329
74385
  this.emit({
74330
74386
  class: "Board",
74331
74387
  method: "add",
@@ -74340,6 +74396,17 @@ class Board {
74340
74396
  this.handleNesting(newItem);
74341
74397
  return newItem;
74342
74398
  }
74399
+ createItemAndAdd(itemType, data, timeStamp) {
74400
+ const id = data.id || this.getNewItemId();
74401
+ const fullData = { ...data, itemType, id };
74402
+ const item = this.createItem(id, fullData);
74403
+ if (item.itemType === "Connector" && data.startPoint && data.endPoint) {
74404
+ const conn = item;
74405
+ conn.apply({ class: "Connector", method: "setStartPoint", startPointData: data.startPoint });
74406
+ conn.apply({ class: "Connector", method: "setEndPoint", endPointData: data.endPoint });
74407
+ }
74408
+ return this.add(item, timeStamp);
74409
+ }
74343
74410
  addLockedGroup(items) {
74344
74411
  const id = this.getNewItemId();
74345
74412
  const groupData = {
@@ -75209,6 +75276,165 @@ function validateTransformationData(transformationData) {
75209
75276
  function validatePointData(pointData) {
75210
75277
  return PointSchema.safeParse(pointData).success;
75211
75278
  }
75279
+ // src/Import/Miro/MiroItemConverter.ts
75280
+ var SHAPE_TYPES = {
75281
+ round_rectangle: "RoundedRectangle",
75282
+ circle: "Circle",
75283
+ triangle: "Triangle",
75284
+ rhombus: "Rhombus",
75285
+ wedge_round_rectangle_callout: "SpeachBubble",
75286
+ parallelogram: "Parallelogram",
75287
+ star: "Star",
75288
+ right_arrow: "ArrowRight",
75289
+ left_arrow: "ArrowLeft",
75290
+ rectangle: "Rectangle",
75291
+ left_right_arrow: "ArrowLeftRight",
75292
+ pentagon: "Pentagon",
75293
+ octagon: "Octagon",
75294
+ hexagon: "Hexagon",
75295
+ flow_chart_predefined_process: "PredefinedProcess",
75296
+ trapezoid: "Trapezoid",
75297
+ cloud: "Cloud",
75298
+ cross: "Cross",
75299
+ can: "Cylinder",
75300
+ left_brace: "BracesRight",
75301
+ right_brace: "BracesLeft"
75302
+ };
75303
+ var BORDER_STYLES = {
75304
+ normal: "solid",
75305
+ dotted: "dot",
75306
+ dashed: "dash"
75307
+ };
75308
+ var STICKER_COLOR_MAP = {
75309
+ dark_blue: 2,
75310
+ blue: 2,
75311
+ light_blue: 3,
75312
+ red: 1,
75313
+ orange: 6,
75314
+ violet: 0,
75315
+ pink: 1,
75316
+ light_pink: 1,
75317
+ cyan: 5,
75318
+ dark_green: 4,
75319
+ green: 4,
75320
+ light_green: 4,
75321
+ yellow: 7,
75322
+ light_yellow: 7,
75323
+ gray: 8,
75324
+ black: 9
75325
+ };
75326
+ var FRAME_TYPES2 = {
75327
+ custom: "Custom",
75328
+ a4: "A4",
75329
+ letter: "Letter",
75330
+ ratio_16x9: "Frame16x9",
75331
+ ratio_4x3: "Frame4x3",
75332
+ ratio_1x1: "Frame1x1",
75333
+ phone: "Custom",
75334
+ tablet: "Custom",
75335
+ desktop: "Custom"
75336
+ };
75337
+ var CONNECTOR_LINE_STYLES = {
75338
+ straight: "straight",
75339
+ curved: "curved",
75340
+ elbowed: "orthogonal"
75341
+ };
75342
+ var CONNECTOR_POINTER_STYLES = {
75343
+ stealth: "ArrowBroad",
75344
+ "Arc Arrow": "ArrowThin",
75345
+ filled_triangle: "Angle",
75346
+ arrow: "ArrowThin",
75347
+ triangle: "TriangleEmpty",
75348
+ filled_diamond: "DiamondFilled",
75349
+ diamond: "DiamondEmpty",
75350
+ filled_oval: "CircleFilled",
75351
+ oval: "Zero",
75352
+ erd_one: "One",
75353
+ erd_many: "Many",
75354
+ erd_one_or_many: "ManyMandatory",
75355
+ erd_only_one: "OneMandatory",
75356
+ erd_zero_or_many: "ManyOptional",
75357
+ erd_zero_or_one: "OneOptional"
75358
+ };
75359
+
75360
+ class MiroItemConverter {
75361
+ static convert(miroItem) {
75362
+ const { type, style: style2, data, geometry, position: position4, id, linkTo, parent } = miroItem;
75363
+ const baseData = {
75364
+ id,
75365
+ parent: parent?.id || "Board",
75366
+ linkTo
75367
+ };
75368
+ switch (type) {
75369
+ case "shape":
75370
+ return {
75371
+ ...baseData,
75372
+ itemType: "Shape",
75373
+ shapeType: SHAPE_TYPES[data?.shape] || "Rectangle",
75374
+ backgroundColor: MiroItemConverter.convertColor(style2?.fillColor, "transparent"),
75375
+ backgroundOpacity: style2?.fillOpacity ? parseFloat(style2.fillOpacity) : 1,
75376
+ borderColor: MiroItemConverter.convertColor(style2?.borderColor),
75377
+ borderOpacity: style2?.borderOpacity ? parseFloat(style2.borderOpacity) : 1,
75378
+ borderStyle: BORDER_STYLES[style2?.borderStyle || "normal"] || "solid",
75379
+ borderWidth: style2?.borderWidth ? parseFloat(style2.borderWidth) : 2
75380
+ };
75381
+ case "sticky_note":
75382
+ const colorIdx = STICKER_COLOR_MAP[style2?.fillColor || "yellow"] ?? 7;
75383
+ return {
75384
+ ...baseData,
75385
+ itemType: "Sticker",
75386
+ backgroundColor: coerceColorValue(conf.STICKER_COLORS[colorIdx])
75387
+ };
75388
+ case "text":
75389
+ return {
75390
+ ...baseData,
75391
+ itemType: "RichText"
75392
+ };
75393
+ case "frame":
75394
+ return {
75395
+ ...baseData,
75396
+ itemType: "Frame",
75397
+ title: data?.title || "Frame",
75398
+ frameType: FRAME_TYPES2[data?.format] || "Custom",
75399
+ backgroundColor: MiroItemConverter.convertColor(style2?.fillColor)
75400
+ };
75401
+ case "connector":
75402
+ return {
75403
+ ...baseData,
75404
+ itemType: "Connector",
75405
+ lineColor: MiroItemConverter.convertColor(style2?.strokeColor),
75406
+ lineStyle: CONNECTOR_LINE_STYLES[miroItem.shape || "straight"] || "straight",
75407
+ lineWidth: style2?.strokeWidth ? parseFloat(style2.strokeWidth) : 1,
75408
+ startPointerStyle: CONNECTOR_POINTER_STYLES[style2?.startStrokeCap || ""] || "None",
75409
+ endPointerStyle: CONNECTOR_POINTER_STYLES[style2?.endStrokeCap || ""] || "ArrowThin"
75410
+ };
75411
+ case "image":
75412
+ return {
75413
+ ...baseData,
75414
+ itemType: "Image"
75415
+ };
75416
+ case "paint":
75417
+ return {
75418
+ ...baseData,
75419
+ itemType: "Drawing",
75420
+ strokeColor: MiroItemConverter.convertColor(style2?.color),
75421
+ strokeWidth: style2?.strokeWidth ? parseFloat(style2.strokeWidth) : 2,
75422
+ strokeOpacity: style2?.strokeOpacity ?? 1
75423
+ };
75424
+ default:
75425
+ return {
75426
+ ...baseData,
75427
+ itemType: "Placeholder"
75428
+ };
75429
+ }
75430
+ }
75431
+ static convertColor(color2, fallback = "black") {
75432
+ if (!color2)
75433
+ return coerceColorValue(fallback);
75434
+ const hex3 = color2 === "#ffffff" ? "transparent" : color2;
75435
+ return coerceColorValue(hex3);
75436
+ }
75437
+ }
75212
75438
  // src/api/initI18N.ts
75213
75439
  function initI18N(i18nInstance) {
75214
75440
  conf.i18n = i18nInstance;