@chaibuilder/sdk 4.0.0-beta.4 → 4.0.0-beta.41
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-Difo_1pg.js → 2SSKDMRQ-CdpXONNF.js} +3 -3
- package/dist/{2SSKDMRQ-CopJgtZb.cjs → 2SSKDMRQ-Dq_oq6gn.cjs} +1 -1
- package/dist/{AP7HFJJL-BPuPBqj4.js → AP7HFJJL-CZb0rAxI.js} +1 -1
- package/dist/{AP7HFJJL-DYxDgaOs.cjs → AP7HFJJL-Do14BULM.cjs} +1 -1
- package/dist/{IconPicker-B2-oriq2.js → IconPicker-CvZSjXc6.js} +2 -2
- package/dist/{IconPicker-C0oycHbs.cjs → IconPicker-DUN9bxmQ.cjs} +1 -1
- package/dist/STRINGS-BExFecZW.js +8 -0
- package/dist/STRINGS-FNnfjF5H.cjs +1 -0
- package/dist/{WDYDFRGG-DbejaRPK.cjs → WDYDFRGG-DfczfcZ8.cjs} +1 -1
- package/dist/{WDYDFRGG-KK8pkcW1.js → WDYDFRGG-Dxa2zFdt.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-DkR2HWI4.js → active-in-another-tab-BREv3Xj8.js} +5 -5
- package/dist/{active-in-another-tab-Cu_ASKtx.cjs → active-in-another-tab-C9o276yY.cjs} +1 -1
- package/dist/{add-new-language-page-CBY0RR6q.js → add-new-language-page-C4PSVDV5.js} +4 -4
- package/dist/{add-new-language-page-BXuwluuU.cjs → add-new-language-page-jHLJjrl1.cjs} +1 -1
- package/dist/{add-new-page-C_PzKby8.cjs → add-new-page-BPPMxBYi.cjs} +1 -1
- package/dist/add-new-page-DomZuT16.js +31 -0
- package/dist/{ai-panel-content--YM01Aly.js → ai-panel-content-CsmUoTCg.js} +6 -6
- package/dist/{ai-panel-content-rRmJdH7L.cjs → ai-panel-content-DlS51Qef.cjs} +1 -1
- package/dist/ai-panel-default-lang-BRVlAMMU.js +317 -0
- package/dist/ai-panel-default-lang-DVKDEnbe.cjs +3 -0
- package/dist/ai-panel-other-lang-B-2xJz2W.cjs +1 -0
- package/dist/ai-panel-other-lang-BPVS6lO_.js +132 -0
- package/dist/{ai-prompt-input-DueQYNf-.js → ai-prompt-input-B0FMhaLB.js} +30 -34
- package/dist/{ai-prompt-input-N9PcYCFa.cjs → ai-prompt-input-CY2pBPzO.cjs} +1 -1
- package/dist/{ai-translation-prompt-B36F3d7K.js → ai-translation-prompt-6LlaU9LO.js} +2 -2
- package/dist/{ai-translation-prompt-IAdWMNZb.cjs → ai-translation-prompt-BwhKmgC3.cjs} +1 -1
- package/dist/apply-binding-BuwI_Uf5.cjs +41 -0
- package/dist/apply-binding-RQRSIe56.js +942 -0
- package/dist/change-password-modal-BlSTfit6.js +137 -0
- package/dist/change-password-modal-wbCcGfDM.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-BC_saYAw.cjs +1 -0
- package/dist/code-editor-Be5VT6om.js +57 -0
- package/dist/{continue-editing-in-this-client-DmGFLHXw.cjs → continue-editing-in-this-client-Bs_3q1hH.cjs} +1 -1
- package/dist/{continue-editing-in-this-client-Dm9cCj7K.js → continue-editing-in-this-client-Z1rBUPU8.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-9P_0uNa4.js → css-import-modal-DMZRgpy0.js} +8 -8
- package/dist/{css-import-modal-Rh1QAVxo.cjs → css-import-modal-QaTHJ7CT.cjs} +1 -1
- package/dist/delete-page-BoP3I06P.js +84 -0
- package/dist/delete-page-CjXYHAsS.cjs +1 -0
- package/dist/{design-token-usage-MNYsFlPG.js → design-token-usage-DFanW2r-.js} +26 -26
- package/dist/{design-token-usage-CXglXgcJ.cjs → design-token-usage-kEPgi-3C.cjs} +1 -1
- package/dist/{digital-asset-manager-CqCWBO0s.js → digital-asset-manager-BbI7Ye34.js} +6 -6
- package/dist/digital-asset-manager-N8tcW28y.cjs +1 -0
- package/dist/{duplicate-page-DzZByALW.cjs → duplicate-page-B-4nFU4j.cjs} +1 -1
- package/dist/{duplicate-page-BknLfqr0.js → duplicate-page-C6y7FdRQ.js} +7 -7
- package/dist/{dynamic-page-selector-WA007Sni.cjs → dynamic-page-selector-Cq4U-49i.cjs} +1 -1
- package/dist/{dynamic-page-selector-DoW7OyUB.js → dynamic-page-selector-DQCWphi0.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-BApShjRz.cjs → get-chai-builder-theme-B5RkBTsB.cjs} +1 -1
- package/dist/{get-chai-builder-theme-DDVRJQ6Z.js → get-chai-builder-theme-BpuwSLeS.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-565A0NpE.cjs} +1 -1
- package/dist/{image-editor-CQnNtak2.js → image-editor-Dz_HQ0I8.js} +1 -1
- package/dist/index-3pEi7VzS.cjs +5 -0
- package/dist/index-C3CV1lXL.cjs +160 -0
- package/dist/index-CDVuf3C1.js +5118 -0
- package/dist/{index-rAcNbjk_.js → index-wBr2Ml98.js} +6152 -6102
- package/dist/{json-diff-viewer-CLuUHiPU.cjs → json-diff-viewer-CMYFM6D6.cjs} +7 -7
- package/dist/{json-diff-viewer-CMvGUvJ2.js → json-diff-viewer-DG7a5-2B.js} +87 -85
- package/dist/{lang-panel-CnwTb05j.js → lang-panel-BvGiJJ8s.js} +26 -26
- package/dist/lang-panel-D97iJH-l.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-4Gu6TMKZ.js +446 -0
- package/dist/manage-design-tokens-Do9Kptp3.cjs +1 -0
- package/dist/manage-design-tokens-modal-Btbdgoun.cjs +1 -0
- package/dist/manage-design-tokens-modal-CkyFE8NW.js +161 -0
- package/dist/{mark-as-template-DBLshWb5.js → mark-as-template-Djhnj93U.js} +11 -11
- package/dist/{mark-as-template-CpWEBJGd.cjs → mark-as-template-QPJ0DqxL.cjs} +1 -1
- package/dist/{nested-path-selector-content-C2sD9dkq.cjs → nested-path-selector-content-BcmSxXxL.cjs} +1 -1
- package/dist/{nested-path-selector-content-6OBJ8LG8.js → nested-path-selector-content-DkPIHcVj.js} +2 -2
- package/dist/{no-language-page-content-CzENgtnu.js → no-language-page-content-DTq-5StU.js} +9 -9
- package/dist/{no-language-page-content-BvPDdccK.cjs → no-language-page-content-ZQz4Kr0-.cjs} +1 -1
- package/dist/{no-language-page-dialog-CbYI2cVg.js → no-language-page-dialog-2rA-YBbC.js} +2 -2
- package/dist/{no-language-page-dialog-CgW4yJBC.cjs → no-language-page-dialog-BsLkwJID.cjs} +1 -1
- package/dist/{page-creator-Cc83uQqw.js → page-creator-Dzpc0_dN.js} +143 -143
- package/dist/page-creator-lcDUpPjh.cjs +1 -0
- package/dist/{page-lock-CT7SmQqp.cjs → page-lock-B2GU-1YM.cjs} +1 -1
- package/dist/{page-lock-BJUkyxdh.js → page-lock-ulFtdOkt.js} +2 -2
- package/dist/{page-locked-dialog-DsEbWRed.js → page-locked-dialog-B9VpkvhN.js} +22 -22
- package/dist/page-locked-dialog-CJ53Z6sQ.cjs +1 -0
- package/dist/page-manager-new-CkoS0B1i.cjs +1 -0
- package/dist/page-manager-new-OoC8W7Yn.js +408 -0
- package/dist/{page-manager-search-and-filter-Bfm0j1gg.cjs → page-manager-search-and-filter-BosoN3wg.cjs} +1 -1
- package/dist/{page-manager-search-and-filter-zq-LfhQ1.js → page-manager-search-and-filter-JfSTGlvp.js} +30 -29
- package/dist/{page-revisions-content-D38G2tJM.js → page-revisions-content-DsFh5itr.js} +133 -122
- package/dist/page-revisions-content-Dtd-t1N3.cjs +1 -0
- package/dist/pages.cjs +1 -1
- package/dist/pages.d.ts +330 -96
- package/dist/pages.js +23 -19
- package/dist/plugin-BSjgGgwo.js +248 -0
- package/dist/plugin-DHpuZZXz.cjs +22 -0
- package/dist/publish-pages-content-C7oS7pkz.cjs +1 -0
- package/dist/{publish-pages-content-CS7f41Ac.js → publish-pages-content-DJc7iu8d.js} +39 -39
- 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-BKQaoxh9.cjs} +1 -1
- package/dist/{rte-widget-modal-D6Zik0Ta.js → rte-widget-modal-BdBYmqgs.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-WwOzbgiF.js → save-to-lib-5nwSdZ9R.js} +153 -147
- package/dist/save-to-lib-D0WdH4lq.cjs +1 -0
- package/dist/sdk.css +1 -1
- package/dist/{selected-block-display-B1SG_UXw.js → selected-block-display-D8ROZHHv.js} +12 -12
- package/dist/{selected-block-display-BOgnQRLF.cjs → selected-block-display-DjYeUPdU.cjs} +1 -1
- package/dist/{seo-panel-BkOgRoWd.js → seo-panel-BbyRNAEo.js} +27 -27
- package/dist/seo-panel-DRjSxmk5.cjs +2 -0
- package/dist/shared-json-ld-BbNLdzCO.cjs +1 -0
- package/dist/{shared-json-ld-uka9TOgA.js → shared-json-ld-EPbpTI9V.js} +88 -88
- package/dist/{slug-input-Cyd6NR6J.cjs → slug-input-CIzxXknM.cjs} +1 -1
- package/dist/{slug-input-DHLmUNrH.js → slug-input-DSbJecNr.js} +8 -8
- 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-Ca0X-qyf.js → take-over-request-BOGDk0H4.js} +13 -13
- package/dist/take-over-request-BXntCMdj.cjs +1 -0
- package/dist/{translation-warning-modal-pSZVKcNW.cjs → translation-warning-modal-DhJaOyLo.cjs} +1 -1
- package/dist/{translation-warning-modal-DrpFeI83.js → translation-warning-modal-reVr0L9e.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-BMqgelv-.js → unmark-as-template-BM85Y7WK.js} +11 -11
- package/dist/{unmark-as-template-DF1Ms4VN.cjs → unmark-as-template-DOPyeU7R.cjs} +1 -1
- package/dist/unpublish-page-DHfds-1-.js +28 -0
- package/dist/{unpublish-page-Bsq2yEqQ.cjs → unpublish-page-Dz028Bzp.cjs} +1 -1
- package/dist/unpublished-partials-modal-BO5ZZdTw.js +52 -0
- package/dist/unpublished-partials-modal-CMqQa9-m.cjs +1 -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-kres0aG7.cjs → web-preview-5MzixBt5.cjs} +1 -1
- package/dist/{web-preview-D6h1L2nV.js → web-preview-BNjG8s8A.js} +2 -2
- 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/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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const T=require("./common-functions-B3a4xKt_.cjs"),e=require("lodash-es"),f=require("himalaya"),q=require("./core-Y0lXLwkq.cjs"),U=require("tailwind-merge"),m="#styles:",Y="__ADD_BLOCK_INTERNAL_ROOT",K="@",H="#",v="dt#",O=t=>{if(t=t.replace(m,""),!t)return{baseClasses:"",classes:""};const l=t.split(/,(?![^\[]*\])/);if(l.length===1)return{baseClasses:"",classes:l[0].trim()};const[n,...s]=l;return{baseClasses:n.trim(),classes:s.join(",").trim().replace(/ +(?= )/g,"")}};function X(t,l,n){const s=e.get(n,"i18nProps",[]);if(e.isEmpty(l)||e.isEmpty(s))return t;const a=e.cloneDeep(t);return e.forEach(e.keys(a),o=>{if(e.includes(s,o)&&!e.isEmpty(l)){const r=e.get(a,o),i=e.get(a,`${o}-${l}`,"");e.isString(r)?a[o]=e.isString(i)&&!e.isEmpty(i.trim())&&i.trimStart()||r:a[o]=e.isEmpty(i)?r:i}}),a}const M=(t,l)=>{const{baseClasses:n,classes:s}=O(t),o=s.split(" ").filter(i=>i.startsWith(v)).map(i=>{var d;return(d=l[i])==null?void 0:d.value}),r=s.split(" ").filter(i=>!i.startsWith(v)).join(" ");return U.twMerge.apply(null,[n,...o,r])};function G(t,l){return e.get(t,`${l}_attrs`,{})}function Z(t,l=!0,n={}){const s={};return Object.keys(t).forEach(a=>{if(e.isString(t[a])&&t[a].startsWith(m)){const o=M(t[a],n),r=G(t,a);s[a]={...!e.isEmpty(o)&&{className:o},...r,...l?{"data-style-prop":a,"data-block-parent":t._id,"data-style-id":`${a}-${t._id}`}:{}}}}),s}const Q=e.memoize(t=>{const l=q.getRegisteredChaiBlock(t),n=e.get(l,"schema.properties",{});return Object.fromEntries(Object.entries(n).filter(([,s])=>e.get(s,"runtime",!1)))}),ee=(t,l)=>{if(!e.isArray(t))return t;let n=t,s;return typeof l.limit=="number"&&l.limit>0&&(s=l.limit),s!==void 0&&(n=n.slice(0,s)),n},te=(t,l)=>{const n=e.cloneDeep(t);return e.forEach(e.keys(n),s=>{if(e.isString(n[s])&&!e.startsWith(s,"_")){let a=n[s];s==="repeaterItems"&&(n.repeaterItemsBinding=a);const o=/\{\{(.*?)\}\}/g,r=a.match(o);r&&r.forEach(i=>{let d=i.slice(2,-2);const c=e.get(l,d,i);a=e.isArray(c)?c:a.replace(i,c)}),n[s]=a}}),n},se=t=>{const l=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,n=/(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;return l.test(t)||n.test(t)},ne=t=>{if(e.isEmpty(t))return t;const l=/<video[^>]+src=['"]([^'">]+)['"]/,n=/<iframe[^>]+src=['"]([^'">]+)['"]/,s=t.match(l),a=t.match(n),o=s?s[1]:a?a[1]:null,r=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,i=/(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;return o&&(r.test(o)||i.test(o))?o:t},F=["chai-name","data-chai-name"],ae={img:{alt:"alt",width:"width",height:"height",src:"image"},video:{src:"url",autoplay:"controls.autoPlay",muted:"controls.muted",loop:"controls.loop",controls:"controls.widgets"},a:{href:"link.href",target:"link.target",type:""},input:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},textarea:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},select:{placeholder:"placeholder",required:"required",multiple:"multiple",name:"fieldName"},form:{action:"action"}},le=(t,l)=>{var n;return((n=t.children)==null?void 0:n.length)===1&&e.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link","RichText"],l._type)},E=t=>t.map(l=>l.type==="text"?e.get(l,"content",""):e.isEmpty(l.children)?"":E(l.children||[])).join(""),B=t=>t===null?"":t,J=t=>{const l=e.compact(e.map(t.split(/\s+/),e.trim)),n=e.find(l,i=>/^w-/.test(i)),s=e.find(l,i=>/^h-/.test(i));if(!s||!n)return{height:"",width:""};const a=i=>{if(!i)return;const d=i.match(/^[wh]-(?:\[(.*?)\]|(.+))$/);if(!d)return;if(d[1])return d[1];const c=d[2];return/^\d+(\.\d+)?$/.test(c)?`${Number(c)*4}px`:c==="auto"||e.includes(c,"%")?c:"16px"},o=a(n),r=a(s);return{width:e.includes(o,"px")?o:"16px",height:e.includes(r,"px")?r:"16px"}},V=t=>{if(t.tagName==="svg")return{};const l={},n=ae[t.tagName||""]||{},s=t.attributes||[];return e.forEach(s,({key:a,value:o})=>{var r;if(!e.includes(F,a))if(a==="bid"&&(l._bid=B(o)),n[a]){if(t.tagName==="img"&&a==="src"&&!o.startsWith("http")){const i=e.find(t.attributes,{key:"width"}),d=e.find(t.attributes,{key:"height"});i&&d?o=`https://picsum.photos/${i==null?void 0:i.value}x${d==null?void 0:d.value}`:o="https://picsum.photos/150x150"}else if(t.tagName==="a"){const i=e.find(t.attributes,{key:"href"});i&&typeof(i==null?void 0:i.value)=="string"&&((r=i==null?void 0:i.value)!=null&&r.startsWith("pageType:"))&&e.set(l,"link.type","pageType")}e.set(l,n[a],B(o))}else e.includes(["style","class","srcset","bid"],a)||(l.styles_attrs=l.styles_attrs||{},e.startsWith(a,"@")&&(a=a.replace("@","x-on:")),l.styles_attrs[`${a}`]=B(o))}),delete l.class,l},oe=(t,l="styles")=>{if(!t.attributes)return{[l]:`${m},`};const n=e.find(t.attributes,{key:"class"});if(n){const s=n.value;return{[l]:`${m},${s}`}}return{[l]:`${m},`}},ie=t=>{const l=e.get(t,"attributes",[]),n=l.find(c=>c.key==="data-chai-richtext"||c.key==="chai-richtext"),s=l.find(c=>c.key==="data-chai-lightbox"||c.key==="chai-lightbox"),a=l.find(c=>c.key==="data-chai-dropdown"||c.key==="chai-dropdown"),o=l.find(c=>c.key==="data-chai-dropdown-button"||c.key==="chai-dropdown-button"),r=l.find(c=>c.key==="data-chai-dropdown-content"||c.key==="chai-dropdown-content"),i=l.find(c=>c.key==="class"),d=i&&i.value.split(/\s+/).includes("rte");if(a)return{_type:"Dropdown"};if(o)return{_type:"DropdownButton"};if(r)return{_type:"DropdownContent"};if(n||d)return{_type:"Paragraph"};if(s)return{_type:"LightBoxLink"};switch(t.tagName){case"img":return{_type:"Image"};case"input":return{_type:"Input",showLabel:!1};case"hr":return{_type:"Divider"};case"br":return{_type:"LineBreak"};case"textarea":return{_type:"TextArea",showLabel:!1};case"audio":return{_type:"Audio"};case"canvas":return{_type:"Canvas"};case"video":case"iframe":return{_type:"CustomHTML"};case"svg":return{_type:"Icon"};case"select":return{_type:"Select",options:[]};case"option":return{_type:"Option"};case"ul":case"ol":case"dl":return{_type:"List",tag:t.tagName,_listType:t.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:t.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:t.tagName};case"p":return{_type:"Paragraph",content:""};case"a":return{_type:"Link"};case"form":return{_type:"Form"};case"label":return{_type:"Label"};case"button":return{_type:"Button"};case"code":return{_type:"Box",_name:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:t.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:t.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:{const c=e.get(t,"children",[]).length>0?"Box":"EmptyBox";return{_type:c,tag:t.tagName,_name:c=="EmptyBox"||t.tagName==="div"?c:e.capitalize(t.tagName)}}}},w=(t,l=null)=>e.flatMapDeep(t,n=>{var D,C,I,$,N,L,W,A,P,R;if(n.type==="comment")return[];let s={_id:T.generateUUID()};if(l&&(s._parent=l.block._id),n.type==="text")return e.isEmpty(e.get(n,"content",""))?[]:l&&le(l.node,l.block)?(e.set(l,"block.content",e.get(n,"content","")),[]):{...s,_type:"Text",content:e.get(n,"content","")};if(e.startsWith(n.tagName,"chai-")){const p=n.attributes||[],u=e.find(p,{key:"chai-type"}),y=(u==null?void 0:u.value)||e.startCase(e.camelCase(n.tagName||"")).replace(/ /g,"").replace(/\s+/g,"");s._type=y,e.forEach(p,({key:h,value:j})=>{if(h==="about-this-component"||h==="chai-type"||h==="can-move"||h==="can-delete")return;if(h==="id"){s._id=j;return}const z=e.startsWith(h,"_")?h:e.camelCase(h);let k=B(j);typeof k=="string"&&e.startsWith(k,"#styles:")&&(k=k.replace("#styles:","#styles:,")),s[z]=k});const g=w(n.children||[],{block:s,node:n});return[s,...g]}const a=e.get(n,"attributes",[]),o=n.tagName==="p"||a.find(p=>p.key==="data-chai-richtext"||p.key==="chai-richtext"),r=a.find(p=>p.key==="class"),i=r&&r.value.split(/\s+/).includes("rte"),d=a.find(p=>p.key==="data-chai-lightbox"||p.key==="chai-lightbox"),c=a.find(p=>p.key==="data-chai-dropdown"||p.key==="chai-dropdown"),b=a.find(p=>p.key==="data-chai-dropdown-button"||p.key==="chai-dropdown-button"),_=a.find(p=>p.key==="data-chai-dropdown-content"||p.key==="chai-dropdown-content");if(s={...s,...ie(n),...V(n),...oe(n)},n.attributes){const p=n.attributes.find(u=>e.includes(F,u.key));p&&(s._name=p.value)}if(o||i)return s.content=`<p>${f.stringify(n.children||[])}</p>`,e.has(s,"styles_attrs.data-chai-richtext")&&delete s.styles_attrs["data-chai-richtext"],e.has(s,"styles_attrs.chai-richtext")&&delete s.styles_attrs["chai-richtext"],[s];if(d){const p=["data-chai-lightbox","chai-lightbox","data-vbtype","data-autoplay","data-maxwidth","data-overlay","data-gall","href"];s={...s,href:((D=a.find(u=>u.key==="href"))==null?void 0:D.value)||"",hrefType:((C=a.find(u=>u.key==="data-vbtype"))==null?void 0:C.value)||"video",autoplay:((I=a.find(u=>u.key==="data-autoplay"))==null?void 0:I.value)==="true"?"true":"false",maxWidth:((N=($=a.find(u=>u.key==="data-maxwidth"))==null?void 0:$.value)==null?void 0:N.replace("px",""))||"",backdropColor:((L=a.find(u=>u.key==="data-overlay"))==null?void 0:L.value)||"",galleryName:((W=a.find(u=>u.key==="data-gall"))==null?void 0:W.value)||""},e.forEach(p,u=>{e.has(s,`styles_attrs.${u}`)&&delete s.styles_attrs[u]})}if(c&&(delete s.styles_attrs,s.showDropdown=!1),_&&delete s.styles_attrs,b){delete s.styles_attrs;const p=e.filter(n.children||[],y=>(y==null?void 0:y.tagName)!=="span");s.content=E(p);const u=e.find(n.children||[],y=>(y==null?void 0:y.tagName)==="span"&&e.some(y.children||[],g=>(g==null?void 0:g.tagName)==="svg"));if(u){const y=e.find(u.children||[],g=>(g==null?void 0:g.tagName)==="svg");if(y){s.icon=f.stringify([y]);const{height:g,width:h}=re(y,"16px","16px");s.iconHeight=g,s.iconWidth=h}}return[s]}if(s._type==="Input"){const p=s.inputType||"text";p==="checkbox"?e.set(s,"_type","Checkbox"):p==="radio"&&e.set(s,"_type","Radio")}else if(n.tagName==="video"||n.tagName==="iframe"){const p=f.stringify([n]);return se(p)&&(e.set(s,"_type","Video"),e.set(s,"url",ne(p)),e.set(s,"styles",`${m},`),e.set(s,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),s.content=p,[s]}else if(n.tagName==="svg"){const p=e.get(e.find(n.attributes,{key:"class"}),"value",""),{height:u,width:y}=J(p);if(u&&y)s.styles=`${m}, ${T.cn(`w-${y} h-${u}`,p)}`.trim(),s.height=u==null?void 0:u.replace("px",""),s.width=y==null?void 0:y.replace("px","");else{const g=(A=e.find(n.attributes,{key:"height"}))==null?void 0:A.value,h=(P=e.find(n.attributes,{key:"width"}))==null?void 0:P.value;g&&h?(s.styles=`${m}, ${T.cn(`w-[${h}px] h-[${g}px]`,p)}`.trim(),s.height=g,s.width=h):s.styles=`${m}, ${T.cn("w-full h-full",p)}`.trim()}return n.attributes=e.filter(n.attributes,g=>!e.includes(["style","width","height","class"],g.key)),s.icon=f.stringify([n]),[s]}else if(n.tagName=="option"&&l&&((R=l.block)==null?void 0:R._type)==="Select")return l.block.options.push({label:E(n.children||[]),...V(n)}),[];const x=w(n.children||[],{block:s,node:n});return[s,...x]}),re=(t,l,n)=>{var d,c;const s=e.get(t,"attributes",[]),{height:a,width:o}=J(e.get(e.find(s,{key:"class"}),"value",""));if(a&&o)return{height:`[${a}px]`,width:`[${o}px]`};const r=(d=e.find(s,{key:"height"}))==null?void 0:d.value,i=(c=e.find(s,{key:"width"}))==null?void 0:c.value;return{height:r?`[${r}px]`:n,width:i?`[${i}px]`:l}},ce=t=>{t=t.replace(/(\w+)=\\?"(.*?)\\?"/g,(s,a,o)=>{let r=o.replace(/\\"/g,'"');return r=r.replace(/{([^}]+)}/g,i=>i.replace(/"/g,'\\"')),`${a}="${r.replace(/\\"/g,'"')}"`}),t=t.replace(/\\n/g,"").replace(/\\\\/g,"").replace(/\\([/<>])/g,"$1").replace(/\\./g,"").replace(/[\n\r\t\f\v]/g,""),t=t.replace(/\$name="[^"]*"/g,"");const l=t.match(/<body[^>]*>[\s\S]*?<\/body>/);return(l&&l.length>0?l[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):t).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},pe=t=>{const l=f.parse(ce(t));if(e.isEmpty(t))return[];const n=e.flatten(w(l));return q.syncBlocksWithDefaults(n)},ue=(t,l)=>t.map(n=>{const s=e.keys(n).filter(a=>e.isString(n[a])&&n[a].startsWith(m));return e.each(s,a=>{n[a]=`${m},${M(n[a],l)}`}),n}),de=t=>{const l=e.last(t);return t.map(n=>{const s=Object.keys(n);for(let a=0;a<s.length;a++)if(e.isString(n[s[a]])&&e.startsWith(s[a],"content")){const o=n===l?"":" ";n[s[a]]=`${n[s[a]].trim()}${o}`}return n})},S=(t,l,{index:n,key:s},a)=>{if(e.isString(t)){let o=t;const r=/\{\{(.*?)\}\}/g,i=t.match(r);if(i){const d=a==="image"||a==="mobileImage";i.forEach(c=>{let b=c.slice(2,-2).trim(),_=s.slice(2,-2).trim();n!==-1&&e.startsWith(b,"$index.")?b=`${_}.${n}.${b.slice(7)}`:n!==-1&&e.startsWith(b,"$index")&&(b=`${_}.${n}`);const x=e.get(l,b);x===void 0?o=o.replace(c,""):d&&!e.isArray(x)?o=x:o=e.isArray(x)?x:o.replace(c,x)})}return o}if(e.isArray(t))return t.map(o=>S(o,l,{index:n,key:s},a));if(t&&typeof t=="object"){const o={};return e.forEach(e.keys(t),r=>{!e.startsWith(r,"_")&&r!=="$repeaterItemsKey"?o[r]=S(t[r],l,{index:n,key:s},r):o[r]=t[r]}),o}return t},ye=(t,l,{index:n,key:s})=>{let a=e.cloneDeep(t);return a.repeaterItems&&(a.$repeaterItemsKey=a.repeaterItems,e.startsWith(a.repeaterItems,`{{${H}`)&&(a.$repeaterItemsKey=a.repeaterItems=`${a.repeaterItems.replace("}}",`/${a._id}}}`)}`),!e.isEmpty(a.repeaterItems)&&a.pagination&&(a.repeaterTotalItems=`${a.repeaterItems.replace("}}",`/${a._id}/totalItems}}`)}`)),S(a,l,{index:n,key:s})};exports.COLLECTION_PREFIX=H;exports.DESIGN_TOKEN_PREFIX=v;exports.REPEATER_PREFIX=K;exports.ROOT_TEMP_KEY=Y;exports.STYLES_KEY=m;exports.adjustSpacingInContentBlocks=de;exports.applyBindingToBlockProps=ye;exports.applyChaiDataBinding=te;exports.applyDesignTokens=ue;exports.applyLanguage=X;exports.applyLimit=ee;exports.getBlockRuntimeProps=Q;exports.getBlockTagAttributes=Z;exports.getBlocksFromHTML=pe;exports.getSplitChaiClasses=O;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx as o, jsxs as d } from "react/jsx-runtime";
|
|
2
|
-
import { u as C, a as k, b as v, c as T, D as g, d as y, e as E, f as w, T as N } from "./index-rAcNbjk_.js";
|
|
3
|
-
import { useThrottledCallback as D } from "@react-hookz/web";
|
|
4
|
-
import { useState as m, useCallback as H, useEffect as P } from "react";
|
|
5
|
-
import { useTranslation as B } from "react-i18next";
|
|
6
|
-
const u = (l) => {
|
|
7
|
-
const t = document.createElement("div");
|
|
8
|
-
return t.innerHTML = l, t.innerHTML;
|
|
9
|
-
};
|
|
10
|
-
function z() {
|
|
11
|
-
const { t: l } = B(), [t, p] = m(!1), [n, f] = m(""), [e, r] = C(), [c] = k(), h = v(), x = T(), b = D(
|
|
12
|
-
(s) => {
|
|
13
|
-
if (!e) return;
|
|
14
|
-
const a = u(s);
|
|
15
|
-
x([e.blockId], { [e.blockProp]: a });
|
|
16
|
-
},
|
|
17
|
-
[],
|
|
18
|
-
300
|
|
19
|
-
), i = H(() => {
|
|
20
|
-
if (t && e) {
|
|
21
|
-
const s = u(n);
|
|
22
|
-
h([e.blockId], { [e.blockProp]: s });
|
|
23
|
-
}
|
|
24
|
-
}, [t, n, e]);
|
|
25
|
-
return P(() => {
|
|
26
|
-
e && !c.includes(e.blockId) && (i(), r(null));
|
|
27
|
-
}, [c, e]), /* @__PURE__ */ o(g, { open: !0, onOpenChange: () => {
|
|
28
|
-
i(), r(null);
|
|
29
|
-
}, children: /* @__PURE__ */ d(y, { className: "flex max-h-[400px] min-h-[200px] max-w-4xl flex-col border-gray-700 text-black", children: [
|
|
30
|
-
/* @__PURE__ */ o(E, { className: "shrink-0 border-b border-gray-700 pb-3", children: /* @__PURE__ */ o(w, { className: "flex items-center justify-between text-black", children: /* @__PURE__ */ d("div", { className: "space-x-3 text-sm font-semibold", children: [
|
|
31
|
-
/* @__PURE__ */ o("span", { children: l("HTML Code Editor |") }),
|
|
32
|
-
/* @__PURE__ */ o("span", { className: "text-xs text-gray-400", children: l("Scripts will be only executed in preview and live mode.") })
|
|
33
|
-
] }) }) }),
|
|
34
|
-
/* @__PURE__ */ o("div", { className: "min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ o(
|
|
35
|
-
N,
|
|
36
|
-
{
|
|
37
|
-
className: "h-full w-full resize-none font-mono text-xs",
|
|
38
|
-
value: e ? n || e.initialCode : "",
|
|
39
|
-
onChange: (s) => {
|
|
40
|
-
const a = s.target.value;
|
|
41
|
-
p(!0), f(a), b(a);
|
|
42
|
-
},
|
|
43
|
-
rows: 10,
|
|
44
|
-
placeholder: "Enter your code here..."
|
|
45
|
-
}
|
|
46
|
-
) })
|
|
47
|
-
] }) });
|
|
48
|
-
}
|
|
49
|
-
export {
|
|
50
|
-
z as default
|
|
51
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),o=require("./index-C99FhuF1.cjs"),k=require("@react-hookz/web"),c=require("react"),g=require("react-i18next"),x=l=>{const s=document.createElement("div");return s.innerHTML=l,s.innerHTML};function j(){const{t:l}=g.useTranslation(),[s,m]=c.useState(!1),[a,h]=c.useState(""),[e,i]=o.useCodeEditor(),[d]=o.useSelectedBlockIds(),p=o.useUpdateBlocksProps(),b=o.useUpdateBlocksPropsRealtime(),f=k.useThrottledCallback(n=>{if(!e)return;const r=x(n);b([e.blockId],{[e.blockProp]:r})},[],300),u=c.useCallback(()=>{if(s&&e){const n=x(a);p([e.blockId],{[e.blockProp]:n})}},[s,a,e]);c.useEffect(()=>{e&&!d.includes(e.blockId)&&(u(),i(null))},[d,e]);const C=()=>{u(),i(null)};return t.jsx(o.Dialog,{open:!0,onOpenChange:C,children:t.jsxs(o.DialogContent,{className:"flex max-h-[400px] min-h-[200px] max-w-4xl flex-col border-gray-700 text-black",children:[t.jsx(o.DialogHeader,{className:"shrink-0 border-b border-gray-700 pb-3",children:t.jsx(o.DialogTitle,{className:"flex items-center justify-between text-black",children:t.jsxs("div",{className:"space-x-3 text-sm font-semibold",children:[t.jsx("span",{children:l("HTML Code Editor |")}),t.jsx("span",{className:"text-xs text-gray-400",children:l("Scripts will be only executed in preview and live mode.")})]})})}),t.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:t.jsx(o.Textarea,{className:"h-full w-full resize-none font-mono text-xs",value:e?a||e.initialCode:"",onChange:n=>{const r=n.target.value;m(!0),h(r),f(r)},rows:10,placeholder:"Enter your code here..."})})]})})}exports.default=j;
|
package/dist/core-Dr7QYemB.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { get as c, each as g, has as u, set as o, cloneDeep as k, omitBy as f } from "lodash-es";
|
|
2
|
-
import { useMemo as h } from "react";
|
|
3
|
-
const s = {}, P = () => s, S = (e) => h(() => c(s, e, null), [e]), i = (e) => c(s, e, null), d = (e) => {
|
|
4
|
-
const t = c(s, `${e}.schema.properties`, {}), r = {};
|
|
5
|
-
return g(t, (n, l) => {
|
|
6
|
-
u(n, "block") || o(r, l, n.default);
|
|
7
|
-
}), r;
|
|
8
|
-
}, p = (e) => c(s, `${e}.i18nProps`, []), $ = (e) => c(s, `${e}.aiProps`, []), w = (e) => {
|
|
9
|
-
const t = i(e);
|
|
10
|
-
if (!t)
|
|
11
|
-
return null;
|
|
12
|
-
const r = k(t.schema), n = c(r, "properties", {}), l = f(n, (a) => (a == null ? void 0 : a.styles) === !0);
|
|
13
|
-
o(r, "properties", l);
|
|
14
|
-
const B = c(s, `${e}.uiSchema`, {});
|
|
15
|
-
return { schema: r, uiSchema: B };
|
|
16
|
-
}, D = (e) => e.map((t) => u(s, t._type) ? { ...d(t._type), ...t } : t), m = (e, t) => {
|
|
17
|
-
const r = c(s, t.type);
|
|
18
|
-
r ? o(s, t.type, { ...r, component: e, ...t }) : o(s, t.type, { component: e, ...t });
|
|
19
|
-
}, E = (e, t) => {
|
|
20
|
-
m(e, { ...t, category: t.category || "core" });
|
|
21
|
-
}, I = (e, t) => {
|
|
22
|
-
const r = c(s, t.type);
|
|
23
|
-
r ? o(s, t.type, { ...r, component: e, ...t }) : o(s, t.type, { component: e, ...t });
|
|
24
|
-
}, R = (e, t) => {
|
|
25
|
-
const r = i(e);
|
|
26
|
-
if (!r)
|
|
27
|
-
throw new Error(`Block ${e} not found`);
|
|
28
|
-
o(s, e, { ...r, dataProvider: t });
|
|
29
|
-
}, _ = (e, t) => {
|
|
30
|
-
const r = i(e);
|
|
31
|
-
if (!r)
|
|
32
|
-
throw new Error(`Block ${e} not found`);
|
|
33
|
-
o(s, e, { ...r, component: t });
|
|
34
|
-
}, v = (e, t) => ({
|
|
35
|
-
type: "null",
|
|
36
|
-
block: e,
|
|
37
|
-
prop: t,
|
|
38
|
-
default: null,
|
|
39
|
-
runtime: !0,
|
|
40
|
-
ui: { "ui:widget": "hidden" }
|
|
41
|
-
});
|
|
42
|
-
export {
|
|
43
|
-
w as a,
|
|
44
|
-
d as b,
|
|
45
|
-
v as c,
|
|
46
|
-
p as d,
|
|
47
|
-
i as e,
|
|
48
|
-
I as f,
|
|
49
|
-
$ as g,
|
|
50
|
-
_ as h,
|
|
51
|
-
D as i,
|
|
52
|
-
P as j,
|
|
53
|
-
E as r,
|
|
54
|
-
R as s,
|
|
55
|
-
S as u
|
|
56
|
-
};
|
package/dist/core-Y0lXLwkq.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("lodash-es"),g=require("react"),o={},B=()=>o,k=e=>g.useMemo(()=>r.get(o,e,null),[e]),l=e=>r.get(o,e,null),u=e=>{const t=r.get(o,`${e}.schema.properties`,{}),s={};return r.each(t,(c,n)=>{r.has(c,"block")||r.set(s,n,c.default)}),s},h=e=>r.get(o,`${e}.i18nProps`,[]),d=e=>r.get(o,`${e}.aiProps`,[]),f=e=>{const t=l(e);if(!t)return null;const s=r.cloneDeep(t.schema),c=r.get(s,"properties",{}),n=r.omitBy(c,i=>(i==null?void 0:i.styles)===!0);r.set(s,"properties",n);const a=r.get(o,`${e}.uiSchema`,{});return{schema:s,uiSchema:a}},C=e=>e.map(t=>r.has(o,t._type)?{...u(t._type),...t}:t),P=(e,t)=>{const s=r.get(o,t.type);s?r.set(o,t.type,{...s,component:e,...t}):r.set(o,t.type,{component:e,...t})},m=(e,t)=>{P(e,{...t,category:t.category||"core"})},y=(e,t)=>{const s=r.get(o,t.type);s?r.set(o,t.type,{...s,component:e,...t}):r.set(o,t.type,{component:e,...t})},S=(e,t)=>{const s=l(e);if(!s)throw new Error(`Block ${e} not found`);r.set(o,e,{...s,dataProvider:t})},R=(e,t)=>{const s=l(e);if(!s)throw new Error(`Block ${e} not found`);r.set(o,e,{...s,component:t})},p=(e,t)=>({type:"null",block:e,prop:t,default:null,runtime:!0,ui:{"ui:widget":"hidden"}});exports.closestBlockProp=p;exports.getAIBlockProps=d;exports.getBlockFormSchemas=f;exports.getDefaultBlockProps=u;exports.getI18nBlockProps=h;exports.getRegisteredChaiBlock=l;exports.registerChaiBlock=m;exports.registerChaiServerBlock=y;exports.setChaiBlockComponent=R;exports.setChaiServerBlockDataProvider=S;exports.syncBlocksWithDefaults=C;exports.useRegisteredChaiBlock=k;exports.useRegisteredChaiBlocks=B;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-C99FhuF1.cjs"),i=require("react-i18next"),a=({tokenName:r,tokenValue:l,onDelete:n,children:o})=>{const{t:s}=i.useTranslation();return e.jsxs(t.AlertDialog,{children:[e.jsx(t.AlertDialogTrigger,{asChild:!0,children:o}),e.jsxs(t.AlertDialogContent,{className:"max-w-md",children:[e.jsxs(t.AlertDialogHeader,{children:[e.jsxs(t.AlertDialogTitle,{className:"text-base",children:[s("Delete"),' "',r,'"?']}),e.jsx(t.AlertDialogDescription,{asChild:!0,children:e.jsxs("div",{className:"space-y-3 pt-1 text-sm",children:[e.jsx("p",{className:"text-muted-foreground",children:s("This action cannot be undone. This will permanently remove the design token from your project.")}),e.jsxs("div",{className:"rounded-md border bg-muted/50 p-3",children:[e.jsx("p",{className:"mb-1 text-xs font-medium text-foreground",children:s("Token classes")}),e.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:l})]})]})})]}),e.jsxs(t.AlertDialogFooter,{children:[e.jsx(t.AlertDialogCancel,{className:"h-7 text-xs",children:s("Cancel")}),e.jsx(t.AlertDialogAction,{onClick:n,className:"h-7 bg-destructive text-xs text-destructive-foreground hover:bg-destructive/90",children:s("Delete")})]})]})]})};exports.default=a;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { E as i, F as n, G as c, H as d, I as m, J as h, K as g, M as u, O as x } from "./index-rAcNbjk_.js";
|
|
3
|
-
import { useTranslation as D } from "react-i18next";
|
|
4
|
-
const N = ({ tokenName: l, tokenValue: s, onDelete: a, children: o }) => {
|
|
5
|
-
const { t: r } = D();
|
|
6
|
-
return /* @__PURE__ */ e(i, { children: [
|
|
7
|
-
/* @__PURE__ */ t(n, { asChild: !0, children: o }),
|
|
8
|
-
/* @__PURE__ */ e(c, { className: "max-w-md", children: [
|
|
9
|
-
/* @__PURE__ */ e(d, { children: [
|
|
10
|
-
/* @__PURE__ */ e(m, { className: "text-base", children: [
|
|
11
|
-
r("Delete"),
|
|
12
|
-
' "',
|
|
13
|
-
l,
|
|
14
|
-
'"?'
|
|
15
|
-
] }),
|
|
16
|
-
/* @__PURE__ */ t(h, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "space-y-3 pt-1 text-sm", children: [
|
|
17
|
-
/* @__PURE__ */ t("p", { className: "text-muted-foreground", children: r("This action cannot be undone. This will permanently remove the design token from your project.") }),
|
|
18
|
-
/* @__PURE__ */ e("div", { className: "rounded-md border bg-muted/50 p-3", children: [
|
|
19
|
-
/* @__PURE__ */ t("p", { className: "mb-1 text-xs font-medium text-foreground", children: r("Token classes") }),
|
|
20
|
-
/* @__PURE__ */ t("p", { className: "font-mono text-xs text-muted-foreground", children: s })
|
|
21
|
-
] })
|
|
22
|
-
] }) })
|
|
23
|
-
] }),
|
|
24
|
-
/* @__PURE__ */ e(g, { children: [
|
|
25
|
-
/* @__PURE__ */ t(u, { className: "h-7 text-xs", children: r("Cancel") }),
|
|
26
|
-
/* @__PURE__ */ t(
|
|
27
|
-
x,
|
|
28
|
-
{
|
|
29
|
-
onClick: a,
|
|
30
|
-
className: "h-7 bg-destructive text-xs text-destructive-foreground hover:bg-destructive/90",
|
|
31
|
-
children: r("Delete")
|
|
32
|
-
}
|
|
33
|
-
)
|
|
34
|
-
] })
|
|
35
|
-
] })
|
|
36
|
-
] });
|
|
37
|
-
};
|
|
38
|
-
export {
|
|
39
|
-
N as default
|
|
40
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { jsx as i, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { B as v } from "./register-chai-top-bar-ESJHs5s-.js";
|
|
3
|
-
import { n as N, o as A, D as E, d as b, e as k, f as U, p as B, q as G } from "./index-rAcNbjk_.js";
|
|
4
|
-
import { c as R, o as W, m as q, g as F, l as H, L as M } from "./index-Dno42B0a.js";
|
|
5
|
-
import { get as Q } from "lodash-es";
|
|
6
|
-
import { useMemo as w } from "react";
|
|
7
|
-
import { useTranslation as $ } from "react-i18next";
|
|
8
|
-
const P = (e, r) => {
|
|
9
|
-
const t = r.filter((c) => c.parent === e);
|
|
10
|
-
if (t.length === 0) return 0;
|
|
11
|
-
let d = t.length;
|
|
12
|
-
return t.forEach((c) => {
|
|
13
|
-
d += P(c.id, r);
|
|
14
|
-
}), d;
|
|
15
|
-
};
|
|
16
|
-
function Y({ page: e, onClose: r }) {
|
|
17
|
-
const { t } = $(), [, d] = R(), { mutate: c, isPending: h } = W(), { data: f } = q(), { data: m = [] } = F(), { setSelectedLang: S, fallbackLang: x } = N(), [, L] = A(), l = !(e != null && e.primaryPage), { data: s = [] } = H(l ? e == null ? void 0 : e.id : void 0), D = w(() => !l || !s ? 0 : s.filter((a) => a.id !== (e == null ? void 0 : e.id)).length, [l, s, e == null ? void 0 : e.id]), u = w(() => {
|
|
18
|
-
if (!(e != null && e.id) || !m.length) return 0;
|
|
19
|
-
let a = P(e.id, m);
|
|
20
|
-
return l && s && s.length > 0 && s.forEach((y) => {
|
|
21
|
-
y.id !== e.id && (a += P(y.id, m));
|
|
22
|
-
}), a;
|
|
23
|
-
}, [e == null ? void 0 : e.id, m, l, s]), C = () => {
|
|
24
|
-
h || c(e, {
|
|
25
|
-
onSuccess: () => {
|
|
26
|
-
e != null && e.primaryPage ? (window.history.replaceState({}, "", `/?page=${e.primaryPage}`), d(new URLSearchParams({ page: e.primaryPage }))) : (window.history.replaceState({}, "", "/"), d(new URLSearchParams())), window.dispatchEvent(new PopStateEvent("popstate")), S(x), L("outline"), r();
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}, o = f == null ? void 0 : f.find((a) => a.key === (e == null ? void 0 : e.pageType));
|
|
30
|
-
return /* @__PURE__ */ i(E, { open: !!e, onOpenChange: r, children: /* @__PURE__ */ n(b, { children: [
|
|
31
|
-
/* @__PURE__ */ n(k, { children: [
|
|
32
|
-
/* @__PURE__ */ i(U, { children: t("Confirm Deletion") }),
|
|
33
|
-
/* @__PURE__ */ n(B, { className: "py-4 text-slate-500", children: [
|
|
34
|
-
/* @__PURE__ */ n("div", { children: [
|
|
35
|
-
t("Are you sure you want to remove"),
|
|
36
|
-
" ",
|
|
37
|
-
/* @__PURE__ */ i("b", { children: (e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.slug) }),
|
|
38
|
-
" ",
|
|
39
|
-
o != null && o.hasSlug ? (o == null ? void 0 : o.name) + "?" : t("page?")
|
|
40
|
-
] }),
|
|
41
|
-
l && (D > 0 || u > 0) && /* @__PURE__ */ n("div", { className: "mt-3 rounded-md bg-red-50 p-3 text-sm", children: [
|
|
42
|
-
/* @__PURE__ */ n("div", { className: "font-semibold text-red-800", children: [
|
|
43
|
-
t("Warning: Deleting this primary page will also delete"),
|
|
44
|
-
":"
|
|
45
|
-
] }),
|
|
46
|
-
/* @__PURE__ */ n("ul", { className: "mt-2 list-inside list-disc space-y-1 text-red-700", children: [
|
|
47
|
-
u > 0 && /* @__PURE__ */ n("li", { children: [
|
|
48
|
-
/* @__PURE__ */ i("span", { className: "font-medium", children: u }),
|
|
49
|
-
" ",
|
|
50
|
-
t(u === 1 ? "nested child page" : "nested child pages")
|
|
51
|
-
] }),
|
|
52
|
-
D > 0 && /* @__PURE__ */ i("li", { children: t("All associated language pages") })
|
|
53
|
-
] })
|
|
54
|
-
] }),
|
|
55
|
-
e.lang && /* @__PURE__ */ n("div", { className: "py-2 text-sm", children: [
|
|
56
|
-
t("Language"),
|
|
57
|
-
":",
|
|
58
|
-
" ",
|
|
59
|
-
/* @__PURE__ */ i("span", { className: "font-medium text-gray-500", children: Q(M, e.lang, e.lang) })
|
|
60
|
-
] })
|
|
61
|
-
] })
|
|
62
|
-
] }),
|
|
63
|
-
/* @__PURE__ */ n(G, { children: [
|
|
64
|
-
/* @__PURE__ */ i(v, { variant: "outline", onClick: r, children: t("Cancel") }),
|
|
65
|
-
/* @__PURE__ */ i(v, { variant: "destructive", disabled: h, onClick: C, children: t(h ? "Deleting..." : "Delete") })
|
|
66
|
-
] })
|
|
67
|
-
] }) });
|
|
68
|
-
}
|
|
69
|
-
export {
|
|
70
|
-
Y as default
|
|
71
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),D=require("./register-chai-top-bar-BqwKw4uy.cjs"),n=require("./index-C99FhuF1.cjs"),o=require("./index-C0-pgg_p.cjs"),N=require("lodash-es"),v=require("react"),q=require("react-i18next"),f=(e,r)=>{const s=r.filter(u=>u.parent===e);if(s.length===0)return 0;let a=s.length;return s.forEach(u=>{a+=f(u.id,r)}),a};function A({page:e,onClose:r}){const{t:s}=q.useTranslation(),[,a]=o.useSearchParams(),{mutate:u,isPending:x}=o.useDeletePage(),{data:P}=o.usePageTypes(),{data:h=[]}=o.useWebsitePages(),{setSelectedLang:S,fallbackLang:w}=n.useLanguages(),[,C]=n.useSidebarActivePanel(),l=!(e!=null&&e.primaryPage),{data:i=[]}=o.useLanguagePages(l?e==null?void 0:e.id:void 0),j=v.useMemo(()=>!l||!i?0:i.filter(d=>d.id!==(e==null?void 0:e.id)).length,[l,i,e==null?void 0:e.id]),m=v.useMemo(()=>{if(!(e!=null&&e.id)||!h.length)return 0;let d=f(e.id,h);return l&&i&&i.length>0&&i.forEach(y=>{y.id!==e.id&&(d+=f(y.id,h))}),d},[e==null?void 0:e.id,h,l,i]),L=()=>{x||u(e,{onSuccess:()=>{e!=null&&e.primaryPage?(window.history.replaceState({},"",`/?page=${e.primaryPage}`),a(new URLSearchParams({page:e.primaryPage}))):(window.history.replaceState({},"","/"),a(new URLSearchParams)),window.dispatchEvent(new PopStateEvent("popstate")),S(w),C("outline"),r()}})},c=P==null?void 0:P.find(d=>d.key===(e==null?void 0:e.pageType));return t.jsx(n.Dialog,{open:!!e,onOpenChange:r,children:t.jsxs(n.DialogContent,{children:[t.jsxs(n.DialogHeader,{children:[t.jsx(n.DialogTitle,{children:s("Confirm Deletion")}),t.jsxs(n.DialogDescription,{className:"py-4 text-slate-500",children:[t.jsxs("div",{children:[s("Are you sure you want to remove")," ",t.jsx("b",{children:(e==null?void 0:e.name)??(e==null?void 0:e.slug)})," ",c!=null&&c.hasSlug?(c==null?void 0:c.name)+"?":s("page?")]}),l&&(j>0||m>0)&&t.jsxs("div",{className:"mt-3 rounded-md bg-red-50 p-3 text-sm",children:[t.jsxs("div",{className:"font-semibold text-red-800",children:[s("Warning: Deleting this primary page will also delete"),":"]}),t.jsxs("ul",{className:"mt-2 list-inside list-disc space-y-1 text-red-700",children:[m>0&&t.jsxs("li",{children:[t.jsx("span",{className:"font-medium",children:m})," ",s(m===1?"nested child page":"nested child pages")]}),j>0&&t.jsx("li",{children:s("All associated language pages")})]})]}),e.lang&&t.jsxs("div",{className:"py-2 text-sm",children:[s("Language"),":"," ",t.jsx("span",{className:"font-medium text-gray-500",children:N.get(o.LANGUAGES,e.lang,e.lang)})]})]})]}),t.jsxs(n.DialogFooter,{children:[t.jsx(D.Button,{variant:"outline",onClick:r,children:s("Cancel")}),t.jsx(D.Button,{variant:"destructive",disabled:x,onClick:L,children:s(x?"Deleting...":"Delete")})]})]})})}exports.default=A;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("./register-chai-top-bar-BqwKw4uy.cjs"),d=require("./index-C99FhuF1.cjs"),ee=require("./image-compression-DZ9WMmyn.cjs"),B=require("lodash-es"),f=require("lucide-react"),u=require("react"),ge=require("react-dropzone"),je=require("react-error-boundary"),R=require("react-i18next"),C=require("sonner"),D=require("@tanstack/react-query"),j=require("./index-C0-pgg_p.cjs"),te=require("./common-functions-B3a4xKt_.cjs"),ve=()=>{const r=j.useApiUrl(),a=D.useQueryClient(),x=j.useFetch();return D.useMutation({mutationFn:async i=>{const n=i.map(async l=>x(r,{action:j.ACTIONS.UPLOAD_ASSET,data:l}));return await Promise.all(n)},onSuccess:i=>{var n;if(i!=null&&i.some(s=>s.error))throw new Error(((n=i==null?void 0:i.find(s=>s.error))==null?void 0:n.error)||"Failed to upload asset");{a.invalidateQueries({queryKey:[j.ACTIONS.GET_ASSETS]});const s=i==null?void 0:i.length;C.toast.success(`${s===1?"Asset":s+" Assets"} uploaded successfully`)}},onError:()=>{C.toast.error("Failed to upload asset")}})},ye=()=>{const r=j.useApiUrl(),a=D.useQueryClient(),x=j.useFetch();return D.useMutation({mutationFn:async i=>x(r,{action:j.ACTIONS.DELETE_ASSET,data:{id:i}}),onSuccess:i=>{if(i!=null&&i.error)throw new Error(i==null?void 0:i.error);a.invalidateQueries({queryKey:[j.ACTIONS.GET_ASSETS]}),C.toast.success("Asset deleted successfully")},onError:()=>{C.toast.error("Failed to delete asset")}})},Ne=()=>{const r=j.useApiUrl(),a=D.useQueryClient(),x=j.useFetch();return D.useMutation({mutationFn:async i=>x(r,{action:j.ACTIONS.UPDATE_ASSET,data:i}),onSuccess:i=>{if(i!=null&&i.error)throw new Error(i==null?void 0:i.error);a.invalidateQueries({queryKey:[j.ACTIONS.GET_ASSETS]}),i!=null&&i.id&&a.invalidateQueries({queryKey:[j.ACTIONS.GET_ASSET,i.id]}),C.toast.success("Asset updated successfully")},onError:()=>{C.toast.error("Failed to update asset")}})};function be({currentPage:r,totalPages:a,onPageChange:x,pageRangeDisplayed:i=3,showPageInput:n=!0,className:s=""}){const[l,I]=u.useState(String(r)),b=u.useMemo(()=>{const o=Math.floor(i/2);let m=Math.max(1,r-o),c=Math.min(a,r+o);c-m+1<i&&(m===1?c=Math.min(a,m+i-1):c===a&&(m=Math.max(1,c-i+1)));const p=[];m>1&&(p.push(1),m>2&&p.push("..."));for(let N=m;N<=c;N++)p.push(N);return c<a&&(c<a-1&&p.push("..."),p.push(a)),p},[r,a,i]),y=o=>{o!==r&&o>=1&&o<=a&&(x(o),I(String(o)))},v=()=>{r>1&&y(r-1)},w=()=>{r<a&&y(r+1)},A=()=>{const o=Number(l);!isNaN(o)&&o>=1&&o<=a&&y(o)},S=o=>{o.key==="Enter"&&A()};return a<=1?null:e.jsxs("div",{className:`flex flex-wrap items-center justify-center gap-3 ${s}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(g.Button,{variant:"outline",size:"sm",onClick:v,disabled:r===1,className:"px-2 py-1 text-sm hover:bg-gray-50",children:[e.jsx(f.ChevronLeft,{className:"h-4 w-4"}),"Previous"]}),e.jsx("div",{className:"flex items-center gap-2",children:b.map((o,m)=>{if(o==="...")return e.jsx("span",{className:"px-2 text-muted-foreground",children:"..."},`ellipsis-${m}`);const c=o,p=c===r;return e.jsx(g.Button,{variant:p?"default":"outline",size:"sm",onClick:()=>y(c),className:p?"border-blue-600 bg-blue-600 px-3 py-1 text-sm text-white":"border px-3 py-1 text-sm hover:bg-gray-50 hover:text-black",children:c},c)})}),e.jsxs(g.Button,{variant:"outline",size:"sm",onClick:w,disabled:r===a,className:"px-2 py-1 text-sm hover:bg-gray-50",children:["Next",e.jsx(f.ChevronRight,{className:"h-4 w-4"})]})]}),n&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Go to"}),e.jsx(g.Input,{type:"number",min:1,max:a,value:l,onChange:o=>{const m=o.target.value.replace(/[^\d]/g,"");I(m)},onKeyDown:S,className:"h-8 w-16 px-2 py-1"}),e.jsx(g.Button,{variant:"outline",size:"sm",onClick:A,disabled:l===""||Number(l)<1||Number(l)>a,children:"Go"})]})]})}const we=(r={})=>{const a=j.useApiUrl(),x=j.useFetch(),{search:i,page:n=1,limit:s=30}=r;return D.useQuery({queryKey:[j.ACTIONS.GET_ASSETS,i,n,s],queryFn:async()=>{const l=await x(a,{action:j.ACTIONS.GET_ASSETS,data:{search:i,page:n,limit:s}});return l.page=n,l.limit=s,l},staleTime:1/0,retry:1})},Ce=r=>{const a=j.useApiUrl(),x=j.useFetch();return D.useQuery({queryKey:[j.ACTIONS.GET_ASSET,r],queryFn:async()=>r?await x(a,{action:j.ACTIONS.GET_ASSET,data:{id:r}}):null,staleTime:1/0,retry:1})};function Ae(r){const a=isNaN(r)?0:typeof r=="number"?r:parseInt(r);return a?a<1024?`${a.toFixed(2)} B`:a<1024*1024?`${(a/1024).toFixed(2)} KB`:`${(a/(1024*1024)).toFixed(2)} MB`:"0 B"}function J(r){if(!r)return"N/A";const a=new Date(r);return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(a)}function Y(r,a){let x=r,i=a==null?void 0:a.description;return(!i||typeof i!="string")&&(i=""),(!x||typeof x!="string")&&(x=""),x!==i}const Se=({assetId:r,onBack:a,onEdit:x,onSave:i,isSaving:n})=>{var o,m;const{t:s}=R.useTranslation(),{data:l,isLoading:I,isError:b}=Ce(r||""),[y,v]=u.useState(""),[w,A]=u.useState(!1);u.useEffect(()=>{const c=new Image;return c.src=(l==null?void 0:l.url)||"",c.onload=()=>A(!0),()=>{c.onload=null}},[l]);const S=async(c,p)=>{try{await navigator.clipboard.writeText(c),C.toast.success(s("{{type}} copied to clipboard",{type:p}))}catch(N){C.toast.error(s("Failed to copy {{type}}",{type:p}),{description:N==null?void 0:N.message})}};return u.useEffect(()=>{l!=null&&l.description&&v(l.description)},[l]),I||!w?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsx(f.Loader,{className:"h-8 w-8 animate-spin"})}):b||!(l!=null&&l.id)?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"mx-auto max-w-md p-6 text-center",children:[e.jsx("div",{className:"mb-4 flex justify-center",children:e.jsx(f.AlertCircle,{className:"h-12 w-12 text-gray-400"})}),e.jsx("h3",{className:"mb-2 text-lg font-medium text-gray-900",children:s("No Asset Found")}),e.jsx("p",{className:"mb-6 text-sm text-gray-500",children:s(b?"There was an error loading the asset. Please try again later.":"The asset you're looking for doesn't exist or has been removed.")}),e.jsxs("div",{className:"flex justify-center gap-4",children:[e.jsx(g.Button,{variant:"outline",onClick:a,children:s("Back to Assets")}),b&&e.jsx(g.Button,{variant:"default",onClick:()=>window.location.reload(),children:s("Try Again")})]})]})}):e.jsxs("div",{className:"flex flex-1 flex-col gap-y-4 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(g.Button,{variant:"outline",size:"sm",onClick:a,disabled:n,children:[e.jsx(f.ChevronLeft,{className:"h-4 w-4"}),s("Back to Assets")]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g.Button,{variant:"outline",onClick:a,disabled:n,children:s("Cancel")}),e.jsxs(g.Button,{variant:"outline",onClick:()=>S(l.url,s("Asset URL")),disabled:n,children:[e.jsx(f.Copy,{className:"mr-2 h-4 w-4"}),s("Copy URL")]}),e.jsxs(g.Button,{variant:"default",onClick:()=>x(l),disabled:n,children:[e.jsx(f.Pencil,{className:"h-4 w-4"}),s("Edit Image")]})]})]}),e.jsxs("div",{className:"grid flex-1 grid-cols-2 items-start gap-6 overflow-hidden",children:[e.jsx("div",{className:"relative flex h-[calc(80vh-200px)] w-full items-start justify-center",children:e.jsx("img",{src:l.url,alt:l.name,className:"h-full max-h-max w-full max-w-max rounded-lg object-contain"})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid gap-3 rounded-md border bg-gray-100 pt-2",children:[e.jsx(d.Label,{className:"w-full text-center",children:s("Details")}),e.jsx("div",{className:"grid grid-cols-1 gap-2 rounded-md border bg-white p-2 text-sm",children:[{label:s("File Name"),value:l.name},{label:s("Type"),value:l.type,capitalize:!0},{label:s("Format"),value:((o=l.metadata)==null?void 0:o.format)||l.type,capitalize:!0},{label:s("Size"),value:Ae(l.size)},{label:s("Dimensions"),value:`${l.width||0} × ${l.height||0}`},{label:s("Created"),value:J(l.createdAt)},{label:s("Updated"),value:J(((m=l.metadata)==null?void 0:m.updatedAt)||(l==null?void 0:l.updatedAt)||l.createdAt)},{label:s("URL"),value:l.url,copyable:!0}].map(c=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(d.Label,{className:"w-1/4 w-max px-2 text-left font-normal text-gray-700",children:c.label}),":",e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-max text-left font-medium text-gray-900"+(c.capitalize?" capitalize":""),children:c.value}),c.copyable&&e.jsx(g.Button,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>S(c.value,c.label),children:e.jsx(f.Link,{className:"h-3 w-3"})})]})]},c.label))})]}),l.usedOn&&l.usedOn.length>0&&e.jsxs("div",{className:"grid gap-3",children:[e.jsx(d.Label,{children:s("Used On")}),e.jsx("div",{className:"grid grid-cols-1 gap-2 rounded-md border p-2 text-sm",children:l.usedOn.map((c,p)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-max text-left font-medium text-gray-900",children:c.name}),e.jsxs("div",{className:"text-gray-500",children:["(",c.slug,")"]})]},p))})]}),e.jsxs("div",{className:"relative grid gap-3 rounded-md border bg-gray-100 pt-2",children:[e.jsx(d.Label,{className:"w-full text-center",children:s("Description")}),e.jsx(d.Textarea,{id:"description",value:y,placeholder:s("Enter a description for the asset"),onChange:c=>v(c.target.value),rows:3,disabled:n,className:"bg-white hover:border-black/40"}),e.jsx("div",{className:"absolute right-2 top-1.5 flex items-start justify-end",children:e.jsx("button",{type:"button",onClick:()=>i(y),disabled:n||!Y(y,l),className:`rounded-md bg-blue-500 px-3 py-0 py-0.5 text-sm text-white ${n||!Y(y,l)?"cursor-not-allowed opacity-50":""}`,children:n?e.jsxs(e.Fragment,{children:[e.jsx(f.Loader,{className:"mr-2 h-4 w-4 animate-spin"}),s("Saving...")]}):s("Save")})})]})]})]})]})},Te=u.lazy(()=>Promise.resolve().then(()=>require("./image-editor-CqwaVxO2.cjs"))),Ee=25*1024*1024,Ie=({isUpdatingAsset:r,allowedTypes:a,uploadAssets:x,isUploadingAsset:i,onUploaded:n})=>{const{t:s}=R.useTranslation(),[l,I]=u.useState(()=>{const o=localStorage.getItem("chai_optimize_images");return o!==null?o==="true":!0});u.useEffect(()=>{localStorage.setItem("chai_optimize_images",l.toString())},[l]);const b=r||i,y=u.useCallback(async o=>{try{const m=o;if(!m.every(T=>T.type.startsWith("image/")))return C.toast.error(s("Invalid file type. Please upload a valid file.")),Promise.reject(new Error("Invalid file type"));const c=m.map(async T=>{let U=T;return T.type.startsWith("image/")&&(U=await ee.compressImageIfNeeded(T)),new Promise((_,q)=>{const L=new FileReader;L.readAsDataURL(U),L.onload=async()=>{_({file:L.result,folderId:void 0,name:T.name,optimize:l})},L.onerror=()=>q(null)})}),p=await Promise.all(c),N=await x(p);return(N==null?void 0:N.length)===1&&n(N[0]),N}catch(m){return Promise.reject(m)}},[x,l,n,s]),v=o=>{const m=[];let c=0;return o.forEach(p=>{p.size>Ee?c++:m.push(p)}),c>0&&C.toast.error(`${c===1&&o.length===1?s("File"):c+s(c===1?" file":" files")} ${s("exceed the maximum size limit of 10MB.")}`),B.isEmpty(m)?[]:y(m)},{getRootProps:w,getInputProps:A,isDragActive:S}=ge.useDropzone({onDrop:v,accept:{"image/*":a.includes("image")?[]:[]},disabled:r||i,multiple:!0});return e.jsx("div",{className:`flex h-[60px] w-full flex-col items-center justify-center rounded-lg border-2 border-dashed border-slate-300 p-0 py-2 hover:border-black/50 ${b?"pointer-events-none bg-gray-100 opacity-90":"bg-gray-100 hover:border-black/50 hover:bg-gray-100"}`,children:e.jsxs("div",{...w(),className:te.cn("flex h-max w-full cursor-pointer flex-col justify-center rounded-lg text-center",b?"items-start":"items-center",S?"border-primary bg-primary/5":"border-muted-foreground/20"),children:[e.jsx("input",{...A()}),b?e.jsx("div",{className:"flex flex-col items-center px-6",children:e.jsxs("div",{className:"flex items-center justify-center gap-2 leading-tight",children:[e.jsx("div",{className:"flex items-center justify-center rounded-full bg-indigo-100 p-2",children:e.jsx(f.Loader,{className:"h-4 w-4 animate-spin text-indigo-500"})}),e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"font-medium",children:s(r?"Updating file...":"Uploading file...")}),e.jsxs("div",{className:"text-xs font-light text-muted-foreground",children:[s("Please wait while we")," ",s(r?"update":"upload")," ",s("your file...")]})]})]})}):e.jsxs("div",{className:"flex w-full items-center justify-between px-6",children:[e.jsx("div",{className:"flex flex-col items-center",children:e.jsxs("div",{className:"flex items-center justify-between gap-2 leading-tight",children:[e.jsx("div",{className:"flex items-center justify-center rounded-full border border-indigo-500 bg-indigo-100 p-2",children:e.jsx(f.Upload,{className:"h-4 w-4 text-indigo-500"})}),e.jsxs("div",{className:"text-left",children:[e.jsxs("div",{className:"font-medium",children:[s("Drop your file here or")," ",e.jsx("span",{className:"cursor-pointer text-indigo-500 hover:underline",children:s("browse")})]}),e.jsx("div",{className:"text-xs font-light text-muted-foreground",children:e.jsxs("span",{className:"",children:[s("Accepted file types:")," ",e.jsx("span",{className:"capitalize text-indigo-400",children:a.join(", ")})]})})]})]})}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs",children:[s("Optimization:")," ",e.jsx("span",{className:l?"text-indigo-600":"text-gray-400",children:s(l?"On":"Off")})]}),e.jsx(d.Switch,{checked:l,onCheckedChange:o=>{I(o)},onClick:o=>{o.stopPropagation()},className:"data-[state=checked]:bg-indigo-500"})]}),e.jsx(d.TooltipProvider,{children:e.jsxs(d.Tooltip,{children:[e.jsx(d.TooltipTrigger,{asChild:!0,children:e.jsx("span",{className:`flex cursor-help items-center text-amber-500 ${l?"invisible":""}`,children:e.jsx(f.AlertTriangle,{className:"mr-1 h-4 w-4"})})}),e.jsx(d.TooltipContent,{side:"top",children:e.jsx("p",{className:"text-xs text-white",children:s("Warning: Unoptimized images may affect performance and page load times")})})]})})]})]})]})})};function ke({close:r,onSelect:a,mode:x="image",assetId:i}){const{t:n}=R.useTranslation(),s=!1,l=10,I=u.useMemo(()=>[x],[x]),[b,y]=u.useState(null),[v,w]=u.useState(null),[A,S]=u.useState(null),[o,m]=u.useState({show:!1,file:""}),[c,p]=u.useState(!1),[N,T]=u.useState(i?"details":"grid"),[U,_]=u.useState(""),[q,L]=u.useState(""),[P,Q]=u.useState(1),[K]=u.useState(30),[E,G]=u.useState([]);u.useEffect(()=>{i&&(y(i),T("details"))},[i]),u.useEffect(()=>{const t=setTimeout(()=>{_(q),Q(1)},300);return()=>clearTimeout(t)},[q]);const{data:O,isLoading:$,refetch:se}=we({search:U.toLowerCase().trim(),page:P,limit:K}),F=(O==null?void 0:O.assets)||[],ie=(O==null?void 0:O.total)||0,k=Math.ceil(ie/K);u.useEffect(()=>{$||k<=0||Q(t=>t>k?k:t<1?1:t)},[$,k]);const le=(F==null?void 0:F.length)>0,{mutate:ae}=ye(),{mutateAsync:W,isPending:re}=ve(),{mutateAsync:V,isPending:ne}=Ne(),H=u.useCallback(t=>{const h=Math.min(Math.max(1,t),Math.max(1,k));h!==P&&Q(h)},[k,P]),oe=t=>{L(t.target.value)},ce=u.useCallback(t=>{G(h=>B.find(h,{id:t.id})?[]:[t])},[s]),de=u.useCallback(()=>{G([])},[]),X=t=>{(t==null?void 0:t.length)!==0&&(a(B.pick(B.first(t||E),["id","url","width","height","description"])),r())},ue=async t=>{w(t)},me=async()=>{v&&(S(v==null?void 0:v.id),await ae(v.id,{onSuccess:()=>{S(null),w(null)},onError:()=>{S(null)}}),w(null))},he=t=>{y(t.id),T("details")},xe=async(t,h)=>{try{const M=localStorage.getItem("chai_optimize_images")!=="false";if(h){const z=await W([{file:t,folderId:void 0,name:o.name||"",optimize:M}]);if((z==null?void 0:z.length)>0){const Z=z[0];a({...B.pick(Z,["id","width","height","description"]),url:Z.url})}}else{const z=await V({id:o.id||"",file:t});z&&a({...B.pick(z,["id","width","height","description"]),url:z.url})}m({show:!1,file:""}),r()}catch(M){console.error(n("Error saving edited image:"),M)}},fe=u.useCallback(t=>{G([t])},[]),pe=u.useCallback(t=>{H(t)},[H]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex h-[80vh] max-h-[1232px] w-[80vw] max-w-[1232px] flex-col space-y-4",children:[e.jsx("h1",{className:"text-lg font-medium",children:n("Digital Asset Manager")}),N==="grid"?e.jsxs(e.Fragment,{children:[e.jsx(Ie,{maxFileSize:l,allowedTypes:I,uploadAssets:W,isUpdatingAsset:ne,isUploadingAsset:re,onUploaded:fe}),e.jsxs("div",{className:"relative flex flex-1 flex-col gap-y-3 overflow-hidden rounded-lg border p-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"relative w-1/2",children:[e.jsx(f.Search,{strokeWidth:3,className:`absolute left-2 top-2.5 h-4 w-4 text-muted-foreground ${q.length>0?"text-indigo-800":""}`}),e.jsx(g.Input,{placeholder:n("Search assets..."),onChange:oe,value:q,className:"pl-8"})]}),e.jsxs("div",{className:"flex items-center gap-x-2",children:[E.length>0?e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-2",children:[E.length>0&&e.jsx(e.Fragment,{children:e.jsx(g.Button,{variant:"outline",size:"sm",onClick:()=>de(),title:n("Clear selection"),children:n("Clear")})}),e.jsx(g.Button,{size:"sm",onClick:()=>X(E),disabled:E.length===0,children:n("Select Asset")})]})}):null,e.jsx(g.Button,{variant:"ghost",size:"icon",onClick:()=>se(),children:e.jsx(f.RefreshCwIcon,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto pb-[66px]",children:$?e.jsxs("div",{className:"columns-1 gap-3 space-y-3 sm:columns-3 md:columns-5",children:[e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"})]}):!$&&!le?e.jsxs("div",{className:"flex h-full flex-col items-center justify-center rounded-lg border",children:[e.jsx("div",{className:"text-muted-foreground",children:e.jsx(f.Archive,{className:"h-9 w-9 text-indigo-500"})}),e.jsx("div",{className:"text-lg text-muted-foreground",children:n("No assets found")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:U.length>0?n("No assets found for your search: {{query}}",{query:U}):n("Start uploading assets to get started")}),e.jsx("br",{})]}):e.jsx("div",{className:"flex flex-wrap gap-3 p-1",children:F==null?void 0:F.map(t=>e.jsxs("div",{className:te.cn("group relative flex max-h-[180px] max-w-[180px] cursor-pointer flex-col justify-between overflow-hidden rounded-lg border-2 transition-all",E.some(h=>h.id===t.id)?"border-blue-500":"hover:border-black/90",A&&(v==null?void 0:v.id)===t.id?"pointer-events-none opacity-50":"",A===t.id?"pointer-events-none opacity-50":""),onClick:()=>ce(t),onDoubleClick:()=>X([t]),children:[e.jsxs("div",{className:"aspect-square relative overflow-hidden",children:[A===t.id?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:e.jsx(f.Loader,{className:"h-8 w-8 animate-spin text-white"})}):null,t.type==="image"?e.jsx("img",{src:`${t.thumbnailUrl||"/placeholder.svg"}?v=${(t==null?void 0:t.updatedAt)||t.createdAt}`,alt:t.name,className:`h-full min-h-[80px] w-full object-contain ${E.some(h=>h.id===t.id)?"":"group-hover:blur group-hover:contrast-50"}`}):e.jsxs("div",{className:"flex h-full items-center justify-center",children:[e.jsx(f.Film,{className:"h-12 w-12 text-muted-foreground"}),t.thumbnailUrl&&e.jsx("img",{src:`${t.thumbnailUrl||"/placeholder.svg"}?v=${(t==null?void 0:t.updatedAt)||t.createdAt}`,alt:t.name,className:"absolute inset-0 h-full w-full object-cover"})]})]}),e.jsxs("div",{className:"flex items-end justify-between border-t-[1px] border-black/10 bg-white px-2 py-1",children:[e.jsx("div",{className:"truncate text-xs leading-tight",title:t.name,children:t.name}),e.jsx("div",{className:"flex items-center justify-between whitespace-nowrap text-[9px] font-light text-muted-foreground",children:e.jsx("span",{children:ee.formatFileSize((t==null?void 0:t.size)||0)})})]}),!E.some(h=>h.id===t.id)&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100",children:e.jsxs("div",{className:"grid grid-cols-4 gap-2 p-2",children:[e.jsx(d.TooltipProvider,{children:e.jsxs(d.Tooltip,{children:[e.jsx(d.TooltipTrigger,{asChild:!0,children:e.jsx(g.Button,{variant:"secondary",size:"icon",className:"h-8 w-8 rounded-full",onClick:h=>{h.stopPropagation(),he(t)},children:e.jsx(f.ImageIcon,{className:"h-4 w-4"})})}),e.jsx(d.TooltipContent,{children:e.jsx("p",{children:n("View Details")})})]})}),e.jsx(d.TooltipProvider,{children:e.jsxs(d.Tooltip,{children:[e.jsx(d.TooltipTrigger,{asChild:!0,children:e.jsx(g.Button,{variant:"secondary",size:"icon",className:"h-8 w-8 rounded-full",onClick:h=>{h.stopPropagation(),navigator.clipboard.writeText(t.url),C.toast.success(n("Asset URL copied to clipboard"))},children:e.jsx(f.Copy,{className:"h-4 w-4"})})}),e.jsx(d.TooltipContent,{children:e.jsx("p",{children:n("Copy URL")})})]})}),e.jsx(d.TooltipProvider,{children:e.jsxs(d.Tooltip,{children:[e.jsx(d.TooltipTrigger,{asChild:!0,children:e.jsx(g.Button,{variant:"secondary",size:"icon",className:"h-8 w-8 rounded-full",onClick:h=>{h.stopPropagation(),m({id:t.id,show:!0,file:t.url,name:t.name})},children:e.jsx(f.Edit,{className:"h-4 w-4"})})}),e.jsx(d.TooltipContent,{children:e.jsx("p",{children:n("Edit Image")})})]})}),e.jsx(d.TooltipProvider,{children:e.jsxs(d.Tooltip,{children:[e.jsx(d.TooltipTrigger,{asChild:!0,children:e.jsx(g.Button,{variant:"destructive",size:"icon",className:"h-8 w-8 rounded-full",onClick:h=>{h.stopPropagation(),ue(t)},children:e.jsx(f.Trash2,{className:"h-4 w-4"})})}),e.jsx(d.TooltipContent,{children:e.jsx("p",{children:n("Delete Asset")})})]})})]})}),E.some(h=>h.id===t.id)&&e.jsx("div",{className:"absolute right-1 top-1 h-max rounded-full border border-white bg-blue-500 p-1",children:e.jsx(f.Check,{className:"h-3 w-3 text-white",strokeWidth:5})})]},t.id))})}),k>1&&e.jsx("div",{className:"absolute bottom-0 left-0 right-0 border-t bg-white p-4",children:e.jsx(je.ErrorBoundary,{fallback:e.jsx("div",{className:"text-red-500",children:n("Error loading pagination")}),children:e.jsx(be,{currentPage:P,totalPages:k,onPageChange:pe,pageRangeDisplayed:3,showPageInput:!0})})})]})]}):e.jsx(Se,{assetId:b||i||"",onBack:()=>{T("grid"),y(null)},onEdit:t=>{m({id:t.id,show:!0,file:t.url,name:t.name})},onSave:async t=>{if(b){p(!0);try{const h=F.find(M=>M.id===b);h&&await V(B.merge(h,{description:t}))}finally{p(!1)}}},isSaving:c})]}),o.show&&e.jsx(u.Suspense,{fallback:e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx(f.Loader,{className:"h-8 w-8 animate-spin"})}),children:e.jsx(Te,{imageUrl:o.file,onSave:xe,onClose:()=>m({show:!1,file:""}),defaultSavedImageName:o.name,isEditing:!!o.id})}),v&&e.jsx(d.Dialog,{open:!!v,onOpenChange:()=>w(null),children:e.jsxs(d.DialogContent,{children:[e.jsxs(d.DialogHeader,{children:[e.jsx(d.DialogTitle,{children:n("Delete Asset")}),e.jsx(d.DialogDescription,{children:n('Are you sure you want to delete "{{name}}"? This action cannot be undone.',{name:v.name})})]}),e.jsxs(d.DialogFooter,{className:"gap-2 sm:gap-0",children:[e.jsx(g.Button,{variant:"outline",onClick:()=>w(null),children:n("Cancel")}),e.jsx(g.Button,{variant:"destructive",onClick:me,children:n("Delete")})]})]})})]})}exports.default=ke;
|
|
Binary file
|
package/dist/fonts/GeistVF.woff
DELETED
|
Binary file
|
package/dist/fonts-B-Xt29pe.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const s=[{family:"Roboto",url:"https://fonts.googleapis.com/css2?family=Roboto:ital,wdth,wght@0,75..100,100..900;1,75..100,100..900&display=swap",fallback:"sans-serif"},{family:"Inter",url:"https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap",fallback:"sans-serif"},{family:"DM Sans",url:"https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap",fallback:"sans-serif"},{family:"Open Sans",url:"https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap",fallback:"sans-serif"},{family:"Lato",url:"https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap",fallback:"sans-serif"},{family:"Montserrat",url:"https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap",fallback:"sans-serif"},{family:"Poppins",url:"https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap",fallback:"sans-serif"},{family:"Source Sans 3",url:"https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap",fallback:"sans-serif"},{family:"Nunito Sans",url:"https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap",fallback:"sans-serif"},{family:"Oswald",url:"https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap",fallback:"sans-serif"},{family:"Raleway",url:"https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap",fallback:"sans-serif"},{family:"Merriweather",url:"https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900&display=swap",fallback:"serif"},{family:"Playfair Display",url:"https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap",fallback:"serif"}],t=(a,l)=>{s.unshift({family:a,...l})},i=()=>s,o=a=>s.find(l=>l.family===a),e=()=>s;exports.getAllRegisteredFonts=e;exports.getRegisteredFont=o;exports.registerChaiFont=t;exports.useRegisteredFonts=i;
|
package/dist/fonts-DRly3Wzd.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
const s = [
|
|
2
|
-
{
|
|
3
|
-
family: "Roboto",
|
|
4
|
-
url: "https://fonts.googleapis.com/css2?family=Roboto:ital,wdth,wght@0,75..100,100..900;1,75..100,100..900&display=swap",
|
|
5
|
-
fallback: "sans-serif"
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
family: "Inter",
|
|
9
|
-
url: "https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap",
|
|
10
|
-
fallback: "sans-serif"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
family: "DM Sans",
|
|
14
|
-
url: "https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap",
|
|
15
|
-
fallback: "sans-serif"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
family: "Open Sans",
|
|
19
|
-
url: "https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap",
|
|
20
|
-
fallback: "sans-serif"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
family: "Lato",
|
|
24
|
-
url: "https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap",
|
|
25
|
-
fallback: "sans-serif"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
family: "Montserrat",
|
|
29
|
-
url: "https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap",
|
|
30
|
-
fallback: "sans-serif"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
family: "Poppins",
|
|
34
|
-
url: "https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap",
|
|
35
|
-
fallback: "sans-serif"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
family: "Source Sans 3",
|
|
39
|
-
url: "https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap",
|
|
40
|
-
fallback: "sans-serif"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
family: "Nunito Sans",
|
|
44
|
-
url: "https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap",
|
|
45
|
-
fallback: "sans-serif"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
family: "Oswald",
|
|
49
|
-
url: "https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap",
|
|
50
|
-
fallback: "sans-serif"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
family: "Raleway",
|
|
54
|
-
url: "https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap",
|
|
55
|
-
fallback: "sans-serif"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
family: "Merriweather",
|
|
59
|
-
url: "https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900&display=swap",
|
|
60
|
-
fallback: "serif"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
family: "Playfair Display",
|
|
64
|
-
url: "https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap",
|
|
65
|
-
fallback: "serif"
|
|
66
|
-
}
|
|
67
|
-
], t = (a, l) => {
|
|
68
|
-
s.unshift({
|
|
69
|
-
family: a,
|
|
70
|
-
...l
|
|
71
|
-
});
|
|
72
|
-
}, i = () => s, o = (a) => s.find((l) => l.family === a), f = () => s;
|
|
73
|
-
export {
|
|
74
|
-
f as a,
|
|
75
|
-
o as g,
|
|
76
|
-
t as r,
|
|
77
|
-
i as u
|
|
78
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const n=require("compressorjs"),m=require("sonner"),t=3*1024*1024,c=10*1024*1024;function s(e){const r=isNaN(e)?0:typeof e=="number"?e:parseInt(e);return r?r<1024?`${r.toFixed(2)} B`:r<1024*1024?`${(r/1024).toFixed(2)} KB`:`${(r/(1024*1024)).toFixed(2)} MB`:"0 B"}function a(e){return new Promise((r,o)=>{if(e.size<=t){r(e);return}new n(e,{quality:.8,maxWidth:2048,maxHeight:2048,convertSize:t,success(i){r(i)},error(i){m.toast.error(`Failed to compress image. Image size is ${s(e.size)}, which exceeds the maximum allowed size of ${s(c)}.`),o(i)}})})}exports.compressImageIfNeeded=a;exports.formatFileSize=s;
|
package/dist/index-B-rSiAp_.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("lodash-es"),s="#styles:",l=e=>{const n=["_type","_id","_parent","_bindings","_name"],o=["$loading","blockProps","inBuilder","lang","draft","pageProps","pageData","children"],r=t.keys(e.properties);if(t.intersection(r,n).length>0)throw new Error(`Reserved props are not allowed: ${t.intersection(r,n).join(", ")}`);if(t.intersection(r,o).length>0)throw new Error(`Runtime props are not allowed in schema: ${t.intersection(r,o).join(", ")}`);const i=t.get(e,"properties",{}),u={};return t.each(i,(p,a)=>{t.isEmpty(p.ui)||(u[a]={...p.ui},delete i[a].ui)}),{schema:t.isEmpty(i)?{}:{...t.omit(e,["ui"])},uiSchema:{...t.get(e,"ui",{}),...u}}},d=(e="")=>({type:"string",styles:!0,default:`${s},${e}`,ui:{"ui:widget":"hidden"}}),c=(e="")=>({type:"string",styles:!0,default:`${s},${e}`,ui:{"ui:widget":"hidden"}}),h=e=>(console.warn("runtimeProp is deprecated, use builderProp instead"),{runtime:!0,...e}),g=e=>({builderProp:!0,...e}),y=e=>`${s},${e}`;exports.StylesProp=d;exports.builderProp=g;exports.defaultChaiStyles=y;exports.registerChaiBlockSchema=l;exports.runtimeProp=h;exports.stylesProp=c;
|