Browse Source

feat: sync with upstream changes

are 1 năm trước cách đây
mục cha
commit
e72721e39f

+ 18 - 1
src/components/TTDDialog/TTDDialog.tsx

@@ -91,7 +91,24 @@ export const TTDDialogBase = withInternalFallback(
                 </div>
               </TTDDialogTabTrigger>
               <TTDDialogTabTrigger tab="text-to-drawing">
-                {t("labels.textToDrawing")}
+                <div style={{ display: "flex", alignItems: "center" }}>
+                  {t("labels.textToDrawing")}
+                  <div
+                    style={{
+                      display: "flex",
+                      alignItems: "center",
+                      justifyContent: "center",
+                      padding: "1px 6px",
+                      marginLeft: "10px",
+                      fontSize: 10,
+                      borderRadius: "12px",
+                      background: "pink",
+                      color: "#000",
+                    }}
+                  >
+                    AI Beta
+                  </div>
+                </div>
               </TTDDialogTabTrigger>
               <TTDDialogTabTrigger tab="mermaid">Mermaid</TTDDialogTabTrigger>
             </TTDDialogTabTriggers>

+ 1 - 1
src/components/TTDDialog/TTDDialogTabs.tsx

@@ -49,7 +49,7 @@ const TTDDialogTabs = (
           });
         } else if (
           props.dialog === "ttd" &&
-          isMemberOf(["text-to-diagram", "mermaid"], tab)
+          isMemberOf(["text-to-diagram", "mermaid", "text-to-drawing"], tab)
         ) {
           setAppState({
             openDialog: { name: props.dialog, tab },

+ 1 - 1
src/components/TTDDialog/TTDDialogTrigger.tsx

@@ -13,7 +13,7 @@ export const TTDDialogTrigger = ({
 }: {
   children?: ReactNode;
   icon?: JSX.Element;
-  tab?: string;
+  tab?: "mermaid" | "text-to-diagram" | "text-to-drawing";
 }) => {
   const { TTDDialogTriggerTunnel } = useTunnels();
   const setAppState = useExcalidrawSetAppState();

+ 1 - 1
src/types.ts

@@ -255,7 +255,7 @@ export interface AppState {
           | "settings"; // when AI settings dialog is explicitly invoked
         tab: "text-to-diagram" | "diagram-to-code";
       }
-    | { name: "ttd"; tab: "text-to-diagram" | "mermaid" };
+    | { name: "ttd"; tab: "text-to-diagram" | "mermaid" | "text-to-drawing" };
   /**
    * Reflects user preference for whether the default sidebar should be docked.
    *