From 6f7087a5a8ae54a4a2b79d86833172b031922d8b Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 3 Mar 2021 12:28:27 -0500 Subject: fixed default tab field --- src/client/util/CurrentUserUtils.ts | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 95980ee6c..28717308c 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -383,7 +383,7 @@ export class CurrentUserUtils { FormattedTextBox.SelectOnLoad = textDoc[Id]; doc.emptySlide = textDoc; } - if ((doc.emptyHeader as Doc)?.version !== headerViewVersion) { + if ((doc.emptyHeader as Doc) ?.version !== headerViewVersion) { const json = { doc: { type: "doc", @@ -480,7 +480,7 @@ export class CurrentUserUtils { alreadyCreatedButtons = dragDocs.map(d => StrCast(d.title)); } } - const buttons = CurrentUserUtils.creatorBtnDescriptors(doc).filter(d => !alreadyCreatedButtons?.includes(d.title)); + const buttons = CurrentUserUtils.creatorBtnDescriptors(doc).filter(d => !alreadyCreatedButtons ?.includes(d.title)); const creatorBtns = buttons.map(({ title, toolTip, icon, ignoreClick, drag, click, backgroundColor, dragFactory, noviceMode, clickFactory }) => Docs.Create.FontIconDocument({ _nativeWidth: 50, _nativeHeight: 50, _width: 35, _height: 35, icon, @@ -573,7 +573,7 @@ export class CurrentUserUtils { // this resets all sidebar buttons to being deactivated PromiseValue(Cast(doc.menuStack, Doc)).then(stack => { stack && PromiseValue(stack.data).then(btns => { - DocListCastAsync(btns).then(bts => bts?.forEach(btn => { + DocListCastAsync(btns).then(bts => bts ?.forEach(btn => { btn.color = "white"; btn._backgroundColor = ""; btn.dontUndo = true; @@ -943,9 +943,9 @@ export class CurrentUserUtils { const openInTarget = Docs.Create.ScriptingDocument(ScriptField.MakeScript( "docCast(thisContainer.target).then((target) => target && (target.proto.data = new List([self]))) ", { thisContainer: Doc.name }), { - title: "Click to open in target", _width: 300, _height: 200, - targetScriptKey: "onChildClick", system: true - }); + title: "Click to open in target", _width: 300, _height: 200, + targetScriptKey: "onChildClick", system: true + }); const openDetail = Docs.Create.ScriptingDocument(ScriptField.MakeScript( "openOnRight(self.doubleClickView)", @@ -991,8 +991,8 @@ export class CurrentUserUtils { reaction(() => DateCast((doc.globalGroupDatabase as Doc).lastModified), async () => { const groups = await DocListCastAsync((doc.globalGroupDatabase as Doc).data); - const mygroups = groups?.filter(group => JSON.parse(StrCast(group.members)).includes(Doc.CurrentUserEmail)) || []; - SnappingManager.SetCachedGroups(["Public", ...mygroups?.map(g => StrCast(g.title))]); + const mygroups = groups ?.filter(group => JSON.parse(StrCast(group.members)).includes(Doc.CurrentUserEmail)) || []; + SnappingManager.SetCachedGroups(["Public", ...mygroups ?.map(g => StrCast(g.title))]); }, { fireImmediately: true }); doc.system = true; doc.noviceMode = doc.noviceMode === undefined ? "true" : doc.noviceMode; @@ -1072,9 +1072,9 @@ export class CurrentUserUtils { await Docs.Prototypes.initialize(); const userDoc = Docs.newAccount ? new Doc(userDocumentId, true) : field as Doc; const updated = this.updateUserDocument(Doc.SetUserDoc(userDoc), sharingDocumentId, linkDatabaseId); - (await DocListCastAsync(Cast(Doc.UserDoc().myLinkDatabase, Doc, null)?.data))?.forEach(async link => { // make sure anchors are loaded to avoid incremental updates to computedFn's in LinkManager - const a1 = await Cast(link?.anchor1, Doc, null); - const a2 = await Cast(link?.anchor2, Doc, null); + (await DocListCastAsync(Cast(Doc.UserDoc().myLinkDatabase, Doc, null) ?.data)) ?.forEach(async link => { // make sure anchors are loaded to avoid incremental updates to computedFn's in LinkManager + const a1 = await Cast(link ?.anchor1, Doc, null); + const a2 = await Cast(link ?.anchor2, Doc, null); }); return updated; }); @@ -1148,10 +1148,10 @@ export class CurrentUserUtils { const disposer = OverlayView.ShowSpinner(); DocListCastAsync(importDocs.data).then(async list => { const results = await DocUtils.uploadFilesToDocs(Array.from(input.files || []), {}); - if (results.length !== input.files?.length) { + if (results.length !== input.files ?.length) { alert("Error uploading files - possibly due to unsupported file types"); } - list?.splice(0, 0, ...results); + list ?.splice(0, 0, ...results); disposer(); }); } else { @@ -1179,6 +1179,7 @@ export class CurrentUserUtils { y: 400, _width: 1500, _height: 1000, + _fitWidth: true, title: `Untitled Tab ${NumCast(emptyPane["dragFactory-count"])}`, }; const freeformDoc = CurrentUserUtils.GuestTarget || Docs.Create.FreeformDocument([], freeformOptions); @@ -1217,7 +1218,7 @@ export class CurrentUserUtils { public static get MyRecentlyClosed() { return Cast(Doc.UserDoc().myRecentlyClosedDocs, Doc, null); } public static get MyDashboards() { return Cast(Doc.UserDoc().myDashboards, Doc, null); } public static get EmptyPane() { return Cast(Doc.UserDoc().emptyPane, Doc, null); } - public static get OverlayDocs() { return DocListCast((Doc.UserDoc().myOverlayDocs as Doc)?.data); } + public static get OverlayDocs() { return DocListCast((Doc.UserDoc().myOverlayDocs as Doc) ?.data); } } Scripting.addGlobal(function openDragFactory(dragFactory: Doc) { -- cgit v1.2.3-70-g09d2 From e55dcc6a510b182fe31b110353befe35c8eba0c4 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 3 Mar 2021 12:34:42 -0500 Subject: from last --- src/client/util/CurrentUserUtils.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 28717308c..154ccec23 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -226,7 +226,7 @@ export class CurrentUserUtils { title: "Advanced Item Prototypes", _xMargin: 0, _showTitle: "title", hidden: ComputedField.MakeFunction("IsNoviceMode()") as any, _stayInCollection: true, _hideContextMenu: true, - _autoHeight: true, _width: 500, _columnWidth: 35, ignoreClick: true, _lockedPosition: true, _chromeStatus: "disabled", + _autoHeight: true, _width: 500, _fitWidth: true, _columnWidth: 35, ignoreClick: true, _lockedPosition: true, _chromeStatus: "disabled", dropConverter: ScriptField.MakeScript("convertToButtons(dragData)", { dragData: DragManager.DocumentDragData.name }), system: true })); } else { @@ -497,13 +497,14 @@ export class CurrentUserUtils { dragFactory, clickFactory, hidden: ComputedField.MakeFunction("IsNoviceMode()") as any, - system: true + system: true, + _fitWidth: true })); if (dragCreatorSet === undefined) { doc.myItemCreators = new PrefetchProxy(Docs.Create.MasonryDocument(creatorBtns, { title: "Basic Item Creators", _showTitle: "title", _xMargin: 0, _stayInCollection: true, _hideContextMenu: true, - _autoHeight: true, _width: 500, _columnWidth: 35, ignoreClick: true, _lockedPosition: true, _chromeStatus: "disabled", + _autoHeight: true, _width: 500, _fitWidth: true, _columnWidth: 35, ignoreClick: true, _lockedPosition: true, _chromeStatus: "disabled", dropConverter: ScriptField.MakeScript("convertToButtons(dragData)", { dragData: DragManager.DocumentDragData.name }), system: true })); } else { @@ -889,7 +890,7 @@ export class CurrentUserUtils { static setupDefaultPresentation(doc: Doc) { if (doc["template-presentation"] === undefined) { doc["template-presentation"] = new PrefetchProxy(Docs.Create.PresElementBoxDocument({ - title: "pres element template", backgroundColor: "transparent", _xMargin: 5, _height: 46, isTemplateDoc: true, isTemplateForField: "data", system: true + title: "pres element template", backgroundColor: "transparent", _xMargin: 5, _fitWidth: true, _height: 46, isTemplateDoc: true, isTemplateForField: "data", system: true })); } } -- cgit v1.2.3-70-g09d2 From 0ecae858ea0892a065c262819b9275e94f8f591e Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 3 Mar 2021 12:47:44 -0500 Subject: from last --- src/client/util/CurrentUserUtils.ts | 4 ++-- src/client/views/collections/CollectionDockingView.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 154ccec23..18868288b 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -365,12 +365,12 @@ export class CurrentUserUtils { }[] { if (doc.emptyPresentation === undefined) { doc.emptyPresentation = Docs.Create.PresDocument(new List(), - { title: "Untitled Presentation", _viewType: CollectionViewType.Stacking, _width: 400, _height: 500, targetDropAction: "alias", _chromeStatus: "replaced", boxShadow: "0 0", system: true, cloneFieldFilter: new List(["system"]) }); + { title: "Untitled Presentation", _viewType: CollectionViewType.Stacking, _fitWidth: true, _width: 400, _height: 500, targetDropAction: "alias", _chromeStatus: "replaced", boxShadow: "0 0", system: true, cloneFieldFilter: new List(["system"]) }); ((doc.emptyPresentation as Doc).proto as Doc)["dragFactory-count"] = 0; } if (doc.emptyCollection === undefined) { doc.emptyCollection = Docs.Create.FreeformDocument([], - { _nativeWidth: undefined, _nativeHeight: undefined, _width: 150, _height: 100, title: "freeform", system: true, cloneFieldFilter: new List(["system"]) }); + { _nativeWidth: undefined, _nativeHeight: undefined, _fitWidth: true, _width: 150, _height: 100, title: "freeform", system: true, cloneFieldFilter: new List(["system"]) }); ((doc.emptyCollection as Doc).proto as Doc)["dragFactory-count"] = 0; } if (doc.emptyPane === undefined) { diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx index 550a4082b..0c8e26e91 100644 --- a/src/client/views/collections/CollectionDockingView.tsx +++ b/src/client/views/collections/CollectionDockingView.tsx @@ -400,7 +400,7 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) { const emptyPane = CurrentUserUtils.EmptyPane; emptyPane["dragFactory-count"] = NumCast(emptyPane["dragFactory-count"]) + 1; CollectionDockingView.AddSplit(Docs.Create.FreeformDocument([], { - _width: this.props.PanelWidth(), _height: this.props.PanelHeight(), title: `Untitled Tab ${NumCast(emptyPane["dragFactory-count"])}` + _width: this.props.PanelWidth(), _height: this.props.PanelHeight(), _fitWidth: true, title: `Untitled Tab ${NumCast(emptyPane["dragFactory-count"])}` }), "", stack); } }); @@ -423,7 +423,7 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) { const emptyPane = CurrentUserUtils.EmptyPane; emptyPane["dragFactory-count"] = NumCast(emptyPane["dragFactory-count"]) + 1; CollectionDockingView.AddSplit(Docs.Create.FreeformDocument([], { - _width: this.props.PanelWidth(), _height: this.props.PanelHeight(), title: `Untitled Tab ${NumCast(emptyPane["dragFactory-count"])}` + _width: this.props.PanelWidth(), _height: this.props.PanelHeight(), _fitWidth: true, title: `Untitled Tab ${NumCast(emptyPane["dragFactory-count"])}` }), "", stack); })); } -- cgit v1.2.3-70-g09d2 From c38c7966539cc97e98dd2f836420ca8863bd35fb Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 3 Mar 2021 13:15:36 -0500 Subject: more fixes for setting up user docs --- src/client/util/CurrentUserUtils.ts | 39 +++++++++++----------- .../views/collections/CollectionTreeView.tsx | 12 ++++++- src/client/views/collections/TreeView.tsx | 4 +-- 3 files changed, 32 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 18868288b..ddb7ded1d 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -226,7 +226,7 @@ export class CurrentUserUtils { title: "Advanced Item Prototypes", _xMargin: 0, _showTitle: "title", hidden: ComputedField.MakeFunction("IsNoviceMode()") as any, _stayInCollection: true, _hideContextMenu: true, - _autoHeight: true, _width: 500, _fitWidth: true, _columnWidth: 35, ignoreClick: true, _lockedPosition: true, _chromeStatus: "disabled", + _autoHeight: true, _width: 500, _height: 300, _fitWidth: true, _columnWidth: 35, ignoreClick: true, _lockedPosition: true, _chromeStatus: "disabled", dropConverter: ScriptField.MakeScript("convertToButtons(dragData)", { dragData: DragManager.DocumentDragData.name }), system: true })); } else { @@ -383,7 +383,7 @@ export class CurrentUserUtils { FormattedTextBox.SelectOnLoad = textDoc[Id]; doc.emptySlide = textDoc; } - if ((doc.emptyHeader as Doc) ?.version !== headerViewVersion) { + if ((doc.emptyHeader as Doc)?.version !== headerViewVersion) { const json = { doc: { type: "doc", @@ -480,7 +480,7 @@ export class CurrentUserUtils { alreadyCreatedButtons = dragDocs.map(d => StrCast(d.title)); } } - const buttons = CurrentUserUtils.creatorBtnDescriptors(doc).filter(d => !alreadyCreatedButtons ?.includes(d.title)); + const buttons = CurrentUserUtils.creatorBtnDescriptors(doc).filter(d => !alreadyCreatedButtons?.includes(d.title)); const creatorBtns = buttons.map(({ title, toolTip, icon, ignoreClick, drag, click, backgroundColor, dragFactory, noviceMode, clickFactory }) => Docs.Create.FontIconDocument({ _nativeWidth: 50, _nativeHeight: 50, _width: 35, _height: 35, icon, @@ -496,15 +496,14 @@ export class CurrentUserUtils { _stayInCollection: true, dragFactory, clickFactory, - hidden: ComputedField.MakeFunction("IsNoviceMode()") as any, + hidden: noviceMode ? ComputedField.MakeFunction("IsNoviceMode()") as any : undefined, system: true, - _fitWidth: true })); if (dragCreatorSet === undefined) { doc.myItemCreators = new PrefetchProxy(Docs.Create.MasonryDocument(creatorBtns, { title: "Basic Item Creators", _showTitle: "title", _xMargin: 0, _stayInCollection: true, _hideContextMenu: true, - _autoHeight: true, _width: 500, _fitWidth: true, _columnWidth: 35, ignoreClick: true, _lockedPosition: true, _chromeStatus: "disabled", + _autoHeight: true, _width: 500, _height: 300, _fitWidth: true, _columnWidth: 35, ignoreClick: true, _lockedPosition: true, _chromeStatus: "disabled", dropConverter: ScriptField.MakeScript("convertToButtons(dragData)", { dragData: DragManager.DocumentDragData.name }), system: true })); } else { @@ -574,7 +573,7 @@ export class CurrentUserUtils { // this resets all sidebar buttons to being deactivated PromiseValue(Cast(doc.menuStack, Doc)).then(stack => { stack && PromiseValue(stack.data).then(btns => { - DocListCastAsync(btns).then(bts => bts ?.forEach(btn => { + DocListCastAsync(btns).then(bts => bts?.forEach(btn => { btn.color = "white"; btn._backgroundColor = ""; btn.dontUndo = true; @@ -719,8 +718,8 @@ export class CurrentUserUtils { if (doc.myCreators === undefined) { doc.myCreators = new PrefetchProxy(Docs.Create.StackingDocument([creatorBtns, templateBtns], { - title: "all Creators", _yMargin: 0, _autoHeight: true, _xMargin: 0, - _width: 500, ignoreClick: true, _lockedPosition: true, _chromeStatus: "disabled", system: true + title: "all Creators", _yMargin: 0, _autoHeight: true, _xMargin: 0, _fitWidth: true, + _width: 500, _height: 300, ignoreClick: true, _lockedPosition: true, _chromeStatus: "disabled", system: true })); } // setup a color picker @@ -944,9 +943,9 @@ export class CurrentUserUtils { const openInTarget = Docs.Create.ScriptingDocument(ScriptField.MakeScript( "docCast(thisContainer.target).then((target) => target && (target.proto.data = new List([self]))) ", { thisContainer: Doc.name }), { - title: "Click to open in target", _width: 300, _height: 200, - targetScriptKey: "onChildClick", system: true - }); + title: "Click to open in target", _width: 300, _height: 200, + targetScriptKey: "onChildClick", system: true + }); const openDetail = Docs.Create.ScriptingDocument(ScriptField.MakeScript( "openOnRight(self.doubleClickView)", @@ -992,8 +991,8 @@ export class CurrentUserUtils { reaction(() => DateCast((doc.globalGroupDatabase as Doc).lastModified), async () => { const groups = await DocListCastAsync((doc.globalGroupDatabase as Doc).data); - const mygroups = groups ?.filter(group => JSON.parse(StrCast(group.members)).includes(Doc.CurrentUserEmail)) || []; - SnappingManager.SetCachedGroups(["Public", ...mygroups ?.map(g => StrCast(g.title))]); + const mygroups = groups?.filter(group => JSON.parse(StrCast(group.members)).includes(Doc.CurrentUserEmail)) || []; + SnappingManager.SetCachedGroups(["Public", ...mygroups?.map(g => StrCast(g.title))]); }, { fireImmediately: true }); doc.system = true; doc.noviceMode = doc.noviceMode === undefined ? "true" : doc.noviceMode; @@ -1073,9 +1072,9 @@ export class CurrentUserUtils { await Docs.Prototypes.initialize(); const userDoc = Docs.newAccount ? new Doc(userDocumentId, true) : field as Doc; const updated = this.updateUserDocument(Doc.SetUserDoc(userDoc), sharingDocumentId, linkDatabaseId); - (await DocListCastAsync(Cast(Doc.UserDoc().myLinkDatabase, Doc, null) ?.data)) ?.forEach(async link => { // make sure anchors are loaded to avoid incremental updates to computedFn's in LinkManager - const a1 = await Cast(link ?.anchor1, Doc, null); - const a2 = await Cast(link ?.anchor2, Doc, null); + (await DocListCastAsync(Cast(Doc.UserDoc().myLinkDatabase, Doc, null)?.data))?.forEach(async link => { // make sure anchors are loaded to avoid incremental updates to computedFn's in LinkManager + const a1 = await Cast(link?.anchor1, Doc, null); + const a2 = await Cast(link?.anchor2, Doc, null); }); return updated; }); @@ -1149,10 +1148,10 @@ export class CurrentUserUtils { const disposer = OverlayView.ShowSpinner(); DocListCastAsync(importDocs.data).then(async list => { const results = await DocUtils.uploadFilesToDocs(Array.from(input.files || []), {}); - if (results.length !== input.files ?.length) { + if (results.length !== input.files?.length) { alert("Error uploading files - possibly due to unsupported file types"); } - list ?.splice(0, 0, ...results); + list?.splice(0, 0, ...results); disposer(); }); } else { @@ -1219,7 +1218,7 @@ export class CurrentUserUtils { public static get MyRecentlyClosed() { return Cast(Doc.UserDoc().myRecentlyClosedDocs, Doc, null); } public static get MyDashboards() { return Cast(Doc.UserDoc().myDashboards, Doc, null); } public static get EmptyPane() { return Cast(Doc.UserDoc().emptyPane, Doc, null); } - public static get OverlayDocs() { return DocListCast((Doc.UserDoc().myOverlayDocs as Doc) ?.data); } + public static get OverlayDocs() { return DocListCast((Doc.UserDoc().myOverlayDocs as Doc)?.data); } } Scripting.addGlobal(function openDragFactory(dragFactory: Doc) { diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx index 146b3cd37..9cc7b4649 100644 --- a/src/client/views/collections/CollectionTreeView.tsx +++ b/src/client/views/collections/CollectionTreeView.tsx @@ -1,7 +1,15 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { action, computed } from "mobx"; import { observer } from "mobx-react"; -import { DataSym, Doc, DocListCast, HeightSym, Opt, WidthSym } from '../../../fields/Doc'; +import { + DataSym, + Doc, + DocListCast, + HeightSym, + Opt, + WidthSym, + NativeWidth +} from '../../../fields/Doc'; import { Id } from '../../../fields/FieldSymbols'; import { List } from '../../../fields/List'; import { Document } from '../../../fields/Schema'; @@ -172,6 +180,8 @@ export class CollectionTreeView extends CollectionSubView { moveDocument={this.move} removeDocument={this.props.removeDoc} ScreenToLocalTransform={this.getTransform} - NativeHeight={returnZero} - NativeWidth={returnZero} + NativeHeight={() => 18} + NativeWidth={this.truncateTitleWidth} PanelWidth={this.truncateTitleWidth} PanelHeight={() => 18} contextMenuItems={this.contextMenuItems} -- cgit v1.2.3-70-g09d2 From 0bf64d5c4bfc62203fa0a024f994a32e23b0effd Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 3 Mar 2021 14:25:38 -0500 Subject: trying out a forked branch of equation editor. cleaned up warnings. --- package-lock.json | 5 ++--- package.json | 2 +- src/client/views/LightboxView.tsx | 2 +- src/client/views/collections/CollectionSubView.tsx | 2 +- src/client/views/collections/CollectionTreeView.tsx | 10 +--------- .../collections/collectionFreeForm/CollectionFreeFormView.tsx | 2 +- src/client/views/nodes/FunctionPlotBox.tsx | 4 ++-- .../views/nodes/formattedText/ProsemirrorExampleTransfer.ts | 2 +- src/fields/util.ts | 2 +- 9 files changed, 11 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/package-lock.json b/package-lock.json index 5c78f311e..f74368dd3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5674,9 +5674,8 @@ "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" }, "equation-editor-react": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/equation-editor-react/-/equation-editor-react-0.0.6.tgz", - "integrity": "sha512-7Zsx04yh4DsirpMzMVnEaDwMxrpcjiAt6NOvSj+DEOa56VfKGXsmouWFOCtSVixahDSVEDs53LbhnPqFh4cVqw==", + "version": "github:bobzel/equation-editor-react#75915e852b4b36a6a4cd3e1cbc80598da6b65227", + "from": "github:bobzel/equation-editor-react#useLocally", "requires": { "jquery": "^3.4.1", "mathquill": "^0.10.1-a" diff --git a/package.json b/package.json index 9575de03a..5c456449d 100644 --- a/package.json +++ b/package.json @@ -153,7 +153,7 @@ "cookie-session": "^2.0.0-rc.1", "cors": "^2.8.5", "depcheck": "^0.9.2", - "equation-editor-react": "0.0.6", + "equation-editor-react": "github:bobzel/equation-editor-react#useLocally", "exif": "^0.6.0", "express": "^4.16.4", "express-flash": "0.0.2", diff --git a/src/client/views/LightboxView.tsx b/src/client/views/LightboxView.tsx index 3fc72c45c..9b14c180e 100644 --- a/src/client/views/LightboxView.tsx +++ b/src/client/views/LightboxView.tsx @@ -260,7 +260,7 @@ export class LightboxView extends React.Component { })}
{ e.stopPropagation(); LightboxView.LightboxDoc!._fitWidth = !LightboxView.LightboxDoc!._fitWidth }}> + onClick={e => { e.stopPropagation(); LightboxView.LightboxDoc!._fitWidth = !LightboxView.LightboxDoc!._fitWidth; }}>
; diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx index 639650b94..e5c835f39 100644 --- a/src/client/views/collections/CollectionSubView.tsx +++ b/src/client/views/collections/CollectionSubView.tsx @@ -230,7 +230,7 @@ export function CollectionSubView(schemaCtor: (doc: Doc) => T, moreProps?: const dropped = dropCreator(this.props.isAnnotationOverlay ? this.rootDoc : undefined); this.addDocument(dropped); return dropped; - } + }; return true; } return false; diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx index 9cc7b4649..7527a0c5a 100644 --- a/src/client/views/collections/CollectionTreeView.tsx +++ b/src/client/views/collections/CollectionTreeView.tsx @@ -1,15 +1,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { action, computed } from "mobx"; import { observer } from "mobx-react"; -import { - DataSym, - Doc, - DocListCast, - HeightSym, - Opt, - WidthSym, - NativeWidth -} from '../../../fields/Doc'; +import { DataSym, Doc, DocListCast, HeightSym, Opt, WidthSym } from '../../../fields/Doc'; import { Id } from '../../../fields/FieldSymbols'; import { List } from '../../../fields/List'; import { Document } from '../../../fields/Schema'; diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index af8ccb9c5..74f00d1b3 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -284,7 +284,7 @@ export class CollectionFreeFormView extends CollectionSubView { this._plotEle = ele || this._plotEle; - let width = this.props.PanelWidth(); - let height = this.props.PanelHeight(); + const width = this.props.PanelWidth(); + const height = this.props.PanelHeight(); const fn = StrCast(DocListCast(this.dataDoc.data).lastElement()?.text, "x^2").replace(/\\frac\{(.*)\}\{(.*)\}/, "($1/$2)"); console.log("Graphing:" + fn); try { diff --git a/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts b/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts index aa51a3a64..d5c77786c 100644 --- a/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts +++ b/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts @@ -146,7 +146,7 @@ export function buildKeymap>(schema: S, props: any, mapKey bind("Ctrl-m", (state: EditorState, dispatch: (tx: Transaction) => void) => { dispatch(state.tr.replaceSelectionWith(schema.nodes.equation.create({ fieldKey: "math" + Utils.GenerateGuid() }))); - }) + }); for (let i = 1; i <= 6; i++) { bind("Shift-Ctrl-" + i, setBlockType(schema.nodes.heading, { level: i })); diff --git a/src/fields/util.ts b/src/fields/util.ts index 36c765dd0..5d98971da 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -302,7 +302,7 @@ export function setter(target: any, in_prop: string | symbol | number, value: an } export function getter(target: any, in_prop: string | symbol | number, receiver: any): any { - let prop = in_prop; + const prop = in_prop; if (in_prop === AclSym) return target[AclSym]; if (in_prop === "toString" || (in_prop !== HeightSym && in_prop !== WidthSym && in_prop !== LayoutSym && typeof prop === "symbol")) return target.__fields[prop] || target[prop]; -- cgit v1.2.3-70-g09d2