@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,137 @@
|
|
|
1
|
+
import { jsx as s, jsxs as t, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { z as h, B as F } from "./register-chai-top-bar-D6GjnauV.js";
|
|
3
|
+
import { D as T, e as q, f as O, g as z, o as B, p as f, q as H } from "./index-DpeytsiB.js";
|
|
4
|
+
import { ap as I, aq as M, A as E, ax as R } from "./index-BpVxZOd-.js";
|
|
5
|
+
import { useMutation as U } from "@tanstack/react-query";
|
|
6
|
+
import { Loader2 as W } from "lucide-react";
|
|
7
|
+
import { useState as c, useCallback as S, useEffect as G } from "react";
|
|
8
|
+
import { useTranslation as _ } from "react-i18next";
|
|
9
|
+
import { z as m } from "zod";
|
|
10
|
+
const K = () => {
|
|
11
|
+
const a = I(), o = M();
|
|
12
|
+
return U({
|
|
13
|
+
mutationKey: [E.CHANGE_PASSWORD],
|
|
14
|
+
mutationFn: async (e) => {
|
|
15
|
+
const n = await o(a, {
|
|
16
|
+
action: E.CHANGE_PASSWORD,
|
|
17
|
+
data: e
|
|
18
|
+
});
|
|
19
|
+
return n == null ? void 0 : n.data;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}, V = (a) => m.object({
|
|
23
|
+
oldPassword: m.string().min(1, a("Current password is required")),
|
|
24
|
+
newPassword: m.string().min(8, a("Password must be at least 8 characters")).max(128, a("Password must be less than 128 characters")).regex(/[A-Z]/, a("Password must contain at least one uppercase letter")).regex(/[a-z]/, a("Password must contain at least one lowercase letter")).regex(/[0-9]/, a("Password must contain at least one number")).regex(/[!@#$%^&*(),.?":{}|<>]/, a("Password must contain at least one special character")),
|
|
25
|
+
confirmPassword: m.string().min(1, a("Confirm password is required"))
|
|
26
|
+
}).refine((o) => o.newPassword === o.confirmPassword, {
|
|
27
|
+
message: a("New password and confirm password do not match"),
|
|
28
|
+
path: ["confirmPassword"]
|
|
29
|
+
}).refine((o) => o.oldPassword !== o.newPassword, {
|
|
30
|
+
message: a("New password must be different from current password"),
|
|
31
|
+
path: ["newPassword"]
|
|
32
|
+
}), os = ({ open: a, onOpenChange: o }) => {
|
|
33
|
+
const { t: e } = _(), n = R("currentUser", null), { mutate: k, isPending: w, isSuccess: u, reset: g } = K(), [P, C] = c(""), [x, N] = c(""), [v, D] = c(""), [b, d] = c(null), y = S(() => {
|
|
34
|
+
C(""), N(""), D(""), d(null), g();
|
|
35
|
+
}, [g]), l = S(
|
|
36
|
+
(r) => {
|
|
37
|
+
o(r), r || y();
|
|
38
|
+
},
|
|
39
|
+
[o, y]
|
|
40
|
+
);
|
|
41
|
+
G(() => {
|
|
42
|
+
if (u) {
|
|
43
|
+
const r = setTimeout(() => {
|
|
44
|
+
l(!1);
|
|
45
|
+
}, 2e3);
|
|
46
|
+
return () => clearTimeout(r);
|
|
47
|
+
}
|
|
48
|
+
}, [u, l]);
|
|
49
|
+
const j = () => {
|
|
50
|
+
var A;
|
|
51
|
+
d(null);
|
|
52
|
+
const r = {
|
|
53
|
+
oldPassword: P.trim(),
|
|
54
|
+
newPassword: x.trim(),
|
|
55
|
+
confirmPassword: v.trim()
|
|
56
|
+
}, i = V(e).safeParse(r);
|
|
57
|
+
if (!i.success) {
|
|
58
|
+
d(((A = i.error.issues[0]) == null ? void 0 : A.message) || e("Validation failed"));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (!(n != null && n.email)) {
|
|
62
|
+
d(e("User email not found"));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
k(
|
|
66
|
+
{
|
|
67
|
+
email: n.email,
|
|
68
|
+
oldPassword: i.data.oldPassword,
|
|
69
|
+
newPassword: i.data.newPassword,
|
|
70
|
+
confirmPassword: i.data.confirmPassword
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
onError: (p) => {
|
|
74
|
+
d((p == null ? void 0 : p.message) || e("Failed to change password"));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
return /* @__PURE__ */ s(T, { open: a, onOpenChange: l, children: /* @__PURE__ */ s(q, { className: "sm:max-w-[425px]", children: w ? /* @__PURE__ */ s("div", { className: "flex h-[340px] items-center justify-center", children: /* @__PURE__ */ s(W, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }) : u ? /* @__PURE__ */ t("div", { className: "flex h-[340px] flex-col items-center justify-center gap-2", children: [
|
|
80
|
+
/* @__PURE__ */ s("div", { className: "rounded-full bg-green-100 p-3", children: /* @__PURE__ */ s("svg", { className: "h-6 w-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ s("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }) }),
|
|
81
|
+
/* @__PURE__ */ s("p", { className: "text-lg font-medium", children: e("Password updated successfully") })
|
|
82
|
+
] }) : /* @__PURE__ */ t(L, { children: [
|
|
83
|
+
/* @__PURE__ */ t(O, { children: [
|
|
84
|
+
/* @__PURE__ */ s(z, { children: e("Change Password") }),
|
|
85
|
+
/* @__PURE__ */ s(B, { children: e("Enter your current password and a new password.") })
|
|
86
|
+
] }),
|
|
87
|
+
/* @__PURE__ */ t("div", { className: "grid gap-4 py-4", children: [
|
|
88
|
+
/* @__PURE__ */ t("div", { className: "grid gap-2", children: [
|
|
89
|
+
/* @__PURE__ */ s(f, { htmlFor: "old-password", children: e("Current Password") }),
|
|
90
|
+
/* @__PURE__ */ s(
|
|
91
|
+
h,
|
|
92
|
+
{
|
|
93
|
+
id: "old-password",
|
|
94
|
+
type: "password",
|
|
95
|
+
value: P,
|
|
96
|
+
onChange: (r) => C(r.target.value),
|
|
97
|
+
placeholder: e("Enter current password")
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
] }),
|
|
101
|
+
/* @__PURE__ */ t("div", { className: "grid gap-2", children: [
|
|
102
|
+
/* @__PURE__ */ s(f, { htmlFor: "new-password", children: e("New Password") }),
|
|
103
|
+
/* @__PURE__ */ s(
|
|
104
|
+
h,
|
|
105
|
+
{
|
|
106
|
+
id: "new-password",
|
|
107
|
+
type: "password",
|
|
108
|
+
value: x,
|
|
109
|
+
onChange: (r) => N(r.target.value),
|
|
110
|
+
placeholder: e("Enter new password")
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
] }),
|
|
114
|
+
/* @__PURE__ */ t("div", { className: "grid gap-2", children: [
|
|
115
|
+
/* @__PURE__ */ s(f, { htmlFor: "confirm-password", children: e("Confirm Password") }),
|
|
116
|
+
/* @__PURE__ */ s(
|
|
117
|
+
h,
|
|
118
|
+
{
|
|
119
|
+
id: "confirm-password",
|
|
120
|
+
type: "password",
|
|
121
|
+
value: v,
|
|
122
|
+
onChange: (r) => D(r.target.value),
|
|
123
|
+
placeholder: e("Confirm new password")
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
] }),
|
|
127
|
+
b && /* @__PURE__ */ s("p", { className: "text-sm text-destructive", children: b })
|
|
128
|
+
] }),
|
|
129
|
+
/* @__PURE__ */ t(H, { children: [
|
|
130
|
+
/* @__PURE__ */ s(F, { variant: "outline", onClick: () => l(!1), disabled: w, children: e("Cancel") }),
|
|
131
|
+
/* @__PURE__ */ s(F, { onClick: j, disabled: w, children: e("Change Password") })
|
|
132
|
+
] })
|
|
133
|
+
] }) }) });
|
|
134
|
+
};
|
|
135
|
+
export {
|
|
136
|
+
os as ChangePasswordModal
|
|
137
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("./register-chai-top-bar-DyW9GPzV.cjs"),n=require("./index-P-2SvZA9.cjs"),u=require("./index-CQf0jL1k.cjs"),A=require("@tanstack/react-query"),F=require("lucide-react"),d=require("react"),k=require("react-i18next"),m=require("zod"),E=()=>{const r=u.useApiUrl(),o=u.useFetch();return A.useMutation({mutationKey:[u.ACTIONS.CHANGE_PASSWORD],mutationFn:async e=>{const t=await o(r,{action:u.ACTIONS.CHANGE_PASSWORD,data:e});return t==null?void 0:t.data}})},L=r=>m.z.object({oldPassword:m.z.string().min(1,r("Current password is required")),newPassword:m.z.string().min(8,r("Password must be at least 8 characters")).max(128,r("Password must be less than 128 characters")).regex(/[A-Z]/,r("Password must contain at least one uppercase letter")).regex(/[a-z]/,r("Password must contain at least one lowercase letter")).regex(/[0-9]/,r("Password must contain at least one number")).regex(/[!@#$%^&*(),.?":{}|<>]/,r("Password must contain at least one special character")),confirmPassword:m.z.string().min(1,r("Confirm password is required"))}).refine(o=>o.newPassword===o.confirmPassword,{message:r("New password and confirm password do not match"),path:["confirmPassword"]}).refine(o=>o.oldPassword!==o.newPassword,{message:r("New password must be different from current password"),path:["newPassword"]}),T=({open:r,onOpenChange:o})=>{const{t:e}=k.useTranslation(),t=u.usePagesProp("currentUser",null),{mutate:q,isPending:h,isSuccess:p,reset:P}=E(),[x,f]=d.useState(""),[j,C]=d.useState(""),[N,v]=d.useState(""),[b,i]=d.useState(null),S=d.useCallback(()=>{f(""),C(""),v(""),i(null),P()},[P]),w=d.useCallback(a=>{o(a),a||S()},[o,S]);d.useEffect(()=>{if(p){const a=setTimeout(()=>{w(!1)},2e3);return()=>clearTimeout(a)}},[p,w]);const D=()=>{var y;i(null);const a={oldPassword:x.trim(),newPassword:j.trim(),confirmPassword:N.trim()},c=L(e).safeParse(a);if(!c.success){i(((y=c.error.issues[0])==null?void 0:y.message)||e("Validation failed"));return}if(!(t!=null&&t.email)){i(e("User email not found"));return}q({email:t.email,oldPassword:c.data.oldPassword,newPassword:c.data.newPassword,confirmPassword:c.data.confirmPassword},{onError:g=>{i((g==null?void 0:g.message)||e("Failed to change password"))}})};return s.jsx(n.Dialog,{open:r,onOpenChange:w,children:s.jsx(n.DialogContent,{className:"sm:max-w-[425px]",children:h?s.jsx("div",{className:"flex h-[340px] items-center justify-center",children:s.jsx(F.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):p?s.jsxs("div",{className:"flex h-[340px] flex-col items-center justify-center gap-2",children:[s.jsx("div",{className:"rounded-full bg-green-100 p-3",children:s.jsx("svg",{className:"h-6 w-6 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),s.jsx("p",{className:"text-lg font-medium",children:e("Password updated successfully")})]}):s.jsxs(s.Fragment,{children:[s.jsxs(n.DialogHeader,{children:[s.jsx(n.DialogTitle,{children:e("Change Password")}),s.jsx(n.DialogDescription,{children:e("Enter your current password and a new password.")})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n.Label,{htmlFor:"old-password",children:e("Current Password")}),s.jsx(l.Input,{id:"old-password",type:"password",value:x,onChange:a=>f(a.target.value),placeholder:e("Enter current password")})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n.Label,{htmlFor:"new-password",children:e("New Password")}),s.jsx(l.Input,{id:"new-password",type:"password",value:j,onChange:a=>C(a.target.value),placeholder:e("Enter new password")})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n.Label,{htmlFor:"confirm-password",children:e("Confirm Password")}),s.jsx(l.Input,{id:"confirm-password",type:"password",value:N,onChange:a=>v(a.target.value),placeholder:e("Confirm new password")})]}),b&&s.jsx("p",{className:"text-sm text-destructive",children:b})]}),s.jsxs(n.DialogFooter,{children:[s.jsx(l.Button,{variant:"outline",onClick:()=>w(!1),disabled:h,children:e("Cancel")}),s.jsx(l.Button,{onClick:D,disabled:h,children:e("Change Password")})]})]})})})};exports.ChangePasswordModal=T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./register-chai-top-bar-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./register-chai-top-bar-DyW9GPzV.cjs"),m=require("@monaco-editor/react"),o=require("@radix-ui/react-icons"),r=require("react");function C({code:l,onCopy:d,language:s="javascript",onDownload:c,downloadText:u="Download"}){const[n,a]=r.useState(!1),[t,p]=r.useState(l),f=()=>{d(t),a(!0),setTimeout(()=>{a(!1)},2e3)},h=()=>{c(t)};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"h-[500px] max-h-full overflow-hidden rounded-md border py-2",children:e.jsx(m,{height:"100%",defaultLanguage:s,language:s,value:t,onChange:x=>p(x||""),theme:"vs-light",options:{minimap:{enabled:!1},fontSize:12,lineNumbers:"off",roundedSelection:!1,scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,insertSpaces:!0,wordWrap:"on",bracketPairColorization:{enabled:!0},suggest:{showKeywords:!1,showSnippets:!1}}})}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(i.Button,{type:"button",variant:"outline",onClick:f,children:[n?e.jsx(o.CheckIcon,{className:"text-green-500"}):e.jsx(o.CopyIcon,{})," ",n?"Copied":"Copy"]}),e.jsxs(i.Button,{type:"button",onClick:h,children:[e.jsx(o.DownloadIcon,{})," ",u]})]})]})}exports.default=C;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { B as l } from "./register-chai-top-bar-
|
|
2
|
+
import { B as l } from "./register-chai-top-bar-D6GjnauV.js";
|
|
3
3
|
import m from "@monaco-editor/react";
|
|
4
4
|
import { CheckIcon as h, CopyIcon as C, DownloadIcon as y } from "@radix-ui/react-icons";
|
|
5
5
|
import { useState as s } from "react";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as t, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { u as k, a as v, b as T, c as E, d as L, L as N, D as y, e as w, f as D, g as H, T as M } from "./index-DpeytsiB.js";
|
|
3
|
+
import { useThrottledCallback as P } from "@react-hookz/web";
|
|
4
|
+
import { get as B } from "lodash-es";
|
|
5
|
+
import { useState as p, useMemo as I, useCallback as S, useEffect as j } from "react";
|
|
6
|
+
import { useTranslation as R } from "react-i18next";
|
|
7
|
+
const x = (a) => {
|
|
8
|
+
const s = document.createElement("div");
|
|
9
|
+
return s.innerHTML = a, s.innerHTML;
|
|
10
|
+
};
|
|
11
|
+
function J() {
|
|
12
|
+
const { t: a } = R(), [s, f] = p(!1), [n, h] = p(""), [e, i] = k(), [d] = v(), g = T(), C = E(), { selectedLang: r } = L(), m = I(() => B(N, r, r), [r]), b = P(
|
|
13
|
+
(o) => {
|
|
14
|
+
if (!e) return;
|
|
15
|
+
const l = x(o);
|
|
16
|
+
C([e.blockId], { [e.blockProp]: l });
|
|
17
|
+
},
|
|
18
|
+
[],
|
|
19
|
+
300
|
|
20
|
+
), u = S(() => {
|
|
21
|
+
if (s && e) {
|
|
22
|
+
const o = x(n);
|
|
23
|
+
g([e.blockId], { [e.blockProp]: o });
|
|
24
|
+
}
|
|
25
|
+
}, [s, n, e]);
|
|
26
|
+
return j(() => {
|
|
27
|
+
e && !d.includes(e.blockId) && (u(), i(null));
|
|
28
|
+
}, [d, e]), /* @__PURE__ */ t(y, { open: !0, onOpenChange: () => {
|
|
29
|
+
u(), i(null);
|
|
30
|
+
}, children: /* @__PURE__ */ c(w, { className: "flex max-h-[400px] min-h-[200px] max-w-4xl flex-col border-gray-700 text-black", children: [
|
|
31
|
+
/* @__PURE__ */ t(D, { className: "shrink-0 pb-3", children: /* @__PURE__ */ t(H, { className: "flex items-center justify-between text-black", children: /* @__PURE__ */ c("div", { className: "space-x-3 text-sm font-semibold", children: [
|
|
32
|
+
/* @__PURE__ */ t("span", { children: a("HTML Code Editor") }),
|
|
33
|
+
m && /* @__PURE__ */ c("span", { className: "text-xs text-gray-400", children: [
|
|
34
|
+
"(",
|
|
35
|
+
m,
|
|
36
|
+
")"
|
|
37
|
+
] }),
|
|
38
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-gray-400", children: a("Scripts will be only executed in preview and live mode.") })
|
|
39
|
+
] }) }) }),
|
|
40
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ t(
|
|
41
|
+
M,
|
|
42
|
+
{
|
|
43
|
+
className: "h-full w-full resize-none font-mono md:text-xs",
|
|
44
|
+
value: e ? n || e.initialCode : "",
|
|
45
|
+
onChange: (o) => {
|
|
46
|
+
const l = o.target.value;
|
|
47
|
+
f(!0), h(l), b(l);
|
|
48
|
+
},
|
|
49
|
+
rows: 10,
|
|
50
|
+
placeholder: "Enter your code here..."
|
|
51
|
+
}
|
|
52
|
+
) })
|
|
53
|
+
] }) });
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
J as default
|
|
57
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t=require("./index-P-2SvZA9.cjs"),j=require("@react-hookz/web"),v=require("lodash-es"),l=require("react"),T=require("react-i18next"),h=c=>{const o=document.createElement("div");return o.innerHTML=c,o.innerHTML};function y(){const{t:c}=T.useTranslation(),[o,p]=l.useState(!1),[r,f]=l.useState(""),[e,d]=t.useCodeEditor(),[u]=t.useSelectedBlockIds(),g=t.useUpdateBlocksProps(),b=t.useUpdateBlocksPropsRealtime(),{selectedLang:i}=t.useLanguages(),x=l.useMemo(()=>v.get(t.LANGUAGES,i,i),[i]),C=j.useThrottledCallback(n=>{if(!e)return;const a=h(n);b([e.blockId],{[e.blockProp]:a})},[],300),m=l.useCallback(()=>{if(o&&e){const n=h(r);g([e.blockId],{[e.blockProp]:n})}},[o,r,e]);l.useEffect(()=>{e&&!u.includes(e.blockId)&&(m(),d(null))},[u,e]);const k=()=>{m(),d(null)};return s.jsx(t.Dialog,{open:!0,onOpenChange:k,children:s.jsxs(t.DialogContent,{className:"flex max-h-[400px] min-h-[200px] max-w-4xl flex-col border-gray-700 text-black",children:[s.jsx(t.DialogHeader,{className:"shrink-0 pb-3",children:s.jsx(t.DialogTitle,{className:"flex items-center justify-between text-black",children:s.jsxs("div",{className:"space-x-3 text-sm font-semibold",children:[s.jsx("span",{children:c("HTML Code Editor")}),x&&s.jsxs("span",{className:"text-xs text-gray-400",children:["(",x,")"]}),s.jsx("span",{className:"text-xs text-gray-400",children:c("Scripts will be only executed in preview and live mode.")})]})})}),s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(t.Textarea,{className:"h-full w-full resize-none font-mono md:text-xs",value:e?r||e.initialCode:"",onChange:n=>{const a=n.target.value;p(!0),f(a),C(a)},rows:10,placeholder:"Enter your code here..."})})]})})}exports.default=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./register-chai-top-bar-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./register-chai-top-bar-DyW9GPzV.cjs"),s=require("./index-P-2SvZA9.cjs"),a=require("./index-CQf0jL1k.cjs"),n=require("lucide-react"),l=require("react-i18next"),o=()=>{const{setPageLockMeta:r}=a.usePageLockMeta(),{t}=l.useTranslation(),c=async()=>{r({})};return e.jsx(a.BlurContainer,{children:e.jsxs(s.Card,{className:"mx-auto w-full max-w-md",children:[e.jsx(s.CardHeader,{className:"space-y-1",children:e.jsxs(s.CardTitle,{className:"flex items-center gap-2 text-xl",children:[e.jsx(n.CheckCircle,{className:"h-6 w-6 text-green-500"}),t("You can edit the page now")]})}),e.jsx(s.CardContent,{className:"space-y-4",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:t("This page is released by other user you can continue editing now")})}),e.jsx(s.CardFooter,{className:"flex gap-2",children:e.jsxs(i.Button,{variant:"default",onClick:c,className:"flex-1 gap-2",children:[e.jsx(n.Check,{className:"h-4 w-4"}),t("Continue Editing")]})})]})})};exports.default=o;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
import { B as r } from "./register-chai-top-bar-
|
|
3
|
-
import {
|
|
4
|
-
import { b as d, B as h } from "./index-
|
|
2
|
+
import { B as r } from "./register-chai-top-bar-D6GjnauV.js";
|
|
3
|
+
import { G as o, H as c, I as i, J as l, K as m } from "./index-DpeytsiB.js";
|
|
4
|
+
import { b as d, B as h } from "./index-BpVxZOd-.js";
|
|
5
5
|
import { CheckCircle as u, Check as p } from "lucide-react";
|
|
6
6
|
import { useTranslation as C } from "react-i18next";
|
|
7
7
|
const y = () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("lodash-es"),d=require("react"),r={},P=()=>r,f=t=>d.useMemo(()=>s.get(r,t,null),[t]),a=t=>s.get(r,t),m=t=>(console.warn("getDefaultBlockProps is deprecated. Use getBlockDefaultProps instead."),g(t)),g=t=>{var l;const e=s.get(r,t),c=((l=e==null?void 0:e.props)==null?void 0:l.schema)||((e==null?void 0:e.schema)??{}),i=s.get(c,"properties",{}),o={};return s.each(i,(n,B)=>{s.has(n,"block")||s.set(o,B,n.default)}),o},C=t=>(console.warn("getI18nBlockProps is deprecated. Use getBlockI18nProps instead."),s.get(r,`${t}.i18nProps`,[])),y=t=>(console.warn("getAIBlockProps is deprecated. Use getBlockAIProps instead."),s.get(r,`${t}.aiProps`,[])),D=t=>{var k,h;const e=a(t);if(!e)return;const c=((k=e.props)==null?void 0:k.schema)||(e.schema??{}),i=((h=e.props)==null?void 0:h.uiSchema)||(e.uiSchema??{}),o=s.cloneDeep(c),l=s.get(o,"properties",{}),n=s.omitBy(l,u=>(u==null?void 0:u.styles)===!0);return s.set(o,"properties",n),{schema:o,uiSchema:i||{}}},S=t=>(console.warn("syncBlocksWithDefaults is deprecated. Use syncBlocksWithDefaultProps instead."),p(t)),p=t=>t.map(e=>s.has(r,e._type)?{...g(e._type),...e}:e),I=(t,e)=>{const c=s.get(r,e.type);c?s.set(r,e.type,{...c,component:t,...e}):s.set(r,e.type,{component:t,...e})},R=(t,e)=>{I(t,{...e,category:e.category||"core"})},v=(t,e)=>{const c=s.get(r,e.type);c?s.set(r,e.type,{...c,component:t,...e}):s.set(r,e.type,{component:t,...e})},W=(t,e)=>{const c=a(t);s.set(r,t,{...c,dataProvider:e})},w=(t,e)=>{const c=a(t);s.set(r,t,{...c,component:e})},A=(t,e)=>({type:"null",block:t,prop:e,default:null,runtime:!0,ui:{"ui:widget":"hidden"}});exports.closestBlockProp=A;exports.getAIBlockProps=y;exports.getBlockDefaultProps=g;exports.getBlockFormSchemas=D;exports.getDefaultBlockProps=m;exports.getI18nBlockProps=C;exports.getRegisteredChaiBlock=a;exports.registerChaiBlock=R;exports.registerChaiServerBlock=v;exports.setChaiBlockComponent=w;exports.setChaiServerBlockDataProvider=W;exports.syncBlocksWithDefaultProps=p;exports.syncBlocksWithDefaults=S;exports.useRegisteredChaiBlock=f;exports.useRegisteredChaiBlocks=P;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { get as c, each as f, has as d, set as o, cloneDeep as m, omitBy as P } from "lodash-es";
|
|
2
|
+
import { useMemo as y } from "react";
|
|
3
|
+
const t = {}, w = () => t, R = (s) => y(() => c(t, s, null), [s]), k = (s) => c(t, s), U = (s) => (console.warn("getDefaultBlockProps is deprecated. Use getBlockDefaultProps instead."), g(s)), g = (s) => {
|
|
4
|
+
var n;
|
|
5
|
+
const e = c(t, s), r = ((n = e == null ? void 0 : e.props) == null ? void 0 : n.schema) || ((e == null ? void 0 : e.schema) ?? {}), i = c(r, "properties", {}), a = {};
|
|
6
|
+
return f(i, (l, p) => {
|
|
7
|
+
d(l, "block") || o(a, p, l.default);
|
|
8
|
+
}), a;
|
|
9
|
+
}, v = (s) => (console.warn("getI18nBlockProps is deprecated. Use getBlockI18nProps instead."), c(t, `${s}.i18nProps`, [])), A = (s) => (console.warn("getAIBlockProps is deprecated. Use getBlockAIProps instead."), c(t, `${s}.aiProps`, [])), W = (s) => {
|
|
10
|
+
var B, h;
|
|
11
|
+
const e = k(s);
|
|
12
|
+
if (!e)
|
|
13
|
+
return;
|
|
14
|
+
const r = ((B = e.props) == null ? void 0 : B.schema) || (e.schema ?? {}), i = ((h = e.props) == null ? void 0 : h.uiSchema) || (e.uiSchema ?? {}), a = m(r), n = c(a, "properties", {}), l = P(n, (u) => (u == null ? void 0 : u.styles) === !0);
|
|
15
|
+
return o(a, "properties", l), { schema: a, uiSchema: i || {} };
|
|
16
|
+
}, _ = (s) => (console.warn("syncBlocksWithDefaults is deprecated. Use syncBlocksWithDefaultProps instead."), D(s)), D = (s) => s.map((e) => d(t, e._type) ? { ...g(e._type), ...e } : e), S = (s, e) => {
|
|
17
|
+
const r = c(t, e.type);
|
|
18
|
+
r ? o(t, e.type, { ...r, component: s, ...e }) : o(t, e.type, { component: s, ...e });
|
|
19
|
+
}, x = (s, e) => {
|
|
20
|
+
S(s, { ...e, category: e.category || "core" });
|
|
21
|
+
}, E = (s, e) => {
|
|
22
|
+
const r = c(t, e.type);
|
|
23
|
+
r ? o(t, e.type, { ...r, component: s, ...e }) : o(t, e.type, { component: s, ...e });
|
|
24
|
+
}, b = (s, e) => {
|
|
25
|
+
const r = k(s);
|
|
26
|
+
o(t, s, { ...r, dataProvider: e });
|
|
27
|
+
}, $ = (s, e) => {
|
|
28
|
+
const r = k(s);
|
|
29
|
+
o(t, s, { ...r, component: e });
|
|
30
|
+
}, j = (s, e) => ({
|
|
31
|
+
type: "null",
|
|
32
|
+
block: s,
|
|
33
|
+
prop: e,
|
|
34
|
+
default: null,
|
|
35
|
+
runtime: !0,
|
|
36
|
+
ui: { "ui:widget": "hidden" }
|
|
37
|
+
});
|
|
38
|
+
export {
|
|
39
|
+
g as a,
|
|
40
|
+
W as b,
|
|
41
|
+
j as c,
|
|
42
|
+
U as d,
|
|
43
|
+
v as e,
|
|
44
|
+
k as f,
|
|
45
|
+
A as g,
|
|
46
|
+
E as h,
|
|
47
|
+
$ as i,
|
|
48
|
+
D as j,
|
|
49
|
+
_ as k,
|
|
50
|
+
w as l,
|
|
51
|
+
x as r,
|
|
52
|
+
b as s,
|
|
53
|
+
R as u
|
|
54
|
+
};
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-P-2SvZA9.cjs"),r=require("./common-functions-B3a4xKt_.cjs"),i=require("./apply-binding-BuwI_Uf5.cjs"),a=require("./register-chai-top-bar-DyW9GPzV.cjs"),t=require("react-i18next"),o=require("i18next");exports.ChaiAddBlocksDialog=e.AddBlocksDialog;exports.ChaiAddBlocksPanel=e.AddBlocksPanel;exports.ChaiAskAiUserPrompt=e.AIUserPrompt;exports.ChaiBlockAttributesEditor=e.BlockAttributesEditor;exports.ChaiBlockPropsEditor=e.BlockSettings;exports.ChaiBlockStyleEditor=e.BlockStyling;exports.ChaiBuilderCanvas=e.CanvasArea;exports.ChaiBuilderEditor=e.ChaiBuilderEditor;exports.ChaiDarkModeSwitcher=e.DarkMode;exports.ChaiDefaultBlocks=e.DefaultChaiBlocks;exports.ChaiDraggableBlock=e.ChaiDraggableBlock;exports.ChaiExportCodeModal=e.ExportCodeModal;exports.ChaiImportHTML=e.ImportHTML;exports.ChaiOutline=e.ListTree;exports.ChaiScreenSizes=e.Breakpoints;exports.ChaiThemeConfigPanel=e.ThemeConfigPanel;exports.ChaiUILibrariesPanel=e.UILibrariesPanel;exports.ChaiUndoRedo=e.UndoRedo;exports.PERMISSIONS=e.PERMISSIONS;exports.defaultChaiLibrary=e.defaultChaiLibrary;exports.getClassValueAndUnit=e.getClassValueAndUnit;exports.useAddBlock=e.useAddBlock;exports.useBlocksHtmlForAi=e.useBlocksHtmlForAi;exports.useHtmlToBlocks=e.useHtmlToBlocks;exports.useI18nBlocks=e.useI18nBlocks;exports.useLanguages=e.useLanguages;exports.useReplaceBlock=e.useReplaceBlock;exports.useSavePage=e.useSavePage;exports.useSelectedBlock=e.useSelectedBlock;exports.useStreamMultipleBlocksProps=e.useStreamMultipleBlocksProps;exports.generateBlockId=r.generateUUID;exports.mergeClasses=r.cn;exports.convertHTMLToChaiBlocks=i.getBlocksFromHTML;exports.getBlocksFromHTML=i.getBlocksFromHTML;exports.ADD_BLOCK_TABS=a.ADD_BLOCK_TABS;exports.CHAI_BUILDER_PANELS=a.CHAI_BUILDER_PANELS;exports.IfChaiFeatureFlag=a.IfChaiFeatureFlag;exports.RJSF_EXTENSIONS=a.RJSF_EXTENSIONS;exports.getChaiLibrary=a.getChaiLibrary;exports.getPreImportHTML=a.getPreImportHTML;exports.registerChaiAddBlockTab=a.registerChaiAddBlockTab;exports.registerChaiBlockSettingField=a.registerChaiBlockSettingField;exports.registerChaiBlockSettingTemplate=a.registerChaiBlockSettingTemplate;exports.registerChaiBlockSettingWidget=a.registerChaiBlockSettingWidget;exports.registerChaiFeatureFlag=a.registerChaiFeatureFlag;exports.registerChaiFeatureFlags=a.registerChaiFeatureFlags;exports.registerChaiLibrary=a.registerChaiLibrary;exports.registerChaiMediaManager=a.registerChaiMediaManager;exports.registerChaiPreImportHTMLHook=a.registerChaiPreImportHTMLHook;exports.registerChaiSaveToLibrary=a.registerChaiSaveToLibrary;exports.registerChaiSidebarPanel=a.registerChaiSidebarPanel;exports.registerChaiTopBar=a.registerChaiTopBar;exports.resetSaveToLibrary=a.resetSaveToLibrary;exports.useChaiAddBlockTabs=a.useChaiAddBlockTabs;exports.useChaiBlockSettingComponents=a.useChaiBlockSettingComponents;exports.useChaiFeatureFlag=a.useChaiFeatureFlag;exports.useChaiFeatureFlags=a.useChaiFeatureFlags;exports.useChaiLibraries=a.useChaiLibraries;exports.useChaiSidebarPanels=a.useChaiSidebarPanels;exports.useMediaManagerComponent=a.useMediaManagerComponent;exports.useSaveToLibraryComponent=a.useSaveToLibraryComponent;exports.useToggleChaiFeatureFlag=a.useToggleChaiFeatureFlag;exports.useTopBarComponent=a.useTopBarComponent;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>t.useTranslation});exports.i18n=o;
|