chaipro 0.1.0
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 +36 -0
- package/dist/IconPicker-I7VNLYZ4.js +5 -0
- package/dist/actions-DM00SIUk.d.cts +899 -0
- package/dist/actions-DM00SIUk.d.ts +899 -0
- package/dist/actions-registery-SEJTZE5Q.js +1 -0
- package/dist/active-in-another-tab-SONDAONP.js +1 -0
- package/dist/add-new-language-page-TI6DUYYX.js +1 -0
- package/dist/add-new-page-LBHXICXO.js +1 -0
- package/dist/ai-block-floating-prompt-input-ESY5GQLZ.js +1 -0
- package/dist/ai-panel-content-62I6FDQF.css +1 -0
- package/dist/ai-panel-content-UZJZ463W.js +1 -0
- package/dist/ai-panel-default-lang-2ZXZYQRT.js +6 -0
- package/dist/ai-panel-default-lang-ETFOFFEF.css +1 -0
- package/dist/ai-panel-for-image-LADQP6VY.js +1 -0
- package/dist/ai-panel-other-lang-WDLC3M2M.js +1 -0
- package/dist/ai-panel-page-chat-7ZISZWY4.js +4 -0
- package/dist/ai-panel-page-chat-N4YFJGAM.css +1 -0
- package/dist/ai-prompt-input-CPT5ETQ4.js +1 -0
- package/dist/ai-theme-generator-7PS4BX52.js +1 -0
- package/dist/ai-translation-prompt-3VE2ECGR.js +1 -0
- package/dist/blocks-CMvgDlxw.d.ts +72 -0
- package/dist/blocks-CP-Pngaz.d.cts +72 -0
- package/dist/build-config-CCERdThN.d.ts +80 -0
- package/dist/build-config-DrerOPd9.d.cts +80 -0
- package/dist/builder.cjs +243 -0
- package/dist/builder.css +1 -0
- package/dist/builder.d.cts +352 -0
- package/dist/builder.d.ts +352 -0
- package/dist/builder.js +1 -0
- package/dist/chaibuilder-instance-DNz3Q-dY.d.cts +579 -0
- package/dist/chaibuilder-instance-qroszVwI.d.ts +579 -0
- package/dist/change-password-modal-NJL7ZLTY.js +1 -0
- package/dist/chunk-2AFM6557.js +3 -0
- package/dist/chunk-2N4IJZOR.js +1 -0
- package/dist/chunk-2NYUIXUX.js +1 -0
- package/dist/chunk-2PJZUYIZ.js +1 -0
- package/dist/chunk-32HH35VD.js +1 -0
- package/dist/chunk-346H4FEX.js +1 -0
- package/dist/chunk-34HIOUTE.js +1 -0
- package/dist/chunk-374QEK4F.js +1 -0
- package/dist/chunk-3E72DJSP.js +1 -0
- package/dist/chunk-3IT7IIAV.js +1 -0
- package/dist/chunk-3UEPBBE4.js +11 -0
- package/dist/chunk-3XSKJBPH.js +1 -0
- package/dist/chunk-45ELAD2J.js +1 -0
- package/dist/chunk-4JBHWPMO.js +1 -0
- package/dist/chunk-4P25MV5E.js +1 -0
- package/dist/chunk-4PQNBY3V.js +1 -0
- package/dist/chunk-4VNLL2IA.js +1 -0
- package/dist/chunk-55SU3QPU.js +1 -0
- package/dist/chunk-5ZC65NB6.js +1 -0
- package/dist/chunk-6M7V7BOM.js +1 -0
- package/dist/chunk-6TXCHU4K.js +1 -0
- package/dist/chunk-777N6WHB.js +1 -0
- package/dist/chunk-7C4EQOAR.js +12 -0
- package/dist/chunk-7EXZXKW2.js +1 -0
- package/dist/chunk-7QWMLDCG.js +1 -0
- package/dist/chunk-AOJE5WI3.js +1 -0
- package/dist/chunk-ATLMLDBS.js +1 -0
- package/dist/chunk-AVGF3YLU.js +17 -0
- package/dist/chunk-BQSLQHLD.js +1 -0
- package/dist/chunk-BWORNCTE.js +1 -0
- package/dist/chunk-BYGD5CDT.js +1 -0
- package/dist/chunk-CA5PVX24.js +1 -0
- package/dist/chunk-CFNOB42V.js +1 -0
- package/dist/chunk-CJP3BQH2.js +1 -0
- package/dist/chunk-CRJENCPR.js +1 -0
- package/dist/chunk-D5SKCKSB.js +1 -0
- package/dist/chunk-DZ72OHTD.js +1 -0
- package/dist/chunk-EPGOG22Q.js +0 -0
- package/dist/chunk-ERCY63ZW.js +1 -0
- package/dist/chunk-ESCX7KEH.js +1 -0
- package/dist/chunk-F2V4N3LT.js +156 -0
- package/dist/chunk-F7YMHPEA.js +1 -0
- package/dist/chunk-FERH2TPR.js +1 -0
- package/dist/chunk-FLSV2QGU.js +1 -0
- package/dist/chunk-FOKGOT6B.js +1 -0
- package/dist/chunk-GJOOCKUE.js +1 -0
- package/dist/chunk-HA7LF3RV.js +1 -0
- package/dist/chunk-HAKJOMCL.js +1 -0
- package/dist/chunk-HEKCKC7N.js +1 -0
- package/dist/chunk-HELRVKD2.js +3 -0
- package/dist/chunk-I7ODKVVX.js +1 -0
- package/dist/chunk-IAKCX2WB.js +1 -0
- package/dist/chunk-IB2C3TWH.js +1 -0
- package/dist/chunk-IH562KSP.js +1 -0
- package/dist/chunk-IP4JBQOX.js +1 -0
- package/dist/chunk-ITX7QWN6.js +1 -0
- package/dist/chunk-IUACZ3E6.js +6 -0
- package/dist/chunk-J7Q62EP7.js +1 -0
- package/dist/chunk-JBB5IJFA.js +1 -0
- package/dist/chunk-JPJRO4NU.js +1 -0
- package/dist/chunk-JUIS55JT.js +1 -0
- package/dist/chunk-JYBTQ3YX.js +5 -0
- package/dist/chunk-K5YWQY4U.js +1 -0
- package/dist/chunk-K6RHR4HT.js +1 -0
- package/dist/chunk-LNV5MRGV.js +1 -0
- package/dist/chunk-LRJREWRD.js +1 -0
- package/dist/chunk-LWYDGDPW.js +1 -0
- package/dist/chunk-MDMGXS5B.js +1 -0
- package/dist/chunk-MEROMQQX.js +1 -0
- package/dist/chunk-N7Z4RFFI.js +1 -0
- package/dist/chunk-NSQEQYEM.js +1 -0
- package/dist/chunk-OD3K76M6.js +1 -0
- package/dist/chunk-ODSL3KXG.js +1 -0
- package/dist/chunk-OJJDRACB.js +1 -0
- package/dist/chunk-ONSZ462E.js +1 -0
- package/dist/chunk-OQZ4EPOM.js +1 -0
- package/dist/chunk-OR7KKUYT.js +1 -0
- package/dist/chunk-OSGXFZTA.js +1 -0
- package/dist/chunk-PM3JNOZH.js +1 -0
- package/dist/chunk-PQHFT4TE.js +1 -0
- package/dist/chunk-QGVCH2NI.js +1 -0
- package/dist/chunk-QIGSSVEY.js +1 -0
- package/dist/chunk-R5ZTCDFD.js +1 -0
- package/dist/chunk-RBDZDQZR.js +1 -0
- package/dist/chunk-ROQRBSK6.js +1 -0
- package/dist/chunk-SSENH35Y.js +1 -0
- package/dist/chunk-SYPALJAE.js +1 -0
- package/dist/chunk-T2YYNX6Z.js +1 -0
- package/dist/chunk-T32TW3XV.js +1 -0
- package/dist/chunk-T56KQBE2.js +1 -0
- package/dist/chunk-TEL5ACJE.js +1 -0
- package/dist/chunk-TGJQC6VC.js +1 -0
- package/dist/chunk-TQ34DGOT.js +1 -0
- package/dist/chunk-TVF77C53.js +1 -0
- package/dist/chunk-UIDBBTCZ.js +3 -0
- package/dist/chunk-VKSRWZCO.js +1 -0
- package/dist/chunk-VL5WBPVV.js +1 -0
- package/dist/chunk-VUWHFLT7.js +22 -0
- package/dist/chunk-WEVKAJMV.js +1 -0
- package/dist/chunk-WHPIYGCY.js +1 -0
- package/dist/chunk-WNESLH23.js +1 -0
- package/dist/chunk-WOT6VMZA.js +1 -0
- package/dist/chunk-WSQ5SQBD.js +1 -0
- package/dist/chunk-XY4UJKHE.js +1 -0
- package/dist/chunk-Y2BHO7OO.js +1 -0
- package/dist/chunk-YDOQEFOK.js +1 -0
- package/dist/chunk-YEFMD4DS.js +1 -0
- package/dist/chunk-YQ5QQCRD.js +1 -0
- package/dist/chunk-YQPOFRXU.js +1 -0
- package/dist/chunk-YTPQSO7V.js +801 -0
- package/dist/chunk-ZAU65LBG.js +1 -0
- package/dist/chunk-ZRFCEMYU.js +1 -0
- package/dist/chunk-ZU2B5YT6.js +1 -0
- package/dist/chunk-ZXKKBKGV.js +1 -0
- package/dist/code-display-7346IUCO.js +1 -0
- package/dist/code-editor-UBGTTX2L.js +1 -0
- package/dist/components/ui/accordion.cjs +1 -0
- package/dist/components/ui/accordion.d.cts +9 -0
- package/dist/components/ui/accordion.d.ts +9 -0
- package/dist/components/ui/accordion.js +1 -0
- package/dist/components/ui/alert-dialog.cjs +1 -0
- package/dist/components/ui/alert-dialog.d.cts +23 -0
- package/dist/components/ui/alert-dialog.d.ts +23 -0
- package/dist/components/ui/alert-dialog.js +1 -0
- package/dist/components/ui/alert.cjs +1 -0
- package/dist/components/ui/alert.d.cts +11 -0
- package/dist/components/ui/alert.d.ts +11 -0
- package/dist/components/ui/alert.js +1 -0
- package/dist/components/ui/avatar.cjs +1 -0
- package/dist/components/ui/avatar.d.cts +8 -0
- package/dist/components/ui/avatar.d.ts +8 -0
- package/dist/components/ui/avatar.js +1 -0
- package/dist/components/ui/badge.cjs +1 -0
- package/dist/components/ui/badge.d.cts +13 -0
- package/dist/components/ui/badge.d.ts +13 -0
- package/dist/components/ui/badge.js +1 -0
- package/dist/components/ui/button.cjs +1 -0
- package/dist/components/ui/button.d.cts +15 -0
- package/dist/components/ui/button.d.ts +15 -0
- package/dist/components/ui/button.js +1 -0
- package/dist/components/ui/card.cjs +1 -0
- package/dist/components/ui/card.d.cts +10 -0
- package/dist/components/ui/card.d.ts +10 -0
- package/dist/components/ui/card.js +1 -0
- package/dist/components/ui/checkbox.cjs +1 -0
- package/dist/components/ui/checkbox.d.cts +6 -0
- package/dist/components/ui/checkbox.d.ts +6 -0
- package/dist/components/ui/checkbox.js +1 -0
- package/dist/components/ui/command.cjs +1 -0
- package/dist/components/ui/command.d.cts +83 -0
- package/dist/components/ui/command.d.ts +83 -0
- package/dist/components/ui/command.js +1 -0
- package/dist/components/ui/context-menu.cjs +1 -0
- package/dist/components/ui/context-menu.d.cts +30 -0
- package/dist/components/ui/context-menu.d.ts +30 -0
- package/dist/components/ui/context-menu.js +1 -0
- package/dist/components/ui/dialog.cjs +1 -0
- package/dist/components/ui/dialog.d.cts +22 -0
- package/dist/components/ui/dialog.d.ts +22 -0
- package/dist/components/ui/dialog.js +1 -0
- package/dist/components/ui/dropdown-menu.cjs +1 -0
- package/dist/components/ui/dropdown-menu.d.cts +30 -0
- package/dist/components/ui/dropdown-menu.d.ts +30 -0
- package/dist/components/ui/dropdown-menu.js +1 -0
- package/dist/components/ui/hover-card.cjs +1 -0
- package/dist/components/ui/hover-card.d.cts +8 -0
- package/dist/components/ui/hover-card.d.ts +8 -0
- package/dist/components/ui/hover-card.js +1 -0
- package/dist/components/ui/input.cjs +1 -0
- package/dist/components/ui/input.d.cts +5 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/input.js +1 -0
- package/dist/components/ui/label.cjs +1 -0
- package/dist/components/ui/label.d.cts +8 -0
- package/dist/components/ui/label.d.ts +8 -0
- package/dist/components/ui/label.js +1 -0
- package/dist/components/ui/loader.cjs +1 -0
- package/dist/components/ui/loader.d.cts +12 -0
- package/dist/components/ui/loader.d.ts +12 -0
- package/dist/components/ui/loader.js +1 -0
- package/dist/components/ui/navigation-menu.cjs +1 -0
- package/dist/components/ui/navigation-menu.d.cts +15 -0
- package/dist/components/ui/navigation-menu.d.ts +15 -0
- package/dist/components/ui/navigation-menu.js +1 -0
- package/dist/components/ui/popover.cjs +1 -0
- package/dist/components/ui/popover.d.cts +9 -0
- package/dist/components/ui/popover.d.ts +9 -0
- package/dist/components/ui/popover.js +1 -0
- package/dist/components/ui/progress.cjs +1 -0
- package/dist/components/ui/progress.d.cts +8 -0
- package/dist/components/ui/progress.d.ts +8 -0
- package/dist/components/ui/progress.js +1 -0
- package/dist/components/ui/scroll-area.cjs +1 -0
- package/dist/components/ui/scroll-area.d.cts +7 -0
- package/dist/components/ui/scroll-area.d.ts +7 -0
- package/dist/components/ui/scroll-area.js +1 -0
- package/dist/components/ui/select.cjs +1 -0
- package/dist/components/ui/select.d.cts +15 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/select.js +1 -0
- package/dist/components/ui/separator.cjs +1 -0
- package/dist/components/ui/separator.d.cts +6 -0
- package/dist/components/ui/separator.d.ts +6 -0
- package/dist/components/ui/separator.js +1 -0
- package/dist/components/ui/sheet.cjs +1 -0
- package/dist/components/ui/sheet.d.cts +29 -0
- package/dist/components/ui/sheet.d.ts +29 -0
- package/dist/components/ui/sheet.js +1 -0
- package/dist/components/ui/skeleton.cjs +1 -0
- package/dist/components/ui/skeleton.d.cts +5 -0
- package/dist/components/ui/skeleton.d.ts +5 -0
- package/dist/components/ui/skeleton.js +1 -0
- package/dist/components/ui/slider.cjs +1 -0
- package/dist/components/ui/slider.d.cts +6 -0
- package/dist/components/ui/slider.d.ts +6 -0
- package/dist/components/ui/slider.js +1 -0
- package/dist/components/ui/switch.cjs +1 -0
- package/dist/components/ui/switch.d.cts +9 -0
- package/dist/components/ui/switch.d.ts +9 -0
- package/dist/components/ui/switch.js +1 -0
- package/dist/components/ui/tabs.cjs +1 -0
- package/dist/components/ui/tabs.d.cts +9 -0
- package/dist/components/ui/tabs.d.ts +9 -0
- package/dist/components/ui/tabs.js +1 -0
- package/dist/components/ui/textarea.cjs +1 -0
- package/dist/components/ui/textarea.d.cts +5 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/textarea.js +1 -0
- package/dist/components/ui/toggle.cjs +1 -0
- package/dist/components/ui/toggle.d.cts +15 -0
- package/dist/components/ui/toggle.d.ts +15 -0
- package/dist/components/ui/toggle.js +1 -0
- package/dist/components/ui/tooltip.cjs +1 -0
- package/dist/components/ui/tooltip.d.cts +9 -0
- package/dist/components/ui/tooltip.d.ts +9 -0
- package/dist/components/ui/tooltip.js +1 -0
- package/dist/config-registry-RSJCAKY5.js +1 -0
- package/dist/continue-editing-in-this-client-QBMOFRLL.js +1 -0
- package/dist/core-BNe4bA6z.d.cts +5455 -0
- package/dist/core-BNe4bA6z.d.ts +5455 -0
- package/dist/css-import-modal-NMFRQGCY.js +13 -0
- package/dist/db/better-sqlite3.cjs +1 -0
- package/dist/db/better-sqlite3.d.cts +16 -0
- package/dist/db/better-sqlite3.d.ts +16 -0
- package/dist/db/better-sqlite3.js +1 -0
- package/dist/db/d1.cjs +1 -0
- package/dist/db/d1.d.cts +17 -0
- package/dist/db/d1.d.ts +17 -0
- package/dist/db/d1.js +1 -0
- package/dist/db/libsql.cjs +1 -0
- package/dist/db/libsql.d.cts +23 -0
- package/dist/db/libsql.d.ts +23 -0
- package/dist/db/libsql.js +1 -0
- package/dist/db/node-pg.cjs +1 -0
- package/dist/db/node-pg.d.cts +21 -0
- package/dist/db/node-pg.d.ts +21 -0
- package/dist/db/node-pg.js +1 -0
- package/dist/db/postgres.cjs +1 -0
- package/dist/db/postgres.d.cts +28 -0
- package/dist/db/postgres.d.ts +28 -0
- package/dist/db/postgres.js +1 -0
- package/dist/delete-page-CGR6VXZC.css +1 -0
- package/dist/delete-page-FQYTEMBN.js +1 -0
- package/dist/digital-asset-manager-PIZMJEMX.js +1 -0
- package/dist/digital-asset-manager-PSTDGMY2.css +1 -0
- package/dist/dispatch-action-3IV56BNY.js +1 -0
- package/dist/duplicate-page-HPPMQRL3.js +1 -0
- package/dist/dynamic-page-selector-LFHJQLYY.js +1 -0
- package/dist/dynamic-page-selector-SXJQAIGL.css +1 -0
- package/dist/edit-url-panel-Q3NJCV55.js +1 -0
- package/dist/get-blocks-styles-SLZ5NDUF.js +1 -0
- package/dist/get-page-styles-Q4FWW5LX.js +1 -0
- package/dist/image-editor-PLXDYVKE.css +1 -0
- package/dist/image-editor-RSEHWRGV.js +1 -0
- package/dist/json-diff-viewer-FQYK2FUX.js +8 -0
- package/dist/lang-panel-57UGEL6B.css +1 -0
- package/dist/lang-panel-HH5LEOF4.js +1 -0
- package/dist/license-overlay-4Q525E53.js +1 -0
- package/dist/log-ai-request-LHPKU2C5.js +1 -0
- package/dist/manage-design-tokens-264H25A2.js +1 -0
- package/dist/manage-design-tokens-modal-OIWIZ53K.js +1 -0
- package/dist/mark-as-template-7TCCEMGC.js +1 -0
- package/dist/nested-path-selector-content-N4XN7QUS.js +1 -0
- package/dist/nextjs/render-client.cjs +1 -0
- package/dist/nextjs/render-client.css +1 -0
- package/dist/nextjs/render-client.d.cts +14 -0
- package/dist/nextjs/render-client.d.ts +14 -0
- package/dist/nextjs/render-client.js +1 -0
- package/dist/nextjs/render.cjs +829 -0
- package/dist/nextjs/render.d.cts +78 -0
- package/dist/nextjs/render.d.ts +78 -0
- package/dist/nextjs/render.js +1 -0
- package/dist/nextjs/server.cjs +807 -0
- package/dist/nextjs/server.d.cts +329 -0
- package/dist/nextjs/server.d.ts +329 -0
- package/dist/nextjs/server.js +1 -0
- package/dist/nextjs.cjs +1 -0
- package/dist/nextjs.d.cts +17 -0
- package/dist/nextjs.d.ts +17 -0
- package/dist/nextjs.js +1 -0
- package/dist/no-language-page-content-NQIROTIL.js +1 -0
- package/dist/no-language-page-dialog-CWG5PI7N.js +1 -0
- package/dist/page-creator-2L6L6EFV.js +1 -0
- package/dist/page-lock-7HMG34UJ.js +1 -0
- package/dist/page-locked-dialog-ACMWVAZX.js +1 -0
- package/dist/page-manager-new-SCZFNGKO.js +1 -0
- package/dist/page-manager-new-VWRASZTI.css +1 -0
- package/dist/page-manager-search-and-filter-7CHPYAPV.js +1 -0
- package/dist/page-manager-sheet-KZZBKQ6M.js +1 -0
- package/dist/page-manager-sheet-U5YEB5CS.css +1 -0
- package/dist/page-revisions-content-DHPEQ4CA.js +1 -0
- package/dist/page-revisions-trigger-XGC4HOTL.js +1 -0
- package/dist/pages-DlMX1Lj2.d.cts +21 -0
- package/dist/pages-Dol4CXrN.d.ts +21 -0
- package/dist/payload/builder.cjs +243 -0
- package/dist/payload/builder.css +1 -0
- package/dist/payload/builder.d.cts +13 -0
- package/dist/payload/builder.d.ts +13 -0
- package/dist/payload/builder.js +1 -0
- package/dist/payload.cjs +807 -0
- package/dist/payload.d.cts +603 -0
- package/dist/payload.d.ts +603 -0
- package/dist/payload.js +1 -0
- package/dist/preview-banner-SDDZGGRW.js +1 -0
- package/dist/publish-pages-content-3AZ45DYH.js +1 -0
- package/dist/registry.cjs +11 -0
- package/dist/registry.d.cts +74 -0
- package/dist/registry.d.ts +74 -0
- package/dist/registry.js +1 -0
- package/dist/relations-DDBTFCMR.js +1 -0
- package/dist/revalidate-G2DEOH4Z.js +1 -0
- package/dist/rte-widget-modal-7RXFEYHK.js +1 -0
- package/dist/save-to-lib-65EGTZE5.js +1 -0
- package/dist/schema-IVNMPI4V.js +1 -0
- package/dist/schema.sqlite-CYBLikNv.d.cts +5852 -0
- package/dist/schema.sqlite-CYBLikNv.d.ts +5852 -0
- package/dist/seo-panel-WQ47FNP4.css +1 -0
- package/dist/seo-panel-Z6OBXHQ4.js +2 -0
- package/dist/server-config-b29G6_aQ.d.cts +116 -0
- package/dist/server-config-oPlt3V1X.d.ts +116 -0
- package/dist/state-RAP56WXS.js +1 -0
- package/dist/take-over-request-EB464ZGU.js +1 -0
- package/dist/translation-warning-modal-EES6I2QV.js +1 -0
- package/dist/types.cjs +1 -0
- package/dist/types.d.cts +38 -0
- package/dist/types.d.ts +38 -0
- package/dist/types.js +1 -0
- package/dist/unmark-as-template-6STMTBP5.js +1 -0
- package/dist/unpublish-page-CE3CJK5C.js +1 -0
- package/dist/unpublished-partials-modal-OZBWBCLN.js +1 -0
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.cts +168 -0
- package/dist/utils.d.ts +168 -0
- package/dist/utils.js +1 -0
- package/dist/web-blocks.cjs +1 -0
- package/dist/web-blocks.d.cts +3 -0
- package/dist/web-blocks.d.ts +3 -0
- package/dist/web-blocks.js +1 -0
- package/dist/web-preview-EIWOXGPY.js +1 -0
- package/package.json +322 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import"./chunk-WOT6VMZA.js";import{jsx as e,jsxs as o}from"react/jsx-runtime";function i({show:t,disableUrl:a}){let n=async()=>{await fetch(a!=null?a:"/next/exit-preview"),window.location.reload()};return t?e("div",{className:"group fixed bottom-4 left-4 z-50 duration-300 animate-in slide-in-from-bottom-4",children:o("div",{className:"flex items-center gap-0 rounded-full border border-amber-400/30 bg-gradient-to-r from-amber-500 to-amber-600 py-2 pl-3.5 pr-3.5 text-white shadow-2xl backdrop-blur-sm transition-all duration-300 group-hover:gap-3 group-hover:pr-3.5",children:[o("div",{className:"flex items-center gap-2",children:[o("span",{className:"relative flex h-2 w-2",children:[e("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-white opacity-75"}),e("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-white"})]}),e("span",{className:"text-xs font-medium",children:"Draft Mode is active"})]}),e("button",{onClick:n,className:"-ml-3 max-w-0 overflow-hidden whitespace-nowrap rounded-full bg-white px-3 py-1 text-[11px] font-semibold text-amber-600 opacity-0 shadow-sm transition-all duration-300 ease-in-out hover:bg-amber-50 hover:shadow-md group-hover:ml-0 group-hover:max-w-[100px] group-hover:opacity-100",children:"Disable"})]})}):null}export{i as PreviewBanner};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a as J}from"./chunk-374QEK4F.js";import"./chunk-OD3K76M6.js";import{a as W}from"./chunk-ZXKKBKGV.js";import"./chunk-K5YWQY4U.js";import{a as V}from"./chunk-ROQRBSK6.js";import{f as E,g as j}from"./chunk-GJOOCKUE.js";import"./chunk-FOKGOT6B.js";import"./chunk-CJP3BQH2.js";import"./chunk-PQHFT4TE.js";import{b as K,e as Q}from"./chunk-YEFMD4DS.js";import"./chunk-T2YYNX6Z.js";import{e as R}from"./chunk-AOJE5WI3.js";import"./chunk-ONSZ462E.js";import"./chunk-2NYUIXUX.js";import{a as G}from"./chunk-WHPIYGCY.js";import"./chunk-HA7LF3RV.js";import{a as D}from"./chunk-WEVKAJMV.js";import{d as M}from"./chunk-ZAU65LBG.js";import"./chunk-FERH2TPR.js";import"./chunk-TVF77C53.js";import"./chunk-WSQ5SQBD.js";import{f as O,g as _,h as q,i as $,j as z}from"./chunk-RBDZDQZR.js";import"./chunk-2N4IJZOR.js";import{b as L}from"./chunk-3IT7IIAV.js";import"./chunk-IP4JBQOX.js";import"./chunk-CRJENCPR.js";import"./chunk-ITX7QWN6.js";import"./chunk-LWYDGDPW.js";import"./chunk-VKSRWZCO.js";import"./chunk-3UEPBBE4.js";import"./chunk-WOT6VMZA.js";import{concat as me,filter as a,find as Y,first as de,get as Z,includes as U,isEmpty as I,keys as pe,map as N,orderBy as T,uniq as ee}from"lodash-es";import{Edit as ge,File as fe,GlobeIcon as he,Lock as xe}from"lucide-react";import{startTransition as te,useCallback as ye,useEffect as se,useMemo as h,useState as oe}from"react";import{useTranslation as ne}from"react-i18next";import{useQuery as ue}from"@tanstack/react-query";var X=()=>{let s=M(),p=R();return ue({queryKey:[D.GET_CHANGES],queryFn:async()=>p(s,{action:D.GET_CHANGES})})};import{Fragment as Te,jsx as t,jsxs as r}from"react/jsx-runtime";var be=({page:s,selectedPages:p,handleCheckboxChange:k,getPageType:n,hasSlug:x,currentOwnerId:m})=>{let{t:c}=ne(),d=E(),{data:u}=V(m),i=m===d?null:u==null?void 0:u.name;return r("tr",{className:"group relative hover:bg-muted/10",children:[r("td",{scope:"row",className:`flex items-center gap-x-1 whitespace-nowrap px-6 py-2 text-foreground ${i?"opacity-50":""}`,children:[i?t(xe,{className:"h-4 w-4 fill-destructive/20 text-destructive"}):t("input",{checked:U(p,s==null?void 0:s.id),onClick:y=>{y.stopPropagation(),k(s==null?void 0:s.id)},type:"checkbox",className:"cursor-pointer rounded focus:outline-none focus:ring-0"}),"\xA0",x(s.pageType)?t(fe,{className:"h-4 w-4"}):t(he,{className:"h-4 w-4"}),t(G,{content:s.name,side:"top",showTooltip:s.name.length>25,children:t("span",{className:"max-w-[200px] truncate font-medium",children:s.name})}),s.slug&&t(G,{content:s.slug,side:"top",showTooltip:s.slug.length>25,children:t("span",{className:"max-w-[200px] truncate font-mono text-xs text-muted-foreground",children:s.slug})})]}),t("td",{className:"px-2",children:n(s==null?void 0:s.pageType)}),t("td",{className:"px-4 text-right",children:de(s.changes)||""}),t(Te,{children:i&&r("button",{className:"absolute right-0 top-0 flex h-full items-center gap-x-1 rounded bg-destructive/10 px-2 py-0.5 text-xs font-light text-destructive opacity-0 group-hover:opacity-100",children:[t(ge,{size:12,className:"stroke-[3]"})," ",t("span",{className:"font-medium",children:i})," ",c("is editing this page")]})})]},s==null?void 0:s.id)},Ne=({onClose:s=()=>{},isPending:p,publishPage:k})=>{let{t:n}=ne(),x=E(),{pageToUser:m}=j(),[c,d]=oe([]),u=K(),[i,y]=oe(u),{data:w,isFetching:A}=X(),{data:g}=Q(),P=ye(e=>{var o;return(o=Y(g,{key:e}))==null?void 0:o.hasSlug},[g]),b=h(()=>a(g,e=>!P(e.key)).map(e=>e.key),[P,g]),B=ee(N(w,"lang")).filter(Boolean),l=h(()=>a(w,e=>e.pageType==="theme"||e.pageType==="design_tokens"?!1:i===u?e.lang===i||e.lang==="":e.lang===i),[w,i,u]),v=h(()=>a(l,e=>!b.includes(e.pageType)),[l,b]),C=h(()=>a(l,e=>b.includes(e.pageType)),[l,b]);se(()=>{let e=N(a(l,{online:!0}),"id");te(()=>d(e))},[l]),se(()=>{let e=a(pe(m),o=>Z(m,[o,"userId"])!==x);te(()=>d(o=>a(o,f=>!U(e,f))))},[m,x]);let F=(l==null?void 0:l.length)>0&&c.length===(l==null?void 0:l.length),le=e=>{d(o=>U(o,e)?a(o,f=>f!==e):me(o,e))},ae=()=>{d(F?[]:N(l,"id"))},re=()=>{k({ids:ee(c)},{onSuccess:()=>{s(),W("CENTER_CENTER"),y(u)}})},ie=e=>{if(e==="theme")return n("Theme");let o=Y(g,{key:e});return o?o==null?void 0:o.name:e},S=h(()=>{let e=[...T(a(v,{online:!0}),"pageType"),...T(a(C,{online:!0}),"pageType")].filter(H=>H.pageType!=="theme"&&H.pageType!=="design_tokens"),o=[...T(a(v,{online:!1}),"pageType"),...T(a(C,{online:!1}),"pageType")],f=e.length>0?[{label:n("Updated"),top:"pt-2"},...e]:[],ce=o.length>0?[{label:n("Offline"),top:"pt-6"},...o]:[];return[...f,...ce]},[v,C,n]);return r(O,{className:"flex max-h-[80%] max-w-4xl flex-col",children:[r(_,{children:[t($,{children:n("Publish changes")}),t(z,{className:"text-xs",children:n("Select the pages you want to publish. Click publish when you're done.")})]}),B.length>0&&t("div",{className:"my-[2px] mt-0 w-fit",children:t(J,{languages:[u,...B],selectedLanguage:i,setSelectedLanguage:y})}),t("div",{className:"no-scrollbar relative -mx-4 -mt-4 h-full max-h-full overflow-y-auto",children:A?r("div",{className:"space-y-2 px-1",children:[t("div",{className:"mt-2 h-6 w-full animate-pulse rounded bg-muted"}),t("div",{className:"h-6 w-full animate-pulse rounded bg-muted"}),t("div",{className:"h-6 w-full animate-pulse rounded bg-muted"}),t("div",{className:"h-6 w-full animate-pulse rounded bg-muted"})]}):r("table",{className:"w-full text-left text-xs text-muted-foreground rtl:text-right",children:[t("thead",{className:"sticky top-0 z-10 border-b bg-surface text-muted-foreground",children:r("tr",{children:[r("th",{scope:"col",className:"w-[150px] flex items-center gap-x-2 px-6 py-3",children:[!I(S)&&t("input",{checked:F,onClick:e=>{e.stopPropagation(),ae()},type:"checkbox",className:"cursor-pointer rounded focus:outline-none focus:ring-0"}),n("Name")]}),t("th",{scope:"col",className:"w-[150px] px-2 py-3",children:n("Type")}),t("th",{scope:"col",className:"w-[150px] px-4 py-3 text-right",children:n("Status")})]})}),t("tbody",{children:I(S)?t("tr",{children:t("td",{colSpan:3,className:"pt-10 text-center text-sm text-muted-foreground",children:n("No changes found")})}):N(S,e=>e.label?t("tr",{children:t("td",{colSpan:3,className:`relative px-6 py-2 text-xs font-medium text-foreground ${e.top}`,children:r("div",{className:"flex w-full items-center",children:[t("span",{className:"pr-2",children:e.label}),t("div",{className:"flex-1 border-t border-border"})]})})},`separator-${e.label}`):t(be,{page:e,selectedPages:c,handleCheckboxChange:le,getPageType:ie,hasSlug:P,currentOwnerId:Z(m,[(e==null?void 0:e.primaryPage)||(e==null?void 0:e.id),"userId"])},e.id))})]})}),r(q,{className:"mt-10 flex items-center justify-center",children:[c.length>0&&r("span",{className:"text-center text-sm text-muted-foreground",children:[c.length," ",c.length!==1?n("Pages"):n("Page")," ",n("Selected")]}),t(L,{disabled:p,variant:"outline",className:"text-muted-foreground",onClick:s,children:n("Cancel")}),t(L,{loading:p,disabled:A||I(c),onClick:re,children:n("Publish Selected")})]})]})},Me=Ne;export{Me as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";var u=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var M=(e,o)=>{for(var t in o)u(e,t,{get:o[t],enumerable:!0})},b=(e,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of w(o))!N.call(e,s)&&s!==t&&u(e,s,{get:()=>o[s],enumerable:!(n=H(o,s))||n.enumerable});return e};var z=e=>b(u({},"__esModule",{value:!0}),e);var re={};M(re,{builderProp:()=>oe,closestBlockProp:()=>G,defaultChaiStyles:()=>te,getAllRegisteredChaiBlocks:()=>I,getAllRegisteredFonts:()=>q,getBlockAIProps:()=>R,getBlockDefaultProps:()=>y,getBlockFormSchemas:()=>O,getBlockSchema:()=>Q,getBlockUiSchema:()=>V,getFontStyles:()=>$,getRegisteredChaiBlock:()=>C,getRegisteredFont:()=>S,registerChaiBlock:()=>A,registerChaiBlockProps:()=>Z,registerChaiFont:()=>X,setChaiBlockComponent:()=>L,stylesProp:()=>ee,syncBlocksWithDefaultProps:()=>D,useRegisteredChaiBlock:()=>x,useRegisteredChaiBlocks:()=>T,useRegisteredFonts:()=>W});module.exports=z(re);var i=require("lodash-es");var k="#styles:";var r=require("lodash-es"),P=require("react"),a={},T=()=>a,I=()=>a,x=e=>(0,P.useMemo)(()=>(0,r.get)(a,e,null),[e]),C=e=>(0,r.get)(a,e),f=e=>{let o=(0,r.memoize)(e),t=(n=>(0,r.has)(a,n)?o(n):e(n));return t.cache=o.cache,t},y=f(e=>{var l,c;let o=(0,r.get)(a,e),t=(c=(l=o==null?void 0:o.props)==null?void 0:l.schema)!=null?c:{},n=(0,r.get)(t,"properties",{}),s={};return(0,r.each)(n,(m,h)=>{(0,r.has)(m,"block")||(0,r.set)(s,h,m.default)}),s}),U=f(e=>(0,r.get)(a,`${e}.i18nProps`,[])),R=f(e=>(0,r.get)(a,`${e}.aiProps`,[])),F=f(e=>{var h,d,E,_;let o=C(e);if(!o)return;let t=(d=(h=o.props)==null?void 0:h.schema)!=null?d:{},n=(_=(E=o.props)==null?void 0:E.uiSchema)!=null?_:{},s=(0,r.cloneDeep)(t),l=(0,r.get)(s,"properties",{}),c=(0,r.omitBy)(l,B=>(B==null?void 0:B.styles)===!0);return(0,r.set)(s,"properties",c),{schema:s,uiSchema:n||{}}}),O=e=>{let o=F(e);if(o)return{schema:(0,r.cloneDeep)(o.schema),uiSchema:(0,r.cloneDeep)(o.uiSchema)}},Y=[y,U,R,F],K=e=>{for(let o of Y)o.cache.delete(e)},D=e=>e.map(o=>(0,r.has)(a,o._type)?{...y(o._type),...o}:o),v=(e,o)=>{let t=(0,r.get)(a,o.type);t?(0,r.set)(a,o.type,{...t,component:e,...o}):(0,r.set)(a,o.type,{component:e,...o}),K(o.type)},A=(e,o)=>{v(e,{...o,category:o.category||"core"})};var L=(e,o)=>{let t=C(e);(0,r.set)(a,e,{...t,component:o}),K(e)},G=(e,o)=>({type:"null",block:e,prop:o,default:null,runtime:!0,ui:{"ui:widget":"hidden"}});var p=require("lodash-es");var J=e=>{let o=(0,p.filter)((0,p.compact)((0,p.map)(e,S)),t=>(0,p.has)(t,"src"));return j(o)},j=e=>!e||e.length===0?"":(0,p.uniqBy)(e,"family").map(o=>o.src.map(t=>`@font-face {
|
|
2
|
+
font-family: "${o.family}";
|
|
3
|
+
src: url("${t.url}") format("${t.format}");
|
|
4
|
+
font-display: swap;
|
|
5
|
+
font-optical-sizing: auto;
|
|
6
|
+
${t.fontWeight?`font-weight: ${t.fontWeight};`:""}
|
|
7
|
+
${t.fontStyle?`font-style: ${t.fontStyle};`:""}
|
|
8
|
+
${t.fontStretch?`font-stretch: ${t.fontStretch};`:""}
|
|
9
|
+
}`).join(`
|
|
10
|
+
`)).join(`
|
|
11
|
+
`),$=async(e,o)=>{let t=J([e,o]),n=[];return[e,...e!==o?[o]:[]].forEach(l=>{let c=S(l);c&&(0,p.has)(c,"src")&&c.src&&c.src.length>0&&n.push(c.src[0].url)}),{fontStyles:t,preloads:(0,p.uniqBy)(n,l=>l)}};var g=[{family:"Arial",fallback:"Helvetica, sans-serif"},{family:"Times New Roman",fallback:"Georgia, serif"},{family:"Courier New",fallback:"Courier, monospace"}],X=(e,o)=>{g.unshift({family:e,...o})},W=()=>g,S=e=>g.find(o=>o.family===e),q=()=>g;var Z=e=>{let o=["_type","_id","_parent","_bindings","_name"],t=["$loading","blockProps","inBuilder","lang","draft","pageProps","pageData","children"],n=(0,i.keys)(e.properties);if((0,i.intersection)(n,o).length>0)throw new Error(`Reserved props are not allowed: ${(0,i.intersection)(n,o).join(", ")}`);if((0,i.intersection)(n,t).length>0)throw new Error(`Runtime props are not allowed in schema: ${(0,i.intersection)(n,t).join(", ")}`);let s=(0,i.get)(e,"properties",{}),l={};return(0,i.each)(s,(c,m)=>{(0,i.isEmpty)(c.ui)||(l[m]={...c.ui},delete s[m].ui)}),{schema:(0,i.isEmpty)(s)?{}:{...(0,i.omit)(e,["ui"])},uiSchema:{...(0,i.get)(e,"ui",{}),...l}}},Q=e=>{var o;return(o=e.props)==null?void 0:o.schema},V=e=>{var o;return(o=e.props)==null?void 0:o.uiSchema},ee=(e="")=>({type:"string",styles:!0,default:`${k},${e}`,ui:{"ui:widget":"hidden"}}),oe=e=>({builderProp:!0,...e}),te=e=>`${k},${e}`;0&&(module.exports={builderProp,closestBlockProp,defaultChaiStyles,getAllRegisteredChaiBlocks,getAllRegisteredFonts,getBlockAIProps,getBlockDefaultProps,getBlockFormSchemas,getBlockSchema,getBlockUiSchema,getFontStyles,getRegisteredChaiBlock,getRegisteredFont,registerChaiBlock,registerChaiBlockProps,registerChaiFont,setChaiBlockComponent,stylesProp,syncBlocksWithDefaultProps,useRegisteredChaiBlock,useRegisteredChaiBlocks,useRegisteredFonts});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { m as ChaiBlockPropsSchema, k as ChaiBlock, H as ChaiFont, I as ChaiFontBySrc, n as ChaiBlockRJSFSchemas } from './actions-DM00SIUk.cjs';
|
|
2
|
+
import { RJSFSchema, UiSchema } from '@rjsf/utils';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { b as ChaiBlockConfig, a as ChaiBlockComponentProps } from './blocks-CP-Pngaz.cjs';
|
|
5
|
+
import 'ai';
|
|
6
|
+
|
|
7
|
+
declare const REGISTERED_CHAI_BLOCKS: Record<string, ChaiBlockConfig & {
|
|
8
|
+
component: React__default.ComponentType<ChaiBlockComponentProps>;
|
|
9
|
+
}>;
|
|
10
|
+
declare const useRegisteredChaiBlocks: () => Record<string, ChaiBlockConfig & {
|
|
11
|
+
component: React__default.ComponentType<ChaiBlockComponentProps>;
|
|
12
|
+
}>;
|
|
13
|
+
/** Returns all registered ChaiBlock configs. Safe to call outside React. */
|
|
14
|
+
declare const getAllRegisteredChaiBlocks: () => Record<string, ChaiBlockConfig & {
|
|
15
|
+
component: React__default.ComponentType<ChaiBlockComponentProps>;
|
|
16
|
+
}>;
|
|
17
|
+
declare const useRegisteredChaiBlock: (type: keyof typeof REGISTERED_CHAI_BLOCKS) => (ChaiBlockConfig & {
|
|
18
|
+
component: React__default.ComponentType<ChaiBlockComponentProps>;
|
|
19
|
+
}) | null;
|
|
20
|
+
declare const getRegisteredChaiBlock: (type: keyof typeof REGISTERED_CHAI_BLOCKS) => (ChaiBlockConfig & {
|
|
21
|
+
component: React__default.ComponentType<ChaiBlockComponentProps>;
|
|
22
|
+
}) | undefined;
|
|
23
|
+
type MemoizedByRegisteredType<T> = ((type: keyof typeof REGISTERED_CHAI_BLOCKS) => T) & {
|
|
24
|
+
cache: {
|
|
25
|
+
delete: (key: string) => boolean;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
declare const getBlockDefaultProps: MemoizedByRegisteredType<Record<string, any>>;
|
|
29
|
+
declare const getBlockAIProps: MemoizedByRegisteredType<never[] | (ChaiBlockConfig & {
|
|
30
|
+
component: React__default.ComponentType<ChaiBlockComponentProps>;
|
|
31
|
+
})>;
|
|
32
|
+
declare const getBlockFormSchemas: (type: keyof typeof REGISTERED_CHAI_BLOCKS) => {
|
|
33
|
+
schema: RJSFSchema;
|
|
34
|
+
uiSchema: UiSchema;
|
|
35
|
+
} | undefined;
|
|
36
|
+
declare const syncBlocksWithDefaultProps: (blocks: ChaiBlock[]) => ChaiBlock[];
|
|
37
|
+
declare const registerChaiBlock: (component: React__default.ComponentType<ChaiBlockComponentProps<any>>, options: ChaiBlockConfig) => void;
|
|
38
|
+
declare const setChaiBlockComponent: (type: keyof typeof REGISTERED_CHAI_BLOCKS, component: React__default.ComponentType<ChaiBlockComponentProps<any>>) => void;
|
|
39
|
+
declare const closestBlockProp: (blockType: keyof typeof REGISTERED_CHAI_BLOCKS, prop: string) => ChaiBlockPropsSchema;
|
|
40
|
+
|
|
41
|
+
declare const getFontStyles: (headingFont: string, bodyFont: string) => Promise<{
|
|
42
|
+
fontStyles: string;
|
|
43
|
+
preloads: string[];
|
|
44
|
+
}>;
|
|
45
|
+
|
|
46
|
+
declare const registerChaiFont: (family: string, font: Omit<ChaiFontBySrc, "family">) => void;
|
|
47
|
+
declare const useRegisteredFonts: () => ChaiFont[];
|
|
48
|
+
declare const getRegisteredFont: (family: string) => ChaiFont | undefined;
|
|
49
|
+
declare const getAllRegisteredFonts: () => ChaiFont[];
|
|
50
|
+
|
|
51
|
+
declare const registerChaiBlockProps: (blockSchema: ChaiBlockPropsSchema) => ChaiBlockRJSFSchemas;
|
|
52
|
+
/**
|
|
53
|
+
* Helper to get schema from block config.
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
declare const getBlockSchema: (config: {
|
|
57
|
+
props?: {
|
|
58
|
+
schema?: any;
|
|
59
|
+
};
|
|
60
|
+
}) => any;
|
|
61
|
+
/**
|
|
62
|
+
* Helper to get uiSchema from block config.
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
declare const getBlockUiSchema: (config: {
|
|
66
|
+
props?: {
|
|
67
|
+
uiSchema?: any;
|
|
68
|
+
};
|
|
69
|
+
}) => any;
|
|
70
|
+
declare const stylesProp: (defaultClasses?: string) => ChaiBlockPropsSchema;
|
|
71
|
+
declare const builderProp: (options: ChaiBlockPropsSchema) => ChaiBlockPropsSchema;
|
|
72
|
+
declare const defaultChaiStyles: (classes: string) => string;
|
|
73
|
+
|
|
74
|
+
export { builderProp, closestBlockProp, defaultChaiStyles, getAllRegisteredChaiBlocks, getAllRegisteredFonts, getBlockAIProps, getBlockDefaultProps, getBlockFormSchemas, getBlockSchema, getBlockUiSchema, getFontStyles, getRegisteredChaiBlock, getRegisteredFont, registerChaiBlock, registerChaiBlockProps, registerChaiFont, setChaiBlockComponent, stylesProp, syncBlocksWithDefaultProps, useRegisteredChaiBlock, useRegisteredChaiBlocks, useRegisteredFonts };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { m as ChaiBlockPropsSchema, k as ChaiBlock, H as ChaiFont, I as ChaiFontBySrc, n as ChaiBlockRJSFSchemas } from './actions-DM00SIUk.js';
|
|
2
|
+
import { RJSFSchema, UiSchema } from '@rjsf/utils';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { b as ChaiBlockConfig, a as ChaiBlockComponentProps } from './blocks-CMvgDlxw.js';
|
|
5
|
+
import 'ai';
|
|
6
|
+
|
|
7
|
+
declare const REGISTERED_CHAI_BLOCKS: Record<string, ChaiBlockConfig & {
|
|
8
|
+
component: React__default.ComponentType<ChaiBlockComponentProps>;
|
|
9
|
+
}>;
|
|
10
|
+
declare const useRegisteredChaiBlocks: () => Record<string, ChaiBlockConfig & {
|
|
11
|
+
component: React__default.ComponentType<ChaiBlockComponentProps>;
|
|
12
|
+
}>;
|
|
13
|
+
/** Returns all registered ChaiBlock configs. Safe to call outside React. */
|
|
14
|
+
declare const getAllRegisteredChaiBlocks: () => Record<string, ChaiBlockConfig & {
|
|
15
|
+
component: React__default.ComponentType<ChaiBlockComponentProps>;
|
|
16
|
+
}>;
|
|
17
|
+
declare const useRegisteredChaiBlock: (type: keyof typeof REGISTERED_CHAI_BLOCKS) => (ChaiBlockConfig & {
|
|
18
|
+
component: React__default.ComponentType<ChaiBlockComponentProps>;
|
|
19
|
+
}) | null;
|
|
20
|
+
declare const getRegisteredChaiBlock: (type: keyof typeof REGISTERED_CHAI_BLOCKS) => (ChaiBlockConfig & {
|
|
21
|
+
component: React__default.ComponentType<ChaiBlockComponentProps>;
|
|
22
|
+
}) | undefined;
|
|
23
|
+
type MemoizedByRegisteredType<T> = ((type: keyof typeof REGISTERED_CHAI_BLOCKS) => T) & {
|
|
24
|
+
cache: {
|
|
25
|
+
delete: (key: string) => boolean;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
declare const getBlockDefaultProps: MemoizedByRegisteredType<Record<string, any>>;
|
|
29
|
+
declare const getBlockAIProps: MemoizedByRegisteredType<never[] | (ChaiBlockConfig & {
|
|
30
|
+
component: React__default.ComponentType<ChaiBlockComponentProps>;
|
|
31
|
+
})>;
|
|
32
|
+
declare const getBlockFormSchemas: (type: keyof typeof REGISTERED_CHAI_BLOCKS) => {
|
|
33
|
+
schema: RJSFSchema;
|
|
34
|
+
uiSchema: UiSchema;
|
|
35
|
+
} | undefined;
|
|
36
|
+
declare const syncBlocksWithDefaultProps: (blocks: ChaiBlock[]) => ChaiBlock[];
|
|
37
|
+
declare const registerChaiBlock: (component: React__default.ComponentType<ChaiBlockComponentProps<any>>, options: ChaiBlockConfig) => void;
|
|
38
|
+
declare const setChaiBlockComponent: (type: keyof typeof REGISTERED_CHAI_BLOCKS, component: React__default.ComponentType<ChaiBlockComponentProps<any>>) => void;
|
|
39
|
+
declare const closestBlockProp: (blockType: keyof typeof REGISTERED_CHAI_BLOCKS, prop: string) => ChaiBlockPropsSchema;
|
|
40
|
+
|
|
41
|
+
declare const getFontStyles: (headingFont: string, bodyFont: string) => Promise<{
|
|
42
|
+
fontStyles: string;
|
|
43
|
+
preloads: string[];
|
|
44
|
+
}>;
|
|
45
|
+
|
|
46
|
+
declare const registerChaiFont: (family: string, font: Omit<ChaiFontBySrc, "family">) => void;
|
|
47
|
+
declare const useRegisteredFonts: () => ChaiFont[];
|
|
48
|
+
declare const getRegisteredFont: (family: string) => ChaiFont | undefined;
|
|
49
|
+
declare const getAllRegisteredFonts: () => ChaiFont[];
|
|
50
|
+
|
|
51
|
+
declare const registerChaiBlockProps: (blockSchema: ChaiBlockPropsSchema) => ChaiBlockRJSFSchemas;
|
|
52
|
+
/**
|
|
53
|
+
* Helper to get schema from block config.
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
declare const getBlockSchema: (config: {
|
|
57
|
+
props?: {
|
|
58
|
+
schema?: any;
|
|
59
|
+
};
|
|
60
|
+
}) => any;
|
|
61
|
+
/**
|
|
62
|
+
* Helper to get uiSchema from block config.
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
declare const getBlockUiSchema: (config: {
|
|
66
|
+
props?: {
|
|
67
|
+
uiSchema?: any;
|
|
68
|
+
};
|
|
69
|
+
}) => any;
|
|
70
|
+
declare const stylesProp: (defaultClasses?: string) => ChaiBlockPropsSchema;
|
|
71
|
+
declare const builderProp: (options: ChaiBlockPropsSchema) => ChaiBlockPropsSchema;
|
|
72
|
+
declare const defaultChaiStyles: (classes: string) => string;
|
|
73
|
+
|
|
74
|
+
export { builderProp, closestBlockProp, defaultChaiStyles, getAllRegisteredChaiBlocks, getAllRegisteredFonts, getBlockAIProps, getBlockDefaultProps, getBlockFormSchemas, getBlockSchema, getBlockUiSchema, getFontStyles, getRegisteredChaiBlock, getRegisteredFont, registerChaiBlock, registerChaiBlockProps, registerChaiFont, setChaiBlockComponent, stylesProp, syncBlocksWithDefaultProps, useRegisteredChaiBlock, useRegisteredChaiBlocks, useRegisteredFonts };
|
package/dist/registry.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,m as j,n as k,o as l,p as m,q as n,r as o,s as p,t as q,u as r,v as s,w as t,x as u,y as v}from"./chunk-3UEPBBE4.js";import"./chunk-WOT6VMZA.js";export{u as builderProp,k as closestBlockProp,v as defaultChaiStyles,b as getAllRegisteredChaiBlocks,p as getAllRegisteredFonts,f as getBlockAIProps,e as getBlockDefaultProps,g as getBlockFormSchemas,r as getBlockSchema,s as getBlockUiSchema,l as getFontStyles,d as getRegisteredChaiBlock,o as getRegisteredFont,i as registerChaiBlock,q as registerChaiBlockProps,m as registerChaiFont,j as setChaiBlockComponent,t as stylesProp,h as syncBlocksWithDefaultProps,c as useRegisteredChaiBlock,a as useRegisteredChaiBlocks,n as useRegisteredFonts};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as l,b as n,c as s,d,e as a,f as c,g as f,h as i,i as R,j as x,k as P,m as t,n as b,o as g,p as U,q as A,r as v,s as h,t as u,u as O,v as T,w as _,x as o}from"./chunk-OSGXFZTA.js";import"./chunk-WOT6VMZA.js";import{relations as p}from"drizzle-orm/relations";var k=p(l,({one:e})=>({app:e(s,{fields:[l.app],references:[s.id]})})),w=p(s,({one:e,many:r})=>({appApiKeys:r(l),invitedUsers:r(n),client:e(i,{fields:[s.client],references:[i.id]}),libraries:r(a),appFormSubmissions:r(R),appDomains:r(x),appUsers:r(P),appPages:r(t),appAssets:r(U),appTrashes:r(h),appPagesRevisions:r(u),appPagesOnlines:r(T),aiLogs:r(o)})),C=p(n,({one:e})=>({app:e(s,{fields:[n.app],references:[s.id]}),client:e(i,{fields:[n.client],references:[i.id]})})),D=p(i,({many:e})=>({invitedUsers:e(n),apps:e(s),appsOnlines:e(d),webhookEvents:e(c),appUserPlans:e(f),aiCreditAddons:e(b),aiAddonPurchases:e(g),clientUsers:e(A),appUserAddons:e(v),aiLogs:e(o)})),E=p(d,({one:e})=>({client:e(i,{fields:[d.client],references:[i.id]})})),F=p(a,({one:e,many:r})=>({app:e(s,{fields:[a.app],references:[s.id]}),libraryTemplates:r(O),libraryItems:r(_)})),K=p(c,({one:e})=>({client:e(i,{fields:[c.clientId],references:[i.id]})})),S=p(f,({one:e})=>({client:e(i,{fields:[f.client],references:[i.id]})})),N=p(R,({one:e})=>({app:e(s,{fields:[R.app],references:[s.id]})})),j=p(x,({one:e})=>({app:e(s,{fields:[x.app],references:[s.id]})})),m=p(P,({one:e})=>({app:e(s,{fields:[P.app],references:[s.id]})})),q=p(t,({one:e,many:r})=>({app:e(s,{fields:[t.app],references:[s.id]}),appPage:e(t,{fields:[t.parent],references:[t.id],relationName:"appPages_parent_appPages_id"}),appPages:r(t,{relationName:"appPages_parent_appPages_id"})})),z=p(b,({one:e})=>({client:e(i,{fields:[b.client],references:[i.id]})})),B=p(g,({one:e})=>({client:e(i,{fields:[g.client],references:[i.id]})})),G=p(U,({one:e})=>({app:e(s,{fields:[U.app],references:[s.id]})})),H=p(A,({one:e})=>({client:e(i,{fields:[A.client],references:[i.id]})})),J=p(v,({one:e})=>({client:e(i,{fields:[v.client],references:[i.id]})})),M=p(h,({one:e})=>({app:e(s,{fields:[h.app],references:[s.id]})})),Q=p(u,({one:e})=>({app:e(s,{fields:[u.app],references:[s.id]})})),V=p(O,({one:e})=>({library:e(a,{fields:[O.library],references:[a.id]})})),W=p(T,({one:e})=>({app:e(s,{fields:[T.app],references:[s.id]})})),X=p(_,({one:e})=>({library:e(a,{fields:[_.library],references:[a.id]})})),Y=p(o,({one:e})=>({app:e(s,{fields:[o.app],references:[s.id]}),client:e(i,{fields:[o.client],references:[i.id]})}));export{B as aiAddonPurchasesRelations,z as aiCreditAddonsRelations,Y as aiLogsRelations,k as appApiKeysRelations,G as appAssetsRelations,j as appDomainsRelations,N as appFormSubmissionsRelations,W as appPagesOnlineRelations,q as appPagesRelations,Q as appPagesRevisionsRelations,M as appTrashRelations,J as appUserAddonsRelations,S as appUserPlansRelations,m as appUsersRelations,E as appsOnlineRelations,w as appsRelations,H as clientUsersRelations,D as clientsRelations,C as invitedUsersRelations,F as librariesRelations,X as libraryItemsRelations,V as libraryTemplatesRelations,K as webhookEventsRelations};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-TQ34DGOT.js";import"./chunk-UIDBBTCZ.js";import"./chunk-4PQNBY3V.js";import"./chunk-IB2C3TWH.js";import"./chunk-MDMGXS5B.js";import"./chunk-YTPQSO7V.js";import"./chunk-JYBTQ3YX.js";import"./chunk-346H4FEX.js";import"./chunk-CFNOB42V.js";import"./chunk-DZ72OHTD.js";import"./chunk-OSGXFZTA.js";import"./chunk-OQZ4EPOM.js";import"./chunk-ESCX7KEH.js";import"./chunk-CRJENCPR.js";import"./chunk-6M7V7BOM.js";import"./chunk-K6RHR4HT.js";import"./chunk-VUWHFLT7.js";import"./chunk-OR7KKUYT.js";import"./chunk-T56KQBE2.js";import"./chunk-YDOQEFOK.js";import"./chunk-ITX7QWN6.js";import"./chunk-LWYDGDPW.js";import"./chunk-VKSRWZCO.js";import"./chunk-3UEPBBE4.js";import"./chunk-WOT6VMZA.js";export{a as revalidateCollectionItem};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as v}from"./chunk-F7YMHPEA.js";import{sa as D}from"./chunk-2NYUIXUX.js";import"./chunk-TVF77C53.js";import"./chunk-777N6WHB.js";import"./chunk-YQ5QQCRD.js";import{a as x,f as h,g,i as u}from"./chunk-RBDZDQZR.js";import{b as p}from"./chunk-3IT7IIAV.js";import"./chunk-IP4JBQOX.js";import"./chunk-CRJENCPR.js";import"./chunk-ITX7QWN6.js";import"./chunk-LWYDGDPW.js";import"./chunk-VKSRWZCO.js";import"./chunk-3UEPBBE4.js";import"./chunk-WOT6VMZA.js";import{jsx as e,jsxs as l}from"react/jsx-runtime";var B=({isOpen:N,onClose:c,editor:t,rteElement:E})=>{let a=D(),C=s=>{if(!t)return;let r=`{{${s}}}`;t.commands.focus();let{from:S,to:w}=t.state.selection;if(S!==w)t.chain().deleteSelection().insertContent(r).run();else{let{state:n}=t,o=n.selection.from,m=n.doc.textBetween(Math.max(0,o-1),o),i=n.doc.textBetween(o,Math.min(o+1,n.doc.content.size)),f="";o>0&&m!==" "&&!/[.,!?;:]/.test(m)&&(f=" ");let d="";i&&i!==" "&&!/[.,!?;:]/.test(i)&&(d=" "),t.chain().insertContent(f+r+d).run()}};return e(x,{open:N,onOpenChange:s=>!s&&c(),children:l(h,{className:"max-h-[90vh] overflow-y-auto sm:max-w-[800px]",children:[e(g,{children:l(u,{className:"flex items-center justify-between pr-8",children:[e("span",{children:"Rich Text Editor"}),a&&Object.keys(a).length>0&&l("div",{className:"flex items-center",children:[e("span",{className:"mr-2 text-xs text-foreground/50",children:"Add field:"}),e("div",{className:"rte-path-selector",children:e(v,{data:a,onSelect:C})})]})]})}),E,e("div",{className:"mt-4 flex justify-end",children:e(p,{onClick:c,children:"Done"})})]})})},M=B;export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ce,b as me,d as de}from"./chunk-R5ZTCDFD.js";import{e as x}from"./chunk-AOJE5WI3.js";import"./chunk-ONSZ462E.js";import{H as te,N as oe,ma as R}from"./chunk-2NYUIXUX.js";import{a as T}from"./chunk-WEVKAJMV.js";import{a as ae}from"./chunk-55SU3QPU.js";import{d as G}from"./chunk-ZAU65LBG.js";import{a as J,b as Z,d as ee}from"./chunk-777N6WHB.js";import{a as se,b as q,c as ie,d as ne,g as le,h as O,i as K}from"./chunk-WSQ5SQBD.js";import{a as w}from"./chunk-2N4IJZOR.js";import{a as U}from"./chunk-4JBHWPMO.js";import{b as u}from"./chunk-3IT7IIAV.js";import"./chunk-IP4JBQOX.js";import{a as re}from"./chunk-CRJENCPR.js";import"./chunk-ITX7QWN6.js";import"./chunk-LWYDGDPW.js";import"./chunk-VKSRWZCO.js";import"./chunk-3UEPBBE4.js";import"./chunk-WOT6VMZA.js";import{has as et,isEmpty as tt,set as ot}from"lodash-es";import{AlertCircle as rt}from"lucide-react";import{useEffect as H,useMemo as Ce,useState as C}from"react";import{toast as Ee}from"sonner";import{Trash2 as ve}from"lucide-react";import{useState as be}from"react";import{toast as ze}from"sonner";import{useMutation as ue,useQuery as Ae}from"@tanstack/react-query";import{useSetAtom as Me}from"jotai";import{toast as _}from"sonner";var pe=t=>{let o=G(),s=x();return ue({mutationFn:async e=>s(o,{action:T.UPSERT_LIBRARY_ITEM,data:e}),onSuccess:e=>{t?t(e):_.success("Block saved successfully")},onError:e=>{console.error("Error saving block:",e),_.error("Failed to save block",{description:e instanceof Error?e.message:"Unknown error"})}})},fe=t=>{let o=G(),s=x();return Ae({staleTime:"static",queryKey:[T.GET_LIBRARY_ITEM,t],enabled:!!t,queryFn:async()=>{if(!t)return null;try{return await s(o,{action:T.GET_LIBRARY_ITEM,data:{id:t}})}catch(e){throw console.error(e),new Error("The block could not be found on the server. It may have been deleted.")}},retry:!1})};var ge=t=>{let o=G(),s=x(),e=Me(ce);return ue({mutationFn:async i=>s(o,{action:T.DELETE_LIBRARY_ITEM,data:{id:i}}),onSuccess:()=>{e(i=>{let d={...i};return Object.keys(d).forEach(m=>{d[m]={loading:"idle",blocks:[],error:!1}}),d}),t?t():_.success("Block deleted successfully")},onError:i=>{console.error("Error deleting block:",i),_.error("Failed to delete block",{description:i instanceof Error?i.message:"Unknown error"})}})};import{jsx as I,jsxs as P}from"react/jsx-runtime";var qe=({blockId:t,libBlockId:o,isOpen:s,onClose:e,blockName:i,trigger:d})=>{let[m,n]=be(!1),l=R(),k=ge(()=>{l([t],{_libBlockId:void 0}),ze.success("Block deleted successfully"),n(!1),e()});return P(J,{open:s,onOpenChange:p=>!p&&e(),children:[I(Z,{asChild:!0,children:d||P(u,{type:"button",variant:"destructive",size:"sm",onClick:p=>p.preventDefault(),disabled:m,children:[I(ve,{className:"mr-2 h-4 w-4"}),"Delete"]})}),I(ee,{className:"z-[9999] w-72 p-4",sideOffset:5,align:"center",children:P("div",{className:"space-y-3",children:[I("h4",{className:"font-medium",children:"Delete Block"}),P("p",{className:"text-sm",children:["Are you sure you want to delete the block",P("span",{className:"font-medium",children:[' "',i,'"']}),"?"]}),I("p",{className:"text-xs text-muted-foreground",children:"This block will be permanently removed from the library. This action cannot be undone."}),P("div",{className:"flex justify-end gap-2 pt-2",children:[I(u,{type:"button",variant:"outline",size:"sm",onClick:e,disabled:m,children:"Cancel"}),I(u,{type:"button",variant:"destructive",size:"sm",loading:m,onClick:()=>{n(!0),k.mutate(o)},children:"Delete"})]})]})})]})},ke=({blockId:t,libBlockId:o,blockName:s,size:e="sm",className:i="",close:d})=>{let[m,n]=be(!1);return I(qe,{blockId:t,libBlockId:o,isOpen:m,onClose:()=>{n(!1),d()},blockName:s,trigger:P(u,{type:"button",variant:"destructive",size:e,className:i,onClick:()=>n(!0),children:[I(ve,{className:"mr-2 h-4 w-4"}),"Delete"]})})};import{Plus as He}from"lucide-react";import{useEffect as Be,useMemo as We,useRef as Ye,useState as V}from"react";import{useMutation as Oe,useQuery as Ke,useQueryClient as Ve}from"@tanstack/react-query";import{toast as ye}from"sonner";var he=()=>{let t=G(),o=x(),s=Ve(),{data:e=[],isLoading:i,error:d}=Ke({queryKey:["library-groups"],staleTime:"static",placeholderData:[],queryFn:async()=>{try{return await o(t,{action:"GET_LIBRARY_GROUPS"})||[]}catch(l){return console.error("Error fetching library groups:",l),[]}}}),{mutateAsync:m,isPending:n}=Oe({mutationFn:async l=>{if(!l.trim())throw new Error("Group name is required");return o(t,{action:"CREATE_BLOCK_GROUP",data:{name:l}})},onSuccess:()=>{s.invalidateQueries({queryKey:["library-groups"]}),ye.success("Group created successfully")},onError:l=>{console.error("Error creating group:",l),ye.error("Failed to create group",{description:l instanceof Error?l.message:"Unknown error"})}});return{groups:e,isLoading:i,error:d,createGroup:m,isCreating:n}};import{jsx as v,jsxs as L}from"react/jsx-runtime";var Ie=({value:t,onChange:o})=>{let[s,e]=V(!1),[i,d]=V(""),m=Ye(null),{groups:n}=he(),[l,k]=V([{id:"hero",name:"Hero"},{id:"feature",name:"Feature"},{id:"footer",name:"Footer"},{id:"content",name:"Content"},{id:"testimonial",name:"Testimonial"},{id:"pricing",name:"Pricing"},{id:"login",name:"Login"},{id:"logos",name:"Logos"},{id:"about",name:"About"},{id:"banner",name:"Banner"},{id:"blog",name:"Blog"},{id:"careers",name:"Careers"},{id:"casestudy",name:"Casestudy"},{id:"changelog",name:"Changelog"},{id:"compare",name:"Compare"},{id:"contact",name:"Contact"},{id:"cta",name:"Cta"},{id:"faq",name:"Faq"},{id:"gallery",name:"Gallery"},{id:"integration",name:"Integration"},{id:"list",name:"List"},{id:"navbar",name:"Navbar"},{id:"product",name:"Product"},{id:"signup",name:"Signup"},{id:"stats",name:"Stats"},{id:"team",name:"Team"},{id:"timeline",name:"Timeline"}]),f=We(()=>[...n,...l.filter(a=>!n.some(B=>B.id===a.id))],[n,l]),g=()=>{let a=i.trim();if(!a)return;let B={id:a,name:a};k(D=>[...D,B]),o(B.id),d(""),e(!1)};Be(()=>{s&&m.current&&m.current.focus()},[s]);let p=a=>{a.key==="Enter"&&(a.preventDefault(),g())};return Be(()=>{t&&!f.some(a=>a.id===t)&&o("")},[t,f,o]),s?L("div",{className:"space-y-2",children:[v(w,{ref:m,placeholder:"Enter new group name",value:i,onChange:a=>d(a.target.value),onKeyDown:p}),L("div",{className:"flex justify-end gap-2",children:[v(u,{variant:"outline",size:"sm",onClick:()=>e(!1),children:"Cancel"}),v(u,{size:"sm",onClick:g,children:"Create"})]})]}):L("div",{className:"flex gap-2",children:[L(se,{value:t,onValueChange:o,children:[v(ne,{className:"w-full",children:v(ie,{placeholder:"Select a group"})}),L(le,{children:[n.length>0&&L(q,{children:[v(O,{children:"Library Groups"}),n.map(a=>v(K,{value:a.id,children:a.name},`lib-${a.id}`))]}),l.length>0&&L(q,{children:[v(O,{children:"Predefined Groups"}),l.filter(a=>!n.some(B=>B.id===a.id)).map(a=>v(K,{value:a.id,children:a.name},`local-${a.id}`))]})]})]}),v(u,{type:"button",size:"icon",variant:"outline",onClick:()=>e(!0),children:v(He,{className:"h-4 w-4"})})]})};import{ImageIcon as je,X as Qe}from"lucide-react";import{useCallback as $e,useRef as Xe,useState as Je}from"react";import{toast as Ze}from"sonner";import{jsx as N,jsxs as A}from"react/jsx-runtime";var Ne=({value:t,onChange:o})=>{let[s,e]=Je(!1),i=Xe(null),d=$e(async l=>{var f;let k=(f=l.target.files)==null?void 0:f[0];if(k)try{e(!0);let g=k;k.type.startsWith("image/")&&(g=await de(k));let p=new FileReader;p.onloadend=()=>{o(p.result),e(!1)},p.readAsDataURL(g)}catch(g){console.error("Error reading file:",g),e(!1),Ze.error("Failed to process image",{description:g instanceof Error?g.message:"Unknown error"})}},[o]);return A("div",{className:"space-y-2",children:[A("div",{className:"flex items-center gap-2",children:[N(w,{type:"file",ref:i,onChange:d,accept:"image/*",className:"hidden"}),N(u,{type:"button",variant:"outline",onClick:()=>{var l;(l=i.current)==null||l.click()},disabled:s,className:"w-full",children:s?A("span",{className:"flex items-center gap-2",children:[N("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"Uploading..."]}):A("span",{className:"flex items-center gap-2 text-sm text-foreground/80",children:[N(je,{className:"h-4 w-4"}),"Select image"]})}),t&&N(u,{type:"button",variant:"outline",size:"icon",onClick:()=>{o(""),i.current&&(i.current.value="")},children:N(Qe,{className:"h-4 w-4"})})]}),t&&N("div",{className:"aspect-video h-[200px] max-h-[200px] overflow-hidden rounded-md border",children:N(ae,{src:t,alt:"Preview",className:"h-full w-full object-contain"})})]})};import{jsx as c,jsxs as b}from"react/jsx-runtime";var at=t=>{let{blocks:o,close:s,blockId:e}=t,{getPartialBlocks:i}=oe(),d=o.find(r=>r._id===e),m=d==null?void 0:d._libBlockId,n=!!m,l=Ce(()=>o.some(r=>r._type==="PartialBlock"||r._type==="GlobalBlock"),[o]),k=Ce(()=>{let r=[];for(let y of o)if(y._type==="PartialBlock"||y._type==="GlobalBlock"){let h=i(y.partialBlockId);y._parent&&(h==null?void 0:h.length)>0&&(h=h.map(z=>(tt(z._parent)&&ot(z,"_parent",y._parent),z))),r=[...r,...h]}else r.push(y);return r},[o,i]),[f,g]=C(""),[p,a]=C(""),[B,D]=C(""),[F,W]=C(""),[E,we]=C({}),[Pe,Le]=C(!1),[Se,Y]=C(n),[Ge,xe]=C(!1),{hasPermission:Te}=te(),Ue=Te(re["library:delete"]),j=R(),De=()=>{j([e],{_libBlockId:void 0}),Ee.success("Block delinked from library"),s()},{data:S,isLoading:M,isError:Q}=fe(m);H(()=>{Q&&n&&(xe(!0),Y(!1))},[Q,n]),H(()=>{S&&!M&&(g(S.name||""),a(S.group||""),D(S.description||""),W(S.preview||""),Y(!1))},[S,M]),H(()=>{let r=f.trim().length>=2,y=p.trim()!=="";Le(r&&y)},[f,p]);let Fe=()=>{let r={};return f.trim()?f.length<2&&(r.name="Name must be at least 2 characters"):r.name="Name is required",p||(r.group="Group is required"),we(r),Object.keys(r).length===0},{resetLibrary:Re}=me({id:""}),$=pe(r=>{n||j([e],{_libBlockId:r.id}),Ee.success(`Block ${n?"updated":"saved"} successfully`),Re(r.library),s()}),_e=async r=>{if(r.preventDefault(),!Fe())return;let y=k.map(h=>(et(h,"_libBlockId")&&delete h._libBlockId,h));$.mutate({name:f.trim(),group:p,blocks:y,description:B.trim(),...F&&F.startsWith("data:")?{previewImage:F}:{},...n?{id:m}:{}})},X=$.isPending;return Se||M?c("div",{className:"flex items-center justify-center p-8",children:c("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):Ge?b("div",{className:"space-y-4",children:[c("div",{className:"text-sm font-medium text-destructive",children:"Block Not Found"}),c("p",{className:"text-sm text-muted-foreground",children:"This block could not be found on the server. It may have been deleted."}),b("div",{className:"flex justify-end gap-2 pt-4",children:[c(u,{type:"button",size:"sm",variant:"outline",onClick:s,children:"Cancel"}),c(u,{size:"sm",onClick:De,variant:"destructive",children:"Delink Block"})]})]}):b("div",{children:[l&&b("div",{className:"mb-4 flex items-start gap-2 rounded-md border border-destructive/50 bg-destructive/10 p-3 text-destructive",children:[c(rt,{className:"mt-0.5 h-5 w-5 flex-shrink-0"}),b("div",{children:[c("p",{className:"font-medium",children:"Partial Blocks Detected"}),c("p",{className:"mt-1 text-xs",children:"This block contains one or more Partial Blocks. Partial blocks will be merged into the library block"})]})]}),b("form",{onSubmit:_e,className:"space-y-4",children:[b("div",{className:"space-y-1",children:[c(U,{htmlFor:"name",className:E.name?"text-destructive":"",children:"Name"}),c(w,{id:"name",placeholder:"Enter block name",value:f,onChange:r=>g(r.target.value),className:E.name?"border-destructive":""}),E.name&&c("p",{className:"text-xs text-destructive",children:E.name})]}),b("div",{className:"space-y-1",children:[c(U,{htmlFor:"group",className:E.group?"text-destructive":"",children:"Group"}),c(Ie,{value:p,onChange:a}),E.group&&c("p",{className:"text-xs text-destructive",children:E.group})]}),b("div",{className:"space-y-1",children:[c(U,{htmlFor:"description",children:"Description (optional)"}),c(w,{id:"description",placeholder:"Enter a brief description",className:"resize-none",value:B,onChange:r=>D(r.target.value)})]}),b("div",{className:"space-y-1",children:[c(U,{htmlFor:"previewImage",children:"Preview Image (optional)"}),c(Ne,{value:F,onChange:W})]}),b("div",{className:"flex justify-end gap-2 pt-2",children:[n&&Ue&&c(ke,{blockId:e,libBlockId:m,blockName:f,className:"mr-auto",close:s}),c(u,{type:"button",size:"sm",variant:"outline",onClick:s,disabled:X,children:"Cancel"}),c(u,{loading:X,size:"sm",type:"submit",disabled:!Pe,children:n?"Update Block":"Save Block"})]})]})]})},lo=at;export{lo as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y}from"./chunk-OSGXFZTA.js";import"./chunk-WOT6VMZA.js";export{o as aiAddonPurchases,n as aiCreditAddons,x as aiLogs,a as appApiKeys,p as appAssets,j as appDomains,i as appFormSubmissions,m as appPages,y as appPagesMetadata,v as appPagesOnline,t as appPagesRevisions,s as appTrash,r as appUserAddons,g as appUserPlans,k as appUsers,c as apps,d as appsOnline,q as clientUsers,h as clients,b as invitedUsers,e as libraries,w as libraryItems,u as libraryTemplates,l as roles,f as webhookEvents};
|