From 705975eb43e7904c62e7e847478f6d0dac60d443 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Sun, 23 Mar 2025 18:14:31 -0400
Subject: more _props.Document  to .Document refactoring.  type updates to
 prosemirrortransfer

---
 src/client/views/nodes/formattedText/DashFieldView.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

diff --git a/src/client/views/nodes/formattedText/DashFieldView.tsx b/src/client/views/nodes/formattedText/DashFieldView.tsx
index aa2829aaf..bb0efa917 100644
--- a/src/client/views/nodes/formattedText/DashFieldView.tsx
+++ b/src/client/views/nodes/formattedText/DashFieldView.tsx
@@ -162,7 +162,7 @@ export class DashFieldViewInternal extends ObservableReactComponent<IDashFieldVi
                     this._expanded = !this._props.editable ? false : !this._expanded;
                 })}>
                 <SchemaTableCell
-                    Document={this._dashDoc}
+                    Doc={this._dashDoc}
                     col={0}
                     deselectCell={emptyFunction}
                     selectCell={() => (this._expanded ? true : undefined)}
-- 
cgit v1.2.3-70-g09d2


From 1ab64fef6e861a2958bbd826f086b8aac7d0c359 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 10 Apr 2025 20:42:09 -0400
Subject: fixed dashfieldviews in text boxes to show ellipsis for long lines
 and to hide dropdown menu when field is not editable. fixed pasting from
 pdf's to work and to display the entire text box.

---
 src/client/views/nodes/formattedText/DashFieldView.scss |  3 +++
 src/client/views/nodes/formattedText/DashFieldView.tsx  |  5 +++--
 src/client/views/pdf/PDFViewer.tsx                      | 13 ++++---------
 3 files changed, 10 insertions(+), 11 deletions(-)

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

diff --git a/src/client/views/nodes/formattedText/DashFieldView.scss b/src/client/views/nodes/formattedText/DashFieldView.scss
index 2e2e1d41c..6db8abc7f 100644
--- a/src/client/views/nodes/formattedText/DashFieldView.scss
+++ b/src/client/views/nodes/formattedText/DashFieldView.scss
@@ -42,6 +42,9 @@
             user-select: all;
             min-width: 100%;
             display: inline-block;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            max-width: 100%;
         }
     }
 }
diff --git a/src/client/views/nodes/formattedText/DashFieldView.tsx b/src/client/views/nodes/formattedText/DashFieldView.tsx
index bb0efa917..7ea5d1fcf 100644
--- a/src/client/views/nodes/formattedText/DashFieldView.tsx
+++ b/src/client/views/nodes/formattedText/DashFieldView.tsx
@@ -184,7 +184,7 @@ export class DashFieldViewInternal extends ObservableReactComponent<IDashFieldVi
                     getFinfo={this.finfo}
                     setColumnValues={returnFalse}
                     allowCRs
-                    oneLine={!this._expanded}
+                    oneLine={!this._expanded && this._props.editable}
                     finishEdit={this.finishEdit}
                     transform={Transform.Identity}
                     menuTarget={null}
@@ -275,7 +275,7 @@ export class DashFieldViewInternal extends ObservableReactComponent<IDashFieldVi
                     </span>
                 )}
                 {this._props.fieldKey.startsWith('#') || this._hideValue ? null : this.fieldValueContent}
