microboard-temp 0.14.44 → 0.14.46

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.
@@ -649,6 +649,7 @@ __export(exports_browser, {
649
649
  sha256: () => sha256,
650
650
  semanticColor: () => semanticColor,
651
651
  selectionActions: () => selectionActions,
652
+ selectionActionSections: () => selectionActionSections,
652
653
  scalePatterns: () => scalePatterns,
653
654
  scaleElementBy: () => scaleElementBy,
654
655
  rgbToRgba: () => rgbToRgba,
@@ -661,6 +662,7 @@ __export(exports_browser, {
661
662
  renderLinkToHTML: () => renderLinkToHTML,
662
663
  relativeLuminance: () => relativeLuminance,
663
664
  registerToolOverlay: () => registerToolOverlay,
665
+ registerSelectionActionSection: () => registerSelectionActionSection,
664
666
  registerSelectionAction: () => registerSelectionAction,
665
667
  registerItemOverlay: () => registerItemOverlay,
666
668
  registerItem: () => registerItem,
@@ -683,6 +685,7 @@ __export(exports_browser, {
683
685
  matchesOverlayCondition: () => matchesOverlayCondition,
684
686
  listToolOverlays: () => listToolOverlays,
685
687
  listSelectionActions: () => listSelectionActions,
688
+ listSelectionActionSections: () => listSelectionActionSections,
686
689
  listRegisteredItemTypes: () => listRegisteredItemTypes,
687
690
  listCreateSurfaceEntries: () => listCreateSurfaceEntries,
688
691
  itemSchemas: () => itemSchemas2,
@@ -11786,6 +11789,7 @@ var itemOverlays = {};
11786
11789
  var toolOverlays = {};
11787
11790
  var dynamicOptionsResolvers = {};
11788
11791
  var selectionActions = {};
11792
+ var selectionActionSections = {};
11789
11793
  function registerItemOverlay(overlay) {
11790
11794
  itemOverlays[overlay.itemType] = overlay;
11791
11795
  }
@@ -11795,6 +11799,9 @@ function registerToolOverlay(overlay) {
11795
11799
  function registerSelectionAction(action) {
11796
11800
  selectionActions[action.id] = action;
11797
11801
  }
11802
+ function registerSelectionActionSection(section) {
11803
+ selectionActionSections[section.id] = section;
11804
+ }
11798
11805
  function registerDynamicOptionsResolver(id, resolver) {
11799
11806
  dynamicOptionsResolvers[id] = resolver;
11800
11807
  }
@@ -11850,6 +11857,9 @@ function listCreateSurfaceEntries() {
11850
11857
  function listSelectionActions() {
11851
11858
  return Object.values(selectionActions);
11852
11859
  }
11860
+ function listSelectionActionSections() {
11861
+ return Object.values(selectionActionSections);
11862
+ }
11853
11863
  function getSelectionOverlayActions(items) {
11854
11864
  return Object.values(selectionActions).filter((action) => action.isAvailable?.(items) ?? true);
11855
11865
  }
@@ -64886,6 +64896,25 @@ class Shape extends BaseItem {
64886
64896
  this.subject.publish(this);
64887
64897
  }
64888
64898
  onPropertyUpdated(property, value, prevValue) {
64899
+ switch (property) {
64900
+ case "shapeType":
64901
+ this.initPath();
64902
+ break;
64903
+ case "backgroundOpacity":
64904
+ this.path.setBackgroundOpacity(value);
64905
+ break;
64906
+ case "borderOpacity":
64907
+ this.path.setBorderOpacity(value);
64908
+ break;
64909
+ case "borderStyle":
64910
+ this.path.setBorderStyle(value);
64911
+ break;
64912
+ case "borderWidth":
64913
+ this.path.setBorderWidth(value);
64914
+ break;
64915
+ default:
64916
+ break;
64917
+ }
64889
64918
  super.onPropertyUpdated(property, value, prevValue);
64890
64919
  this.saveShapeData();
64891
64920
  }
@@ -73913,12 +73942,39 @@ class Presence {
73913
73942
  function everyItemHasRichText(items) {
73914
73943
  return items.length > 0 && items.every((item) => !!item.getRichText?.());
73915
73944
  }
73945
+ registerSelectionActionSection({
73946
+ id: "selectionTextSize",
73947
+ label: "Text size",
73948
+ actionIds: ["selection.text.fontSize"]
73949
+ });
73950
+ registerSelectionActionSection({
73951
+ id: "selectionTextColors",
73952
+ label: "Text colors",
73953
+ actionIds: ["selection.text.color", "selection.text.highlight"]
73954
+ });
73955
+ registerSelectionActionSection({
73956
+ id: "selectionArrange",
73957
+ label: "Arrange",
73958
+ actionIds: ["selection.bringToFront", "selection.sendToBack"]
73959
+ });
73960
+ registerSelectionActionSection({
73961
+ id: "selectionActions",
73962
+ label: "Actions",
73963
+ actionIds: [
73964
+ "selection.duplicate",
73965
+ "selection.lock",
73966
+ "selection.unlock",
73967
+ "selection.delete"
73968
+ ]
73969
+ });
73916
73970
  registerSelectionAction({
73917
73971
  id: "selection.delete",
73918
73972
  label: "Delete",
73919
73973
  icon: symbolIcon("Delete"),
73920
73974
  description: "Removes the selected items from the board.",
73921
73975
  invoke: { kind: "selectionMethod", methodName: "removeFromBoard" },
73976
+ sectionId: "selectionActions",
73977
+ order: 4,
73922
73978
  isAvailable: (items) => items.length > 0
73923
73979
  });
73924
73980
  registerSelectionAction({
@@ -73927,6 +73983,8 @@ registerSelectionAction({
73927
73983
  icon: symbolIcon("Duplicate"),
73928
73984
  description: "Duplicates the selected items.",
73929
73985
  invoke: { kind: "selectionMethod", methodName: "duplicate" },
73986
+ sectionId: "selectionActions",
73987
+ order: 1,
73930
73988
  isAvailable: (items) => items.length > 0
73931
73989
  });
73932
73990
  registerSelectionAction({
@@ -73935,6 +73993,8 @@ registerSelectionAction({
73935
73993
  icon: symbolIcon("unlock"),
73936
73994
  description: "Locks the selected items.",
73937
73995
  invoke: { kind: "selectionMethod", methodName: "lock" },
73996
+ sectionId: "selectionActions",
73997
+ order: 2,
73938
73998
  isAvailable: (items) => items.length > 0 && !items.some((item) => item.transformation.isLocked)
73939
73999
  });
73940
74000
  registerSelectionAction({
@@ -73943,6 +74003,8 @@ registerSelectionAction({
73943
74003
  icon: symbolIcon("lock"),
73944
74004
  description: "Unlocks the selected items.",
73945
74005
  invoke: { kind: "selectionMethod", methodName: "unlock" },
74006
+ sectionId: "selectionActions",
74007
+ order: 2,
73946
74008
  isAvailable: (items) => items.some((item) => item.transformation.isLocked)
73947
74009
  });
73948
74010
  registerSelectionAction({
@@ -73951,6 +74013,8 @@ registerSelectionAction({
73951
74013
  icon: symbolIcon("BringToFront"),
73952
74014
  description: "Moves the selection above overlapping items.",
73953
74015
  invoke: { kind: "selectionMethod", methodName: "bringToFront" },
74016
+ sectionId: "selectionArrange",
74017
+ order: 1,
73954
74018
  isAvailable: (items) => items.length > 0
73955
74019
  });
73956
74020
  registerSelectionAction({
@@ -73959,6 +74023,8 @@ registerSelectionAction({
73959
74023
  icon: symbolIcon("SendToBack"),
73960
74024
  description: "Moves the selection behind overlapping items.",
73961
74025
  invoke: { kind: "selectionMethod", methodName: "sendToBack" },
74026
+ sectionId: "selectionArrange",
74027
+ order: 2,
73962
74028
  isAvailable: (items) => items.length > 0
73963
74029
  });
73964
74030
  registerSelectionAction({
@@ -73966,6 +74032,8 @@ registerSelectionAction({
73966
74032
  label: "Font size",
73967
74033
  icon: styleFontSizeIcon(),
73968
74034
  invoke: { kind: "selectionMethod", methodName: "setFontSize" },
74035
+ sectionId: "selectionTextSize",
74036
+ order: 1,
73969
74037
  controls: [
73970
74038
  {
73971
74039
  id: "fontSize",
@@ -73991,6 +74059,8 @@ registerSelectionAction({
73991
74059
  swatch: { kind: "selectionProperty", property: "getFontColor" }
73992
74060
  }),
73993
74061
  invoke: { kind: "selectionMethod", methodName: "setFontColor" },
74062
+ sectionId: "selectionTextColors",
74063
+ order: 1,
73994
74064
  controls: [
73995
74065
  {
73996
74066
  id: "fontColor",
@@ -74012,6 +74082,8 @@ registerSelectionAction({
74012
74082
  swatch: { kind: "selectionProperty", property: "getFontHighlight" }
74013
74083
  }),
74014
74084
  invoke: { kind: "selectionMethod", methodName: "setFontHighlight" },
74085
+ sectionId: "selectionTextColors",
74086
+ order: 2,
74015
74087
  controls: [
74016
74088
  {
74017
74089
  id: "fontHighlight",
package/dist/cjs/index.js CHANGED
@@ -649,6 +649,7 @@ __export(exports_src, {
649
649
  sha256: () => sha256,
650
650
  semanticColor: () => semanticColor,
651
651
  selectionActions: () => selectionActions,
652
+ selectionActionSections: () => selectionActionSections,
652
653
  scalePatterns: () => scalePatterns,
653
654
  scaleElementBy: () => scaleElementBy,
654
655
  rgbToRgba: () => rgbToRgba,
@@ -661,6 +662,7 @@ __export(exports_src, {
661
662
  renderLinkToHTML: () => renderLinkToHTML,
662
663
  relativeLuminance: () => relativeLuminance,
663
664
  registerToolOverlay: () => registerToolOverlay,
665
+ registerSelectionActionSection: () => registerSelectionActionSection,
664
666
  registerSelectionAction: () => registerSelectionAction,
665
667
  registerItemOverlay: () => registerItemOverlay,
666
668
  registerItem: () => registerItem,
@@ -683,6 +685,7 @@ __export(exports_src, {
683
685
  matchesOverlayCondition: () => matchesOverlayCondition,
684
686
  listToolOverlays: () => listToolOverlays,
685
687
  listSelectionActions: () => listSelectionActions,
688
+ listSelectionActionSections: () => listSelectionActionSections,
686
689
  listRegisteredItemTypes: () => listRegisteredItemTypes,
687
690
  listCreateSurfaceEntries: () => listCreateSurfaceEntries,
688
691
  itemSchemas: () => itemSchemas2,
@@ -11786,6 +11789,7 @@ var itemOverlays = {};
11786
11789
  var toolOverlays = {};
11787
11790
  var dynamicOptionsResolvers = {};
11788
11791
  var selectionActions = {};
11792
+ var selectionActionSections = {};
11789
11793
  function registerItemOverlay(overlay) {
11790
11794
  itemOverlays[overlay.itemType] = overlay;
11791
11795
  }
@@ -11795,6 +11799,9 @@ function registerToolOverlay(overlay) {
11795
11799
  function registerSelectionAction(action) {
11796
11800
  selectionActions[action.id] = action;
11797
11801
  }
11802
+ function registerSelectionActionSection(section) {
11803
+ selectionActionSections[section.id] = section;
11804
+ }
11798
11805
  function registerDynamicOptionsResolver(id, resolver) {
11799
11806
  dynamicOptionsResolvers[id] = resolver;
11800
11807
  }
@@ -11850,6 +11857,9 @@ function listCreateSurfaceEntries() {
11850
11857
  function listSelectionActions() {
11851
11858
  return Object.values(selectionActions);
11852
11859
  }
11860
+ function listSelectionActionSections() {
11861
+ return Object.values(selectionActionSections);
11862
+ }
11853
11863
  function getSelectionOverlayActions(items) {
11854
11864
  return Object.values(selectionActions).filter((action) => action.isAvailable?.(items) ?? true);
11855
11865
  }
@@ -64886,6 +64896,25 @@ class Shape extends BaseItem {
64886
64896
  this.subject.publish(this);
64887
64897
  }
64888
64898
  onPropertyUpdated(property, value, prevValue) {
64899
+ switch (property) {
64900
+ case "shapeType":
64901
+ this.initPath();
64902
+ break;
64903
+ case "backgroundOpacity":
64904
+ this.path.setBackgroundOpacity(value);
64905
+ break;
64906
+ case "borderOpacity":
64907
+ this.path.setBorderOpacity(value);
64908
+ break;
64909
+ case "borderStyle":
64910
+ this.path.setBorderStyle(value);
64911
+ break;
64912
+ case "borderWidth":
64913
+ this.path.setBorderWidth(value);
64914
+ break;
64915
+ default:
64916
+ break;
64917
+ }
64889
64918
  super.onPropertyUpdated(property, value, prevValue);
64890
64919
  this.saveShapeData();
64891
64920
  }
@@ -73913,12 +73942,39 @@ class Presence {
73913
73942
  function everyItemHasRichText(items) {
73914
73943
  return items.length > 0 && items.every((item) => !!item.getRichText?.());
73915
73944
  }
73945
+ registerSelectionActionSection({
73946
+ id: "selectionTextSize",
73947
+ label: "Text size",
73948
+ actionIds: ["selection.text.fontSize"]
73949
+ });
73950
+ registerSelectionActionSection({
73951
+ id: "selectionTextColors",
73952
+ label: "Text colors",
73953
+ actionIds: ["selection.text.color", "selection.text.highlight"]
73954
+ });
73955
+ registerSelectionActionSection({
73956
+ id: "selectionArrange",
73957
+ label: "Arrange",
73958
+ actionIds: ["selection.bringToFront", "selection.sendToBack"]
73959
+ });
73960
+ registerSelectionActionSection({
73961
+ id: "selectionActions",
73962
+ label: "Actions",
73963
+ actionIds: [
73964
+ "selection.duplicate",
73965
+ "selection.lock",
73966
+ "selection.unlock",
73967
+ "selection.delete"
73968
+ ]
73969
+ });
73916
73970
  registerSelectionAction({
73917
73971
  id: "selection.delete",
73918
73972
  label: "Delete",
73919
73973
  icon: symbolIcon("Delete"),
73920
73974
  description: "Removes the selected items from the board.",
73921
73975
  invoke: { kind: "selectionMethod", methodName: "removeFromBoard" },
73976
+ sectionId: "selectionActions",
73977
+ order: 4,
73922
73978
  isAvailable: (items) => items.length > 0
73923
73979
  });
73924
73980
  registerSelectionAction({
@@ -73927,6 +73983,8 @@ registerSelectionAction({
73927
73983
  icon: symbolIcon("Duplicate"),
73928
73984
  description: "Duplicates the selected items.",
73929
73985
  invoke: { kind: "selectionMethod", methodName: "duplicate" },
73986
+ sectionId: "selectionActions",
73987
+ order: 1,
73930
73988
  isAvailable: (items) => items.length > 0
73931
73989
  });
73932
73990
  registerSelectionAction({
@@ -73935,6 +73993,8 @@ registerSelectionAction({
73935
73993
  icon: symbolIcon("unlock"),
73936
73994
  description: "Locks the selected items.",
73937
73995
  invoke: { kind: "selectionMethod", methodName: "lock" },
73996
+ sectionId: "selectionActions",
73997
+ order: 2,
73938
73998
  isAvailable: (items) => items.length > 0 && !items.some((item) => item.transformation.isLocked)
73939
73999
  });
73940
74000
  registerSelectionAction({
@@ -73943,6 +74003,8 @@ registerSelectionAction({
73943
74003
  icon: symbolIcon("lock"),
73944
74004
  description: "Unlocks the selected items.",
73945
74005
  invoke: { kind: "selectionMethod", methodName: "unlock" },
74006
+ sectionId: "selectionActions",
74007
+ order: 2,
73946
74008
  isAvailable: (items) => items.some((item) => item.transformation.isLocked)
73947
74009
  });
73948
74010
  registerSelectionAction({
@@ -73951,6 +74013,8 @@ registerSelectionAction({
73951
74013
  icon: symbolIcon("BringToFront"),
73952
74014
  description: "Moves the selection above overlapping items.",
73953
74015
  invoke: { kind: "selectionMethod", methodName: "bringToFront" },
74016
+ sectionId: "selectionArrange",
74017
+ order: 1,
73954
74018
  isAvailable: (items) => items.length > 0
73955
74019
  });
73956
74020
  registerSelectionAction({
@@ -73959,6 +74023,8 @@ registerSelectionAction({
73959
74023
  icon: symbolIcon("SendToBack"),
73960
74024
  description: "Moves the selection behind overlapping items.",
73961
74025
  invoke: { kind: "selectionMethod", methodName: "sendToBack" },
74026
+ sectionId: "selectionArrange",
74027
+ order: 2,
73962
74028
  isAvailable: (items) => items.length > 0
73963
74029
  });
73964
74030
  registerSelectionAction({
@@ -73966,6 +74032,8 @@ registerSelectionAction({
73966
74032
  label: "Font size",
73967
74033
  icon: styleFontSizeIcon(),
73968
74034
  invoke: { kind: "selectionMethod", methodName: "setFontSize" },
74035
+ sectionId: "selectionTextSize",
74036
+ order: 1,
73969
74037
  controls: [
73970
74038
  {
73971
74039
  id: "fontSize",
@@ -73991,6 +74059,8 @@ registerSelectionAction({
73991
74059
  swatch: { kind: "selectionProperty", property: "getFontColor" }
73992
74060
  }),
73993
74061
  invoke: { kind: "selectionMethod", methodName: "setFontColor" },
74062
+ sectionId: "selectionTextColors",
74063
+ order: 1,
73994
74064
  controls: [
73995
74065
  {
73996
74066
  id: "fontColor",
@@ -74012,6 +74082,8 @@ registerSelectionAction({
74012
74082
  swatch: { kind: "selectionProperty", property: "getFontHighlight" }
74013
74083
  }),
74014
74084
  invoke: { kind: "selectionMethod", methodName: "setFontHighlight" },
74085
+ sectionId: "selectionTextColors",
74086
+ order: 2,
74015
74087
  controls: [
74016
74088
  {
74017
74089
  id: "fontHighlight",
package/dist/cjs/node.js CHANGED
@@ -1686,6 +1686,7 @@ __export(exports_node, {
1686
1686
  sha256: () => sha256,
1687
1687
  semanticColor: () => semanticColor,
1688
1688
  selectionActions: () => selectionActions,
1689
+ selectionActionSections: () => selectionActionSections,
1689
1690
  scalePatterns: () => scalePatterns,
1690
1691
  scaleElementBy: () => scaleElementBy,
1691
1692
  rgbToRgba: () => rgbToRgba,
@@ -1698,6 +1699,7 @@ __export(exports_node, {
1698
1699
  renderLinkToHTML: () => renderLinkToHTML,
1699
1700
  relativeLuminance: () => relativeLuminance,
1700
1701
  registerToolOverlay: () => registerToolOverlay,
1702
+ registerSelectionActionSection: () => registerSelectionActionSection,
1701
1703
  registerSelectionAction: () => registerSelectionAction,
1702
1704
  registerItemOverlay: () => registerItemOverlay,
1703
1705
  registerItem: () => registerItem,
@@ -1720,6 +1722,7 @@ __export(exports_node, {
1720
1722
  matchesOverlayCondition: () => matchesOverlayCondition,
1721
1723
  listToolOverlays: () => listToolOverlays,
1722
1724
  listSelectionActions: () => listSelectionActions,
1725
+ listSelectionActionSections: () => listSelectionActionSections,
1723
1726
  listRegisteredItemTypes: () => listRegisteredItemTypes,
1724
1727
  listCreateSurfaceEntries: () => listCreateSurfaceEntries,
1725
1728
  itemSchemas: () => itemSchemas2,
@@ -12822,6 +12825,7 @@ var itemOverlays = {};
12822
12825
  var toolOverlays = {};
12823
12826
  var dynamicOptionsResolvers = {};
12824
12827
  var selectionActions = {};
12828
+ var selectionActionSections = {};
12825
12829
  function registerItemOverlay(overlay) {
12826
12830
  itemOverlays[overlay.itemType] = overlay;
12827
12831
  }
@@ -12831,6 +12835,9 @@ function registerToolOverlay(overlay) {
12831
12835
  function registerSelectionAction(action) {
12832
12836
  selectionActions[action.id] = action;
12833
12837
  }
12838
+ function registerSelectionActionSection(section) {
12839
+ selectionActionSections[section.id] = section;
12840
+ }
12834
12841
  function registerDynamicOptionsResolver(id, resolver) {
12835
12842
  dynamicOptionsResolvers[id] = resolver;
12836
12843
  }
@@ -12886,6 +12893,9 @@ function listCreateSurfaceEntries() {
12886
12893
  function listSelectionActions() {
12887
12894
  return Object.values(selectionActions);
12888
12895
  }
12896
+ function listSelectionActionSections() {
12897
+ return Object.values(selectionActionSections);
12898
+ }
12889
12899
  function getSelectionOverlayActions(items) {
12890
12900
  return Object.values(selectionActions).filter((action) => action.isAvailable?.(items) ?? true);
12891
12901
  }
@@ -67359,6 +67369,25 @@ class Shape extends BaseItem {
67359
67369
  this.subject.publish(this);
67360
67370
  }
67361
67371
  onPropertyUpdated(property, value, prevValue) {
67372
+ switch (property) {
67373
+ case "shapeType":
67374
+ this.initPath();
67375
+ break;
67376
+ case "backgroundOpacity":
67377
+ this.path.setBackgroundOpacity(value);
67378
+ break;
67379
+ case "borderOpacity":
67380
+ this.path.setBorderOpacity(value);
67381
+ break;
67382
+ case "borderStyle":
67383
+ this.path.setBorderStyle(value);
67384
+ break;
67385
+ case "borderWidth":
67386
+ this.path.setBorderWidth(value);
67387
+ break;
67388
+ default:
67389
+ break;
67390
+ }
67362
67391
  super.onPropertyUpdated(property, value, prevValue);
67363
67392
  this.saveShapeData();
67364
67393
  }
@@ -76386,12 +76415,39 @@ class Presence {
76386
76415
  function everyItemHasRichText(items) {
76387
76416
  return items.length > 0 && items.every((item) => !!item.getRichText?.());
76388
76417
  }
76418
+ registerSelectionActionSection({
76419
+ id: "selectionTextSize",
76420
+ label: "Text size",
76421
+ actionIds: ["selection.text.fontSize"]
76422
+ });
76423
+ registerSelectionActionSection({
76424
+ id: "selectionTextColors",
76425
+ label: "Text colors",
76426
+ actionIds: ["selection.text.color", "selection.text.highlight"]
76427
+ });
76428
+ registerSelectionActionSection({
76429
+ id: "selectionArrange",
76430
+ label: "Arrange",
76431
+ actionIds: ["selection.bringToFront", "selection.sendToBack"]
76432
+ });
76433
+ registerSelectionActionSection({
76434
+ id: "selectionActions",
76435
+ label: "Actions",
76436
+ actionIds: [
76437
+ "selection.duplicate",
76438
+ "selection.lock",
76439
+ "selection.unlock",
76440
+ "selection.delete"
76441
+ ]
76442
+ });
76389
76443
  registerSelectionAction({
76390
76444
  id: "selection.delete",
76391
76445
  label: "Delete",
76392
76446
  icon: symbolIcon("Delete"),
76393
76447
  description: "Removes the selected items from the board.",
76394
76448
  invoke: { kind: "selectionMethod", methodName: "removeFromBoard" },
76449
+ sectionId: "selectionActions",
76450
+ order: 4,
76395
76451
  isAvailable: (items) => items.length > 0
76396
76452
  });
76397
76453
  registerSelectionAction({
@@ -76400,6 +76456,8 @@ registerSelectionAction({
76400
76456
  icon: symbolIcon("Duplicate"),
76401
76457
  description: "Duplicates the selected items.",
76402
76458
  invoke: { kind: "selectionMethod", methodName: "duplicate" },
76459
+ sectionId: "selectionActions",
76460
+ order: 1,
76403
76461
  isAvailable: (items) => items.length > 0
76404
76462
  });
76405
76463
  registerSelectionAction({
@@ -76408,6 +76466,8 @@ registerSelectionAction({
76408
76466
  icon: symbolIcon("unlock"),
76409
76467
  description: "Locks the selected items.",
76410
76468
  invoke: { kind: "selectionMethod", methodName: "lock" },
76469
+ sectionId: "selectionActions",
76470
+ order: 2,
76411
76471
  isAvailable: (items) => items.length > 0 && !items.some((item) => item.transformation.isLocked)
76412
76472
  });
76413
76473
  registerSelectionAction({
@@ -76416,6 +76476,8 @@ registerSelectionAction({
76416
76476
  icon: symbolIcon("lock"),
76417
76477
  description: "Unlocks the selected items.",
76418
76478
  invoke: { kind: "selectionMethod", methodName: "unlock" },
76479
+ sectionId: "selectionActions",
76480
+ order: 2,
76419
76481
  isAvailable: (items) => items.some((item) => item.transformation.isLocked)
76420
76482
  });
76421
76483
  registerSelectionAction({
@@ -76424,6 +76486,8 @@ registerSelectionAction({
76424
76486
  icon: symbolIcon("BringToFront"),
76425
76487
  description: "Moves the selection above overlapping items.",
76426
76488
  invoke: { kind: "selectionMethod", methodName: "bringToFront" },
76489
+ sectionId: "selectionArrange",
76490
+ order: 1,
76427
76491
  isAvailable: (items) => items.length > 0
76428
76492
  });
76429
76493
  registerSelectionAction({
@@ -76432,6 +76496,8 @@ registerSelectionAction({
76432
76496
  icon: symbolIcon("SendToBack"),
76433
76497
  description: "Moves the selection behind overlapping items.",
76434
76498
  invoke: { kind: "selectionMethod", methodName: "sendToBack" },
76499
+ sectionId: "selectionArrange",
76500
+ order: 2,
76435
76501
  isAvailable: (items) => items.length > 0
76436
76502
  });
76437
76503
  registerSelectionAction({
@@ -76439,6 +76505,8 @@ registerSelectionAction({
76439
76505
  label: "Font size",
76440
76506
  icon: styleFontSizeIcon(),
76441
76507
  invoke: { kind: "selectionMethod", methodName: "setFontSize" },
76508
+ sectionId: "selectionTextSize",
76509
+ order: 1,
76442
76510
  controls: [
76443
76511
  {
76444
76512
  id: "fontSize",
@@ -76464,6 +76532,8 @@ registerSelectionAction({
76464
76532
  swatch: { kind: "selectionProperty", property: "getFontColor" }
76465
76533
  }),
76466
76534
  invoke: { kind: "selectionMethod", methodName: "setFontColor" },
76535
+ sectionId: "selectionTextColors",
76536
+ order: 1,
76467
76537
  controls: [
76468
76538
  {
76469
76539
  id: "fontColor",
@@ -76485,6 +76555,8 @@ registerSelectionAction({
76485
76555
  swatch: { kind: "selectionProperty", property: "getFontHighlight" }
76486
76556
  }),
76487
76557
  invoke: { kind: "selectionMethod", methodName: "setFontHighlight" },
76558
+ sectionId: "selectionTextColors",
76559
+ order: 2,
76488
76560
  controls: [
76489
76561
  {
76490
76562
  id: "fontHighlight",
@@ -11554,6 +11554,7 @@ var itemOverlays = {};
11554
11554
  var toolOverlays = {};
11555
11555
  var dynamicOptionsResolvers = {};
11556
11556
  var selectionActions = {};
11557
+ var selectionActionSections = {};
11557
11558
  function registerItemOverlay(overlay) {
11558
11559
  itemOverlays[overlay.itemType] = overlay;
11559
11560
  }
@@ -11563,6 +11564,9 @@ function registerToolOverlay(overlay) {
11563
11564
  function registerSelectionAction(action) {
11564
11565
  selectionActions[action.id] = action;
11565
11566
  }
11567
+ function registerSelectionActionSection(section) {
11568
+ selectionActionSections[section.id] = section;
11569
+ }
11566
11570
  function registerDynamicOptionsResolver(id, resolver) {
11567
11571
  dynamicOptionsResolvers[id] = resolver;
11568
11572
  }
@@ -11618,6 +11622,9 @@ function listCreateSurfaceEntries() {
11618
11622
  function listSelectionActions() {
11619
11623
  return Object.values(selectionActions);
11620
11624
  }
11625
+ function listSelectionActionSections() {
11626
+ return Object.values(selectionActionSections);
11627
+ }
11621
11628
  function getSelectionOverlayActions(items) {
11622
11629
  return Object.values(selectionActions).filter((action) => action.isAvailable?.(items) ?? true);
11623
11630
  }
@@ -64662,6 +64669,25 @@ class Shape extends BaseItem {
64662
64669
  this.subject.publish(this);
64663
64670
  }
64664
64671
  onPropertyUpdated(property, value, prevValue) {
64672
+ switch (property) {
64673
+ case "shapeType":
64674
+ this.initPath();
64675
+ break;
64676
+ case "backgroundOpacity":
64677
+ this.path.setBackgroundOpacity(value);
64678
+ break;
64679
+ case "borderOpacity":
64680
+ this.path.setBorderOpacity(value);
64681
+ break;
64682
+ case "borderStyle":
64683
+ this.path.setBorderStyle(value);
64684
+ break;
64685
+ case "borderWidth":
64686
+ this.path.setBorderWidth(value);
64687
+ break;
64688
+ default:
64689
+ break;
64690
+ }
64665
64691
  super.onPropertyUpdated(property, value, prevValue);
64666
64692
  this.saveShapeData();
64667
64693
  }
@@ -73689,12 +73715,39 @@ class Presence {
73689
73715
  function everyItemHasRichText(items) {
73690
73716
  return items.length > 0 && items.every((item) => !!item.getRichText?.());
73691
73717
  }
73718
+ registerSelectionActionSection({
73719
+ id: "selectionTextSize",
73720
+ label: "Text size",
73721
+ actionIds: ["selection.text.fontSize"]
73722
+ });
73723
+ registerSelectionActionSection({
73724
+ id: "selectionTextColors",
73725
+ label: "Text colors",
73726
+ actionIds: ["selection.text.color", "selection.text.highlight"]
73727
+ });
73728
+ registerSelectionActionSection({
73729
+ id: "selectionArrange",
73730
+ label: "Arrange",
73731
+ actionIds: ["selection.bringToFront", "selection.sendToBack"]
73732
+ });
73733
+ registerSelectionActionSection({
73734
+ id: "selectionActions",
73735
+ label: "Actions",
73736
+ actionIds: [
73737
+ "selection.duplicate",
73738
+ "selection.lock",
73739
+ "selection.unlock",
73740
+ "selection.delete"
73741
+ ]
73742
+ });
73692
73743
  registerSelectionAction({
73693
73744
  id: "selection.delete",
73694
73745
  label: "Delete",
73695
73746
  icon: symbolIcon("Delete"),
73696
73747
  description: "Removes the selected items from the board.",
73697
73748
  invoke: { kind: "selectionMethod", methodName: "removeFromBoard" },
73749
+ sectionId: "selectionActions",
73750
+ order: 4,
73698
73751
  isAvailable: (items) => items.length > 0
73699
73752
  });
73700
73753
  registerSelectionAction({
@@ -73703,6 +73756,8 @@ registerSelectionAction({
73703
73756
  icon: symbolIcon("Duplicate"),
73704
73757
  description: "Duplicates the selected items.",
73705
73758
  invoke: { kind: "selectionMethod", methodName: "duplicate" },
73759
+ sectionId: "selectionActions",
73760
+ order: 1,
73706
73761
  isAvailable: (items) => items.length > 0
73707
73762
  });
73708
73763
  registerSelectionAction({
@@ -73711,6 +73766,8 @@ registerSelectionAction({
73711
73766
  icon: symbolIcon("unlock"),
73712
73767
  description: "Locks the selected items.",
73713
73768
  invoke: { kind: "selectionMethod", methodName: "lock" },
73769
+ sectionId: "selectionActions",
73770
+ order: 2,
73714
73771
  isAvailable: (items) => items.length > 0 && !items.some((item) => item.transformation.isLocked)
73715
73772
  });
73716
73773
  registerSelectionAction({
@@ -73719,6 +73776,8 @@ registerSelectionAction({
73719
73776
  icon: symbolIcon("lock"),
73720
73777
  description: "Unlocks the selected items.",
73721
73778
  invoke: { kind: "selectionMethod", methodName: "unlock" },
73779
+ sectionId: "selectionActions",
73780
+ order: 2,
73722
73781
  isAvailable: (items) => items.some((item) => item.transformation.isLocked)
73723
73782
  });
73724
73783
  registerSelectionAction({
@@ -73727,6 +73786,8 @@ registerSelectionAction({
73727
73786
  icon: symbolIcon("BringToFront"),
73728
73787
  description: "Moves the selection above overlapping items.",
73729
73788
  invoke: { kind: "selectionMethod", methodName: "bringToFront" },
73789
+ sectionId: "selectionArrange",
73790
+ order: 1,
73730
73791
  isAvailable: (items) => items.length > 0
73731
73792
  });
73732
73793
  registerSelectionAction({
@@ -73735,6 +73796,8 @@ registerSelectionAction({
73735
73796
  icon: symbolIcon("SendToBack"),
73736
73797
  description: "Moves the selection behind overlapping items.",
73737
73798
  invoke: { kind: "selectionMethod", methodName: "sendToBack" },
73799
+ sectionId: "selectionArrange",
73800
+ order: 2,
73738
73801
  isAvailable: (items) => items.length > 0
73739
73802
  });
73740
73803
  registerSelectionAction({
@@ -73742,6 +73805,8 @@ registerSelectionAction({
73742
73805
  label: "Font size",
73743
73806
  icon: styleFontSizeIcon(),
73744
73807
  invoke: { kind: "selectionMethod", methodName: "setFontSize" },
73808
+ sectionId: "selectionTextSize",
73809
+ order: 1,
73745
73810
  controls: [
73746
73811
  {
73747
73812
  id: "fontSize",
@@ -73767,6 +73832,8 @@ registerSelectionAction({
73767
73832
  swatch: { kind: "selectionProperty", property: "getFontColor" }
73768
73833
  }),
73769
73834
  invoke: { kind: "selectionMethod", methodName: "setFontColor" },
73835
+ sectionId: "selectionTextColors",
73836
+ order: 1,
73770
73837
  controls: [
73771
73838
  {
73772
73839
  id: "fontColor",
@@ -73788,6 +73855,8 @@ registerSelectionAction({
73788
73855
  swatch: { kind: "selectionProperty", property: "getFontHighlight" }
73789
73856
  }),
73790
73857
  invoke: { kind: "selectionMethod", methodName: "setFontHighlight" },
73858
+ sectionId: "selectionTextColors",
73859
+ order: 2,
73791
73860
  controls: [
73792
73861
  {
73793
73862
  id: "fontHighlight",
@@ -81802,6 +81871,7 @@ export {
81802
81871
  sha256,
81803
81872
  semanticColor,
81804
81873
  selectionActions,
81874
+ selectionActionSections,
81805
81875
  scalePatterns,
81806
81876
  scaleElementBy,
81807
81877
  rgbToRgba,
@@ -81814,6 +81884,7 @@ export {
81814
81884
  renderLinkToHTML,
81815
81885
  relativeLuminance,
81816
81886
  registerToolOverlay,
81887
+ registerSelectionActionSection,
81817
81888
  registerSelectionAction,
81818
81889
  registerItemOverlay,
81819
81890
  registerItem,
@@ -81836,6 +81907,7 @@ export {
81836
81907
  matchesOverlayCondition,
81837
81908
  listToolOverlays,
81838
81909
  listSelectionActions,
81910
+ listSelectionActionSections,
81839
81911
  listRegisteredItemTypes,
81840
81912
  listCreateSurfaceEntries,
81841
81913
  itemSchemas2 as itemSchemas,
package/dist/esm/index.js CHANGED
@@ -11547,6 +11547,7 @@ var itemOverlays = {};
11547
11547
  var toolOverlays = {};
11548
11548
  var dynamicOptionsResolvers = {};
11549
11549
  var selectionActions = {};
11550
+ var selectionActionSections = {};
11550
11551
  function registerItemOverlay(overlay) {
11551
11552
  itemOverlays[overlay.itemType] = overlay;
11552
11553
  }
@@ -11556,6 +11557,9 @@ function registerToolOverlay(overlay) {
11556
11557
  function registerSelectionAction(action) {
11557
11558
  selectionActions[action.id] = action;
11558
11559
  }
11560
+ function registerSelectionActionSection(section) {
11561
+ selectionActionSections[section.id] = section;
11562
+ }
11559
11563
  function registerDynamicOptionsResolver(id, resolver) {
11560
11564
  dynamicOptionsResolvers[id] = resolver;
11561
11565
  }
@@ -11611,6 +11615,9 @@ function listCreateSurfaceEntries() {
11611
11615
  function listSelectionActions() {
11612
11616
  return Object.values(selectionActions);
11613
11617
  }
11618
+ function listSelectionActionSections() {
11619
+ return Object.values(selectionActionSections);
11620
+ }
11614
11621
  function getSelectionOverlayActions(items) {
11615
11622
  return Object.values(selectionActions).filter((action) => action.isAvailable?.(items) ?? true);
11616
11623
  }
@@ -64655,6 +64662,25 @@ class Shape extends BaseItem {
64655
64662
  this.subject.publish(this);
64656
64663
  }
64657
64664
  onPropertyUpdated(property, value, prevValue) {
64665
+ switch (property) {
64666
+ case "shapeType":
64667
+ this.initPath();
64668
+ break;
64669
+ case "backgroundOpacity":
64670
+ this.path.setBackgroundOpacity(value);
64671
+ break;
64672
+ case "borderOpacity":
64673
+ this.path.setBorderOpacity(value);
64674
+ break;
64675
+ case "borderStyle":
64676
+ this.path.setBorderStyle(value);
64677
+ break;
64678
+ case "borderWidth":
64679
+ this.path.setBorderWidth(value);
64680
+ break;
64681
+ default:
64682
+ break;
64683
+ }
64658
64684
  super.onPropertyUpdated(property, value, prevValue);
64659
64685
  this.saveShapeData();
64660
64686
  }
@@ -73682,12 +73708,39 @@ class Presence {
73682
73708
  function everyItemHasRichText(items) {
73683
73709
  return items.length > 0 && items.every((item) => !!item.getRichText?.());
73684
73710
  }
73711
+ registerSelectionActionSection({
73712
+ id: "selectionTextSize",
73713
+ label: "Text size",
73714
+ actionIds: ["selection.text.fontSize"]
73715
+ });
73716
+ registerSelectionActionSection({
73717
+ id: "selectionTextColors",
73718
+ label: "Text colors",
73719
+ actionIds: ["selection.text.color", "selection.text.highlight"]
73720
+ });
73721
+ registerSelectionActionSection({
73722
+ id: "selectionArrange",
73723
+ label: "Arrange",
73724
+ actionIds: ["selection.bringToFront", "selection.sendToBack"]
73725
+ });
73726
+ registerSelectionActionSection({
73727
+ id: "selectionActions",
73728
+ label: "Actions",
73729
+ actionIds: [
73730
+ "selection.duplicate",
73731
+ "selection.lock",
73732
+ "selection.unlock",
73733
+ "selection.delete"
73734
+ ]
73735
+ });
73685
73736
  registerSelectionAction({
73686
73737
  id: "selection.delete",
73687
73738
  label: "Delete",
73688
73739
  icon: symbolIcon("Delete"),
73689
73740
  description: "Removes the selected items from the board.",
73690
73741
  invoke: { kind: "selectionMethod", methodName: "removeFromBoard" },
73742
+ sectionId: "selectionActions",
73743
+ order: 4,
73691
73744
  isAvailable: (items) => items.length > 0
73692
73745
  });
73693
73746
  registerSelectionAction({
@@ -73696,6 +73749,8 @@ registerSelectionAction({
73696
73749
  icon: symbolIcon("Duplicate"),
73697
73750
  description: "Duplicates the selected items.",
73698
73751
  invoke: { kind: "selectionMethod", methodName: "duplicate" },
73752
+ sectionId: "selectionActions",
73753
+ order: 1,
73699
73754
  isAvailable: (items) => items.length > 0
73700
73755
  });
73701
73756
  registerSelectionAction({
@@ -73704,6 +73759,8 @@ registerSelectionAction({
73704
73759
  icon: symbolIcon("unlock"),
73705
73760
  description: "Locks the selected items.",
73706
73761
  invoke: { kind: "selectionMethod", methodName: "lock" },
73762
+ sectionId: "selectionActions",
73763
+ order: 2,
73707
73764
  isAvailable: (items) => items.length > 0 && !items.some((item) => item.transformation.isLocked)
73708
73765
  });
73709
73766
  registerSelectionAction({
@@ -73712,6 +73769,8 @@ registerSelectionAction({
73712
73769
  icon: symbolIcon("lock"),
73713
73770
  description: "Unlocks the selected items.",
73714
73771
  invoke: { kind: "selectionMethod", methodName: "unlock" },
73772
+ sectionId: "selectionActions",
73773
+ order: 2,
73715
73774
  isAvailable: (items) => items.some((item) => item.transformation.isLocked)
73716
73775
  });
73717
73776
  registerSelectionAction({
@@ -73720,6 +73779,8 @@ registerSelectionAction({
73720
73779
  icon: symbolIcon("BringToFront"),
73721
73780
  description: "Moves the selection above overlapping items.",
73722
73781
  invoke: { kind: "selectionMethod", methodName: "bringToFront" },
73782
+ sectionId: "selectionArrange",
73783
+ order: 1,
73723
73784
  isAvailable: (items) => items.length > 0
73724
73785
  });
73725
73786
  registerSelectionAction({
@@ -73728,6 +73789,8 @@ registerSelectionAction({
73728
73789
  icon: symbolIcon("SendToBack"),
73729
73790
  description: "Moves the selection behind overlapping items.",
73730
73791
  invoke: { kind: "selectionMethod", methodName: "sendToBack" },
73792
+ sectionId: "selectionArrange",
73793
+ order: 2,
73731
73794
  isAvailable: (items) => items.length > 0
73732
73795
  });
73733
73796
  registerSelectionAction({
@@ -73735,6 +73798,8 @@ registerSelectionAction({
73735
73798
  label: "Font size",
73736
73799
  icon: styleFontSizeIcon(),
73737
73800
  invoke: { kind: "selectionMethod", methodName: "setFontSize" },
73801
+ sectionId: "selectionTextSize",
73802
+ order: 1,
73738
73803
  controls: [
73739
73804
  {
73740
73805
  id: "fontSize",
@@ -73760,6 +73825,8 @@ registerSelectionAction({
73760
73825
  swatch: { kind: "selectionProperty", property: "getFontColor" }
73761
73826
  }),
73762
73827
  invoke: { kind: "selectionMethod", methodName: "setFontColor" },
73828
+ sectionId: "selectionTextColors",
73829
+ order: 1,
73763
73830
  controls: [
73764
73831
  {
73765
73832
  id: "fontColor",
@@ -73781,6 +73848,8 @@ registerSelectionAction({
73781
73848
  swatch: { kind: "selectionProperty", property: "getFontHighlight" }
73782
73849
  }),
73783
73850
  invoke: { kind: "selectionMethod", methodName: "setFontHighlight" },
73851
+ sectionId: "selectionTextColors",
73852
+ order: 2,
73784
73853
  controls: [
73785
73854
  {
73786
73855
  id: "fontHighlight",
@@ -81700,6 +81769,7 @@ export {
81700
81769
  sha256,
81701
81770
  semanticColor,
81702
81771
  selectionActions,
81772
+ selectionActionSections,
81703
81773
  scalePatterns,
81704
81774
  scaleElementBy,
81705
81775
  rgbToRgba,
@@ -81712,6 +81782,7 @@ export {
81712
81782
  renderLinkToHTML,
81713
81783
  relativeLuminance,
81714
81784
  registerToolOverlay,
81785
+ registerSelectionActionSection,
81715
81786
  registerSelectionAction,
81716
81787
  registerItemOverlay,
81717
81788
  registerItem,
@@ -81734,6 +81805,7 @@ export {
81734
81805
  matchesOverlayCondition,
81735
81806
  listToolOverlays,
81736
81807
  listSelectionActions,
81808
+ listSelectionActionSections,
81737
81809
  listRegisteredItemTypes,
81738
81810
  listCreateSurfaceEntries,
81739
81811
  itemSchemas2 as itemSchemas,
package/dist/esm/node.js CHANGED
@@ -12330,6 +12330,7 @@ var itemOverlays = {};
12330
12330
  var toolOverlays = {};
12331
12331
  var dynamicOptionsResolvers = {};
12332
12332
  var selectionActions = {};
12333
+ var selectionActionSections = {};
12333
12334
  function registerItemOverlay(overlay) {
12334
12335
  itemOverlays[overlay.itemType] = overlay;
12335
12336
  }
@@ -12339,6 +12340,9 @@ function registerToolOverlay(overlay) {
12339
12340
  function registerSelectionAction(action) {
12340
12341
  selectionActions[action.id] = action;
12341
12342
  }
12343
+ function registerSelectionActionSection(section) {
12344
+ selectionActionSections[section.id] = section;
12345
+ }
12342
12346
  function registerDynamicOptionsResolver(id, resolver) {
12343
12347
  dynamicOptionsResolvers[id] = resolver;
12344
12348
  }
@@ -12394,6 +12398,9 @@ function listCreateSurfaceEntries() {
12394
12398
  function listSelectionActions() {
12395
12399
  return Object.values(selectionActions);
12396
12400
  }
12401
+ function listSelectionActionSections() {
12402
+ return Object.values(selectionActionSections);
12403
+ }
12397
12404
  function getSelectionOverlayActions(items) {
12398
12405
  return Object.values(selectionActions).filter((action) => action.isAvailable?.(items) ?? true);
12399
12406
  }
@@ -67123,6 +67130,25 @@ class Shape extends BaseItem {
67123
67130
  this.subject.publish(this);
67124
67131
  }
67125
67132
  onPropertyUpdated(property, value, prevValue) {
67133
+ switch (property) {
67134
+ case "shapeType":
67135
+ this.initPath();
67136
+ break;
67137
+ case "backgroundOpacity":
67138
+ this.path.setBackgroundOpacity(value);
67139
+ break;
67140
+ case "borderOpacity":
67141
+ this.path.setBorderOpacity(value);
67142
+ break;
67143
+ case "borderStyle":
67144
+ this.path.setBorderStyle(value);
67145
+ break;
67146
+ case "borderWidth":
67147
+ this.path.setBorderWidth(value);
67148
+ break;
67149
+ default:
67150
+ break;
67151
+ }
67126
67152
  super.onPropertyUpdated(property, value, prevValue);
67127
67153
  this.saveShapeData();
67128
67154
  }
@@ -76150,12 +76176,39 @@ class Presence {
76150
76176
  function everyItemHasRichText(items) {
76151
76177
  return items.length > 0 && items.every((item) => !!item.getRichText?.());
76152
76178
  }
76179
+ registerSelectionActionSection({
76180
+ id: "selectionTextSize",
76181
+ label: "Text size",
76182
+ actionIds: ["selection.text.fontSize"]
76183
+ });
76184
+ registerSelectionActionSection({
76185
+ id: "selectionTextColors",
76186
+ label: "Text colors",
76187
+ actionIds: ["selection.text.color", "selection.text.highlight"]
76188
+ });
76189
+ registerSelectionActionSection({
76190
+ id: "selectionArrange",
76191
+ label: "Arrange",
76192
+ actionIds: ["selection.bringToFront", "selection.sendToBack"]
76193
+ });
76194
+ registerSelectionActionSection({
76195
+ id: "selectionActions",
76196
+ label: "Actions",
76197
+ actionIds: [
76198
+ "selection.duplicate",
76199
+ "selection.lock",
76200
+ "selection.unlock",
76201
+ "selection.delete"
76202
+ ]
76203
+ });
76153
76204
  registerSelectionAction({
76154
76205
  id: "selection.delete",
76155
76206
  label: "Delete",
76156
76207
  icon: symbolIcon("Delete"),
76157
76208
  description: "Removes the selected items from the board.",
76158
76209
  invoke: { kind: "selectionMethod", methodName: "removeFromBoard" },
76210
+ sectionId: "selectionActions",
76211
+ order: 4,
76159
76212
  isAvailable: (items) => items.length > 0
76160
76213
  });
76161
76214
  registerSelectionAction({
@@ -76164,6 +76217,8 @@ registerSelectionAction({
76164
76217
  icon: symbolIcon("Duplicate"),
76165
76218
  description: "Duplicates the selected items.",
76166
76219
  invoke: { kind: "selectionMethod", methodName: "duplicate" },
76220
+ sectionId: "selectionActions",
76221
+ order: 1,
76167
76222
  isAvailable: (items) => items.length > 0
76168
76223
  });
76169
76224
  registerSelectionAction({
@@ -76172,6 +76227,8 @@ registerSelectionAction({
76172
76227
  icon: symbolIcon("unlock"),
76173
76228
  description: "Locks the selected items.",
76174
76229
  invoke: { kind: "selectionMethod", methodName: "lock" },
76230
+ sectionId: "selectionActions",
76231
+ order: 2,
76175
76232
  isAvailable: (items) => items.length > 0 && !items.some((item) => item.transformation.isLocked)
76176
76233
  });
76177
76234
  registerSelectionAction({
@@ -76180,6 +76237,8 @@ registerSelectionAction({
76180
76237
  icon: symbolIcon("lock"),
76181
76238
  description: "Unlocks the selected items.",
76182
76239
  invoke: { kind: "selectionMethod", methodName: "unlock" },
76240
+ sectionId: "selectionActions",
76241
+ order: 2,
76183
76242
  isAvailable: (items) => items.some((item) => item.transformation.isLocked)
76184
76243
  });
76185
76244
  registerSelectionAction({
@@ -76188,6 +76247,8 @@ registerSelectionAction({
76188
76247
  icon: symbolIcon("BringToFront"),
76189
76248
  description: "Moves the selection above overlapping items.",
76190
76249
  invoke: { kind: "selectionMethod", methodName: "bringToFront" },
76250
+ sectionId: "selectionArrange",
76251
+ order: 1,
76191
76252
  isAvailable: (items) => items.length > 0
76192
76253
  });
76193
76254
  registerSelectionAction({
@@ -76196,6 +76257,8 @@ registerSelectionAction({
76196
76257
  icon: symbolIcon("SendToBack"),
76197
76258
  description: "Moves the selection behind overlapping items.",
76198
76259
  invoke: { kind: "selectionMethod", methodName: "sendToBack" },
76260
+ sectionId: "selectionArrange",
76261
+ order: 2,
76199
76262
  isAvailable: (items) => items.length > 0
76200
76263
  });
76201
76264
  registerSelectionAction({
@@ -76203,6 +76266,8 @@ registerSelectionAction({
76203
76266
  label: "Font size",
76204
76267
  icon: styleFontSizeIcon(),
76205
76268
  invoke: { kind: "selectionMethod", methodName: "setFontSize" },
76269
+ sectionId: "selectionTextSize",
76270
+ order: 1,
76206
76271
  controls: [
76207
76272
  {
76208
76273
  id: "fontSize",
@@ -76228,6 +76293,8 @@ registerSelectionAction({
76228
76293
  swatch: { kind: "selectionProperty", property: "getFontColor" }
76229
76294
  }),
76230
76295
  invoke: { kind: "selectionMethod", methodName: "setFontColor" },
76296
+ sectionId: "selectionTextColors",
76297
+ order: 1,
76231
76298
  controls: [
76232
76299
  {
76233
76300
  id: "fontColor",
@@ -76249,6 +76316,8 @@ registerSelectionAction({
76249
76316
  swatch: { kind: "selectionProperty", property: "getFontHighlight" }
76250
76317
  }),
76251
76318
  invoke: { kind: "selectionMethod", methodName: "setFontHighlight" },
76319
+ sectionId: "selectionTextColors",
76320
+ order: 2,
76252
76321
  controls: [
76253
76322
  {
76254
76323
  id: "fontHighlight",
@@ -84335,6 +84404,7 @@ export {
84335
84404
  sha256,
84336
84405
  semanticColor,
84337
84406
  selectionActions,
84407
+ selectionActionSections,
84338
84408
  scalePatterns,
84339
84409
  scaleElementBy,
84340
84410
  rgbToRgba,
@@ -84347,6 +84417,7 @@ export {
84347
84417
  renderLinkToHTML,
84348
84418
  relativeLuminance,
84349
84419
  registerToolOverlay,
84420
+ registerSelectionActionSection,
84350
84421
  registerSelectionAction,
84351
84422
  registerItemOverlay,
84352
84423
  registerItem,
@@ -84369,6 +84440,7 @@ export {
84369
84440
  matchesOverlayCondition,
84370
84441
  listToolOverlays,
84371
84442
  listSelectionActions,
84443
+ listSelectionActionSections,
84372
84444
  listRegisteredItemTypes,
84373
84445
  listCreateSurfaceEntries,
84374
84446
  itemSchemas2 as itemSchemas,
@@ -249,6 +249,8 @@ export interface SelectionOverlayActionDefinition {
249
249
  invoke: OverlayInvocation;
250
250
  controls?: OverlayControlDefinition[];
251
251
  groups?: OverlayControlGroupDefinition[];
252
+ sectionId?: string;
253
+ order?: number;
252
254
  isAvailable?: (items: readonly BaseItem[]) => boolean;
253
255
  }
254
256
  export interface ToolDefaultsDefinition {
@@ -1,6 +1,6 @@
1
1
  import type { BaseItem } from "../Items/BaseItem/BaseItem";
2
2
  import type { Tool } from "../Tools/Tool";
3
- import type { ItemOverlayDefinition, OverlayActionDefinition, OverlayCondition, OverlayOptionDefinition, SelectionOverlayActionDefinition, ToolOverlayDefinition } from "./OverlayMetadata";
3
+ import type { ItemOverlayDefinition, OverlayActionDefinition, OverlayActionSectionDefinition, OverlayCondition, OverlayOptionDefinition, SelectionOverlayActionDefinition, ToolOverlayDefinition } from "./OverlayMetadata";
4
4
  export interface OverlayDynamicOptionsContext {
5
5
  item?: BaseItem;
6
6
  items?: readonly BaseItem[];
@@ -28,15 +28,18 @@ export declare const itemOverlays: Record<string, ItemOverlayDefinition>;
28
28
  export declare const toolOverlays: Record<string, ToolOverlayDefinition>;
29
29
  export declare const dynamicOptionsResolvers: Record<string, OverlayDynamicOptionsResolver>;
30
30
  export declare const selectionActions: Record<string, SelectionOverlayActionDefinition>;
31
+ export declare const selectionActionSections: Record<string, OverlayActionSectionDefinition>;
31
32
  export declare function registerItemOverlay(overlay: ItemOverlayDefinition): void;
32
33
  export declare function registerToolOverlay(overlay: ToolOverlayDefinition): void;
33
34
  export declare function registerSelectionAction(action: SelectionOverlayActionDefinition): void;
35
+ export declare function registerSelectionActionSection(section: OverlayActionSectionDefinition): void;
34
36
  export declare function registerDynamicOptionsResolver(id: string, resolver: OverlayDynamicOptionsResolver): void;
35
37
  export declare function getItemOverlay(itemOrType: BaseItem | string): ItemOverlayDefinition | undefined;
36
38
  export declare function getToolOverlay(toolName: string): ToolOverlayDefinition | undefined;
37
39
  export declare function listToolOverlays(): ToolOverlayDefinition[];
38
40
  export declare function listCreateSurfaceEntries(): OverlayCreateSurfaceEntry[];
39
41
  export declare function listSelectionActions(): SelectionOverlayActionDefinition[];
42
+ export declare function listSelectionActionSections(): OverlayActionSectionDefinition[];
40
43
  export declare function getSelectionOverlayActions(items: readonly BaseItem[]): SelectionOverlayActionDefinition[];
41
44
  export declare function resolveDynamicOptions(providerId: string, context: OverlayDynamicOptionsContext): OverlayOptionDefinition[];
42
45
  export declare function matchesOverlayCondition(condition: OverlayCondition | undefined, context: OverlayDynamicOptionsContext): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.14.44",
3
+ "version": "0.14.46",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",