microboard-temp 0.14.44 → 0.14.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/browser.js +53 -0
- package/dist/cjs/index.js +53 -0
- package/dist/cjs/node.js +53 -0
- package/dist/esm/browser.js +53 -0
- package/dist/esm/index.js +53 -0
- package/dist/esm/node.js +53 -0
- package/dist/types/Overlay/OverlayMetadata.d.ts +2 -0
- package/dist/types/Overlay/overlayRegistry.d.ts +4 -1
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -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
|
}
|
|
@@ -73913,12 +73923,39 @@ class Presence {
|
|
|
73913
73923
|
function everyItemHasRichText(items) {
|
|
73914
73924
|
return items.length > 0 && items.every((item) => !!item.getRichText?.());
|
|
73915
73925
|
}
|
|
73926
|
+
registerSelectionActionSection({
|
|
73927
|
+
id: "selectionTextSize",
|
|
73928
|
+
label: "Text size",
|
|
73929
|
+
actionIds: ["selection.text.fontSize"]
|
|
73930
|
+
});
|
|
73931
|
+
registerSelectionActionSection({
|
|
73932
|
+
id: "selectionTextColors",
|
|
73933
|
+
label: "Text colors",
|
|
73934
|
+
actionIds: ["selection.text.color", "selection.text.highlight"]
|
|
73935
|
+
});
|
|
73936
|
+
registerSelectionActionSection({
|
|
73937
|
+
id: "selectionArrange",
|
|
73938
|
+
label: "Arrange",
|
|
73939
|
+
actionIds: ["selection.bringToFront", "selection.sendToBack"]
|
|
73940
|
+
});
|
|
73941
|
+
registerSelectionActionSection({
|
|
73942
|
+
id: "selectionActions",
|
|
73943
|
+
label: "Actions",
|
|
73944
|
+
actionIds: [
|
|
73945
|
+
"selection.duplicate",
|
|
73946
|
+
"selection.lock",
|
|
73947
|
+
"selection.unlock",
|
|
73948
|
+
"selection.delete"
|
|
73949
|
+
]
|
|
73950
|
+
});
|
|
73916
73951
|
registerSelectionAction({
|
|
73917
73952
|
id: "selection.delete",
|
|
73918
73953
|
label: "Delete",
|
|
73919
73954
|
icon: symbolIcon("Delete"),
|
|
73920
73955
|
description: "Removes the selected items from the board.",
|
|
73921
73956
|
invoke: { kind: "selectionMethod", methodName: "removeFromBoard" },
|
|
73957
|
+
sectionId: "selectionActions",
|
|
73958
|
+
order: 4,
|
|
73922
73959
|
isAvailable: (items) => items.length > 0
|
|
73923
73960
|
});
|
|
73924
73961
|
registerSelectionAction({
|
|
@@ -73927,6 +73964,8 @@ registerSelectionAction({
|
|
|
73927
73964
|
icon: symbolIcon("Duplicate"),
|
|
73928
73965
|
description: "Duplicates the selected items.",
|
|
73929
73966
|
invoke: { kind: "selectionMethod", methodName: "duplicate" },
|
|
73967
|
+
sectionId: "selectionActions",
|
|
73968
|
+
order: 1,
|
|
73930
73969
|
isAvailable: (items) => items.length > 0
|
|
73931
73970
|
});
|
|
73932
73971
|
registerSelectionAction({
|
|
@@ -73935,6 +73974,8 @@ registerSelectionAction({
|
|
|
73935
73974
|
icon: symbolIcon("unlock"),
|
|
73936
73975
|
description: "Locks the selected items.",
|
|
73937
73976
|
invoke: { kind: "selectionMethod", methodName: "lock" },
|
|
73977
|
+
sectionId: "selectionActions",
|
|
73978
|
+
order: 2,
|
|
73938
73979
|
isAvailable: (items) => items.length > 0 && !items.some((item) => item.transformation.isLocked)
|
|
73939
73980
|
});
|
|
73940
73981
|
registerSelectionAction({
|
|
@@ -73943,6 +73984,8 @@ registerSelectionAction({
|
|
|
73943
73984
|
icon: symbolIcon("lock"),
|
|
73944
73985
|
description: "Unlocks the selected items.",
|
|
73945
73986
|
invoke: { kind: "selectionMethod", methodName: "unlock" },
|
|
73987
|
+
sectionId: "selectionActions",
|
|
73988
|
+
order: 2,
|
|
73946
73989
|
isAvailable: (items) => items.some((item) => item.transformation.isLocked)
|
|
73947
73990
|
});
|
|
73948
73991
|
registerSelectionAction({
|
|
@@ -73951,6 +73994,8 @@ registerSelectionAction({
|
|
|
73951
73994
|
icon: symbolIcon("BringToFront"),
|
|
73952
73995
|
description: "Moves the selection above overlapping items.",
|
|
73953
73996
|
invoke: { kind: "selectionMethod", methodName: "bringToFront" },
|
|
73997
|
+
sectionId: "selectionArrange",
|
|
73998
|
+
order: 1,
|
|
73954
73999
|
isAvailable: (items) => items.length > 0
|
|
73955
74000
|
});
|
|
73956
74001
|
registerSelectionAction({
|
|
@@ -73959,6 +74004,8 @@ registerSelectionAction({
|
|
|
73959
74004
|
icon: symbolIcon("SendToBack"),
|
|
73960
74005
|
description: "Moves the selection behind overlapping items.",
|
|
73961
74006
|
invoke: { kind: "selectionMethod", methodName: "sendToBack" },
|
|
74007
|
+
sectionId: "selectionArrange",
|
|
74008
|
+
order: 2,
|
|
73962
74009
|
isAvailable: (items) => items.length > 0
|
|
73963
74010
|
});
|
|
73964
74011
|
registerSelectionAction({
|
|
@@ -73966,6 +74013,8 @@ registerSelectionAction({
|
|
|
73966
74013
|
label: "Font size",
|
|
73967
74014
|
icon: styleFontSizeIcon(),
|
|
73968
74015
|
invoke: { kind: "selectionMethod", methodName: "setFontSize" },
|
|
74016
|
+
sectionId: "selectionTextSize",
|
|
74017
|
+
order: 1,
|
|
73969
74018
|
controls: [
|
|
73970
74019
|
{
|
|
73971
74020
|
id: "fontSize",
|
|
@@ -73991,6 +74040,8 @@ registerSelectionAction({
|
|
|
73991
74040
|
swatch: { kind: "selectionProperty", property: "getFontColor" }
|
|
73992
74041
|
}),
|
|
73993
74042
|
invoke: { kind: "selectionMethod", methodName: "setFontColor" },
|
|
74043
|
+
sectionId: "selectionTextColors",
|
|
74044
|
+
order: 1,
|
|
73994
74045
|
controls: [
|
|
73995
74046
|
{
|
|
73996
74047
|
id: "fontColor",
|
|
@@ -74012,6 +74063,8 @@ registerSelectionAction({
|
|
|
74012
74063
|
swatch: { kind: "selectionProperty", property: "getFontHighlight" }
|
|
74013
74064
|
}),
|
|
74014
74065
|
invoke: { kind: "selectionMethod", methodName: "setFontHighlight" },
|
|
74066
|
+
sectionId: "selectionTextColors",
|
|
74067
|
+
order: 2,
|
|
74015
74068
|
controls: [
|
|
74016
74069
|
{
|
|
74017
74070
|
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
|
}
|
|
@@ -73913,12 +73923,39 @@ class Presence {
|
|
|
73913
73923
|
function everyItemHasRichText(items) {
|
|
73914
73924
|
return items.length > 0 && items.every((item) => !!item.getRichText?.());
|
|
73915
73925
|
}
|
|
73926
|
+
registerSelectionActionSection({
|
|
73927
|
+
id: "selectionTextSize",
|
|
73928
|
+
label: "Text size",
|
|
73929
|
+
actionIds: ["selection.text.fontSize"]
|
|
73930
|
+
});
|
|
73931
|
+
registerSelectionActionSection({
|
|
73932
|
+
id: "selectionTextColors",
|
|
73933
|
+
label: "Text colors",
|
|
73934
|
+
actionIds: ["selection.text.color", "selection.text.highlight"]
|
|
73935
|
+
});
|
|
73936
|
+
registerSelectionActionSection({
|
|
73937
|
+
id: "selectionArrange",
|
|
73938
|
+
label: "Arrange",
|
|
73939
|
+
actionIds: ["selection.bringToFront", "selection.sendToBack"]
|
|
73940
|
+
});
|
|
73941
|
+
registerSelectionActionSection({
|
|
73942
|
+
id: "selectionActions",
|
|
73943
|
+
label: "Actions",
|
|
73944
|
+
actionIds: [
|
|
73945
|
+
"selection.duplicate",
|
|
73946
|
+
"selection.lock",
|
|
73947
|
+
"selection.unlock",
|
|
73948
|
+
"selection.delete"
|
|
73949
|
+
]
|
|
73950
|
+
});
|
|
73916
73951
|
registerSelectionAction({
|
|
73917
73952
|
id: "selection.delete",
|
|
73918
73953
|
label: "Delete",
|
|
73919
73954
|
icon: symbolIcon("Delete"),
|
|
73920
73955
|
description: "Removes the selected items from the board.",
|
|
73921
73956
|
invoke: { kind: "selectionMethod", methodName: "removeFromBoard" },
|
|
73957
|
+
sectionId: "selectionActions",
|
|
73958
|
+
order: 4,
|
|
73922
73959
|
isAvailable: (items) => items.length > 0
|
|
73923
73960
|
});
|
|
73924
73961
|
registerSelectionAction({
|
|
@@ -73927,6 +73964,8 @@ registerSelectionAction({
|
|
|
73927
73964
|
icon: symbolIcon("Duplicate"),
|
|
73928
73965
|
description: "Duplicates the selected items.",
|
|
73929
73966
|
invoke: { kind: "selectionMethod", methodName: "duplicate" },
|
|
73967
|
+
sectionId: "selectionActions",
|
|
73968
|
+
order: 1,
|
|
73930
73969
|
isAvailable: (items) => items.length > 0
|
|
73931
73970
|
});
|
|
73932
73971
|
registerSelectionAction({
|
|
@@ -73935,6 +73974,8 @@ registerSelectionAction({
|
|
|
73935
73974
|
icon: symbolIcon("unlock"),
|
|
73936
73975
|
description: "Locks the selected items.",
|
|
73937
73976
|
invoke: { kind: "selectionMethod", methodName: "lock" },
|
|
73977
|
+
sectionId: "selectionActions",
|
|
73978
|
+
order: 2,
|
|
73938
73979
|
isAvailable: (items) => items.length > 0 && !items.some((item) => item.transformation.isLocked)
|
|
73939
73980
|
});
|
|
73940
73981
|
registerSelectionAction({
|
|
@@ -73943,6 +73984,8 @@ registerSelectionAction({
|
|
|
73943
73984
|
icon: symbolIcon("lock"),
|
|
73944
73985
|
description: "Unlocks the selected items.",
|
|
73945
73986
|
invoke: { kind: "selectionMethod", methodName: "unlock" },
|
|
73987
|
+
sectionId: "selectionActions",
|
|
73988
|
+
order: 2,
|
|
73946
73989
|
isAvailable: (items) => items.some((item) => item.transformation.isLocked)
|
|
73947
73990
|
});
|
|
73948
73991
|
registerSelectionAction({
|
|
@@ -73951,6 +73994,8 @@ registerSelectionAction({
|
|
|
73951
73994
|
icon: symbolIcon("BringToFront"),
|
|
73952
73995
|
description: "Moves the selection above overlapping items.",
|
|
73953
73996
|
invoke: { kind: "selectionMethod", methodName: "bringToFront" },
|
|
73997
|
+
sectionId: "selectionArrange",
|
|
73998
|
+
order: 1,
|
|
73954
73999
|
isAvailable: (items) => items.length > 0
|
|
73955
74000
|
});
|
|
73956
74001
|
registerSelectionAction({
|
|
@@ -73959,6 +74004,8 @@ registerSelectionAction({
|
|
|
73959
74004
|
icon: symbolIcon("SendToBack"),
|
|
73960
74005
|
description: "Moves the selection behind overlapping items.",
|
|
73961
74006
|
invoke: { kind: "selectionMethod", methodName: "sendToBack" },
|
|
74007
|
+
sectionId: "selectionArrange",
|
|
74008
|
+
order: 2,
|
|
73962
74009
|
isAvailable: (items) => items.length > 0
|
|
73963
74010
|
});
|
|
73964
74011
|
registerSelectionAction({
|
|
@@ -73966,6 +74013,8 @@ registerSelectionAction({
|
|
|
73966
74013
|
label: "Font size",
|
|
73967
74014
|
icon: styleFontSizeIcon(),
|
|
73968
74015
|
invoke: { kind: "selectionMethod", methodName: "setFontSize" },
|
|
74016
|
+
sectionId: "selectionTextSize",
|
|
74017
|
+
order: 1,
|
|
73969
74018
|
controls: [
|
|
73970
74019
|
{
|
|
73971
74020
|
id: "fontSize",
|
|
@@ -73991,6 +74040,8 @@ registerSelectionAction({
|
|
|
73991
74040
|
swatch: { kind: "selectionProperty", property: "getFontColor" }
|
|
73992
74041
|
}),
|
|
73993
74042
|
invoke: { kind: "selectionMethod", methodName: "setFontColor" },
|
|
74043
|
+
sectionId: "selectionTextColors",
|
|
74044
|
+
order: 1,
|
|
73994
74045
|
controls: [
|
|
73995
74046
|
{
|
|
73996
74047
|
id: "fontColor",
|
|
@@ -74012,6 +74063,8 @@ registerSelectionAction({
|
|
|
74012
74063
|
swatch: { kind: "selectionProperty", property: "getFontHighlight" }
|
|
74013
74064
|
}),
|
|
74014
74065
|
invoke: { kind: "selectionMethod", methodName: "setFontHighlight" },
|
|
74066
|
+
sectionId: "selectionTextColors",
|
|
74067
|
+
order: 2,
|
|
74015
74068
|
controls: [
|
|
74016
74069
|
{
|
|
74017
74070
|
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
|
}
|
|
@@ -76386,12 +76396,39 @@ class Presence {
|
|
|
76386
76396
|
function everyItemHasRichText(items) {
|
|
76387
76397
|
return items.length > 0 && items.every((item) => !!item.getRichText?.());
|
|
76388
76398
|
}
|
|
76399
|
+
registerSelectionActionSection({
|
|
76400
|
+
id: "selectionTextSize",
|
|
76401
|
+
label: "Text size",
|
|
76402
|
+
actionIds: ["selection.text.fontSize"]
|
|
76403
|
+
});
|
|
76404
|
+
registerSelectionActionSection({
|
|
76405
|
+
id: "selectionTextColors",
|
|
76406
|
+
label: "Text colors",
|
|
76407
|
+
actionIds: ["selection.text.color", "selection.text.highlight"]
|
|
76408
|
+
});
|
|
76409
|
+
registerSelectionActionSection({
|
|
76410
|
+
id: "selectionArrange",
|
|
76411
|
+
label: "Arrange",
|
|
76412
|
+
actionIds: ["selection.bringToFront", "selection.sendToBack"]
|
|
76413
|
+
});
|
|
76414
|
+
registerSelectionActionSection({
|
|
76415
|
+
id: "selectionActions",
|
|
76416
|
+
label: "Actions",
|
|
76417
|
+
actionIds: [
|
|
76418
|
+
"selection.duplicate",
|
|
76419
|
+
"selection.lock",
|
|
76420
|
+
"selection.unlock",
|
|
76421
|
+
"selection.delete"
|
|
76422
|
+
]
|
|
76423
|
+
});
|
|
76389
76424
|
registerSelectionAction({
|
|
76390
76425
|
id: "selection.delete",
|
|
76391
76426
|
label: "Delete",
|
|
76392
76427
|
icon: symbolIcon("Delete"),
|
|
76393
76428
|
description: "Removes the selected items from the board.",
|
|
76394
76429
|
invoke: { kind: "selectionMethod", methodName: "removeFromBoard" },
|
|
76430
|
+
sectionId: "selectionActions",
|
|
76431
|
+
order: 4,
|
|
76395
76432
|
isAvailable: (items) => items.length > 0
|
|
76396
76433
|
});
|
|
76397
76434
|
registerSelectionAction({
|
|
@@ -76400,6 +76437,8 @@ registerSelectionAction({
|
|
|
76400
76437
|
icon: symbolIcon("Duplicate"),
|
|
76401
76438
|
description: "Duplicates the selected items.",
|
|
76402
76439
|
invoke: { kind: "selectionMethod", methodName: "duplicate" },
|
|
76440
|
+
sectionId: "selectionActions",
|
|
76441
|
+
order: 1,
|
|
76403
76442
|
isAvailable: (items) => items.length > 0
|
|
76404
76443
|
});
|
|
76405
76444
|
registerSelectionAction({
|
|
@@ -76408,6 +76447,8 @@ registerSelectionAction({
|
|
|
76408
76447
|
icon: symbolIcon("unlock"),
|
|
76409
76448
|
description: "Locks the selected items.",
|
|
76410
76449
|
invoke: { kind: "selectionMethod", methodName: "lock" },
|
|
76450
|
+
sectionId: "selectionActions",
|
|
76451
|
+
order: 2,
|
|
76411
76452
|
isAvailable: (items) => items.length > 0 && !items.some((item) => item.transformation.isLocked)
|
|
76412
76453
|
});
|
|
76413
76454
|
registerSelectionAction({
|
|
@@ -76416,6 +76457,8 @@ registerSelectionAction({
|
|
|
76416
76457
|
icon: symbolIcon("lock"),
|
|
76417
76458
|
description: "Unlocks the selected items.",
|
|
76418
76459
|
invoke: { kind: "selectionMethod", methodName: "unlock" },
|
|
76460
|
+
sectionId: "selectionActions",
|
|
76461
|
+
order: 2,
|
|
76419
76462
|
isAvailable: (items) => items.some((item) => item.transformation.isLocked)
|
|
76420
76463
|
});
|
|
76421
76464
|
registerSelectionAction({
|
|
@@ -76424,6 +76467,8 @@ registerSelectionAction({
|
|
|
76424
76467
|
icon: symbolIcon("BringToFront"),
|
|
76425
76468
|
description: "Moves the selection above overlapping items.",
|
|
76426
76469
|
invoke: { kind: "selectionMethod", methodName: "bringToFront" },
|
|
76470
|
+
sectionId: "selectionArrange",
|
|
76471
|
+
order: 1,
|
|
76427
76472
|
isAvailable: (items) => items.length > 0
|
|
76428
76473
|
});
|
|
76429
76474
|
registerSelectionAction({
|
|
@@ -76432,6 +76477,8 @@ registerSelectionAction({
|
|
|
76432
76477
|
icon: symbolIcon("SendToBack"),
|
|
76433
76478
|
description: "Moves the selection behind overlapping items.",
|
|
76434
76479
|
invoke: { kind: "selectionMethod", methodName: "sendToBack" },
|
|
76480
|
+
sectionId: "selectionArrange",
|
|
76481
|
+
order: 2,
|
|
76435
76482
|
isAvailable: (items) => items.length > 0
|
|
76436
76483
|
});
|
|
76437
76484
|
registerSelectionAction({
|
|
@@ -76439,6 +76486,8 @@ registerSelectionAction({
|
|
|
76439
76486
|
label: "Font size",
|
|
76440
76487
|
icon: styleFontSizeIcon(),
|
|
76441
76488
|
invoke: { kind: "selectionMethod", methodName: "setFontSize" },
|
|
76489
|
+
sectionId: "selectionTextSize",
|
|
76490
|
+
order: 1,
|
|
76442
76491
|
controls: [
|
|
76443
76492
|
{
|
|
76444
76493
|
id: "fontSize",
|
|
@@ -76464,6 +76513,8 @@ registerSelectionAction({
|
|
|
76464
76513
|
swatch: { kind: "selectionProperty", property: "getFontColor" }
|
|
76465
76514
|
}),
|
|
76466
76515
|
invoke: { kind: "selectionMethod", methodName: "setFontColor" },
|
|
76516
|
+
sectionId: "selectionTextColors",
|
|
76517
|
+
order: 1,
|
|
76467
76518
|
controls: [
|
|
76468
76519
|
{
|
|
76469
76520
|
id: "fontColor",
|
|
@@ -76485,6 +76536,8 @@ registerSelectionAction({
|
|
|
76485
76536
|
swatch: { kind: "selectionProperty", property: "getFontHighlight" }
|
|
76486
76537
|
}),
|
|
76487
76538
|
invoke: { kind: "selectionMethod", methodName: "setFontHighlight" },
|
|
76539
|
+
sectionId: "selectionTextColors",
|
|
76540
|
+
order: 2,
|
|
76488
76541
|
controls: [
|
|
76489
76542
|
{
|
|
76490
76543
|
id: "fontHighlight",
|
package/dist/esm/browser.js
CHANGED
|
@@ -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
|
}
|
|
@@ -73689,12 +73696,39 @@ class Presence {
|
|
|
73689
73696
|
function everyItemHasRichText(items) {
|
|
73690
73697
|
return items.length > 0 && items.every((item) => !!item.getRichText?.());
|
|
73691
73698
|
}
|
|
73699
|
+
registerSelectionActionSection({
|
|
73700
|
+
id: "selectionTextSize",
|
|
73701
|
+
label: "Text size",
|
|
73702
|
+
actionIds: ["selection.text.fontSize"]
|
|
73703
|
+
});
|
|
73704
|
+
registerSelectionActionSection({
|
|
73705
|
+
id: "selectionTextColors",
|
|
73706
|
+
label: "Text colors",
|
|
73707
|
+
actionIds: ["selection.text.color", "selection.text.highlight"]
|
|
73708
|
+
});
|
|
73709
|
+
registerSelectionActionSection({
|
|
73710
|
+
id: "selectionArrange",
|
|
73711
|
+
label: "Arrange",
|
|
73712
|
+
actionIds: ["selection.bringToFront", "selection.sendToBack"]
|
|
73713
|
+
});
|
|
73714
|
+
registerSelectionActionSection({
|
|
73715
|
+
id: "selectionActions",
|
|
73716
|
+
label: "Actions",
|
|
73717
|
+
actionIds: [
|
|
73718
|
+
"selection.duplicate",
|
|
73719
|
+
"selection.lock",
|
|
73720
|
+
"selection.unlock",
|
|
73721
|
+
"selection.delete"
|
|
73722
|
+
]
|
|
73723
|
+
});
|
|
73692
73724
|
registerSelectionAction({
|
|
73693
73725
|
id: "selection.delete",
|
|
73694
73726
|
label: "Delete",
|
|
73695
73727
|
icon: symbolIcon("Delete"),
|
|
73696
73728
|
description: "Removes the selected items from the board.",
|
|
73697
73729
|
invoke: { kind: "selectionMethod", methodName: "removeFromBoard" },
|
|
73730
|
+
sectionId: "selectionActions",
|
|
73731
|
+
order: 4,
|
|
73698
73732
|
isAvailable: (items) => items.length > 0
|
|
73699
73733
|
});
|
|
73700
73734
|
registerSelectionAction({
|
|
@@ -73703,6 +73737,8 @@ registerSelectionAction({
|
|
|
73703
73737
|
icon: symbolIcon("Duplicate"),
|
|
73704
73738
|
description: "Duplicates the selected items.",
|
|
73705
73739
|
invoke: { kind: "selectionMethod", methodName: "duplicate" },
|
|
73740
|
+
sectionId: "selectionActions",
|
|
73741
|
+
order: 1,
|
|
73706
73742
|
isAvailable: (items) => items.length > 0
|
|
73707
73743
|
});
|
|
73708
73744
|
registerSelectionAction({
|
|
@@ -73711,6 +73747,8 @@ registerSelectionAction({
|
|
|
73711
73747
|
icon: symbolIcon("unlock"),
|
|
73712
73748
|
description: "Locks the selected items.",
|
|
73713
73749
|
invoke: { kind: "selectionMethod", methodName: "lock" },
|
|
73750
|
+
sectionId: "selectionActions",
|
|
73751
|
+
order: 2,
|
|
73714
73752
|
isAvailable: (items) => items.length > 0 && !items.some((item) => item.transformation.isLocked)
|
|
73715
73753
|
});
|
|
73716
73754
|
registerSelectionAction({
|
|
@@ -73719,6 +73757,8 @@ registerSelectionAction({
|
|
|
73719
73757
|
icon: symbolIcon("lock"),
|
|
73720
73758
|
description: "Unlocks the selected items.",
|
|
73721
73759
|
invoke: { kind: "selectionMethod", methodName: "unlock" },
|
|
73760
|
+
sectionId: "selectionActions",
|
|
73761
|
+
order: 2,
|
|
73722
73762
|
isAvailable: (items) => items.some((item) => item.transformation.isLocked)
|
|
73723
73763
|
});
|
|
73724
73764
|
registerSelectionAction({
|
|
@@ -73727,6 +73767,8 @@ registerSelectionAction({
|
|
|
73727
73767
|
icon: symbolIcon("BringToFront"),
|
|
73728
73768
|
description: "Moves the selection above overlapping items.",
|
|
73729
73769
|
invoke: { kind: "selectionMethod", methodName: "bringToFront" },
|
|
73770
|
+
sectionId: "selectionArrange",
|
|
73771
|
+
order: 1,
|
|
73730
73772
|
isAvailable: (items) => items.length > 0
|
|
73731
73773
|
});
|
|
73732
73774
|
registerSelectionAction({
|
|
@@ -73735,6 +73777,8 @@ registerSelectionAction({
|
|
|
73735
73777
|
icon: symbolIcon("SendToBack"),
|
|
73736
73778
|
description: "Moves the selection behind overlapping items.",
|
|
73737
73779
|
invoke: { kind: "selectionMethod", methodName: "sendToBack" },
|
|
73780
|
+
sectionId: "selectionArrange",
|
|
73781
|
+
order: 2,
|
|
73738
73782
|
isAvailable: (items) => items.length > 0
|
|
73739
73783
|
});
|
|
73740
73784
|
registerSelectionAction({
|
|
@@ -73742,6 +73786,8 @@ registerSelectionAction({
|
|
|
73742
73786
|
label: "Font size",
|
|
73743
73787
|
icon: styleFontSizeIcon(),
|
|
73744
73788
|
invoke: { kind: "selectionMethod", methodName: "setFontSize" },
|
|
73789
|
+
sectionId: "selectionTextSize",
|
|
73790
|
+
order: 1,
|
|
73745
73791
|
controls: [
|
|
73746
73792
|
{
|
|
73747
73793
|
id: "fontSize",
|
|
@@ -73767,6 +73813,8 @@ registerSelectionAction({
|
|
|
73767
73813
|
swatch: { kind: "selectionProperty", property: "getFontColor" }
|
|
73768
73814
|
}),
|
|
73769
73815
|
invoke: { kind: "selectionMethod", methodName: "setFontColor" },
|
|
73816
|
+
sectionId: "selectionTextColors",
|
|
73817
|
+
order: 1,
|
|
73770
73818
|
controls: [
|
|
73771
73819
|
{
|
|
73772
73820
|
id: "fontColor",
|
|
@@ -73788,6 +73836,8 @@ registerSelectionAction({
|
|
|
73788
73836
|
swatch: { kind: "selectionProperty", property: "getFontHighlight" }
|
|
73789
73837
|
}),
|
|
73790
73838
|
invoke: { kind: "selectionMethod", methodName: "setFontHighlight" },
|
|
73839
|
+
sectionId: "selectionTextColors",
|
|
73840
|
+
order: 2,
|
|
73791
73841
|
controls: [
|
|
73792
73842
|
{
|
|
73793
73843
|
id: "fontHighlight",
|
|
@@ -81802,6 +81852,7 @@ export {
|
|
|
81802
81852
|
sha256,
|
|
81803
81853
|
semanticColor,
|
|
81804
81854
|
selectionActions,
|
|
81855
|
+
selectionActionSections,
|
|
81805
81856
|
scalePatterns,
|
|
81806
81857
|
scaleElementBy,
|
|
81807
81858
|
rgbToRgba,
|
|
@@ -81814,6 +81865,7 @@ export {
|
|
|
81814
81865
|
renderLinkToHTML,
|
|
81815
81866
|
relativeLuminance,
|
|
81816
81867
|
registerToolOverlay,
|
|
81868
|
+
registerSelectionActionSection,
|
|
81817
81869
|
registerSelectionAction,
|
|
81818
81870
|
registerItemOverlay,
|
|
81819
81871
|
registerItem,
|
|
@@ -81836,6 +81888,7 @@ export {
|
|
|
81836
81888
|
matchesOverlayCondition,
|
|
81837
81889
|
listToolOverlays,
|
|
81838
81890
|
listSelectionActions,
|
|
81891
|
+
listSelectionActionSections,
|
|
81839
81892
|
listRegisteredItemTypes,
|
|
81840
81893
|
listCreateSurfaceEntries,
|
|
81841
81894
|
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
|
}
|
|
@@ -73682,12 +73689,39 @@ class Presence {
|
|
|
73682
73689
|
function everyItemHasRichText(items) {
|
|
73683
73690
|
return items.length > 0 && items.every((item) => !!item.getRichText?.());
|
|
73684
73691
|
}
|
|
73692
|
+
registerSelectionActionSection({
|
|
73693
|
+
id: "selectionTextSize",
|
|
73694
|
+
label: "Text size",
|
|
73695
|
+
actionIds: ["selection.text.fontSize"]
|
|
73696
|
+
});
|
|
73697
|
+
registerSelectionActionSection({
|
|
73698
|
+
id: "selectionTextColors",
|
|
73699
|
+
label: "Text colors",
|
|
73700
|
+
actionIds: ["selection.text.color", "selection.text.highlight"]
|
|
73701
|
+
});
|
|
73702
|
+
registerSelectionActionSection({
|
|
73703
|
+
id: "selectionArrange",
|
|
73704
|
+
label: "Arrange",
|
|
73705
|
+
actionIds: ["selection.bringToFront", "selection.sendToBack"]
|
|
73706
|
+
});
|
|
73707
|
+
registerSelectionActionSection({
|
|
73708
|
+
id: "selectionActions",
|
|
73709
|
+
label: "Actions",
|
|
73710
|
+
actionIds: [
|
|
73711
|
+
"selection.duplicate",
|
|
73712
|
+
"selection.lock",
|
|
73713
|
+
"selection.unlock",
|
|
73714
|
+
"selection.delete"
|
|
73715
|
+
]
|
|
73716
|
+
});
|
|
73685
73717
|
registerSelectionAction({
|
|
73686
73718
|
id: "selection.delete",
|
|
73687
73719
|
label: "Delete",
|
|
73688
73720
|
icon: symbolIcon("Delete"),
|
|
73689
73721
|
description: "Removes the selected items from the board.",
|
|
73690
73722
|
invoke: { kind: "selectionMethod", methodName: "removeFromBoard" },
|
|
73723
|
+
sectionId: "selectionActions",
|
|
73724
|
+
order: 4,
|
|
73691
73725
|
isAvailable: (items) => items.length > 0
|
|
73692
73726
|
});
|
|
73693
73727
|
registerSelectionAction({
|
|
@@ -73696,6 +73730,8 @@ registerSelectionAction({
|
|
|
73696
73730
|
icon: symbolIcon("Duplicate"),
|
|
73697
73731
|
description: "Duplicates the selected items.",
|
|
73698
73732
|
invoke: { kind: "selectionMethod", methodName: "duplicate" },
|
|
73733
|
+
sectionId: "selectionActions",
|
|
73734
|
+
order: 1,
|
|
73699
73735
|
isAvailable: (items) => items.length > 0
|
|
73700
73736
|
});
|
|
73701
73737
|
registerSelectionAction({
|
|
@@ -73704,6 +73740,8 @@ registerSelectionAction({
|
|
|
73704
73740
|
icon: symbolIcon("unlock"),
|
|
73705
73741
|
description: "Locks the selected items.",
|
|
73706
73742
|
invoke: { kind: "selectionMethod", methodName: "lock" },
|
|
73743
|
+
sectionId: "selectionActions",
|
|
73744
|
+
order: 2,
|
|
73707
73745
|
isAvailable: (items) => items.length > 0 && !items.some((item) => item.transformation.isLocked)
|
|
73708
73746
|
});
|
|
73709
73747
|
registerSelectionAction({
|
|
@@ -73712,6 +73750,8 @@ registerSelectionAction({
|
|
|
73712
73750
|
icon: symbolIcon("lock"),
|
|
73713
73751
|
description: "Unlocks the selected items.",
|
|
73714
73752
|
invoke: { kind: "selectionMethod", methodName: "unlock" },
|
|
73753
|
+
sectionId: "selectionActions",
|
|
73754
|
+
order: 2,
|
|
73715
73755
|
isAvailable: (items) => items.some((item) => item.transformation.isLocked)
|
|
73716
73756
|
});
|
|
73717
73757
|
registerSelectionAction({
|
|
@@ -73720,6 +73760,8 @@ registerSelectionAction({
|
|
|
73720
73760
|
icon: symbolIcon("BringToFront"),
|
|
73721
73761
|
description: "Moves the selection above overlapping items.",
|
|
73722
73762
|
invoke: { kind: "selectionMethod", methodName: "bringToFront" },
|
|
73763
|
+
sectionId: "selectionArrange",
|
|
73764
|
+
order: 1,
|
|
73723
73765
|
isAvailable: (items) => items.length > 0
|
|
73724
73766
|
});
|
|
73725
73767
|
registerSelectionAction({
|
|
@@ -73728,6 +73770,8 @@ registerSelectionAction({
|
|
|
73728
73770
|
icon: symbolIcon("SendToBack"),
|
|
73729
73771
|
description: "Moves the selection behind overlapping items.",
|
|
73730
73772
|
invoke: { kind: "selectionMethod", methodName: "sendToBack" },
|
|
73773
|
+
sectionId: "selectionArrange",
|
|
73774
|
+
order: 2,
|
|
73731
73775
|
isAvailable: (items) => items.length > 0
|
|
73732
73776
|
});
|
|
73733
73777
|
registerSelectionAction({
|
|
@@ -73735,6 +73779,8 @@ registerSelectionAction({
|
|
|
73735
73779
|
label: "Font size",
|
|
73736
73780
|
icon: styleFontSizeIcon(),
|
|
73737
73781
|
invoke: { kind: "selectionMethod", methodName: "setFontSize" },
|
|
73782
|
+
sectionId: "selectionTextSize",
|
|
73783
|
+
order: 1,
|
|
73738
73784
|
controls: [
|
|
73739
73785
|
{
|
|
73740
73786
|
id: "fontSize",
|
|
@@ -73760,6 +73806,8 @@ registerSelectionAction({
|
|
|
73760
73806
|
swatch: { kind: "selectionProperty", property: "getFontColor" }
|
|
73761
73807
|
}),
|
|
73762
73808
|
invoke: { kind: "selectionMethod", methodName: "setFontColor" },
|
|
73809
|
+
sectionId: "selectionTextColors",
|
|
73810
|
+
order: 1,
|
|
73763
73811
|
controls: [
|
|
73764
73812
|
{
|
|
73765
73813
|
id: "fontColor",
|
|
@@ -73781,6 +73829,8 @@ registerSelectionAction({
|
|
|
73781
73829
|
swatch: { kind: "selectionProperty", property: "getFontHighlight" }
|
|
73782
73830
|
}),
|
|
73783
73831
|
invoke: { kind: "selectionMethod", methodName: "setFontHighlight" },
|
|
73832
|
+
sectionId: "selectionTextColors",
|
|
73833
|
+
order: 2,
|
|
73784
73834
|
controls: [
|
|
73785
73835
|
{
|
|
73786
73836
|
id: "fontHighlight",
|
|
@@ -81700,6 +81750,7 @@ export {
|
|
|
81700
81750
|
sha256,
|
|
81701
81751
|
semanticColor,
|
|
81702
81752
|
selectionActions,
|
|
81753
|
+
selectionActionSections,
|
|
81703
81754
|
scalePatterns,
|
|
81704
81755
|
scaleElementBy,
|
|
81705
81756
|
rgbToRgba,
|
|
@@ -81712,6 +81763,7 @@ export {
|
|
|
81712
81763
|
renderLinkToHTML,
|
|
81713
81764
|
relativeLuminance,
|
|
81714
81765
|
registerToolOverlay,
|
|
81766
|
+
registerSelectionActionSection,
|
|
81715
81767
|
registerSelectionAction,
|
|
81716
81768
|
registerItemOverlay,
|
|
81717
81769
|
registerItem,
|
|
@@ -81734,6 +81786,7 @@ export {
|
|
|
81734
81786
|
matchesOverlayCondition,
|
|
81735
81787
|
listToolOverlays,
|
|
81736
81788
|
listSelectionActions,
|
|
81789
|
+
listSelectionActionSections,
|
|
81737
81790
|
listRegisteredItemTypes,
|
|
81738
81791
|
listCreateSurfaceEntries,
|
|
81739
81792
|
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
|
}
|
|
@@ -76150,12 +76157,39 @@ class Presence {
|
|
|
76150
76157
|
function everyItemHasRichText(items) {
|
|
76151
76158
|
return items.length > 0 && items.every((item) => !!item.getRichText?.());
|
|
76152
76159
|
}
|
|
76160
|
+
registerSelectionActionSection({
|
|
76161
|
+
id: "selectionTextSize",
|
|
76162
|
+
label: "Text size",
|
|
76163
|
+
actionIds: ["selection.text.fontSize"]
|
|
76164
|
+
});
|
|
76165
|
+
registerSelectionActionSection({
|
|
76166
|
+
id: "selectionTextColors",
|
|
76167
|
+
label: "Text colors",
|
|
76168
|
+
actionIds: ["selection.text.color", "selection.text.highlight"]
|
|
76169
|
+
});
|
|
76170
|
+
registerSelectionActionSection({
|
|
76171
|
+
id: "selectionArrange",
|
|
76172
|
+
label: "Arrange",
|
|
76173
|
+
actionIds: ["selection.bringToFront", "selection.sendToBack"]
|
|
76174
|
+
});
|
|
76175
|
+
registerSelectionActionSection({
|
|
76176
|
+
id: "selectionActions",
|
|
76177
|
+
label: "Actions",
|
|
76178
|
+
actionIds: [
|
|
76179
|
+
"selection.duplicate",
|
|
76180
|
+
"selection.lock",
|
|
76181
|
+
"selection.unlock",
|
|
76182
|
+
"selection.delete"
|
|
76183
|
+
]
|
|
76184
|
+
});
|
|
76153
76185
|
registerSelectionAction({
|
|
76154
76186
|
id: "selection.delete",
|
|
76155
76187
|
label: "Delete",
|
|
76156
76188
|
icon: symbolIcon("Delete"),
|
|
76157
76189
|
description: "Removes the selected items from the board.",
|
|
76158
76190
|
invoke: { kind: "selectionMethod", methodName: "removeFromBoard" },
|
|
76191
|
+
sectionId: "selectionActions",
|
|
76192
|
+
order: 4,
|
|
76159
76193
|
isAvailable: (items) => items.length > 0
|
|
76160
76194
|
});
|
|
76161
76195
|
registerSelectionAction({
|
|
@@ -76164,6 +76198,8 @@ registerSelectionAction({
|
|
|
76164
76198
|
icon: symbolIcon("Duplicate"),
|
|
76165
76199
|
description: "Duplicates the selected items.",
|
|
76166
76200
|
invoke: { kind: "selectionMethod", methodName: "duplicate" },
|
|
76201
|
+
sectionId: "selectionActions",
|
|
76202
|
+
order: 1,
|
|
76167
76203
|
isAvailable: (items) => items.length > 0
|
|
76168
76204
|
});
|
|
76169
76205
|
registerSelectionAction({
|
|
@@ -76172,6 +76208,8 @@ registerSelectionAction({
|
|
|
76172
76208
|
icon: symbolIcon("unlock"),
|
|
76173
76209
|
description: "Locks the selected items.",
|
|
76174
76210
|
invoke: { kind: "selectionMethod", methodName: "lock" },
|
|
76211
|
+
sectionId: "selectionActions",
|
|
76212
|
+
order: 2,
|
|
76175
76213
|
isAvailable: (items) => items.length > 0 && !items.some((item) => item.transformation.isLocked)
|
|
76176
76214
|
});
|
|
76177
76215
|
registerSelectionAction({
|
|
@@ -76180,6 +76218,8 @@ registerSelectionAction({
|
|
|
76180
76218
|
icon: symbolIcon("lock"),
|
|
76181
76219
|
description: "Unlocks the selected items.",
|
|
76182
76220
|
invoke: { kind: "selectionMethod", methodName: "unlock" },
|
|
76221
|
+
sectionId: "selectionActions",
|
|
76222
|
+
order: 2,
|
|
76183
76223
|
isAvailable: (items) => items.some((item) => item.transformation.isLocked)
|
|
76184
76224
|
});
|
|
76185
76225
|
registerSelectionAction({
|
|
@@ -76188,6 +76228,8 @@ registerSelectionAction({
|
|
|
76188
76228
|
icon: symbolIcon("BringToFront"),
|
|
76189
76229
|
description: "Moves the selection above overlapping items.",
|
|
76190
76230
|
invoke: { kind: "selectionMethod", methodName: "bringToFront" },
|
|
76231
|
+
sectionId: "selectionArrange",
|
|
76232
|
+
order: 1,
|
|
76191
76233
|
isAvailable: (items) => items.length > 0
|
|
76192
76234
|
});
|
|
76193
76235
|
registerSelectionAction({
|
|
@@ -76196,6 +76238,8 @@ registerSelectionAction({
|
|
|
76196
76238
|
icon: symbolIcon("SendToBack"),
|
|
76197
76239
|
description: "Moves the selection behind overlapping items.",
|
|
76198
76240
|
invoke: { kind: "selectionMethod", methodName: "sendToBack" },
|
|
76241
|
+
sectionId: "selectionArrange",
|
|
76242
|
+
order: 2,
|
|
76199
76243
|
isAvailable: (items) => items.length > 0
|
|
76200
76244
|
});
|
|
76201
76245
|
registerSelectionAction({
|
|
@@ -76203,6 +76247,8 @@ registerSelectionAction({
|
|
|
76203
76247
|
label: "Font size",
|
|
76204
76248
|
icon: styleFontSizeIcon(),
|
|
76205
76249
|
invoke: { kind: "selectionMethod", methodName: "setFontSize" },
|
|
76250
|
+
sectionId: "selectionTextSize",
|
|
76251
|
+
order: 1,
|
|
76206
76252
|
controls: [
|
|
76207
76253
|
{
|
|
76208
76254
|
id: "fontSize",
|
|
@@ -76228,6 +76274,8 @@ registerSelectionAction({
|
|
|
76228
76274
|
swatch: { kind: "selectionProperty", property: "getFontColor" }
|
|
76229
76275
|
}),
|
|
76230
76276
|
invoke: { kind: "selectionMethod", methodName: "setFontColor" },
|
|
76277
|
+
sectionId: "selectionTextColors",
|
|
76278
|
+
order: 1,
|
|
76231
76279
|
controls: [
|
|
76232
76280
|
{
|
|
76233
76281
|
id: "fontColor",
|
|
@@ -76249,6 +76297,8 @@ registerSelectionAction({
|
|
|
76249
76297
|
swatch: { kind: "selectionProperty", property: "getFontHighlight" }
|
|
76250
76298
|
}),
|
|
76251
76299
|
invoke: { kind: "selectionMethod", methodName: "setFontHighlight" },
|
|
76300
|
+
sectionId: "selectionTextColors",
|
|
76301
|
+
order: 2,
|
|
76252
76302
|
controls: [
|
|
76253
76303
|
{
|
|
76254
76304
|
id: "fontHighlight",
|
|
@@ -84335,6 +84385,7 @@ export {
|
|
|
84335
84385
|
sha256,
|
|
84336
84386
|
semanticColor,
|
|
84337
84387
|
selectionActions,
|
|
84388
|
+
selectionActionSections,
|
|
84338
84389
|
scalePatterns,
|
|
84339
84390
|
scaleElementBy,
|
|
84340
84391
|
rgbToRgba,
|
|
@@ -84347,6 +84398,7 @@ export {
|
|
|
84347
84398
|
renderLinkToHTML,
|
|
84348
84399
|
relativeLuminance,
|
|
84349
84400
|
registerToolOverlay,
|
|
84401
|
+
registerSelectionActionSection,
|
|
84350
84402
|
registerSelectionAction,
|
|
84351
84403
|
registerItemOverlay,
|
|
84352
84404
|
registerItem,
|
|
@@ -84369,6 +84421,7 @@ export {
|
|
|
84369
84421
|
matchesOverlayCondition,
|
|
84370
84422
|
listToolOverlays,
|
|
84371
84423
|
listSelectionActions,
|
|
84424
|
+
listSelectionActionSections,
|
|
84372
84425
|
listRegisteredItemTypes,
|
|
84373
84426
|
listCreateSurfaceEntries,
|
|
84374
84427
|
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;
|