The Shape tool, implied rectangles, and the palette floating again
A Shapes button right of Text draws a rectangle, an ellipse, a line of taps or an arrow in the pen's colour and width, with a fill colour of its own; a hold, a secondary press or two quick clicks open its menu. Text and Hide rectangles draw nothing on the page and show blue corners while the pointer hovers over them; free text's red corner mark is gone. Arrange moves and resizes shapes. The colour palette floats below "+" again instead of reflowing the toolbar. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
46a82bf3b7
commit
03907da8c9
12 files changed
+1502
-297
No files matched your search
+5
-1
@@ -13,13 +13,17 @@ export const TITLE = 'User interface actions';
|
||||
export const WIDTH = 80;
|
||||
|
||||
/**
|
||||
* What a control is called: a button's label; a label's own text, without
|
||||
* What a control is called: the name it gives for this text, when its
|
||||
* label changes (`data-name`; the Shape button is named for the shape it
|
||||
* draws at the moment); a button's label; a label's own text, without
|
||||
* its checkbox; else the name given for assistive technology, the text of
|
||||
* the label that points at the control, or its id.
|
||||
* @param {Element} el
|
||||
* @returns {string}
|
||||
*/
|
||||
function nameOf(el) {
|
||||
const given = el.getAttribute('data-name');
|
||||
if (given) return given;
|
||||
if (el instanceof HTMLLabelElement) {
|
||||
return [...el.childNodes].filter((n) => n.nodeType === Node.TEXT_NODE)
|
||||
.map((n) => n.textContent?.trim() ?? '').join(' ').trim();
|
||||
|
||||
Reference in new issue
Block a user