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,899 @@
|
|
|
1
|
+
import { StreamTextResult } from 'ai';
|
|
2
|
+
import { RJSFSchema, UiSchema } from '@rjsf/utils';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import React__default from 'react';
|
|
5
|
+
|
|
6
|
+
interface ChaiPage$1 {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
pageType: string;
|
|
11
|
+
parent: string | null;
|
|
12
|
+
children?: ChaiPage$1[];
|
|
13
|
+
isTemplate?: boolean;
|
|
14
|
+
dynamic?: boolean;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type StructureError = {
|
|
19
|
+
id: string;
|
|
20
|
+
message: string;
|
|
21
|
+
severity: "error" | "warning";
|
|
22
|
+
blockId?: string;
|
|
23
|
+
partialBlockId?: string;
|
|
24
|
+
};
|
|
25
|
+
type StructureRule = {
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
validate: (canvasDocument: Document) => StructureError[];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
type FilterOptions = {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
};
|
|
36
|
+
type SortOptions = {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
};
|
|
41
|
+
type ChaiCollectoin = {
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
filters?: FilterOptions[];
|
|
46
|
+
sorts?: SortOptions[];
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
type ChaiRenderBlockProps<T> = {
|
|
50
|
+
blockProps: Record<string, string>;
|
|
51
|
+
children?: React.ReactNode;
|
|
52
|
+
inBuilder: boolean;
|
|
53
|
+
} & T;
|
|
54
|
+
type ChaiBlockStyles = Record<string, string>;
|
|
55
|
+
|
|
56
|
+
interface ChaiDesignTokens {
|
|
57
|
+
[uniqueId: string]: {
|
|
58
|
+
name: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
value: string;
|
|
61
|
+
archived?: boolean;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
type ChaiBlocksWithDesignTokens = Record<string, string>;
|
|
65
|
+
interface ChaiSiteWideUsageData {
|
|
66
|
+
[pageId: string]: {
|
|
67
|
+
name: string;
|
|
68
|
+
isPartial: boolean;
|
|
69
|
+
partialBlocks: string[];
|
|
70
|
+
links: string[];
|
|
71
|
+
designTokens: ChaiBlocksWithDesignTokens;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
type ChaiLibraryBlock<T = Record<string, any>> = {
|
|
76
|
+
id: string;
|
|
77
|
+
group: string;
|
|
78
|
+
name: string;
|
|
79
|
+
preview?: string;
|
|
80
|
+
tags?: string[];
|
|
81
|
+
description?: string;
|
|
82
|
+
} & T;
|
|
83
|
+
type ChaiLibrary<T = Record<string, any>> = {
|
|
84
|
+
id: string;
|
|
85
|
+
name: string;
|
|
86
|
+
blocks?: ChaiLibraryBlock[];
|
|
87
|
+
description?: string;
|
|
88
|
+
} & T;
|
|
89
|
+
type ReactComponentType = React__default.ComponentType<any>;
|
|
90
|
+
type CSSVariableName = string;
|
|
91
|
+
type HSLColor = string;
|
|
92
|
+
type HexColor = string;
|
|
93
|
+
type ChaiCssVariableNameWithDefault = Record<CSSVariableName, any>;
|
|
94
|
+
type VariableKey = string;
|
|
95
|
+
type ChaiBorderRadiusValue = false | string;
|
|
96
|
+
type ChaiThemeOptions = {
|
|
97
|
+
fontFamily: false | Record<VariableKey, string>;
|
|
98
|
+
borderRadius: ChaiBorderRadiusValue;
|
|
99
|
+
colors: {
|
|
100
|
+
group: string;
|
|
101
|
+
items: Record<VariableKey, [HSLColor, HSLColor]>;
|
|
102
|
+
}[];
|
|
103
|
+
};
|
|
104
|
+
type ChaiBreakpoint = {
|
|
105
|
+
title: string;
|
|
106
|
+
content: string;
|
|
107
|
+
breakpoint: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | string;
|
|
108
|
+
icon: React__default.ReactNode | Element;
|
|
109
|
+
width: number;
|
|
110
|
+
};
|
|
111
|
+
type ChaiSavePageData = {
|
|
112
|
+
autoSave: boolean;
|
|
113
|
+
blocks: ChaiBlock[];
|
|
114
|
+
needTranslations?: boolean;
|
|
115
|
+
designTokens: ChaiDesignTokens;
|
|
116
|
+
partialIds?: string[];
|
|
117
|
+
linkPageIds?: string[];
|
|
118
|
+
};
|
|
119
|
+
type ChaiSaveWebsiteData = {
|
|
120
|
+
type: "THEME";
|
|
121
|
+
data: ChaiTheme;
|
|
122
|
+
} | {
|
|
123
|
+
type: "DESIGN_TOKENS";
|
|
124
|
+
data: ChaiDesignTokens;
|
|
125
|
+
};
|
|
126
|
+
type ChaiAskAiResponse = {
|
|
127
|
+
blocks?: Array<{
|
|
128
|
+
_id: string;
|
|
129
|
+
} & Partial<ChaiBlock>>;
|
|
130
|
+
usage?: Record<any, number>;
|
|
131
|
+
error?: any;
|
|
132
|
+
};
|
|
133
|
+
type ChaiTheme = {
|
|
134
|
+
fontFamily: {
|
|
135
|
+
heading: string;
|
|
136
|
+
body: string;
|
|
137
|
+
};
|
|
138
|
+
borderRadius: string;
|
|
139
|
+
colors: {
|
|
140
|
+
background: [HexColor, HexColor];
|
|
141
|
+
foreground: [HexColor, HexColor];
|
|
142
|
+
primary: [HexColor, HexColor];
|
|
143
|
+
"primary-foreground": [HexColor, HexColor];
|
|
144
|
+
secondary: [HexColor, HexColor];
|
|
145
|
+
"secondary-foreground": [HexColor, HexColor];
|
|
146
|
+
muted: [HexColor, HexColor];
|
|
147
|
+
"muted-foreground": [HSLColor, HSLColor];
|
|
148
|
+
accent: [HSLColor, HSLColor];
|
|
149
|
+
"accent-foreground": [HSLColor, HSLColor];
|
|
150
|
+
destructive: [HSLColor, HSLColor];
|
|
151
|
+
"destructive-foreground": [HSLColor, HSLColor];
|
|
152
|
+
border: [HSLColor, HSLColor];
|
|
153
|
+
input: [HSLColor, HSLColor];
|
|
154
|
+
ring: [HexColor, HexColor];
|
|
155
|
+
card: [HexColor, HexColor];
|
|
156
|
+
"card-foreground": [HexColor, HexColor];
|
|
157
|
+
popover: [HexColor, HexColor];
|
|
158
|
+
"popover-foreground": [HexColor, HexColor];
|
|
159
|
+
success?: [HexColor, HexColor];
|
|
160
|
+
"success-foreground"?: [HexColor, HexColor];
|
|
161
|
+
warning?: [HexColor, HexColor];
|
|
162
|
+
"warning-foreground"?: [HexColor, HexColor];
|
|
163
|
+
info?: [HexColor, HexColor];
|
|
164
|
+
"info-foreground"?: [HexColor, HexColor];
|
|
165
|
+
purple?: [HexColor, HexColor];
|
|
166
|
+
"purple-foreground"?: [HexColor, HexColor];
|
|
167
|
+
orange?: [HexColor, HexColor];
|
|
168
|
+
"orange-foreground"?: [HexColor, HexColor];
|
|
169
|
+
aqua?: [HexColor, HexColor];
|
|
170
|
+
"aqua-foreground"?: [HexColor, HexColor];
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
interface ChaiBuilderEditorProps {
|
|
174
|
+
children?: React__default.ReactNode;
|
|
175
|
+
/**
|
|
176
|
+
* Goto page callback
|
|
177
|
+
*/
|
|
178
|
+
gotoPage?: ({ pageId, lang }: {
|
|
179
|
+
pageId: string;
|
|
180
|
+
lang: string;
|
|
181
|
+
}) => void;
|
|
182
|
+
/**
|
|
183
|
+
* User
|
|
184
|
+
*/
|
|
185
|
+
user?: ChaiLoggedInUser;
|
|
186
|
+
/**
|
|
187
|
+
* Permissions
|
|
188
|
+
*/
|
|
189
|
+
permissions?: string[] | null;
|
|
190
|
+
/**
|
|
191
|
+
* Optional pageId. If not provided, a random pageId will be generated
|
|
192
|
+
*/
|
|
193
|
+
pageId?: string;
|
|
194
|
+
/**
|
|
195
|
+
* Page external data
|
|
196
|
+
*/
|
|
197
|
+
pageExternalData?: Record<string, any>;
|
|
198
|
+
/**
|
|
199
|
+
* Theme presets
|
|
200
|
+
*/
|
|
201
|
+
themePresets?: Record<string, Partial<ChaiTheme>>[];
|
|
202
|
+
/**
|
|
203
|
+
* Theme
|
|
204
|
+
*/
|
|
205
|
+
theme?: ChaiTheme;
|
|
206
|
+
/**
|
|
207
|
+
* Builder theme
|
|
208
|
+
*/
|
|
209
|
+
builderTheme?: ChaiTheme;
|
|
210
|
+
/**
|
|
211
|
+
* Theme panel component
|
|
212
|
+
* TODO: Move to registerChaiThemePanelComponent()
|
|
213
|
+
*/
|
|
214
|
+
themePanelComponent?: ReactComponentType;
|
|
215
|
+
/**
|
|
216
|
+
* onError callback function
|
|
217
|
+
* @param error
|
|
218
|
+
*/
|
|
219
|
+
onError?: (error: Error) => void;
|
|
220
|
+
/**
|
|
221
|
+
* Translations object
|
|
222
|
+
*/
|
|
223
|
+
translations?: Record<string, Record<string, any>>;
|
|
224
|
+
/**
|
|
225
|
+
* Custom layout component
|
|
226
|
+
* TODO: Move to registerChaiLayoutComponent()
|
|
227
|
+
*/
|
|
228
|
+
layout?: React__default.ComponentType;
|
|
229
|
+
/**
|
|
230
|
+
* HTML direction.
|
|
231
|
+
*/
|
|
232
|
+
htmlDir?: "ltr" | "rtl";
|
|
233
|
+
/**
|
|
234
|
+
* Show debug logs
|
|
235
|
+
*/
|
|
236
|
+
debugLogs?: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Auto save support
|
|
239
|
+
*/
|
|
240
|
+
autoSave?: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* Auto save interval in seconds
|
|
243
|
+
*/
|
|
244
|
+
autoSaveActionsCount?: number;
|
|
245
|
+
/**
|
|
246
|
+
* Breakpoints
|
|
247
|
+
*/
|
|
248
|
+
breakpoints?: ChaiBreakpoint[];
|
|
249
|
+
/**
|
|
250
|
+
* Loading state
|
|
251
|
+
*/
|
|
252
|
+
loading?: boolean;
|
|
253
|
+
/**
|
|
254
|
+
* Locale
|
|
255
|
+
*/
|
|
256
|
+
locale?: string;
|
|
257
|
+
/**
|
|
258
|
+
* Ask AI callback
|
|
259
|
+
*/
|
|
260
|
+
askAiCallBack?: (type: "styles" | "content", prompt: string, blocks: ChaiBlock[], lang: string) => Promise<ChaiAskAiResponse>;
|
|
261
|
+
/**
|
|
262
|
+
* Get partial blocks
|
|
263
|
+
* @returns {Record<string, { type: string; name: string; description?: string }>}
|
|
264
|
+
*/
|
|
265
|
+
getPartialBlocks?: () => Promise<Record<string, {
|
|
266
|
+
type: string;
|
|
267
|
+
name: string;
|
|
268
|
+
description?: string;
|
|
269
|
+
}>>;
|
|
270
|
+
/**
|
|
271
|
+
* Get all blocks of a partial block
|
|
272
|
+
*/
|
|
273
|
+
getPartialBlockBlocks?: (partialBlockKey: string) => Promise<ChaiBlock[]>;
|
|
274
|
+
/**
|
|
275
|
+
* Blocks for the page
|
|
276
|
+
*/
|
|
277
|
+
blocks?: ChaiBlock[];
|
|
278
|
+
/**
|
|
279
|
+
* onSave callback function
|
|
280
|
+
* @param saveData
|
|
281
|
+
*/
|
|
282
|
+
onSave?: ({ blocks, autoSave }: ChaiSavePageData) => Promise<boolean | Error>;
|
|
283
|
+
/**
|
|
284
|
+
* onSaveWebsiteData callback function for theme and design tokens
|
|
285
|
+
* @param saveData
|
|
286
|
+
*/
|
|
287
|
+
onSaveWebsiteData?: (data: ChaiSaveWebsiteData) => Promise<boolean | Error>;
|
|
288
|
+
/**
|
|
289
|
+
* onSaveStateChange callback function
|
|
290
|
+
* @param syncStatus
|
|
291
|
+
*/
|
|
292
|
+
onSaveStateChange?: (syncStatus: "SAVED" | "SAVING" | "UNSAVED") => void;
|
|
293
|
+
/**
|
|
294
|
+
* Preview component
|
|
295
|
+
* TODO: Move to registerChaiPreviewComponent()
|
|
296
|
+
*/
|
|
297
|
+
previewComponent?: ReactComponentType;
|
|
298
|
+
/**
|
|
299
|
+
* Content locale
|
|
300
|
+
*/
|
|
301
|
+
fallbackLang?: string;
|
|
302
|
+
/**
|
|
303
|
+
* Languages
|
|
304
|
+
*/
|
|
305
|
+
languages?: string[];
|
|
306
|
+
/**
|
|
307
|
+
* Page Types props
|
|
308
|
+
*/
|
|
309
|
+
pageTypes?: ChaiPageType[];
|
|
310
|
+
/**
|
|
311
|
+
* Search page type items
|
|
312
|
+
*/
|
|
313
|
+
searchPageTypeItems?: (pageTypeKey: string, query: string) => Promise<Pick<ChaiPage$1, "id" | "slug" | "name">[] | Error>;
|
|
314
|
+
/**
|
|
315
|
+
* Collections
|
|
316
|
+
*/
|
|
317
|
+
collections?: ChaiCollectoin[];
|
|
318
|
+
/**
|
|
319
|
+
* Get Block Async Props
|
|
320
|
+
*/
|
|
321
|
+
getBlockAsyncProps?: (args: {
|
|
322
|
+
block: ChaiBlock;
|
|
323
|
+
}) => Promise<{
|
|
324
|
+
[key: string]: any;
|
|
325
|
+
}>;
|
|
326
|
+
/**
|
|
327
|
+
* temporary props. Not to be used in production
|
|
328
|
+
*/
|
|
329
|
+
flags?: {
|
|
330
|
+
librarySite?: boolean;
|
|
331
|
+
copyPaste?: boolean;
|
|
332
|
+
exportCode?: boolean;
|
|
333
|
+
darkMode?: boolean;
|
|
334
|
+
dataBinding?: boolean;
|
|
335
|
+
importHtml?: boolean;
|
|
336
|
+
importTheme?: boolean;
|
|
337
|
+
gotoSettings?: boolean;
|
|
338
|
+
dragAndDrop?: boolean;
|
|
339
|
+
validateStructure?: boolean;
|
|
340
|
+
designTokens?: boolean;
|
|
341
|
+
ai?: boolean;
|
|
342
|
+
aiCredits?: boolean;
|
|
343
|
+
revisions?: boolean;
|
|
344
|
+
sharedJsonLD?: boolean;
|
|
345
|
+
resetSeoToDefault?: boolean;
|
|
346
|
+
pagesManager?: boolean;
|
|
347
|
+
dam?: {
|
|
348
|
+
searchImages?: boolean;
|
|
349
|
+
genAI?: boolean;
|
|
350
|
+
};
|
|
351
|
+
trash?: boolean;
|
|
352
|
+
animation?: boolean;
|
|
353
|
+
bulkPublish?: boolean;
|
|
354
|
+
draftsInRevisions?: boolean;
|
|
355
|
+
};
|
|
356
|
+
structureRules?: StructureRule[];
|
|
357
|
+
designTokens?: ChaiDesignTokens;
|
|
358
|
+
siteWideUsage?: ChaiSiteWideUsageData;
|
|
359
|
+
/**
|
|
360
|
+
* Custom feature labels with i18n support
|
|
361
|
+
*/
|
|
362
|
+
labels?: {
|
|
363
|
+
features?: {
|
|
364
|
+
designTokens?: string | Record<string, string>;
|
|
365
|
+
trash?: string | Record<string, string>;
|
|
366
|
+
dataBinding?: string | Record<string, string>;
|
|
367
|
+
ai?: string | Record<string, string>;
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
/**
|
|
371
|
+
* Screen to small message component
|
|
372
|
+
*/
|
|
373
|
+
smallScreenComponent?: ReactComponentType;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
type ChaiUserAccess = {
|
|
377
|
+
role: string;
|
|
378
|
+
permissions: string[] | null;
|
|
379
|
+
};
|
|
380
|
+
/**
|
|
381
|
+
* Action Context
|
|
382
|
+
* Contains information and repositories needed by actions
|
|
383
|
+
*/
|
|
384
|
+
interface ChaiActionContext {
|
|
385
|
+
appId: string;
|
|
386
|
+
userId?: string;
|
|
387
|
+
/** Resolved app membership, set by dispatchChaiAction for authenticated actions. */
|
|
388
|
+
userAccess?: ChaiUserAccess;
|
|
389
|
+
/**
|
|
390
|
+
* Delegated permission scopes for MCP-scoped requests. When present, effective
|
|
391
|
+
* permissions are clamped to `userPermissions ∩ delegatedScopes`. Absent/null on
|
|
392
|
+
* normal browser requests (full user permissions apply).
|
|
393
|
+
*/
|
|
394
|
+
delegatedScopes?: string[] | null;
|
|
395
|
+
/** Registry action key, when set by the dispatcher. */
|
|
396
|
+
action?: string;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Resolves the permission required to run an action.
|
|
400
|
+
* Either a static permission key (`entity:operation`) or a function that derives
|
|
401
|
+
* it from the action data/context (e.g. page-type-level permissions).
|
|
402
|
+
* Return `null`/`undefined` to require no specific permission (authenticated-only).
|
|
403
|
+
*/
|
|
404
|
+
type ChaiRequiredPermission<T = any> = string | ((data: T, context: ChaiActionContext) => string | null | undefined);
|
|
405
|
+
/**
|
|
406
|
+
* ChaiAction Interface
|
|
407
|
+
* Defines the contract for all action handlers
|
|
408
|
+
*/
|
|
409
|
+
interface ChaiAction<T = any, K = any> {
|
|
410
|
+
/**
|
|
411
|
+
* Permission required to run this action. Enforced by `dispatchChaiAction`.
|
|
412
|
+
* Undeclared (undefined) = authenticated-only (no specific permission).
|
|
413
|
+
*/
|
|
414
|
+
requiredPermission?: ChaiRequiredPermission<T>;
|
|
415
|
+
validate(data: T): boolean;
|
|
416
|
+
setContext(context: ChaiActionContext): void;
|
|
417
|
+
execute(data: T): Promise<K>;
|
|
418
|
+
run(data: T): Promise<K>;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
type TrashContext = ChaiActionContext & Record<string, any>;
|
|
422
|
+
type TrashRecord = {
|
|
423
|
+
id: string;
|
|
424
|
+
entityType: string;
|
|
425
|
+
entityId: string;
|
|
426
|
+
name?: string;
|
|
427
|
+
metadata?: Record<string, any>;
|
|
428
|
+
deletedAt?: string;
|
|
429
|
+
deletedBy: string;
|
|
430
|
+
app?: string;
|
|
431
|
+
tags?: string[];
|
|
432
|
+
};
|
|
433
|
+
type TrashableRecordData = Omit<TrashRecord, "id">;
|
|
434
|
+
type RestoreConflictResolution = {
|
|
435
|
+
resolved: boolean;
|
|
436
|
+
newSlug?: string;
|
|
437
|
+
};
|
|
438
|
+
interface ChaiTrashableEntity {
|
|
439
|
+
key: string;
|
|
440
|
+
label: string;
|
|
441
|
+
icon?: string;
|
|
442
|
+
moveToTrash: (id: string, context: TrashContext) => Promise<TrashableRecordData>;
|
|
443
|
+
restore: (record: TrashRecord, context: TrashContext) => Promise<void>;
|
|
444
|
+
deletePermanently: (record: TrashRecord, context: TrashContext) => Promise<boolean>;
|
|
445
|
+
hasRestoreConflict?: (record: TrashRecord, context: TrashContext) => Promise<boolean>;
|
|
446
|
+
resolveRestoreConflict?: (record: TrashRecord, context: TrashContext) => Promise<RestoreConflictResolution>;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
type AIModel = {
|
|
450
|
+
id: string;
|
|
451
|
+
name: string;
|
|
452
|
+
provider: string;
|
|
453
|
+
description: string;
|
|
454
|
+
multiplier: number;
|
|
455
|
+
/** MIME types this model accepts as file attachments. Set by the consumer via AIConfigProvider or ai.models prop. */
|
|
456
|
+
allowedFileTypes?: string[];
|
|
457
|
+
};
|
|
458
|
+
type AICompletionEvent = {
|
|
459
|
+
type: "completion";
|
|
460
|
+
content: string;
|
|
461
|
+
model: string;
|
|
462
|
+
timestamp: number;
|
|
463
|
+
};
|
|
464
|
+
type AIErrorEvent = {
|
|
465
|
+
type: "error";
|
|
466
|
+
error: Error | string;
|
|
467
|
+
model?: string;
|
|
468
|
+
timestamp: number;
|
|
469
|
+
};
|
|
470
|
+
type AIStreamStartEvent = {
|
|
471
|
+
type: "stream_start";
|
|
472
|
+
model: string;
|
|
473
|
+
timestamp: number;
|
|
474
|
+
};
|
|
475
|
+
type AIEvent = AICompletionEvent | AIErrorEvent | AIStreamStartEvent;
|
|
476
|
+
type AISuccessCallback = {
|
|
477
|
+
content: string;
|
|
478
|
+
model: string;
|
|
479
|
+
timestamp: number;
|
|
480
|
+
};
|
|
481
|
+
type AIErrorCallback = {
|
|
482
|
+
error: Error | string;
|
|
483
|
+
model: string;
|
|
484
|
+
timestamp: number;
|
|
485
|
+
};
|
|
486
|
+
type AICompleteCallback = {
|
|
487
|
+
success: boolean;
|
|
488
|
+
content?: string;
|
|
489
|
+
error?: Error | string;
|
|
490
|
+
model: string;
|
|
491
|
+
timestamp: number;
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
type LoggedInUser = {
|
|
495
|
+
id: string;
|
|
496
|
+
email: string;
|
|
497
|
+
name: string;
|
|
498
|
+
avatar?: string;
|
|
499
|
+
metadata?: Record<string, any>;
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
type ChaiBlock<T = Record<string, any>> = {
|
|
503
|
+
_id: string;
|
|
504
|
+
_name?: string;
|
|
505
|
+
_parent?: string | null | undefined;
|
|
506
|
+
_libBlock?: string;
|
|
507
|
+
_type: string;
|
|
508
|
+
partialBlockId?: string;
|
|
509
|
+
} & T;
|
|
510
|
+
interface ChaiCoreBlock {
|
|
511
|
+
blocks?: ChaiBlock[];
|
|
512
|
+
data: any;
|
|
513
|
+
props: {
|
|
514
|
+
[key: string]: any;
|
|
515
|
+
};
|
|
516
|
+
type: string;
|
|
517
|
+
_name?: string;
|
|
518
|
+
partialBlockId?: string;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
type ChaiBlockUiSchema = UiSchema;
|
|
522
|
+
type ChaiBlockPropsSchema = RJSFSchema & {
|
|
523
|
+
properties?: {
|
|
524
|
+
[key: string]: RJSFSchema;
|
|
525
|
+
} | undefined;
|
|
526
|
+
enumNames?: (string | number)[];
|
|
527
|
+
};
|
|
528
|
+
type ChaiBlockSchema = {
|
|
529
|
+
properties?: Record<string, ChaiBlockPropsSchema>;
|
|
530
|
+
allOf?: any[];
|
|
531
|
+
oneOf?: any[];
|
|
532
|
+
} & Partial<Pick<ChaiBlockPropsSchema, "required" | "dependencies" | "ui" | "title" | "description" | "default">>;
|
|
533
|
+
type ChaiBlockSchemas = {
|
|
534
|
+
schema: object | Omit<ChaiBlockSchema, "ui">;
|
|
535
|
+
uiSchema?: ChaiBlockUiSchema;
|
|
536
|
+
};
|
|
537
|
+
type ChaiBlockRJSFSchemas = {
|
|
538
|
+
schema: object | Omit<ChaiBlockSchema, "ui">;
|
|
539
|
+
uiSchema: ChaiBlockUiSchema;
|
|
540
|
+
};
|
|
541
|
+
type ChaiWebsiteBuilderProps = {
|
|
542
|
+
ai?: {
|
|
543
|
+
models?: AIModel[];
|
|
544
|
+
/** Map of model keys to action names they handle. Actions: 'AI_ENHANCE_CONTEXT', 'AI_GENERATE_THEME', 'AI_GENERATE_SEO_FIELD', 'AI_GENERATE_IMAGE_DESCRIPTION', 'AI_GENERATE_IMAGE' */
|
|
545
|
+
actionModels?: Record<string, string[]>;
|
|
546
|
+
};
|
|
547
|
+
hasReactQueryProvider?: boolean;
|
|
548
|
+
apiUrl?: string;
|
|
549
|
+
getPreviewUrl?: (slug: string) => string;
|
|
550
|
+
getLiveUrl?: (slug: string) => string;
|
|
551
|
+
onLogout?: (reason?: string) => void;
|
|
552
|
+
getAccessToken?: () => Promise<string>;
|
|
553
|
+
currentUser: LoggedInUser | null;
|
|
554
|
+
websocket?: any;
|
|
555
|
+
beforeRequest?: (params: {
|
|
556
|
+
action: string;
|
|
557
|
+
data: any;
|
|
558
|
+
}) => Promise<{
|
|
559
|
+
action: string;
|
|
560
|
+
data: any;
|
|
561
|
+
} | null> | {
|
|
562
|
+
action: string;
|
|
563
|
+
data: any;
|
|
564
|
+
} | null;
|
|
565
|
+
dam?: {
|
|
566
|
+
searchImages?: {
|
|
567
|
+
providers: {
|
|
568
|
+
id: string;
|
|
569
|
+
filters: Record<string, string[]>;
|
|
570
|
+
}[];
|
|
571
|
+
};
|
|
572
|
+
};
|
|
573
|
+
} & Pick<ChaiBuilderEditorProps, "onError" | "translations" | "locale" | "htmlDir" | "autoSave" | "autoSaveActionsCount" | "fallbackLang" | "languages" | "themePresets" | "flags" | "structureRules" | "labels">;
|
|
574
|
+
type ChaiPageProps<T = Record<string, any>> = {
|
|
575
|
+
slug: string;
|
|
576
|
+
searchParams?: Record<string, string>;
|
|
577
|
+
} & T;
|
|
578
|
+
type ChaiFontByUrl = {
|
|
579
|
+
family: string;
|
|
580
|
+
url: string;
|
|
581
|
+
fallback: string;
|
|
582
|
+
};
|
|
583
|
+
type ChaiFontSource = {
|
|
584
|
+
url: string;
|
|
585
|
+
format: string;
|
|
586
|
+
fontWeight?: string;
|
|
587
|
+
fontStyle?: string;
|
|
588
|
+
fontDisplay?: string;
|
|
589
|
+
fontStretch?: string;
|
|
590
|
+
};
|
|
591
|
+
type ChaiFontBySrc = {
|
|
592
|
+
family: string;
|
|
593
|
+
src: ChaiFontSource[];
|
|
594
|
+
fallback: string;
|
|
595
|
+
};
|
|
596
|
+
type ChaiSystemFont = {
|
|
597
|
+
family: string;
|
|
598
|
+
fallback: string;
|
|
599
|
+
};
|
|
600
|
+
type ChaiFont = ChaiFontByUrl | ChaiFontBySrc | ChaiSystemFont;
|
|
601
|
+
|
|
602
|
+
type CollectionFetchParams = {
|
|
603
|
+
block: ChaiBlock;
|
|
604
|
+
inBuilder: boolean;
|
|
605
|
+
draft: boolean;
|
|
606
|
+
lang: string;
|
|
607
|
+
pageProps: {
|
|
608
|
+
slug: string;
|
|
609
|
+
params?: Record<string, string>;
|
|
610
|
+
[key: string]: any;
|
|
611
|
+
};
|
|
612
|
+
};
|
|
613
|
+
interface CollectionConfig<T> {
|
|
614
|
+
id: string;
|
|
615
|
+
name: string;
|
|
616
|
+
icon?: string;
|
|
617
|
+
filters?: {
|
|
618
|
+
id: string;
|
|
619
|
+
name: string;
|
|
620
|
+
}[];
|
|
621
|
+
sort?: {
|
|
622
|
+
id: string;
|
|
623
|
+
name: string;
|
|
624
|
+
}[];
|
|
625
|
+
fetch: (params: CollectionFetchParams) => Promise<{
|
|
626
|
+
items: T[];
|
|
627
|
+
totalItems?: number;
|
|
628
|
+
}>;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Minimal request shape for route handlers and `resolveRequestContext`.
|
|
633
|
+
* Structural type compatible with Next.js `NextRequest` and standard `Request`.
|
|
634
|
+
*/
|
|
635
|
+
type ChaiIncomingRequest = {
|
|
636
|
+
headers: {
|
|
637
|
+
get(name: string): string | null;
|
|
638
|
+
};
|
|
639
|
+
method: string;
|
|
640
|
+
url: string;
|
|
641
|
+
cookies: {
|
|
642
|
+
get(name: string): {
|
|
643
|
+
value: string;
|
|
644
|
+
} | undefined;
|
|
645
|
+
};
|
|
646
|
+
};
|
|
647
|
+
/**
|
|
648
|
+
* Per-request context from `resolveDefaultChaiContext`, `resolveRequestContext`, or `getChaiBuilder(config, route)`.
|
|
649
|
+
*/
|
|
650
|
+
type ChaiRequestContext = {
|
|
651
|
+
appId: string;
|
|
652
|
+
userId?: string | null;
|
|
653
|
+
draft?: boolean;
|
|
654
|
+
siteUrl?: string | null;
|
|
655
|
+
lang?: string;
|
|
656
|
+
/**
|
|
657
|
+
* MCP-delegated permission scopes. When present, effective permissions are
|
|
658
|
+
* clamped to `userPermissions ∩ delegatedScopes`. Absent on normal browser requests.
|
|
659
|
+
*/
|
|
660
|
+
delegatedScopes?: string[] | null;
|
|
661
|
+
/**
|
|
662
|
+
* Client-sent license last-check timestamp (ms epoch, as a string) from the
|
|
663
|
+
* `x-chai-license-check` request header. A refresh throttle only — never
|
|
664
|
+
* license data. Populated from the request during context resolution.
|
|
665
|
+
*/
|
|
666
|
+
licenseCheck?: string | null;
|
|
667
|
+
};
|
|
668
|
+
/**
|
|
669
|
+
* Arguments passed to the process-registered {@link ChaiContextResolver}.
|
|
670
|
+
* `request` is present in route handlers; absent in server components, server
|
|
671
|
+
* actions, MCP tools, and scripts (resolve identity from headers/cookies/args).
|
|
672
|
+
*/
|
|
673
|
+
type ChaiContextResolverArgs<Req extends ChaiIncomingRequest = ChaiIncomingRequest> = {
|
|
674
|
+
request?: Req;
|
|
675
|
+
routeProps?: ChaiBuilderRouteProps;
|
|
676
|
+
};
|
|
677
|
+
/**
|
|
678
|
+
* Resolves the full {@link ChaiRequestContext} for the current call. Registered
|
|
679
|
+
* once per process via `setChaiContextResolver`, decoupled from the server config
|
|
680
|
+
* so the config stays environment-agnostic (Next-free).
|
|
681
|
+
*/
|
|
682
|
+
type ChaiContextResolver<Req extends ChaiIncomingRequest = ChaiIncomingRequest> = (args: ChaiContextResolverArgs<Req>) => Partial<ChaiRequestContext> | Promise<Partial<ChaiRequestContext>>;
|
|
683
|
+
/**
|
|
684
|
+
* @deprecated Context passed to the removed `resolveSiteUrl` config option.
|
|
685
|
+
* Resolve `siteUrl` inside your {@link ChaiContextResolver} instead.
|
|
686
|
+
*/
|
|
687
|
+
type ChaiResolveSiteUrlContext = {
|
|
688
|
+
appId: string;
|
|
689
|
+
};
|
|
690
|
+
/** @deprecated Use {@link ChaiContextResolverArgs}. */
|
|
691
|
+
type ChaiRequestContextArgs<Req extends ChaiIncomingRequest = ChaiIncomingRequest> = {
|
|
692
|
+
routeProps: ChaiBuilderRouteProps;
|
|
693
|
+
request?: Req;
|
|
694
|
+
};
|
|
695
|
+
/** @deprecated Use {@link ChaiContextResolver}. */
|
|
696
|
+
type ChaiRequestContextResolver<Req extends ChaiIncomingRequest = ChaiIncomingRequest> = (args: ChaiRequestContextArgs<Req>) => Partial<ChaiRequestContext> | Promise<Partial<ChaiRequestContext>>;
|
|
697
|
+
/**
|
|
698
|
+
* Same shape as Next.js App Router route component props (`page` / `layout` / `generateMetadata`).
|
|
699
|
+
* `params` / `searchParams` may be `Promise`s (Next 15+) or plain objects.
|
|
700
|
+
*
|
|
701
|
+
* Route Handlers (`route.ts`): pass `params` / `searchParams` from the handler context plus optional
|
|
702
|
+
* `ChaiIncomingRequest` (e.g. Next.js `NextRequest`) as the third argument to `getChaiBuilder`.
|
|
703
|
+
*/
|
|
704
|
+
type ChaiBuilderRouteProps = {
|
|
705
|
+
params?: Promise<unknown> | unknown;
|
|
706
|
+
searchParams?: Promise<unknown> | unknown;
|
|
707
|
+
};
|
|
708
|
+
/**
|
|
709
|
+
* Global data provider function - returns merged global data object
|
|
710
|
+
*/
|
|
711
|
+
type ChaiGlobalDataProvider<T = any> = (ctx: {
|
|
712
|
+
lang: string;
|
|
713
|
+
draft: boolean;
|
|
714
|
+
inBuilder: boolean;
|
|
715
|
+
}) => Promise<T>;
|
|
716
|
+
/**
|
|
717
|
+
* Page type entry (includes both page types and partials)
|
|
718
|
+
*/
|
|
719
|
+
type ChaiPageTypeEntry = ChaiPageType & {
|
|
720
|
+
partial?: boolean;
|
|
721
|
+
};
|
|
722
|
+
/**
|
|
723
|
+
* Collection entry
|
|
724
|
+
*/
|
|
725
|
+
type ChaiCollectionEntry = CollectionConfig<any>;
|
|
726
|
+
/**
|
|
727
|
+
* Page type data provider function
|
|
728
|
+
*/
|
|
729
|
+
type ChaiPageTypeDataProvider<T = Record<string, any>> = (ctx: {
|
|
730
|
+
lang: string;
|
|
731
|
+
draft: boolean;
|
|
732
|
+
inBuilder: boolean;
|
|
733
|
+
pageProps: ChaiPageProps;
|
|
734
|
+
}) => Promise<T>;
|
|
735
|
+
/**
|
|
736
|
+
* Block data provider function
|
|
737
|
+
*/
|
|
738
|
+
type ChaiBlockDataProvider = (ctx: {
|
|
739
|
+
block: any;
|
|
740
|
+
lang: string;
|
|
741
|
+
draft: boolean;
|
|
742
|
+
inBuilder: boolean;
|
|
743
|
+
pageProps: any;
|
|
744
|
+
}) => Promise<any>;
|
|
745
|
+
/**
|
|
746
|
+
* Trash entry
|
|
747
|
+
*/
|
|
748
|
+
type ChaiTrashEntry = ChaiTrashableEntity;
|
|
749
|
+
/** 0 = off (default), 1 = DB + HTTP + cache + AI summary, 2 = + API/action timing + full SQL + AI verbose (prompts, tools, tokens) */
|
|
750
|
+
type ChaiDebugLevel = 0 | 1 | 2;
|
|
751
|
+
|
|
752
|
+
type ChaiBaseSlugEntry = {
|
|
753
|
+
slug: string;
|
|
754
|
+
lang: string;
|
|
755
|
+
pageId: string;
|
|
756
|
+
primaryPageId: string | null;
|
|
757
|
+
dynamicSlugCustom: string | null;
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
type ChaiWebsiteSetting = {
|
|
761
|
+
appKey: string;
|
|
762
|
+
fallbackLang: string;
|
|
763
|
+
languages: string[];
|
|
764
|
+
theme: ChaiTheme;
|
|
765
|
+
settings: Record<string, any>;
|
|
766
|
+
designTokens: ChaiDesignTokens;
|
|
767
|
+
appChanges?: string[];
|
|
768
|
+
consentConfig?: Record<string, any>;
|
|
769
|
+
configData?: Record<string, any>;
|
|
770
|
+
};
|
|
771
|
+
type ChaiPageSeo = {
|
|
772
|
+
title?: string;
|
|
773
|
+
description?: string;
|
|
774
|
+
ogTitle?: string;
|
|
775
|
+
ogDescription?: string;
|
|
776
|
+
ogImage?: string;
|
|
777
|
+
canonicalUrl?: string;
|
|
778
|
+
noIndex?: boolean;
|
|
779
|
+
noFollow?: boolean;
|
|
780
|
+
jsonLD?: string;
|
|
781
|
+
};
|
|
782
|
+
type ChaiPage = {
|
|
783
|
+
id: string;
|
|
784
|
+
slug: string;
|
|
785
|
+
lang: string;
|
|
786
|
+
name: string;
|
|
787
|
+
pageType: string;
|
|
788
|
+
blocks: ChaiBlock[];
|
|
789
|
+
createdAt: string;
|
|
790
|
+
lastSaved: string;
|
|
791
|
+
dynamic: boolean;
|
|
792
|
+
online: boolean;
|
|
793
|
+
seo: ChaiPageSeo;
|
|
794
|
+
app: string;
|
|
795
|
+
primaryPage?: string | null;
|
|
796
|
+
currentEditor?: string | null;
|
|
797
|
+
changes: object[];
|
|
798
|
+
parent?: string | null;
|
|
799
|
+
libRefId?: string | null;
|
|
800
|
+
dynamicSlugCustom?: string | null;
|
|
801
|
+
metadata?: object;
|
|
802
|
+
jsonld?: object;
|
|
803
|
+
globalJsonLds?: string[];
|
|
804
|
+
links?: string;
|
|
805
|
+
partialBlocks?: string;
|
|
806
|
+
designTokens?: ChaiDesignTokens;
|
|
807
|
+
tracking?: Record<string, any> | null;
|
|
808
|
+
};
|
|
809
|
+
type ChaiPageType = {
|
|
810
|
+
key: string;
|
|
811
|
+
helpText?: string;
|
|
812
|
+
description?: string;
|
|
813
|
+
hasSlug?: boolean;
|
|
814
|
+
icon?: string;
|
|
815
|
+
name: string | (() => Promise<string>);
|
|
816
|
+
pluralName?: string | (() => Promise<string>);
|
|
817
|
+
dynamicSegments?: string;
|
|
818
|
+
dynamicSlug?: string;
|
|
819
|
+
getDynamicPages?: ({ query, slug, lang, }: {
|
|
820
|
+
query?: string;
|
|
821
|
+
slug?: string;
|
|
822
|
+
lang: string;
|
|
823
|
+
}) => Promise<Pick<ChaiPage, "id" | "name" | "slug" | "primaryPage">[]>;
|
|
824
|
+
search?: (query: string) => Promise<Pick<ChaiPage, "id" | "name" | "slug">[] | Error>;
|
|
825
|
+
resolveLink?: (id: string, draft?: boolean, lang?: string) => Promise<string>;
|
|
826
|
+
/**
|
|
827
|
+
* URL to open in an iframe panel when editing a dynamic page item.
|
|
828
|
+
* Use {{ID}} as placeholder for the page id.
|
|
829
|
+
* e.g. "/admin/embed/collections/posts/{{ID}}"
|
|
830
|
+
*/
|
|
831
|
+
editUrl?: string;
|
|
832
|
+
/**
|
|
833
|
+
* URL to open in an iframe panel when creating a new dynamic page item.
|
|
834
|
+
* Plain URL, no placeholder needed.
|
|
835
|
+
* e.g. "/admin/embed/collections/posts/create"
|
|
836
|
+
*/
|
|
837
|
+
createUrl?: string;
|
|
838
|
+
onCreate?: (data: Partial<ChaiPage> & {
|
|
839
|
+
id: string;
|
|
840
|
+
}) => Promise<void>;
|
|
841
|
+
onUpdate?: (data: Partial<ChaiPage> & {
|
|
842
|
+
id: string;
|
|
843
|
+
}) => Promise<void>;
|
|
844
|
+
onDelete?: (data: Pick<ChaiPage, "id">) => Promise<void>;
|
|
845
|
+
dataProvider?: ChaiPageTypeDataProvider;
|
|
846
|
+
defaultSeo?: () => Record<string, any>;
|
|
847
|
+
defaultJSONLD?: () => Record<string, any>;
|
|
848
|
+
defaultMetaTags?: () => Record<string, string>;
|
|
849
|
+
defaultTrackingInfo?: () => Record<string, any>;
|
|
850
|
+
};
|
|
851
|
+
interface ChaiLoggedInUser {
|
|
852
|
+
id: string;
|
|
853
|
+
email: string;
|
|
854
|
+
name: string;
|
|
855
|
+
avatar?: string;
|
|
856
|
+
role?: string;
|
|
857
|
+
}
|
|
858
|
+
type ChaiUserInfo = {
|
|
859
|
+
id: string;
|
|
860
|
+
email: string;
|
|
861
|
+
name: string;
|
|
862
|
+
avatar?: string;
|
|
863
|
+
};
|
|
864
|
+
type AssetsParams = {
|
|
865
|
+
search: string;
|
|
866
|
+
limit: number;
|
|
867
|
+
page: number;
|
|
868
|
+
};
|
|
869
|
+
type ImageConfig = {
|
|
870
|
+
lastImage?: string;
|
|
871
|
+
aspectRatio?: "1:1" | "3:4" | "4:3" | "9:16" | "16:9";
|
|
872
|
+
quality?: number;
|
|
873
|
+
};
|
|
874
|
+
type AIChatOptions = {
|
|
875
|
+
messages: any[];
|
|
876
|
+
image?: ImageConfig;
|
|
877
|
+
systemPrompt?: string;
|
|
878
|
+
initiator?: string | null;
|
|
879
|
+
model?: string;
|
|
880
|
+
context?: AIContext;
|
|
881
|
+
designTokens?: ChaiDesignTokens;
|
|
882
|
+
images?: string[];
|
|
883
|
+
attachments?: {
|
|
884
|
+
url?: string;
|
|
885
|
+
mediaType?: string;
|
|
886
|
+
filename?: string;
|
|
887
|
+
}[];
|
|
888
|
+
options?: Record<string, any>;
|
|
889
|
+
};
|
|
890
|
+
type AIContext = {
|
|
891
|
+
site?: Record<string, any>;
|
|
892
|
+
page?: Record<string, any>;
|
|
893
|
+
};
|
|
894
|
+
interface ChaiBuilderPagesAIInterface {
|
|
895
|
+
handleRequest(options: AIChatOptions, res: any): Promise<StreamTextResult<any, any>>;
|
|
896
|
+
isConfigured(): boolean;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
export type { ChaiResolveSiteUrlContext as $, AIChatOptions as A, ChaiContextResolverArgs as B, ChaiAction as C, ChaiCoreBlock as D, ChaiCssVariableNameWithDefault as E, ChaiDebugLevel as F, ChaiDesignTokens as G, ChaiFont as H, ChaiFontBySrc as I, ChaiFontByUrl as J, ChaiFontSource as K, ChaiGlobalDataProvider as L, ChaiIncomingRequest as M, ChaiLibrary as N, ChaiLibraryBlock as O, ChaiLoggedInUser as P, ChaiPage$1 as Q, ChaiPage as R, ChaiPageProps as S, ChaiPageType as T, ChaiPageTypeDataProvider as U, ChaiPageTypeEntry as V, ChaiRenderBlockProps as W, ChaiRequestContext as X, ChaiRequestContextArgs as Y, ChaiRequestContextResolver as Z, ChaiRequiredPermission as _, AICompleteCallback as a, ChaiSavePageData as a0, ChaiSaveWebsiteData as a1, ChaiSiteWideUsageData as a2, ChaiSystemFont as a3, ChaiTheme as a4, ChaiThemeOptions as a5, ChaiTrashEntry as a6, ChaiTrashableEntity as a7, ChaiUserAccess as a8, ChaiUserInfo as a9, ChaiWebsiteBuilderProps as aa, ChaiWebsiteSetting as ab, CollectionConfig as ac, CollectionFetchParams as ad, ImageConfig as ae, RestoreConflictResolution as af, StructureRule as ag, TrashContext as ah, TrashRecord as ai, TrashableRecordData as aj, AIContext as b, AIErrorCallback as c, AIEvent as d, AIModel as e, AISuccessCallback as f, AssetsParams as g, ChaiActionContext as h, ChaiAskAiResponse as i, ChaiBaseSlugEntry as j, ChaiBlock as k, ChaiBlockDataProvider as l, ChaiBlockPropsSchema as m, ChaiBlockRJSFSchemas as n, ChaiBlockSchema as o, ChaiBlockSchemas as p, ChaiBlockStyles as q, ChaiBlockUiSchema as r, ChaiBorderRadiusValue as s, ChaiBreakpoint as t, ChaiBuilderEditorProps as u, ChaiBuilderPagesAIInterface as v, ChaiBuilderRouteProps as w, ChaiCollectionEntry as x, ChaiCollectoin as y, ChaiContextResolver as z };
|