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/node.js CHANGED
@@ -1676,6 +1676,11 @@ __export(exports_node, {
1676
1676
  toFiniteNumber: () => toFiniteNumber,
1677
1677
  tempStorage: () => tempStorage,
1678
1678
  tagByType: () => tagByType,
1679
+ symbolIcon: () => symbolIcon,
1680
+ styleStrokeIcon: () => styleStrokeIcon,
1681
+ styleFontSizeIcon: () => styleFontSizeIcon,
1682
+ styleFillIcon: () => styleFillIcon,
1683
+ styleColorIcon: () => styleColorIcon,
1679
1684
  stickerColors: () => stickerColors,
1680
1685
  srgbChannelToLinear: () => srgbChannelToLinear,
1681
1686
  sha256: () => sha256,
@@ -1802,6 +1807,8 @@ __export(exports_node, {
1802
1807
  PRESENCE_CURSOR_THROTTLE: () => PRESENCE_CURSOR_THROTTLE,
1803
1808
  PRESENCE_CLEANUP_USER_TIMER: () => PRESENCE_CLEANUP_USER_TIMER,
1804
1809
  PRESENCE_CLEANUP_IDLE_TIMER: () => PRESENCE_CLEANUP_IDLE_TIMER,
1810
+ OVERLAY_SYMBOL_KEYS: () => OVERLAY_SYMBOL_KEYS,
1811
+ MiroItemConverter: () => MiroItemConverter,
1805
1812
  Mbr: () => Mbr,
1806
1813
  Matrix: () => Matrix,
1807
1814
  MIN_STROKE_WIDTH: () => MIN_STROKE_WIDTH,
@@ -1830,6 +1837,7 @@ __export(exports_node, {
1830
1837
  Dice: () => Dice,
1831
1838
  DefaultTransformationData: () => DefaultTransformationData,
1832
1839
  DefaultShapeData: () => DefaultShapeData,
1840
+ DefaultRichTextData: () => DefaultRichTextData,
1833
1841
  DefaultPlaceholderData: () => DefaultPlaceholderData,
1834
1842
  DefaultImageItemData: () => DefaultImageItemData,
1835
1843
  DefaultGroupData: () => DefaultGroupData,
@@ -12745,6 +12753,28 @@ function toLocalTransformOp(op, containerMatrix, itemId) {
12745
12753
  return op;
12746
12754
  }
12747
12755
  }
12756
+ // src/Overlay/OverlayIcons.ts
12757
+ var OVERLAY_SYMBOL_KEYS = {
12758
+ styleFill: "style.fill",
12759
+ styleStroke: "style.stroke",
12760
+ styleColor: "style.color",
12761
+ styleFontSize: "style.fontSize"
12762
+ };
12763
+ function symbolIcon(key, state) {
12764
+ return state ? { kind: "symbol", key, state } : { kind: "symbol", key };
12765
+ }
12766
+ function styleFillIcon(state) {
12767
+ return symbolIcon(OVERLAY_SYMBOL_KEYS.styleFill, state);
12768
+ }
12769
+ function styleStrokeIcon(state) {
12770
+ return symbolIcon(OVERLAY_SYMBOL_KEYS.styleStroke, state);
12771
+ }
12772
+ function styleColorIcon(state) {
12773
+ return symbolIcon(OVERLAY_SYMBOL_KEYS.styleColor, state);
12774
+ }
12775
+ function styleFontSizeIcon(state) {
12776
+ return symbolIcon(OVERLAY_SYMBOL_KEYS.styleFontSize, state);
12777
+ }
12748
12778
  // src/Overlay/overlayRegistry.ts
12749
12779
  var itemOverlays = {};
12750
12780
  var toolOverlays = {};
@@ -40277,7 +40307,7 @@ var richTextOverlay = {
40277
40307
  {
40278
40308
  id: "text.fontSize",
40279
40309
  label: "Font size",
40280
- icon: { kind: "symbol", key: "text.fontSize" },
40310
+ icon: styleFontSizeIcon(),
40281
40311
  target: "each",
40282
40312
  controls: [
40283
40313
  {
@@ -46516,6 +46546,7 @@ class Group extends BaseItem {
46516
46546
  transformationRenderBlock = undefined;
46517
46547
  isLockedGroup = false;
46518
46548
  static movingGroupId = null;
46549
+ static reparentingGroupId = null;
46519
46550
  constructor(board, id = "") {
46520
46551
  super(board, id);
46521
46552
  this.index = new SimpleSpatialIndex(this.board.camera, this.board.pointer);
@@ -46581,6 +46612,23 @@ class Group extends BaseItem {
46581
46612
  this.apply(operation);
46582
46613
  }
46583
46614
  }
46615
+ applyAddChildren(childIds) {
46616
+ Group.reparentingGroupId = this.getId();
46617
+ super.applyAddChildren(childIds);
46618
+ Group.reparentingGroupId = null;
46619
+ for (const child of this.index?.listAll() || []) {
46620
+ child.subject.publish(child);
46621
+ }
46622
+ }
46623
+ applyRemoveChildren(childIds) {
46624
+ Group.reparentingGroupId = this.getId();
46625
+ super.applyRemoveChildren(childIds);
46626
+ Group.reparentingGroupId = null;
46627
+ for (const childId of childIds) {
46628
+ const child = this.board.items.getById(childId);
46629
+ child?.subject.publish(child);
46630
+ }
46631
+ }
46584
46632
  setId(id) {
46585
46633
  this.id = id;
46586
46634
  this.transformation.setId(id);
@@ -46689,12 +46737,12 @@ var COLOR_PALETTE = [
46689
46737
  "#118AB2",
46690
46738
  "#7B61FF"
46691
46739
  ];
46692
- var symbolIcon = (key) => ({ kind: "symbol", key });
46740
+ var symbolIcon2 = (key) => ({ kind: "symbol", key });
46693
46741
  var lineStyleOptions = ConnectorLineStyles.map((style) => ({
46694
46742
  id: style,
46695
46743
  label: style[0].toUpperCase() + style.slice(1),
46696
46744
  value: style,
46697
- icon: symbolIcon(`connector.lineStyle.${style}`)
46745
+ icon: symbolIcon2(`connector.lineStyle.${style}`)
46698
46746
  }));
46699
46747
  var lineWidthOptions = ConnectionLineWidths.map((width) => ({
46700
46748
  id: `${width}`,
@@ -46705,13 +46753,13 @@ var pointerOptions = CONNECTOR_POINTER_TYPES.map((pointer) => ({
46705
46753
  id: pointer,
46706
46754
  label: pointer,
46707
46755
  value: pointer,
46708
- icon: symbolIcon(`connector.pointer.${pointer}`)
46756
+ icon: symbolIcon2(`connector.pointer.${pointer}`)
46709
46757
  }));
46710
46758
  var borderStyleOptions = ["solid", "dot", "dash", "longDash"].map((style) => ({
46711
46759
  id: style,
46712
46760
  label: style,
46713
46761
  value: style,
46714
- icon: symbolIcon(`stroke.${style}`)
46762
+ icon: symbolIcon2(`stroke.${style}`)
46715
46763
  }));
46716
46764
  var connectorStyleControls = [
46717
46765
  {
@@ -46766,7 +46814,7 @@ var connectorStyleControls = [
46766
46814
  {
46767
46815
  id: "smartJump",
46768
46816
  label: "Smart jump",
46769
- icon: symbolIcon("connector.smartJump"),
46817
+ icon: symbolIcon2("connector.smartJump"),
46770
46818
  valueSource: { kind: "itemProperty", property: "smartJump" },
46771
46819
  editor: { kind: "toggle", trueLabel: "On", falseLabel: "Off" },
46772
46820
  invoke: { kind: "setProperty", property: "smartJump" }
@@ -46825,7 +46873,7 @@ var connectorToolControls = [
46825
46873
  {
46826
46874
  id: "toolSmartJump",
46827
46875
  label: "Smart jump",
46828
- icon: symbolIcon("connector.smartJump"),
46876
+ icon: symbolIcon2("connector.smartJump"),
46829
46877
  valueSource: { kind: "toolProperty", property: "smartJump" },
46830
46878
  editor: { kind: "toggle", trueLabel: "On", falseLabel: "Off" },
46831
46879
  invoke: { kind: "toolProperty", property: "smartJump" }
@@ -46837,21 +46885,21 @@ var connectorOverlay = {
46837
46885
  {
46838
46886
  id: "connector.switchPointers",
46839
46887
  label: "Switch arrows",
46840
- icon: symbolIcon("connector.switchPointers"),
46888
+ icon: symbolIcon2("connector.switchPointers"),
46841
46889
  target: "selection",
46842
46890
  invoke: { kind: "operation", class: "Connector", method: "switchPointers" }
46843
46891
  },
46844
46892
  {
46845
46893
  id: "connector.style",
46846
46894
  label: "Connector style",
46847
- icon: symbolIcon("connector.style"),
46895
+ icon: symbolIcon2("connector.style"),
46848
46896
  target: "each",
46849
46897
  controls: connectorStyleControls,
46850
46898
  groups: [
46851
46899
  {
46852
46900
  id: "connectorStyle",
46853
46901
  label: "Connector style",
46854
- icon: symbolIcon("connector.style"),
46902
+ icon: symbolIcon2("connector.style"),
46855
46903
  controlIds: connectorStyleControls.map((control) => control.id)
46856
46904
  }
46857
46905
  ]
@@ -46878,7 +46926,7 @@ var addConnectorToolOverlay = {
46878
46926
  {
46879
46927
  id: "connectorToolStyle",
46880
46928
  label: "Connector defaults",
46881
- icon: symbolIcon("connector.style"),
46929
+ icon: symbolIcon2("connector.style"),
46882
46930
  controlIds: connectorToolControls.map((control) => control.id)
46883
46931
  }
46884
46932
  ]
@@ -47030,7 +47078,7 @@ class Connector2 extends BaseItem {
47030
47078
  }
47031
47079
  this.text = new RichText(this.board, this.id);
47032
47080
  this.text.container = this.getMbr();
47033
- this.text.transformation = new Transformation;
47081
+ this.text.transformation = this.transformation;
47034
47082
  this.text.linkTo = this.linkTo;
47035
47083
  this.text.placeholderText = conf.i18n.t("connector.textPlaceholder", {
47036
47084
  ns: "default"
@@ -47075,6 +47123,10 @@ class Connector2 extends BaseItem {
47075
47123
  observerStartPointItem = () => {
47076
47124
  const point3 = this.startPoint;
47077
47125
  if (point3.pointType !== "Board") {
47126
+ const reparentingGroupId = Group.reparentingGroupId;
47127
+ if (reparentingGroupId !== null && (this.parent === reparentingGroupId || point3.item instanceof BaseItem && point3.item.parent === reparentingGroupId)) {
47128
+ return;
47129
+ }
47078
47130
  const movingGroupId = Group.movingGroupId;
47079
47131
  if (movingGroupId !== null && this.parent === movingGroupId && point3.item instanceof BaseItem && point3.item.parent === movingGroupId) {
47080
47132
  return;
@@ -47093,6 +47145,10 @@ class Connector2 extends BaseItem {
47093
47145
  observerEndPointItem = () => {
47094
47146
  const point3 = this.endPoint;
47095
47147
  if (point3.pointType !== "Board") {
47148
+ const reparentingGroupId = Group.reparentingGroupId;
47149
+ if (reparentingGroupId !== null && (this.parent === reparentingGroupId || point3.item instanceof BaseItem && point3.item.parent === reparentingGroupId)) {
47150
+ return;
47151
+ }
47096
47152
  const movingGroupId = Group.movingGroupId;
47097
47153
  if (movingGroupId !== null && this.parent === movingGroupId && point3.item instanceof BaseItem && point3.item.parent === movingGroupId) {
47098
47154
  return;
@@ -61017,7 +61073,7 @@ var inlineShapeAsset = (folder, file2 = folder) => ({
61017
61073
  path: `src/Items/Shape/Basic/${folder}/${file2}.icon.svg`,
61018
61074
  mimeType: "image/svg+xml"
61019
61075
  });
61020
- var symbolIcon2 = (key) => ({ kind: "symbol", key });
61076
+ var symbolIcon3 = (key) => ({ kind: "symbol", key });
61021
61077
  var BASIC_INLINE_OPTIONS = [
61022
61078
  { id: "rectangle", label: "Rectangle", value: "Rectangle", icon: inlineShapeAsset("Rectangle") },
61023
61079
  { id: "rounded-rectangle", label: "Rounded rectangle", value: "RoundedRectangle", icon: inlineShapeAsset("RoundedRectangle") },
@@ -61027,48 +61083,48 @@ var BASIC_INLINE_OPTIONS = [
61027
61083
  ];
61028
61084
  var SHAPE_CATALOG_OPTIONS = [
61029
61085
  ...BASIC_INLINE_OPTIONS,
61030
- { id: "reversed-triangle", label: "Reversed triangle", value: "ReversedTriangle", icon: symbolIcon2("shape.reversedTriangle") },
61086
+ { id: "reversed-triangle", label: "Reversed triangle", value: "ReversedTriangle", icon: symbolIcon3("shape.reversedTriangle") },
61031
61087
  { id: "arrow-left", label: "Arrow left", value: "ArrowLeft", icon: inlineShapeAsset("ArrowLeft") },
61032
61088
  { id: "arrow-right", label: "Arrow right", value: "ArrowRight", icon: inlineShapeAsset("ArrowRight") },
61033
61089
  { id: "arrow-left-right", label: "Arrow left right", value: "ArrowLeftRight", icon: inlineShapeAsset("ArrowLeftRight") },
61034
- { id: "arrow-block-left", label: "Arrow block left", value: "ArrowBlockLeft", icon: symbolIcon2("shape.arrowBlockLeft") },
61035
- { id: "arrow-block-right", label: "Arrow block right", value: "ArrowBlockRight", icon: symbolIcon2("shape.arrowBlockRight") },
61090
+ { id: "arrow-block-left", label: "Arrow block left", value: "ArrowBlockLeft", icon: symbolIcon3("shape.arrowBlockLeft") },
61091
+ { id: "arrow-block-right", label: "Arrow block right", value: "ArrowBlockRight", icon: symbolIcon3("shape.arrowBlockRight") },
61036
61092
  { id: "cloud", label: "Cloud", value: "Cloud", icon: inlineShapeAsset("Cloud") },
61037
61093
  { id: "cross", label: "Cross", value: "Cross", icon: inlineShapeAsset("Cross") },
61038
61094
  { id: "cylinder", label: "Cylinder", value: "Cylinder", icon: inlineShapeAsset("Cylinder") },
61039
61095
  { id: "hexagon", label: "Hexagon", value: "Hexagon", icon: inlineShapeAsset("Hexagon") },
61040
61096
  { id: "octagon", label: "Octagon", value: "Octagon", icon: inlineShapeAsset("Octagon") },
61041
61097
  { id: "parallelogram", label: "Parallelogram", value: "Parallelogram", icon: inlineShapeAsset("Parallelogram") },
61042
- { id: "reversed-parallelogram", label: "Reversed parallelogram", value: "ReversedParallelogram", icon: symbolIcon2("shape.reversedParallelogram") },
61098
+ { id: "reversed-parallelogram", label: "Reversed parallelogram", value: "ReversedParallelogram", icon: symbolIcon3("shape.reversedParallelogram") },
61043
61099
  { id: "pentagon", label: "Pentagon", value: "Pentagon", icon: inlineShapeAsset("Pentagon") },
61044
- { id: "predefined-process", label: "Predefined process", value: "PredefinedProcess", icon: symbolIcon2("shape.predefinedProcess") },
61100
+ { id: "predefined-process", label: "Predefined process", value: "PredefinedProcess", icon: symbolIcon3("shape.predefinedProcess") },
61045
61101
  { id: "speech-bubble", label: "Speech bubble", value: "SpeachBubble", icon: inlineShapeAsset("SpeachBubble") },
61046
61102
  { id: "star", label: "Star", value: "Star", icon: inlineShapeAsset("Star") },
61047
61103
  { id: "trapezoid", label: "Trapezoid", value: "Trapezoid", icon: inlineShapeAsset("Trapezoid") },
61048
61104
  { id: "braces-left", label: "Braces left", value: "BracesLeft", icon: inlineShapeAsset("BracesLeft", "BracesLeft") },
61049
61105
  { id: "braces-right", label: "Braces right", value: "BracesRight", icon: inlineShapeAsset("BracesRight", "BracesRight") },
61050
- { id: "bpmn-task", label: "BPMN task", value: "BPMN_Task", icon: symbolIcon2("shape.bpmn.task") },
61051
- { id: "bpmn-gateway", label: "BPMN gateway", value: "BPMN_Gateway", icon: symbolIcon2("shape.bpmn.gateway") },
61052
- { id: "bpmn-gateway-parallel", label: "BPMN gateway parallel", value: "BPMN_GatewayParallel", icon: symbolIcon2("shape.bpmn.gatewayParallel") },
61053
- { id: "bpmn-gateway-xor", label: "BPMN gateway XOR", value: "BPMN_GatewayXOR", icon: symbolIcon2("shape.bpmn.gatewayXor") },
61054
- { id: "bpmn-start-event", label: "BPMN start event", value: "BPMN_StartEvent", icon: symbolIcon2("shape.bpmn.startEvent") },
61055
- { id: "bpmn-start-event-non-interrupting", label: "BPMN start event non interrupting", value: "BPMN_StartEventNoneInterrupting", icon: symbolIcon2("shape.bpmn.startEventNoneInterrupting") },
61056
- { id: "bpmn-end-event", label: "BPMN end event", value: "BPMN_EndEvent", icon: symbolIcon2("shape.bpmn.endEvent") },
61057
- { id: "bpmn-intermediate-event", label: "BPMN intermediate event", value: "BPMN_IntermediateEvent", icon: symbolIcon2("shape.bpmn.intermediateEvent") },
61058
- { id: "bpmn-intermediate-event-none-interrupting", label: "BPMN intermediate event none interrupting", value: "BPMN_IntermediateEventNoneInterrupting", icon: symbolIcon2("shape.bpmn.intermediateEventNoneInterrupting") },
61059
- { id: "bpmn-data-object", label: "BPMN data object", value: "BPMN_DataObject", icon: symbolIcon2("shape.bpmn.dataObject") },
61060
- { id: "bpmn-data-store", label: "BPMN data store", value: "BPMN_DataStore", icon: symbolIcon2("shape.bpmn.dataStore") },
61061
- { id: "bpmn-participant", label: "BPMN participant", value: "BPMN_Participant", icon: symbolIcon2("shape.bpmn.participant") },
61062
- { id: "bpmn-transaction", label: "BPMN transaction", value: "BPMN_Transaction", icon: symbolIcon2("shape.bpmn.transaction") },
61063
- { id: "bpmn-event-subprocess", label: "BPMN event subprocess", value: "BPMN_EventSubprocess", icon: symbolIcon2("shape.bpmn.eventSubprocess") },
61064
- { id: "bpmn-group", label: "BPMN group", value: "BPMN_Group", icon: symbolIcon2("shape.bpmn.group") },
61065
- { id: "bpmn-annotation", label: "BPMN annotation", value: "BPMN_Annotation", icon: symbolIcon2("shape.bpmn.annotation") }
61106
+ { id: "bpmn-task", label: "BPMN task", value: "BPMN_Task", icon: symbolIcon3("shape.bpmn.task") },
61107
+ { id: "bpmn-gateway", label: "BPMN gateway", value: "BPMN_Gateway", icon: symbolIcon3("shape.bpmn.gateway") },
61108
+ { id: "bpmn-gateway-parallel", label: "BPMN gateway parallel", value: "BPMN_GatewayParallel", icon: symbolIcon3("shape.bpmn.gatewayParallel") },
61109
+ { id: "bpmn-gateway-xor", label: "BPMN gateway XOR", value: "BPMN_GatewayXOR", icon: symbolIcon3("shape.bpmn.gatewayXor") },
61110
+ { id: "bpmn-start-event", label: "BPMN start event", value: "BPMN_StartEvent", icon: symbolIcon3("shape.bpmn.startEvent") },
61111
+ { id: "bpmn-start-event-non-interrupting", label: "BPMN start event non interrupting", value: "BPMN_StartEventNoneInterrupting", icon: symbolIcon3("shape.bpmn.startEventNoneInterrupting") },
61112
+ { id: "bpmn-end-event", label: "BPMN end event", value: "BPMN_EndEvent", icon: symbolIcon3("shape.bpmn.endEvent") },
61113
+ { id: "bpmn-intermediate-event", label: "BPMN intermediate event", value: "BPMN_IntermediateEvent", icon: symbolIcon3("shape.bpmn.intermediateEvent") },
61114
+ { id: "bpmn-intermediate-event-none-interrupting", label: "BPMN intermediate event none interrupting", value: "BPMN_IntermediateEventNoneInterrupting", icon: symbolIcon3("shape.bpmn.intermediateEventNoneInterrupting") },
61115
+ { id: "bpmn-data-object", label: "BPMN data object", value: "BPMN_DataObject", icon: symbolIcon3("shape.bpmn.dataObject") },
61116
+ { id: "bpmn-data-store", label: "BPMN data store", value: "BPMN_DataStore", icon: symbolIcon3("shape.bpmn.dataStore") },
61117
+ { id: "bpmn-participant", label: "BPMN participant", value: "BPMN_Participant", icon: symbolIcon3("shape.bpmn.participant") },
61118
+ { id: "bpmn-transaction", label: "BPMN transaction", value: "BPMN_Transaction", icon: symbolIcon3("shape.bpmn.transaction") },
61119
+ { id: "bpmn-event-subprocess", label: "BPMN event subprocess", value: "BPMN_EventSubprocess", icon: symbolIcon3("shape.bpmn.eventSubprocess") },
61120
+ { id: "bpmn-group", label: "BPMN group", value: "BPMN_Group", icon: symbolIcon3("shape.bpmn.group") },
61121
+ { id: "bpmn-annotation", label: "BPMN annotation", value: "BPMN_Annotation", icon: symbolIcon3("shape.bpmn.annotation") }
61066
61122
  ];
61067
61123
  var BORDER_STYLE_OPTIONS = [
61068
- { id: "solid", label: "Solid", value: "solid", icon: symbolIcon2("stroke.solid") },
61069
- { id: "dot", label: "Dot", value: "dot", icon: symbolIcon2("stroke.dot") },
61070
- { id: "dash", label: "Dash", value: "dash", icon: symbolIcon2("stroke.dash") },
61071
- { id: "long-dash", label: "Long dash", value: "longDash", icon: symbolIcon2("stroke.longDash") }
61124
+ { id: "solid", label: "Solid", value: "solid", icon: symbolIcon3("stroke.solid") },
61125
+ { id: "dot", label: "Dot", value: "dot", icon: symbolIcon3("stroke.dot") },
61126
+ { id: "dash", label: "Dash", value: "dash", icon: symbolIcon3("stroke.dash") },
61127
+ { id: "long-dash", label: "Long dash", value: "longDash", icon: symbolIcon3("stroke.longDash") }
61072
61128
  ];
61073
61129
  var shapeTypeControl = {
61074
61130
  id: "shapeType",
@@ -61091,14 +61147,10 @@ var fillControl = {
61091
61147
  id: "backgroundColor",
61092
61148
  label: "Fill",
61093
61149
  valueSource: { kind: "itemProperty", property: "backgroundColor" },
61094
- icon: {
61095
- kind: "symbol",
61096
- key: "shape.fill",
61097
- state: {
61098
- swatch: { kind: "itemProperty", property: "backgroundColor" },
61099
- note: "UI can render the current fill color as a swatch inside the icon."
61100
- }
61101
- },
61150
+ icon: styleFillIcon({
61151
+ swatch: { kind: "itemProperty", property: "backgroundColor" },
61152
+ note: "UI can render the current fill color as a swatch inside the icon."
61153
+ }),
61102
61154
  editor: {
61103
61155
  kind: "color",
61104
61156
  palette: COLOR_PALETTE2,
@@ -61149,7 +61201,7 @@ var shapeOverlay = {
61149
61201
  {
61150
61202
  id: "shape.shapeType",
61151
61203
  label: "Shape type",
61152
- icon: symbolIcon2("shape.type"),
61204
+ icon: symbolIcon3("shape.type"),
61153
61205
  target: "each",
61154
61206
  controls: [shapeTypeControl]
61155
61207
  },
@@ -61163,14 +61215,14 @@ var shapeOverlay = {
61163
61215
  {
61164
61216
  id: "shape.strokeStyle",
61165
61217
  label: "Stroke style",
61166
- icon: symbolIcon2("shape.stroke"),
61218
+ icon: styleStrokeIcon(),
61167
61219
  target: "each",
61168
61220
  controls: strokeControls,
61169
61221
  groups: [
61170
61222
  {
61171
61223
  id: "shapeStrokeStyle",
61172
61224
  label: "Stroke style",
61173
- icon: symbolIcon2("shape.stroke"),
61225
+ icon: styleStrokeIcon(),
61174
61226
  controlIds: strokeControls.map((control) => control.id)
61175
61227
  }
61176
61228
  ]
@@ -64536,6 +64588,9 @@ class AINode extends BaseItem {
64536
64588
  getLinkTo() {
64537
64589
  return this.linkTo.link;
64538
64590
  }
64591
+ getRichText() {
64592
+ return this.text;
64593
+ }
64539
64594
  renderButton(context) {
64540
64595
  const { left, right, top, bottom } = this.buttonMbr;
64541
64596
  const { ctx } = context;
@@ -66541,11 +66596,9 @@ var diceOverlay = {
66541
66596
  {
66542
66597
  id: "dice.fill",
66543
66598
  label: "Fill",
66544
- icon: {
66545
- kind: "symbol",
66546
- key: "shape.fill",
66547
- state: { swatch: { kind: "itemProperty", property: "backgroundColor" } }
66548
- },
66599
+ icon: styleFillIcon({
66600
+ swatch: { kind: "itemProperty", property: "backgroundColor" }
66601
+ }),
66549
66602
  target: "each",
66550
66603
  controls: [
66551
66604
  {
@@ -76798,7 +76851,10 @@ class Board {
76798
76851
  return parseHTML(el);
76799
76852
  }
76800
76853
  add(item, timeStamp) {
76801
- const id = this.getNewItemId();
76854
+ const id = item.getId() || this.getNewItemId();
76855
+ if (!item.getId()) {
76856
+ item.setId(id);
76857
+ }
76802
76858
  this.emit({
76803
76859
  class: "Board",
76804
76860
  method: "add",
@@ -76813,6 +76869,17 @@ class Board {
76813
76869
  this.handleNesting(newItem);
76814
76870
  return newItem;
76815
76871
  }
76872
+ createItemAndAdd(itemType, data, timeStamp) {
76873
+ const id = data.id || this.getNewItemId();
76874
+ const fullData = { ...data, itemType, id };
76875
+ const item = this.createItem(id, fullData);
76876
+ if (item.itemType === "Connector" && data.startPoint && data.endPoint) {
76877
+ const conn = item;
76878
+ conn.apply({ class: "Connector", method: "setStartPoint", startPointData: data.startPoint });
76879
+ conn.apply({ class: "Connector", method: "setEndPoint", endPointData: data.endPoint });
76880
+ }
76881
+ return this.add(item, timeStamp);
76882
+ }
76816
76883
  addLockedGroup(items) {
76817
76884
  const id = this.getNewItemId();
76818
76885
  const groupData = {
@@ -77682,6 +77749,165 @@ function validateTransformationData(transformationData) {
77682
77749
  function validatePointData(pointData) {
77683
77750
  return PointSchema.safeParse(pointData).success;
77684
77751
  }
77752
+ // src/Import/Miro/MiroItemConverter.ts
77753
+ var SHAPE_TYPES = {
77754
+ round_rectangle: "RoundedRectangle",
77755
+ circle: "Circle",
77756
+ triangle: "Triangle",
77757
+ rhombus: "Rhombus",
77758
+ wedge_round_rectangle_callout: "SpeachBubble",
77759
+ parallelogram: "Parallelogram",
77760
+ star: "Star",
77761
+ right_arrow: "ArrowRight",
77762
+ left_arrow: "ArrowLeft",
77763
+ rectangle: "Rectangle",
77764
+ left_right_arrow: "ArrowLeftRight",
77765
+ pentagon: "Pentagon",
77766
+ octagon: "Octagon",
77767
+ hexagon: "Hexagon",
77768
+ flow_chart_predefined_process: "PredefinedProcess",
77769
+ trapezoid: "Trapezoid",
77770
+ cloud: "Cloud",
77771
+ cross: "Cross",
77772
+ can: "Cylinder",
77773
+ left_brace: "BracesRight",
77774
+ right_brace: "BracesLeft"
77775
+ };
77776
+ var BORDER_STYLES = {
77777
+ normal: "solid",
77778
+ dotted: "dot",
77779
+ dashed: "dash"
77780
+ };
77781
+ var STICKER_COLOR_MAP = {
77782
+ dark_blue: 2,
77783
+ blue: 2,
77784
+ light_blue: 3,
77785
+ red: 1,
77786
+ orange: 6,
77787
+ violet: 0,
77788
+ pink: 1,
77789
+ light_pink: 1,
77790
+ cyan: 5,
77791
+ dark_green: 4,
77792
+ green: 4,
77793
+ light_green: 4,
77794
+ yellow: 7,
77795
+ light_yellow: 7,
77796
+ gray: 8,
77797
+ black: 9
77798
+ };
77799
+ var FRAME_TYPES2 = {
77800
+ custom: "Custom",
77801
+ a4: "A4",
77802
+ letter: "Letter",
77803
+ ratio_16x9: "Frame16x9",
77804
+ ratio_4x3: "Frame4x3",
77805
+ ratio_1x1: "Frame1x1",
77806
+ phone: "Custom",
77807
+ tablet: "Custom",
77808
+ desktop: "Custom"
77809
+ };
77810
+ var CONNECTOR_LINE_STYLES = {
77811
+ straight: "straight",
77812
+ curved: "curved",
77813
+ elbowed: "orthogonal"
77814
+ };
77815
+ var CONNECTOR_POINTER_STYLES = {
77816
+ stealth: "ArrowBroad",
77817
+ "Arc Arrow": "ArrowThin",
77818
+ filled_triangle: "Angle",
77819
+ arrow: "ArrowThin",
77820
+ triangle: "TriangleEmpty",
77821
+ filled_diamond: "DiamondFilled",
77822
+ diamond: "DiamondEmpty",
77823
+ filled_oval: "CircleFilled",
77824
+ oval: "Zero",
77825
+ erd_one: "One",
77826
+ erd_many: "Many",
77827
+ erd_one_or_many: "ManyMandatory",
77828
+ erd_only_one: "OneMandatory",
77829
+ erd_zero_or_many: "ManyOptional",
77830
+ erd_zero_or_one: "OneOptional"
77831
+ };
77832
+
77833
+ class MiroItemConverter {
77834
+ static convert(miroItem) {
77835
+ const { type, style: style2, data, geometry, position: position4, id, linkTo, parent } = miroItem;
77836
+ const baseData = {
77837
+ id,
77838
+ parent: parent?.id || "Board",
77839
+ linkTo
77840
+ };
77841
+ switch (type) {
77842
+ case "shape":
77843
+ return {
77844
+ ...baseData,
77845
+ itemType: "Shape",
77846
+ shapeType: SHAPE_TYPES[data?.shape] || "Rectangle",
77847
+ backgroundColor: MiroItemConverter.convertColor(style2?.fillColor, "transparent"),
77848
+ backgroundOpacity: style2?.fillOpacity ? parseFloat(style2.fillOpacity) : 1,
77849
+ borderColor: MiroItemConverter.convertColor(style2?.borderColor),
77850
+ borderOpacity: style2?.borderOpacity ? parseFloat(style2.borderOpacity) : 1,
77851
+ borderStyle: BORDER_STYLES[style2?.borderStyle || "normal"] || "solid",
77852
+ borderWidth: style2?.borderWidth ? parseFloat(style2.borderWidth) : 2
77853
+ };
77854
+ case "sticky_note":
77855
+ const colorIdx = STICKER_COLOR_MAP[style2?.fillColor || "yellow"] ?? 7;
77856
+ return {
77857
+ ...baseData,
77858
+ itemType: "Sticker",
77859
+ backgroundColor: coerceColorValue(conf.STICKER_COLORS[colorIdx])
77860
+ };
77861
+ case "text":
77862
+ return {
77863
+ ...baseData,
77864
+ itemType: "RichText"
77865
+ };
77866
+ case "frame":
77867
+ return {
77868
+ ...baseData,
77869
+ itemType: "Frame",
77870
+ title: data?.title || "Frame",
77871
+ frameType: FRAME_TYPES2[data?.format] || "Custom",
77872
+ backgroundColor: MiroItemConverter.convertColor(style2?.fillColor)
77873
+ };
77874
+ case "connector":
77875
+ return {
77876
+ ...baseData,
77877
+ itemType: "Connector",
77878
+ lineColor: MiroItemConverter.convertColor(style2?.strokeColor),
77879
+ lineStyle: CONNECTOR_LINE_STYLES[miroItem.shape || "straight"] || "straight",
77880
+ lineWidth: style2?.strokeWidth ? parseFloat(style2.strokeWidth) : 1,
77881
+ startPointerStyle: CONNECTOR_POINTER_STYLES[style2?.startStrokeCap || ""] || "None",
77882
+ endPointerStyle: CONNECTOR_POINTER_STYLES[style2?.endStrokeCap || ""] || "ArrowThin"
77883
+ };
77884
+ case "image":
77885
+ return {
77886
+ ...baseData,
77887
+ itemType: "Image"
77888
+ };
77889
+ case "paint":
77890
+ return {
77891
+ ...baseData,
77892
+ itemType: "Drawing",
77893
+ strokeColor: MiroItemConverter.convertColor(style2?.color),
77894
+ strokeWidth: style2?.strokeWidth ? parseFloat(style2.strokeWidth) : 2,
77895
+ strokeOpacity: style2?.strokeOpacity ?? 1
77896
+ };
77897
+ default:
77898
+ return {
77899
+ ...baseData,
77900
+ itemType: "Placeholder"
77901
+ };
77902
+ }
77903
+ }
77904
+ static convertColor(color2, fallback = "black") {
77905
+ if (!color2)
77906
+ return coerceColorValue(fallback);
77907
+ const hex3 = color2 === "#ffffff" ? "transparent" : color2;
77908
+ return coerceColorValue(hex3);
77909
+ }
77910
+ }
77685
77911
  // src/api/initI18N.ts
77686
77912
  function initI18N(i18nInstance) {
77687
77913
  conf.i18n = i18nInstance;