diff options
| author | bobzel <zzzman@gmail.com> | 2024-05-01 09:47:11 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2024-05-01 09:47:11 -0400 |
| commit | 76838b7b3842c9b184e6459e29796dd14de37e8d (patch) | |
| tree | f96cc6db69e72e90179e8b1c3003401146ee3522 /src/client/views/nodes/FontIconBox/FontIconBox.tsx | |
| parent | 098deaa68c8b9bb781748fbe0c1bd0104bab3596 (diff) | |
more cycle import removal. fixed ndollar bugs introduced during lint changes.
Diffstat (limited to 'src/client/views/nodes/FontIconBox/FontIconBox.tsx')
| -rw-r--r-- | src/client/views/nodes/FontIconBox/FontIconBox.tsx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/client/views/nodes/FontIconBox/FontIconBox.tsx b/src/client/views/nodes/FontIconBox/FontIconBox.tsx index d83690cdd..8d1617e66 100644 --- a/src/client/views/nodes/FontIconBox/FontIconBox.tsx +++ b/src/client/views/nodes/FontIconBox/FontIconBox.tsx @@ -11,8 +11,7 @@ import { BoolCast, DocCast, NumCast, ScriptCast, StrCast } from '../../../../fie import { emptyFunction } from '../../../../Utils'; import { Docs } from '../../../documents/Documents'; import { CollectionViewType, DocumentType } from '../../../documents/DocumentTypes'; -import { SelectionManager } from '../../../util/SelectionManager'; -import { SettingsManager } from '../../../util/SettingsManager'; +import { SnappingManager } from '../../../util/SnappingManager'; import { undoable, UndoManager } from '../../../util/UndoManager'; import { ContextMenu } from '../../ContextMenu'; import { ViewBoxBaseComponent } from '../../DocComponent'; @@ -125,7 +124,7 @@ export class FontIconBox extends ViewBoxBaseComponent<ButtonProps>() { return ( <NumberDropdown color={color} - background={SettingsManager.userBackgroundColor} + background={SnappingManager.userBackgroundColor} numberDropdownType={type} showPlusMinus={false} tooltip={this.label} @@ -160,9 +159,10 @@ export class FontIconBox extends ViewBoxBaseComponent<ButtonProps>() { let text: string | undefined; let getStyle: (val: string) => any = () => {}; let icon: IconProp = 'caret-down'; - const isViewDropdown = script?.script.originalScript.startsWith('setView'); + const isViewDropdown = script?.script.originalScript.startsWith('{ return setView'); if (isViewDropdown) { - const selected = SelectionManager.Docs; + const selected = Array.from(script?.script.run({ _readOnly_: true }).result) as Doc[]; + // const selected = SelectionManager.Docs; if (selected.lastElement()) { if (StrCast(selected.lastElement().type) === DocumentType.COL) { text = StrCast(selected.lastElement()._type_collection); @@ -178,15 +178,15 @@ export class FontIconBox extends ViewBoxBaseComponent<ButtonProps>() { icon={<FontAwesomeIcon size="1x" icon={icon} />} text={text} type={Type.TERT} - color={SettingsManager.userColor} - background={SettingsManager.userVariantColor} + color={SnappingManager.userColor} + background={SnappingManager.userVariantColor} popup={<SelectedDocView selectedDocs={selected} />} fillWidth /> ); } } else { - return <Button text="None Selected" type={Type.TERT} color={SettingsManager.userColor} background={SettingsManager.userVariantColor} fillWidth inactive />; + return <Button text="None Selected" type={Type.TERT} color={SnappingManager.userColor} background={SnappingManager.userVariantColor} fillWidth inactive />; } noviceList = [CollectionViewType.Freeform, CollectionViewType.Schema, CollectionViewType.Carousel3D, CollectionViewType.Stacking, CollectionViewType.NoteTaking]; } else { @@ -209,8 +209,8 @@ export class FontIconBox extends ViewBoxBaseComponent<ButtonProps>() { <Dropdown selectedVal={text} setSelectedVal={undoable(value => script.script.run({ this: this.Document, self: this.Document, value }), `dropdown select ${this.label}`)} - color={SettingsManager.userColor} - background={SettingsManager.userVariantColor} + color={SnappingManager.userColor} + background={SnappingManager.userVariantColor} type={Type.TERT} closeOnSelect={false} dropdownType={DropdownType.SELECT} @@ -250,7 +250,7 @@ export class FontIconBox extends ViewBoxBaseComponent<ButtonProps>() { selectedColor={curColor} type={Type.PRIM} color={color} - background={SettingsManager.userBackgroundColor} + background={SnappingManager.userBackgroundColor} icon={this.Icon(color)!} tooltip={tooltip} label={this.label} @@ -271,7 +271,7 @@ export class FontIconBox extends ViewBoxBaseComponent<ButtonProps>() { tooltip={`Toggle ${tooltip}`} type={Type.PRIM} color={color} - background={SettingsManager.userBackgroundColor} + background={SnappingManager.userBackgroundColor} label={this.label} items={DocListCast(this.dataDoc.data).map(item => ({ icon: <FontAwesomeIcon className={`fontIconBox-icon-${this.type}`} icon={StrCast(item.icon) as any} color={color} />, @@ -309,7 +309,7 @@ export class FontIconBox extends ViewBoxBaseComponent<ButtonProps>() { toggleStatus={toggleStatus} text={buttonText} color={color} - // background={SettingsManager.userBackgroundColor} + // background={SnappingManager.userBackgroundColor} icon={this.Icon(color)!} label={this.label} onPointerDown={e => @@ -373,9 +373,9 @@ export class FontIconBox extends ViewBoxBaseComponent<ButtonProps>() { case ButtonType.ClickButton:return <IconButton {...btnProps} size={Size.MEDIUM} color={color} />; case ButtonType.ToolButton: return <IconButton {...btnProps} size={Size.LARGE} color={color} />; case ButtonType.TextButton: return <Button {...btnProps} color={color} - background={SettingsManager.userBackgroundColor} text={StrCast(this.dataDoc.buttonText)}/>; + background={SnappingManager.userBackgroundColor} text={StrCast(this.dataDoc.buttonText)}/>; case ButtonType.MenuButton: return <IconButton {...btnProps} color={color} - background={SettingsManager.userBackgroundColor} size={Size.LARGE} tooltipPlacement='right' onPointerDown={scriptFunc} />; + background={SnappingManager.userBackgroundColor} size={Size.LARGE} tooltipPlacement='right' onPointerDown={scriptFunc} />; default: } return this.defaultButton; |
