@chaibuilder/sdk 4.0.0-beta.6 → 4.0.0-beta.8
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/README.md +73 -50
- package/dist/{2SSKDMRQ-BIryEtW-.cjs → 2SSKDMRQ-DHv4u_0i.cjs} +1 -1
- package/dist/{2SSKDMRQ-trME0kvt.js → 2SSKDMRQ-DewwiCoQ.js} +2 -2
- package/dist/{AP7HFJJL-CAGB9iMp.js → AP7HFJJL-ComnZw7J.js} +1 -1
- package/dist/{AP7HFJJL-5ZR38Hyh.cjs → AP7HFJJL-cz754qhG.cjs} +1 -1
- package/dist/{IconPicker-Mu75ni5T.js → IconPicker-2H9IGKMS.js} +2 -2
- package/dist/{IconPicker-CQ-BgNNU.cjs → IconPicker-U0Z2dWeR.cjs} +1 -1
- package/dist/{WDYDFRGG-n8sBZVFG.cjs → WDYDFRGG-BfRX3M58.cjs} +1 -1
- package/dist/{WDYDFRGG-Cd4hRWj-.js → WDYDFRGG-vy7nMYD4.js} +2 -2
- package/dist/{actions-registery-JdxhXhT6.cjs → actions-registery-CtQSSexG.cjs} +31 -31
- package/dist/{actions-registery-y_ENc8zj.js → actions-registery-DqrFhSMp.js} +2414 -2418
- package/dist/actions.cjs +1 -1
- package/dist/actions.d.ts +0 -34
- package/dist/actions.js +3 -3
- package/dist/{active-in-another-tab-Cb6tnX9u.js → active-in-another-tab-5hn17Jeq.js} +3 -3
- package/dist/{active-in-another-tab-CZLV-uAW.cjs → active-in-another-tab-ijahI5qu.cjs} +1 -1
- package/dist/{add-new-language-page-BKcBaqZu.js → add-new-language-page-DmOyPy0u.js} +4 -4
- package/dist/{add-new-language-page-C3UzNV7W.cjs → add-new-language-page-vmNKNx-e.cjs} +1 -1
- package/dist/{add-new-page-pH3PwqJe.js → add-new-page-NHScAQn8.js} +2 -2
- package/dist/{add-new-page-mULv9r3z.cjs → add-new-page-XDuCkOyb.cjs} +1 -1
- package/dist/{ai-panel-content-BPgRdgye.cjs → ai-panel-content-BDqW16AW.cjs} +1 -1
- package/dist/{ai-panel-content-CNxN84pv.js → ai-panel-content-CHJ0JcQI.js} +4 -4
- package/dist/{ai-panel-default-lang-CYcHjk8U.js → ai-panel-default-lang-BIomgsN0.js} +4 -4
- package/dist/{ai-panel-default-lang-DhTPtPgD.cjs → ai-panel-default-lang-HeYWpbMu.cjs} +2 -2
- package/dist/{ai-panel-other-lang-CGNU3-FI.cjs → ai-panel-other-lang-BMelEs3p.cjs} +1 -1
- package/dist/{ai-panel-other-lang-D8Ofvj8F.js → ai-panel-other-lang-CbAgG-qX.js} +3 -3
- package/dist/{ai-prompt-input-Ceuy5bs3.js → ai-prompt-input-BH8LOVT4.js} +2 -2
- package/dist/{ai-prompt-input-CUutJjlf.cjs → ai-prompt-input-C_GG6nwq.cjs} +1 -1
- package/dist/{ai-translation-prompt-CoCPLEed.cjs → ai-translation-prompt-CkHaFv5I.cjs} +1 -1
- package/dist/{ai-translation-prompt-BiepZRcN.js → ai-translation-prompt-DxsNw8YR.js} +2 -2
- package/dist/{code-display-DloSPyPr.cjs → code-display-9Onx6RCq.cjs} +1 -1
- package/dist/{code-display-Ck81Id9K.js → code-display-oa1j0ri7.js} +1 -1
- package/dist/{code-editor-Z14ByBIv.js → code-editor-CGBAc-A6.js} +1 -1
- package/dist/{code-editor-C1ewJzDJ.cjs → code-editor-GV8ibQ4h.cjs} +1 -1
- package/dist/{continue-editing-in-this-client-k9Ab5E63.cjs → continue-editing-in-this-client-DKHP0pq8.cjs} +1 -1
- package/dist/{continue-editing-in-this-client-Byi6ER3L.js → continue-editing-in-this-client-Da8ab_9d.js} +3 -3
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -90
- package/dist/core.js +22 -34
- package/dist/css-import-modal-B4j26_cO.cjs +13 -0
- package/dist/{css-import-modal-De7Kvg5C.js → css-import-modal-CcZVLsF9.js} +5 -4
- package/dist/{delete-design-token-C6s-ESB_.cjs → delete-design-token-3-WwqXMO.cjs} +1 -1
- package/dist/{delete-design-token-B97CnFDU.js → delete-design-token-DzINIVtO.js} +1 -1
- package/dist/{delete-page-Djn97HiP.cjs → delete-page-B7ODELqM.cjs} +1 -1
- package/dist/{delete-page-Dnf97ZHP.js → delete-page-DwZDMwfI.js} +3 -3
- package/dist/{design-token-usage-B-SykAjD.js → design-token-usage-DQf180Lg.js} +2 -2
- package/dist/{design-token-usage-OTd93kS8.cjs → design-token-usage-Dy08kcIc.cjs} +1 -1
- package/dist/{digital-asset-manager-DHYRXaaq.cjs → digital-asset-manager-C7subULa.cjs} +1 -1
- package/dist/{digital-asset-manager-b8gDuLnI.js → digital-asset-manager-CDy9kHZO.js} +4 -4
- package/dist/{duplicate-page-C4Ovp8Ff.cjs → duplicate-page-CWQ9aMd9.cjs} +1 -1
- package/dist/{duplicate-page-Bdtpl7_R.js → duplicate-page-DTnSztlr.js} +4 -4
- package/dist/{dynamic-page-selector-B8DdnfrF.cjs → dynamic-page-selector-DJuxLcsM.cjs} +1 -1
- package/dist/{dynamic-page-selector-BVnIM1Rq.js → dynamic-page-selector-DYW3ov_u.js} +3 -3
- package/dist/{image-editor-C2zOHeKv.cjs → image-editor-C4H3AkZK.cjs} +1 -1
- package/dist/{image-editor-cckqPmk5.js → image-editor-DLeSST0K.js} +1 -1
- package/dist/{index-CAhEmHYP.js → index-BK0xWO1z.js} +5212 -5680
- package/dist/index-BRJCj7c_.cjs +5 -0
- package/dist/index-Bm8iS2OH.cjs +160 -0
- package/dist/{index-Bn0fFN58.js → index-D5d4QDq7.js} +520 -511
- package/dist/{json-diff-viewer-DNizzMnu.js → json-diff-viewer-BYHieVod.js} +3 -3
- package/dist/{json-diff-viewer-D9DVIBz4.cjs → json-diff-viewer-g6SY62bl.cjs} +1 -1
- package/dist/{lang-panel-DL_BtSRD.js → lang-panel-BG1GMn-1.js} +4 -4
- package/dist/{lang-panel-C1dbn163.cjs → lang-panel-Dm1eOO2J.cjs} +1 -1
- package/dist/{manage-design-tokens-xxMO_RYg.js → manage-design-tokens-BdWQUHhw.js} +3 -3
- package/dist/{manage-design-tokens-CXjYkarE.cjs → manage-design-tokens-XWs_B6jo.cjs} +1 -1
- package/dist/{mark-as-template-Ba2bmVd9.js → mark-as-template-D2XxagVO.js} +3 -3
- package/dist/{mark-as-template-DF1KIMr0.cjs → mark-as-template-DUFnfVM3.cjs} +1 -1
- package/dist/{nested-path-selector-content-Cuk7NB-u.cjs → nested-path-selector-content-CQOx2L9C.cjs} +1 -1
- package/dist/{nested-path-selector-content-Br1IWhK5.js → nested-path-selector-content-Wd6-Eql0.js} +2 -2
- package/dist/{no-language-page-content-9B2Fm-on.js → no-language-page-content-BOv6TZIk.js} +3 -3
- package/dist/{no-language-page-content-CxTp-LIM.cjs → no-language-page-content-C11uF6hs.cjs} +1 -1
- package/dist/{no-language-page-dialog-DynACvgV.cjs → no-language-page-dialog-CY5XhXsC.cjs} +1 -1
- package/dist/{no-language-page-dialog-CPlKMyb8.js → no-language-page-dialog-DIXyKRJq.js} +2 -2
- package/dist/{page-creator-BtyJz2sx.js → page-creator-WX9lMrJY.js} +4 -4
- package/dist/{page-creator-Cbfv9N0P.cjs → page-creator-zSUFF4eT.cjs} +1 -1
- package/dist/{page-lock-CzsxrmN5.js → page-lock-D9miLZjm.js} +2 -2
- package/dist/{page-lock-fRos9wRU.cjs → page-lock-DGhR_url.cjs} +1 -1
- package/dist/{page-locked-dialog-D2q9qkPk.js → page-locked-dialog-CNCUCcvH.js} +3 -3
- package/dist/{page-locked-dialog-D57d2gvn.cjs → page-locked-dialog-DTLnbfuP.cjs} +1 -1
- package/dist/{page-manager-new-D6DVIx2S.js → page-manager-new-BFFOLh-l.js} +4 -4
- package/dist/{page-manager-new-aE198gKS.cjs → page-manager-new-Dd2c-Q_O.cjs} +1 -1
- package/dist/{page-manager-search-and-filter-DGQEgKzy.cjs → page-manager-search-and-filter-BKdQUJ2W.cjs} +1 -1
- package/dist/{page-manager-search-and-filter-CuZkQaZg.js → page-manager-search-and-filter-C1IWF_4d.js} +3 -3
- package/dist/page-revisions-content-D0cflnj1.cjs +1 -0
- package/dist/{page-revisions-content-5rbicFbD.js → page-revisions-content-DHapiLck.js} +75 -67
- package/dist/pages.cjs +1 -1
- package/dist/pages.d.ts +2 -1
- package/dist/pages.js +1 -1
- package/dist/{publish-pages-content-WeGk-YLC.js → publish-pages-content-Bd2zJHtK.js} +4 -4
- package/dist/{publish-pages-content-DBb8M3TG.cjs → publish-pages-content-BqLcnKry.cjs} +1 -1
- package/dist/{register-chai-top-bar-ESJHs5s-.js → register-chai-top-bar-CX_JkRJn.js} +78 -78
- package/dist/register-chai-top-bar-DWTuRU53.cjs +1 -0
- package/dist/render.d.ts +2 -1
- package/dist/{rte-widget-modal-DBoPRXq-.cjs → rte-widget-modal-DiB5BjH1.cjs} +1 -1
- package/dist/{rte-widget-modal-J-_AytmK.js → rte-widget-modal-RS8PMKOn.js} +7 -7
- package/dist/runtime-client.cjs +1 -0
- package/dist/runtime-client.d.ts +158 -0
- package/dist/runtime-client.js +32 -0
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.ts +1 -163
- package/dist/runtime.js +71 -72
- package/dist/{save-to-lib-CQQxoovF.js → save-to-lib--6ZXHEbC.js} +3 -3
- package/dist/{save-to-lib-0ysmXVbI.cjs → save-to-lib-BXJvaC1N.cjs} +1 -1
- package/dist/{selected-block-display-BWupQFoQ.cjs → selected-block-display-BfpJda4h.cjs} +1 -1
- package/dist/{selected-block-display-CgoXS8Hr.js → selected-block-display-CUnCqXQw.js} +3 -3
- package/dist/{seo-panel-B798Myp_.js → seo-panel-Bs-FcY1A.js} +3 -3
- package/dist/{seo-panel-BkFbXIL0.cjs → seo-panel-CQITMfZ6.cjs} +1 -1
- package/dist/{shared-json-ld-Clg_UEhd.js → shared-json-ld-7EujD341.js} +3 -3
- package/dist/{shared-json-ld-Cn3MCW6I.cjs → shared-json-ld-DDXXi-Mj.cjs} +1 -1
- package/dist/{slug-input-BHyD8cxk.cjs → slug-input-CsVJAr7r.cjs} +1 -1
- package/dist/{slug-input-hX5VaZpj.js → slug-input-DoEIq5rs.js} +2 -2
- package/dist/supabase-actions.cjs +1 -1
- package/dist/supabase-actions.d.ts +5 -0
- package/dist/supabase-actions.js +1 -1
- package/dist/{take-over-request-s1L5Yofb.js → take-over-request-C14kJ356.js} +3 -3
- package/dist/{take-over-request-Dzczo20q.cjs → take-over-request-D5Oo3MPo.cjs} +1 -1
- package/dist/{theme-panel-footer-sK6bYhEb.js → theme-panel-footer-Dvknelm8.js} +3 -3
- package/dist/{theme-panel-footer-NTNCL0SW.cjs → theme-panel-footer-Eeibz2JA.cjs} +1 -1
- package/dist/{translation-warning-modal-BfM4HGck.cjs → translation-warning-modal-CPzdHzqq.cjs} +1 -1
- package/dist/{translation-warning-modal-Jadkcver.js → translation-warning-modal-YlzP2XoO.js} +2 -2
- package/dist/{unmark-as-template-CqkHI3gR.cjs → unmark-as-template-BGDwuCnv.cjs} +1 -1
- package/dist/{unmark-as-template-D5b775eR.js → unmark-as-template-CPJvQk7L.js} +3 -3
- package/dist/{unpublish-page-BT5bCfs6.cjs → unpublish-page-BMowW5wT.cjs} +1 -1
- package/dist/{unpublish-page-DLLLgY43.js → unpublish-page-DlFHLlmI.js} +3 -3
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +43 -43
- package/dist/{web-preview-C_yFwxEe.js → web-preview-BUnv3jIc.js} +2 -2
- package/dist/{web-preview-DU1MgppY.cjs → web-preview-D8GQHCjs.cjs} +1 -1
- package/package.json +29 -30
- package/dist/css-import-modal--bSJR-_y.cjs +0 -13
- package/dist/index-B-rSiAp_.cjs +0 -1
- package/dist/index-B0e71wJ1.cjs +0 -160
- package/dist/index-DKuwxj1x.cjs +0 -5
- package/dist/index-Dxfyt4d4.js +0 -39
- package/dist/page-revisions-content-CefqOvKX.cjs +0 -1
- package/dist/register-chai-top-bar-BqwKw4uy.cjs +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as d, createElement as m } from "react";
|
|
3
|
-
import { B as s } from "./register-chai-top-bar-
|
|
3
|
+
import { B as s } from "./register-chai-top-bar-CX_JkRJn.js";
|
|
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-D5d4QDq7.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"),l=require("react"),a=require("./register-chai-top-bar-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),a=require("./register-chai-top-bar-DWTuRU53.cjs"),u=require("jotai"),x=require("lodash-es"),n=require("lucide-react"),c=require("./index-BRJCj7c_.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:o,setIframeWidth:r})=>e.jsx(a.Button,{className:"px-3 py-3",onClick:()=>r(s),variant:s===t?"default":"ghost",children:o}),p=()=>{const[t,s]=l.useState(1200),o=i=>s(i),[r,d]=u.useAtom(c.previewUrlAtom);if(!r)return null;const h=()=>{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,i=>l.createElement(w,{...i,setIframeWidth:o,key:i.title,currentWidth:t}))})," ",e.jsx(c.Tooltip,{content:"Exit Preview",delayDuration:0,children:e.jsx(a.Button,{variant:"destructive",size:"sm",onClick:h,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",fillRule:"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:r})]})};exports.default=p;
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"author": "Suraj Air",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"homepage": "https://chaibuilder.com",
|
|
8
|
-
"version": "4.0.0-beta.
|
|
8
|
+
"version": "4.0.0-beta.8",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -16,25 +16,6 @@
|
|
|
16
16
|
],
|
|
17
17
|
"main": "dist/core.js",
|
|
18
18
|
"sideEffects": false,
|
|
19
|
-
"scripts": {
|
|
20
|
-
"dev": "vite",
|
|
21
|
-
"build": "tsc && vite build",
|
|
22
|
-
"live": "tsc && vite build --config vite.config.live.ts",
|
|
23
|
-
"live:serve": "cd live && npx http-server -p 8080",
|
|
24
|
-
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
25
|
-
"lint:errors": "eslint . --ext ts,tsx --quiet --max-warnings 0",
|
|
26
|
-
"lint:warnings": "eslint . --ext ts,tsx --min-warnings 1",
|
|
27
|
-
"preview": "vite preview",
|
|
28
|
-
"test": "vitest --run",
|
|
29
|
-
"test:watch": "vitest --watch",
|
|
30
|
-
"test:coverage": "vitest --coverage",
|
|
31
|
-
"e2e": "playwright test",
|
|
32
|
-
"e2e:report": "playwright show-report",
|
|
33
|
-
"e2e:ui": "playwright test --ui",
|
|
34
|
-
"docs:api": "typedoc",
|
|
35
|
-
"docs:serve": "docsify serve docs",
|
|
36
|
-
"prepare": "husky"
|
|
37
|
-
},
|
|
38
19
|
"exports": {
|
|
39
20
|
".": {
|
|
40
21
|
"types": "./dist/core.d.ts",
|
|
@@ -66,6 +47,11 @@
|
|
|
66
47
|
"import": "./dist/runtime.js",
|
|
67
48
|
"require": "./dist/runtime.cjs"
|
|
68
49
|
},
|
|
50
|
+
"./runtime/client": {
|
|
51
|
+
"types": "./dist/runtime-client.d.ts",
|
|
52
|
+
"import": "./dist/runtime-client.js",
|
|
53
|
+
"require": "./dist/runtime-client.cjs"
|
|
54
|
+
},
|
|
69
55
|
"./actions/supabase": {
|
|
70
56
|
"types": "./dist/supabase-actions.d.ts",
|
|
71
57
|
"import": "./dist/supabase-actions.js",
|
|
@@ -82,17 +68,15 @@
|
|
|
82
68
|
}
|
|
83
69
|
},
|
|
84
70
|
"peerDependencies": {
|
|
85
|
-
"@supabase/supabase-js": "^2.
|
|
71
|
+
"@supabase/supabase-js": "^2.90.1",
|
|
86
72
|
"@types/react": "*",
|
|
87
73
|
"@types/react-dom": "*",
|
|
88
74
|
"ai": "^6.0.11",
|
|
89
75
|
"drizzle-orm": "^0.45.1",
|
|
90
|
-
"next": "16.1.1",
|
|
91
76
|
"postgres": "^3.4.8",
|
|
92
77
|
"react": "^18.0 || ^19.0 || ^19.1 || ^19.2",
|
|
93
78
|
"react-dom": "^18.0 || ^19.0 || ^19.1 || ^19.2",
|
|
94
|
-
"sharp": "^0.34.5"
|
|
95
|
-
"streamdown": "^1.6.10"
|
|
79
|
+
"sharp": "^0.34.5"
|
|
96
80
|
},
|
|
97
81
|
"peerDependenciesMeta": {
|
|
98
82
|
"@types/react": {
|
|
@@ -110,9 +94,6 @@
|
|
|
110
94
|
"ai": {
|
|
111
95
|
"optional": true
|
|
112
96
|
},
|
|
113
|
-
"streamdown": {
|
|
114
|
-
"optional": true
|
|
115
|
-
},
|
|
116
97
|
"sharp": {
|
|
117
98
|
"optional": true
|
|
118
99
|
},
|
|
@@ -208,6 +189,7 @@
|
|
|
208
189
|
"react-i18next": "16.0.0",
|
|
209
190
|
"react-wrap-balancer": "^1.1.1",
|
|
210
191
|
"sonner": "^2.0.7",
|
|
192
|
+
"streamdown": "^1.6.10",
|
|
211
193
|
"tailwind-merge": "^3.4.0",
|
|
212
194
|
"tree-model": "^1.0.7",
|
|
213
195
|
"undo-manager": "1.1.1",
|
|
@@ -221,7 +203,7 @@
|
|
|
221
203
|
"@faker-js/faker": "^9.9.0",
|
|
222
204
|
"@microsoft/clarity": "^1.0.2",
|
|
223
205
|
"@playwright/test": "^1.57.0",
|
|
224
|
-
"@supabase/supabase-js": "^2.
|
|
206
|
+
"@supabase/supabase-js": "^2.90.1",
|
|
225
207
|
"@tanstack/eslint-plugin-query": "^5.91.2",
|
|
226
208
|
"@tanstack/react-query-devtools": "^5.91.2",
|
|
227
209
|
"@testing-library/react": "^16.3.1",
|
|
@@ -266,7 +248,6 @@
|
|
|
266
248
|
"react-router-dom": "^7.11.0",
|
|
267
249
|
"shadcn": "2.3.0",
|
|
268
250
|
"sharp": "^0.34.5",
|
|
269
|
-
"streamdown": "^1.6.10",
|
|
270
251
|
"tailwindcss": "^3.4.19",
|
|
271
252
|
"ts-jest": "^29.4.6",
|
|
272
253
|
"ts-node": "^10.9.2",
|
|
@@ -282,5 +263,23 @@
|
|
|
282
263
|
},
|
|
283
264
|
"engines": {
|
|
284
265
|
"node": ">=21.0.0"
|
|
266
|
+
},
|
|
267
|
+
"scripts": {
|
|
268
|
+
"dev": "vite",
|
|
269
|
+
"build": "tsc && vite build",
|
|
270
|
+
"live": "tsc && vite build --config vite.config.live.ts",
|
|
271
|
+
"live:serve": "cd live && npx http-server -p 8080",
|
|
272
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
273
|
+
"lint:errors": "eslint . --ext ts,tsx --quiet --max-warnings 0",
|
|
274
|
+
"lint:warnings": "eslint . --ext ts,tsx --min-warnings 1",
|
|
275
|
+
"preview": "vite preview",
|
|
276
|
+
"test": "vitest --run",
|
|
277
|
+
"test:watch": "vitest --watch",
|
|
278
|
+
"test:coverage": "vitest --coverage",
|
|
279
|
+
"e2e": "playwright test",
|
|
280
|
+
"e2e:report": "playwright show-report",
|
|
281
|
+
"e2e:ui": "playwright test --ui",
|
|
282
|
+
"docs:api": "typedoc",
|
|
283
|
+
"docs:serve": "docsify serve docs"
|
|
285
284
|
}
|
|
286
|
-
}
|
|
285
|
+
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),y=require("./register-chai-top-bar-BqwKw4uy.cjs"),f=require("./index-B0e71wJ1.cjs"),T=require("culori"),V=require("./fonts-B-Xt29pe.cjs"),N=require("react"),R=require("react-i18next");function j(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const b=j(T),C=j(N),d=e=>e?e%1===0?e:e.toFixed(4):"0",E=e=>`hsl(${d(e.h)} ${d(e.s*100)}% ${d(e.l*100)}%)`,I=(e,o="hsl",t="4")=>{try{const r=b.parse(e);if(!r)throw new Error("Invalid color input");switch(o){case"hsl":{const s=b.converter("hsl")(r);return t==="4"?E(s):`${d(s.h)} ${d(s.s*100)}% ${d(s.l*100)}%`}case"rgb":return b.formatRgb(r);case"oklch":{const s=b.converter("oklch")(r);return`oklch(${d(s.l)} ${d(s.c)} ${d(s.h)})`}case"hex":return b.formatHex(r);default:return e}}catch(r){return console.error(`Failed to convert color: ${e}`,r),e}},x=e=>I(e,"hex"),q=e=>{const o={fontFamily:{heading:"",body:""},borderRadius:"",colors:{}};try{const t=w(e);if(!t.isValid)return console.warn("CSS validation failed:",t.error),$();const r=v(e,":root"),s=v(e,".dark"),c=u(r,"--font-sans")||u(r,"--font-family")||u(r,"--font-heading")||u(r,"--font-body"),a=D(c);o.fontFamily={heading:a,body:a};const h=u(r,"--radius")||u(r,"--border-radius")||"0.5rem";o.borderRadius=P(h),["background","foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","destructive","destructive-foreground","border","input","ring","card","card-foreground","popover","popover-foreground"].forEach(i=>{const p=u(r,`--${i}`),g=u(s,`--${i}`);if(p||g){const l=p?k(p):"#000000",S=g?k(g):l;o.colors[i]=[l,S]}})}catch(t){return console.error("Error parsing CSS to ChaiThemeValues:",t),$()}return o},v=(e,o)=>{var r,s;const t=new RegExp(`${F(o)}\\s*{([^}]+)}`);return((s=(r=e.match(t))==null?void 0:r[1])==null?void 0:s.trim())||null},u=(e,o)=>{var s;if(!e)return null;const t=new RegExp(`${F(o)}\\s*:\\s*([^;]+)`),r=e.match(t);return((s=r==null?void 0:r[1])==null?void 0:s.trim())||null},k=e=>{if(!e||typeof e!="string")return"#000000";try{const o=e.replace(/var\([^)]+\)/g,"").trim();if(!o)return"#000000";if(/^[a-z]+$/i.test(o))return x(o)||"#000000";if(/^#?([0-9A-F]{3,4}|[0-9A-F]{6}|[0-9A-F]{8})$/i.test(o.replace(/#/g,""))){const r=o.startsWith("#")?o:`#${o}`;return r.length<=5?`#${r.slice(1).split("").map(s=>s+s).join("")}`.slice(0,7):r.length>7?r.slice(0,7):r}if(/^(rgb|hsl|oklch)a?\(/i.test(o))return x(o)||"#000000";const t=o.match(/^(\d+\.?\d*)\s+(\d+\.?\d*)%\s+(\d+\.?\d*)%$/);if(t){const[,r,s,c]=t,a=`hsl(${r} ${s}% ${c}%)`;return x(a)||"#000000"}if(/^[\d.]+[\s,]+[\d.]+[\s,]+[\d.]+(?:[\s,/]+[\d.]+)?$/.test(o)){const r=o.split(/[\s,]+/).filter(Boolean);if(r.length>=3){const c=r.some(a=>a.includes("%"))?`hsl(${r[0]} ${r[1]} ${r[2]})`:`rgb(${r[0]}, ${r[1]}, ${r[2]})`;return x(c)||"#000000"}}return x(o)||"#000000"}catch(o){return console.warn("Failed to process color:",e,o),"#000000"}},D=e=>{const o=V.getAllRegisteredFonts();if(!e)return"ui-sans-serif, system-ui, sans-serif";try{const r=e.replace(/["']/g,"").trim().split(",")[0].trim(),s=o.find(c=>c.family.toLowerCase()===r.toLowerCase());return(s==null?void 0:s.family)||"ui-sans-serif, system-ui, sans-serif"}catch(t){return console.warn("Error processing font family:",e,t),"ui-sans-serif, system-ui, sans-serif"}},P=e=>{try{const o=e.trim();if(o.endsWith("px"))return o;if(o.endsWith("rem")){const r=parseFloat(o.replace("rem",""));if(!isNaN(r))return`${Math.round(r*16)}px`}if(o.endsWith("em")){const r=parseFloat(o.replace("em",""));if(!isNaN(r))return`${Math.round(r*16)}px`}const t=parseFloat(o);return isNaN(t)?"8px":`${Math.round(t)}px`}catch(o){return console.warn("Error converting border radius to px:",e,o),"8px"}},$=()=>({fontFamily:{heading:"ui-sans-serif, system-ui, sans-serif",body:"ui-sans-serif, system-ui, sans-serif"},borderRadius:"8px",colors:{background:["#ffffff","#000000"],foreground:["#000000","#ffffff"],primary:["#3b82f6","#60a5fa"],"primary-foreground":["#ffffff","#1e293b"],secondary:["#f1f5f9","#334155"],"secondary-foreground":["#0f172a","#f8fafc"],muted:["#f8fafc","#1e293b"],"muted-foreground":["#64748b","#94a3b8"],accent:["#f1f5f9","#334155"],"accent-foreground":["#0f172a","#f8fafc"],destructive:["#ef4444","#f87171"],"destructive-foreground":["#ffffff","#1e293b"],border:["#e2e8f0","#475569"],input:["#e2e8f0","#475569"],ring:["#3b82f6","#60a5fa"],card:["#ffffff","#0f172a"],"card-foreground":["#000000","#f8fafc"],popover:["#ffffff","#0f172a"],"popover-foreground":["#000000","#f8fafc"]}}),F=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),B=e=>["background","foreground","primary","primary-foreground"].every(r=>e.colors[r]&&Array.isArray(e.colors[r])&&e.colors[r].length>=2)&&!!e.fontFamily.heading&&!!e.fontFamily.body&&!!e.borderRadius,w=e=>{if(!e||typeof e!="string")return{isValid:!1,error:"Please enter valid CSS content"};const o=e.trim();if(!o)return{isValid:!1,error:"Please enter CSS content"};try{if(!o.includes("{")||!o.includes("}"))return{isValid:!1,error:"Invalid CSS format. CSS should contain proper block structure with { }"};const t=(o.match(/{/g)||[]).length,r=(o.match(/}/g)||[]).length;return t!==r?{isValid:!1,error:"Invalid CSS format. Unmatched braces detected"}:!o.includes("--")||!o.includes(":")?{isValid:!1,error:"Invalid CSS format. CSS should contain variable definitions like --primary: #color"}:!o.includes(":root")&&!o.includes(".dark")?{isValid:!1,error:"CSS should contain at least :root or .dark selector with theme variables"}:{isValid:!0}}catch(t){return console.error("CSS validation error:",t),{isValid:!1,error:"Failed to parse CSS. Please check your syntax."}}},M=`:root {
|
|
2
|
-
--background: 0 0% 100%;
|
|
3
|
-
--foreground: oklch(0.52 0.13 144.17);
|
|
4
|
-
--primary: #3e2723;
|
|
5
|
-
--primary-foreground: #ffffff;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.dark {
|
|
9
|
-
--background: 222.2 84% 4.9%;
|
|
10
|
-
--foreground: hsl(37.50 36.36% 95.69%);
|
|
11
|
-
--primary: rgb(46, 125, 50);
|
|
12
|
-
--primary-foreground: #ffffff;
|
|
13
|
-
}`,_=({open:e,onOpenChange:o,onImport:t})=>{const[r,s]=C.useState(""),[c,a]=C.useState(null),[h,m]=C.useState(!1),{t:i}=R.useTranslation(),p=async()=>{m(!0),a(null);try{const l=w(r);if(!l.isValid){a(l.error||i("Invalid CSS format")),setTimeout(()=>{a(null)},5e3),m(!1);return}const S=q(r);if(!B(S)){a(i("The CSS doesn't contain enough theme information. Please ensure it includes at least background, foreground, primary, and primary-foreground colors.")),setTimeout(()=>{a(null)},5e3),m(!1);return}t(S),s(""),a(null),o(!1)}catch(l){console.error("Error importing CSS:",l),a(i("Failed to parse CSS. Please check your syntax and try again.")),setTimeout(()=>{a(null)},5e3)}finally{m(!1)}},g=()=>{s(""),a(null),o(!1)};return n.jsx(f.Dialog,{open:e,onOpenChange:o,children:n.jsxs(f.DialogContent,{className:"flex max-h-[80vh] max-w-2xl flex-col",children:[n.jsxs(f.DialogHeader,{children:[n.jsx(f.DialogTitle,{children:i("Import CSS Theme")}),n.jsxs(f.DialogDescription,{className:"space-y-2",children:[n.jsx("p",{children:i("Paste your CSS variables to import a custom theme. The CSS should contain :root and .dark blocks with CSS custom properties.")}),n.jsxs("div",{className:"flex items-center",children:[n.jsx("p",{className:"font-bold",children:"Get theme resources:"}),n.jsx(y.Button,{variant:"link",size:"sm",onClick:()=>window.open("https://tweakcn.com/","_blank"),children:"TweakCN"}),n.jsx(y.Button,{variant:"link",size:"sm",onClick:()=>window.open("https://ui.shadcn.com/themes#themes","_blank"),children:"shadcn/ui Themes"}),n.jsx(y.Button,{variant:"link",size:"sm",onClick:()=>window.open("https://zippystarter.com/tools/shadcn-ui-theme-generator","_blank"),children:"ZippyStarter"})]})]})]}),n.jsxs("div",{className:"flex-1 space-y-4 overflow-hidden",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(f.Label,{htmlFor:"css-input",children:i("CSS Variables")}),n.jsx(f.Textarea,{id:"css-input",placeholder:M,value:r,onChange:l=>s(l.target.value),className:"min-h-[300px] resize-none font-mono text-sm",disabled:h})]}),c&&n.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 p-3",children:n.jsx("p",{className:"text-sm text-red-600",children:c})})]}),n.jsxs(f.DialogFooter,{className:"gap-2",children:[n.jsx(y.Button,{variant:"outline",onClick:g,disabled:h,children:i("Cancel")}),n.jsx(y.Button,{onClick:p,disabled:!r.trim()||h,children:i(h?"Importing...":"Import Theme")})]})]})})};exports.CssImportModal=_;
|
package/dist/index-B-rSiAp_.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("lodash-es"),s="#styles:",l=e=>{const n=["_type","_id","_parent","_bindings","_name"],o=["$loading","blockProps","inBuilder","lang","draft","pageProps","pageData","children"],r=t.keys(e.properties);if(t.intersection(r,n).length>0)throw new Error(`Reserved props are not allowed: ${t.intersection(r,n).join(", ")}`);if(t.intersection(r,o).length>0)throw new Error(`Runtime props are not allowed in schema: ${t.intersection(r,o).join(", ")}`);const i=t.get(e,"properties",{}),u={};return t.each(i,(p,a)=>{t.isEmpty(p.ui)||(u[a]={...p.ui},delete i[a].ui)}),{schema:t.isEmpty(i)?{}:{...t.omit(e,["ui"])},uiSchema:{...t.get(e,"ui",{}),...u}}},d=(e="")=>({type:"string",styles:!0,default:`${s},${e}`,ui:{"ui:widget":"hidden"}}),c=(e="")=>({type:"string",styles:!0,default:`${s},${e}`,ui:{"ui:widget":"hidden"}}),h=e=>(console.warn("runtimeProp is deprecated, use builderProp instead"),{runtime:!0,...e}),g=e=>({builderProp:!0,...e}),y=e=>`${s},${e}`;exports.StylesProp=d;exports.builderProp=g;exports.defaultChaiStyles=y;exports.registerChaiBlockSchema=l;exports.runtimeProp=h;exports.stylesProp=c;
|