@chaibuilder/sdk 4.0.0-beta.3 → 4.0.0-beta.31
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 +72 -50
- package/dist/{2SSKDMRQ-BnsZi3K3.cjs → 2SSKDMRQ-BksFOLpD.cjs} +1 -1
- package/dist/{2SSKDMRQ-CnSDkQcy.js → 2SSKDMRQ-gmj-yWTy.js} +2 -2
- package/dist/{AP7HFJJL-B31839PG.cjs → AP7HFJJL-CO-deD_p.cjs} +1 -1
- package/dist/{AP7HFJJL-CymCmW14.js → AP7HFJJL-kVgc0R61.js} +1 -1
- package/dist/IconPicker-BJHUCDn4.cjs +1 -0
- package/dist/{IconPicker-B1rWC-Ex.js → IconPicker-D_GRfhwS.js} +8 -7
- package/dist/STRINGS-BExFecZW.js +8 -0
- package/dist/STRINGS-FNnfjF5H.cjs +1 -0
- package/dist/{WDYDFRGG-BUVnbAci.js → WDYDFRGG-C9_E3QW0.js} +2 -2
- package/dist/{WDYDFRGG-BxhOCHc3.cjs → WDYDFRGG-KPpWFul_.cjs} +1 -1
- package/dist/{actions-registery-CZ1w0NKa.js → actions-registery-Bj-j1k5i.js} +2668 -2585
- package/dist/actions-registery-Cy1lqUVI.cjs +481 -0
- package/dist/actions.cjs +1 -1
- package/dist/actions.d.ts +0 -158
- package/dist/actions.js +3 -3
- package/dist/active-in-another-tab-1GoKTVcF.js +35 -0
- package/dist/active-in-another-tab-iEd5fZD0.cjs +1 -0
- package/dist/{add-new-language-page-WmlCnytQ.js → add-new-language-page-B3GUvWdP.js} +54 -53
- package/dist/add-new-language-page-Cq8R42Ro.cjs +1 -0
- package/dist/{add-new-page-VW2wAYZp.js → add-new-page-C5HlQfzy.js} +2 -2
- package/dist/{add-new-page-soZ8GAkN.cjs → add-new-page-DiHnECAR.cjs} +1 -1
- package/dist/ai-panel-content-BPpawv4D.cjs +1 -0
- package/dist/{ai-panel-content-D_o7Q_A-.js → ai-panel-content-tExD3yhH.js} +12 -11
- package/dist/ai-panel-default-lang-C6N4wUUF.cjs +3 -0
- package/dist/ai-panel-default-lang-DnYLHSaS.js +317 -0
- package/dist/ai-panel-other-lang-C65lVVtZ.cjs +1 -0
- package/dist/ai-panel-other-lang-D1pCJluY.js +132 -0
- package/dist/{ai-prompt-input-Bhc0ds7X.js → ai-prompt-input-B2q30bhR.js} +59 -62
- package/dist/ai-prompt-input-Dws5BHhQ.cjs +1 -0
- package/dist/{ai-translation-prompt-CZ55HQmo.js → ai-translation-prompt-Dnn6i_t3.js} +2 -2
- package/dist/ai-translation-prompt-DnwG2BmF.cjs +1 -0
- package/dist/apply-binding-9XSrYzAE.cjs +1 -0
- package/dist/{apply-binding-6iwlED02.js → apply-binding-chfbBKi2.js} +238 -225
- package/dist/change-password-modal-C0MMizgl.js +137 -0
- package/dist/change-password-modal-LKtYY-8V.cjs +1 -0
- package/dist/code-display-BR-gij5j.cjs +1 -0
- package/dist/{code-display-DhD_RBcg.js → code-display-DdWcOQ_i.js} +1 -1
- package/dist/code-editor-CWOmKcUc.js +57 -0
- package/dist/code-editor-Cim6jQVF.cjs +1 -0
- package/dist/continue-editing-in-this-client-Dd6nKIvX.cjs +1 -0
- package/dist/{continue-editing-in-this-client-CS2aQ7yY.js → continue-editing-in-this-client-oxYWGWON.js} +10 -9
- package/dist/core-BWQrViOY.cjs +1 -0
- package/dist/core-QlWEXm1d.js +53 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +275 -105
- package/dist/core.js +59 -28
- package/dist/{css-import-modal-Byg6wV0O.js → css-import-modal-6bMTRlCg.js} +11 -9
- package/dist/css-import-modal-CXulmaB4.cjs +13 -0
- package/dist/delete-page-D0tdn6VW.cjs +1 -0
- package/dist/delete-page-LnzR01A8.js +71 -0
- package/dist/design-token-usage-D-hrcKz1.cjs +1 -0
- package/dist/{design-token-usage-xQs6SlaJ.js → design-token-usage-lf7N_uOk.js} +33 -32
- package/dist/{digital-asset-manager-DbtwzxRz.js → digital-asset-manager-DJhRhLGC.js} +6 -5
- package/dist/digital-asset-manager-eCJHNSjj.cjs +1 -0
- package/dist/{duplicate-page-BR7Dlo9d.js → duplicate-page-CXzYy7vx.js} +20 -19
- package/dist/duplicate-page-ChSp1TYN.cjs +1 -0
- package/dist/dynamic-page-selector-btGtkyyv.cjs +1 -0
- package/dist/{dynamic-page-selector-Cb5r_W8s.js → dynamic-page-selector-r5IR9_7k.js} +12 -11
- package/dist/fonts/bungee/Bungee-Regular.woff2 +0 -0
- package/dist/fonts/dm_sans/dm-sans-variable.woff2 +0 -0
- package/dist/fonts/geist/Geist-VariableFont_wght.ttf +0 -0
- package/dist/fonts/geist/Geist-VariableFont_wght.woff2 +0 -0
- package/dist/fonts/geist/geist-variable.woff2 +0 -0
- package/dist/fonts/geist-mono/GeistMono-VariableFont_wght.woff2 +0 -0
- package/dist/fonts/inter/inter-latin.woff2 +0 -0
- package/dist/fonts/inter/inter-variable.woff2 +1449 -0
- package/dist/fonts/lato/lato-variable.woff2 +0 -0
- package/dist/fonts/lavishly_yours/lavishly-yours.woff2 +11 -0
- package/dist/fonts/merriweather/merriweather-variable.woff2 +11 -0
- package/dist/fonts/montserrat/montserrat-variable.woff2 +0 -0
- package/dist/fonts/nunito_sans/nunito-sans-variable.woff2 +11 -0
- package/dist/fonts/open_sans/open-sans-variable.woff2 +0 -0
- package/dist/fonts/oswald/oswald-variable.woff2 +0 -0
- package/dist/fonts/playfair_display/playfair-display-variable.woff2 +11 -0
- package/dist/fonts/poppins/poppins-variable.woff2 +0 -0
- package/dist/fonts/raleway/raleway-variable.woff2 +0 -0
- package/dist/fonts/roboto/roboto-variable.woff2 +11 -0
- package/dist/fonts/source_sans_3/source-sans-3-variable.woff2 +11 -0
- package/dist/fonts/ubuntu/ubuntu-variable.woff2 +0 -0
- package/dist/fonts-B3UYxuJI.js +25 -0
- package/dist/fonts-D5fTqvSS.cjs +1 -0
- package/dist/get-chai-builder-tailwind-config-7CxFxEYL.cjs +1 -0
- package/dist/{get-chai-builder-tailwind-config-DjoVOuAf.js → get-chai-builder-tailwind-config-DC4sDOYK.js} +8 -8
- package/dist/{get-chai-builder-theme-Dl72X7cz.cjs → get-chai-builder-theme-B5RkBTsB.cjs} +1 -1
- package/dist/{get-chai-builder-theme-BYtp20KD.js → get-chai-builder-theme-BpuwSLeS.js} +1 -1
- package/dist/{image-editor-G-K28aTS.cjs → image-editor-BdW476J8.cjs} +1 -1
- package/dist/{image-editor-DV8kUKhl.js → image-editor-CilPMtAC.js} +1 -1
- package/dist/index-CAhDwfHE.cjs +5 -0
- package/dist/{index-Ct7ElCGK.js → index-DsQXiNA_.js} +5888 -6282
- package/dist/index-DtMksfXx.js +4932 -0
- package/dist/index-mPCp0j2h.cjs +160 -0
- package/dist/json-diff-viewer-BkrnLb3B.cjs +8 -0
- package/dist/{json-diff-viewer-krslPepD.js → json-diff-viewer-D3N3w3Ax.js} +100 -97
- package/dist/{lang-panel-BwIewMyw.js → lang-panel-BAaaP4Qc.js} +15 -14
- package/dist/lang-panel-BjDRrpwN.cjs +1 -0
- package/dist/library-blocks/bento/agency-showcase/agency-showcase.html +175 -0
- package/dist/library-blocks/bento/agency-showcase/agency-showcase.webp +0 -0
- package/dist/library-blocks/bento/creative-portfolio/creative-portfolio.html +116 -0
- package/dist/library-blocks/bento/creative-portfolio/creative-portfolio.webp +0 -0
- package/dist/library-blocks/bento/product-features/product-features.html +159 -0
- package/dist/library-blocks/bento/product-features/product-features.webp +0 -0
- package/dist/library-blocks/bento/saas-dashboard/saas-dashboard.html +182 -0
- package/dist/library-blocks/bento/saas-dashboard/saas-dashboard.webp +0 -0
- package/dist/library-blocks/bento/startup-metrics/startup-metrics.html +170 -0
- package/dist/library-blocks/bento/startup-metrics/startup-metrics.webp +0 -0
- package/dist/library-blocks/blocks-list.json +149 -0
- package/dist/library-blocks/feature/agency-services/agency-services.html +194 -0
- package/dist/library-blocks/feature/agency-services/agency-services.webp +0 -0
- package/dist/library-blocks/feature/consulting-firm/consulting-firm.html +219 -0
- package/dist/library-blocks/feature/consulting-firm/consulting-firm.webp +0 -0
- package/dist/library-blocks/feature/design-studio/design-studio.html +190 -0
- package/dist/library-blocks/feature/design-studio/design-studio.webp +0 -0
- package/dist/library-blocks/feature/freelancer-toolkit/freelancer-toolkit.html +195 -0
- package/dist/library-blocks/feature/freelancer-toolkit/freelancer-toolkit.webp +0 -0
- package/dist/library-blocks/feature/marketing-agency/marketing-agency.html +212 -0
- package/dist/library-blocks/feature/marketing-agency/marketing-agency.webp +0 -0
- package/dist/library-blocks/footer/creative-agency/creative-agency.html +64 -0
- package/dist/library-blocks/footer/creative-agency/creative-agency.webp +0 -0
- package/dist/library-blocks/footer/minimal-portfolio/minimal-portfolio.html +106 -0
- package/dist/library-blocks/footer/minimal-portfolio/minimal-portfolio.webp +0 -0
- package/dist/library-blocks/footer/saas-startup/saas-startup.html +117 -0
- package/dist/library-blocks/footer/saas-startup/saas-startup.webp +0 -0
- package/dist/library-blocks/hero/creative-agency/creative-agency.html +117 -0
- package/dist/library-blocks/hero/creative-agency/creative-agency.webp +0 -0
- package/dist/library-blocks/hero/developer-focused/developer-focused.html +124 -0
- package/dist/library-blocks/hero/developer-focused/developer-focused.webp +0 -0
- package/dist/library-blocks/hero/minimal-saas/minimal-saas.html +98 -0
- package/dist/library-blocks/hero/minimal-saas/minimal-saas.webp +0 -0
- package/dist/library-blocks/hero/portfolio-showcase/portfolio-showcase.html +148 -0
- package/dist/library-blocks/hero/portfolio-showcase/portfolio-showcase.webp +0 -0
- package/dist/library-blocks/hero/startup-landing/startup-landing.html +130 -0
- package/dist/library-blocks/hero/startup-landing/startup-landing.webp +0 -0
- package/dist/library-blocks/navbar/creative-agency/creative-agency.html +139 -0
- package/dist/library-blocks/navbar/creative-agency/creative-agency.webp +0 -0
- package/dist/library-blocks/navbar/minimal-portfolio/minimal-portfolio.html +164 -0
- package/dist/library-blocks/navbar/minimal-portfolio/minimal-portfolio.webp +0 -0
- package/dist/library-blocks/navbar/saas-startup/saas-startup.html +129 -0
- package/dist/library-blocks/navbar/saas-startup/saas-startup.webp +0 -0
- package/dist/manage-design-tokens-BknGNAKE.cjs +1 -0
- package/dist/manage-design-tokens-Co5677WS.js +428 -0
- package/dist/manage-design-tokens-modal-9qpcb-EC.js +161 -0
- package/dist/manage-design-tokens-modal-BcgdwEXE.cjs +1 -0
- package/dist/{mark-as-template-D295ZQtU.js → mark-as-template-DNHYNjI9.js} +17 -16
- package/dist/mark-as-template-IYRjta97.cjs +1 -0
- package/dist/{nested-path-selector-content-CKYYK-C5.js → nested-path-selector-content-Be-pbnVl.js} +24 -23
- package/dist/nested-path-selector-content-CWmPgU-L.cjs +1 -0
- package/dist/no-language-page-content-8_J6y-cm.cjs +1 -0
- package/dist/{no-language-page-content-BvqRBP6y.js → no-language-page-content-C-ltY7bj.js} +10 -9
- package/dist/{no-language-page-dialog-BcEoqyQB.cjs → no-language-page-dialog-BOZZZzqx.cjs} +1 -1
- package/dist/{no-language-page-dialog-PjNqTUpl.js → no-language-page-dialog-D5NXpDHi.js} +2 -2
- package/dist/{page-creator-DiOITEMw.js → page-creator-BuHHnqiQ.js} +242 -241
- package/dist/page-creator-wtbae2U7.cjs +1 -0
- package/dist/{page-lock-BdYmCks0.cjs → page-lock-DN4iJc-V.cjs} +1 -1
- package/dist/{page-lock-Bfbs6RgL.js → page-lock-pPGlTxj7.js} +2 -2
- package/dist/page-locked-dialog-B_vdgv24.cjs +1 -0
- package/dist/{page-locked-dialog-B6MKTRfY.js → page-locked-dialog-Bl-ojgIW.js} +26 -23
- package/dist/page-manager-new-5W5M9_ue.cjs +1 -0
- package/dist/page-manager-new-Bg8H6yrg.js +418 -0
- package/dist/page-manager-search-and-filter-CDXunXNd.cjs +1 -0
- package/dist/{page-manager-search-and-filter-CM0UMb6U.js → page-manager-search-and-filter-CyfO7O96.js} +20 -19
- package/dist/{page-revisions-content-NH9JK4Ey.js → page-revisions-content-B-egQgoZ.js} +131 -117
- package/dist/page-revisions-content-BKT8S9_g.cjs +1 -0
- package/dist/pages.cjs +1 -1
- package/dist/pages.d.ts +300 -97
- package/dist/pages.js +22 -19
- package/dist/plugin-BSjgGgwo.js +248 -0
- package/dist/plugin-DHpuZZXz.cjs +22 -0
- package/dist/{publish-pages-content-D9aixMN5.js → publish-pages-content-D2B_ScCQ.js} +71 -70
- package/dist/publish-pages-content-WJHTVYnx.cjs +1 -0
- package/dist/register-chai-top-bar-D6GjnauV.js +237 -0
- package/dist/register-chai-top-bar-DyW9GPzV.cjs +1 -0
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +22 -20
- package/dist/render.js +125 -118
- package/dist/rte-widget-modal-CC1KcrAT.cjs +1 -0
- package/dist/{rte-widget-modal-DOJEXLIf.js → rte-widget-modal-c3T09VeO.js} +10 -9
- 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 +11 -1
- package/dist/runtime.d.ts +159 -114
- package/dist/runtime.js +107 -42
- package/dist/save-to-lib-CiM0wiIr.cjs +1 -0
- package/dist/{save-to-lib-eiOc_SSN.js → save-to-lib-dT1NDd5w.js} +156 -149
- package/dist/sdk.css +1 -1
- package/dist/{selected-block-display-CBFePS19.js → selected-block-display-BQndDPcY.js} +40 -39
- package/dist/selected-block-display-BgqcPsXI.cjs +16 -0
- package/dist/seo-panel-DXZvGYEM.cjs +2 -0
- package/dist/{seo-panel-C1-iMOR1.js → seo-panel-Z93Zf_bz.js} +23 -22
- package/dist/{shared-json-ld-B4PxAM_0.js → shared-json-ld-Ct68RlWD.js} +100 -99
- package/dist/shared-json-ld-DwvUDGAS.cjs +1 -0
- package/dist/{slug-input-AwNJs9im.js → slug-input-CAqkFZBq.js} +9 -8
- package/dist/slug-input-Curnt2n3.cjs +1 -0
- package/dist/supabase-actions.cjs +1 -1
- package/dist/supabase-actions.d.ts +40 -1
- package/dist/supabase-actions.js +231 -192
- package/dist/{take-over-request-C4FeDtN_.js → take-over-request-C6ngP1QR.js} +15 -14
- package/dist/take-over-request-D6y2HcDr.cjs +1 -0
- package/dist/theme-panel-footer-CGZL2F7R.js +26 -0
- package/dist/theme-panel-footer-IgGj-_OA.cjs +1 -0
- package/dist/translation-warning-modal-B876S5yp.cjs +1 -0
- package/dist/{translation-warning-modal-B64YqlbI.js → translation-warning-modal-kRcfrPgo.js} +11 -10
- package/dist/types.cjs +1 -0
- package/dist/types.d.ts +743 -0
- package/dist/types.js +1 -0
- package/dist/{unmark-as-template-CZ9sQp_P.js → unmark-as-template-DeeWUTco.js} +12 -11
- package/dist/unmark-as-template-f1dl_YTz.cjs +1 -0
- package/dist/unpublish-page-DEPFjGuu.cjs +1 -0
- package/dist/unpublish-page-U_79Pwc0.js +28 -0
- package/dist/unpublished-partials-modal-CEFXp1D1.cjs +1 -0
- package/dist/unpublished-partials-modal-Ts5ZhAK9.js +41 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +8 -5
- package/dist/utils.js +2 -2
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +341 -332
- package/dist/{web-preview-Djy6WIyj.js → web-preview-CoT8r96b.js} +2 -2
- package/dist/web-preview-DTDoIE-c.cjs +1 -0
- package/package.json +36 -31
- package/dist/IconPicker-DREyo007.cjs +0 -1
- package/dist/actions-registery-YnFmU21O.cjs +0 -418
- package/dist/active-in-another-tab-B47YjQGN.cjs +0 -1
- package/dist/active-in-another-tab-CyjngVA6.js +0 -34
- package/dist/add-new-language-page-88xzrUy8.cjs +0 -1
- package/dist/ai-panel-content-7zCil042.cjs +0 -1
- package/dist/ai-panel-default-lang-COYaxNwn.cjs +0 -3
- package/dist/ai-panel-default-lang-DnElspF0.js +0 -341
- package/dist/ai-panel-other-lang-CkynNlAU.cjs +0 -1
- package/dist/ai-panel-other-lang-Dp0E9_Hx.js +0 -162
- package/dist/ai-prompt-input-CThbVp0_.cjs +0 -1
- package/dist/ai-translation-prompt-C2kJQFDX.cjs +0 -1
- package/dist/apply-binding-KKp5PnpZ.cjs +0 -1
- package/dist/code-display-BnqzqzoP.cjs +0 -1
- package/dist/code-editor-DRIAnNbb.js +0 -50
- package/dist/code-editor-o3___nu2.cjs +0 -1
- package/dist/continue-editing-in-this-client-CtMYsk-A.cjs +0 -1
- package/dist/core-BoRDjj4h.cjs +0 -1
- package/dist/core-yvI6kCyw.js +0 -56
- package/dist/css-import-modal-CyqkXWCO.cjs +0 -13
- package/dist/delete-design-token-BRZZiWtQ.js +0 -40
- package/dist/delete-design-token-DkVs1oBf.cjs +0 -1
- package/dist/delete-page-BzyX9TN-.js +0 -70
- package/dist/delete-page-DxX7PFIE.cjs +0 -1
- package/dist/design-token-usage-CAHzEGgJ.cjs +0 -1
- package/dist/digital-asset-manager--uO8Agia.cjs +0 -1
- package/dist/duplicate-page-CaNAbXwV.cjs +0 -1
- package/dist/dynamic-page-selector-Cxk_gjni.cjs +0 -1
- package/dist/fonts/GeistMonoVF.woff +0 -0
- package/dist/fonts/GeistVF.woff +0 -0
- package/dist/fonts-B-Xt29pe.cjs +0 -1
- package/dist/fonts-DRly3Wzd.js +0 -78
- package/dist/get-chai-builder-tailwind-config-B9rCyiQo.cjs +0 -1
- package/dist/index-B-rSiAp_.cjs +0 -1
- package/dist/index-DF5DEvqb.cjs +0 -160
- package/dist/index-Dxfyt4d4.js +0 -39
- package/dist/index-WQwzsC7A.cjs +0 -5
- package/dist/index-ZuacEL1j.js +0 -4732
- package/dist/json-diff-viewer-D7z4zNvv.cjs +0 -8
- package/dist/lang-panel-DT96k1xg.cjs +0 -1
- package/dist/manage-design-tokens-Caz_20VK.js +0 -240
- package/dist/manage-design-tokens-CrmLe7UT.cjs +0 -1
- package/dist/mark-as-template-W3LmpiqN.cjs +0 -1
- package/dist/nested-path-selector-content-CoS_d3dc.cjs +0 -1
- package/dist/no-language-page-content-DkfeMl90.cjs +0 -1
- package/dist/page-creator-C4gc5NSC.cjs +0 -1
- package/dist/page-locked-dialog-B1FAtK92.cjs +0 -1
- package/dist/page-manager-new-CHDueBDk.cjs +0 -1
- package/dist/page-manager-new-CzX22g2n.js +0 -394
- package/dist/page-manager-search-and-filter-DkkRIH86.cjs +0 -1
- package/dist/page-revisions-content-ChY-4f2V.cjs +0 -1
- package/dist/plugin-3ZKK6RXm.js +0 -245
- package/dist/plugin-C6rgJDNQ.cjs +0 -22
- package/dist/publish-pages-content-x-JuSFJ9.cjs +0 -1
- package/dist/rte-widget-modal-BaHIuEjF.cjs +0 -1
- package/dist/save-to-lib-Cgpxw8-g.cjs +0 -1
- package/dist/selected-block-display-BgRY82CT.cjs +0 -16
- package/dist/seo-panel-DfAb8U7W.cjs +0 -2
- package/dist/shared-json-ld-DzG398hr.cjs +0 -1
- package/dist/slug-input-C_ijLQ_X.cjs +0 -1
- package/dist/take-over-request-BNxcjY2j.cjs +0 -1
- package/dist/theme-panel-footer-Cq9pljro.cjs +0 -1
- package/dist/theme-panel-footer-uBQqSJXm.js +0 -25
- package/dist/translation-warning-modal-BZAcwM2_.cjs +0 -1
- package/dist/unmark-as-template-EVvk0vmp.cjs +0 -1
- package/dist/unpublish-page-D4VwOlxc.js +0 -27
- package/dist/unpublish-page-bdSmwAVQ.cjs +0 -1
- package/dist/web-preview-Cio70gk5.cjs +0 -1
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
import { jsxs as a, Fragment as C, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Z as oe, _ as le, $ as Z, a0 as ce, a1 as de, a2 as me, a3 as ue, a4 as he, a5 as fe, a6 as pe, q as ge, a7 as xe, a8 as ve, a9 as Ne } from "./index-DsQXiNA_.js";
|
|
3
|
+
import { z as G, B as x } from "./register-chai-top-bar-D6GjnauV.js";
|
|
4
|
+
import { D as ke } from "./STRINGS-BExFecZW.js";
|
|
5
|
+
import { MagnifyingGlassIcon as V, PlusIcon as _, TokensIcon as be, ArrowLeftIcon as Te, EyeOpenIcon as Q, Pencil1Icon as ye } from "@radix-ui/react-icons";
|
|
6
|
+
import { useAtom as Ce } from "jotai";
|
|
7
|
+
import { nanoid as we } from "nanoid";
|
|
8
|
+
import { useState as g, useRef as Ae, useCallback as je, useMemo as De, useEffect as q, Suspense as Oe, lazy as Ee } from "react";
|
|
9
|
+
import { useTranslation as Se } from "react-i18next";
|
|
10
|
+
import { toast as p } from "sonner";
|
|
11
|
+
import { twMerge as Ie } from "tailwind-merge";
|
|
12
|
+
const H = (o) => {
|
|
13
|
+
const m = o.trim();
|
|
14
|
+
return m.length === 0 || m.length > 25 ? !1 : /^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$/.test(m);
|
|
15
|
+
}, Pe = (o, m, t, i = !1, h) => {
|
|
16
|
+
const f = o.trim();
|
|
17
|
+
return f.length === 0 ? "" : f.length > 25 ? t("Token name must be 25 characters or less") : /^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$/.test(f) ? Object.entries(m).find(
|
|
18
|
+
([c, T]) => T.name === f && (!i || c !== h)
|
|
19
|
+
) ? t("Token name already exists") : "" : t("Only alphanumeric characters and hyphens allowed");
|
|
20
|
+
}, ze = (o) => o.replace(/\s+/g, "-"), Le = Ee(() => import("./design-token-usage-lf7N_uOk.js")), K = ({
|
|
21
|
+
tokenId: o,
|
|
22
|
+
token: m,
|
|
23
|
+
isDisabled: t,
|
|
24
|
+
isSelected: i,
|
|
25
|
+
isArchived: h = !1,
|
|
26
|
+
onSelect: f,
|
|
27
|
+
onEdit: b,
|
|
28
|
+
onUnarchive: v
|
|
29
|
+
}) => /* @__PURE__ */ a(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
onClick: () => f(o),
|
|
33
|
+
className: `group relative flex cursor-pointer items-center justify-between overflow-hidden rounded border p-2 transition-all duration-150 ${h ? "border-muted bg-muted/30 opacity-60" : i ? "border-primary bg-primary/10" : "hover:bg-muted/90"}`,
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1 overflow-hidden", children: [
|
|
36
|
+
/* @__PURE__ */ e("div", { className: `text-xs font-semibold ${h ? "text-muted-foreground" : ""}`, children: m.name }),
|
|
37
|
+
/* @__PURE__ */ e("div", { className: `w-full max-w-52 truncate text-[10px] font-light ${h ? "text-muted-foreground" : ""}`, children: m.value })
|
|
38
|
+
] }),
|
|
39
|
+
/* @__PURE__ */ a("div", { className: "absolute right-1 top-1 flex flex-shrink-0 items-center opacity-0 transition-opacity duration-150 group-hover:opacity-100", children: [
|
|
40
|
+
!h && /* @__PURE__ */ a(C, { children: [
|
|
41
|
+
/* @__PURE__ */ e(Oe, { fallback: null, children: /* @__PURE__ */ e(Le, { tokenId: o, tokenName: m.name, children: /* @__PURE__ */ e(
|
|
42
|
+
x,
|
|
43
|
+
{
|
|
44
|
+
variant: "ghost",
|
|
45
|
+
size: "sm",
|
|
46
|
+
className: "h-6 w-6 rounded-full p-0 hover:bg-primary/10 hover:text-primary",
|
|
47
|
+
children: /* @__PURE__ */ e(Q, { className: "h-3 w-3" })
|
|
48
|
+
}
|
|
49
|
+
) }) }),
|
|
50
|
+
/* @__PURE__ */ e(
|
|
51
|
+
x,
|
|
52
|
+
{
|
|
53
|
+
variant: "ghost",
|
|
54
|
+
size: "sm",
|
|
55
|
+
onClick: (c) => {
|
|
56
|
+
c.stopPropagation(), b(o);
|
|
57
|
+
},
|
|
58
|
+
disabled: t,
|
|
59
|
+
className: "h-6 w-6 rounded-full p-0 hover:bg-primary/10 hover:text-primary",
|
|
60
|
+
children: /* @__PURE__ */ e(ye, { className: "h-3 w-3" })
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
] }),
|
|
64
|
+
h && /* @__PURE__ */ e(
|
|
65
|
+
x,
|
|
66
|
+
{
|
|
67
|
+
variant: "ghost",
|
|
68
|
+
size: "sm",
|
|
69
|
+
onClick: (c) => {
|
|
70
|
+
c.stopPropagation(), v == null || v(o);
|
|
71
|
+
},
|
|
72
|
+
disabled: t,
|
|
73
|
+
className: "h-6 w-6 rounded-full p-0 hover:bg-primary/10 hover:text-primary",
|
|
74
|
+
children: /* @__PURE__ */ e(Q, { className: "h-3 w-3" })
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
] })
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
), Xe = ({ onActiveTokenChange: o, onDirtyStateChange: m }) => {
|
|
81
|
+
const { t } = Se(), [i, h] = Ce(oe), f = le(), b = Z("pageId", ""), v = Z("siteWideUsage", {}), [c, T] = g("view"), [k, P] = g(null), [N, R] = g(null), [l, w] = g(""), [d, A] = g(""), [j, D] = g(""), [O, X] = g(""), [J, Y] = g(!1), [E, z] = g({
|
|
82
|
+
isOpen: !1,
|
|
83
|
+
tokenId: null,
|
|
84
|
+
tokenName: "",
|
|
85
|
+
pageCount: 0,
|
|
86
|
+
partialCount: 0
|
|
87
|
+
}), S = Ae(null), U = je(
|
|
88
|
+
(n) => {
|
|
89
|
+
if (!v) return { pageCount: 0, partialCount: 0 };
|
|
90
|
+
let s = 0, r = 0;
|
|
91
|
+
return Object.entries(v).forEach(([u, y]) => {
|
|
92
|
+
if (u === b || !(y != null && y.designTokens)) return;
|
|
93
|
+
Object.keys(y.designTokens).some((ie) => ie === n) && (y.isPartial ? r++ : s++);
|
|
94
|
+
}), { pageCount: s, partialCount: r };
|
|
95
|
+
},
|
|
96
|
+
[v, b]
|
|
97
|
+
), L = De(() => Object.entries(i).filter(
|
|
98
|
+
([, n]) => n.name.toLowerCase().includes(O.toLowerCase()) || n.value.toLowerCase().includes(O.toLowerCase())
|
|
99
|
+
), [i, O]);
|
|
100
|
+
q(() => {
|
|
101
|
+
if (!m)
|
|
102
|
+
return;
|
|
103
|
+
const n = c === "add" && (l && l.trim().length > 0 || d && d.trim().length > 0);
|
|
104
|
+
m(n);
|
|
105
|
+
}, [c, l, d, m]), q(() => {
|
|
106
|
+
if (o)
|
|
107
|
+
if (c === "edit" || c === "add")
|
|
108
|
+
o(l && d ? {
|
|
109
|
+
name: l,
|
|
110
|
+
value: d,
|
|
111
|
+
id: k || void 0
|
|
112
|
+
} : null);
|
|
113
|
+
else if (c === "view" && N && i[N]) {
|
|
114
|
+
const n = i[N];
|
|
115
|
+
o({
|
|
116
|
+
name: n.name,
|
|
117
|
+
value: n.value,
|
|
118
|
+
id: N
|
|
119
|
+
});
|
|
120
|
+
} else
|
|
121
|
+
o(null);
|
|
122
|
+
}, [c, l, d, k, N, i, o]);
|
|
123
|
+
const ee = () => {
|
|
124
|
+
if (!l.trim() || !d.trim()) {
|
|
125
|
+
p.error(t("Please fill in both token name and classes"));
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (!H(l)) {
|
|
129
|
+
p.error(t("Invalid design token name format"));
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (Object.entries(i).find(
|
|
133
|
+
([r, u]) => u.name === l.trim() && r !== k
|
|
134
|
+
)) {
|
|
135
|
+
p.error(t("Token already exists"));
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (!k) return;
|
|
139
|
+
const s = {
|
|
140
|
+
...i,
|
|
141
|
+
[k]: {
|
|
142
|
+
name: l.trim(),
|
|
143
|
+
value: d.trim()
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
h(s), f(), p.success(t("Token updated successfully")), I();
|
|
147
|
+
}, te = () => {
|
|
148
|
+
if (!l.trim() || !d.trim()) {
|
|
149
|
+
p.error(t("Please fill in both token name and classes"));
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
if (!H(l)) {
|
|
153
|
+
p.error(t("Invalid design token name format"));
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (Object.values(i).find((u) => u.name === l.trim())) {
|
|
157
|
+
p.error(t("Token already exists"));
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const s = `${ke}${we(12)}`, r = {
|
|
161
|
+
...i,
|
|
162
|
+
[s]: {
|
|
163
|
+
name: l.trim(),
|
|
164
|
+
value: d.trim()
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
h(r), f(), p.success(t("Token added successfully")), I();
|
|
168
|
+
}, M = (n) => {
|
|
169
|
+
const s = i[n];
|
|
170
|
+
if (!s) return;
|
|
171
|
+
const { pageCount: r, partialCount: u } = U(n);
|
|
172
|
+
z({
|
|
173
|
+
isOpen: !0,
|
|
174
|
+
tokenId: n,
|
|
175
|
+
tokenName: s.name,
|
|
176
|
+
pageCount: r,
|
|
177
|
+
partialCount: u
|
|
178
|
+
}), S.current = n;
|
|
179
|
+
}, ne = () => {
|
|
180
|
+
const n = S.current;
|
|
181
|
+
if (!n) return;
|
|
182
|
+
const s = {
|
|
183
|
+
...i,
|
|
184
|
+
[n]: {
|
|
185
|
+
...i[n],
|
|
186
|
+
archived: !0
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
h(s), f(), p.success(t("Token archived successfully")), z({
|
|
190
|
+
isOpen: !1,
|
|
191
|
+
tokenId: null,
|
|
192
|
+
tokenName: "",
|
|
193
|
+
pageCount: 0,
|
|
194
|
+
partialCount: 0
|
|
195
|
+
}), S.current = null;
|
|
196
|
+
}, $ = (n) => {
|
|
197
|
+
const s = {
|
|
198
|
+
...i,
|
|
199
|
+
[n]: {
|
|
200
|
+
name: i[n].name,
|
|
201
|
+
value: i[n].value
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
h(s), f(), p.success(t("Token unarchived successfully"));
|
|
205
|
+
}, B = (n) => {
|
|
206
|
+
const s = i[n];
|
|
207
|
+
s && (P(n), w(s.name), A(s.value), D(""), T("edit"));
|
|
208
|
+
}, F = () => {
|
|
209
|
+
P(null), w(""), A(""), D(""), T("add");
|
|
210
|
+
}, I = () => {
|
|
211
|
+
P(null), w(""), A(""), D(""), Y(!1), T("view");
|
|
212
|
+
}, se = (n) => {
|
|
213
|
+
const s = ze(n);
|
|
214
|
+
w(s);
|
|
215
|
+
const r = Pe(s, i, t, c === "edit", k || void 0);
|
|
216
|
+
D(r);
|
|
217
|
+
}, W = (n) => {
|
|
218
|
+
A(n);
|
|
219
|
+
}, re = (n) => {
|
|
220
|
+
const s = ve(Ne(Ie(d, n)));
|
|
221
|
+
W(s);
|
|
222
|
+
}, ae = (n) => {
|
|
223
|
+
const s = d.split(" ").filter((r) => r !== n).join(" ");
|
|
224
|
+
W(s);
|
|
225
|
+
};
|
|
226
|
+
return /* @__PURE__ */ a(C, { children: [
|
|
227
|
+
/* @__PURE__ */ e("div", { className: "flex h-full w-full flex-col", children: c === "view" ? (() => {
|
|
228
|
+
const n = L.filter(([, r]) => !r.archived), s = L.filter(([, r]) => r.archived);
|
|
229
|
+
return /* @__PURE__ */ a(C, { children: [
|
|
230
|
+
Object.entries(i).length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-x-2", children: [
|
|
231
|
+
/* @__PURE__ */ a("div", { className: "relative flex-1", children: [
|
|
232
|
+
/* @__PURE__ */ e(V, { className: "absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground" }),
|
|
233
|
+
/* @__PURE__ */ e(
|
|
234
|
+
G,
|
|
235
|
+
{
|
|
236
|
+
placeholder: t("Search tokens"),
|
|
237
|
+
value: O,
|
|
238
|
+
onChange: (r) => X(r.target.value),
|
|
239
|
+
className: "h-6 pl-7 text-xs"
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
] }),
|
|
243
|
+
/* @__PURE__ */ a(
|
|
244
|
+
x,
|
|
245
|
+
{
|
|
246
|
+
variant: "outline",
|
|
247
|
+
onClick: F,
|
|
248
|
+
size: "sm",
|
|
249
|
+
className: "h-6 border-primary text-xs text-primary hover:bg-primary/10 hover:text-primary",
|
|
250
|
+
children: [
|
|
251
|
+
/* @__PURE__ */ e(_, { className: "h-3 w-3" }),
|
|
252
|
+
t("Add")
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
)
|
|
256
|
+
] }),
|
|
257
|
+
/* @__PURE__ */ e("div", { className: "no-scrollbar flex flex-1 flex-col overflow-hidden pt-2", children: /* @__PURE__ */ e(pe, { className: "flex h-full flex-1 items-center justify-center", children: /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
258
|
+
Object.entries(i).length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center rounded-lg border border-dashed border-muted bg-muted/20 py-8", children: [
|
|
259
|
+
/* @__PURE__ */ e("div", { className: "mb-2 text-3xl", children: /* @__PURE__ */ e(be, { className: "h-12 w-12 text-muted-foreground" }) }),
|
|
260
|
+
/* @__PURE__ */ e("p", { className: "mb-1 text-sm font-medium text-foreground", children: t("No design tokens yet") }),
|
|
261
|
+
/* @__PURE__ */ e("p", { className: "text-center text-xs text-muted-foreground", children: t("Create reusable design tokens to streamline your styling") }),
|
|
262
|
+
/* @__PURE__ */ a(x, { variant: "default", onClick: F, size: "sm", className: "mt-4 h-7 text-xs leading-tight", children: [
|
|
263
|
+
/* @__PURE__ */ e(_, { className: "mr-1 h-3 w-3" }),
|
|
264
|
+
t("Add first design token")
|
|
265
|
+
] })
|
|
266
|
+
] }) : L.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center rounded-lg border border-dashed border-muted bg-muted/20 py-8", children: [
|
|
267
|
+
/* @__PURE__ */ e("div", { className: "mb-2", children: /* @__PURE__ */ e(V, { className: "h-10 w-10 text-muted-foreground" }) }),
|
|
268
|
+
/* @__PURE__ */ e("p", { className: "mb-1 text-sm font-medium text-foreground", children: t("No tokens found") }),
|
|
269
|
+
/* @__PURE__ */ e("p", { className: "text-center text-xs text-muted-foreground", children: t("No design tokens match your search") })
|
|
270
|
+
] }) : /* @__PURE__ */ a(C, { children: [
|
|
271
|
+
n.length > 0 && /* @__PURE__ */ e("div", { className: "space-y-1", children: n.map(([r, u]) => /* @__PURE__ */ e(
|
|
272
|
+
K,
|
|
273
|
+
{
|
|
274
|
+
token: u,
|
|
275
|
+
tokenId: r,
|
|
276
|
+
isSelected: N === r,
|
|
277
|
+
isArchived: !1,
|
|
278
|
+
onSelect: R,
|
|
279
|
+
onEdit: B,
|
|
280
|
+
onArchive: M,
|
|
281
|
+
onUnarchive: $,
|
|
282
|
+
isDisabled: !1
|
|
283
|
+
},
|
|
284
|
+
r
|
|
285
|
+
)) }),
|
|
286
|
+
s.length > 0 && /* @__PURE__ */ a("div", { className: "mt-4 space-y-1", children: [
|
|
287
|
+
/* @__PURE__ */ e("div", { className: "px-2 py-1 text-[10px] font-semibold text-muted-foreground", children: t("Archived") }),
|
|
288
|
+
s.map(([r, u]) => /* @__PURE__ */ e(
|
|
289
|
+
K,
|
|
290
|
+
{
|
|
291
|
+
token: u,
|
|
292
|
+
tokenId: r,
|
|
293
|
+
isSelected: N === r,
|
|
294
|
+
isArchived: !0,
|
|
295
|
+
onSelect: R,
|
|
296
|
+
onEdit: B,
|
|
297
|
+
onArchive: M,
|
|
298
|
+
onUnarchive: $,
|
|
299
|
+
isDisabled: !1
|
|
300
|
+
},
|
|
301
|
+
r
|
|
302
|
+
))
|
|
303
|
+
] })
|
|
304
|
+
] }),
|
|
305
|
+
/* @__PURE__ */ e("div", { className: "h-44" })
|
|
306
|
+
] }) }) })
|
|
307
|
+
] });
|
|
308
|
+
})() : (() => {
|
|
309
|
+
const n = c === "edit", s = t(n ? "Edit Design Token" : "Add Design Token"), r = t(n ? "Update design token" : "Create a reusable design token");
|
|
310
|
+
return /* @__PURE__ */ a("div", { className: "flex h-full flex-col", children: [
|
|
311
|
+
/* @__PURE__ */ a("div", { className: "mb-3 flex items-center gap-2 rounded-md border border-border/50 bg-muted p-1.5", children: [
|
|
312
|
+
/* @__PURE__ */ e(
|
|
313
|
+
x,
|
|
314
|
+
{
|
|
315
|
+
variant: "ghost",
|
|
316
|
+
size: "sm",
|
|
317
|
+
onClick: I,
|
|
318
|
+
className: "h-6 w-6 rounded-full p-0 hover:bg-muted",
|
|
319
|
+
children: /* @__PURE__ */ e(Te, { className: "h-3 w-3" })
|
|
320
|
+
}
|
|
321
|
+
),
|
|
322
|
+
/* @__PURE__ */ a("div", { className: "flex-1", children: [
|
|
323
|
+
/* @__PURE__ */ e("h3", { className: "text-xs font-semibold text-foreground", children: s }),
|
|
324
|
+
/* @__PURE__ */ e("p", { className: "text-[10px] text-muted-foreground", children: r })
|
|
325
|
+
] }),
|
|
326
|
+
n && J && /* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-[10px] text-muted-foreground", children: /* @__PURE__ */ e("div", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-primary" }) })
|
|
327
|
+
] }),
|
|
328
|
+
/* @__PURE__ */ a("div", { className: "flex-1 space-y-3 overflow-y-auto", children: [
|
|
329
|
+
/* @__PURE__ */ a("div", { className: "space-y-1.5", children: [
|
|
330
|
+
/* @__PURE__ */ e(ge, { htmlFor: "token-name", className: "text-xs font-medium", children: t("Token Name") }),
|
|
331
|
+
/* @__PURE__ */ e(
|
|
332
|
+
G,
|
|
333
|
+
{
|
|
334
|
+
id: "token-name",
|
|
335
|
+
placeholder: "Button-Primary",
|
|
336
|
+
value: l,
|
|
337
|
+
onChange: (u) => se(u.target.value),
|
|
338
|
+
className: "h-7 text-xs"
|
|
339
|
+
}
|
|
340
|
+
),
|
|
341
|
+
j ? /* @__PURE__ */ e("span", { className: "text-[10px] text-destructive", children: j }) : /* @__PURE__ */ e("span", { className: "text-[10px] font-light text-muted-foreground", children: t("Button-Primary, Card-Header, Text-Large etc.") })
|
|
342
|
+
] }),
|
|
343
|
+
/* @__PURE__ */ e(
|
|
344
|
+
xe,
|
|
345
|
+
{
|
|
346
|
+
from: "designToken",
|
|
347
|
+
classFromProps: d,
|
|
348
|
+
onAddNew: re,
|
|
349
|
+
onRemove: ae
|
|
350
|
+
}
|
|
351
|
+
),
|
|
352
|
+
/* @__PURE__ */ a("div", { className: "mt-3 flex items-center justify-end gap-2 pt-3", children: [
|
|
353
|
+
/* @__PURE__ */ e(x, { variant: "outline", onClick: I, className: "h-7 text-xs", children: t("Cancel") }),
|
|
354
|
+
n ? /* @__PURE__ */ e(
|
|
355
|
+
x,
|
|
356
|
+
{
|
|
357
|
+
onClick: ee,
|
|
358
|
+
disabled: !l.trim() || !d.trim() || !!j,
|
|
359
|
+
className: "h-7 text-xs",
|
|
360
|
+
children: t("Save Token")
|
|
361
|
+
}
|
|
362
|
+
) : /* @__PURE__ */ e(
|
|
363
|
+
x,
|
|
364
|
+
{
|
|
365
|
+
onClick: te,
|
|
366
|
+
disabled: !l.trim() || !d.trim() || !!j,
|
|
367
|
+
className: "h-7 text-xs",
|
|
368
|
+
children: t("Add Token")
|
|
369
|
+
}
|
|
370
|
+
)
|
|
371
|
+
] })
|
|
372
|
+
] })
|
|
373
|
+
] });
|
|
374
|
+
})() }),
|
|
375
|
+
/* @__PURE__ */ e(
|
|
376
|
+
ce,
|
|
377
|
+
{
|
|
378
|
+
open: E.isOpen,
|
|
379
|
+
onOpenChange: (n) => {
|
|
380
|
+
n || (z({
|
|
381
|
+
isOpen: !1,
|
|
382
|
+
tokenId: null,
|
|
383
|
+
tokenName: "",
|
|
384
|
+
pageCount: 0,
|
|
385
|
+
partialCount: 0
|
|
386
|
+
}), S.current = null);
|
|
387
|
+
},
|
|
388
|
+
children: /* @__PURE__ */ a(de, { children: [
|
|
389
|
+
/* @__PURE__ */ e(me, { children: t("Archive Design Token") }),
|
|
390
|
+
/* @__PURE__ */ a(ue, { className: "space-y-3", children: [
|
|
391
|
+
/* @__PURE__ */ a("p", { children: [
|
|
392
|
+
t("This token is used on"),
|
|
393
|
+
" ",
|
|
394
|
+
/* @__PURE__ */ e("span", { className: "font-semibold", children: E.pageCount }),
|
|
395
|
+
" ",
|
|
396
|
+
t("pages"),
|
|
397
|
+
E.partialCount > 0 && /* @__PURE__ */ a(C, { children: [
|
|
398
|
+
" ",
|
|
399
|
+
t("and"),
|
|
400
|
+
" ",
|
|
401
|
+
/* @__PURE__ */ e("span", { className: "font-semibold", children: E.partialCount }),
|
|
402
|
+
" ",
|
|
403
|
+
t("partials")
|
|
404
|
+
] }),
|
|
405
|
+
"."
|
|
406
|
+
] }),
|
|
407
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: t("Archiving this token will remove the styling for those blocks.") }),
|
|
408
|
+
/* @__PURE__ */ e("p", { children: t("Do you wish to continue?") })
|
|
409
|
+
] }),
|
|
410
|
+
/* @__PURE__ */ a("div", { className: "flex justify-end gap-2", children: [
|
|
411
|
+
/* @__PURE__ */ e(he, { children: t("Cancel") }),
|
|
412
|
+
/* @__PURE__ */ e(
|
|
413
|
+
fe,
|
|
414
|
+
{
|
|
415
|
+
onClick: ne,
|
|
416
|
+
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
417
|
+
children: t("Archive")
|
|
418
|
+
}
|
|
419
|
+
)
|
|
420
|
+
] })
|
|
421
|
+
] })
|
|
422
|
+
}
|
|
423
|
+
)
|
|
424
|
+
] });
|
|
425
|
+
};
|
|
426
|
+
export {
|
|
427
|
+
Xe as default
|
|
428
|
+
};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { jsxs as l, jsx as e, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { al as k, am as A, i as T, an as M, ao as H, ap as _, aq as j, ar as I, a6 as P, D as S, e as L, f as E, g as O, a0 as U, a1 as q, as as R, a2 as $, a3 as V, at as Y, a4 as z, a5 as B } from "./index-DsQXiNA_.js";
|
|
3
|
+
import { TokensIcon as Q } from "@radix-ui/react-icons";
|
|
4
|
+
import { useMemo as u, useEffect as b, useState as g, useCallback as v } from "react";
|
|
5
|
+
import { useTranslation as F } from "react-i18next";
|
|
6
|
+
import { p as W, g as G, a as J, b as K } from "./plugin-BSjgGgwo.js";
|
|
7
|
+
import { get as w, filter as x, has as C, isEmpty as X, map as D, find as N } from "lodash-es";
|
|
8
|
+
import Z from "@tailwindcss/aspect-ratio";
|
|
9
|
+
import ee from "@tailwindcss/container-queries";
|
|
10
|
+
import se from "@tailwindcss/forms";
|
|
11
|
+
import ne from "@tailwindcss/typography";
|
|
12
|
+
import { u as ae } from "./fonts-B3UYxuJI.js";
|
|
13
|
+
import re from "./manage-design-tokens-Co5677WS.js";
|
|
14
|
+
const te = () => {
|
|
15
|
+
const [s] = T(), a = M(), [r] = H(), { document: n, window: i } = _(), t = ae();
|
|
16
|
+
b(() => {
|
|
17
|
+
r ? n == null || n.documentElement.classList.add("dark") : n == null || n.documentElement.classList.remove("dark");
|
|
18
|
+
}, [r, n]), b(() => {
|
|
19
|
+
!i || !i.tailwind || (i.tailwind.config = {
|
|
20
|
+
darkMode: "class",
|
|
21
|
+
theme: {
|
|
22
|
+
extend: {
|
|
23
|
+
container: {
|
|
24
|
+
center: !0,
|
|
25
|
+
padding: "1rem",
|
|
26
|
+
screens: {
|
|
27
|
+
"2xl": "1400px"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
...G(a)
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
plugins: [
|
|
34
|
+
ne,
|
|
35
|
+
se,
|
|
36
|
+
Z,
|
|
37
|
+
ee,
|
|
38
|
+
W(function({ addBase: o, theme: d }) {
|
|
39
|
+
o({
|
|
40
|
+
"h1,h2,h3,h4,h5,h6": {
|
|
41
|
+
fontFamily: d("fontFamily.heading")
|
|
42
|
+
},
|
|
43
|
+
body: {
|
|
44
|
+
fontFamily: d("fontFamily.body"),
|
|
45
|
+
color: d("colors.foreground"),
|
|
46
|
+
backgroundColor: d("colors.background")
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
}, [s, a, i]);
|
|
53
|
+
const c = u(() => {
|
|
54
|
+
const o = w(s, "fontFamily.heading"), d = w(s, "fontFamily.body");
|
|
55
|
+
return t.filter((h) => h.family === o || h.family === d);
|
|
56
|
+
}, [s, t]), p = u(
|
|
57
|
+
() => J(x(c, (o) => C(o, "url"))),
|
|
58
|
+
[c]
|
|
59
|
+
), m = u(
|
|
60
|
+
() => K(x(c, (o) => C(o, "src"))),
|
|
61
|
+
[c]
|
|
62
|
+
);
|
|
63
|
+
return /* @__PURE__ */ l(y, { children: [
|
|
64
|
+
/* @__PURE__ */ e(j, { theme: s }),
|
|
65
|
+
p.map((o, d) => /* @__PURE__ */ e("link", { rel: "stylesheet", href: o }, `preview-font-${d}`)),
|
|
66
|
+
/* @__PURE__ */ e("style", { id: "chai-custom-fonts", dangerouslySetInnerHTML: { __html: m } })
|
|
67
|
+
] });
|
|
68
|
+
}, le = ({
|
|
69
|
+
content: s,
|
|
70
|
+
classes: a = "",
|
|
71
|
+
className: r = "w-full rounded border-0",
|
|
72
|
+
style: n = { minHeight: 80 },
|
|
73
|
+
title: i = "Preview"
|
|
74
|
+
}) => {
|
|
75
|
+
const t = u(() => k.replace('dir="__HTML_DIR__"', 'dir="ltr"'), []);
|
|
76
|
+
return (
|
|
77
|
+
// @ts-ignore
|
|
78
|
+
/* @__PURE__ */ l(A, { className: r, style: n, title: i, initialContent: t, children: [
|
|
79
|
+
/* @__PURE__ */ e(te, {}),
|
|
80
|
+
/* @__PURE__ */ e("div", { className: "h-full p-4", children: /* @__PURE__ */ e("div", { className: a || void 0, dangerouslySetInnerHTML: { __html: s } }) })
|
|
81
|
+
] })
|
|
82
|
+
);
|
|
83
|
+
}, f = ["xs", "sm", "md", "lg", "xl", "2xl"], oe = (s) => {
|
|
84
|
+
if (s = s.trim().replace(/ +(?= )/g, ""), X(s)) return "";
|
|
85
|
+
const a = D(s.split(" "), I), r = [];
|
|
86
|
+
for (const n of a) {
|
|
87
|
+
const i = n.mq;
|
|
88
|
+
if (!r.includes(n.fullCls))
|
|
89
|
+
for (let t = f.indexOf(i) + 1; t < f.length; t++) {
|
|
90
|
+
const c = N(a, { property: n.property, mq: f[t] });
|
|
91
|
+
if (c && c.cls !== n.cls)
|
|
92
|
+
break;
|
|
93
|
+
N(a, { cls: n.cls, mq: f[t] }) && r.push(`${f[t]}:${n.cls}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return x(
|
|
97
|
+
D(a, (n) => r.includes(n.fullCls) ? null : n.fullCls),
|
|
98
|
+
(n) => n !== null
|
|
99
|
+
).join(" ");
|
|
100
|
+
}, ie = ({ activeToken: s }) => {
|
|
101
|
+
const { t: a } = F(), r = s != null && s.value ? oe(s.value) : "", n = s && s.name && s.value;
|
|
102
|
+
return /* @__PURE__ */ e(P, { className: "h-full", children: /* @__PURE__ */ e("div", { className: "space-y-4 pr-4", children: /* @__PURE__ */ l("div", { className: "space-y-2 rounded-lg border bg-card p-4", children: [
|
|
103
|
+
n && /* @__PURE__ */ e(y, { children: /* @__PURE__ */ l("div", { className: "mb-3 flex items-center justify-between", children: [
|
|
104
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-semibold", children: s.name }),
|
|
105
|
+
s.id && /* @__PURE__ */ e("span", { className: "rounded bg-muted px-2 py-0.5 font-mono text-[9px] text-muted-foreground", children: s.id })
|
|
106
|
+
] }) }),
|
|
107
|
+
/* @__PURE__ */ l("div", { children: [
|
|
108
|
+
/* @__PURE__ */ e("div", { className: "mb-2 text-[10px] font-medium text-muted-foreground", children: a("Preview:") }),
|
|
109
|
+
/* @__PURE__ */ e(
|
|
110
|
+
le,
|
|
111
|
+
{
|
|
112
|
+
content: a("Sample text with token styles applied"),
|
|
113
|
+
classes: r,
|
|
114
|
+
style: { minHeight: 80 },
|
|
115
|
+
title: a("Token Preview")
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] })
|
|
119
|
+
] }) }) });
|
|
120
|
+
}, Ce = ({ open: s, onOpenChange: a }) => {
|
|
121
|
+
const { t: r } = F(), [n, i] = g(null), [t, c] = g(!1), [p, m] = g(!1), o = v(
|
|
122
|
+
(h) => {
|
|
123
|
+
if (!h && t) {
|
|
124
|
+
m(!0);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
a(h);
|
|
128
|
+
},
|
|
129
|
+
[t, a]
|
|
130
|
+
), d = v(() => {
|
|
131
|
+
m(!1), c(!1), a(!1);
|
|
132
|
+
}, [a]);
|
|
133
|
+
return /* @__PURE__ */ l(y, { children: [
|
|
134
|
+
/* @__PURE__ */ e(S, { open: s, onOpenChange: o, children: /* @__PURE__ */ l(L, { className: "flex h-[53vh] max-w-6xl flex-col gap-0 p-0", children: [
|
|
135
|
+
/* @__PURE__ */ e(E, { className: "border-b border-border px-6 py-4", children: /* @__PURE__ */ l(O, { className: "flex items-center gap-2", children: [
|
|
136
|
+
/* @__PURE__ */ e(Q, { className: "h-5 w-5 text-primary" }),
|
|
137
|
+
r("Design Token Management")
|
|
138
|
+
] }) }),
|
|
139
|
+
/* @__PURE__ */ l("div", { className: "flex flex-1 overflow-hidden", children: [
|
|
140
|
+
/* @__PURE__ */ e("div", { className: "flex w-1/2 flex-col border-r border-border p-4", children: /* @__PURE__ */ e(re, { onActiveTokenChange: i, onDirtyStateChange: c }) }),
|
|
141
|
+
/* @__PURE__ */ l("div", { className: "flex w-1/2 flex-col p-4", children: [
|
|
142
|
+
/* @__PURE__ */ e("div", { className: "mb-3 flex items-center justify-between", children: /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: r("Live Preview") }) }),
|
|
143
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ e(ie, { activeToken: n }) })
|
|
144
|
+
] })
|
|
145
|
+
] })
|
|
146
|
+
] }) }),
|
|
147
|
+
/* @__PURE__ */ e(U, { open: p, onOpenChange: m, children: /* @__PURE__ */ l(q, { children: [
|
|
148
|
+
/* @__PURE__ */ l(R, { children: [
|
|
149
|
+
/* @__PURE__ */ e($, { children: r("Unsaved Changes") }),
|
|
150
|
+
/* @__PURE__ */ e(V, { children: r("You have unsaved changes. Are you sure you want to close? Your changes will be lost.") })
|
|
151
|
+
] }),
|
|
152
|
+
/* @__PURE__ */ l(Y, { children: [
|
|
153
|
+
/* @__PURE__ */ e(z, { children: r("Continue Editing") }),
|
|
154
|
+
/* @__PURE__ */ e(B, { onClick: d, children: r("Discard Changes") })
|
|
155
|
+
] })
|
|
156
|
+
] }) })
|
|
157
|
+
] });
|
|
158
|
+
};
|
|
159
|
+
export {
|
|
160
|
+
Ce as default
|
|
161
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-mPCp0j2h.cjs"),y=require("@radix-ui/react-icons"),c=require("react"),j=require("react-i18next"),g=require("./plugin-DHpuZZXz.cjs"),o=require("lodash-es"),b=require("@tailwindcss/aspect-ratio"),v=require("@tailwindcss/container-queries"),w=require("@tailwindcss/forms"),C=require("@tailwindcss/typography"),D=require("./fonts-D5fTqvSS.cjs"),F=require("./manage-design-tokens-BknGNAKE.cjs"),N=()=>{const[s]=t.useTheme(),r=t.useThemeOptions(),[l]=t.useDarkMode(),{document:n,window:d}=t.useFrame(),i=D.useRegisteredFonts();c.useEffect(()=>{l?n==null||n.documentElement.classList.add("dark"):n==null||n.documentElement.classList.remove("dark")},[l,n]),c.useEffect(()=>{!d||!d.tailwind||(d.tailwind.config={darkMode:"class",theme:{extend:{container:{center:!0,padding:"1rem",screens:{"2xl":"1400px"}},...g.getChaiThemeOptions(r)}},plugins:[C,w,b,v,g.plugin(function({addBase:a,theme:m}){a({"h1,h2,h3,h4,h5,h6":{fontFamily:m("fontFamily.heading")},body:{fontFamily:m("fontFamily.body"),color:m("colors.foreground"),backgroundColor:m("colors.background")}})})]})},[s,r,d]);const u=c.useMemo(()=>{const a=o.get(s,"fontFamily.heading"),m=o.get(s,"fontFamily.body");return i.filter(f=>f.family===a||f.family===m)},[s,i]),p=c.useMemo(()=>g.getThemeFontsUrls(o.filter(u,a=>o.has(a,"url"))),[u]),h=c.useMemo(()=>g.getThemeCustomFontFace(o.filter(u,a=>o.has(a,"src"))),[u]);return e.jsxs(e.Fragment,{children:[e.jsx(t.CssThemeVariables,{theme:s}),p.map((a,m)=>e.jsx("link",{rel:"stylesheet",href:a},`preview-font-${m}`)),e.jsx("style",{id:"chai-custom-fonts",dangerouslySetInnerHTML:{__html:h}})]})},T=({content:s,classes:r="",className:l="w-full rounded border-0",style:n={minHeight:80},title:d="Preview"})=>{const i=c.useMemo(()=>t.IframeInitialContent.replace('dir="__HTML_DIR__"','dir="ltr"'),[]);return e.jsxs(t.ChaiFrame,{className:l,style:n,title:d,initialContent:i,children:[e.jsx(N,{}),e.jsx("div",{className:"h-full p-4",children:e.jsx("div",{className:r||void 0,dangerouslySetInnerHTML:{__html:s}})})]})},x=["xs","sm","md","lg","xl","2xl"],k=s=>{if(s=s.trim().replace(/ +(?= )/g,""),o.isEmpty(s))return"";const r=o.map(s.split(" "),t.constructClassObject),l=[];for(const n of r){const d=n.mq;if(!l.includes(n.fullCls))for(let i=x.indexOf(d)+1;i<x.length;i++){const u=o.find(r,{property:n.property,mq:x[i]});if(u&&u.cls!==n.cls)break;o.find(r,{cls:n.cls,mq:x[i]})&&l.push(`${x[i]}:${n.cls}`)}}return o.filter(o.map(r,n=>l.includes(n.fullCls)?null:n.fullCls),n=>n!==null).join(" ")},q=({activeToken:s})=>{const{t:r}=j.useTranslation(),l=s!=null&&s.value?k(s.value):"",n=s&&s.name&&s.value;return e.jsx(t.ScrollArea,{className:"h-full",children:e.jsx("div",{className:"space-y-4 pr-4",children:e.jsxs("div",{className:"space-y-2 rounded-lg border bg-card p-4",children:[n&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-semibold",children:s.name}),s.id&&e.jsx("span",{className:"rounded bg-muted px-2 py-0.5 font-mono text-[9px] text-muted-foreground",children:s.id})]})}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-2 text-[10px] font-medium text-muted-foreground",children:r("Preview:")}),e.jsx(T,{content:r("Sample text with token styles applied"),classes:l,style:{minHeight:80},title:r("Token Preview")})]})]})})})},A=({open:s,onOpenChange:r})=>{const{t:l}=j.useTranslation(),[n,d]=c.useState(null),[i,u]=c.useState(!1),[p,h]=c.useState(!1),a=c.useCallback(f=>{if(!f&&i){h(!0);return}r(f)},[i,r]),m=c.useCallback(()=>{h(!1),u(!1),r(!1)},[r]);return e.jsxs(e.Fragment,{children:[e.jsx(t.Dialog,{open:s,onOpenChange:a,children:e.jsxs(t.DialogContent,{className:"flex h-[53vh] max-w-6xl flex-col gap-0 p-0",children:[e.jsx(t.DialogHeader,{className:"border-b border-border px-6 py-4",children:e.jsxs(t.DialogTitle,{className:"flex items-center gap-2",children:[e.jsx(y.TokensIcon,{className:"h-5 w-5 text-primary"}),l("Design Token Management")]})}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsx("div",{className:"flex w-1/2 flex-col border-r border-border p-4",children:e.jsx(F.default,{onActiveTokenChange:d,onDirtyStateChange:u})}),e.jsxs("div",{className:"flex w-1/2 flex-col p-4",children:[e.jsx("div",{className:"mb-3 flex items-center justify-between",children:e.jsx("h3",{className:"text-sm font-semibold",children:l("Live Preview")})}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(q,{activeToken:n})})]})]})]})}),e.jsx(t.AlertDialog,{open:p,onOpenChange:h,children:e.jsxs(t.AlertDialogContent,{children:[e.jsxs(t.AlertDialogHeader,{children:[e.jsx(t.AlertDialogTitle,{children:l("Unsaved Changes")}),e.jsx(t.AlertDialogDescription,{children:l("You have unsaved changes. Are you sure you want to close? Your changes will be lost.")})]}),e.jsxs(t.AlertDialogFooter,{children:[e.jsx(t.AlertDialogCancel,{children:l("Continue Editing")}),e.jsx(t.AlertDialogAction,{onClick:m,children:l("Discard Changes")})]})]})})]})};exports.default=A;
|