@chaibuilder/pages 0.16.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{2AITGKQY-BxEty5Ow.cjs → 2AITGKQY-CD9A6oc6.cjs} +1 -1
- package/dist/{2AITGKQY-BFankGad.js → 2AITGKQY-Z1XcJ6Q7.js} +2 -2
- package/dist/{NCMVHL6D-DP-qw6yT.cjs → NCMVHL6D-CkpM-3og.cjs} +1 -1
- package/dist/{NCMVHL6D-DFMKkQPN.js → NCMVHL6D-DoK0XoIo.js} +2 -2
- package/dist/{ZDWCUMSJ-Cu1VTliO.cjs → ZDWCUMSJ-D32swpGV.cjs} +1 -1
- package/dist/{ZDWCUMSJ-DU81uAQq.js → ZDWCUMSJ-hGXNxbOK.js} +1 -1
- package/dist/{add-new-language-page-0zC1CJZK.js → add-new-language-page-BZPoqdX-.js} +2 -2
- package/dist/{add-new-language-page-DQ46xqnc.cjs → add-new-language-page-D65TpIwK.cjs} +1 -1
- package/dist/{add-new-page-Ca2H2J-2.cjs → add-new-page-CQ0aj4RJ.cjs} +1 -1
- package/dist/{add-new-page-CUtZhDvi.js → add-new-page-DK25Y0zS.js} +1 -1
- package/dist/{ai-panel-content-CV-HTsAs.cjs → ai-panel-content-BSGJqnTM.cjs} +1 -1
- package/dist/{ai-panel-content-r2jlUBoR.js → ai-panel-content-DYRZnMgV.js} +2 -2
- package/dist/ai-panel-default-lang-BOZrL5Xe.cjs +1 -0
- package/dist/{ai-panel-default-lang-D6RAQW1X.js → ai-panel-default-lang-DZUqC79y.js} +3 -3
- package/dist/ai-panel-other-lang-CCyiE6ha.js +145 -0
- package/dist/ai-panel-other-lang-CNtlT5dM.cjs +1 -0
- package/dist/{ai-panel-quick-prompts-DiNVPPAn.cjs → ai-panel-quick-prompts-DeS7L1f0.cjs} +1 -1
- package/dist/{ai-panel-quick-prompts-CpzN48cl.js → ai-panel-quick-prompts-Ds0Ndz7g.js} +1 -1
- package/dist/{ai-prompt-input-vAcIZSB1.js → ai-prompt-input-Ch_PLEPN.js} +1 -1
- package/dist/{ai-prompt-input-D-F23bdc.cjs → ai-prompt-input-Zg6lN1Lo.cjs} +1 -1
- package/dist/ai-translation-prompt-BUFjo_om.cjs +1 -0
- package/dist/ai-translation-prompt-BiJ5B_an.js +28 -0
- package/dist/{delete-page-BS10zPLU.js → delete-page-B95T2Prd.js} +1 -1
- package/dist/{delete-page-ClgtvB6n.cjs → delete-page-BSop1jNg.cjs} +1 -1
- package/dist/{digital-asset-manager-D_FFLECK.js → digital-asset-manager-BQNSwfKs.js} +1 -1
- package/dist/{digital-asset-manager-MK8ZL6Nd.cjs → digital-asset-manager-Bn58WzM6.cjs} +1 -1
- package/dist/{duplicate-page-BaZrekqu.cjs → duplicate-page-BLxkSiug.cjs} +1 -1
- package/dist/{duplicate-page-C1r4cCIJ.js → duplicate-page-CrzzObAj.js} +2 -2
- package/dist/{dynamic-page-selector-CjtnFkxO.js → dynamic-page-selector-D6wQnNfH.js} +1 -1
- package/dist/{dynamic-page-selector-C4R_vhhz.cjs → dynamic-page-selector-D8UZ63LW.cjs} +1 -1
- package/dist/index-W0r4o5Ro.cjs +5 -0
- package/dist/{index-D_qadcqD.js → index-yhKyIbgs.js} +584 -587
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-diff-viewer-BURQmaIL.js → json-diff-viewer-ISJS7lHK.js} +1 -1
- package/dist/{json-diff-viewer-CyZVbnpL.cjs → json-diff-viewer-ZeJ3Rp2y.cjs} +1 -1
- package/dist/{lang-panel-C8yx7PSU.js → lang-panel-Bj11IL7k.js} +2 -2
- package/dist/{lang-panel-SUARS5YU.cjs → lang-panel-DqN_J3vz.cjs} +1 -1
- package/dist/{mark-as-template-DS-nfI06.cjs → mark-as-template-CcwAAdrd.cjs} +1 -1
- package/dist/{mark-as-template-CUHypMlj.js → mark-as-template-CmCCMaQg.js} +1 -1
- package/dist/{no-language-page-content-DZj3cmtM.cjs → no-language-page-content-BXm1k1Aa.cjs} +1 -1
- package/dist/{no-language-page-content-qoHrlxwD.js → no-language-page-content-Cme-zo4R.js} +1 -1
- package/dist/{page-creator-HwE9ST54.cjs → page-creator-ByhjXyHP.cjs} +1 -1
- package/dist/{page-creator-C8VQGfap.js → page-creator-Zbv4d4H8.js} +2 -2
- package/dist/{page-lock-request-Db7-x_EI.cjs → page-lock-request-Cln-EE6Z.cjs} +1 -1
- package/dist/{page-lock-request-CBVKtxVj.js → page-lock-request-DDQJb8IA.js} +1 -1
- package/dist/{page-locked-by-dialog-CvRDaBcN.cjs → page-locked-by-dialog-BIXYITEu.cjs} +1 -1
- package/dist/{page-locked-by-dialog-DEC58QPA.js → page-locked-by-dialog-Csn56a3n.js} +1 -1
- package/dist/{page-manager-new-CBxSkcYY.cjs → page-manager-new-BJaTBpih.cjs} +1 -1
- package/dist/{page-manager-new-B1PDwz2w.js → page-manager-new-BrRxZDfT.js} +2 -2
- package/dist/{page-manager-search-and-filter-BRLPHE64.cjs → page-manager-search-and-filter-Bk3PUjha.cjs} +1 -1
- package/dist/{page-manager-search-and-filter-0eTSE1C1.js → page-manager-search-and-filter-_Hvk3bU3.js} +1 -1
- package/dist/{page-revisions-content-CKcp4He4.js → page-revisions-content-B6fRCBX_.js} +2 -2
- package/dist/{page-revisions-content-CTrVTQ_s.cjs → page-revisions-content-C_Ha3tFu.cjs} +1 -1
- package/dist/{prompt-helper-CfyAlam9.js → prompt-helper-Csgu8Rfb.js} +31 -19
- package/dist/{prompt-helper-BtijECyh.cjs → prompt-helper-DgI1lgGV.cjs} +3 -3
- package/dist/{publish-pages-content-BMaeNHV2.js → publish-pages-content-CFEIxKQD.js} +2 -2
- package/dist/{publish-pages-content-B6HGaUtO.cjs → publish-pages-content-DQDNxwHD.cjs} +1 -1
- package/dist/{save-to-lib-BKKTPv4h.cjs → save-to-lib-Bl22umTa.cjs} +1 -1
- package/dist/{save-to-lib-CccnzwO8.js → save-to-lib-YyYkF6c6.js} +1 -1
- package/dist/{seo-panel-4KK4r-BP.js → seo-panel-BZlMea1L.js} +1 -1
- package/dist/{seo-panel-DL_rcWwC.cjs → seo-panel-BhxikAkG.cjs} +1 -1
- package/dist/server.cjs +3 -0
- package/dist/server.d.ts +1 -1
- package/dist/server.js +3 -0
- package/dist/{shared-json-ld-BuYzbmKx.cjs → shared-json-ld-BfkH76U3.cjs} +1 -1
- package/dist/{shared-json-ld-DGW40Ccy.js → shared-json-ld-E4Ckwlbr.js} +1 -1
- package/dist/{slug-input--8SgDwYu.cjs → slug-input--VmQG0S1.cjs} +1 -1
- package/dist/{slug-input-DH5w0H22.js → slug-input-CKKkqGj4.js} +1 -1
- package/dist/{theme-panel-footer-CHR7J97n.js → theme-panel-footer-2ERfMsET.js} +1 -1
- package/dist/{theme-panel-footer-Co5VI_i9.cjs → theme-panel-footer-CagxEZEO.cjs} +1 -1
- package/dist/{unmark-as-template-DlA879QF.js → unmark-as-template-BJ5CTNAe.js} +1 -1
- package/dist/{unmark-as-template-B3h10oHA.cjs → unmark-as-template-CeWpo9wD.cjs} +1 -1
- package/dist/{unpublish-page-Bfo_DuW5.cjs → unpublish-page-DmZSVxFj.cjs} +1 -1
- package/dist/{unpublish-page-JzGl35pF.js → unpublish-page-DvOWVBIf.js} +1 -1
- package/dist/{web-preview-CJ6JyhJD.js → web-preview-DTkIggV7.js} +1 -1
- package/dist/{web-preview-oG2epixb.cjs → web-preview-DlSKpPUZ.cjs} +1 -1
- package/package.json +1 -1
- package/dist/ai-panel-default-lang-EH3w6g25.cjs +0 -1
- package/dist/ai-panel-other-lang-BeTdv7yM.js +0 -133
- package/dist/ai-panel-other-lang-_gGQTjZQ.cjs +0 -1
- package/dist/ai-translation-prompt-AImJlmDg.cjs +0 -1
- package/dist/ai-translation-prompt-BKyp1IW2.js +0 -63
- package/dist/index-C64wG61b.cjs +0 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n, Fragment as j } from "react/jsx-runtime";
|
|
2
2
|
import { useLanguages as me } from "@chaibuilder/sdk";
|
|
3
3
|
import { useQuery as he, useQueryClient as ue } from "@tanstack/react-query";
|
|
4
|
-
import { am as ge, an as fe, A as U, ar as le, aw as pe, ax as se, ay as re, az as de, aA as xe, aB as Ne, aC as be, g as ye, aD as ve } from "./index-
|
|
4
|
+
import { am as ge, an as fe, A as U, ar as le, aw as pe, ax as se, ay as re, az as de, aA as xe, aB as Ne, aC as be, g as ye, aD as ve } from "./index-yhKyIbgs.js";
|
|
5
5
|
import { Dialog as $, DialogContent as W, DialogHeader as Y, DialogTitle as X, Alert as we, AlertDescription as Ae, Label as y, Input as G, Button as v, AlertDialog as _, AlertDialogContent as R, AlertDialogHeader as M, AlertDialogTitle as q, AlertDialogDescription as H, AlertDialogFooter as Q, AlertDialogCancel as V, AlertDialogAction as K, Tooltip as E, TooltipTrigger as J, TooltipContent as O, ScrollArea as Ce, Card as Se, CardHeader as Pe, CardTitle as Te, AlertDialogTrigger as De, CardContent as Le, Textarea as Ee } from "@chaibuilder/sdk/ui";
|
|
6
6
|
import { filter as Je, find as Oe } from "lodash-es";
|
|
7
7
|
import { Info as Fe, Loader as F, Plus as ke, Eye as je, Edit as Ge, Trash as Be } from "lucide-react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("react/jsx-runtime"),u=require("./index-
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),u=require("./index-W0r4o5Ro.cjs"),b=require("@chaibuilder/sdk/ui"),d=require("react"),j=e=>{if(!e)return{base:e,extension:null};const n=e.lastIndexOf(".");if(n<=0)return{base:e,extension:null};const t=e.substring(n);return{base:e.substring(0,n),extension:t}},x=e=>{if(!e)return e;const{base:n}=j(e);return n};function E(e,n){const t=(e||"").split("/").filter(Boolean);let r="",a=!0;if(n.slug==="/"){const i=t.pop()||"";if(u.LANGUAGES[i])a=!0;else{r=i;const l=t.pop()||"";a=!!u.LANGUAGES[l]}}else if(n.parent)t.length&&(r=t.pop()||"");else if(t.length){r=t.pop()||"";const i=t.pop()||"";a=!!u.LANGUAGES[i]}return{initSlug:r,prefix:a}}const v=e=>e&&x(e),C=(e,n)=>{const t=x(e||"");return!t||t==="/"?`/${n}`:`${t}/${n}`};function A({value:e,onChange:n,placeholder:t,parentSlug:r,onValidationChange:a,disabled:i=!1,fullSlug:l}){const[g,p]=d.useState(e),[o,f]=d.useState(null);d.useEffect(()=>{p(e)},[e]);const h=S=>{const c=S.target.value.replace(/\//g,"").replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-_.]/g,"-").replace(/-+/g,"-").replace(/^-+/,"").toLowerCase(),m=(c.match(/\./g)||[]).length,N=m<=1;m>1?f("Invalid slug. Only one dot (.) is allowed in the slug"):f(null),a&&a(N),p(c),n(c)};return s.jsxs("div",{children:[r&&s.jsx("div",{className:"mb-1 flex items-center",children:s.jsxs("span",{className:"text-xs text-gray-500",children:["Parent: ",s.jsx("span",{className:"font-mono text-gray-900",children:v(r)})]})}),s.jsxs("div",{className:"relative",children:[s.jsx(b.Input,{disabled:i,value:g,onChange:h,placeholder:t,className:o?"border-red-500":""}),o&&s.jsx("div",{className:"mt-1 text-xs text-red-500",children:o})]}),l&&l!=="undefined"&&s.jsx("div",{className:"mt-1 flex items-center",children:s.jsxs("span",{className:"text-xs text-gray-500",children:["Complete Slug: ",s.jsx("span",{className:"font-mono text-gray-900",children:l})]})})]})}exports.SlugInput=A;exports.combineParentChildSlugs=C;exports.parseSlugForEdit=E;exports.removeSlugExtension=x;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { L as d } from "./index-
|
|
2
|
+
import { L as d } from "./index-yhKyIbgs.js";
|
|
3
3
|
import { Input as v } from "@chaibuilder/sdk/ui";
|
|
4
4
|
import { useState as x, useEffect as C } from "react";
|
|
5
5
|
const y = (e) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as c, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { u, a as d, t as h } from "./index-
|
|
2
|
+
import { u, a as d, t as h } from "./index-yhKyIbgs.js";
|
|
3
3
|
import { useTheme as b, useTranslation as g } from "@chaibuilder/sdk";
|
|
4
4
|
import { Button as o } from "@chaibuilder/sdk/ui";
|
|
5
5
|
const x = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-W0r4o5Ro.cjs"),o=require("@chaibuilder/sdk"),r=require("@chaibuilder/sdk/ui"),h=()=>{const[t]=o.useTheme(),{mutate:c,isPending:i}=s.usePublishPages(),{mutateAsync:n,isPending:u}=s.useUpdateWebsiteSettings(),{t:a}=o.useTranslation(),l=()=>{n({settings:{theme:t}})},d=async()=>{await n({settings:{theme:t}}),c({ids:["THEME"]},{onSuccess:()=>{s.throwConfetti("BOTTOM_RIGHT")}})};return e.jsxs("div",{className:"flex items-center justify-center gap-x-3 border-t bg-white py-3",children:[e.jsx(r.Button,{size:"sm",variant:"outline",disabled:i||u,onClick:l,children:a("Save draft")}),e.jsx(r.Button,{size:"sm",disabled:i||u,onClick:d,children:a("Publish")})]})};exports.default=h;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
-
import { o as p } from "./index-
|
|
2
|
+
import { o as p } from "./index-yhKyIbgs.js";
|
|
3
3
|
import { useTranslation as u } from "@chaibuilder/sdk";
|
|
4
4
|
import { Dialog as d, DialogContent as g, DialogHeader as h, DialogTitle as f, DialogDescription as k, DialogFooter as D, Button as s } from "@chaibuilder/sdk/ui";
|
|
5
5
|
import { useState as x } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("./index-W0r4o5Ro.cjs"),d=require("@chaibuilder/sdk"),t=require("@chaibuilder/sdk/ui"),m=require("react"),p=({page:i,onClose:n})=>{const{t:a}=d.useTranslation(),[r,s]=m.useState(!1),o=u.useUnmarkAsTemplate(),l=()=>{s(!0),o.mutate(i,{onSuccess:()=>{s(!1),n()},onError:()=>{s(!1)}})};return e.jsx(t.Dialog,{open:!0,onOpenChange:n,children:e.jsxs(t.DialogContent,{children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{children:a("Unmark as template")}),e.jsx(t.DialogDescription,{className:"space-y-1 py-4 text-xs text-slate-500",children:a("Are you sure you want to unmark this page as a template?")})]}),e.jsxs(t.DialogFooter,{className:r?"pointer-events-none opacity-75":"",children:[e.jsx(t.Button,{variant:"outline",onClick:c=>{c.stopPropagation(),n()},children:a("Cancel")}),e.jsx(t.Button,{variant:"default",disabled:r,onClick:l,children:a("Unmark as template")})]})]})})};exports.default=p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("./index-W0r4o5Ro.cjs"),c=require("@chaibuilder/sdk"),s=require("@chaibuilder/sdk/ui"),d=({page:i,onClose:t})=>{const{t:e}=c.useTranslation(),{mutate:r,isPending:l}=u.useUnpublishPage(),o=async()=>{r(i,{onSuccess:t})};return n.jsx(s.Dialog,{open:!!i,onOpenChange:t,children:n.jsxs(s.DialogContent,{children:[n.jsxs(s.DialogHeader,{children:[n.jsx(s.DialogTitle,{children:e("Confirm action")}),n.jsxs(s.DialogDescription,{children:[e("Are you sure you want to unpublish")," ",n.jsx("b",{children:(i==null?void 0:i.name)??(i==null?void 0:i.slug)}),"?"]})]}),n.jsxs(s.DialogFooter,{children:[n.jsx(s.Button,{variant:"outline",onClick:t,children:e("Cancel")}),n.jsx(s.Button,{variant:"destructive",disabled:l,onClick:o,children:e(l?"Updating...":"Unpublish")})]})]})})};exports.default=d;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as o, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import { l as u } from "./index-
|
|
2
|
+
import { l as u } from "./index-yhKyIbgs.js";
|
|
3
3
|
import { useTranslation as a } from "@chaibuilder/sdk";
|
|
4
4
|
import { Dialog as h, DialogContent as d, DialogHeader as m, DialogTitle as b, DialogDescription as D, DialogFooter as f, Button as s } from "@chaibuilder/sdk/ui";
|
|
5
5
|
const g = ({ page: n, onClose: t }) => {
|
|
@@ -4,7 +4,7 @@ import { Button as s } from "@chaibuilder/sdk/ui";
|
|
|
4
4
|
import { useAtom as h } from "jotai";
|
|
5
5
|
import { map as p } from "lodash-es";
|
|
6
6
|
import { Smartphone as w, Tablet as f, Laptop as u, LaptopMinimal as x } from "lucide-react";
|
|
7
|
-
import { p as v, T as _ } from "./index-
|
|
7
|
+
import { p as v, T as _ } from "./index-yhKyIbgs.js";
|
|
8
8
|
const b = [
|
|
9
9
|
{
|
|
10
10
|
title: "mobile_xs_title",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),a=require("@chaibuilder/sdk/ui"),h=require("jotai"),x=require("lodash-es"),n=require("lucide-react"),c=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),a=require("@chaibuilder/sdk/ui"),h=require("jotai"),x=require("lodash-es"),n=require("lucide-react"),c=require("./index-W0r4o5Ro.cjs"),m=[{title:"mobile_xs_title",content:"mobile_xs_content",icon:e.jsx(n.Smartphone,{className:"h-4 w-4"}),width:400},{title:"tablet_md_title",content:"tablet_md_content",icon:e.jsx(n.Tablet,{className:"h-4 w-4"}),width:800},{title:"desktop_xl_title",content:"desktop_xl_content",icon:e.jsx(n.Laptop,{className:"h-4 w-4"}),width:1200},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",icon:e.jsx(n.LaptopMinimal,{className:"h-4 w-4"}),width:1600}],w=({currentWidth:t,width:s,icon:l,setIframeWidth:i})=>e.jsx(a.Button,{className:"px-3 py-3",onClick:()=>i(s),variant:s===t?"default":"ghost",children:l}),p=()=>{const[t,s]=o.useState(1200),l=r=>s(r),[i,d]=h.useAtom(c.previewUrlAtom);if(!i)return null;const u=()=>{d("")};return e.jsxs("div",{className:"absolute inset-0 z-[999999] flex h-screen w-screen flex-col overflow-hidden bg-gray-100",children:[e.jsxs("div",{className:"flex h-[50px] items-center justify-center border-b border-gray-200 px-4 shadow-sm",children:[e.jsx("div",{className:"flex items-center justify-center rounded-md border border-gray-300",children:x.map(m,r=>o.createElement(w,{...r,setIframeWidth:l,key:r.title,currentWidth:t}))})," ",e.jsx(c.Tooltip,{content:"Exit Preview",delayDuration:0,children:e.jsx(a.Button,{variant:"destructive",size:"sm",onClick:u,children:e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H12C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H3C2.44772 13 2 12.5523 2 12V3ZM12 3H3V12H12V3Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"})})})})]}),e.jsx("iframe",{style:{width:`${t}px`,transition:"width 0.3s ease-in-out"},className:"no-scrollbar mx-auto h-full overflow-y-auto border bg-white",src:i})]})};exports.default=p;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),f=require("@chaibuilder/sdk"),F=require("lucide-react"),d=require("react"),X=require("sonner"),Y=require("./prompt-helper-BtijECyh.cjs");function Z(n){if(!n)return"";let e=n.trim();return e=e.replace(/^```html\n?/i,""),e=e.replace(/^```\n?/,""),e=e.replace(/\n?```$/,""),e=e.trim(),e}function ee(n){if(!n)return"";const e=Z(n);return e.length===0||!e.includes("<")||!e.includes(">")?"":e}const te=n=>{const e=document.getElementById("canvas-iframe");if(!e)return null;const l=e==null?void 0:e.contentDocument;if(!l)return null;const s=l.querySelector(`[data-block-id="${n}"]`);if(!s)return null;if(n==="canvas"){const a=l.createElement("div");return a.style.height="100vh",s.appendChild(a),a}return s},ne=d.lazy(()=>Promise.resolve().then(()=>require("./ai-panel-message-bubble-Bl-aUeU4.cjs"))),re=d.lazy(()=>Promise.resolve().then(()=>require("./ai-prompt-input-D-F23bdc.cjs"))),oe=({t:n,fetch:e,input:l,messages:s,setInput:a,isLoading:m,setMessages:v,handleReset:T,handleStop:_,setIsLoading:k,currentBlock:D,fallbackLang:M,setCurrentBlock:R,setAbortController:E,forceNewConversation:j,suggestNewConversation:z})=>{const q=d.useRef(null),{addPredefinedBlock:V}=f.useAddBlock(),O=f.useReplaceBlock(),h=f.useSelectedBlock(),U=f.useBlocksHtmlForAi(),W=f.useHtmlToBlocks(),$=()=>{var o;(o=q.current)==null||o.scrollIntoView({behavior:"smooth"})};d.useEffect(()=>{$()},[s,m]);const C=async(o,x,A)=>{var B;if(!o||m)return;const r=h;R(h);const H=U();if(h&&!H){X.toast.error(n("Something went wrong. Please try again."));return}const N={id:Date.now().toString(),role:"user",content:Y.getUserPrompt({language:M,userInput:x||o,currentHtml:H}),userMessage:o},P={id:Date.now().toString(),role:"assistant",content:""};v(i=>[...i,N,P]),k(!0);const K=new AbortController;E(K);try{const i={messages:[...s,N].map(w=>({role:w.role,content:w.content}))};A&&(i.image=A);const b=await e({body:{action:"ASK_AI",data:i},streamResponse:!0});if(!b.ok)throw new Error(n("Failed to get AI response"));const p=(B=b.body)==null?void 0:B.getReader(),L=new TextDecoder;let y="";if(!p)throw new Error(n("Response body is not readable"));const u=te(r?r==null?void 0:r._id:"canvas");for(;;){const{done:w,value:J}=await p.read();if(w){u&&!r&&u.remove();break}const Q=L.decode(J,{stream:!0});if(y+=Q,u){u.innerHTML=y;const g=u.getBoundingClientRect(),c=document.getElementById("canvas-iframe"),I=c==null?void 0:c.contentWindow;I&&(g.top>=0&&g.bottom<=I.innerHeight||u.scrollIntoView({behavior:"smooth",block:"nearest"}))}v(g=>g.map(c=>c.id===P.id?{...c,content:y}:c))}const G=ee(y),S=W(G);r!=null&&r._id?(console.log("Editing block",r==null?void 0:r._id,S),O(r==null?void 0:r._id,S)):V([...S],r==null?void 0:r._parent,-1)}catch(i){if(i.name!=="AbortError"){const b={id:(Date.now()+1).toString(),role:"assistant",content:n("Sorry, I encountered an error. Please try again.")};v(p=>[...p,b])}}finally{a(""),k(!1),R(null),E(null)}};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex-1 space-y-3 overflow-y-auto py-4",children:[s.length===0&&t.jsx("div",{className:"flex-1 space-y-3 overflow-y-auto py-4",children:t.jsxs("div",{className:"mx-auto mt-8 text-center text-gray-500",children:[t.jsx(F.Bot,{size:48,className:"mx-auto mb-4 text-gray-300"}),t.jsx("p",{className:"mx-auto max-w-[75%] text-sm",children:n("Start a conversation with the AI assistant to generate and update your sections")})]})}),s.map((o,x)=>o.role!=="system"&&t.jsx(d.Suspense,{fallback:t.jsx("div",{children:"Loading..."}),children:t.jsx(ne,{message:o,isUser:o.role==="user",isLoading:o.role==="assistant"&&m&&x===s.length-1})},x)),z&&!m&&t.jsx("button",{onClick:T,className:"flex w-full items-center justify-center gap-2 rounded-lg border border-blue-200 bg-blue-50 p-1.5 text-left transition-colors hover:bg-blue-100",children:t.jsx("div",{className:"flex flex-col",children:t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-blue-700",children:[t.jsx(F.Plus,{className:"h-4 w-4 capitalize text-blue-600"}),n(j?"Start":"New")," ",n("Conversation")," ",!j&&t.jsx("span",{className:"text-[10px] font-extralight text-blue-600",children:n("For best results")})]})})}),t.jsx("div",{ref:q})]}),!j&&t.jsx("div",{className:"border-gray-200 pb-2",children:t.jsx(d.Suspense,{fallback:t.jsx("div",{children:"Loading..."}),children:t.jsx(re,{input:l,setInput:a,onSend:C,onStop:_,isLoading:m,selectedLang:"",currentBlock:h||D,disabled:(l==null?void 0:l.length)===0})})})]})};exports.default=oe;
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { jsxs as i, Fragment as V, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as W, useSelectedBlock as G, useI18nBlocks as H, useStreamMultipleBlocksProps as Q } from "@chaibuilder/sdk";
|
|
3
|
-
import { Bot as X, Plus as Y } from "lucide-react";
|
|
4
|
-
import { lazy as b, useRef as Z, useEffect as $, Suspense as f } from "react";
|
|
5
|
-
import { g as L } from "./prompt-helper-CfyAlam9.js";
|
|
6
|
-
const ee = b(() => import("./ai-panel-message-bubble-DPAaAMAZ.js")), te = b(() => import("./ai-translation-prompt-BKyp1IW2.js")), se = b(() => import("./ai-prompt-input-vAcIZSB1.js")), ce = ({
|
|
7
|
-
fetch: E,
|
|
8
|
-
input: l,
|
|
9
|
-
messages: n,
|
|
10
|
-
setInput: x,
|
|
11
|
-
isLoading: r,
|
|
12
|
-
handleStop: P,
|
|
13
|
-
handleReset: R,
|
|
14
|
-
setMessages: p,
|
|
15
|
-
setIsLoading: d,
|
|
16
|
-
selectedLang: c,
|
|
17
|
-
currentBlock: j,
|
|
18
|
-
fallbackLang: O,
|
|
19
|
-
abortController: u,
|
|
20
|
-
setAbortController: D,
|
|
21
|
-
forceNewConversation: m,
|
|
22
|
-
suggestNewConversation: F
|
|
23
|
-
}) => {
|
|
24
|
-
const { t: s } = W(), y = Z(null), w = G(), g = H(), I = Q(), M = () => {
|
|
25
|
-
var t;
|
|
26
|
-
(t = y.current) == null || t.scrollIntoView({ behavior: "smooth" });
|
|
27
|
-
};
|
|
28
|
-
$(() => {
|
|
29
|
-
M();
|
|
30
|
-
}, [n, r]);
|
|
31
|
-
const k = async (t, o) => {
|
|
32
|
-
var v;
|
|
33
|
-
const N = (t == null ? void 0 : t.toLowerCase()) === "translate", T = {
|
|
34
|
-
id: Date.now().toString(),
|
|
35
|
-
role: "user",
|
|
36
|
-
content: L({
|
|
37
|
-
fallbackLang: O,
|
|
38
|
-
userInput: o || t,
|
|
39
|
-
language: c,
|
|
40
|
-
blocks: N ? g() : g(c)
|
|
41
|
-
}),
|
|
42
|
-
userMessage: o || t || s("Translate the content")
|
|
43
|
-
};
|
|
44
|
-
d(!0);
|
|
45
|
-
const z = new AbortController();
|
|
46
|
-
D(z);
|
|
47
|
-
const U = { id: Date.now().toString(), role: "assistant", content: "" };
|
|
48
|
-
p((S) => [...S, T, U]), d(!0);
|
|
49
|
-
try {
|
|
50
|
-
const B = await E({ body: { action: "ASK_AI", data: {
|
|
51
|
-
messages: [T],
|
|
52
|
-
initiator: N ? "TRANSLATE_CONTENT" : "UPDATE_CONTENT"
|
|
53
|
-
} }, streamResponse: !0 });
|
|
54
|
-
if (!B.ok)
|
|
55
|
-
throw new Error(s("Failed to get AI response"));
|
|
56
|
-
const A = (v = B.body) == null ? void 0 : v.getReader(), _ = new TextDecoder();
|
|
57
|
-
let a = "";
|
|
58
|
-
if (!A) throw new Error(s("Response body is not readable"));
|
|
59
|
-
for (; ; ) {
|
|
60
|
-
const { done: C, value: J } = await A.read();
|
|
61
|
-
if (C)
|
|
62
|
-
break;
|
|
63
|
-
const K = _.decode(J, { stream: !0 });
|
|
64
|
-
a += K, p((h) => (h[h.length - 1].content = a, [...h]));
|
|
65
|
-
}
|
|
66
|
-
const q = JSON.parse(a == null ? void 0 : a.replace("```json", "").replace("```", ""));
|
|
67
|
-
I(q);
|
|
68
|
-
} catch {
|
|
69
|
-
u == null || u.abort();
|
|
70
|
-
} finally {
|
|
71
|
-
d(!1), x("");
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
return /* @__PURE__ */ i(V, { children: [
|
|
75
|
-
/* @__PURE__ */ e("div", { className: "py-2", children: /* @__PURE__ */ e(f, { fallback: /* @__PURE__ */ e("div", { children: s("Loading...") }), children: /* @__PURE__ */ e(
|
|
76
|
-
te,
|
|
77
|
-
{
|
|
78
|
-
isLoading: r,
|
|
79
|
-
selectedBlock: w,
|
|
80
|
-
selectedLang: c,
|
|
81
|
-
onClick: k
|
|
82
|
-
}
|
|
83
|
-
) }) }),
|
|
84
|
-
/* @__PURE__ */ i("div", { className: "flex-1 space-y-3 overflow-y-auto py-4", children: [
|
|
85
|
-
n.length === 0 && /* @__PURE__ */ e("div", { className: "flex-1 space-y-3 overflow-y-auto py-4", children: /* @__PURE__ */ i("div", { className: "mx-auto mt-8 text-center text-gray-500", children: [
|
|
86
|
-
/* @__PURE__ */ e(X, { size: 48, className: "mx-auto mb-4 text-gray-300" }),
|
|
87
|
-
/* @__PURE__ */ e("p", { className: "mx-auto max-w-[75%] text-sm", children: s("Start a conversation with the AI assistant to translate your content") })
|
|
88
|
-
] }) }),
|
|
89
|
-
n.map(
|
|
90
|
-
(t, o) => t.role !== "system" && /* @__PURE__ */ e(f, { fallback: /* @__PURE__ */ e("div", { children: s("Loading...") }), children: /* @__PURE__ */ e(
|
|
91
|
-
ee,
|
|
92
|
-
{
|
|
93
|
-
message: t,
|
|
94
|
-
isUser: t.role === "user",
|
|
95
|
-
isLoading: t.role === "assistant" && r && o === n.length - 1
|
|
96
|
-
}
|
|
97
|
-
) }, o)
|
|
98
|
-
),
|
|
99
|
-
F && !r && /* @__PURE__ */ e(
|
|
100
|
-
"button",
|
|
101
|
-
{
|
|
102
|
-
onClick: R,
|
|
103
|
-
className: "flex w-full items-center justify-center gap-2 rounded-lg border border-blue-200 bg-blue-50 p-1.5 text-left transition-colors hover:bg-blue-100",
|
|
104
|
-
children: /* @__PURE__ */ e("div", { className: "flex flex-col", children: /* @__PURE__ */ i("span", { className: "flex items-center gap-1 text-xs font-medium text-blue-700", children: [
|
|
105
|
-
/* @__PURE__ */ e(Y, { className: "h-4 w-4 capitalize text-blue-600" }),
|
|
106
|
-
m ? s("Start ") : "",
|
|
107
|
-
" ",
|
|
108
|
-
s("New Conversation"),
|
|
109
|
-
" ",
|
|
110
|
-
!m && /* @__PURE__ */ e("span", { className: "text-[10px] font-extralight text-blue-600", children: s("For best results") })
|
|
111
|
-
] }) })
|
|
112
|
-
}
|
|
113
|
-
),
|
|
114
|
-
/* @__PURE__ */ e("div", { ref: y })
|
|
115
|
-
] }),
|
|
116
|
-
!m && /* @__PURE__ */ e("div", { className: "border-gray-200 pb-2", children: /* @__PURE__ */ e(f, { fallback: /* @__PURE__ */ e("div", { children: s("Loading...") }), children: /* @__PURE__ */ e(
|
|
117
|
-
se,
|
|
118
|
-
{
|
|
119
|
-
input: l,
|
|
120
|
-
setInput: x,
|
|
121
|
-
onSend: k,
|
|
122
|
-
onStop: P,
|
|
123
|
-
isLoading: r,
|
|
124
|
-
selectedLang: c,
|
|
125
|
-
currentBlock: w || j,
|
|
126
|
-
disabled: (l == null ? void 0 : l.length) === 0
|
|
127
|
-
}
|
|
128
|
-
) }) })
|
|
129
|
-
] });
|
|
130
|
-
};
|
|
131
|
-
export {
|
|
132
|
-
ce as default
|
|
133
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("@chaibuilder/sdk"),B=require("lucide-react"),r=require("react"),K=require("./prompt-helper-BtijECyh.cjs"),V=r.lazy(()=>Promise.resolve().then(()=>require("./ai-panel-message-bubble-Bl-aUeU4.cjs"))),W=r.lazy(()=>Promise.resolve().then(()=>require("./ai-translation-prompt-AImJlmDg.cjs"))),G=r.lazy(()=>Promise.resolve().then(()=>require("./ai-prompt-input-D-F23bdc.cjs"))),Q=({fetch:P,input:a,messages:c,setInput:b,isLoading:n,handleStop:q,handleReset:A,setMessages:j,setIsLoading:d,selectedLang:i,currentBlock:R,fallbackLang:E,abortController:x,setAbortController:O,forceNewConversation:h,suggestNewConversation:z})=>{const{t}=u.useTranslation(),f=r.useRef(null),y=u.useSelectedBlock(),p=u.useI18nBlocks(),M=u.useStreamMultipleBlocksProps(),D=()=>{var s;(s=f.current)==null||s.scrollIntoView({behavior:"smooth"})};r.useEffect(()=>{D()},[c,n]);const g=async(s,o)=>{var v;const k=(s==null?void 0:s.toLowerCase())==="translate",w={id:Date.now().toString(),role:"user",content:K.getTranslationUserPrompt({fallbackLang:E,userInput:o||s,language:i,blocks:k?p():p(i)}),userMessage:o||s||t("Translate the content")};d(!0);const F=new AbortController;O(F);const I={id:Date.now().toString(),role:"assistant",content:""};j(N=>[...N,w,I]),d(!0);try{const S=await P({body:{action:"ASK_AI",data:{messages:[w],initiator:k?"TRANSLATE_CONTENT":"UPDATE_CONTENT"}},streamResponse:!0});if(!S.ok)throw new Error(t("Failed to get AI response"));const T=(v=S.body)==null?void 0:v.getReader(),U=new TextDecoder;let l="";if(!T)throw new Error(t("Response body is not readable"));for(;;){const{done:C,value:H}=await T.read();if(C)break;const J=U.decode(H,{stream:!0});l+=J,j(m=>(m[m.length-1].content=l,[...m]))}const _=JSON.parse(l==null?void 0:l.replace("```json","").replace("```",""));M(_)}catch{x==null||x.abort()}finally{d(!1),b("")}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-2",children:e.jsx(r.Suspense,{fallback:e.jsx("div",{children:t("Loading...")}),children:e.jsx(W,{isLoading:n,selectedBlock:y,selectedLang:i,onClick:g})})}),e.jsxs("div",{className:"flex-1 space-y-3 overflow-y-auto py-4",children:[c.length===0&&e.jsx("div",{className:"flex-1 space-y-3 overflow-y-auto py-4",children:e.jsxs("div",{className:"mx-auto mt-8 text-center text-gray-500",children:[e.jsx(B.Bot,{size:48,className:"mx-auto mb-4 text-gray-300"}),e.jsx("p",{className:"mx-auto max-w-[75%] text-sm",children:t("Start a conversation with the AI assistant to translate your content")})]})}),c.map((s,o)=>s.role!=="system"&&e.jsx(r.Suspense,{fallback:e.jsx("div",{children:t("Loading...")}),children:e.jsx(V,{message:s,isUser:s.role==="user",isLoading:s.role==="assistant"&&n&&o===c.length-1})},o)),z&&!n&&e.jsx("button",{onClick:A,className:"flex w-full items-center justify-center gap-2 rounded-lg border border-blue-200 bg-blue-50 p-1.5 text-left transition-colors hover:bg-blue-100",children:e.jsx("div",{className:"flex flex-col",children:e.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-blue-700",children:[e.jsx(B.Plus,{className:"h-4 w-4 capitalize text-blue-600"}),h?t("Start "):""," ",t("New Conversation")," ",!h&&e.jsx("span",{className:"text-[10px] font-extralight text-blue-600",children:t("For best results")})]})})}),e.jsx("div",{ref:f})]}),!h&&e.jsx("div",{className:"border-gray-200 pb-2",children:e.jsx(r.Suspense,{fallback:e.jsx("div",{children:t("Loading...")}),children:e.jsx(G,{input:a,setInput:b,onSend:g,onStop:q,isLoading:n,selectedLang:i,currentBlock:y||R,disabled:(a==null?void 0:a.length)===0})})})]})};exports.default=Q;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-C64wG61b.cjs"),i=require("@chaibuilder/sdk"),n=require("lucide-react"),o=({selectedLang:l,isLoading:r,selectedBlock:c,onClick:a})=>{const{t:s}=i.useTranslation();return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"relative rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-800",children:[e.jsxs("div",{className:"flex items-center gap-2 text-amber-900",children:[e.jsx(n.LanguagesIcon,{className:"h-3 w-3"}),e.jsx("span",{className:"text-xs leading-none",children:s("Selected Language:")}),e.jsx("span",{className:"text-[12px] font-medium leading-none",children:t.LANGUAGES[l]})]}),e.jsx("p",{className:"pt-2 font-medium leading-none",children:s("Content Translation Mode")}),e.jsx("p",{className:"mt-1 text-xs",children:e.jsxs("ul",{className:"list-disc pl-4",children:[e.jsx("li",{children:s("When not using default language, only text content can be edited.")}),e.jsx("li",{children:s("Switch to the default language to modify layout and styling.")})]})}),e.jsx("div",{className:"mt-1",children:e.jsx(t.LanguageSwitcher,{showAdd:!1,variant:"outline",goToDefaultLang:!0})})]}),e.jsx("div",{className:`flex flex-col gap-2 ${r?"pointer-events-none opacity-50":""}`,children:c?e.jsx("button",{onClick:()=>a("TRANSLATE"),className:"flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 p-2 text-left transition-colors hover:bg-green-100",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("span",{className:"flex items-center gap-x-2 text-sm font-medium text-green-700",children:[e.jsx(n.CheckCircle,{className:"h-4 w-4 text-green-600"})," Translate Selected Block"]}),e.jsxs("span",{className:"pl-6 text-xs text-green-600",children:["Convert current block to ",t.LANGUAGES[l]]})]})}):e.jsx("button",{onClick:()=>a("TRANSLATE"),className:"flex items-center gap-2 rounded-lg border border-purple-200 bg-purple-50 p-2 text-left transition-colors hover:bg-purple-100",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("span",{className:"flex items-center gap-x-2 text-sm font-medium text-purple-700",children:[e.jsx(n.Plus,{className:"h-4 w-4 text-purple-600"})," Translate Entire Page"]}),e.jsxs("span",{className:"pl-6 text-xs text-purple-600",children:["Convert all content to ",t.LANGUAGES[l]]})]})})})]})};exports.default=o;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { L as n, aj as c } from "./index-D_qadcqD.js";
|
|
3
|
-
import { useTranslation as i } from "@chaibuilder/sdk";
|
|
4
|
-
import { LanguagesIcon as d, CheckCircle as m, Plus as p } from "lucide-react";
|
|
5
|
-
const f = ({
|
|
6
|
-
selectedLang: a,
|
|
7
|
-
isLoading: s,
|
|
8
|
-
selectedBlock: o,
|
|
9
|
-
onClick: r
|
|
10
|
-
}) => {
|
|
11
|
-
const { t: l } = i();
|
|
12
|
-
return /* @__PURE__ */ t("div", { className: "flex flex-col gap-2", children: [
|
|
13
|
-
/* @__PURE__ */ t("div", { className: "relative rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-800", children: [
|
|
14
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-2 text-amber-900", children: [
|
|
15
|
-
/* @__PURE__ */ e(d, { className: "h-3 w-3" }),
|
|
16
|
-
/* @__PURE__ */ e("span", { className: "text-xs leading-none", children: l("Selected Language:") }),
|
|
17
|
-
/* @__PURE__ */ e("span", { className: "text-[12px] font-medium leading-none", children: n[a] })
|
|
18
|
-
] }),
|
|
19
|
-
/* @__PURE__ */ e("p", { className: "pt-2 font-medium leading-none", children: l("Content Translation Mode") }),
|
|
20
|
-
/* @__PURE__ */ e("p", { className: "mt-1 text-xs", children: /* @__PURE__ */ t("ul", { className: "list-disc pl-4", children: [
|
|
21
|
-
/* @__PURE__ */ e("li", { children: l("When not using default language, only text content can be edited.") }),
|
|
22
|
-
/* @__PURE__ */ e("li", { children: l("Switch to the default language to modify layout and styling.") })
|
|
23
|
-
] }) }),
|
|
24
|
-
/* @__PURE__ */ e("div", { className: "mt-1", children: /* @__PURE__ */ e(c, { showAdd: !1, variant: "outline", goToDefaultLang: !0 }) })
|
|
25
|
-
] }),
|
|
26
|
-
/* @__PURE__ */ e("div", { className: `flex flex-col gap-2 ${s ? "pointer-events-none opacity-50" : ""}`, children: o ? /* @__PURE__ */ e(
|
|
27
|
-
"button",
|
|
28
|
-
{
|
|
29
|
-
onClick: () => r("TRANSLATE"),
|
|
30
|
-
className: "flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 p-2 text-left transition-colors hover:bg-green-100",
|
|
31
|
-
children: /* @__PURE__ */ t("div", { className: "flex flex-col", children: [
|
|
32
|
-
/* @__PURE__ */ t("span", { className: "flex items-center gap-x-2 text-sm font-medium text-green-700", children: [
|
|
33
|
-
/* @__PURE__ */ e(m, { className: "h-4 w-4 text-green-600" }),
|
|
34
|
-
" Translate Selected Block"
|
|
35
|
-
] }),
|
|
36
|
-
/* @__PURE__ */ t("span", { className: "pl-6 text-xs text-green-600", children: [
|
|
37
|
-
"Convert current block to ",
|
|
38
|
-
n[a]
|
|
39
|
-
] })
|
|
40
|
-
] })
|
|
41
|
-
}
|
|
42
|
-
) : /* @__PURE__ */ e(
|
|
43
|
-
"button",
|
|
44
|
-
{
|
|
45
|
-
onClick: () => r("TRANSLATE"),
|
|
46
|
-
className: "flex items-center gap-2 rounded-lg border border-purple-200 bg-purple-50 p-2 text-left transition-colors hover:bg-purple-100",
|
|
47
|
-
children: /* @__PURE__ */ t("div", { className: "flex flex-col", children: [
|
|
48
|
-
/* @__PURE__ */ t("span", { className: "flex items-center gap-x-2 text-sm font-medium text-purple-700", children: [
|
|
49
|
-
/* @__PURE__ */ e(p, { className: "h-4 w-4 text-purple-600" }),
|
|
50
|
-
" Translate Entire Page"
|
|
51
|
-
] }),
|
|
52
|
-
/* @__PURE__ */ t("span", { className: "pl-6 text-xs text-purple-600", children: [
|
|
53
|
-
"Convert all content to ",
|
|
54
|
-
n[a]
|
|
55
|
-
] })
|
|
56
|
-
] })
|
|
57
|
-
}
|
|
58
|
-
) })
|
|
59
|
-
] });
|
|
60
|
-
};
|
|
61
|
-
export {
|
|
62
|
-
f as default
|
|
63
|
-
};
|