-                {!this.values.length ? null : (
+                {!this.values.length || !this.props.editable ? null : (
                     <select className="dashFieldView-select" tabIndex={-1} defaultValue={this._dashDoc && Field.toKeyValueString(this._dashDoc, this._fieldKey)} onChange={this.selectVal}>
                         <option value="-unset-">-unset-</option>
                         {this.values.map(val => (
@@ -308,6 +308,7 @@ export class DashFieldView {
         this.dom.style.height = node.attrs.height;
         this.dom.style.position = 'relative';
         this.dom.style.display = 'inline-flex';
+        this.dom.style.maxWidth = '100%';
         this.dom.onkeypress = function (e: KeyboardEvent) {
             e.stopPropagation();
         };
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index ed2f661e6..9aa0e8e8b 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -134,7 +134,7 @@ export class PDFViewer extends ObservableReactComponent<IViewerProps> {
 
     componentWillUnmount = () => {
         Object.values(this._disposers).forEach(disposer => disposer?.());
-        document.removeEventListener('copy', this.copy);
+        document.removeEventListener('copy', this.copy, true);
     };
 
     copy = (e: ClipboardEvent) => {
@@ -262,16 +262,11 @@ export class PDFViewer extends ObservableReactComponent<IViewerProps> {
             }
             return;
         }
-        document.removeEventListener('copy', this.copy);
-        document.addEventListener('copy', this.copy);
+        document.removeEventListener('copy', this.copy, true);
+        document.addEventListener('copy', this.copy, true);
         const eventBus = new PDFJSViewer.EventBus();
         eventBus._on('pagesinit', this.pagesinit);
-        eventBus._on(
-            'pagerendered',
-            action(() => {
-                this._showWaiting = false;
-            })
-        );
+        eventBus._on('pagerendered',action(() => (this._showWaiting = false))); // prettier-ignore
         const pdfLinkService = new PDFJSViewer.PDFLinkService({ eventBus });
         const pdfFindController = new PDFJSViewer.PDFFindController({ linkService: pdfLinkService, eventBus });
         this._pdfViewer = new PDFJSViewer.PDFViewer({
-- 
cgit v1.2.3-70-g09d2


From cc3838dd456da90a66d7b563d9f4ea7b8753c4de Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Wed, 14 May 2025 22:39:24 -0400
Subject: moved calendar button to expert. fixed context menu for dash field
 views.

---
 src/client/views/DocumentButtonBar.tsx                 | 4 ++--
 src/client/views/nodes/formattedText/DashFieldView.tsx | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

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

diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index bc669fc4e..a845e4936 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -294,7 +294,7 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (
                     {metaBtn('keywords', 'id-card')}
                 </div> */}
 
-                <Tooltip title={<div className="dash-keyword-button">Open keyword menu</div>}>
+                <Tooltip title={<div className="dash-keyword-button">Open tags menu</div>}>
                     <div
                         className="documentButtonBar-icon"
                         style={{ color: 'white' }}
@@ -511,7 +511,7 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (
                 {!DocumentView.Selected().some(v => v.allLinks.length) ? null : <div className="documentButtonBar-button">{this.followLinkButton}</div>}
                 <div className="documentButtonBar-button">{this.pinButton}</div>
                 <div className="documentButtonBar-button">{this.recordButton}</div>
-                <div className="documentButtonBar-button">{this.calendarButton}</div>
+                {Doc.noviceMode ? null : <div className="documentButtonBar-button">{this.calendarButton}</div>}
                 {this.view0?.HasAIEditor ? <div className="documentButtonBar-button">{this.aiEditorButton}</div> : null}
                 <div className="documentButtonBar-button">{this.keywordButton}</div>
                 {!Doc.UserDoc().documentLinksButton_fullMenu ? null : <div className="documentButtonBar-button">{this.shareButton}</div>}
diff --git a/src/client/views/nodes/formattedText/DashFieldView.tsx b/src/client/views/nodes/formattedText/DashFieldView.tsx
index 7ea5d1fcf..d700a705a 100644
--- a/src/client/views/nodes/formattedText/DashFieldView.tsx
+++ b/src/client/views/nodes/formattedText/DashFieldView.tsx
@@ -262,7 +262,8 @@ export class DashFieldViewInternal extends ObservableReactComponent<IDashFieldVi
     render() {
         return (
             <div
-                className={`dashFieldView${this.isRowActive() ? '-active' : ''}`}
+                // eslint-disable-next-line no-use-before-define
+                className={`${DashFieldView.name}${this.isRowActive() ? '-active' : ''}`}
                 ref={this._fieldRef}
                 style={{
                     // width: this._props.width,
-- 
cgit v1.2.3-70-g09d2

