@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,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper functions for defining and working with props and groups of props
|
|
3
|
+
*/
|
|
4
|
+
import { type TProperties, Type, type TSchema, type TObject, type ObjectOptions } from "@sinclair/typebox";
|
|
5
|
+
import { commonProps } from "./common";
|
|
6
|
+
import type { PartialBy, Prop, PropGroup, GroupMetadata } from "./types";
|
|
7
|
+
import { get } from "lodash-es";
|
|
8
|
+
|
|
9
|
+
function isTObject(schema: TSchema | TProperties): schema is TObject {
|
|
10
|
+
return schema.type === "object";
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function group<T extends TProperties>({
|
|
14
|
+
title,
|
|
15
|
+
children,
|
|
16
|
+
category = "settings",
|
|
17
|
+
metadata,
|
|
18
|
+
options,
|
|
19
|
+
}: PartialBy<PropGroup<T>, "category">) {
|
|
20
|
+
// check if children is already a TObject
|
|
21
|
+
if (isTObject(children)) {
|
|
22
|
+
const generated = Type.Composite([Type.Object({}), children], {
|
|
23
|
+
title,
|
|
24
|
+
metadata: {
|
|
25
|
+
category,
|
|
26
|
+
group: true,
|
|
27
|
+
...metadata,
|
|
28
|
+
},
|
|
29
|
+
...options,
|
|
30
|
+
});
|
|
31
|
+
return generated;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Create the TypeBox schema with title as a standard property and group-specific info in metadata
|
|
35
|
+
return Type.Object(children, {
|
|
36
|
+
title,
|
|
37
|
+
...options,
|
|
38
|
+
metadata: {
|
|
39
|
+
category,
|
|
40
|
+
group: true,
|
|
41
|
+
...metadata,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function prop<T extends TSchema>({ schema, ...rest }: Prop<T>): T {
|
|
47
|
+
Object.assign(schema, rest);
|
|
48
|
+
return schema;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Functions to extract metadata from schemas
|
|
52
|
+
export function getGroupInfo(schema: TSchema) {
|
|
53
|
+
const meta = schema.metadata as GroupMetadata;
|
|
54
|
+
return {
|
|
55
|
+
title: (schema.title ?? schema.metadata?.title) as string | undefined,
|
|
56
|
+
meta,
|
|
57
|
+
tab: meta.groupTab || "common",
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function defineProps<P extends TProperties>(props: P, options?: ObjectOptions) {
|
|
62
|
+
const finalProps = { ...commonProps, ...props };
|
|
63
|
+
return Type.Object(finalProps, options);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const optional = Type.Optional;
|
|
67
|
+
export const array = Type.Array;
|
|
68
|
+
|
|
69
|
+
export type PropertyPath = string;
|
|
70
|
+
export type StyleId = string;
|
|
71
|
+
|
|
72
|
+
// Helper function to traverse a schema and filter to get style properties
|
|
73
|
+
// (properties whose "ui:styleId" starts with "#styles:") and return them as an object with the path to the property
|
|
74
|
+
// as the key and the $id as the value. Paths should be dot-separated.
|
|
75
|
+
// The initial schema is a TObject, but nested schemas can be any type and arrays.
|
|
76
|
+
export function getStyleProperties(schema: TSchema, path = "", styles: Record<PropertyPath, StyleId> = {}) {
|
|
77
|
+
if (schema.type === "object") {
|
|
78
|
+
for (const key in schema.properties) {
|
|
79
|
+
const prop = schema.properties[key];
|
|
80
|
+
if (prop["ui:styleId"]) {
|
|
81
|
+
styles[`${path}${key}`] = prop["ui:styleId"];
|
|
82
|
+
}
|
|
83
|
+
getStyleProperties(prop, `${path}${key}.`, styles);
|
|
84
|
+
}
|
|
85
|
+
} else if (schema.type === "array") {
|
|
86
|
+
getStyleProperties(schema.items, `${path}[].`, styles);
|
|
87
|
+
}
|
|
88
|
+
return styles;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function getStyleValueById<T>(
|
|
92
|
+
stylePos: ReturnType<typeof getStyleProperties>,
|
|
93
|
+
formData: Record<string, unknown>,
|
|
94
|
+
id: string,
|
|
95
|
+
) {
|
|
96
|
+
for (const [stylePath, styleId] of Object.entries(stylePos)) {
|
|
97
|
+
if (styleId === id) {
|
|
98
|
+
return get(formData, stylePath) as T;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { type SchemaOptions, Type, type Static } from "@sinclair/typebox";
|
|
2
|
+
import { prop } from "./helpers";
|
|
3
|
+
import { typedRef } from "~/shared/utils/typed-ref";
|
|
4
|
+
// import { canvasDataURI } from "~/shared/utils/canvas-data-uri";
|
|
5
|
+
|
|
6
|
+
type PropImageOptions = {
|
|
7
|
+
defaultImageUrl?: string;
|
|
8
|
+
showImgSearch?: boolean;
|
|
9
|
+
noObjectOptions?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function image(title = "Image", options: PropImageOptions = {}) {
|
|
13
|
+
const { defaultImageUrl, showImgSearch = false } = options;
|
|
14
|
+
const schema = Type.Object(
|
|
15
|
+
{
|
|
16
|
+
src: Type.String({
|
|
17
|
+
default: defaultImageUrl,
|
|
18
|
+
title,
|
|
19
|
+
description: "Image URL. Can be a link to an image or a data URI",
|
|
20
|
+
}),
|
|
21
|
+
alt: Type.Optional(
|
|
22
|
+
Type.String({
|
|
23
|
+
title: "Alternate Text",
|
|
24
|
+
description: "Alternative text for the image. Recommended for screen readers and SEO",
|
|
25
|
+
"ui:placeholder": "Your image description",
|
|
26
|
+
}),
|
|
27
|
+
),
|
|
28
|
+
fit: Type.Optional(
|
|
29
|
+
Type.Union(
|
|
30
|
+
[
|
|
31
|
+
Type.Literal("object-none", { title: "None" }),
|
|
32
|
+
Type.Literal("object-contain", { title: "Contain" }),
|
|
33
|
+
Type.Literal("object-cover", { title: "Cover" }),
|
|
34
|
+
Type.Literal("object-fill", { title: "Fill" }),
|
|
35
|
+
Type.Literal("object-scale-down", { title: "Scale down" }),
|
|
36
|
+
],
|
|
37
|
+
{
|
|
38
|
+
title: "Fit",
|
|
39
|
+
description: "How the image should be resized to fit its container",
|
|
40
|
+
"ui:field": "enum",
|
|
41
|
+
"ui:styleId": "#styles:objectFit",
|
|
42
|
+
},
|
|
43
|
+
),
|
|
44
|
+
),
|
|
45
|
+
position: Type.Optional(
|
|
46
|
+
Type.Union(
|
|
47
|
+
[
|
|
48
|
+
Type.Literal("object-top", { title: "Top" }),
|
|
49
|
+
Type.Literal("object-center", { title: "Center" }),
|
|
50
|
+
Type.Literal("object-bottom", { title: "Bottom" }),
|
|
51
|
+
Type.Literal("object-left", { title: "Left" }),
|
|
52
|
+
Type.Literal("object-right", { title: "Right" }),
|
|
53
|
+
Type.Literal("object-left-top", { title: "Top left" }),
|
|
54
|
+
Type.Literal("object-right-top", { title: "Top right" }),
|
|
55
|
+
Type.Literal("object-left-bottom", { title: "Bottom left" }),
|
|
56
|
+
Type.Literal("object-right-bottom", { title: "Bottom right" }),
|
|
57
|
+
],
|
|
58
|
+
{
|
|
59
|
+
"ui:styleId": "#styles:objectPosition",
|
|
60
|
+
title: "Position",
|
|
61
|
+
description: "The position of the image inside its container",
|
|
62
|
+
"ui:field": "enum",
|
|
63
|
+
},
|
|
64
|
+
),
|
|
65
|
+
),
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
$id: "assets:image",
|
|
69
|
+
"ui:field": "image",
|
|
70
|
+
"ui:accept": "image/*",
|
|
71
|
+
"ui:show-img-search": !!showImgSearch,
|
|
72
|
+
"ui:no-object-options": !!options.noObjectOptions,
|
|
73
|
+
default: {
|
|
74
|
+
alt: "Image",
|
|
75
|
+
fit: "object-cover",
|
|
76
|
+
position: "object-center",
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
);
|
|
80
|
+
return prop({
|
|
81
|
+
title,
|
|
82
|
+
schema,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function imageRef(options: PropImageOptions & SchemaOptions = {}) {
|
|
87
|
+
return typedRef("assets:image", { ...options, styleId: "#assets:image" });
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type ImageProps = Static<ReturnType<typeof image>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Type, type NumberOptions } from "@sinclair/typebox";
|
|
2
|
+
import { prop } from "./helpers";
|
|
3
|
+
import type { FieldMetadata } from "./types";
|
|
4
|
+
|
|
5
|
+
type NumberFieldOptions = NumberOptions & FieldMetadata;
|
|
6
|
+
|
|
7
|
+
export function number(
|
|
8
|
+
title: string,
|
|
9
|
+
defaultValue?: number,
|
|
10
|
+
options: Omit<NumberFieldOptions, "default"> = {},
|
|
11
|
+
) {
|
|
12
|
+
return prop({
|
|
13
|
+
title,
|
|
14
|
+
schema: Type.Number({ default: defaultValue, ...options }),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Type, type Static } from "@sinclair/typebox";
|
|
2
|
+
import { prop } from "./helpers";
|
|
3
|
+
import { typedRef } from "~/shared/utils/typed-ref";
|
|
4
|
+
|
|
5
|
+
export function padding() {
|
|
6
|
+
return prop({
|
|
7
|
+
title: "Padding",
|
|
8
|
+
schema: Type.String({
|
|
9
|
+
$id: "styles:padding",
|
|
10
|
+
description: "Space between the content and the border",
|
|
11
|
+
"ai:instructions": "Can be a tailwind class like `p-4` or a custom value like `p-[16px]`.",
|
|
12
|
+
"ui:field": "enum",
|
|
13
|
+
"ui:responsive": true,
|
|
14
|
+
"ui:styleId": "#styles:padding",
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const paddingRef = typedRef("styles:padding");
|
|
20
|
+
|
|
21
|
+
export type PaddingSettings = Static<ReturnType<typeof padding>>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Type, type Static } from "@sinclair/typebox";
|
|
2
|
+
import { prop } from "./helpers";
|
|
3
|
+
|
|
4
|
+
export function position(defaultValue = "flowing", title = "Position") {
|
|
5
|
+
return prop({
|
|
6
|
+
title,
|
|
7
|
+
schema: Type.Union(
|
|
8
|
+
[
|
|
9
|
+
Type.Literal("flowing", { title: "Flowing" }),
|
|
10
|
+
Type.Literal("fixed", { title: "Fixed" }),
|
|
11
|
+
Type.Literal("sticky", { title: "Sticky" }),
|
|
12
|
+
],
|
|
13
|
+
{ default: defaultValue, "ui:styleId": "#styles:position" },
|
|
14
|
+
),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type PositionSettings = Static<ReturnType<typeof position>>;
|
|
19
|
+
|
|
20
|
+
export function fixedPositioned(defaultValue = false, title = "Fixed position") {
|
|
21
|
+
return prop({
|
|
22
|
+
title,
|
|
23
|
+
schema: Type.Boolean({ default: defaultValue, "ui:styleId": "#styles:fixedPositioned" }),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type FixedPositionedSettings = Static<ReturnType<typeof fixedPositioned>>;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Type, type Static } from "@sinclair/typebox";
|
|
2
|
+
import { typedRef } from "~/shared/utils/typed-ref";
|
|
3
|
+
|
|
4
|
+
export function preset(defaultValue?: string) {
|
|
5
|
+
return Type.Union(
|
|
6
|
+
[
|
|
7
|
+
Type.Literal("surface-1", {
|
|
8
|
+
title: "Surface 1",
|
|
9
|
+
description: "Surface elevation 1, light background with dark text.",
|
|
10
|
+
}),
|
|
11
|
+
Type.Literal("surface-2", {
|
|
12
|
+
title: "Surface 2",
|
|
13
|
+
description: "Surface elevation 2, slightly darker background with dark text.",
|
|
14
|
+
}),
|
|
15
|
+
Type.Literal("surface-3", {
|
|
16
|
+
title: "Surface 3",
|
|
17
|
+
description: "Surface elevation 3, even darker background with dark text.",
|
|
18
|
+
}),
|
|
19
|
+
Type.Literal("prominent-primary", {
|
|
20
|
+
title: "Prominent Primary",
|
|
21
|
+
description: "Prominent display on primary-700 background.",
|
|
22
|
+
}),
|
|
23
|
+
Type.Literal("prominent-secondary", {
|
|
24
|
+
title: "Prominent Secondary",
|
|
25
|
+
description: "Prominent display on secondary-700 background.",
|
|
26
|
+
}),
|
|
27
|
+
Type.Literal("prominent-accent", {
|
|
28
|
+
title: "Prominent Accent",
|
|
29
|
+
description: "Prominent display on accent-700 background.",
|
|
30
|
+
}),
|
|
31
|
+
Type.Literal("medium-primary", {
|
|
32
|
+
title: "Medium Primary",
|
|
33
|
+
description: "Filled display on primary-200 background.",
|
|
34
|
+
}),
|
|
35
|
+
Type.Literal("medium-secondary", {
|
|
36
|
+
title: "Medium Secondary",
|
|
37
|
+
description: "Medium display on secondary-200 background.",
|
|
38
|
+
}),
|
|
39
|
+
Type.Literal("medium-accent", {
|
|
40
|
+
title: "Medium Accent",
|
|
41
|
+
description: "Medium display on accent-200 background.",
|
|
42
|
+
}),
|
|
43
|
+
Type.Literal("subtle-primary", {
|
|
44
|
+
title: "Subtle Primary",
|
|
45
|
+
description: "Subtle display on primary-100 background and 1px border.",
|
|
46
|
+
}),
|
|
47
|
+
Type.Literal("subtle-secondary", {
|
|
48
|
+
title: "Subtle Secondary",
|
|
49
|
+
description: "Subtle display on secondary-100 background and 1px border.",
|
|
50
|
+
}),
|
|
51
|
+
Type.Literal("subtle-accent", {
|
|
52
|
+
title: "Subtle Accent",
|
|
53
|
+
description: "Subtle display on accent-100 background and 1px border.",
|
|
54
|
+
}),
|
|
55
|
+
Type.Literal("preset-none", {
|
|
56
|
+
title: "None",
|
|
57
|
+
description:
|
|
58
|
+
"No background and no border. Useful for bricks inside a card or a container that already have a surface/background.",
|
|
59
|
+
}),
|
|
60
|
+
],
|
|
61
|
+
{
|
|
62
|
+
$id: "styles:preset",
|
|
63
|
+
title: "Preset",
|
|
64
|
+
description: "Styles presets are used to maintain styles consistency across the application.",
|
|
65
|
+
default: defaultValue ?? "preset-none",
|
|
66
|
+
},
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type Preset = Static<ReturnType<typeof preset>>;
|
|
71
|
+
|
|
72
|
+
export const presetRef = typedRef("styles:preset");
|
|
73
|
+
|
|
74
|
+
export const presetsStyleProps = {
|
|
75
|
+
"surface-1": {
|
|
76
|
+
"#styles:backgroundColor": "bg-base-100",
|
|
77
|
+
"#styles:color": "text-base-100",
|
|
78
|
+
"#styles:border": { color: "border-base-100" },
|
|
79
|
+
},
|
|
80
|
+
"surface-2": {
|
|
81
|
+
"#styles:backgroundColor": "bg-base-200",
|
|
82
|
+
"#styles:color": "text-base-200",
|
|
83
|
+
"#styles:border": { color: "border-base-200" },
|
|
84
|
+
},
|
|
85
|
+
"surface-3": {
|
|
86
|
+
"#styles:backgroundColor": "bg-base-300",
|
|
87
|
+
"#styles:color": "text-base-300",
|
|
88
|
+
"#styles:border": { color: "border-base-300" },
|
|
89
|
+
},
|
|
90
|
+
"prominent-primary": {
|
|
91
|
+
"#styles:backgroundColor": "bg-primary-700",
|
|
92
|
+
"#styles:color": "text-primary",
|
|
93
|
+
"#styles:border": { color: "border-primary-800" },
|
|
94
|
+
},
|
|
95
|
+
"prominent-secondary": {
|
|
96
|
+
"#styles:backgroundColor": "bg-secondary-700",
|
|
97
|
+
"#styles:color": "text-secondary",
|
|
98
|
+
"#styles:border": { color: "border-secondary-800" },
|
|
99
|
+
},
|
|
100
|
+
"prominent-accent": {
|
|
101
|
+
"#styles:backgroundColor": "bg-accent-700",
|
|
102
|
+
"#styles:color": "text-accent",
|
|
103
|
+
"#styles:border": { color: "border-accent-800" },
|
|
104
|
+
},
|
|
105
|
+
"medium-primary": {
|
|
106
|
+
"#styles:backgroundColor": "bg-primary-200",
|
|
107
|
+
"#styles:color": "text-primary-800",
|
|
108
|
+
"#styles:border": { color: "border-primary-300" },
|
|
109
|
+
},
|
|
110
|
+
"medium-secondary": {
|
|
111
|
+
"#styles:backgroundColor": "bg-secondary-200",
|
|
112
|
+
"#styles:color": "text-secondary-800",
|
|
113
|
+
"#styles:border": { color: "border-secondary-300" },
|
|
114
|
+
},
|
|
115
|
+
"medium-accent": {
|
|
116
|
+
"#styles:backgroundColor": "bg-accent-200",
|
|
117
|
+
"#styles:color": "text-accent-800",
|
|
118
|
+
"#styles:border": { color: "border-accent-300" },
|
|
119
|
+
},
|
|
120
|
+
"subtle-primary": {
|
|
121
|
+
"#styles:backgroundColor": "bg-primary-100",
|
|
122
|
+
"#styles:color": "text-primary-800",
|
|
123
|
+
"#styles:border": { color: "border-primary-100" },
|
|
124
|
+
},
|
|
125
|
+
"subtle-secondary": {
|
|
126
|
+
"#styles:backgroundColor": "bg-secondary-100",
|
|
127
|
+
"#styles:color": "text-secondary-800",
|
|
128
|
+
"#styles:border": { color: "border-secondary-100" },
|
|
129
|
+
},
|
|
130
|
+
"subtle-accent": {
|
|
131
|
+
"#styles:backgroundColor": "bg-accent-100",
|
|
132
|
+
"#styles:color": "text-accent-800",
|
|
133
|
+
"#styles:border": { color: "border-accent-100" },
|
|
134
|
+
},
|
|
135
|
+
"preset-none": {},
|
|
136
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type Static, Type, type StringOptions } from "@sinclair/typebox";
|
|
2
|
+
import { prop } from "./helpers";
|
|
3
|
+
import type { jsonStringsSupportedFormats } from "../../ajv";
|
|
4
|
+
import type { FieldMetadata } from "./types";
|
|
5
|
+
import { typedRef } from "~/shared/utils/typed-ref";
|
|
6
|
+
|
|
7
|
+
type StrFieldOptions = StringOptions &
|
|
8
|
+
FieldMetadata & {
|
|
9
|
+
format?: (typeof jsonStringsSupportedFormats)[number];
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function string(title: string, defaultValue?: string, options: Omit<StrFieldOptions, "default"> = {}) {
|
|
13
|
+
return prop({
|
|
14
|
+
title,
|
|
15
|
+
schema: Type.String({ default: defaultValue, ...options }),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function url(title = "URL", defaultValue?: string) {
|
|
20
|
+
return prop({
|
|
21
|
+
title,
|
|
22
|
+
schema: Type.String({
|
|
23
|
+
format: "uri",
|
|
24
|
+
"ui:field": "url",
|
|
25
|
+
default: defaultValue,
|
|
26
|
+
}),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const pageIdSchema = Type.String({
|
|
31
|
+
"ui:field": "page-id",
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export function urlOrPageId(title = "URL or Page ID", defaultValue?: string) {
|
|
35
|
+
return prop({
|
|
36
|
+
title,
|
|
37
|
+
schema: Type.Union(
|
|
38
|
+
[
|
|
39
|
+
Type.String({
|
|
40
|
+
format: "uri",
|
|
41
|
+
}),
|
|
42
|
+
pageIdSchema,
|
|
43
|
+
],
|
|
44
|
+
{
|
|
45
|
+
$id: "content:urlOrPageId",
|
|
46
|
+
default: defaultValue,
|
|
47
|
+
title: "URL or Page ID",
|
|
48
|
+
"ui:field": "url-page-id",
|
|
49
|
+
"ai:instructions":
|
|
50
|
+
"This field can be a URL or a page ID. Use the page ID when linking to a internal page, and a URL for external links.",
|
|
51
|
+
},
|
|
52
|
+
),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type UrlOrPageIdSettings = Static<ReturnType<typeof urlOrPageId>>;
|
|
57
|
+
|
|
58
|
+
export function urlOrPageIdRef(options: { title?: string; default?: string } = {}) {
|
|
59
|
+
return typedRef("content:urlOrPageId", { ...options });
|
|
60
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { basicAlign } from "../align";
|
|
3
|
+
|
|
4
|
+
describe("Align prop test suite", () => {
|
|
5
|
+
describe("basicAlign", () => {
|
|
6
|
+
it("should have the correct title with default options", () => {
|
|
7
|
+
expect(basicAlign().title).toBe("Align");
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it("should have the correct title with custom options", () => {
|
|
11
|
+
expect(basicAlign({ title: "Custom Align" }).title).toBe("Custom Align");
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("should have correct UI metadata", () => {
|
|
15
|
+
const schema = basicAlign();
|
|
16
|
+
expect(schema["ui:field"]).toBe("align-basic");
|
|
17
|
+
expect(schema["ui:responsive"]).toBe(true);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("should have correct default values", () => {
|
|
21
|
+
const schema = basicAlign();
|
|
22
|
+
expect(schema.default).toEqual({
|
|
23
|
+
horizontal: "justify-start",
|
|
24
|
+
vertical: "items-center",
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("should accept custom default values", () => {
|
|
29
|
+
const customDefault = {
|
|
30
|
+
horizontal: "justify-center",
|
|
31
|
+
vertical: "items-start",
|
|
32
|
+
};
|
|
33
|
+
const schema = basicAlign({ defaultValue: customDefault });
|
|
34
|
+
expect(schema.default).toEqual(customDefault);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { background, backgroundRef, backgroundColor } from "../background";
|
|
3
|
+
|
|
4
|
+
describe("Background prop test suite", () => {
|
|
5
|
+
describe("background", () => {
|
|
6
|
+
it("should have the correct title", () => {
|
|
7
|
+
expect(background().title).toBe("Background");
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it("should have correct schema structure", () => {
|
|
11
|
+
const schema = background();
|
|
12
|
+
expect(schema.type).toBe("object");
|
|
13
|
+
expect(schema).toHaveProperty("properties.color");
|
|
14
|
+
expect(schema).toHaveProperty("properties.image");
|
|
15
|
+
expect(schema).toHaveProperty("properties.size");
|
|
16
|
+
expect(schema).toHaveProperty("properties.repeat");
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("should have correct UI metadata", () => {
|
|
20
|
+
const schema = background();
|
|
21
|
+
expect(schema["ui:field"]).toBe("background");
|
|
22
|
+
expect(schema["ui:group"]).toBe("background");
|
|
23
|
+
expect(schema["ui:group:title"]).toBe("Background");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("should accept custom default values", () => {
|
|
27
|
+
const customBg = background({
|
|
28
|
+
defaultValue: {
|
|
29
|
+
color: "#000000",
|
|
30
|
+
size: "cover",
|
|
31
|
+
repeat: "repeat",
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
expect(customBg.default).toEqual({
|
|
35
|
+
color: "#000000",
|
|
36
|
+
size: "cover",
|
|
37
|
+
repeat: "repeat",
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("should accept custom title", () => {
|
|
42
|
+
const customBg = background({ title: "Custom Title" });
|
|
43
|
+
expect(customBg.title).toBe("Custom Title");
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
describe("color property", () => {
|
|
47
|
+
it("should have correct metadata", () => {
|
|
48
|
+
const colorProp = background().properties.color;
|
|
49
|
+
expect(colorProp.title).toBe("Color");
|
|
50
|
+
expect(colorProp.type).toBe("string");
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
describe("image property", () => {
|
|
55
|
+
it("should have correct metadata", () => {
|
|
56
|
+
const imageProp = background().properties.image;
|
|
57
|
+
expect(imageProp.title).toBe("Image");
|
|
58
|
+
expect(imageProp.type).toBe("string");
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
describe("size property", () => {
|
|
63
|
+
it("should have correct metadata", () => {
|
|
64
|
+
const sizeProp = background().properties.size;
|
|
65
|
+
expect(sizeProp.default).toBe("auto");
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
describe("repeat property", () => {
|
|
70
|
+
it("should have correct metadata", () => {
|
|
71
|
+
const repeatProp = background().properties.repeat;
|
|
72
|
+
expect(repeatProp.default).toBe("no-repeat");
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
describe("backgroundColor", () => {
|
|
78
|
+
it("should have the correct title", () => {
|
|
79
|
+
expect(backgroundColor().title).toBe("Background color");
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it("should accept custom title", () => {
|
|
83
|
+
expect(backgroundColor("red", "Custom Title").title).toBe("Custom Title");
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("should have correct schema structure", () => {
|
|
87
|
+
const schema = backgroundColor();
|
|
88
|
+
expect(schema.type).toBe("string");
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it("should have correct UI metadata", () => {
|
|
92
|
+
const schema = backgroundColor();
|
|
93
|
+
expect(schema["ui:field"]).toBe("color");
|
|
94
|
+
expect(schema["ui:color-type"]).toBe("background");
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it("should have correct default value", () => {
|
|
98
|
+
expect(backgroundColor().default).toBeUndefined();
|
|
99
|
+
expect(backgroundColor("red").default).toBe("red");
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { border } from "../border";
|
|
3
|
+
|
|
4
|
+
describe("Border prop test suite", () => {
|
|
5
|
+
const borderSchema = border();
|
|
6
|
+
|
|
7
|
+
describe("propBorder", () => {
|
|
8
|
+
it("should have the correct title", () => {
|
|
9
|
+
expect(border().title).toBe("Border");
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
describe("border schema", () => {
|
|
14
|
+
describe("border.style", () => {
|
|
15
|
+
it("should have correct metadata", () => {
|
|
16
|
+
const styleProp = borderSchema.properties.style;
|
|
17
|
+
expect(styleProp.description).toBe("The brick border style");
|
|
18
|
+
expect(styleProp["ui:field"]).toBe("enum");
|
|
19
|
+
expect(styleProp["ui:display"]).toBe("button-group");
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
describe("border.color", () => {
|
|
24
|
+
it("should have correct metadata", () => {
|
|
25
|
+
const colorProp = borderSchema.properties.color;
|
|
26
|
+
expect(colorProp["ui:field"]).toBe("color");
|
|
27
|
+
expect(colorProp["ui:color-type"]).toBe("border");
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe("border.width", () => {
|
|
32
|
+
it("should have correct metadata", () => {
|
|
33
|
+
const widthProp = borderSchema.properties.width;
|
|
34
|
+
expect(widthProp["ui:field"]).toBe("enum");
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { opacity, shadow, textShadow } from "../effects";
|
|
3
|
+
|
|
4
|
+
describe("Effects props test suite", () => {
|
|
5
|
+
describe("opacity", () => {
|
|
6
|
+
it("should have correct title and default value", () => {
|
|
7
|
+
const prop = opacity();
|
|
8
|
+
expect(prop.title).toBe("Opacity");
|
|
9
|
+
expect(prop.default).toBe(1);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("should allow for custom default value", () => {
|
|
13
|
+
const prop = opacity({ defaultValue: 0.5 });
|
|
14
|
+
expect(prop.default).toBe(0.5);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("should have correct UI metadata", () => {
|
|
18
|
+
const prop = opacity();
|
|
19
|
+
expect(prop["ui:field"]).toBe("slider");
|
|
20
|
+
expect(prop.minimum).toBe(0.1);
|
|
21
|
+
expect(prop.maximum).toBe(1);
|
|
22
|
+
expect(prop.multipleOf).toBe(0.1);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe("textShadow", () => {
|
|
27
|
+
it("should have correct title", () => {
|
|
28
|
+
const prop = textShadow();
|
|
29
|
+
expect(prop.title).toBe("Text shadow");
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("should have correct UI metadata", () => {
|
|
33
|
+
const schema = textShadow();
|
|
34
|
+
expect(schema["ui:field"]).toBe("enum");
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
});
|