From cfc6eecf58aa8e10ef3ff1b34be47717163e9697 Mon Sep 17 00:00:00 2001 From: usodhi <61431818+usodhi@users.noreply.github.com> Date: Mon, 7 Sep 2020 17:03:28 +0530 Subject: fixed bottom linking popup --- src/client/views/collections/CollectionLinearView.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/client/views/collections') diff --git a/src/client/views/collections/CollectionLinearView.tsx b/src/client/views/collections/CollectionLinearView.tsx index 9eaa02bf8..ea050011a 100644 --- a/src/client/views/collections/CollectionLinearView.tsx +++ b/src/client/views/collections/CollectionLinearView.tsx @@ -171,7 +171,8 @@ export class CollectionLinearView extends CollectionSubView(LinearDocument) { })} {DocumentLinksButton.StartLink ? e.stopPropagation()} > -- cgit v1.2.3-70-g09d2 From 53c03919a4c89b9e685d006dad948c65cc715831 Mon Sep 17 00:00:00 2001 From: usodhi <61431818+usodhi@users.noreply.github.com> Date: Mon, 7 Sep 2020 21:13:26 +0530 Subject: handle + button z-index fix --- src/client/views/MainView.scss | 16 +++++++++++----- src/client/views/collections/CollectionDockingView.scss | 2 ++ 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src/client/views/collections') diff --git a/src/client/views/MainView.scss b/src/client/views/MainView.scss index 9ca8f348d..aebb28859 100644 --- a/src/client/views/MainView.scss +++ b/src/client/views/MainView.scss @@ -21,6 +21,7 @@ width: 100%; height: 100%; } + .mainContent-div-flyout { left: calc(-1 * var(--flyoutHandleWidth)); } @@ -122,7 +123,7 @@ border-top-left-radius: 10px; border-bottom-left-radius: 10px; border-right: unset; - z-index: 1; + z-index: 41; // lm_maximised has a z-index of 40 and this needs to be above that display: flex; align-items: center; padding: 4px; @@ -156,6 +157,7 @@ display: contents; flex-direction: row; position: relative; + .mainView-flyoutContainer { display: flex; flex-direction: column; @@ -167,6 +169,7 @@ background: lightgrey; } } + .propertiesView { right: 0; position: absolute; @@ -181,8 +184,9 @@ .collectionStackingView { scrollbar-width: none; } + ::-webkit-scrollbar { - width:0; + width: 0; } .mainView-menuPanel-button { @@ -293,11 +297,11 @@ position: relative; display: flex; flex-direction: column; - z-index: 2; + z-index: 42; .mainView-contentArea { position: relative; - height: 100%; + height: 100%; width: 100%; overflow: visible; } @@ -311,6 +315,7 @@ margin-bottom: 10; } } + .mainView-libraryFlyout-out { transition: width .25s; box-shadow: rgb(156, 147, 150) 0.2vw 0.2vw 0.2vw; @@ -325,7 +330,7 @@ border: 1px solid black; border-radius: 8px; position: relative; - z-index: 1; + z-index: 41; // lm_maximised has a z-index of 40 and this needs to be above that touch-action: none; background-color: lightgrey; cursor: grab; @@ -369,6 +374,7 @@ width: 200px; height: 800px; } + .mainVew-invisibleWebRef { position: absolute; left: 50; diff --git a/src/client/views/collections/CollectionDockingView.scss b/src/client/views/collections/CollectionDockingView.scss index 96f5afcd9..8b1594b21 100644 --- a/src/client/views/collections/CollectionDockingView.scss +++ b/src/client/views/collections/CollectionDockingView.scss @@ -35,6 +35,7 @@ padding-right: 20px; margin-top: -1px; border-bottom: 1px black; + .collectionDockingView-gear { display: none; } @@ -44,6 +45,7 @@ padding-right: 20px; margin-top: 1px; border-bottom: unset; + .collectionDockingView-gear { display: inline-block; } -- cgit v1.2.3-70-g09d2 From 157faac6a3c8a7c2347baf78e1796ff0aa3e0312 Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 7 Sep 2020 15:27:34 -0400 Subject: fixed childLayoutString templates whch broke somewhere along the way. --- src/client/views/collections/CollectionMenu.tsx | 12 +++++++++++- src/client/views/collections/CollectionView.tsx | 17 ++++++----------- .../collectionFreeForm/CollectionFreeFormView.tsx | 4 ---- src/client/views/nodes/DocumentContentsView.tsx | 18 +++++++++++++++--- 4 files changed, 32 insertions(+), 19 deletions(-) (limited to 'src/client/views/collections') diff --git a/src/client/views/collections/CollectionMenu.tsx b/src/client/views/collections/CollectionMenu.tsx index 4b8075f06..cb989d348 100644 --- a/src/client/views/collections/CollectionMenu.tsx +++ b/src/client/views/collections/CollectionMenu.tsx @@ -33,6 +33,7 @@ import { PresBox } from "../nodes/PresBox"; import "./CollectionMenu.scss"; import { CollectionViewType, COLLECTION_BORDER_WIDTH } from "./CollectionView"; import { TabDocView } from "./TabDocView"; +import { RichTextField } from "../../../fields/RichTextField"; @observer export class CollectionMenu extends AntimodeMenu { @@ -121,7 +122,16 @@ export class CollectionViewBaseChrome extends React.Component source.length && (this.target.childLayoutTemplate = Doc.getDocTemplate(source?.[0]))), + immediate: undoBatch((source: Doc[]) => { + if (source.length === 1 && source[0].type === DocumentType.RTF && Cast(source[0].text, RichTextField, null)?.Text) { + Doc.SetInPlace(this.target, "childLayoutString", Cast(source[0].text, RichTextField, null)?.Text, false); + } else if (source.length) { + this.target.childLayoutTemplate = Doc.getDocTemplate(source?.[0]); + } else { + Doc.SetInPlace(this.target, "childLayoutString", undefined, true); + Doc.SetInPlace(this.target, "childLayoutTemplate", undefined, true); + } + }), initialize: emptyFunction, }; _narrativeCommand = { diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx index ba8e23447..e0c40ce77 100644 --- a/src/client/views/collections/CollectionView.tsx +++ b/src/client/views/collections/CollectionView.tsx @@ -71,8 +71,6 @@ export enum CollectionViewType { } export interface CollectionViewCustomProps { filterAddDocument?: (doc: Doc | Doc[]) => boolean; // allows a document that renders a Collection view to filter or modify any documents added to the collection (see PresBox for an example) - childLayoutTemplate?: () => Opt; // specify a layout Doc template to use for children of the collection - childLayoutString?: string; // specify a layout string to use for children of the collection childOpacity?: () => number; hideFilter?: true; } @@ -85,8 +83,8 @@ export interface CollectionRenderProps { whenActiveChanged: (isActive: boolean) => void; PanelWidth: () => number; PanelHeight: () => number; - ChildLayoutTemplate?: () => Doc; - ChildLayoutString?: string; + ChildLayoutTemplate?: () => Doc;// specify a layout Doc template to use for children of the collection + ChildLayoutString?: string;// specify a layout string to use for children of the collection } @observer @@ -244,7 +242,8 @@ export class CollectionView extends Touchable this.props.renderDepth ? this.props.ScreenToLocalTransform() : this.props.ScreenToLocalTransform().scale(this.props.PanelWidth() / this.bodyPanelWidth()); - private SubViewHelper = (type: CollectionViewType, renderProps: CollectionRenderProps) => { + private SubView = (type: CollectionViewType, renderProps: CollectionRenderProps) => { + TraceMobx(); const props: SubCollectionViewProps = { ...this.props, ...renderProps, ScreenToLocalTransform: this.screenToLocalTransform, CollectionView: this, annotationsKey: "" }; switch (type) { case CollectionViewType.Schema: return (); @@ -263,14 +262,10 @@ export class CollectionView extends Touchable); case CollectionViewType.Grid: return (); case CollectionViewType.Freeform: - default: { this.props.Document._freeformLayoutEngine = undefined; return (); } + default: { this.props.Document._freeformLayoutEngine = undefined; return (); } } } - private SubView = (type: CollectionViewType, renderProps: CollectionRenderProps) => { - return this.SubViewHelper(type, renderProps); - } - setupViewTypes(category: string, func: (viewType: CollectionViewType) => Doc, addExtras: boolean) { const subItems: ContextMenuProps[] = []; @@ -411,7 +406,7 @@ export class CollectionView extends Touchable this.props.childLayoutTemplate?.() || Cast(this.props.Document.childLayoutTemplate, Doc, null); - childLayoutString = this.props.childLayoutString || StrCast(this.props.Document.childLayoutString); + @computed get childLayoutString() { return StrCast(this.props.Document.childLayoutString); } render() { TraceMobx(); diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 306dfe797..86460eee1 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -1497,11 +1497,9 @@ class CollectionFreeFormViewPannableContents extends React.Component { }, (e) => { }); } } @@ -1567,8 +1565,6 @@ class CollectionFreeFormViewPannableContents extends React.Component {!this.props.presPinView ? (null) :
diff --git a/src/client/views/nodes/DocumentContentsView.tsx b/src/client/views/nodes/DocumentContentsView.tsx index 1b2070c0f..90fc5dc64 100644 --- a/src/client/views/nodes/DocumentContentsView.tsx +++ b/src/client/views/nodes/DocumentContentsView.tsx @@ -64,7 +64,19 @@ interface HTMLtagProps { onClick?: ScriptField; onInput?: ScriptField; } -//"{this.title}"@observer + +//" {this.title}" +//" +// +// +// {this.title} +// +// " @observer export class HTMLtag extends React.Component { click = (e: React.MouseEvent) => { @@ -170,10 +182,10 @@ export class DocumentContentsView extends React.Component { - const splits = layoutFrame.split(`func=`); + const splits = layoutFrame.split(`${func}=`); if (splits.length > 1) { const code = XRegExp.matchRecursive(splits[1], "{", "}", "", { valueNames: ["between", "left", "match", "right", "between"] }); - layoutFrame = splits[0] + ` ${func}={props.onClick} ` + splits[1].substring(code[1].end + 1); + layoutFrame = splits[0] + ` ${func}={props.${func}} ` + splits[1].substring(code[1].end + 1); return ScriptField.MakeScript(code[1].value, { this: Doc.name, self: Doc.name, value: "string" }); } return undefined; -- cgit v1.2.3-70-g09d2 From b8300497de3d496015c719ad59df9b1d6d4b0e56 Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 8 Sep 2020 23:57:23 -0400 Subject: fixed event handling on embedded textboxes - dash field views need to stopPropagation() on pointerdown events, and textBoxes need to handle scroll events when they are rootSelected() (ie, in a template) --- src/client/views/collections/CollectionMasonryViewFieldRow.tsx | 2 +- src/client/views/nodes/formattedText/DashFieldView.tsx | 5 ++++- src/client/views/nodes/formattedText/FormattedTextBox.tsx | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/client/views/collections') diff --git a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx index 65695d22a..cb7ffb0e7 100644 --- a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx +++ b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx @@ -182,7 +182,7 @@ export class CollectionMasonryViewFieldRow extends React.Component) => { if (e.button === 0 && !e.ctrlKey) { - setupMoveUpEvents(this, e, this.headerMove, emptyFunction, () => (this.props.parent.props.Document._chromeStatus === "disabled") && this.collapseSection(e)); + setupMoveUpEvents(this, e, this.headerMove, emptyFunction, e => (this.props.parent.props.Document._chromeStatus === "disabled") && this.collapseSection(e)); this._createAliasSelected = false; } } diff --git a/src/client/views/nodes/formattedText/DashFieldView.tsx b/src/client/views/nodes/formattedText/DashFieldView.tsx index f2658e77e..f14a57e31 100644 --- a/src/client/views/nodes/formattedText/DashFieldView.tsx +++ b/src/client/views/nodes/formattedText/DashFieldView.tsx @@ -106,7 +106,10 @@ export class DashFieldViewInternal extends React.Component { r?.addEventListener("keydown", e => this.fieldSpanKeyDown(e, r)); r?.addEventListener("blur", e => r && this.updateText(r.textContent!, false)); - r?.addEventListener("pointerdown", action((e) => this._showEnumerables = true)); + r?.addEventListener("pointerdown", action((e) => { + this._showEnumerables = true; + e.stopPropagation(); + })); }} > {strVal} ; diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx index 311143ff7..f1a1726b2 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx @@ -1286,7 +1286,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp } onPointerWheel = (e: React.WheelEvent): void => { // if a text note is not selected and scrollable, this prevents us from being able to scroll and zoom out at the same time - if (this.props.isSelected(true) || e.currentTarget.scrollHeight > e.currentTarget.clientHeight) { + if ((this.props.rootSelected(true) || this.props.isSelected(true)) || e.currentTarget.scrollHeight > e.currentTarget.clientHeight) { e.stopPropagation(); } } -- cgit v1.2.3-70-g09d2