From ab658feb8d5a0a2c7eb2bd213bff227b7accb23a Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Mon, 26 Feb 2024 14:45:02 -0500
Subject: fixed tooltips to not grab events - this made moving down a menu a
 problem since the tooltip blocked the next menu item and wouldn't give the
 hover event to the next menu item.  fixed proto_embeddings to update when
 lassoing a collection in marqueeView which made showContexts in property view
 do the right thing.

---
 src/client/views/linking/LinkMenuItem.tsx | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

(limited to 'src/client/views/linking/LinkMenuItem.tsx')

diff --git a/src/client/views/linking/LinkMenuItem.tsx b/src/client/views/linking/LinkMenuItem.tsx
index e694806a5..81dd0eb98 100644
--- a/src/client/views/linking/LinkMenuItem.tsx
+++ b/src/client/views/linking/LinkMenuItem.tsx
@@ -10,7 +10,7 @@ import { Cast, DocCast, StrCast } from '../../../fields/Types';
 import { WebField } from '../../../fields/URLField';
 import { DocumentType } from '../../documents/DocumentTypes';
 import { DocumentManager } from '../../util/DocumentManager';
-import { DragManager } from '../../util/DragManager';
+import { DragManager, dropActionType } from '../../util/DragManager';
 import { LinkFollower } from '../../util/LinkFollower';
 import { LinkManager } from '../../util/LinkManager';
 import { SelectionManager } from '../../util/SelectionManager';
@@ -45,7 +45,7 @@ export async function StartLinkTargetsDrag(dragEle: HTMLElement, docView: Docume
 
         const dragData = new DragManager.DocumentDragData(moddrag.length ? moddrag : draggedDocs);
         dragData.canEmbed = true;
-        dragData.dropAction = 'embed';
+        dragData.dropAction = dropActionType.embed;
 
         DragManager.StartDocumentDrag([dragEle], dragData, downX, downY, undefined);
     }
