aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/formattedText/FormattedTextBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-04-19 13:01:37 -0400
committerbobzel <zzzman@gmail.com>2023-04-19 13:01:37 -0400
commit0a66b0f369a13d5f399bf125727aff73cd6fd1b4 (patch)
tree1214f42703f07a4cc1b6e88bae02795f65c9b9ff /src/client/views/nodes/formattedText/FormattedTextBox.tsx
parent615bd643f6afc95f6548bcbec468177582d4ffc3 (diff)
fixed image importing metadata for gpt. fixed showTitle UI to be able to turn off titles on templates (like icon views). added ui for choosing primary/alternate image and a drop target for setting alternate.
Diffstat (limited to 'src/client/views/nodes/formattedText/FormattedTextBox.tsx')
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBox.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index 3e60441aa..bbe38cf99 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -885,13 +885,15 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FieldViewProps
try {
let image_url = await gptImageCall((this.dataDoc.text as RichTextField)?.Text);
if (image_url) {
- const [{ accessPaths }] = await Networking.PostToServer('/uploadRemoteImage', { sources: [image_url] });
- const source = Utils.prepend(accessPaths.agnostic.client);
+ const [result] = await Networking.PostToServer('/uploadRemoteImage', { sources: [image_url] });
+ const source = Utils.prepend(result.accessPaths.agnostic.client);
const newDoc = Docs.Create.ImageDocument(source, {
x: NumCast(this.rootDoc.x) + NumCast(this.layoutDoc._width) + 10,
y: NumCast(this.rootDoc.y),
_height: 200,
_width: 200,
+ 'data-nativeWidth': result.nativeWidth,
+ 'data-nativeHeight': result.nativeHeight,
});
if (DocListCast(Doc.MyOverlayDocs?.data).includes(this.rootDoc)) {
newDoc.overlayX = this.rootDoc.x;