aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx11
-rw-r--r--src/client/views/nodes/DocumentView.tsx7
-rw-r--r--src/client/views/nodes/ImageBox.tsx5
3 files changed, 11 insertions, 12 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index b45409a75..49c684ab1 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -2164,10 +2164,6 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
@observable private _regenerateLoading = false;
@observable private _regenInput = '';
- @observable private _canInteract = true;
- @observable private _drawingFillInput = '';
- @observable private _regenLoading = false;
- @observable private _drawingFillLoading = false;
@observable private _fireflyRefStrength = 0;
componentAIView = () => {
@@ -2180,7 +2176,7 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
aria-label="Edit instructions input"
type="text"
value={this._regenInput || StrCast(this.Document.title)}
- onChange={action(e => this._canInteract && (this._regenInput = e.target.value))}
+ onChange={action(e => (this._regenInput = e.target.value))}
placeholder={this._regenInput || StrCast(this.Document.title)}
/>
<div className="imageBox-aiView-regenerate-createBtn">
@@ -2213,10 +2209,7 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
max={100}
number={this._fireflyRefStrength}
size={Size.XXSMALL}
- setNumber={undoable(
- action(val => this._canInteract && (this._fireflyRefStrength = val as number)),
- `${this.Document.title} button set from list`
- )}
+ setNumber={undoable(action(val => (this._fireflyRefStrength = val as number)),`${this.Document.title} button set from list` )}
fillWidth
/>
</div>
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index bd71115db..90edab3a7 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -743,6 +743,12 @@ export class DocumentViewInternal extends DocComponent<DocumentViewProps & Field
widgetOverlayFunc = () => (this.widgetDecorations ? this.widgetOverlay : null);
viewingAiEditor = () => (this._props.showAIEditor && this._componentView?.componentAIView?.() !== undefined ? this.aiEditor : null);
@observable _contentsRef: DocumentContentsView | undefined = undefined;
+ screenToContentsXf = () =>
+ this.viewingAiEditor()
+ ? this.layoutDoc.layout_reflowHorizontal
+ ? this._props.ScreenToLocalTransform().scale(Math.min(this.aiContentsWidth() / this._props.PanelWidth(), this.aiContentsHeight() / this._props.PanelHeight()))
+ : this._props.ScreenToLocalTransform().translate((this._props.PanelWidth() - this.aiContentsWidth()) / 2, 0)
+ : this._props.ScreenToLocalTransform();
@computed get viewBoxContents() {
TraceMobx();
const isInk = this.layoutDoc._layout_isSvg && !this._props.LayoutTemplateString;
@@ -762,6 +768,7 @@ export class DocumentViewInternal extends DocComponent<DocumentViewProps & Field
layoutFieldKey={StrCast(this.Document.layout_fieldKey, 'layout')}
pointerEvents={this.contentPointerEvents}
setContentViewBox={this.setContentView}
+ ScreenToLocalTransform={this.screenToContentsXf}
childFilters={this.childFilters}
PanelWidth={this.viewingAiEditor() ? this.aiContentsWidth : this._props.PanelWidth}
PanelHeight={this.viewingAiEditor() ? this.aiContentsHeight : this.panelHeight}
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx
index 5d5f9d00a..4886f0e96 100644
--- a/src/client/views/nodes/ImageBox.tsx
+++ b/src/client/views/nodes/ImageBox.tsx
@@ -100,7 +100,6 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
// variables for AI Image Editor
@observable private _regenInput = '';
- @observable private _canInteract = true;
@observable private _regenerateLoading = false;
// Add these observable properties to the ImageBox class
@@ -903,7 +902,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
aria-label="Edit instructions input"
type="text"
value={this._regenInput || StrCast(this.Document.title)}
- onChange={action(e => this._canInteract && (this._regenInput = e.target.value))}
+ onChange={action(e => (this._regenInput = e.target.value))}
placeholder={this._regenInput || StrCast(this.Document.title)}
/>
<div className="imageBox-aiView-regenerate-createBtn">
@@ -937,7 +936,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
number={this._fireflyRefStrength}
size={Size.XXSMALL}
setNumber={undoable(
- action(val => this._canInteract && (this._fireflyRefStrength = val as number)),
+ action(val => (this._fireflyRefStrength = val as number)),
`${this.Document.title} button set from list`
)}
fillWidth