@@ -89,7 +89,7 @@ export class LinkMenuItem extends ObservableReactComponent<LinkMenuItemProps> {
             this,
             e,
             e => {
-                const dragData = new DragManager.DocumentDragData([this._props.linkDoc], 'embed');
+                const dragData = new DragManager.DocumentDragData([this._props.linkDoc], dropActionType.embed);
                 dragData.dropPropertiesToRemove = ['hidden'];
                 DragManager.StartDocumentDrag([this._editRef.current!], dragData, e.x, e.y);
                 return true;
@@ -177,12 +177,12 @@ export class LinkMenuItem extends ObservableReactComponent<LinkMenuItemProps> {
                         className="linkMenu-name" //title="drag to view target. click to customize."
                         onPointerDown={this.onLinkButtonDown}>
                         <div className="linkMenu-item-buttons">
-                            <Tooltip title={<div className="dash-tooltip">Edit Link</div>}>
+                            <Tooltip disableInteractive={true} title={<div className="dash-tooltip">Edit Link</div>}>
                                 <div className="linkMenu-icon-wrapper" ref={this._editRef} onPointerDown={this.onEdit} onClick={e => e.stopPropagation()}>
                                     <FontAwesomeIcon className="linkMenu-icon" icon="edit" size="sm" />
                                 </div>
                             </Tooltip>
-                            <Tooltip title={<div className="dash-tooltip">Show/Hide Link</div>}>
+                            <Tooltip disableInteractive={true} title={<div className="dash-tooltip">Show/Hide Link</div>}>
                                 <div title="click to show link" className="linkMenu-icon-wrapper" onPointerDown={this.onIconDown}>
                                     <FontAwesomeIcon className="linkMenu-icon" icon={destinationIcon} size="sm" />
                                 </div>
@@ -211,7 +211,7 @@ export class LinkMenuItem extends ObservableReactComponent<LinkMenuItemProps> {
                                 </p>
                             ) : null}
                             <div className="linkMenu-title-wrapper">
-                                <Tooltip title={<div className="dash-tooltip">Follow Link</div>}>
+                                <Tooltip disableInteractive={true} title={<div className="dash-tooltip">Follow Link</div>}>
                                     <p className="linkMenu-destination-title">
                                         {this._props.linkDoc.linksToAnnotation && Cast(this._props.destinationDoc.data, WebField)?.url.href === this._props.linkDoc.annotationUri ? 'Annotation in' : ''} {StrCast(title)}
                                     </p>
@@ -221,7 +221,7 @@ export class LinkMenuItem extends ObservableReactComponent<LinkMenuItemProps> {
                         </div>
 
                         <div className="linkMenu-item-buttons">
-                            <Tooltip title={<div className="dash-tooltip">Delete Link</div>}>
+                            <Tooltip disableInteractive={true} title={<div className="dash-tooltip">Delete Link</div>}>
                                 <div className="linkMenu-deleteButton" onPointerDown={this.deleteLink} onClick={e => e.stopPropagation()}>
                                     <FontAwesomeIcon className="fa-icon" icon="trash" size="sm" />
                                 </div>
-- 
cgit v1.2.3-70-g09d2


From 0a02dfa252f4eee451ba4ea74f82b90be489687e Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Mon, 1 Apr 2024 14:07:05 -0400
Subject: fixed exceptions on link to link positions

---
 src/client/documents/Documents.ts         | 8 ++++----
 src/client/views/linking/LinkMenuItem.tsx | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

(limited to 'src/client/views/linking/LinkMenuItem.tsx')

diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 20e74a3e1..29ec1d19e 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -1517,8 +1517,8 @@ export namespace DocUtils {
             return linkDoc;
         });
 
-        const a = source.layout_unrendered ? 'link_anchor_1.annotationOn' : 'link_anchor_1';
-        const b = target.layout_unrendered ? 'link_anchor_2.annotationOn' : 'link_anchor_2';
+        const a = source.layout_unrendered ? 'link_anchor_1?.annotationOn' : 'link_anchor_1';
+        const b = target.layout_unrendered ? 'link_anchor_2?.annotationOn' : 'link_anchor_2';
 
         return makeLink(
             Docs.Create.LinkDocument(
@@ -1533,8 +1533,8 @@ export namespace DocUtils {
                     link_displayLine: linkSettings.link_displayLine,
                     link_relationship: linkSettings.link_relationship,
                     link_description: linkSettings.link_description,
-                    x: ComputedField.MakeFunction(`(this.${a}.x+this.${b}.x)/2`) as any,
-                    y: ComputedField.MakeFunction(`(this.${a}.y+this.${b}.y)/2`) as any,
+                    x: ComputedField.MakeFunction(`((this.${a}?.x||0)+(this.${b}?.x||0))/2`) as any,
+                    y: ComputedField.MakeFunction(`((this.${a}?.y||0)+(this.${b}?.y||0))/2`) as any,
                     link_autoMoveAnchors: true,
                     _lockedPosition: true,
                     _layout_showCaption: '', // removed since they conflict with showing a link with a LinkBox (ie, line, not comparison box)
diff --git a/src/client/views/linking/LinkMenuItem.tsx b/src/client/views/linking/LinkMenuItem.tsx
index 81dd0eb98..a2c9d10b6 100644
--- a/src/client/views/linking/LinkMenuItem.tsx
+++ b/src/client/views/linking/LinkMenuItem.tsx
@@ -183,7 +183,7 @@ export class LinkMenuItem extends ObservableReactComponent<LinkMenuItemProps> {
                                 </div>
                             </Tooltip>
                             <Tooltip disableInteractive={true} title={<div className="dash-tooltip">Show/Hide Link</div>}>
-                                <div title="click to show link" className="linkMenu-icon-wrapper" onPointerDown={this.onIconDown}>
+                                <div className="linkMenu-icon-wrapper" onPointerDown={this.onIconDown}>
                                     <FontAwesomeIcon className="linkMenu-icon" icon={destinationIcon} size="sm" />
                                 </div>
                             </Tooltip>
-- 
cgit v1.2.3-70-g09d2

