From 27bb82ad35e94c0d7bc6fa9af9ad04122be3d571 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Wed, 9 Aug 2023 21:42:10 -0400
Subject: fixed resizing from bottomleft. turned on Tools in novice mode.  
 fixed aborting editing of tree view titles with escape or click outside.  got
 rid of scrollbar in Tools panel by fixing height of masonry panel.  updated
 browndash-components to fix problem of tooltips getting in away of click
 events on Tool items.

---
 src/client/views/nodes/FontIconBox/FontIconBox.tsx | 40 ++++++++--------------
 1 file changed, 14 insertions(+), 26 deletions(-)

(limited to 'src/client/views/nodes/FontIconBox/FontIconBox.tsx')

diff --git a/src/client/views/nodes/FontIconBox/FontIconBox.tsx b/src/client/views/nodes/FontIconBox/FontIconBox.tsx
index ad3532502..91eac675f 100644
--- a/src/client/views/nodes/FontIconBox/FontIconBox.tsx
+++ b/src/client/views/nodes/FontIconBox/FontIconBox.tsx
@@ -378,38 +378,26 @@ export class FontIconBox extends DocComponent<ButtonProps>() {
     }
 
     render() {
-        // determine dash button metadata
         const color = this.props.styleProvider?.(this.rootDoc, this.props, StyleProp.Color);
-        const tooltip: string = StrCast(this.rootDoc.toolTip);
-        const onClickScript = ScriptCast(this.rootDoc.onClick);
-        // TODO:glr Add label of button type
-        let button: JSX.Element = this.defaultButton;
+        const tooltip = StrCast(this.rootDoc.toolTip);
+        const scriptFunc = () => ScriptCast(this.rootDoc.onClick)?.script.run({ this: this.layoutDoc, self: this.rootDoc, _readOnly_: false });
+        const btnProps = { tooltip, icon: this.Icon(color)!, label: this.label };
         // prettier-ignore
         switch (this.type) {
-            case ButtonType.EditableText: 
-                button = this.editableText; break;
-            case ButtonType.DropdownList:
-                button = this.dropdownListButton; break;
-            case ButtonType.ColorButton: 
-                button = this.colorButton;  break;
             case ButtonType.NumberDropdownButton: 
             case ButtonType.NumberInlineButton:
-            case ButtonType.NumberSliderButton: 
-                button = this.numberDropdown;  break;
-            case ButtonType.DropdownButton: 
-                button = this.dropdownButton;  break;
-            case ButtonType.MultiToggleButton: 
-                button = this.multiToggleButton; break; 
-            case ButtonType.ToggleButton: button = this.toggleButton; break;
+            case ButtonType.NumberSliderButton: return this.numberDropdown;
+            case ButtonType.EditableText:       return this.editableText; 
+            case ButtonType.DropdownList:       return this.dropdownListButton;
+            case ButtonType.ColorButton:        return this.colorButton; 
+            case ButtonType.DropdownButton:     return this.dropdownButton;
+            case ButtonType.MultiToggleButton:  return this.multiToggleButton;
+            case ButtonType.ToggleButton:       return this.toggleButton;
             case ButtonType.ClickButton:
-            case ButtonType.ToolButton: 
-                button = <IconButton tooltip={tooltip} color={color} icon={this.Icon(color)!} label={this.label}/>; break;
-            case ButtonType.TextButton: 
-                button = <Button tooltip={tooltip} icon={this.Icon(color)!} text={StrCast(this.rootDoc.buttonText)} label={this.label}/>; break;
-            case ButtonType.MenuButton: 
-                button = <IconButton tooltip={tooltip} onPointerDown={() => onClickScript?.script.run({ this: this.layoutDoc, self: this.rootDoc, _readOnly_: false })} tooltipPlacement='right' size={Size.LARGE} color={color} icon={this.Icon(color)!} label={this.label}/>; break;
+            case ButtonType.ToolButton: return <IconButton {...btnProps} size={Size.LARGE} color={color} />;
+            case ButtonType.TextButton: return <Button     {...btnProps} text={StrCast(this.rootDoc.buttonText)}/>;
+            case ButtonType.MenuButton: return <IconButton {...btnProps} color={color}  size={Size.LARGE} tooltipPlacement='right' onPointerDown={scriptFunc} />; 
         }
-
-        return button;
+        return this.defaultButton;
     }
 }
-- 
cgit v1.2.3-70-g09d2


From 372face940712d239d48f9884ded34d82d170a94 Mon Sep 17 00:00:00 2001
From: geireann <geireann.lindfield@gmail.com>
Date: Tue, 15 Aug 2023 15:33:28 -0400
Subject: trying to prevent colorpicker from generating undo event for every
 drag movement.

---
 package-lock.json                                  | 64 +++++++++++-----------
 package.json                                       |  2 +-
 src/client/views/nodes/FontIconBox/FontIconBox.tsx | 11 +++-
 3 files changed, 41 insertions(+), 36 deletions(-)

(limited to 'src/client/views/nodes/FontIconBox/FontIconBox.tsx')

