aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/documents/Documents.ts7
-rw-r--r--src/client/views/DocumentButtonBar.tsx54
-rw-r--r--src/client/views/DocumentDecorations.tsx4
-rw-r--r--src/client/views/StyleProvider.tsx3
-rw-r--r--src/client/views/collections/CollectionCardDeckView.scss58
-rw-r--r--src/client/views/collections/CollectionCardDeckView.tsx19
-rw-r--r--src/client/views/global/globalScripts.ts12
-rw-r--r--src/client/views/nodes/IconTagBox.scss20
-rw-r--r--src/client/views/pdf/GPTPopup/GPTPopup.scss12
9 files changed, 58 insertions, 131 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 623a5251e..aac15059e 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -488,14 +488,7 @@ export class DocumentOptions {
userColor?: STRt = new StrInfo('color associated with a Dash user (seen in header fields of shared documents)');
cardSort?: STRt = new StrInfo('way cards are sorted in deck view');
- // cardSortForDropDown?: STRt = new StrInfo('needed for dropdown and i dont know why')
- // cardSort_customField?: STRt = new StrInfo('field key used for sorting cards');
- cardSort_activeIcons?: List<string>; //icons each card is tagges with
- // cardSort_visibleSortGroups?: List<string>; // which sorting values are being filtered (shown)
-
- // cardSort_visibleSortGroups?: List<number>; // which sorting values are being filtered (shown)
cardSort_isDesc?: BOOLt = new BoolInfo('whether the cards are sorted ascending or descending');
- // test?: STRt = new StrInfo('testing for filtering')
}
export const DocOptions = new DocumentOptions();
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index ea859a1e5..ccde1de80 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -9,7 +9,7 @@ import * as React from 'react';
import { FaEdit } from 'react-icons/fa';
import { returnFalse, returnTrue, setupMoveUpEvents, simulateMouseClick } from '../../ClientUtils';
import { emptyFunction } from '../../Utils';
-import { Doc, DocListCast } from '../../fields/Doc';
+import { Doc } from '../../fields/Doc';
import { Cast, DocCast } from '../../fields/Types';
import { DocUtils, IsFollowLinkScript } from '../documents/DocUtils';
import { CalendarManager } from '../util/CalendarManager';
@@ -264,6 +264,26 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (
}
@computed
+ get calendarButton() {
+ const targetDoc = this.view0?.Document;
+ return !targetDoc ? null : (
+ <Tooltip title={<div className="dash-calendar-button">Open calendar menu</div>}>
+ <div
+ className="documentButtonBar-icon"
+ style={{ color: 'white' }}
+ onClick={() => {
+ CalendarManager.Instance.open(this.view0, targetDoc);
+ }}>
+ <FontAwesomeIcon className="documentdecorations-icon" icon={faCalendarDays as IconLookup} />
+ </div>
+ </Tooltip>
+ );
+ }
+
+ /**
+ * Allows for both the keywords and the icon tags to be shown using a quasi- multitoggle
+ */
+ @computed
get keywordButton() {
const targetDoc = this.view0?.Document;
@@ -279,21 +299,10 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (
size="sm"
icon={icon}
onClick={e => {
- // console.log('wtfff')
- // name === 'tags' ??
if (name === 'tags'){
- undoable(e => (targetDoc && (targetDoc[DocData].showIconTags = !targetDoc[DocData].showIconTags)), 'show icon tags')
+ (targetDoc && (targetDoc[DocData].showIconTags = !targetDoc[DocData].showIconTags))
} else {
- undoable(e => {
- const showing = DocumentView.Selected().some(dv => dv.layoutDoc._layout_showTags);
- DocumentView.Selected().forEach(dv => {
- dv.layoutDoc._layout_showTags = !showing;
- if (e.shiftKey)
- DocListCast(dv.Document[Doc.LayoutFieldKey(dv.Document) + '_annotations']).forEach(doc => {
- if (doc.face) doc.hidden = showing;
- });
- });
- }, 'show Doc tags')
+ (targetDoc && (targetDoc[DocData].showLabels = !targetDoc[DocData].showLabels))
}
@@ -309,15 +318,23 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (
- return !DocumentView.Selected().length ? null : (
+ return !targetDoc ? null : (
<div className='documentButtonBar-icon'>
<div className="documentButtonBar-pinTypes" style = {{width: '40px'}}>
{metaBtn('tags', 'star')}
{metaBtn("keywords", 'id-card')}
</div>
- <Tooltip title={<div className="dash-keyword-button">Open keyword / icon tag menu</div>}>
- <div className="documentButtonBar-icon" style={{ color: 'white' }}>
+ <Tooltip title={<div className="dash-keyword-button">Open keyword menu</div>}>
+ <div
+ className="documentButtonBar-icon"
+ style={{ color: 'white' }}
+ onClick={() => {
+ // targetDoc[DocData].showIconTags = !targetDoc[DocData].showIconTags;
+ }}
+ >
+
+
<FontAwesomeIcon className="documentdecorations-icon" icon="tag" />
</div>
</Tooltip>
@@ -495,10 +512,11 @@ 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>
<div className="documentButtonBar-button">{this.keywordButton}</div>
{!Doc.UserDoc().documentLinksButton_fullMenu ? null : <div className="documentButtonBar-button">{this.shareButton}</div>}
<div className="documentButtonBar-button">{this.menuButton}</div>
</div>
);
}
-}
+} \ No newline at end of file
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 45ce681aa..37b1f04e7 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -773,10 +773,6 @@ export class DocumentDecorations extends ObservableReactComponent<DocumentDecora
const freeformDoc = DocumentView.Selected().some(v => CollectionFreeFormDocumentView.from(v));
- const keyWordTrans = doc[DocData].showLabels ? NumCast(doc[DocData].keywordHeight) : 0
- const tagTrans = doc[DocData].showIconTags ? NumCast(doc[DocData].tagHeight) : 0
-
-
return (
<div className="documentDecorations" style={{ display: this._showNothing && !freeformDoc ? 'none' : undefined }}>
<div
diff --git a/src/client/views/StyleProvider.tsx b/src/client/views/StyleProvider.tsx
index cda39b474..54698ab2d 100644
--- a/src/client/views/StyleProvider.tsx
+++ b/src/client/views/StyleProvider.tsx
@@ -367,13 +367,12 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<FieldViewProps &
</Tooltip>
);
};
- const tags = () => props?.DocumentView?.() && CollectionFreeFormDocumentView.from(props.DocumentView()) ? <TagsView View={props.DocumentView()}/> : null;
+ const tags = () => props?.DocumentView?.() ? <TagsView Views={[props.DocumentView()]}/> : null;
const iconTags = () => {
if (doc && doc![DocData].showIconTags)
{return (<IconTagBox doc= {doc}></IconTagBox>)}
}
-
return (
<>
{paint()}
diff --git a/src/client/views/collections/CollectionCardDeckView.scss b/src/client/views/collections/CollectionCardDeckView.scss
index 1728f7aee..5ccc3d9a8 100644
--- a/src/client/views/collections/CollectionCardDeckView.scss
+++ b/src/client/views/collections/CollectionCardDeckView.scss
@@ -12,7 +12,6 @@
height: 35px;
border-radius: 50%;
background-color: $dark-gray;
- // border-color: $medium-blue;
margin: 5px; // transform: translateY(-50px);
}
}
@@ -20,7 +19,6 @@
.card-wrapper {
display: grid;
grid-template-columns: repeat(10, 1fr);
- // width: 100%;
transform-origin: top left;
position: absolute;
@@ -31,33 +29,6 @@
transition: transform 0.3s cubic-bezier(0.455, 0.03, 0.515, 0.955);
}
-// .card-button-container {
-// display: flex;
-// padding: 3px;
-// // width: 300px;
-// // height:100px;
-// pointer-events: none; /* This ensures the container does not capture hover events */
-
-// background-color: rgb(218, 218, 218); /* Background color of the container */
-// border-radius: 50px; /* Rounds the corners of the container */
-// transform: translateY(25px);
-// // box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Optional: Adds shadow for depth */
-// align-items: center; /* Centers buttons vertically */
-// justify-content: start; /* Centers buttons horizontally */
-
-// button {
-// pointer-events: auto; /* Re-enable pointer events for the buttons */
-
-// width: 70px;
-// height: 70px;
-// border-radius: 50%;
-// background-color: $dark-gray;
-// // border-color: $medium-blue;
-// margin: 5px; // transform: translateY(-50px);
-// background-color: transparent;
-// }
-// }
-
.no-card-span{
position: relative;
width: fit-content;
@@ -70,28 +41,6 @@
-// button:hover {
-// transform: translateY(-50px);
-// }
-
-// .card-wrapper::after {
-// content: "";
-// width: 100%; /* Forces wrapping */
-// }
-
-// .card-wrapper > .card-item:nth-child(10n)::after {
-// content: "";
-// width: 100%; /* Forces wrapping after every 10th item */
-// }
-
-// .card-row{
-// display: flex;
-// position: absolute;
-// align-items: center;
-// transition: transform 0.3s cubic-bezier(0.455, 0.03, 0.515, 0.955);
-
-// }
-
.card-item-inactive,
.card-item-active,
.card-item {
@@ -101,18 +50,11 @@
flex-direction: column;
}
-// .card-item:hover {
-// box-shadow: 0 20px 20px $medium-blue;
-// transform: scale(1.05);
-
-
-// }
.card-item-inactive {
opacity: 0.5;
}
.card-item-active {
- // position: absolute;
z-index: 100;
}
diff --git a/src/client/views/collections/CollectionCardDeckView.tsx b/src/client/views/collections/CollectionCardDeckView.tsx
index 3d9f28a49..bb932b8b2 100644
--- a/src/client/views/collections/CollectionCardDeckView.tsx
+++ b/src/client/views/collections/CollectionCardDeckView.tsx
@@ -1,9 +1,9 @@
import { IReactionDisposer, ObservableMap, action, computed, makeObservable, observable, reaction } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
-import { ClientUtils, DashColor, returnFalse, returnZero } from '../../../ClientUtils';
-import { emptyFunction, numberRange } from '../../../Utils';
-import { Doc, NumListCast, StrListCast } from '../../../fields/Doc';
+import { ClientUtils, returnFalse, returnZero } from '../../../ClientUtils';
+import { emptyFunction } from '../../../Utils';
+import { Doc, StrListCast } from '../../../fields/Doc';
import { DocData } from '../../../fields/DocSymbols';
import { Id } from '../../../fields/FieldSymbols';
import { BoolCast, Cast, DateCast, NumCast, RTFCast, ScriptCast, StrCast } from '../../../fields/Types';
@@ -144,18 +144,7 @@ export class CollectionCardView extends CollectionSubView() {
* custom group
*/
@computed get childDocsWithoutLinks() {
- const regularDocs = this.childDocs.filter(l => l.type !== DocumentType.LINK);
- const activeGroups = StrListCast(this.Document.cardSort_visibleSortGroups);
-
- if (activeGroups.length > 0) {
- return regularDocs.filter(doc => {
- const activeTags = StrListCast(doc.cardSort_activeIcons);
- return activeTags !== undefined && activeTags.some(tag => activeGroups.includes(tag));
- });
- }
-
- // Default return for non-custom cardSort or other cases, filtering out links
- return regularDocs;
+ return this.childDocs.filter(l => l.type !== DocumentType.LINK);
}
/**
diff --git a/src/client/views/global/globalScripts.ts b/src/client/views/global/globalScripts.ts
index 53e10d44d..65bd524fe 100644
--- a/src/client/views/global/globalScripts.ts
+++ b/src/client/views/global/globalScripts.ts
@@ -147,7 +147,7 @@ ScriptingGlobals.add(function showFreeform(attr: 'hcenter' | 'vcenter' | 'grid'
}
// prettier-ignore
- const map: Map<'flashcards' | 'center' | 'grid' | 'snaplines' | 'clusters' | 'arrange' | 'viewAll' | 'fitOnce' | 'time' | 'docType' | 'color' | 'chat' | 'up' | 'down' | 'pile' | 'toggle-chat' | 'tag',
+ const map: Map<'flashcards' | 'hcenter' | 'vcenter' | 'grid' | 'snaplines' | 'clusters' | 'arrange' | 'viewAll' | 'fitOnce' | 'time' | 'docType' | 'color' | 'chat' | 'up' | 'down' | 'pile' | 'toggle-chat' | 'tag',
{
waitForRender?: boolean;
checkResult: (doc: Doc) => boolean;
@@ -169,9 +169,13 @@ ScriptingGlobals.add(function showFreeform(attr: 'hcenter' | 'vcenter' | 'grid'
else (dv.ComponentView as CollectionFreeFormView)?.fitContentOnce();
},
}],
- ['center', {
- checkResult: (doc: Doc) => BoolCast(doc?._stacking_alignCenter, false),
- setDoc: (doc: Doc) => { doc._stacking_alignCenter = !doc._stacking_alignCenter; },
+ ['vcenter', {
+ checkResult: (doc:Doc) => !StrCast(doc?._layout_dontCenter).includes('y'),
+ setDoc: (doc:Doc) => { doc._layout_dontCenter = StrCast(doc.layout_dontCenter).includes('y') ? StrCast(doc.layout_dontCenter).replace(/y/,"") : StrCast(doc.layout_dontCenter) + 'y'; },
+ }],
+ ['hcenter', {
+ checkResult: (doc:Doc) => !StrCast(doc?._layout_dontCenter).includes('x'),
+ setDoc: (doc:Doc) => { doc._layout_dontCenter = StrCast(doc.layout_dontCenter).includes('x') ? StrCast(doc.layout_dontCenter).replace(/x/,"") : 'x'+ StrCast(doc.layout_dontCenter); },
}],
['clusters', {
waitForRender: true, // flags that undo batch should terminate after a re-render giving the script the chance to fire
diff --git a/src/client/views/nodes/IconTagBox.scss b/src/client/views/nodes/IconTagBox.scss
index 8c0f92c90..211a961c1 100644
--- a/src/client/views/nodes/IconTagBox.scss
+++ b/src/client/views/nodes/IconTagBox.scss
@@ -4,27 +4,21 @@
display: flex;
padding: 3px;
position: absolute;
- // width: 300px;
- // height:100px;
- pointer-events: none; /* This ensures the container does not capture hover events */
-
- background-color: rgb(218, 218, 218); /* Background color of the container */
- border-radius: 50px; /* Rounds the corners of the container */
+ pointer-events: none;
+ background-color: rgb(218, 218, 218);
+ border-radius: 50px;
transform: translateY(25px);
- // box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Optional: Adds shadow for depth */
- align-items: center; /* Centers buttons vertically */
- justify-content: start; /* Centers buttons horizontally */
+ align-items: center;
+ justify-content: start;
button {
- pointer-events: auto; /* Re-enable pointer events for the buttons */
+ pointer-events: auto;
transform: translateY(-7.5px);
-
width: 30px;
height: 30px;
border-radius: 50%;
background-color: $dark-gray;
- // border-color: $medium-blue;
- margin: 5px; // transform: translateY(-50px);
+ margin: 5px;
background-color: transparent;
}
} \ No newline at end of file
diff --git a/src/client/views/pdf/GPTPopup/GPTPopup.scss b/src/client/views/pdf/GPTPopup/GPTPopup.scss
index 1defd1a7f..0247dc10c 100644
--- a/src/client/views/pdf/GPTPopup/GPTPopup.scss
+++ b/src/client/views/pdf/GPTPopup/GPTPopup.scss
@@ -104,9 +104,9 @@ $highlightedText: #82e0ff;
display: flex;
flex-direction: column;
width: 100%;
- max-height: calc(100vh - 80px); /* Height minus the input box and some padding */
+ max-height: calc(100vh - 80px);
overflow-y: auto;
- padding-bottom: 60px; /* Space for the input */
+ padding-bottom: 60px;
}
.chat-bubbles {
@@ -150,15 +150,7 @@ $highlightedText: #82e0ff;
}
- // button {
- // font-size: 9px;
- // padding: 10px;
- // color: #ffffff;
- // width: 100%;
- // background-color: $button;
- // border-radius: 5px;
- // }
.text-btn {
&:hover {