@upstart.gg/sdk 0.0.96 → 0.0.97
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/dist/node/cli/api.js +2 -2
- package/dist/node/cli/api.js.map +1 -1
- package/dist/node/cli/commands/login/cmd-login.js +6 -6
- package/dist/node/cli/commands/login/cmd-login.js.map +1 -1
- package/dist/node/cli/commands/publish/cmd-publish.d.ts.map +1 -1
- package/dist/node/cli/commands/publish/cmd-publish.js +18 -18
- package/dist/node/cli/commands/publish/cmd-publish.js.map +1 -1
- package/dist/node/cli/commands/publish/uploader.js +7 -7
- package/dist/node/cli/commands/publish/uploader.js.map +1 -1
- package/dist/node/cli/is-logged-in.js +2 -2
- package/dist/node/cli/is-logged-in.js.map +1 -1
- package/dist/node/cli/program.js +24 -24
- package/dist/node/cli/program.js.map +1 -1
- package/dist/node/shared/config.d.ts +4 -14
- package/dist/node/shared/config.d.ts.map +1 -1
- package/dist/node/shared/config.js +4 -4
- package/dist/node/shared/config.js.map +1 -1
- package/dist/node/shared/logger.d.ts.map +1 -1
- package/dist/node/shared/logger.js +2 -2
- package/dist/node/shared/logger.js.map +1 -1
- package/dist/shared/ajv.d.ts +2 -0
- package/dist/shared/ajv.d.ts.map +1 -1
- package/dist/shared/ajv.js +1 -1
- package/dist/shared/attributes.d.ts +20 -93
- package/dist/shared/attributes.d.ts.map +1 -1
- package/dist/shared/attributes.js +1 -1
- package/dist/shared/brick-manifest.d.ts +7 -17
- package/dist/shared/brick-manifest.d.ts.map +1 -1
- package/dist/shared/brick-manifest.js +1 -1
- package/dist/shared/bricks/manifests/accordion.manifest.d.ts +111 -0
- package/dist/shared/bricks/manifests/accordion.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/accordion.manifest.js +3 -0
- package/dist/shared/bricks/manifests/all-manifests.d.ts +5 -0
- package/dist/shared/bricks/manifests/all-manifests.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/all-manifests.js +1 -1
- package/dist/shared/bricks/manifests/button.manifest.d.ts +22 -13
- package/dist/shared/bricks/manifests/button.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/button.manifest.js +1 -1
- package/dist/shared/bricks/manifests/card.manifest.d.ts +44 -54
- package/dist/shared/bricks/manifests/card.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/card.manifest.js +1 -1
- package/dist/shared/bricks/manifests/carousel.manifest.d.ts +39 -12
- package/dist/shared/bricks/manifests/carousel.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/carousel.manifest.js +1 -1
- package/dist/shared/bricks/manifests/container.manifest.d.ts +49 -172
- package/dist/shared/bricks/manifests/container.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/container.manifest.js +1 -1
- package/dist/shared/bricks/manifests/divider.manifest.d.ts +63 -0
- package/dist/shared/bricks/manifests/divider.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/divider.manifest.js +3 -0
- package/dist/shared/bricks/manifests/footer.manifest.d.ts +30 -35
- package/dist/shared/bricks/manifests/footer.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/footer.manifest.js +1 -1
- package/dist/shared/bricks/manifests/form.manifest.d.ts +22 -12
- package/dist/shared/bricks/manifests/form.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/form.manifest.js +1 -1
- package/dist/shared/bricks/manifests/hero.manifest.d.ts +31 -71
- package/dist/shared/bricks/manifests/hero.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/hero.manifest.js +1 -1
- package/dist/shared/bricks/manifests/icon.manifest.d.ts +18 -12
- package/dist/shared/bricks/manifests/icon.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/icon.manifest.js +1 -1
- package/dist/shared/bricks/manifests/image.manifest.d.ts +36 -50
- package/dist/shared/bricks/manifests/image.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/image.manifest.js +1 -1
- package/dist/shared/bricks/manifests/images-gallery.manifest.d.ts +55 -115
- package/dist/shared/bricks/manifests/images-gallery.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/images-gallery.manifest.js +1 -1
- package/dist/shared/bricks/manifests/map.manifest.d.ts +36 -12
- package/dist/shared/bricks/manifests/map.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/map.manifest.js +1 -1
- package/dist/shared/bricks/manifests/navbar.manifest.d.ts +160 -0
- package/dist/shared/bricks/manifests/navbar.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/navbar.manifest.js +3 -0
- package/dist/shared/bricks/manifests/sidebar.manifest.d.ts +83 -12
- package/dist/shared/bricks/manifests/sidebar.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/sidebar.manifest.js +1 -1
- package/dist/shared/bricks/manifests/social-links.manifest.d.ts +37 -12
- package/dist/shared/bricks/manifests/social-links.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/social-links.manifest.js +1 -1
- package/dist/shared/bricks/manifests/testimonials.manifest.d.ts +94 -0
- package/dist/shared/bricks/manifests/testimonials.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/testimonials.manifest.js +3 -0
- package/dist/shared/bricks/manifests/text.manifest.d.ts +31 -63
- package/dist/shared/bricks/manifests/text.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/text.manifest.js +1 -1
- package/dist/shared/bricks/manifests/timeline.manifest.d.ts +122 -0
- package/dist/shared/bricks/manifests/timeline.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/timeline.manifest.js +3 -0
- package/dist/shared/bricks/manifests/video.manifest.d.ts +38 -12
- package/dist/shared/bricks/manifests/video.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/video.manifest.js +1 -1
- package/dist/shared/bricks/props/_style-presets.d.ts +1 -1
- package/dist/shared/bricks/props/_style-presets.d.ts.map +1 -1
- package/dist/shared/bricks/props/_style-presets.js +1 -1
- package/dist/shared/bricks/props/align.d.ts +7 -3
- package/dist/shared/bricks/props/align.d.ts.map +1 -1
- package/dist/shared/bricks/props/align.js +1 -1
- package/dist/shared/bricks/props/background.d.ts +8 -1
- package/dist/shared/bricks/props/background.d.ts.map +1 -1
- package/dist/shared/bricks/props/background.js +1 -1
- package/dist/shared/bricks/props/boolean.js +1 -1
- package/dist/shared/bricks/props/border.d.ts +24 -22
- package/dist/shared/bricks/props/border.d.ts.map +1 -1
- package/dist/shared/bricks/props/border.js +1 -1
- package/dist/shared/bricks/props/color.d.ts +5 -0
- package/dist/shared/bricks/props/color.d.ts.map +1 -0
- package/dist/shared/bricks/props/color.js +3 -0
- package/dist/shared/bricks/props/common.d.ts +9 -1
- package/dist/shared/bricks/props/common.d.ts.map +1 -1
- package/dist/shared/bricks/props/common.js +1 -1
- package/dist/shared/bricks/props/container.d.ts +37 -45
- package/dist/shared/bricks/props/container.d.ts.map +1 -1
- package/dist/shared/bricks/props/container.js +1 -1
- package/dist/shared/bricks/props/css-length.d.ts +5 -0
- package/dist/shared/bricks/props/css-length.d.ts.map +1 -0
- package/dist/shared/bricks/props/css-length.js +3 -0
- package/dist/shared/bricks/props/datasource.d.ts +9 -13
- package/dist/shared/bricks/props/datasource.d.ts.map +1 -1
- package/dist/shared/bricks/props/datasource.js +1 -1
- package/dist/shared/bricks/props/date.d.ts +4 -0
- package/dist/shared/bricks/props/date.d.ts.map +1 -0
- package/dist/shared/bricks/props/date.js +3 -0
- package/dist/shared/bricks/props/effects.d.ts +4 -21
- package/dist/shared/bricks/props/effects.d.ts.map +1 -1
- package/dist/shared/bricks/props/effects.js +1 -1
- package/dist/shared/bricks/props/enum.d.ts +13 -0
- package/dist/shared/bricks/props/enum.d.ts.map +1 -0
- package/dist/shared/bricks/props/enum.js +3 -0
- package/dist/shared/bricks/props/file.d.ts +2 -0
- package/dist/shared/bricks/props/file.d.ts.map +1 -0
- package/dist/shared/bricks/props/file.js +3 -0
- package/dist/shared/bricks/props/geolocation.d.ts +16 -0
- package/dist/shared/bricks/props/geolocation.d.ts.map +1 -0
- package/dist/shared/bricks/props/geolocation.js +3 -0
- package/dist/shared/bricks/props/helpers.d.ts +8 -4
- package/dist/shared/bricks/props/helpers.d.ts.map +1 -1
- package/dist/shared/bricks/props/helpers.js +1 -1
- package/dist/shared/bricks/props/image.d.ts +7 -1
- package/dist/shared/bricks/props/image.d.ts.map +1 -1
- package/dist/shared/bricks/props/image.js +1 -1
- package/dist/shared/bricks/props/number.js +1 -1
- package/dist/shared/bricks/props/padding.d.ts +2 -1
- package/dist/shared/bricks/props/padding.d.ts.map +1 -1
- package/dist/shared/bricks/props/padding.js +1 -1
- package/dist/shared/bricks/props/position.d.ts.map +1 -1
- package/dist/shared/bricks/props/position.js +1 -1
- package/dist/shared/bricks/props/preset.d.ts +92 -0
- package/dist/shared/bricks/props/preset.d.ts.map +1 -0
- package/dist/shared/bricks/props/preset.js +3 -0
- package/dist/shared/bricks/props/string.d.ts +8 -3
- package/dist/shared/bricks/props/string.d.ts.map +1 -1
- package/dist/shared/bricks/props/string.js +1 -1
- package/dist/shared/bricks/props/text.d.ts +3 -4
- package/dist/shared/bricks/props/text.d.ts.map +1 -1
- package/dist/shared/bricks/props/text.js +1 -1
- package/dist/shared/bricks/props/types.d.ts +5 -2
- package/dist/shared/bricks/props/types.d.ts.map +1 -1
- package/dist/shared/bricks.d.ts +243 -134
- package/dist/shared/bricks.d.ts.map +1 -1
- package/dist/shared/bricks.js +1 -1
- package/dist/shared/chunk-2AJYHJFG.js +8 -0
- package/dist/shared/chunk-2FHWS73Y.js +6 -0
- package/dist/shared/chunk-3FJVF357.js +3 -0
- package/dist/shared/chunk-3RHYJ6E7.js +5 -0
- package/dist/shared/chunk-3VZACK2Y.js +3 -0
- package/dist/shared/chunk-3XCKZ4JQ.js +3 -0
- package/dist/shared/chunk-4MPRHJWO.js +3 -0
- package/dist/shared/chunk-5EOWW7BX.js +4 -0
- package/dist/shared/chunk-5HYPCOSS.js +3 -0
- package/dist/shared/chunk-5K5C6XFX.js +3 -0
- package/dist/shared/chunk-6QS5PKLA.js +3 -0
- package/dist/shared/chunk-74EL657O.js +3 -0
- package/dist/shared/chunk-AJDYOLKP.js +3 -0
- package/dist/shared/chunk-ALFOZHAH.js +3 -0
- package/dist/shared/{chunk-FGU4BGP4.js → chunk-ATDJCXC2.js} +1 -1
- package/dist/shared/chunk-BJSO43AS.js +3 -0
- package/dist/shared/chunk-BTKLQQZA.js +3 -0
- package/dist/shared/chunk-CAVNF3BU.js +3 -0
- package/dist/shared/chunk-CCNU3J56.js +3 -0
- package/dist/shared/chunk-CTRS76PX.js +3 -0
- package/dist/shared/chunk-DCH2FI6T.js +8 -0
- package/dist/shared/chunk-DFSQR6QC.js +3 -0
- package/dist/shared/chunk-ENU4SEHO.js +3 -0
- package/dist/shared/chunk-G7LX3UKQ.js +3 -0
- package/dist/shared/chunk-GGJBTPGW.js +3 -0
- package/dist/shared/chunk-H24R3IWA.js +3 -0
- package/dist/shared/chunk-HYVQXAK5.js +3 -0
- package/dist/shared/chunk-LKVQQQTI.js +3 -0
- package/dist/shared/chunk-MITJPRGD.js +6 -0
- package/dist/shared/chunk-NLZBY65T.js +3 -0
- package/dist/shared/chunk-OUI2VDNM.js +3 -0
- package/dist/shared/chunk-OYIL5SCU.js +3 -0
- package/dist/shared/chunk-P5DZK4TS.js +3 -0
- package/dist/shared/chunk-PK3R5VOF.js +3 -0
- package/dist/shared/chunk-QPATZM3I.js +3 -0
- package/dist/shared/chunk-RDBEWW4G.js +7 -0
- package/dist/shared/chunk-RPBQZW5I.js +3 -0
- package/dist/shared/chunk-SLSIAUYV.js +3 -0
- package/dist/shared/chunk-SUG225LF.js +3 -0
- package/dist/shared/chunk-U5XOIYSS.js +3 -0
- package/dist/shared/{chunk-HIZPJNEM.js → chunk-UL7L3HYV.js} +1 -1
- package/dist/shared/chunk-V6BCYHZH.js +3 -0
- package/dist/shared/chunk-VA5LFJVE.js +3 -0
- package/dist/shared/chunk-VAC73HJE.js +3 -0
- package/dist/shared/chunk-VBWC36L2.js +3 -0
- package/dist/shared/chunk-VLGLD6GR.js +3 -0
- package/dist/shared/chunk-VTFWVTPI.js +3 -0
- package/dist/shared/chunk-WAAKB6OB.js +3 -0
- package/dist/shared/chunk-Y36SM2AO.js +3 -0
- package/dist/shared/chunk-Y7CEEEVW.js +3 -0
- package/dist/shared/chunk-YZ5Y4WE6.js +3 -0
- package/dist/shared/chunk-Z7SYP6FG.js +3 -0
- package/dist/shared/chunk-ZJNA4QQC.js +3 -0
- package/dist/shared/chunk-ZMDHKAWL.js +3 -0
- package/dist/shared/context.d.ts +38 -0
- package/dist/shared/context.d.ts.map +1 -0
- package/dist/shared/{chunk-WJ5CDDXW.js → context.js} +0 -1
- package/dist/shared/datarecords/types.d.ts +40 -20
- package/dist/shared/datarecords/types.d.ts.map +1 -1
- package/dist/shared/datarecords/types.js +1 -1
- package/dist/shared/datasources/external/http-json/fetcher.d.ts.map +1 -0
- package/dist/shared/datasources/external/http-json/options.d.ts.map +1 -0
- package/dist/shared/datasources/external/{json → http-json}/schema.d.ts +0 -1
- package/dist/shared/datasources/external/http-json/schema.d.ts.map +1 -0
- package/dist/shared/datasources/external/http-json/tests/fetcher.test.d.ts.map +1 -0
- package/dist/shared/datasources/external/rss/fetcher.d.ts.map +1 -1
- package/dist/shared/datasources/external/rss/sample.d.ts.map +1 -1
- package/dist/shared/datasources/external/rss/schema.d.ts +7 -13
- package/dist/shared/datasources/external/rss/schema.d.ts.map +1 -1
- package/dist/shared/datasources/external/youtube/list/sample.d.ts +23 -32
- package/dist/shared/datasources/external/youtube/list/sample.d.ts.map +1 -1
- package/dist/shared/datasources/external/youtube/list/schema.d.ts +24 -33
- package/dist/shared/datasources/external/youtube/list/schema.d.ts.map +1 -1
- package/dist/shared/datasources/internal/blog/schema.d.ts.map +1 -1
- package/dist/shared/datasources/internal/changelog/schema.d.ts.map +1 -1
- package/dist/shared/datasources/internal/recipes/schema.d.ts.map +1 -1
- package/dist/shared/datasources/samples.d.ts +1 -1
- package/dist/shared/datasources/samples.d.ts.map +1 -1
- package/dist/shared/datasources/schemas.d.ts +33 -583
- package/dist/shared/datasources/schemas.d.ts.map +1 -1
- package/dist/shared/datasources/schemas.js +1 -1
- package/dist/shared/datasources/types.d.ts +75 -1314
- package/dist/shared/datasources/types.d.ts.map +1 -1
- package/dist/shared/datasources/types.js +1 -1
- package/dist/shared/datasources.d.ts +14 -0
- package/dist/shared/datasources.d.ts.map +1 -1
- package/dist/shared/datasources.js +1 -1
- package/dist/shared/images.d.ts +30 -0
- package/dist/shared/images.d.ts.map +1 -0
- package/dist/shared/images.js +3 -0
- package/dist/shared/layout-constants.js +1 -1
- package/dist/shared/page.d.ts +104 -2670
- package/dist/shared/page.d.ts.map +1 -1
- package/dist/shared/page.js +1 -1
- package/dist/shared/prompt.d.ts +4 -0
- package/dist/shared/prompt.d.ts.map +1 -0
- package/dist/shared/prompt.js +3 -0
- package/dist/shared/responsive.d.ts +3 -3
- package/dist/shared/responsive.d.ts.map +1 -1
- package/dist/shared/responsive.js +1 -1
- package/dist/shared/site.d.ts +545 -0
- package/dist/shared/site.d.ts.map +1 -0
- package/dist/shared/site.js +3 -0
- package/dist/shared/sitemap.d.ts +38 -0
- package/dist/shared/sitemap.d.ts.map +1 -0
- package/dist/shared/sitemap.js +3 -0
- package/dist/shared/theme.d.ts +41 -19
- package/dist/shared/theme.d.ts.map +1 -1
- package/dist/shared/theme.js +1 -1
- package/dist/shared/themes/color-system.d.ts +5 -309
- package/dist/shared/themes/color-system.d.ts.map +1 -1
- package/dist/shared/themes/color-system.js +1 -1
- package/dist/shared/utils/invariant.js +1 -1
- package/dist/shared/utils/schema.d.ts +10 -2
- package/dist/shared/utils/schema.d.ts.map +1 -1
- package/dist/shared/utils/schema.js +1 -1
- package/dist/shared/utils/typed-ref.d.ts +32 -0
- package/dist/shared/utils/typed-ref.d.ts.map +1 -0
- package/dist/shared/utils/typed-ref.js +3 -0
- package/package.json +11 -11
- package/src/node/cli/api.ts +101 -0
- package/src/node/cli/commands/cmd-build.ts +64 -0
- package/src/node/cli/commands/login/cmd-login.ts +111 -0
- package/src/node/cli/commands/logout/cmd-logout.ts +11 -0
- package/src/node/cli/commands/publish/cmd-publish.ts +135 -0
- package/src/node/cli/commands/publish/parse-gitignore.ts +278 -0
- package/src/node/cli/commands/publish/uploader.ts +333 -0
- package/src/node/cli/constants.ts +14 -0
- package/src/node/cli/is-logged-in.ts +28 -0
- package/src/node/cli/program.ts +77 -0
- package/src/node/cli/store.ts +64 -0
- package/src/node/cli/tests/api.test.ts +161 -0
- package/src/node/cli/types.ts +34 -0
- package/src/node/cli/utils.ts +20 -0
- package/src/node/shared/config.ts +69 -0
- package/src/node/shared/logger.ts +44 -0
- package/src/shared/ajv.ts +111 -0
- package/src/shared/analytics/init.ts +14 -0
- package/src/shared/analytics/track.ts +21 -0
- package/src/shared/analytics/types.ts +13 -0
- package/src/shared/attributes.ts +222 -0
- package/src/shared/brick-manifest.ts +110 -0
- package/src/shared/bricks/manifests/accordion.manifest.ts +179 -0
- package/src/shared/bricks/manifests/all-manifests.ts +92 -0
- package/src/shared/bricks/manifests/button.manifest.ts +145 -0
- package/src/shared/bricks/manifests/card.manifest.ts +269 -0
- package/src/shared/bricks/manifests/carousel.manifest.ts +106 -0
- package/src/shared/bricks/manifests/container.manifest.ts +357 -0
- package/src/shared/bricks/manifests/divider.manifest.ts +121 -0
- package/src/shared/bricks/manifests/footer.manifest.ts +487 -0
- package/src/shared/bricks/manifests/form.manifest.ts +112 -0
- package/src/shared/bricks/manifests/hero.manifest.ts +132 -0
- package/src/shared/bricks/manifests/icon.manifest.ts +130 -0
- package/src/shared/bricks/manifests/image.manifest.ts +203 -0
- package/src/shared/bricks/manifests/images-gallery.manifest.ts +227 -0
- package/src/shared/bricks/manifests/map.manifest.ts +75 -0
- package/src/shared/bricks/manifests/navbar.manifest.ts +344 -0
- package/src/shared/bricks/manifests/sidebar.manifest.ts +90 -0
- package/src/shared/bricks/manifests/social-links.manifest.ts +370 -0
- package/src/shared/bricks/manifests/testimonials.manifest.ts +397 -0
- package/src/shared/bricks/manifests/tests/header.manifest.test.ts +10 -0
- package/src/shared/bricks/manifests/text.manifest.ts +164 -0
- package/src/shared/bricks/manifests/timeline.manifest.ts +456 -0
- package/src/shared/bricks/manifests/video.manifest.ts +59 -0
- package/src/shared/bricks/props/_style-presets.ts +352 -0
- package/src/shared/bricks/props/align.ts +59 -0
- package/src/shared/bricks/props/background.ts +118 -0
- package/src/shared/bricks/props/boolean.ts +11 -0
- package/src/shared/bricks/props/border.ts +84 -0
- package/src/shared/bricks/props/color.ts +24 -0
- package/src/shared/bricks/props/common.ts +37 -0
- package/src/shared/bricks/props/container.ts +356 -0
- package/src/shared/bricks/props/css-length.ts +25 -0
- package/src/shared/bricks/props/datasource.ts +60 -0
- package/src/shared/bricks/props/date.ts +24 -0
- package/src/shared/bricks/props/effects.ts +123 -0
- package/src/shared/bricks/props/enum.ts +42 -0
- package/src/shared/bricks/props/file.ts +12 -0
- package/src/shared/bricks/props/geolocation.ts +30 -0
- package/src/shared/bricks/props/helpers.ts +101 -0
- package/src/shared/bricks/props/image.ts +90 -0
- package/src/shared/bricks/props/number.ts +16 -0
- package/src/shared/bricks/props/padding.ts +21 -0
- package/src/shared/bricks/props/position.ts +27 -0
- package/src/shared/bricks/props/preset.ts +136 -0
- package/src/shared/bricks/props/string.ts +60 -0
- package/src/shared/bricks/props/tests/align.test.ts +37 -0
- package/src/shared/bricks/props/tests/background.test.ts +102 -0
- package/src/shared/bricks/props/tests/border.test.ts +38 -0
- package/src/shared/bricks/props/tests/effects.test.ts +37 -0
- package/src/shared/bricks/props/tests/helpers.test.ts +133 -0
- package/src/shared/bricks/props/tests/image.test.ts +71 -0
- package/src/shared/bricks/props/tests/padding.ts +12 -0
- package/src/shared/bricks/props/tests/string.test.ts +79 -0
- package/src/shared/bricks/props/text.ts +66 -0
- package/src/shared/bricks/props/types.ts +57 -0
- package/src/shared/bricks.ts +232 -0
- package/src/shared/context.ts +39 -0
- package/src/shared/datarecords/external/airtable/handler.ts +21 -0
- package/src/shared/datarecords/external/airtable/options.ts +22 -0
- package/src/shared/datarecords/external/generic-webhook/handler.ts +10 -0
- package/src/shared/datarecords/external/generic-webhook/options.ts +13 -0
- package/src/shared/datarecords/external/google/oauth/config.ts +30 -0
- package/src/shared/datarecords/external/google/sheets/handler.ts +26 -0
- package/src/shared/datarecords/external/google/sheets/options.ts +9 -0
- package/src/shared/datarecords/types.ts +120 -0
- package/src/shared/datarecords.ts +5 -0
- package/src/shared/datasources/README.md +3 -0
- package/src/shared/datasources/external/facebook/posts/fetcher.ts +62 -0
- package/src/shared/datasources/external/facebook/posts/sample.ts +35 -0
- package/src/shared/datasources/external/facebook/posts/schema.ts +33 -0
- package/src/shared/datasources/external/facebook/posts/tests/fetcher.test.ts +91 -0
- package/src/shared/datasources/external/http-json/fetcher.ts +28 -0
- package/src/shared/datasources/external/http-json/options.ts +12 -0
- package/src/shared/datasources/external/http-json/schema.ts +6 -0
- package/src/shared/datasources/external/http-json/tests/fetcher.test.ts +70 -0
- package/src/shared/datasources/external/instagram/feed/fetcher.ts +43 -0
- package/src/shared/datasources/external/instagram/feed/sample.ts +22 -0
- package/src/shared/datasources/external/instagram/feed/schema.ts +23 -0
- package/src/shared/datasources/external/instagram/feed/tests/fetcher.test.ts +82 -0
- package/src/shared/datasources/external/mastodon/account/fetcher.ts +33 -0
- package/src/shared/datasources/external/mastodon/account/sample.ts +33 -0
- package/src/shared/datasources/external/mastodon/account/schema.ts +45 -0
- package/src/shared/datasources/external/mastodon/account/tests/fetcher.test.ts +65 -0
- package/src/shared/datasources/external/mastodon/options.ts +11 -0
- package/src/shared/datasources/external/mastodon/status/fetcher.ts +45 -0
- package/src/shared/datasources/external/mastodon/status/sample.array.ts +59 -0
- package/src/shared/datasources/external/mastodon/status/sample.single.ts +55 -0
- package/src/shared/datasources/external/mastodon/status/schema.ts +130 -0
- package/src/shared/datasources/external/mastodon/status/tests/fetcher.test.ts +74 -0
- package/src/shared/datasources/external/meta/oauth/config.ts +16 -0
- package/src/shared/datasources/external/meta/options.ts +11 -0
- package/src/shared/datasources/external/rss/fetcher.ts +30 -0
- package/src/shared/datasources/external/rss/options.ts +11 -0
- package/src/shared/datasources/external/rss/sample.ts +22 -0
- package/src/shared/datasources/external/rss/schema.ts +42 -0
- package/src/shared/datasources/external/threads/media/fetcher.ts +63 -0
- package/src/shared/datasources/external/threads/media/sample.ts +44 -0
- package/src/shared/datasources/external/threads/media/schema.ts +37 -0
- package/src/shared/datasources/external/tiktok/oauth/config.ts +17 -0
- package/src/shared/datasources/external/tiktok/video/fetcher.ts +49 -0
- package/src/shared/datasources/external/tiktok/video/options.ts +12 -0
- package/src/shared/datasources/external/tiktok/video/sample.ts +26 -0
- package/src/shared/datasources/external/tiktok/video/schema.ts +27 -0
- package/src/shared/datasources/external/youtube/list/fetcher.ts +46 -0
- package/src/shared/datasources/external/youtube/list/options.ts +15 -0
- package/src/shared/datasources/external/youtube/list/sample.ts +33 -0
- package/src/shared/datasources/external/youtube/list/schema.ts +38 -0
- package/src/shared/datasources/external/youtube/oauth/config.ts +15 -0
- package/src/shared/datasources/fetcher.ts +17 -0
- package/src/shared/datasources/internal/blog/schema.ts +69 -0
- package/src/shared/datasources/internal/changelog/schema.ts +48 -0
- package/src/shared/datasources/internal/contact-info/schema.ts +20 -0
- package/src/shared/datasources/internal/cv/schema.ts +217 -0
- package/src/shared/datasources/internal/faq/schema.ts +27 -0
- package/src/shared/datasources/internal/job-board/schema.ts +228 -0
- package/src/shared/datasources/internal/links/schema.ts +15 -0
- package/src/shared/datasources/internal/recipes/schema.ts +42 -0
- package/src/shared/datasources/internal/restaurant/schema.ts +225 -0
- package/src/shared/datasources/provider-options.ts +7 -0
- package/src/shared/datasources/samples.ts +26 -0
- package/src/shared/datasources/schemas.ts +45 -0
- package/src/shared/datasources/types.ts +276 -0
- package/src/shared/datasources/utils.ts +16 -0
- package/src/shared/datasources.ts +42 -0
- package/src/shared/env.ts +23 -0
- package/src/shared/errors.ts +1 -0
- package/src/shared/images.ts +44 -0
- package/src/shared/index.ts +3 -0
- package/src/shared/layout-constants.ts +25 -0
- package/src/shared/manifest.ts +50 -0
- package/src/shared/oauth.ts +16 -0
- package/src/shared/page.ts +61 -0
- package/src/shared/prompt.ts +9 -0
- package/src/shared/responsive.ts +5 -0
- package/src/shared/site.ts +97 -0
- package/src/shared/sitemap.ts +66 -0
- package/src/shared/social-icons.ts +307 -0
- package/src/shared/tests/attributes.test.ts +37 -0
- package/src/shared/theme.ts +245 -0
- package/src/shared/themes/README.md +34 -0
- package/src/shared/themes/color-system.ts +127 -0
- package/src/shared/utils/canvas-data-uri.ts +2 -0
- package/src/shared/utils/invariant.ts +25 -0
- package/src/shared/utils/json-date.ts +8 -0
- package/src/shared/utils/merge.ts +12 -0
- package/src/shared/utils/object-hash.ts +7 -0
- package/src/shared/utils/schema.ts +30 -0
- package/src/shared/utils/try-catch.ts +12 -0
- package/src/shared/utils/typed-ref.ts +41 -0
- package/dist/shared/bricks/manifests/countdown.manifest.d.ts +0 -57
- package/dist/shared/bricks/manifests/countdown.manifest.d.ts.map +0 -1
- package/dist/shared/bricks/manifests/countdown.manifest.js +0 -3
- package/dist/shared/bricks/manifests/generic-component.manifest.d.ts +0 -62
- package/dist/shared/bricks/manifests/generic-component.manifest.d.ts.map +0 -1
- package/dist/shared/bricks/manifests/generic-component.manifest.js +0 -3
- package/dist/shared/bricks/manifests/header.manifest.d.ts +0 -275
- package/dist/shared/bricks/manifests/header.manifest.d.ts.map +0 -1
- package/dist/shared/bricks/manifests/header.manifest.js +0 -3
- package/dist/shared/bricks/props/_docs-common-styles.d.ts +0 -59
- package/dist/shared/bricks/props/_docs-common-styles.d.ts.map +0 -1
- package/dist/shared/bricks/props/_docs-common-styles.js +0 -3
- package/dist/shared/bricks/props/tests/container.test.d.ts +0 -2
- package/dist/shared/bricks/props/tests/container.test.d.ts.map +0 -1
- package/dist/shared/chunk-2ZPY4LCA.js +0 -3
- package/dist/shared/chunk-3CY6AZG7.js +0 -3
- package/dist/shared/chunk-4K5NN4CN.js +0 -3
- package/dist/shared/chunk-4NCCSLBW.js +0 -3
- package/dist/shared/chunk-6I4PY5WS.js +0 -3
- package/dist/shared/chunk-6LDLGZUM.js +0 -3
- package/dist/shared/chunk-AZ63RF3K.js +0 -3
- package/dist/shared/chunk-BH4HTAAC.js +0 -3
- package/dist/shared/chunk-BK6LBWDI.js +0 -3
- package/dist/shared/chunk-BMDB2V7J.js +0 -3
- package/dist/shared/chunk-DAPQ4JPP.js +0 -3
- package/dist/shared/chunk-ECZ6FGZM.js +0 -3
- package/dist/shared/chunk-EFJQECVB.js +0 -3
- package/dist/shared/chunk-F2ZVIFHO.js +0 -3
- package/dist/shared/chunk-H6L4KRCJ.js +0 -3
- package/dist/shared/chunk-IWSVY2VC.js +0 -3
- package/dist/shared/chunk-JVDUEZYO.js +0 -3
- package/dist/shared/chunk-KB4HY432.js +0 -3
- package/dist/shared/chunk-KOTGMAXH.js +0 -3
- package/dist/shared/chunk-LDOM2LJF.js +0 -3
- package/dist/shared/chunk-NFU5BF6G.js +0 -3
- package/dist/shared/chunk-P5FVZ5PL.js +0 -3
- package/dist/shared/chunk-PD7P5KSV.js +0 -3
- package/dist/shared/chunk-PJ6HA55L.js +0 -3
- package/dist/shared/chunk-PSNFBHPU.js +0 -3
- package/dist/shared/chunk-PSSJMWGU.js +0 -3
- package/dist/shared/chunk-PU2FOOTY.js +0 -3
- package/dist/shared/chunk-Q4MXTCE4.js +0 -8
- package/dist/shared/chunk-RBYYMUOZ.js +0 -3
- package/dist/shared/chunk-S2RQWOG2.js +0 -3
- package/dist/shared/chunk-SO5M7CYA.js +0 -3
- package/dist/shared/chunk-THRRILTW.js +0 -3
- package/dist/shared/chunk-TQ23UATQ.js +0 -3
- package/dist/shared/chunk-U44NTSIO.js +0 -3
- package/dist/shared/chunk-U4R5EGBK.js +0 -3
- package/dist/shared/chunk-WOEBR25A.js +0 -3
- package/dist/shared/chunk-WPTVLIYS.js +0 -3
- package/dist/shared/chunk-WXKRIUTA.js +0 -3
- package/dist/shared/chunk-XBX6II3M.js +0 -3
- package/dist/shared/chunk-XEQ2XZLQ.js +0 -3
- package/dist/shared/chunk-XGCBIXOO.js +0 -3
- package/dist/shared/chunk-YY6DANZF.js +0 -3
- package/dist/shared/chunk-ZWQHIQEQ.js +0 -3
- package/dist/shared/datasources/external/json/fetcher.d.ts.map +0 -1
- package/dist/shared/datasources/external/json/options.d.ts.map +0 -1
- package/dist/shared/datasources/external/json/schema.d.ts.map +0 -1
- package/dist/shared/datasources/external/json/tests/fetcher.test.d.ts.map +0 -1
- package/dist/shared/datasources/external/rss/tests/fetcher.test.d.ts +0 -2
- package/dist/shared/datasources/external/rss/tests/fetcher.test.d.ts.map +0 -1
- package/dist/shared/template.d.ts +0 -898
- package/dist/shared/template.d.ts.map +0 -1
- package/dist/shared/template.js +0 -3
- package/dist/shared/tests/page.test.d.ts +0 -2
- package/dist/shared/tests/page.test.d.ts.map +0 -1
- package/dist/shared/tests/test-config.d.ts +0 -3
- package/dist/shared/tests/test-config.d.ts.map +0 -1
- package/dist/shared/themes/all-themes.d.ts +0 -3
- package/dist/shared/themes/all-themes.d.ts.map +0 -1
- package/dist/shared/themes/all-themes.js +0 -3
- /package/dist/shared/datasources/external/{json → http-json}/fetcher.d.ts +0 -0
- /package/dist/shared/datasources/external/{json → http-json}/options.d.ts +0 -0
- /package/dist/shared/datasources/external/{json → http-json}/tests/fetcher.test.d.ts +0 -0
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { type TObject, Type, type Static, type SchemaOptions } from "@sinclair/typebox";
|
|
2
|
+
import { getStyleProperties, getStyleValueById, group, optional, prop } from "./helpers";
|
|
3
|
+
import { StringEnum } from "~/shared/utils/schema";
|
|
4
|
+
import { typedRef } from "~/shared/utils/typed-ref";
|
|
5
|
+
|
|
6
|
+
// type FlexOptions = {
|
|
7
|
+
// title?: string;
|
|
8
|
+
// defaultValue?: {
|
|
9
|
+
// direction: string;
|
|
10
|
+
// wrap: string;
|
|
11
|
+
// gap: string;
|
|
12
|
+
// justifyContent: string;
|
|
13
|
+
// alignItems: string;
|
|
14
|
+
// };
|
|
15
|
+
// };
|
|
16
|
+
|
|
17
|
+
// export function flex(opts: FlexOptions = {}) {
|
|
18
|
+
// const {
|
|
19
|
+
// title = "Layout",
|
|
20
|
+
// defaultValue = {
|
|
21
|
+
// direction: "flex-row",
|
|
22
|
+
// gap: "gap-1",
|
|
23
|
+
// wrap: "flex-wrap",
|
|
24
|
+
// justifyContent: "justify-stretch",
|
|
25
|
+
// alignItems: "items-stretch",
|
|
26
|
+
// },
|
|
27
|
+
// } = opts;
|
|
28
|
+
// return prop({
|
|
29
|
+
// title,
|
|
30
|
+
// schema: Type.Object(
|
|
31
|
+
// {
|
|
32
|
+
// direction: Type.Optional(
|
|
33
|
+
// StringEnum(["flex-row", "flex-col"], {
|
|
34
|
+
// enumNames: ["Row", "Column"],
|
|
35
|
+
// title: "Direction",
|
|
36
|
+
// description: "The direction of the container.",
|
|
37
|
+
// default: defaultValue.direction,
|
|
38
|
+
// }),
|
|
39
|
+
// ),
|
|
40
|
+
// gap: Type.Optional(
|
|
41
|
+
// Type.String({
|
|
42
|
+
// title: "Gap",
|
|
43
|
+
// description:
|
|
44
|
+
// "Space between items. Can be a tailwind gap class like 'gap-1' or 'gap-2', or a custom value like '10px'",
|
|
45
|
+
// default: defaultValue.gap,
|
|
46
|
+
// // todo: make a specific field for gap
|
|
47
|
+
// // "ui:field": "enum",
|
|
48
|
+
// }),
|
|
49
|
+
// ),
|
|
50
|
+
// wrap: Type.Optional(
|
|
51
|
+
// StringEnum(["flex-wrap", "flex-nowrap"], {
|
|
52
|
+
// enumNames: ["Wrap", "No wrap"],
|
|
53
|
+
// title: "Wrap",
|
|
54
|
+
// description: "Wether to wrap items in the container.",
|
|
55
|
+
// default: defaultValue.wrap,
|
|
56
|
+
// }),
|
|
57
|
+
// ),
|
|
58
|
+
// justifyContent: Type.Optional(
|
|
59
|
+
// StringEnum(
|
|
60
|
+
// [
|
|
61
|
+
// "justify-start",
|
|
62
|
+
// "justify-center",
|
|
63
|
+
// "justify-end",
|
|
64
|
+
// "justify-between",
|
|
65
|
+
// "justify-around",
|
|
66
|
+
// "justify-evenly",
|
|
67
|
+
// "justify-stretch",
|
|
68
|
+
// ],
|
|
69
|
+
// {
|
|
70
|
+
// enumNames: [
|
|
71
|
+
// "Start",
|
|
72
|
+
// "Center",
|
|
73
|
+
// "End",
|
|
74
|
+
// "Space between",
|
|
75
|
+
// "Space around",
|
|
76
|
+
// "Evenly distributed",
|
|
77
|
+
// "Stretch",
|
|
78
|
+
// ],
|
|
79
|
+
// title: "Justify",
|
|
80
|
+
// description: "Justify content along the main axis (horizontal for row, vertical for column).",
|
|
81
|
+
// default: defaultValue.justifyContent,
|
|
82
|
+
// },
|
|
83
|
+
// ),
|
|
84
|
+
// ),
|
|
85
|
+
// alignItems: Type.Optional(
|
|
86
|
+
// StringEnum(["items-start", "items-center", "items-end", "items-stretch"], {
|
|
87
|
+
// enumNames: ["Start", "Center", "End", "Stretch"],
|
|
88
|
+
// title: "Alignment",
|
|
89
|
+
// description: "Align items along the cross axis (vertical for row, horizontal for column).",
|
|
90
|
+
// default: defaultValue.alignItems,
|
|
91
|
+
// }),
|
|
92
|
+
// ),
|
|
93
|
+
// },
|
|
94
|
+
// {
|
|
95
|
+
// "ui:styleId": "#styles:flex",
|
|
96
|
+
// "ui:field": "flex",
|
|
97
|
+
// "ui:responsive": true,
|
|
98
|
+
// default: {
|
|
99
|
+
// direction: defaultValue.direction,
|
|
100
|
+
// gap: defaultValue.gap,
|
|
101
|
+
// wrap: defaultValue.wrap,
|
|
102
|
+
// justifyContent: defaultValue.justifyContent,
|
|
103
|
+
// alignItems: defaultValue.alignItems,
|
|
104
|
+
// },
|
|
105
|
+
// },
|
|
106
|
+
// ),
|
|
107
|
+
// });
|
|
108
|
+
// }
|
|
109
|
+
|
|
110
|
+
// export type FlexSettings = Static<ReturnType<typeof flex>>;
|
|
111
|
+
|
|
112
|
+
// type GridOptions = {
|
|
113
|
+
// title?: string;
|
|
114
|
+
// defaultValue?: {
|
|
115
|
+
// gap: string;
|
|
116
|
+
// columns: number;
|
|
117
|
+
// };
|
|
118
|
+
// };
|
|
119
|
+
|
|
120
|
+
// export function grid(options: GridOptions = {}) {
|
|
121
|
+
// const { title = "Layout", defaultValue = { gap: "gap-1", columns: 2 } } = options;
|
|
122
|
+
// return prop({
|
|
123
|
+
// title,
|
|
124
|
+
// schema: Type.Object(
|
|
125
|
+
// {
|
|
126
|
+
// columns: Type.Number({
|
|
127
|
+
// title: "Columns",
|
|
128
|
+
// description: "Number of columns",
|
|
129
|
+
// "ui:group": "grid",
|
|
130
|
+
// "ui:field": "slider",
|
|
131
|
+
// default: 2,
|
|
132
|
+
// minimum: 1,
|
|
133
|
+
// maximum: 12,
|
|
134
|
+
// }),
|
|
135
|
+
// gap: Type.Optional(
|
|
136
|
+
// Type.String({
|
|
137
|
+
// title: "Gap",
|
|
138
|
+
// description:
|
|
139
|
+
// "Space between items. Can be a tailwind gap class like 'gap-1' or 'gap-2', or a custom value like '10px'",
|
|
140
|
+
// default: defaultValue.gap,
|
|
141
|
+
// // todo: make a specific field for gap
|
|
142
|
+
// // "ui:field": "enum",
|
|
143
|
+
// }),
|
|
144
|
+
// ),
|
|
145
|
+
// },
|
|
146
|
+
// {
|
|
147
|
+
// "ui:styleId": "#styles:grid",
|
|
148
|
+
// "ui:field": "grid",
|
|
149
|
+
// "ui:responsive": true,
|
|
150
|
+
// default: defaultValue,
|
|
151
|
+
// },
|
|
152
|
+
// ),
|
|
153
|
+
// });
|
|
154
|
+
// }
|
|
155
|
+
|
|
156
|
+
// export type GridSettings = Static<ReturnType<typeof grid>>;
|
|
157
|
+
|
|
158
|
+
const isFlexLayoutFilter = (manifestProps: TObject, formData: Record<string, unknown>) => {
|
|
159
|
+
const stylesProps = getStyleProperties(manifestProps);
|
|
160
|
+
const currentStyle = getStyleValueById<ContainerLayoutSettings>(
|
|
161
|
+
stylesProps,
|
|
162
|
+
formData,
|
|
163
|
+
"#styles:containerLayout",
|
|
164
|
+
);
|
|
165
|
+
return currentStyle?.type === "flex" || !currentStyle?.type;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const isGridLayoutFilter = (manifestProps: TObject, formData: Record<string, unknown>) => {
|
|
169
|
+
return !isFlexLayoutFilter(manifestProps, formData);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
type ContainerLayoutOptions = {
|
|
173
|
+
title?: string;
|
|
174
|
+
defaults?: {
|
|
175
|
+
type?: "flex" | "grid";
|
|
176
|
+
gap?: string;
|
|
177
|
+
direction?: string;
|
|
178
|
+
columns?: {
|
|
179
|
+
max?: number;
|
|
180
|
+
default?: number;
|
|
181
|
+
};
|
|
182
|
+
wrap?: boolean;
|
|
183
|
+
fillSpace?: boolean;
|
|
184
|
+
justifyContent?: string;
|
|
185
|
+
alignItems?: string;
|
|
186
|
+
};
|
|
187
|
+
options?: {
|
|
188
|
+
disableGrid?: boolean;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
function containerlayoutStyle(options: SchemaOptions = {}) {
|
|
193
|
+
return Type.Object(
|
|
194
|
+
{
|
|
195
|
+
...(!options.disableGrid
|
|
196
|
+
? {
|
|
197
|
+
type: StringEnum(["flex", "grid"], {
|
|
198
|
+
enumNames: ["Flex", "Grid"],
|
|
199
|
+
title: "Layout type",
|
|
200
|
+
description:
|
|
201
|
+
"Type of the container. Flex layout arranges items in a one-dimensional line. Grid layout arranges items in a two-dimensional grid",
|
|
202
|
+
"ui:field": "enum",
|
|
203
|
+
"ui:responsive": true,
|
|
204
|
+
}),
|
|
205
|
+
}
|
|
206
|
+
: {}),
|
|
207
|
+
|
|
208
|
+
gap: Type.Optional(
|
|
209
|
+
Type.String({
|
|
210
|
+
title: "Gap",
|
|
211
|
+
description:
|
|
212
|
+
"Space between items. Can be a tailwind gap class like 'gap-1' or 'gap-2', or a custom value like '10px'",
|
|
213
|
+
"ui:placeholder": "Not specified",
|
|
214
|
+
// todo: make a specific field for gap
|
|
215
|
+
// "ui:field": "enum",
|
|
216
|
+
}),
|
|
217
|
+
),
|
|
218
|
+
direction: optional(
|
|
219
|
+
StringEnum(["flex-row", "flex-col"], {
|
|
220
|
+
enumNames: ["Row", "Column"],
|
|
221
|
+
title: "Direction",
|
|
222
|
+
description: "The direction of the container. Only applies to flex layout",
|
|
223
|
+
metadata: {
|
|
224
|
+
filter: isFlexLayoutFilter,
|
|
225
|
+
},
|
|
226
|
+
}),
|
|
227
|
+
),
|
|
228
|
+
columns: optional(
|
|
229
|
+
Type.Number({
|
|
230
|
+
title: "Columns",
|
|
231
|
+
description: "Number of columns. Only applies to grid layout",
|
|
232
|
+
"ui:field": "slider",
|
|
233
|
+
minimum: 1,
|
|
234
|
+
maximum: 16,
|
|
235
|
+
metadata: {
|
|
236
|
+
filter: isGridLayoutFilter,
|
|
237
|
+
},
|
|
238
|
+
}),
|
|
239
|
+
),
|
|
240
|
+
wrap: optional(
|
|
241
|
+
Type.Boolean({
|
|
242
|
+
title: "Wrap",
|
|
243
|
+
description: "Wrap items.",
|
|
244
|
+
"ai:instructions": "Only applies to flex layout",
|
|
245
|
+
metadata: {
|
|
246
|
+
filter: isFlexLayoutFilter,
|
|
247
|
+
},
|
|
248
|
+
}),
|
|
249
|
+
),
|
|
250
|
+
fillSpace: optional(
|
|
251
|
+
Type.Boolean({
|
|
252
|
+
title: "Fill space",
|
|
253
|
+
description: "Makes items of the container fill the available space",
|
|
254
|
+
"ai:instructions": "Only applies to flex layout",
|
|
255
|
+
metadata: {
|
|
256
|
+
filter: isFlexLayoutFilter,
|
|
257
|
+
},
|
|
258
|
+
}),
|
|
259
|
+
),
|
|
260
|
+
justifyContent: Type.Optional(
|
|
261
|
+
StringEnum(
|
|
262
|
+
[
|
|
263
|
+
"justify-start",
|
|
264
|
+
"justify-center",
|
|
265
|
+
"justify-end",
|
|
266
|
+
"justify-between",
|
|
267
|
+
"justify-around",
|
|
268
|
+
"justify-evenly",
|
|
269
|
+
"justify-stretch",
|
|
270
|
+
],
|
|
271
|
+
{
|
|
272
|
+
enumNames: [
|
|
273
|
+
"Start",
|
|
274
|
+
"Center",
|
|
275
|
+
"End",
|
|
276
|
+
"Space between",
|
|
277
|
+
"Space around",
|
|
278
|
+
"Evenly distributed",
|
|
279
|
+
"Stretch",
|
|
280
|
+
],
|
|
281
|
+
title: "Justify",
|
|
282
|
+
description: "Justify content along the main axis (horizontal for row, vertical for column)",
|
|
283
|
+
"ai:instructions": "Only applies to flex layout",
|
|
284
|
+
metadata: {
|
|
285
|
+
filter: isFlexLayoutFilter,
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
),
|
|
289
|
+
),
|
|
290
|
+
|
|
291
|
+
alignItems: optional(
|
|
292
|
+
Type.Union(
|
|
293
|
+
[
|
|
294
|
+
Type.Literal("items-start", { title: "Start" }),
|
|
295
|
+
Type.Literal("items-center", { title: "Center" }),
|
|
296
|
+
Type.Literal("items-end", { title: "End" }),
|
|
297
|
+
Type.Literal("items-stretch", { title: "Stretch" }),
|
|
298
|
+
],
|
|
299
|
+
{
|
|
300
|
+
title: "Alignment",
|
|
301
|
+
description: "Align items along the cross axis (vertical for row, horizontal for column)",
|
|
302
|
+
"ai:instructions": "Only applies to flex layout",
|
|
303
|
+
metadata: {
|
|
304
|
+
filter: isFlexLayoutFilter,
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
),
|
|
308
|
+
),
|
|
309
|
+
},
|
|
310
|
+
{ $id: "styles:containerLayout" },
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export function containerLayout({ title = "Layout", options = {} }: ContainerLayoutOptions = {}) {
|
|
315
|
+
return group({
|
|
316
|
+
title,
|
|
317
|
+
options: {
|
|
318
|
+
"ui:styleId": "#styles:containerLayout",
|
|
319
|
+
$id: "styles:containerLayout",
|
|
320
|
+
},
|
|
321
|
+
children: containerlayoutStyle(options),
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export type ContainerLayoutSettings = Static<ReturnType<typeof containerLayout>>;
|
|
326
|
+
|
|
327
|
+
export function containerLayoutRef(options: SchemaOptions = {}) {
|
|
328
|
+
return typedRef("styles:containerLayout", {
|
|
329
|
+
title: "Container layout",
|
|
330
|
+
description: "Settings for the layout of the container",
|
|
331
|
+
options: {
|
|
332
|
+
...options,
|
|
333
|
+
disableGrid: options.disableGrid ?? false,
|
|
334
|
+
},
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export function makeContainerProps() {
|
|
339
|
+
return {
|
|
340
|
+
$childrenType: Type.Optional(
|
|
341
|
+
Type.String({
|
|
342
|
+
title: "Dynamic child brick type",
|
|
343
|
+
description: "Type of the child bricks that will be created when container is dynamic",
|
|
344
|
+
"ui:field": "brick-type",
|
|
345
|
+
metadata: {
|
|
346
|
+
category: "content",
|
|
347
|
+
},
|
|
348
|
+
}),
|
|
349
|
+
),
|
|
350
|
+
$children: Type.Array(Type.Any(), {
|
|
351
|
+
"ui:field": "hidden",
|
|
352
|
+
description: "List of nested bricks",
|
|
353
|
+
default: [],
|
|
354
|
+
}),
|
|
355
|
+
};
|
|
356
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Static, Type, type StringOptions } from "@sinclair/typebox";
|
|
2
|
+
import { prop } from "./helpers";
|
|
3
|
+
import { typedRef } from "~/shared/utils/typed-ref";
|
|
4
|
+
|
|
5
|
+
export function cssLength(options: StringOptions = {}) {
|
|
6
|
+
const units = ["px", "%", "em", "rem", "vh", "vw", "dvh", "dvw", "rlh", "lh", "cqh", "cqw"];
|
|
7
|
+
return prop({
|
|
8
|
+
title: "Length",
|
|
9
|
+
schema: Type.String({
|
|
10
|
+
$id: "styles:cssLength",
|
|
11
|
+
description: `A CSS length value. Must be a number with a unit (e.g. "10px", "50%"). The unit can be one of the following: ${units?.join(", ")}.`,
|
|
12
|
+
title: "Length",
|
|
13
|
+
default: options.default,
|
|
14
|
+
...options,
|
|
15
|
+
"ui:field": "css-length",
|
|
16
|
+
"ui:css-units": units,
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type CssLength = Static<ReturnType<typeof cssLength>>;
|
|
22
|
+
|
|
23
|
+
export function cssLengthRef(options: StringOptions = {}) {
|
|
24
|
+
return typedRef("styles:cssLength", options);
|
|
25
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Type, type Static } from "@sinclair/typebox";
|
|
2
|
+
import { prop } from "./helpers";
|
|
3
|
+
|
|
4
|
+
export function datasourceRef() {
|
|
5
|
+
return prop({
|
|
6
|
+
title: "Database",
|
|
7
|
+
description: "Reference to a data source. Only used for dynamic websites",
|
|
8
|
+
schema: Type.Object(
|
|
9
|
+
{
|
|
10
|
+
id: Type.String({
|
|
11
|
+
title: "Data Source ID",
|
|
12
|
+
}),
|
|
13
|
+
mapping: Type.Record(Type.String(), Type.String(), {
|
|
14
|
+
description: "Mapping of data source fields to brick props",
|
|
15
|
+
}),
|
|
16
|
+
filters: Type.Optional(
|
|
17
|
+
Type.Record(
|
|
18
|
+
Type.String(),
|
|
19
|
+
Type.Object({
|
|
20
|
+
op: Type.Union([
|
|
21
|
+
Type.Literal("eq"),
|
|
22
|
+
Type.Literal("ne"),
|
|
23
|
+
Type.Literal("lt"),
|
|
24
|
+
Type.Literal("lte"),
|
|
25
|
+
Type.Literal("gt"),
|
|
26
|
+
Type.Literal("gte"),
|
|
27
|
+
Type.Literal("in"),
|
|
28
|
+
Type.Literal("nin"),
|
|
29
|
+
Type.Literal("contains"),
|
|
30
|
+
Type.Literal("startsWith"),
|
|
31
|
+
Type.Literal("endsWith"),
|
|
32
|
+
]),
|
|
33
|
+
value: Type.String(),
|
|
34
|
+
}),
|
|
35
|
+
{ description: "Filter data source records" },
|
|
36
|
+
),
|
|
37
|
+
),
|
|
38
|
+
sort: Type.Optional(
|
|
39
|
+
Type.Record(
|
|
40
|
+
Type.String(),
|
|
41
|
+
Type.Union([
|
|
42
|
+
Type.Literal("asc", { title: "Ascending" }),
|
|
43
|
+
Type.Literal("desc", { title: "Descending" }),
|
|
44
|
+
]),
|
|
45
|
+
{ description: "Sort data source records" },
|
|
46
|
+
),
|
|
47
|
+
),
|
|
48
|
+
limit: Type.Optional(Type.Number({ description: "Limit the number of records to fetch" })),
|
|
49
|
+
offset: Type.Optional(Type.Number({ description: "Offset the records to fetch" })),
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"ui:field": "datasource-ref",
|
|
53
|
+
"ui:meta-type": "datasource-ref",
|
|
54
|
+
description: "Datasource reference. Only used for dynamic websites. Do not use for static websites",
|
|
55
|
+
},
|
|
56
|
+
),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type DatasourceRefSettings = Static<ReturnType<typeof datasourceRef>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Type, type StringOptions } from "@sinclair/typebox";
|
|
2
|
+
import { prop } from "./helpers";
|
|
3
|
+
|
|
4
|
+
export function date(title = "Date", options?: StringOptions) {
|
|
5
|
+
return prop({
|
|
6
|
+
title,
|
|
7
|
+
schema: Type.String({
|
|
8
|
+
format: "date",
|
|
9
|
+
"ui:field": "date",
|
|
10
|
+
...options,
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function datetime(title = "Date and Time", options?: StringOptions) {
|
|
16
|
+
return prop({
|
|
17
|
+
title,
|
|
18
|
+
schema: Type.String({
|
|
19
|
+
format: "date-time",
|
|
20
|
+
"ui:field": "datetime",
|
|
21
|
+
...options,
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { type SchemaOptions, Type, type Static } from "@sinclair/typebox";
|
|
2
|
+
import { group, optional, prop } from "./helpers";
|
|
3
|
+
import { StringEnum } from "~/shared/utils/schema";
|
|
4
|
+
import { typedRef } from "~/shared/utils/typed-ref";
|
|
5
|
+
|
|
6
|
+
type ShadowOptions = {
|
|
7
|
+
title?: string;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export function shadow({ title = "Shadow", defaultValue = "shadow-none" }: ShadowOptions = {}) {
|
|
12
|
+
return prop({
|
|
13
|
+
title,
|
|
14
|
+
schema: StringEnum(["shadow-none", "shadow-sm", "shadow-md", "shadow-lg", "shadow-xl", "shadow-2xl"], {
|
|
15
|
+
$id: "styles:shadow",
|
|
16
|
+
title,
|
|
17
|
+
default: defaultValue,
|
|
18
|
+
enumNames: ["None", "S", "M", "L", "XL", "2XL"],
|
|
19
|
+
"ui:placeholder": "Not specified",
|
|
20
|
+
"ui:field": "enum",
|
|
21
|
+
"ui:display": "select",
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type ShadowSettings = Static<ReturnType<typeof shadow>>;
|
|
27
|
+
|
|
28
|
+
export function shadowRef(options: SchemaOptions & ShadowOptions = {}) {
|
|
29
|
+
return typedRef("styles:shadow", { ...options, "ui:styleId": "#styles:shadow" });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type TextShadowOptions = {
|
|
33
|
+
title?: string;
|
|
34
|
+
defaultValue?: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export function textShadow({
|
|
38
|
+
title = "Text shadow",
|
|
39
|
+
defaultValue = "text-shadow-none",
|
|
40
|
+
}: TextShadowOptions = {}) {
|
|
41
|
+
return prop({
|
|
42
|
+
title,
|
|
43
|
+
schema: StringEnum(
|
|
44
|
+
["text-shadow-none", "text-shadow-sm", "text-shadow-md", "text-shadow-lg", "text-shadow-xl"],
|
|
45
|
+
{
|
|
46
|
+
default: defaultValue,
|
|
47
|
+
enumNames: ["None", "Small", "Medium", "Large", "Extra large"],
|
|
48
|
+
"ui:placeholder": "Not specified",
|
|
49
|
+
"ui:field": "enum",
|
|
50
|
+
},
|
|
51
|
+
),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type TextShadowSettings = Static<ReturnType<typeof textShadow>>;
|
|
56
|
+
|
|
57
|
+
type OpacityOptions = {
|
|
58
|
+
title?: string;
|
|
59
|
+
defaultValue?: number;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export function opacity({ defaultValue = 1, title = "Opacity" }: OpacityOptions = {}) {
|
|
63
|
+
return prop({
|
|
64
|
+
title,
|
|
65
|
+
schema: Type.Number({
|
|
66
|
+
minimum: 0.1,
|
|
67
|
+
maximum: 1,
|
|
68
|
+
default: defaultValue,
|
|
69
|
+
multipleOf: 0.1,
|
|
70
|
+
"ui:field": "slider",
|
|
71
|
+
"ui:unit": "%",
|
|
72
|
+
"ui:multiplier": 100,
|
|
73
|
+
}),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type OpacitySettings = Static<ReturnType<typeof opacity>>;
|
|
78
|
+
|
|
79
|
+
type EffectsOptions = {
|
|
80
|
+
title?: string;
|
|
81
|
+
defaultValue?: {
|
|
82
|
+
opacity?: number;
|
|
83
|
+
shadow?: string;
|
|
84
|
+
textShadow?: string;
|
|
85
|
+
};
|
|
86
|
+
enableTextShadow?: boolean;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// export function effects({ title = "Effects", defaultValue = {}, enableTextShadow }: EffectsOptions = {}) {
|
|
90
|
+
// return group({
|
|
91
|
+
// title,
|
|
92
|
+
// options: {
|
|
93
|
+
// default: defaultValue,
|
|
94
|
+
// $id: "styles:effects",
|
|
95
|
+
// },
|
|
96
|
+
// children: {
|
|
97
|
+
// opacity: optional(
|
|
98
|
+
// opacity({
|
|
99
|
+
// title: "Opacity",
|
|
100
|
+
// defaultValue: defaultValue.opacity,
|
|
101
|
+
// }),
|
|
102
|
+
// ),
|
|
103
|
+
// shadow: optional(
|
|
104
|
+
// shadowRef({
|
|
105
|
+
// title: "Shadow",
|
|
106
|
+
// defaultValue: defaultValue.shadow,
|
|
107
|
+
// }),
|
|
108
|
+
// ),
|
|
109
|
+
// ...(enableTextShadow && {
|
|
110
|
+
// textShadow: optional(
|
|
111
|
+
// textShadow({
|
|
112
|
+
// title: "Text shadow",
|
|
113
|
+
// defaultValue: defaultValue.textShadow,
|
|
114
|
+
// }),
|
|
115
|
+
// ),
|
|
116
|
+
// }),
|
|
117
|
+
// },
|
|
118
|
+
// });
|
|
119
|
+
// }
|
|
120
|
+
|
|
121
|
+
// export function effectsRef(options: SchemaOptions & EffectsOptions = {}) {
|
|
122
|
+
// return typedRef("styles:effects", options);
|
|
123
|
+
// }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type SchemaOptions, Type, type StringOptions } from "@sinclair/typebox";
|
|
2
|
+
import { prop } from "./helpers";
|
|
3
|
+
|
|
4
|
+
type EnumOption = {
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
value: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export function enumProp(
|
|
12
|
+
title: string,
|
|
13
|
+
defaultValue: string,
|
|
14
|
+
opts: Omit<SchemaOptions, "title" | "default"> & {
|
|
15
|
+
options: EnumOption[] | string[];
|
|
16
|
+
displayAs?: "radio" | "select" | "button-group" | "icon-group";
|
|
17
|
+
},
|
|
18
|
+
) {
|
|
19
|
+
const defaultOpts = {
|
|
20
|
+
"ui:field": "enum",
|
|
21
|
+
"ui:display": opts.displayAs || "select",
|
|
22
|
+
};
|
|
23
|
+
const { options, displayAs, ...commonOpts } = opts;
|
|
24
|
+
|
|
25
|
+
return prop({
|
|
26
|
+
title,
|
|
27
|
+
schema: Type.Union(
|
|
28
|
+
options.map((opt) =>
|
|
29
|
+
Type.Literal(typeof opt === "string" ? opt : opt.value, {
|
|
30
|
+
title: typeof opt === "string" ? opt : opt.title,
|
|
31
|
+
"ui:icon": typeof opt === "string" ? undefined : opt.icon,
|
|
32
|
+
}),
|
|
33
|
+
),
|
|
34
|
+
{
|
|
35
|
+
title,
|
|
36
|
+
default: defaultValue,
|
|
37
|
+
...defaultOpts,
|
|
38
|
+
...commonOpts,
|
|
39
|
+
},
|
|
40
|
+
),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Type, type Static } from "@sinclair/typebox";
|
|
2
|
+
import { prop } from "./helpers";
|
|
3
|
+
|
|
4
|
+
type GeolocationOptions = {
|
|
5
|
+
title?: string;
|
|
6
|
+
defaultValue?: {
|
|
7
|
+
lat: number;
|
|
8
|
+
lng: number;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function geolocation(opts: GeolocationOptions = {}) {
|
|
13
|
+
const { title = "Geolocation", defaultValue = { lat: 48.864716, lng: 2.349014 } } = opts;
|
|
14
|
+
return prop({
|
|
15
|
+
title,
|
|
16
|
+
schema: Type.Object(
|
|
17
|
+
{
|
|
18
|
+
lat: Type.Number({ minimum: -90, maximum: 90 }),
|
|
19
|
+
lng: Type.Number({ minimum: -180, maximum: 180 }),
|
|
20
|
+
label: Type.Optional(Type.String({ title: "Tooltip" })),
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"ui:field": "geo-point",
|
|
24
|
+
default: defaultValue,
|
|
25
|
+
},
|
|
26
|
+
),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type GeolocationSettings = Static<ReturnType<typeof geolocation>>;
|