diff --git a/package-lock.json b/package-lock.json
index 1d334cbeb..7be724df1 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -6507,9 +6507,9 @@
             }
         },
         "browndash-components": {
-            "version": "0.0.93",
-            "resolved": "https://registry.npmjs.org/browndash-components/-/browndash-components-0.0.93.tgz",
-            "integrity": "sha512-JL9Hi7Nq+zHZtjLCQSuGhID0Hd7X6sARutyJqbECfsLWACsIC/JfeEQZdUeH5CqO+R7pJKeoWM82AIkWGtN2Xw==",
+            "version": "0.0.95",
+            "resolved": "https://registry.npmjs.org/browndash-components/-/browndash-components-0.0.95.tgz",
+            "integrity": "sha512-1sTyIyzngLSMWqit7bysNH3Xb24QEXsctlm1u14RBK8826Q8ALlK1YxbFMYjzFMNK1WggC0TQ31VdKA3iuTamQ==",
             "requires": {
                 "@emotion/react": "^11.11.1",
                 "@emotion/styled": "^11.11.0",
@@ -6627,14 +6627,14 @@
                     "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww=="
                 },
                 "@mui/base": {
-                    "version": "5.0.0-beta.10",
-                    "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.10.tgz",
-                    "integrity": "sha512-moTAhGwFfQffj7hsu61FnqcGqVcd53A1CrOhnskM9TF0Uh2rnLDMCuar4JRUWWpaJofAfQEbQBBFPadFQLI4PA==",
+                    "version": "5.0.0-beta.11",
+                    "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.11.tgz",
+                    "integrity": "sha512-FdKZGPd8qmC3ZNke7CNhzcEgToc02M6WYZc9hcBsNQ17bgAd3s9F//1bDDYgMVBYxDM71V0sv/hBHlOY4I1ZVA==",
                     "requires": {
                         "@babel/runtime": "^7.22.6",
                         "@emotion/is-prop-valid": "^1.2.1",
                         "@mui/types": "^7.2.4",
-                        "@mui/utils": "^5.14.4",
+                        "@mui/utils": "^5.14.5",
                         "@popperjs/core": "^2.11.8",
                         "clsx": "^2.0.0",
                         "prop-types": "^15.8.1",
@@ -6652,21 +6652,21 @@
                     }
                 },
                 "@mui/core-downloads-tracker": {
-                    "version": "5.14.4",
-                    "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.14.4.tgz",
-                    "integrity": "sha512-pW2XghSi3hpYKX57Wu0SCWMTSpzvXZmmucj3TcOJWaCiFt4xr05w2gcwBZi36dAp9uvd9//9N51qbblmnD+GPg=="
+                    "version": "5.14.5",
+                    "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.14.5.tgz",
+                    "integrity": "sha512-+wpGH1USwPcKMFPMvXqYPC6fEvhxM3FzxC8lyDiNK/imLyyJ6y2DPb1Oue7OGIKJWBmYBqrWWtfovrxd1aJHTA=="
                 },
                 "@mui/material": {
-                    "version": "5.14.4",
-                    "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.14.4.tgz",
-                    "integrity": "sha512-2XUV3KyRC07BQPPzEgd+ss3x/ezXtHeKtOGCMCNmx3MauZojPYUpSwFkE0fYgYCD9dMQMVG4DY/VF38P0KShsg==",
+                    "version": "5.14.5",
+                    "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.14.5.tgz",
+                    "integrity": "sha512-4qa4GMfuZH0Ai3mttk5ccXP8a3sf7aPlAJwyMrUSz6h9hPri6BPou94zeu3rENhhmKLby9S/W1y+pmficy8JKA==",
                     "requires": {
                         "@babel/runtime": "^7.22.6",
-                        "@mui/base": "5.0.0-beta.10",
-                        "@mui/core-downloads-tracker": "^5.14.4",
-                        "@mui/system": "^5.14.4",
+                        "@mui/base": "5.0.0-beta.11",
+                        "@mui/core-downloads-tracker": "^5.14.5",
+                        "@mui/system": "^5.14.5",
                         "@mui/types": "^7.2.4",
-                        "@mui/utils": "^5.14.4",
+                        "@mui/utils": "^5.14.5",
                         "@types/react-transition-group": "^4.4.6",
                         "clsx": "^2.0.0",
                         "csstype": "^3.1.2",
@@ -6686,12 +6686,12 @@
                     }
                 },
                 "@mui/private-theming": {
-                    "version": "5.14.4",
-                    "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.14.4.tgz",
-                    "integrity": "sha512-ISXsHDiQ3z1XA4IuKn+iXDWvDjcz/UcQBiFZqtdoIsEBt8CB7wgdQf3LwcwqO81dl5ofg/vNQBEnXuKfZHrnYA==",
+                    "version": "5.14.5",
+                    "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.14.5.tgz",
+                    "integrity": "sha512-cC4C5RrpXpDaaZyH9QwmPhRLgz+f2SYbOty3cPkk4qPSOSfif2ZEcDD9HTENKDDd9deB+xkPKzzZhi8cxIx8Ig==",
                     "requires": {
                         "@babel/runtime": "^7.22.6",
-                        "@mui/utils": "^5.14.4",
+                        "@mui/utils": "^5.14.5",
                         "prop-types": "^15.8.1"
                     },
                     "dependencies": {
@@ -6727,15 +6727,15 @@
                     }
                 },
                 "@mui/system": {
-                    "version": "5.14.4",
-                    "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.14.4.tgz",
-                    "integrity": "sha512-oPgfWS97QNfHcDBapdkZIs4G5i85BJt69Hp6wbXF6s7vi3Evcmhdk8AbCRW6n0sX4vTj8oe0mh0RIm1G2A1KDA==",
+                    "version": "5.14.5",
+                    "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.14.5.tgz",
+                    "integrity": "sha512-mextXZHDeGcR7E1kx43TRARrVXy+gI4wzpUgNv7MqZs1dvTVXQGVeAT6ydj9d6FUqHBPMNLGV/21vJOrpqsL+w==",
                     "requires": {
                         "@babel/runtime": "^7.22.6",
-                        "@mui/private-theming": "^5.14.4",
+                        "@mui/private-theming": "^5.14.5",
                         "@mui/styled-engine": "^5.13.2",
                         "@mui/types": "^7.2.4",
-                        "@mui/utils": "^5.14.4",
+                        "@mui/utils": "^5.14.5",
                         "clsx": "^2.0.0",
                         "csstype": "^3.1.2",
                         "prop-types": "^15.8.1"
@@ -6752,9 +6752,9 @@
                     }
                 },
                 "@mui/utils": {
-                    "version": "5.14.4",
-                    "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.4.tgz",
-                    "integrity": "sha512-4ANV0txPD3x0IcTCSEHKDWnsutg1K3m6Vz5IckkbLXVYu17oOZCVUdOKsb/txUmaCd0v0PmSRe5PW+Mlvns5dQ==",
+                    "version": "5.14.5",
+                    "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.5.tgz",
+                    "integrity": "sha512-6Hzw63VR9C5xYv+CbjndoRLU6Gntal8rJ5W+GUzkyHrGWIyYPWZPa6AevnyGioySNETATe1H9oXS8f/7qgIHJA==",
                     "requires": {
                         "@babel/runtime": "^7.22.6",
                         "@types/prop-types": "^15.7.5",
@@ -8787,9 +8787,9 @@
                     "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g=="
                 },
                 "postcss": {
-                    "version": "8.4.27",
-                    "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.27.tgz",
-                    "integrity": "sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==",
+                    "version": "8.4.28",
+                    "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.28.tgz",
+                    "integrity": "sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==",
                     "requires": {
                         "nanoid": "^3.3.6",
                         "picocolors": "^1.0.0",
diff --git a/package.json b/package.json
index aff438dd9..63f6a7040 100644
--- a/package.json
+++ b/package.json
@@ -178,7 +178,7 @@
         "body-parser": "^1.19.2",
         "bootstrap": "^4.6.1",
         "brotli": "^1.3.3",
-        "browndash-components": "^0.0.93",
+        "browndash-components": "^0.0.95",
         "browser-assert": "^1.2.1",
         "bson": "^4.6.1",
         "canvas": "^2.9.3",
diff --git a/src/client/views/nodes/FontIconBox/FontIconBox.tsx b/src/client/views/nodes/FontIconBox/FontIconBox.tsx
index 91eac675f..1b2209224 100644
--- a/src/client/views/nodes/FontIconBox/FontIconBox.tsx
+++ b/src/client/views/nodes/FontIconBox/FontIconBox.tsx
@@ -267,20 +267,25 @@ export class FontIconBox extends DocComponent<ButtonProps>() {
         return ScriptCast(this.rootDoc.script);
     }
 
+    colorBatch:UndoManager.Batch|undefined;
     /**
      * Color button
      */
     @computed get colorButton() {
         const color = this.props.styleProvider?.(this.rootDoc, this.props, StyleProp.Color);
-        const backgroundColor = this.props.styleProvider?.(this.rootDoc, this.props, StyleProp.BackgroundColor);
         const curColor = this.colorScript?.script.run({ this: this.layoutDoc, self: this.rootDoc, value: undefined, _readOnly_: true }).result ?? 'transparent';
         const tooltip: string = StrCast(this.rootDoc.toolTip);
 
         return (
             <ColorPicker
                 setSelectedColor={value => {
-                    const s = this.colorScript;
-                    s && undoable(() => s.script.run({ this: this.layoutDoc, self: this.rootDoc, value: value, _readOnly_: false }).result, `Set ${tooltip} to ${value}`)();
+                    if (!this.colorBatch) this.colorBatch = UndoManager.StartBatch(`Set ${tooltip} color`);
+                    this.colorScript?.script.run({ this: this.layoutDoc, self: this.rootDoc, value: value, _readOnly_: false });
+                }}
+                setFinalColor={value => {
+                    this.colorScript?.script.run({ this: this.layoutDoc, self: this.rootDoc, value: value, _readOnly_: false });
+                    this.colorBatch?.end();
+                    this.colorBatch= undefined;
                 }}
                 selectedColor={curColor}
                 type={Type.PRIM}
-- 
cgit v1.2.3-70-g09d2

