@chaibuilder/sdk 4.0.0-beta.4 → 4.0.0-beta.40
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-CopJgtZb.cjs → 2SSKDMRQ-D-2rSLsq.cjs} +1 -1
- package/dist/{2SSKDMRQ-Difo_1pg.js → 2SSKDMRQ-DKit4bEt.js} +3 -3
- package/dist/{AP7HFJJL-BPuPBqj4.js → AP7HFJJL-BWruCozs.js} +1 -1
- package/dist/{AP7HFJJL-DYxDgaOs.cjs → AP7HFJJL-CAE2yHEv.cjs} +1 -1
- package/dist/{IconPicker-C0oycHbs.cjs → IconPicker-BCYCPK5M.cjs} +1 -1
- package/dist/{IconPicker-B2-oriq2.js → IconPicker-BOBnjfJc.js} +2 -2
- package/dist/STRINGS-BExFecZW.js +8 -0
- package/dist/STRINGS-FNnfjF5H.cjs +1 -0
- package/dist/{WDYDFRGG-DbejaRPK.cjs → WDYDFRGG-BNve1FlV.cjs} +1 -1
- package/dist/{WDYDFRGG-KK8pkcW1.js → WDYDFRGG-Bv40IVPG.js} +4 -4
- package/dist/{actions-registery-y_ENc8zj.js → actions-registery-CMKfEXxX.js} +3397 -3202
- package/dist/actions-registery-CqhNZFV3.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-Cu_ASKtx.cjs → active-in-another-tab-BPBvEwmD.cjs} +1 -1
- package/dist/{active-in-another-tab-DkR2HWI4.js → active-in-another-tab-C334yD2g.js} +5 -5
- package/dist/{add-new-language-page-BXuwluuU.cjs → add-new-language-page-BVME8b7v.cjs} +1 -1
- package/dist/{add-new-language-page-CBY0RR6q.js → add-new-language-page-DVL-HkWR.js} +4 -4
- package/dist/{add-new-page-C_PzKby8.cjs → add-new-page-BPysPck8.cjs} +1 -1
- package/dist/add-new-page-BQOsHkVl.js +31 -0
- package/dist/{ai-panel-content-rRmJdH7L.cjs → ai-panel-content-BsElc0Ke.cjs} +1 -1
- package/dist/{ai-panel-content--YM01Aly.js → ai-panel-content-BwX0YBGD.js} +6 -6
- package/dist/ai-panel-default-lang-BqhAu1iN.cjs +3 -0
- package/dist/ai-panel-default-lang-CYZuwSQn.js +317 -0
- package/dist/ai-panel-other-lang-CL83Mwha.js +132 -0
- package/dist/ai-panel-other-lang-CivH2s8Q.cjs +1 -0
- package/dist/{ai-prompt-input-N9PcYCFa.cjs → ai-prompt-input-BuP52voq.cjs} +1 -1
- package/dist/{ai-prompt-input-DueQYNf-.js → ai-prompt-input-C37B_jlE.js} +30 -34
- package/dist/{ai-translation-prompt-IAdWMNZb.cjs → ai-translation-prompt-CgZKlkF_.cjs} +1 -1
- package/dist/{ai-translation-prompt-B36F3d7K.js → ai-translation-prompt-V5PBEZRn.js} +2 -2
- package/dist/apply-binding-BuwI_Uf5.cjs +41 -0
- package/dist/apply-binding-RQRSIe56.js +942 -0
- package/dist/change-password-modal-AQU_GLqq.js +137 -0
- package/dist/change-password-modal-Chufk3yU.cjs +1 -0
- package/dist/{code-display-DloSPyPr.cjs → code-display-BR-gij5j.cjs} +1 -1
- package/dist/{code-display-Ck81Id9K.js → code-display-DdWcOQ_i.js} +1 -1
- package/dist/code-editor-D-fpas30.js +57 -0
- package/dist/code-editor-gqdLU-rU.cjs +1 -0
- package/dist/{continue-editing-in-this-client-DmGFLHXw.cjs → continue-editing-in-this-client-BNEnV0hi.cjs} +1 -1
- package/dist/{continue-editing-in-this-client-Dm9cCj7K.js → continue-editing-in-this-client-Dx3f64SH.js} +3 -3
- package/dist/core-czmLeR0h.cjs +1 -0
- package/dist/core-nSRy3D7z.js +54 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +285 -103
- package/dist/core.js +71 -42
- package/dist/{css-import-modal-Rh1QAVxo.cjs → css-import-modal-B2NoLsdZ.cjs} +1 -1
- package/dist/{css-import-modal-9P_0uNa4.js → css-import-modal-c_6VH1js.js} +8 -8
- package/dist/default-theme-options-DN-3gIjM.cjs +22 -0
- package/dist/default-theme-options-saBIkWGT.js +248 -0
- package/dist/delete-page-B1R1w8O5.js +84 -0
- package/dist/delete-page-DbQDbCyB.cjs +1 -0
- package/dist/{design-token-usage-MNYsFlPG.js → design-token-usage-11kPk5n1.js} +26 -26
- package/dist/{design-token-usage-CXglXgcJ.cjs → design-token-usage-BBLfxzzo.cjs} +1 -1
- package/dist/digital-asset-manager-B0h5rUVQ.cjs +1 -0
- package/dist/{digital-asset-manager-CqCWBO0s.js → digital-asset-manager-BbEQ8cPb.js} +6 -6
- package/dist/{duplicate-page-BknLfqr0.js → duplicate-page-BY_Pcqbb.js} +7 -7
- package/dist/{duplicate-page-DzZByALW.cjs → duplicate-page-BaAzKbiX.cjs} +1 -1
- package/dist/{dynamic-page-selector-WA007Sni.cjs → dynamic-page-selector-DzH_gCQ4.cjs} +1 -1
- package/dist/{dynamic-page-selector-DoW7OyUB.js → dynamic-page-selector-bsaLGZkO.js} +16 -16
- 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-BFePCEIS.cjs → get-chai-builder-tailwind-config-7CxFxEYL.cjs} +1 -1
- package/dist/{get-chai-builder-tailwind-config-BXf_xLHk.js → get-chai-builder-tailwind-config-DC4sDOYK.js} +5 -5
- package/dist/get-chai-builder-theme-C_qofMh_.cjs +1 -0
- package/dist/{get-chai-builder-theme-DDVRJQ6Z.js → get-chai-builder-theme-CyOkIlte.js} +1 -1
- package/dist/{image-compression-DsZ1oqpb.js → image-compression-DPFITwOL.js} +2 -2
- package/dist/image-compression-UaU7Bwqe.cjs +1 -0
- package/dist/{image-editor-CqwaVxO2.cjs → image-editor-Cfn290vp.cjs} +1 -1
- package/dist/{image-editor-CQnNtak2.js → image-editor-CyGqVNvX.js} +1 -1
- package/dist/index-BpVxZOd-.js +5082 -0
- package/dist/index-CQf0jL1k.cjs +5 -0
- package/dist/{index-rAcNbjk_.js → index-DpeytsiB.js} +6145 -6091
- package/dist/index-P-2SvZA9.cjs +160 -0
- package/dist/{json-diff-viewer-CLuUHiPU.cjs → json-diff-viewer-BBERGXdt.cjs} +7 -7
- package/dist/{json-diff-viewer-CMvGUvJ2.js → json-diff-viewer-C-bpInzt.js} +87 -85
- package/dist/{lang-panel-CnwTb05j.js → lang-panel-4Q_PTmKm.js} +26 -26
- package/dist/lang-panel-uI149Beq.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-B_-TrQgu.cjs +1 -0
- package/dist/manage-design-tokens-CHpHE-dx.js +446 -0
- package/dist/manage-design-tokens-modal-Bug5H8PT.cjs +1 -0
- package/dist/manage-design-tokens-modal-DO_tHkgp.js +161 -0
- package/dist/{mark-as-template-CpWEBJGd.cjs → mark-as-template-BEnMYTql.cjs} +1 -1
- package/dist/{mark-as-template-DBLshWb5.js → mark-as-template-Ca3QLzX4.js} +11 -11
- package/dist/{nested-path-selector-content-6OBJ8LG8.js → nested-path-selector-content-5gECLoRV.js} +2 -2
- package/dist/{nested-path-selector-content-C2sD9dkq.cjs → nested-path-selector-content-BHPOfftZ.cjs} +1 -1
- package/dist/{no-language-page-content-CzENgtnu.js → no-language-page-content-Bb3nUSLv.js} +9 -9
- package/dist/{no-language-page-content-BvPDdccK.cjs → no-language-page-content-CKxggLC_.cjs} +1 -1
- package/dist/{no-language-page-dialog-CbYI2cVg.js → no-language-page-dialog-BEVRCAhM.js} +2 -2
- package/dist/{no-language-page-dialog-CgW4yJBC.cjs → no-language-page-dialog-DMb5Z5on.cjs} +1 -1
- package/dist/page-creator-C_95U8kn.cjs +1 -0
- package/dist/{page-creator-Cc83uQqw.js → page-creator-DQRFXhNj.js} +143 -143
- package/dist/{page-lock-BJUkyxdh.js → page-lock-Be5wPHz5.js} +2 -2
- package/dist/{page-lock-CT7SmQqp.cjs → page-lock-DKWt66MX.cjs} +1 -1
- package/dist/page-locked-dialog-CWyZol0i.cjs +1 -0
- package/dist/{page-locked-dialog-DsEbWRed.js → page-locked-dialog-CkXpQUpO.js} +22 -22
- package/dist/page-manager-new-2gYNPR6y.js +408 -0
- package/dist/page-manager-new-Bt7rBO1J.cjs +1 -0
- package/dist/{page-manager-search-and-filter-zq-LfhQ1.js → page-manager-search-and-filter-BotSCoAo.js} +30 -29
- package/dist/{page-manager-search-and-filter-Bfm0j1gg.cjs → page-manager-search-and-filter-Dkwl089C.cjs} +1 -1
- package/dist/{page-revisions-content-D38G2tJM.js → page-revisions-content-OigWteYc.js} +133 -122
- package/dist/page-revisions-content-bQ32feXp.cjs +1 -0
- package/dist/pages.cjs +1 -1
- package/dist/pages.d.ts +330 -96
- package/dist/pages.js +23 -19
- package/dist/{publish-pages-content-CS7f41Ac.js → publish-pages-content-2RcG3Ptp.js} +39 -39
- package/dist/publish-pages-content-Dtkal6ue.cjs +1 -0
- package/dist/{register-chai-top-bar-ESJHs5s-.js → register-chai-top-bar-D6GjnauV.js} +87 -87
- package/dist/register-chai-top-bar-DyW9GPzV.cjs +1 -0
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +20 -18
- package/dist/render.js +133 -132
- package/dist/{rte-widget-modal-BKNx2wln.cjs → rte-widget-modal-CHxO3TQR.cjs} +1 -1
- package/dist/{rte-widget-modal-D6Zik0Ta.js → rte-widget-modal-DmQk0Lfj.js} +10 -10
- 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 +153 -270
- package/dist/runtime.js +107 -71
- package/dist/save-to-lib-BSsuvkZS.cjs +1 -0
- package/dist/{save-to-lib-WwOzbgiF.js → save-to-lib-CVqlFkRK.js} +153 -147
- package/dist/sdk.css +1 -1
- package/dist/{selected-block-display-BOgnQRLF.cjs → selected-block-display-Cr7R1ojV.cjs} +1 -1
- package/dist/{selected-block-display-B1SG_UXw.js → selected-block-display-DngI-pF1.js} +12 -12
- package/dist/seo-panel-BMYdzcoJ.cjs +2 -0
- package/dist/{seo-panel-BkOgRoWd.js → seo-panel-CHkFLI5b.js} +27 -27
- package/dist/{shared-json-ld-uka9TOgA.js → shared-json-ld-BzjOUN-P.js} +88 -88
- package/dist/shared-json-ld-ClIZw1aA.cjs +1 -0
- package/dist/{slug-input-DHLmUNrH.js → slug-input-07EKw9U5.js} +8 -8
- package/dist/{slug-input-Cyd6NR6J.cjs → slug-input-DHVDl_Dv.cjs} +1 -1
- package/dist/supabase-actions.cjs +1 -1
- package/dist/supabase-actions.d.ts +45 -0
- package/dist/supabase-actions.js +380 -275
- package/dist/take-over-request-BLdOZhUs.cjs +1 -0
- package/dist/{take-over-request-Ca0X-qyf.js → take-over-request-zqtItFSK.js} +13 -13
- package/dist/{translation-warning-modal-pSZVKcNW.cjs → translation-warning-modal-BxV_8mCE.cjs} +1 -1
- package/dist/{translation-warning-modal-DrpFeI83.js → translation-warning-modal-DnSd7lOJ.js} +9 -9
- package/dist/types.cjs +1 -0
- package/dist/types.d.ts +756 -0
- package/dist/types.js +1 -0
- package/dist/{unmark-as-template-DF1Ms4VN.cjs → unmark-as-template-C4UkGyOP.cjs} +1 -1
- package/dist/{unmark-as-template-BMqgelv-.js → unmark-as-template-DIKZYr01.js} +11 -11
- package/dist/unpublish-page-CK0sAZcB.js +28 -0
- package/dist/{unpublish-page-Bsq2yEqQ.cjs → unpublish-page-DFXLzJbc.cjs} +1 -1
- package/dist/unpublished-partials-modal-BAr1SkEG.cjs +1 -0
- package/dist/unpublished-partials-modal-CDaOvXgp.js +52 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +6 -6
- package/dist/utils.js +2 -2
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +360 -351
- package/dist/{web-preview-D6h1L2nV.js → web-preview-CRSjh2he.js} +2 -2
- package/dist/{web-preview-kres0aG7.cjs → web-preview-DA7_F3vv.cjs} +1 -1
- package/package.json +34 -35
- package/dist/actions-registery-JdxhXhT6.cjs +0 -418
- package/dist/add-new-page-DJLJFLAd.js +0 -31
- package/dist/ai-panel-default-lang-BZl0tPYo.js +0 -341
- package/dist/ai-panel-default-lang-D2zhXvKP.cjs +0 -3
- package/dist/ai-panel-other-lang-Bfjk2CYZ.js +0 -162
- package/dist/ai-panel-other-lang-Y4bEKHoG.cjs +0 -1
- package/dist/apply-binding-BvWfJCSZ.js +0 -841
- package/dist/apply-binding-IsUf6UWJ.cjs +0 -1
- package/dist/code-editor-Bb7JumZy.js +0 -51
- package/dist/code-editor-DQB8lAOk.cjs +0 -1
- package/dist/core-Dr7QYemB.js +0 -56
- package/dist/core-Y0lXLwkq.cjs +0 -1
- package/dist/delete-design-token-BG8yHcS5.cjs +0 -1
- package/dist/delete-design-token-COvR4G1S.js +0 -40
- package/dist/delete-page-CNucxe4P.js +0 -71
- package/dist/delete-page-DAvEjHwF.cjs +0 -1
- package/dist/digital-asset-manager-CB5MRBcW.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-theme-BApShjRz.cjs +0 -1
- package/dist/image-compression-DZ9WMmyn.cjs +0 -1
- package/dist/index-B-rSiAp_.cjs +0 -1
- package/dist/index-C0-pgg_p.cjs +0 -5
- package/dist/index-C99FhuF1.cjs +0 -160
- package/dist/index-Dno42B0a.js +0 -4734
- package/dist/index-Dxfyt4d4.js +0 -39
- package/dist/lang-panel-fDCYm5Jm.cjs +0 -1
- package/dist/manage-design-tokens-BsSZE9Vs.js +0 -241
- package/dist/manage-design-tokens-BvH5KTJX.cjs +0 -1
- package/dist/page-creator-g8GqgcKH.cjs +0 -1
- package/dist/page-locked-dialog-Co5b9XIZ.cjs +0 -1
- package/dist/page-manager-new-5rFP5DyQ.js +0 -395
- package/dist/page-manager-new-BOkJImo2.cjs +0 -1
- package/dist/page-revisions-content-ag-MHBGr.cjs +0 -1
- package/dist/plugin-BGlQf0iy.cjs +0 -22
- package/dist/plugin-C-ht41UZ.js +0 -245
- package/dist/publish-pages-content-BiX-GMLw.cjs +0 -1
- package/dist/register-chai-top-bar-BqwKw4uy.cjs +0 -1
- package/dist/save-to-lib-ffjCZYJ5.cjs +0 -1
- package/dist/seo-panel-FjS1UF_y.cjs +0 -2
- package/dist/shared-json-ld-yJkXjENy.cjs +0 -1
- package/dist/take-over-request-CmpJVe9T.cjs +0 -1
- package/dist/theme-panel-footer-BUXIu252.js +0 -26
- package/dist/theme-panel-footer-CKO9YYwZ.cjs +0 -1
- package/dist/unpublish-page-BJ0Bsvt2.js +0 -28
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
import { jsxs as a, Fragment as A, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Z as he, _ as fe, $ as pe, a0 as K, a1 as ge, a2 as xe, a3 as ve, a4 as ke, a5 as Ne, a6 as be, a7 as Te, p as ye, a8 as Ce, a9 as we, aa as Ae } from "./index-DpeytsiB.js";
|
|
3
|
+
import { z as X, B as v } from "./register-chai-top-bar-D6GjnauV.js";
|
|
4
|
+
import { D as De } from "./STRINGS-BExFecZW.js";
|
|
5
|
+
import { MagnifyingGlassIcon as q, PlusIcon as J, TokensIcon as je, ArrowLeftIcon as Oe, EyeOpenIcon as Y, Pencil1Icon as Se } from "@radix-ui/react-icons";
|
|
6
|
+
import { useAtom as Ee } from "jotai";
|
|
7
|
+
import { nanoid as Ie } from "nanoid";
|
|
8
|
+
import { useState as x, useRef as U, useCallback as F, useMemo as Pe, useEffect as ee, Suspense as ze, lazy as Re } from "react";
|
|
9
|
+
import { useTranslation as Le } from "react-i18next";
|
|
10
|
+
import { toast as p } from "sonner";
|
|
11
|
+
import { twMerge as Me } from "tailwind-merge";
|
|
12
|
+
const W = (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
|
+
}, $e = (o, m, n, i = !1, u) => {
|
|
16
|
+
const h = o.trim();
|
|
17
|
+
return h.length === 0 ? "" : h.length > 25 ? n("Token name must be 25 characters or less") : /^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$/.test(h) ? Object.entries(m).find(
|
|
18
|
+
([k, C]) => C.name === h && (!i || k !== u)
|
|
19
|
+
) ? n("Token name already exists") : "" : n("Only alphanumeric characters and hyphens allowed");
|
|
20
|
+
}, Be = (o) => o.replace(/\s+/g, "-"), Fe = Re(() => import("./design-token-usage-11kPk5n1.js")), te = ({
|
|
21
|
+
tokenId: o,
|
|
22
|
+
token: m,
|
|
23
|
+
isDisabled: n,
|
|
24
|
+
isSelected: i,
|
|
25
|
+
isArchived: u = !1,
|
|
26
|
+
onSelect: h,
|
|
27
|
+
onEdit: y,
|
|
28
|
+
onUnarchive: N
|
|
29
|
+
}) => /* @__PURE__ */ a(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
onClick: () => h(o),
|
|
33
|
+
className: `group relative flex cursor-pointer items-center justify-between overflow-hidden rounded border p-2 transition-all duration-150 ${u ? "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 ${u ? "text-muted-foreground" : ""}`, children: m.name }),
|
|
37
|
+
/* @__PURE__ */ e("div", { className: `w-full max-w-52 truncate text-[10px] font-light ${u ? "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
|
+
!u && /* @__PURE__ */ a(A, { children: [
|
|
41
|
+
/* @__PURE__ */ e(ze, { fallback: null, children: /* @__PURE__ */ e(Fe, { tokenId: o, tokenName: m.name, children: /* @__PURE__ */ e(
|
|
42
|
+
v,
|
|
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(Y, { className: "h-3 w-3" })
|
|
48
|
+
}
|
|
49
|
+
) }) }),
|
|
50
|
+
/* @__PURE__ */ e(
|
|
51
|
+
v,
|
|
52
|
+
{
|
|
53
|
+
variant: "ghost",
|
|
54
|
+
size: "sm",
|
|
55
|
+
onClick: (k) => {
|
|
56
|
+
k.stopPropagation(), y(o);
|
|
57
|
+
},
|
|
58
|
+
disabled: n,
|
|
59
|
+
className: "h-6 w-6 rounded-full p-0 hover:bg-primary/10 hover:text-primary",
|
|
60
|
+
children: /* @__PURE__ */ e(Se, { className: "h-3 w-3" })
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
] }),
|
|
64
|
+
u && /* @__PURE__ */ e(
|
|
65
|
+
v,
|
|
66
|
+
{
|
|
67
|
+
variant: "ghost",
|
|
68
|
+
size: "sm",
|
|
69
|
+
onClick: (k) => {
|
|
70
|
+
k.stopPropagation(), N == null || N(o);
|
|
71
|
+
},
|
|
72
|
+
disabled: n,
|
|
73
|
+
className: "h-6 w-6 rounded-full p-0 hover:bg-primary/10 hover:text-primary",
|
|
74
|
+
children: /* @__PURE__ */ e(Y, { className: "h-3 w-3" })
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
] })
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
), tt = ({ onActiveTokenChange: o, onDirtyStateChange: m }) => {
|
|
81
|
+
const { t: n } = Le(), [i, u] = Ee(he), h = fe(), { saveDesignTokens: y, debouncedSaveDesignTokens: N } = pe(), k = K("pageId", ""), C = K("siteWideUsage", {}), [f, z] = x("view"), [g, R] = x(null), [b, Z] = x(null), [l, D] = x(""), [c, j] = x(""), [O, S] = x(""), [E, ne] = x(""), [se, L] = x(!1), M = U(null), [I, $] = x({
|
|
82
|
+
isOpen: !1,
|
|
83
|
+
tokenId: null,
|
|
84
|
+
tokenName: "",
|
|
85
|
+
pageCount: 0,
|
|
86
|
+
partialCount: 0
|
|
87
|
+
}), P = U(null), re = F(
|
|
88
|
+
(t) => {
|
|
89
|
+
if (!C) return { pageCount: 0, partialCount: 0 };
|
|
90
|
+
let s = 0, r = 0;
|
|
91
|
+
return Object.entries(C).forEach(([d, T]) => {
|
|
92
|
+
if (d === k || !(T != null && T.designTokens)) return;
|
|
93
|
+
Object.keys(T.designTokens).some((ue) => ue === t) && (T.isPartial ? r++ : s++);
|
|
94
|
+
}), { pageCount: s, partialCount: r };
|
|
95
|
+
},
|
|
96
|
+
[C, k]
|
|
97
|
+
), B = Pe(() => Object.entries(i).filter(
|
|
98
|
+
([, t]) => t.name.toLowerCase().includes(E.toLowerCase()) || t.value.toLowerCase().includes(E.toLowerCase())
|
|
99
|
+
), [i, E]);
|
|
100
|
+
ee(() => {
|
|
101
|
+
if (!m)
|
|
102
|
+
return;
|
|
103
|
+
const t = f === "add" && (l && l.trim().length > 0 || c && c.trim().length > 0);
|
|
104
|
+
m(t);
|
|
105
|
+
}, [f, l, c, m]), ee(() => {
|
|
106
|
+
if (o)
|
|
107
|
+
if (f === "edit" || f === "add")
|
|
108
|
+
o(l && c ? {
|
|
109
|
+
name: l,
|
|
110
|
+
value: c,
|
|
111
|
+
id: g || void 0
|
|
112
|
+
} : null);
|
|
113
|
+
else if (f === "view" && b && i[b]) {
|
|
114
|
+
const t = i[b];
|
|
115
|
+
o({
|
|
116
|
+
name: t.name,
|
|
117
|
+
value: t.value,
|
|
118
|
+
id: b
|
|
119
|
+
});
|
|
120
|
+
} else
|
|
121
|
+
o(null);
|
|
122
|
+
}, [f, l, c, g, b, i, o]);
|
|
123
|
+
const ae = () => {
|
|
124
|
+
if (!l.trim() || !c.trim()) {
|
|
125
|
+
p.error(n("Please fill in both token name and classes"));
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (!W(l)) {
|
|
129
|
+
p.error(n("Invalid design token name format"));
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (Object.entries(i).find(
|
|
133
|
+
([s, r]) => r.name === l.trim() && s !== g
|
|
134
|
+
)) {
|
|
135
|
+
p.error(n("Token already exists"));
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
g && ie(l, c);
|
|
139
|
+
}, w = F(() => {
|
|
140
|
+
R(null), D(""), j(""), S(""), L(!1), z("view");
|
|
141
|
+
}, []), ie = F(
|
|
142
|
+
(t, s) => {
|
|
143
|
+
!g || f !== "edit" || !t.trim() || !s.trim() || !W(t) || Object.entries(i).find(
|
|
144
|
+
([d, T]) => T.name === t.trim() && d !== g
|
|
145
|
+
) || (L(!0), M.current && clearTimeout(M.current), M.current = setTimeout(() => {
|
|
146
|
+
const d = {
|
|
147
|
+
...i,
|
|
148
|
+
[g]: {
|
|
149
|
+
name: t.trim(),
|
|
150
|
+
value: s.trim()
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
u(d), h(), N(), L(!1), p.success(n("Token updated successfully")), w();
|
|
154
|
+
}, 10));
|
|
155
|
+
},
|
|
156
|
+
[
|
|
157
|
+
g,
|
|
158
|
+
f,
|
|
159
|
+
i,
|
|
160
|
+
u,
|
|
161
|
+
h,
|
|
162
|
+
N,
|
|
163
|
+
n,
|
|
164
|
+
w
|
|
165
|
+
]
|
|
166
|
+
), oe = () => {
|
|
167
|
+
if (!l.trim() || !c.trim()) {
|
|
168
|
+
p.error(n("Please fill in both token name and classes"));
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (!W(l)) {
|
|
172
|
+
p.error(n("Invalid design token name format"));
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (Object.values(i).find((d) => d.name === l.trim())) {
|
|
176
|
+
p.error(n("Token already exists"));
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const s = `${De}${Ie(12)}`, r = {
|
|
180
|
+
...i,
|
|
181
|
+
[s]: {
|
|
182
|
+
name: l.trim(),
|
|
183
|
+
value: c.trim()
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
u(r), h(), y(), p.success(n("Token added successfully")), w();
|
|
187
|
+
}, G = (t) => {
|
|
188
|
+
const s = i[t];
|
|
189
|
+
if (!s) return;
|
|
190
|
+
const { pageCount: r, partialCount: d } = re(t);
|
|
191
|
+
$({
|
|
192
|
+
isOpen: !0,
|
|
193
|
+
tokenId: t,
|
|
194
|
+
tokenName: s.name,
|
|
195
|
+
pageCount: r,
|
|
196
|
+
partialCount: d
|
|
197
|
+
}), P.current = t;
|
|
198
|
+
}, le = () => {
|
|
199
|
+
const t = P.current;
|
|
200
|
+
if (!t) return;
|
|
201
|
+
const s = {
|
|
202
|
+
...i,
|
|
203
|
+
[t]: {
|
|
204
|
+
...i[t],
|
|
205
|
+
archived: !0
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
u(s), h(), y(), p.success(n("Token archived successfully")), $({
|
|
209
|
+
isOpen: !1,
|
|
210
|
+
tokenId: null,
|
|
211
|
+
tokenName: "",
|
|
212
|
+
pageCount: 0,
|
|
213
|
+
partialCount: 0
|
|
214
|
+
}), P.current = null;
|
|
215
|
+
}, V = (t) => {
|
|
216
|
+
const s = {
|
|
217
|
+
...i,
|
|
218
|
+
[t]: {
|
|
219
|
+
name: i[t].name,
|
|
220
|
+
value: i[t].value
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
u(s), h(), p.success(n("Token unarchived successfully"));
|
|
224
|
+
}, _ = (t) => {
|
|
225
|
+
const s = i[t];
|
|
226
|
+
s && (R(t), D(s.name), j(s.value), S(""), z("edit"));
|
|
227
|
+
}, Q = () => {
|
|
228
|
+
R(null), D(""), j(""), S(""), z("add");
|
|
229
|
+
}, ce = (t) => {
|
|
230
|
+
const s = Be(t);
|
|
231
|
+
D(s);
|
|
232
|
+
const r = $e(s, i, n, f === "edit", g || void 0);
|
|
233
|
+
S(r);
|
|
234
|
+
}, H = (t) => {
|
|
235
|
+
j(t);
|
|
236
|
+
}, de = (t) => {
|
|
237
|
+
const s = we(Ae(Me(c, t)));
|
|
238
|
+
H(s);
|
|
239
|
+
}, me = (t) => {
|
|
240
|
+
const s = c.split(" ").filter((r) => r !== t).join(" ");
|
|
241
|
+
H(s);
|
|
242
|
+
};
|
|
243
|
+
return /* @__PURE__ */ a(A, { children: [
|
|
244
|
+
/* @__PURE__ */ e("div", { className: "flex h-full w-full flex-col", children: f === "view" ? (() => {
|
|
245
|
+
const t = B.filter(([, r]) => !r.archived), s = B.filter(([, r]) => r.archived);
|
|
246
|
+
return /* @__PURE__ */ a(A, { children: [
|
|
247
|
+
Object.entries(i).length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-x-2", children: [
|
|
248
|
+
/* @__PURE__ */ a("div", { className: "relative flex-1", children: [
|
|
249
|
+
/* @__PURE__ */ e(q, { className: "absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground" }),
|
|
250
|
+
/* @__PURE__ */ e(
|
|
251
|
+
X,
|
|
252
|
+
{
|
|
253
|
+
placeholder: n("Search tokens"),
|
|
254
|
+
value: E,
|
|
255
|
+
onChange: (r) => ne(r.target.value),
|
|
256
|
+
className: "h-6 pl-7 text-xs"
|
|
257
|
+
}
|
|
258
|
+
)
|
|
259
|
+
] }),
|
|
260
|
+
/* @__PURE__ */ a(
|
|
261
|
+
v,
|
|
262
|
+
{
|
|
263
|
+
variant: "outline",
|
|
264
|
+
onClick: Q,
|
|
265
|
+
size: "sm",
|
|
266
|
+
className: "h-6 border-primary text-xs text-primary hover:bg-primary/10 hover:text-primary",
|
|
267
|
+
children: [
|
|
268
|
+
/* @__PURE__ */ e(J, { className: "h-3 w-3" }),
|
|
269
|
+
n("Add")
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
] }),
|
|
274
|
+
/* @__PURE__ */ e("div", { className: "no-scrollbar flex flex-1 flex-col overflow-hidden pt-2", children: /* @__PURE__ */ e(Te, { className: "flex h-full flex-1 items-center justify-center", children: /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
275
|
+
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: [
|
|
276
|
+
/* @__PURE__ */ e("div", { className: "mb-2 text-3xl", children: /* @__PURE__ */ e(je, { className: "h-12 w-12 text-muted-foreground" }) }),
|
|
277
|
+
/* @__PURE__ */ e("p", { className: "mb-1 text-sm font-medium text-foreground", children: n("No design tokens yet") }),
|
|
278
|
+
/* @__PURE__ */ e("p", { className: "text-center text-xs text-muted-foreground", children: n("Create reusable design tokens to streamline your styling") }),
|
|
279
|
+
/* @__PURE__ */ a(v, { variant: "default", onClick: Q, size: "sm", className: "mt-4 h-7 text-xs leading-tight", children: [
|
|
280
|
+
/* @__PURE__ */ e(J, { className: "mr-1 h-3 w-3" }),
|
|
281
|
+
n("Add first design token")
|
|
282
|
+
] })
|
|
283
|
+
] }) : B.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: [
|
|
284
|
+
/* @__PURE__ */ e("div", { className: "mb-2", children: /* @__PURE__ */ e(q, { className: "h-10 w-10 text-muted-foreground" }) }),
|
|
285
|
+
/* @__PURE__ */ e("p", { className: "mb-1 text-sm font-medium text-foreground", children: n("No tokens found") }),
|
|
286
|
+
/* @__PURE__ */ e("p", { className: "text-center text-xs text-muted-foreground", children: n("No design tokens match your search") })
|
|
287
|
+
] }) : /* @__PURE__ */ a(A, { children: [
|
|
288
|
+
t.length > 0 && /* @__PURE__ */ e("div", { className: "space-y-1", children: t.map(([r, d]) => /* @__PURE__ */ e(
|
|
289
|
+
te,
|
|
290
|
+
{
|
|
291
|
+
token: d,
|
|
292
|
+
tokenId: r,
|
|
293
|
+
isSelected: b === r,
|
|
294
|
+
isArchived: !1,
|
|
295
|
+
onSelect: Z,
|
|
296
|
+
onEdit: _,
|
|
297
|
+
onArchive: G,
|
|
298
|
+
onUnarchive: V,
|
|
299
|
+
isDisabled: !1
|
|
300
|
+
},
|
|
301
|
+
r
|
|
302
|
+
)) }),
|
|
303
|
+
s.length > 0 && /* @__PURE__ */ a("div", { className: "mt-4 space-y-1", children: [
|
|
304
|
+
/* @__PURE__ */ e("div", { className: "px-2 py-1 text-[10px] font-semibold text-muted-foreground", children: n("Archived") }),
|
|
305
|
+
s.map(([r, d]) => /* @__PURE__ */ e(
|
|
306
|
+
te,
|
|
307
|
+
{
|
|
308
|
+
token: d,
|
|
309
|
+
tokenId: r,
|
|
310
|
+
isSelected: b === r,
|
|
311
|
+
isArchived: !0,
|
|
312
|
+
onSelect: Z,
|
|
313
|
+
onEdit: _,
|
|
314
|
+
onArchive: G,
|
|
315
|
+
onUnarchive: V,
|
|
316
|
+
isDisabled: !1
|
|
317
|
+
},
|
|
318
|
+
r
|
|
319
|
+
))
|
|
320
|
+
] })
|
|
321
|
+
] }),
|
|
322
|
+
/* @__PURE__ */ e("div", { className: "h-44" })
|
|
323
|
+
] }) }) })
|
|
324
|
+
] });
|
|
325
|
+
})() : (() => {
|
|
326
|
+
const t = f === "edit", s = n(t ? "Edit Design Token" : "Add Design Token"), r = n(t ? "Update design token" : "Create a reusable design token");
|
|
327
|
+
return /* @__PURE__ */ a("div", { className: "flex h-full flex-col", children: [
|
|
328
|
+
/* @__PURE__ */ a("div", { className: "mb-3 flex items-center gap-2 rounded-md border border-border/50 bg-muted p-1.5", children: [
|
|
329
|
+
/* @__PURE__ */ e(
|
|
330
|
+
v,
|
|
331
|
+
{
|
|
332
|
+
variant: "ghost",
|
|
333
|
+
size: "sm",
|
|
334
|
+
onClick: w,
|
|
335
|
+
className: "h-6 w-6 rounded-full p-0 hover:bg-muted",
|
|
336
|
+
children: /* @__PURE__ */ e(Oe, { className: "h-3 w-3" })
|
|
337
|
+
}
|
|
338
|
+
),
|
|
339
|
+
/* @__PURE__ */ a("div", { className: "flex-1", children: [
|
|
340
|
+
/* @__PURE__ */ e("h3", { className: "text-xs font-semibold text-foreground", children: s }),
|
|
341
|
+
/* @__PURE__ */ e("p", { className: "text-[10px] text-muted-foreground", children: r })
|
|
342
|
+
] }),
|
|
343
|
+
t && se && /* @__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" }) })
|
|
344
|
+
] }),
|
|
345
|
+
/* @__PURE__ */ a("div", { className: "flex-1 space-y-3 overflow-y-auto", children: [
|
|
346
|
+
/* @__PURE__ */ a("div", { className: "space-y-1.5", children: [
|
|
347
|
+
/* @__PURE__ */ e(ye, { htmlFor: "token-name", className: "text-xs font-medium", children: n("Token Name") }),
|
|
348
|
+
/* @__PURE__ */ e(
|
|
349
|
+
X,
|
|
350
|
+
{
|
|
351
|
+
id: "token-name",
|
|
352
|
+
placeholder: "Button-Primary",
|
|
353
|
+
value: l,
|
|
354
|
+
onChange: (d) => ce(d.target.value),
|
|
355
|
+
className: "h-7 text-xs"
|
|
356
|
+
}
|
|
357
|
+
),
|
|
358
|
+
O ? /* @__PURE__ */ e("span", { className: "text-[10px] text-destructive", children: O }) : /* @__PURE__ */ e("span", { className: "text-[10px] font-light text-muted-foreground", children: n("Button-Primary, Card-Header, Text-Large etc.") })
|
|
359
|
+
] }),
|
|
360
|
+
/* @__PURE__ */ e(
|
|
361
|
+
Ce,
|
|
362
|
+
{
|
|
363
|
+
from: "designToken",
|
|
364
|
+
classFromProps: c,
|
|
365
|
+
onAddNew: de,
|
|
366
|
+
onRemove: me,
|
|
367
|
+
showDesignTokenSuggestions: !1
|
|
368
|
+
}
|
|
369
|
+
),
|
|
370
|
+
/* @__PURE__ */ a("div", { className: "mt-3 flex items-center justify-end gap-2 pt-3", children: [
|
|
371
|
+
/* @__PURE__ */ e(v, { variant: "outline", onClick: w, className: "h-7 text-xs", children: n("Cancel") }),
|
|
372
|
+
t ? /* @__PURE__ */ e(
|
|
373
|
+
v,
|
|
374
|
+
{
|
|
375
|
+
onClick: ae,
|
|
376
|
+
disabled: !l.trim() || !c.trim() || !!O,
|
|
377
|
+
className: "h-7 text-xs",
|
|
378
|
+
children: n("Save Token")
|
|
379
|
+
}
|
|
380
|
+
) : /* @__PURE__ */ e(
|
|
381
|
+
v,
|
|
382
|
+
{
|
|
383
|
+
onClick: oe,
|
|
384
|
+
disabled: !l.trim() || !c.trim() || !!O,
|
|
385
|
+
className: "h-7 text-xs",
|
|
386
|
+
children: n("Add Token")
|
|
387
|
+
}
|
|
388
|
+
)
|
|
389
|
+
] })
|
|
390
|
+
] })
|
|
391
|
+
] });
|
|
392
|
+
})() }),
|
|
393
|
+
/* @__PURE__ */ e(
|
|
394
|
+
ge,
|
|
395
|
+
{
|
|
396
|
+
open: I.isOpen,
|
|
397
|
+
onOpenChange: (t) => {
|
|
398
|
+
t || ($({
|
|
399
|
+
isOpen: !1,
|
|
400
|
+
tokenId: null,
|
|
401
|
+
tokenName: "",
|
|
402
|
+
pageCount: 0,
|
|
403
|
+
partialCount: 0
|
|
404
|
+
}), P.current = null);
|
|
405
|
+
},
|
|
406
|
+
children: /* @__PURE__ */ a(xe, { children: [
|
|
407
|
+
/* @__PURE__ */ e(ve, { children: n("Archive Design Token") }),
|
|
408
|
+
/* @__PURE__ */ a(ke, { className: "space-y-3", children: [
|
|
409
|
+
/* @__PURE__ */ a("p", { children: [
|
|
410
|
+
n("This token is used on"),
|
|
411
|
+
" ",
|
|
412
|
+
/* @__PURE__ */ e("span", { className: "font-semibold", children: I.pageCount }),
|
|
413
|
+
" ",
|
|
414
|
+
n("pages"),
|
|
415
|
+
I.partialCount > 0 && /* @__PURE__ */ a(A, { children: [
|
|
416
|
+
" ",
|
|
417
|
+
n("and"),
|
|
418
|
+
" ",
|
|
419
|
+
/* @__PURE__ */ e("span", { className: "font-semibold", children: I.partialCount }),
|
|
420
|
+
" ",
|
|
421
|
+
n("partials")
|
|
422
|
+
] }),
|
|
423
|
+
"."
|
|
424
|
+
] }),
|
|
425
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: n("Archiving this token will remove the styling for those blocks.") }),
|
|
426
|
+
/* @__PURE__ */ e("p", { children: n("Do you wish to continue?") })
|
|
427
|
+
] }),
|
|
428
|
+
/* @__PURE__ */ a("div", { className: "flex justify-end gap-2", children: [
|
|
429
|
+
/* @__PURE__ */ e(Ne, { children: n("Cancel") }),
|
|
430
|
+
/* @__PURE__ */ e(
|
|
431
|
+
be,
|
|
432
|
+
{
|
|
433
|
+
onClick: le,
|
|
434
|
+
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
435
|
+
children: n("Archive")
|
|
436
|
+
}
|
|
437
|
+
)
|
|
438
|
+
] })
|
|
439
|
+
] })
|
|
440
|
+
}
|
|
441
|
+
)
|
|
442
|
+
] });
|
|
443
|
+
};
|
|
444
|
+
export {
|
|
445
|
+
tt as default
|
|
446
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-P-2SvZA9.cjs"),y=require("@radix-ui/react-icons"),c=require("react"),j=require("react-i18next"),g=require("./default-theme-options-DN-3gIjM.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-B_-TrQgu.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-[540px] 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;
|
|
@@ -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, an as T, ao as M, ap as H, aq as _, ar as j, as as I, a7 as P, D as S, e as L, f as E, g as O, a1 as U, a2 as q, at as R, a3 as $, a4 as V, au as Y, a5 as z, a6 as B } from "./index-DpeytsiB.js";
|
|
3
|
+
import { TokensIcon as Q } from "@radix-ui/react-icons";
|
|
4
|
+
import { useMemo as u, useEffect as b, useState as g, useCallback as w } 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 "./default-theme-options-saBIkWGT.js";
|
|
7
|
+
import { get as v, 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-CHpHE-dx.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 = v(s, "fontFamily.heading"), d = v(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 = w(
|
|
122
|
+
(h) => {
|
|
123
|
+
if (!h && t) {
|
|
124
|
+
m(!0);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
a(h);
|
|
128
|
+
},
|
|
129
|
+
[t, a]
|
|
130
|
+
), d = w(() => {
|
|
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-[540px] 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
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("./register-chai-top-bar-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("./register-chai-top-bar-DyW9GPzV.cjs"),t=require("./index-P-2SvZA9.cjs"),y=require("./index-CQf0jL1k.cjs"),w=require("lodash-es"),m=require("lucide-react"),l=require("react"),M=require("react-i18next"),k=require("sonner"),B=1*1024*1024,A=({page:r,onClose:u})=>{const{t:s}=M.useTranslation(),[f,p]=l.useState(!1),[j,T]=l.useState(""),[c,N]=l.useState(""),[v,x]=l.useState(!1),i=l.useRef(null),C=y.useMarkAsTemplate(),{data:h}=y.usePageTypes(),g=h==null?void 0:h.find(a=>a.key===r.pageType),I=(g==null?void 0:g.name)||w.startCase(r.pageType),D=l.useCallback(a=>{var b;const d=(b=a.target.files)==null?void 0:b[0];if(d){if(d.size>B){k.toast.error(s("File too large"),{description:`${s("Maximum file size is 1MB. Selected file is")} ${(d.size/1024).toFixed(2)}KB.`}),i.current&&(i.current.value="");return}try{x(!0);const n=new FileReader;n.onloadend=()=>{N(n.result),x(!1)},n.readAsDataURL(d)}catch(n){console.error("Error reading file:",n),x(!1),k.toast.error(s("Failed to process image"),{description:n instanceof Error?n.message:s("Unknown error")})}}},[s]),F=()=>{N(""),i.current&&(i.current.value="")},S=()=>{var a;(a=i.current)==null||a.click()},q=()=>{p(!0),C.mutate({page:r,name:r.name,description:j.trim()||void 0,pageType:r.pageType,...c?{previewImage:c}:{}},{onSuccess:()=>{p(!1),u()},onError:()=>{p(!1)}})};return e.jsx(t.Dialog,{open:!0,onOpenChange:u,children:e.jsxs(t.DialogContent,{children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{children:s("Mark as template")}),e.jsxs(t.DialogDescription,{className:"space-y-1 py-4 text-xs text-slate-500",children:[s("Are you sure you want to mark this page as a template?"),e.jsx("br",{}),s("Templates can be used to create new pages with the same content.")]})]}),e.jsxs("div",{className:"mb-4 space-y-4 text-xs",children:[e.jsxs("div",{className:"space-y-3 rounded border bg-slate-50 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(m.Tag,{className:"h-4 w-4 text-slate-500"}),e.jsxs("span",{className:"font-medium text-slate-500",children:[s("Page Name"),":"]}),e.jsx("span",{className:"font-semibold",children:w.startCase(r.name)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(m.File,{className:"h-4 w-4 text-slate-500"}),e.jsxs("span",{className:"font-medium text-slate-500",children:[s("Type"),":"]}),e.jsx("span",{className:"font-semibold",children:I})]})]}),e.jsxs("div",{children:[e.jsx(t.Label,{htmlFor:"description",className:"text-xs font-medium",children:s("Description (Optional)")}),e.jsx(t.Textarea,{id:"description",placeholder:s("Describe this template's purpose"),className:"mt-1 h-24 resize-none text-xs",value:j,onChange:a=>T(a.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t.Label,{htmlFor:"previewImage",className:"text-xs font-medium",children:s("Preview Image (Optional)")}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(o.Input,{type:"file",id:"previewImage",ref:i,onChange:D,accept:"image/*",className:"hidden"}),e.jsx(o.Button,{type:"button",variant:"outline",onClick:S,disabled:v,className:"w-full",children:v?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),s("Uploading...")]}):e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(m.ImageIcon,{className:"h-4 w-4"}),s("Select image")]})}),c&&e.jsx(o.Button,{type:"button",variant:"outline",size:"icon",onClick:F,children:e.jsx(m.X,{className:"h-4 w-4"})})]}),c&&e.jsx("div",{className:"aspect-video overflow-hidden rounded-md border",children:e.jsx("img",{src:c,alt:s("Preview"),className:"h-full max-h-[200px] w-full object-contain"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("max 1mb")})]})]})]}),e.jsxs(t.DialogFooter,{className:f?"pointer-events-none opacity-75":"",children:[e.jsx(o.Button,{variant:"outline",onClick:a=>{a.stopPropagation(),u()},children:s("Cancel")}),e.jsx(o.Button,{variant:"default",disabled:f,onClick:q,children:s("Mark as template")})]})]})})};exports.default=A;
|