From d0fccd1050f5d6ccc24c1e4d2b7d1c0ed94fb2a7 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Sun, 23 Mar 2025 10:27:28 -0400
Subject: updated more [DocData] to .$ things

---
 src/client/views/smartdraw/StickerPalette.tsx | 28 +++++++++++++--------------
 1 file changed, 13 insertions(+), 15 deletions(-)

(limited to 'src/client/views/smartdraw/StickerPalette.tsx')

diff --git a/src/client/views/smartdraw/StickerPalette.tsx b/src/client/views/smartdraw/StickerPalette.tsx
index e3305851a..080a05d42 100644
--- a/src/client/views/smartdraw/StickerPalette.tsx
+++ b/src/client/views/smartdraw/StickerPalette.tsx
@@ -9,7 +9,6 @@ import ReactLoading from 'react-loading';
 import { returnEmptyFilter, returnFalse, returnTrue } from '../../../ClientUtils';
 import { emptyFunction, numberRange } from '../../../Utils';
 import { Doc, DocListCast, returnEmptyDoclist } from '../../../fields/Doc';
-import { DocData } from '../../../fields/DocSymbols';
 import { ImageCast, NumCast } from '../../../fields/Types';
 import { ImageField } from '../../../fields/URLField';
 import { DocumentType } from '../../documents/DocumentTypes';
@@ -133,7 +132,7 @@ export class StickerPalette extends ObservableReactComponent<StickerPaletteProps
         this._canInteract = true;
         this._opts = { text: '', complexity: 5, size: 200, autoColor: true, x: 0, y: 0 };
         this._gptRes = [];
-        this._props.Document[DocData].data = undefined;
+        this._props.Document.$data = undefined;
     });
 
     /**
@@ -143,8 +142,8 @@ export class StickerPalette extends ObservableReactComponent<StickerPaletteProps
     @undoBatch
     generateDrawings = action(() => {
         this._isLoading = true;
-        const prevDrawings = DocListCast(this._props.Document[DocData].data);
-        this._props.Document[DocData].data = undefined;
+        const prevDrawings = DocListCast(this._props.Document.$data);
+        this._props.Document.$data = undefined;
         SmartDrawHandler.Instance.AddDrawing = this.addDrawing;
         this._canInteract = false;
         Promise.all(
@@ -164,7 +163,7 @@ export class StickerPalette extends ObservableReactComponent<StickerPaletteProps
     @action
     addDrawing = (drawing: Doc, opts: DrawingOptions, gptRes: string) => {
         this._gptRes.push(gptRes);
-        drawing[DocData].freeform_fitContentsToBox = true;
+        drawing.$freeform_fitContentsToBox = true;
         Doc.AddDocToList(this._props.Document, 'data', drawing);
     };
 
@@ -176,17 +175,16 @@ export class StickerPalette extends ObservableReactComponent<StickerPaletteProps
     saveDrawing = () => {
         const cIndex = NumCast(this._props.Document.carousel_index);
         const focusedDrawing = DocListCast(this._props.Document.data)[cIndex];
-        const docData = focusedDrawing[DocData];
-        docData.title = this._opts.text?.match(/^(.*?)~~~.*$/)?.[1] || this._opts.text;
-        docData.ai_drawing_input = this._opts.text;
-        docData.ai_drawing_complexity = this._opts.complexity;
-        docData.ai_drawing_colored = this._opts.autoColor;
-        docData.ai_drawing_size = this._opts.size;
-        docData.ai_drawing_data = this._gptRes[cIndex];
-        docData.ai = 'gpt';
+        focusedDrawing.$title = this._opts.text?.match(/^(.*?)~~~.*$/)?.[1] || this._opts.text;
+        focusedDrawing.$ai_drawing_input = this._opts.text;
+        focusedDrawing.$ai_drawing_complexity = this._opts.complexity;
+        focusedDrawing.$ai_drawing_colored = this._opts.autoColor;
+        focusedDrawing.$ai_drawing_size = this._opts.size;
+        focusedDrawing.$ai_drawing_data = this._gptRes[cIndex];
+        focusedDrawing.$ai = 'gpt';
         focusedDrawing.width = this._opts.size;
-        docData.x = this._opts.x;
-        docData.y = this._opts.y;
+        focusedDrawing.x = this._opts.x;
+        focusedDrawing.y = this._opts.y;
         StickerPalette.addToPalette(focusedDrawing).then(() => this.resetPalette(true));
     };
 
-- 
cgit v1.2.3-70-g09d2

