diff options
author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-10-09 16:58:33 -0400 |
---|---|---|
committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-10-09 16:58:33 -0400 |
commit | 6ae5bd63d5355a03dba099a149532e7c6b1fd74a (patch) | |
tree | 5971f41919806c4055aab9f6e8d3284a7098cd14 /src | |
parent | b21d8cc9d1b25ccd2e0103f47ad132dd6f04612d (diff) |
small changes for pull request; removed schema type reference in editableview; a couple lint changes
Diffstat (limited to 'src')
6 files changed, 19 insertions, 17 deletions
diff --git a/src/client/views/EditableView.tsx b/src/client/views/EditableView.tsx index 9722b2d4b..9974fc63b 100644 --- a/src/client/views/EditableView.tsx +++ b/src/client/views/EditableView.tsx @@ -54,7 +54,8 @@ export interface EditableProps { placeholder?: string; wrap?: string; // nowrap, pre-wrap, etc - schemaFieldType?: SchemaFieldType; + inputString?: boolean; + inputStringPlaceholder?: string; prohibitedText?: Array<string>; onClick?: () => void; updateAlt?: (newAlt: string) => void; @@ -290,10 +291,10 @@ export class EditableView extends ObservableReactComponent<EditableProps> { staticDisplay = () => { let toDisplay; const gval = this._props.GetValue()?.replace(/\n/g, '\\r\\n'); - if (this._props.schemaFieldType === SchemaFieldType.Header){ + if (this._props.inputString){ toDisplay = <input className="editableView-input" value={gval} - placeholder='Add key' + placeholder={this._props.inputStringPlaceholder} readOnly style={{ display: this._props.display, overflow: 'auto', pointerEvents: 'none', fontSize: this._props.fontSize, width: '100%', margin: 0, background: this._props.background}} // eslint-disable-next-line jsx-a11y/no-autofocus diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 0cc63d632..d2bc8f2c2 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -1221,7 +1221,7 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection * Function that creates a drawing--a group of ink strokes--to go with the smart draw function. */ @undoBatch - createDrawingDoc = (strokeData: [InkData, string, string][], opts: DrawingOptions, gptRes: string) => { + createDrawingDoc = (strokeData: [InkData, string, string][], opts: DrawingOptions) => { this._drawing = []; const xf = this.screenToFreeformContentsXf; strokeData.forEach((stroke: [InkData, string, string]) => { diff --git a/src/client/views/collections/collectionSchema/SchemaCellField.tsx b/src/client/views/collections/collectionSchema/SchemaCellField.tsx index 84e7b62bf..dab494c0e 100644 --- a/src/client/views/collections/collectionSchema/SchemaCellField.tsx +++ b/src/client/views/collections/collectionSchema/SchemaCellField.tsx @@ -5,7 +5,7 @@ import { OverlayView } from '../../OverlayView'; import { DocumentIconContainer } from '../../nodes/DocumentIcon'; import React, { FormEvent } from 'react'; import { FieldView, FieldViewProps } from '../../nodes/FieldView'; -import { ObjectField } from '../../../../fields/ObjectField'; +import { FieldType, ObjectField } from '../../../../fields/ObjectField'; import { Doc } from '../../../../fields/Doc'; import { DocumentView } from '../../nodes/DocumentView'; import DOMPurify from 'dompurify'; @@ -21,7 +21,7 @@ import DOMPurify from 'dompurify'; */ export interface SchemaCellFieldProps { - contents: any; + contents: FieldType; fieldContents?: FieldViewProps; editing?: boolean; oneLine?: boolean; diff --git a/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx b/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx index c5cdac8af..207e1deac 100644 --- a/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx +++ b/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx @@ -135,7 +135,8 @@ export class SchemaColumnHeader extends ObservableReactComponent<SchemaColumnHea placeholder={'Add key'} updateAlt={this.updateAlt} // alternate title to display updateSearch={this.updateKeyDropdown} - schemaFieldType={SchemaFieldType.Header} + inputString={true} + inputStringPlaceholder={'Add key'} GetValue={() => { if (SchemaColumnHeader.isDefaultField(this.fieldKey)) return ''; else if (this._altTitle) return this._altTitle; diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx b/src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx index 44f743a97..ad47b7848 100644 --- a/src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx +++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx @@ -943,7 +943,7 @@ export class DocCreatorMenu extends ObservableReactComponent<FieldViewProps> { removeDocument={returnFalse} PanelWidth={() => this._menuDimensions.width - 10} PanelHeight={() => this._menuDimensions.height - 60} - ScreenToLocalTransform={Transform.Identity} + ScreenToLocalTransform={() => new Transform(-this._pageX,-this._pageY, 1)} renderDepth={5} whenChildContentsActiveChanged={emptyFunction} focus={emptyFunction} diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx index 226fad977..c156c80e4 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -124,15 +124,15 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { { fireImmediately: true, delay: 1000 } ); const { layoutDoc } = this; - // this._disposers.path = reaction( - // () => ({ nativeSize: this.nativeSize, width: NumCast(this.layoutDoc._width) }), - // ({ nativeSize, width }) => { - // if (layoutDoc === this.layoutDoc || !this.layoutDoc._height) { - // this.layoutDoc._height = (width * nativeSize.nativeHeight) / nativeSize.nativeWidth; - // } - // }, - // { fireImmediately: true } - // ); + this._disposers.path = reaction( + () => ({ nativeSize: this.nativeSize, width: NumCast(this.layoutDoc._width) }), + ({ nativeSize, width }) => { + if (layoutDoc === this.layoutDoc || !this.layoutDoc._height) { + this.layoutDoc._height = (width * nativeSize.nativeHeight) / nativeSize.nativeWidth; + } + }, + { fireImmediately: true } + ); this._disposers.scroll = reaction( () => this.layoutDoc.layout_scrollTop, sTop => { |