@formicoidea/labre-framework-wardley 0.23.3 → 0.24.0
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.
|
@@ -78,17 +78,17 @@ export class EdgelessWardleySeniorButton extends EdgelessToolbarToolMixin(Signal
|
|
|
78
78
|
this.setEdgelessTool(DefaultTool);
|
|
79
79
|
const menu = this.createPopper('edgeless-wardley-menu', this);
|
|
80
80
|
menu.element.edgeless = this.edgeless;
|
|
81
|
-
// Anchor the sub-menu to THIS button (the clip wrapper is
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
// senior
|
|
85
|
-
//
|
|
86
|
-
//
|
|
81
|
+
// Anchor the sub-menu to THIS button (the clip wrapper is button-relative
|
|
82
|
+
// thanks to `:host{position:relative}`): right-align the menu's right edge
|
|
83
|
+
// to the button's right edge via the wrap's `flex-end`. Mirrors every other
|
|
84
|
+
// framework senior button (Cynefin, EDGY, BPMN, DDD). This stays correct
|
|
85
|
+
// regardless of how many senior buttons are hidden — unlike aligning to the
|
|
86
|
+
// rightmost toolbar slot, which moves when buttons are toggled off.
|
|
87
87
|
const el = menu.element;
|
|
88
88
|
const wrap = el.parentElement;
|
|
89
89
|
if (wrap) {
|
|
90
90
|
wrap.style.overflow = 'visible';
|
|
91
|
-
wrap.style.justifyContent = '
|
|
91
|
+
wrap.style.justifyContent = 'flex-end';
|
|
92
92
|
}
|
|
93
93
|
Object.assign(el.style, {
|
|
94
94
|
position: 'static',
|
|
@@ -96,38 +96,6 @@ export class EdgelessWardleySeniorButton extends EdgelessToolbarToolMixin(Signal
|
|
|
96
96
|
maxWidth: 'calc(100vw - 16px)',
|
|
97
97
|
marginLeft: '0',
|
|
98
98
|
});
|
|
99
|
-
// The Wardley menu is wide (~13 items). After layout, right-align its right
|
|
100
|
-
// edge to the right edge of the rightmost senior tool (the right end of the
|
|
101
|
-
// senior toolbar), so it fills the space to the right instead of sitting
|
|
102
|
-
// centered with a gap. The menu then extends leftwards.
|
|
103
|
-
requestAnimationFrame(() => {
|
|
104
|
-
const rect = el.getBoundingClientRect();
|
|
105
|
-
// Right edge of the rightmost senior tool slot (scan across shadow roots).
|
|
106
|
-
let target = 0;
|
|
107
|
-
const seen = new Set();
|
|
108
|
-
const scan = (root) => {
|
|
109
|
-
root.querySelectorAll('*').forEach(node => {
|
|
110
|
-
const cls = node.className;
|
|
111
|
-
if (typeof cls === 'string' &&
|
|
112
|
-
cls.split(' ').includes('senior-tool-item')) {
|
|
113
|
-
const b = node.getBoundingClientRect();
|
|
114
|
-
if (b.width > 0)
|
|
115
|
-
target = Math.max(target, b.right);
|
|
116
|
-
}
|
|
117
|
-
const sr = node.shadowRoot;
|
|
118
|
-
if (sr && !seen.has(sr)) {
|
|
119
|
-
seen.add(sr);
|
|
120
|
-
scan(sr);
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
};
|
|
124
|
-
scan(document);
|
|
125
|
-
if (target > 0) {
|
|
126
|
-
const dx = Math.round(target - rect.right);
|
|
127
|
-
if (dx)
|
|
128
|
-
el.style.transform = `translateX(${dx}px)`;
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
99
|
}
|
|
132
100
|
render() {
|
|
133
101
|
return html `<edgeless-toolbar-button
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formicoidea/labre-framework-wardley",
|
|
3
3
|
"description": "Labre wardley framework for @formicoidea/labre-core.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.24.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"author": "lajola",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@formicoidea/labre-core": "0.
|
|
30
|
+
"@formicoidea/labre-core": "0.24.0",
|
|
31
31
|
"lit": "^3.2.0"
|
|
32
32
|
}
|
|
33
33
|
}
|