@upstart.gg/sdk 0.0.104 → 0.0.106
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/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.js +1 -1
- package/dist/shared/brick-manifest.js +1 -1
- package/dist/shared/bricks/manifests/accordion.manifest.js +1 -1
- package/dist/shared/bricks/manifests/all-manifests.js +1 -1
- package/dist/shared/bricks/manifests/button.manifest.js +1 -1
- package/dist/shared/bricks/manifests/card.manifest.js +1 -1
- package/dist/shared/bricks/manifests/carousel.manifest.js +1 -1
- package/dist/shared/bricks/manifests/container.manifest.js +1 -1
- package/dist/shared/bricks/manifests/divider.manifest.js +1 -1
- package/dist/shared/bricks/manifests/footer.manifest.d.ts +1 -1
- 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.js +1 -1
- package/dist/shared/bricks/manifests/hero.manifest.js +1 -1
- package/dist/shared/bricks/manifests/icon.manifest.js +1 -1
- package/dist/shared/bricks/manifests/image.manifest.js +1 -1
- package/dist/shared/bricks/manifests/images-gallery.manifest.js +1 -1
- package/dist/shared/bricks/manifests/map.manifest.js +1 -1
- package/dist/shared/bricks/manifests/navbar.manifest.js +1 -1
- package/dist/shared/bricks/manifests/sidebar.manifest.js +1 -1
- package/dist/shared/bricks/manifests/social-links.manifest.js +1 -1
- package/dist/shared/bricks/manifests/testimonials.manifest.js +1 -1
- package/dist/shared/bricks/manifests/text.manifest.js +1 -1
- package/dist/shared/bricks/manifests/timeline.manifest.js +1 -1
- package/dist/shared/bricks/manifests/video.manifest.js +1 -1
- 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/container.js +1 -1
- package/dist/shared/bricks/props/effects.js +1 -1
- package/dist/shared/bricks.d.ts.map +1 -1
- package/dist/shared/bricks.js +1 -1
- package/dist/shared/{chunk-TCZBR3ZU.js → chunk-2DI5SIVV.js} +1 -1
- package/dist/shared/{chunk-O22VV7YR.js → chunk-33FU4KGU.js} +1 -1
- package/dist/shared/{chunk-WCNVFVDK.js → chunk-3ZGRY444.js} +1 -1
- package/dist/shared/{chunk-CUCUHPQ7.js → chunk-6OKXZL6R.js} +1 -1
- package/dist/shared/chunk-7E67XSKP.js +3 -0
- package/dist/shared/{chunk-LJQXN32B.js → chunk-AMGHA7QH.js} +1 -1
- package/dist/shared/{chunk-QALNFBY7.js → chunk-DC5DWF7B.js} +1 -1
- package/dist/shared/{chunk-I43NIQ2K.js → chunk-DY2YCYZ6.js} +1 -1
- package/dist/shared/{chunk-CEXHD4BO.js → chunk-E4UAVLKC.js} +2 -2
- package/dist/shared/{chunk-ZFTWLZ3G.js → chunk-EHH677K5.js} +1 -1
- package/dist/shared/{chunk-POYVTV5F.js → chunk-FD3KX2U7.js} +1 -1
- package/dist/shared/chunk-G3JO5DM5.js +3 -0
- package/dist/shared/{chunk-I5S2MPPR.js → chunk-H7OYUKBW.js} +1 -1
- package/dist/shared/{chunk-ATVHWZSA.js → chunk-HBM4DPIW.js} +1 -1
- package/dist/shared/chunk-HIBTEX2T.js +3 -0
- package/dist/shared/{chunk-E2EBTWJI.js → chunk-I3HSLGFA.js} +1 -1
- package/dist/shared/{chunk-UISES3HA.js → chunk-IXJX7EQ3.js} +1 -1
- package/dist/shared/{chunk-5IEGQ7YT.js → chunk-JAAPJQNK.js} +1 -1
- package/dist/shared/{chunk-UK6H3FDX.js → chunk-JDBVMPSI.js} +1 -1
- package/dist/shared/{chunk-F6MLW6DO.js → chunk-JH3NRO6M.js} +1 -1
- package/dist/shared/{chunk-ZNVRYEO7.js → chunk-L3TKLJKK.js} +1 -1
- package/dist/shared/{chunk-TEPFFY32.js → chunk-LOFXGDAK.js} +1 -1
- package/dist/shared/chunk-O3FJP65T.js +3 -0
- package/dist/shared/{chunk-7L3UOEMR.js → chunk-PX7QSNLO.js} +1 -1
- package/dist/shared/{chunk-22KRCQK5.js → chunk-U76JDFWJ.js} +1 -1
- package/dist/shared/{chunk-CW5FWW5W.js → chunk-UYZP24VV.js} +1 -1
- package/dist/shared/chunk-X42WBJTN.js +3 -0
- package/dist/shared/{chunk-OQIFFJ7I.js → chunk-XB3X4P3I.js} +1 -1
- package/dist/shared/chunk-XDCGA4WT.js +3 -0
- package/dist/shared/chunk-YGHBFXR6.js +3 -0
- package/dist/shared/{chunk-WEQRYCPD.js → chunk-ZWYLKIBI.js} +1 -1
- package/dist/shared/datasources/external/rss/fetcher.d.ts +1 -1
- package/dist/shared/datasources/external/rss/fetcher.d.ts.map +1 -1
- package/dist/shared/images.js +1 -1
- package/dist/shared/page.js +1 -1
- package/dist/shared/responsive.js +1 -1
- package/dist/shared/site.js +1 -1
- package/dist/shared/sitemap.js +1 -1
- package/dist/shared/theme.js +1 -1
- package/dist/shared/utils/schema.d.ts +6 -8
- package/dist/shared/utils/schema.d.ts.map +1 -1
- package/dist/shared/utils/schema.js +1 -1
- package/package.json +5 -9
- package/dist/shared/chunk-F63ANNAK.js +0 -3
- package/dist/shared/chunk-GPKRRX3D.js +0 -3
- package/dist/shared/chunk-HQQYIKTE.js +0 -3
- package/dist/shared/chunk-JFDOR3UH.js +0 -3
- package/dist/shared/chunk-OD2PRCLH.js +0 -3
- package/dist/shared/chunk-PK6UAFPW.js +0 -3
- package/dist/shared/chunk-VDHLON5R.js +0 -3
- package/src/node/cli/api.ts +0 -101
- package/src/node/cli/commands/cmd-build.ts +0 -64
- package/src/node/cli/commands/login/cmd-login.ts +0 -111
- package/src/node/cli/commands/logout/cmd-logout.ts +0 -11
- package/src/node/cli/commands/publish/cmd-publish.ts +0 -135
- package/src/node/cli/commands/publish/parse-gitignore.ts +0 -278
- package/src/node/cli/commands/publish/uploader.ts +0 -333
- package/src/node/cli/constants.ts +0 -14
- package/src/node/cli/is-logged-in.ts +0 -28
- package/src/node/cli/program.ts +0 -77
- package/src/node/cli/store.ts +0 -64
- package/src/node/cli/tests/api.test.ts +0 -161
- package/src/node/cli/types.ts +0 -34
- package/src/node/cli/utils.ts +0 -20
- package/src/node/shared/config.ts +0 -69
- package/src/node/shared/logger.ts +0 -44
- package/src/shared/ajv.ts +0 -103
- package/src/shared/analytics/init.ts +0 -14
- package/src/shared/analytics/track.ts +0 -21
- package/src/shared/analytics/types.ts +0 -13
- package/src/shared/attributes.ts +0 -211
- package/src/shared/brick-manifest.ts +0 -110
- package/src/shared/bricks/manifests/accordion.manifest.ts +0 -179
- package/src/shared/bricks/manifests/all-manifests.ts +0 -92
- package/src/shared/bricks/manifests/button.manifest.ts +0 -145
- package/src/shared/bricks/manifests/card.manifest.ts +0 -269
- package/src/shared/bricks/manifests/carousel.manifest.ts +0 -106
- package/src/shared/bricks/manifests/container.manifest.ts +0 -357
- package/src/shared/bricks/manifests/divider.manifest.ts +0 -121
- package/src/shared/bricks/manifests/footer.manifest.ts +0 -487
- package/src/shared/bricks/manifests/form.manifest.ts +0 -112
- package/src/shared/bricks/manifests/hero.manifest.ts +0 -132
- package/src/shared/bricks/manifests/icon.manifest.ts +0 -130
- package/src/shared/bricks/manifests/image.manifest.ts +0 -203
- package/src/shared/bricks/manifests/images-gallery.manifest.ts +0 -227
- package/src/shared/bricks/manifests/map.manifest.ts +0 -75
- package/src/shared/bricks/manifests/navbar.manifest.ts +0 -344
- package/src/shared/bricks/manifests/sidebar.manifest.ts +0 -90
- package/src/shared/bricks/manifests/social-links.manifest.ts +0 -370
- package/src/shared/bricks/manifests/testimonials.manifest.ts +0 -397
- package/src/shared/bricks/manifests/tests/header.manifest.test.ts +0 -10
- package/src/shared/bricks/manifests/text.manifest.ts +0 -164
- package/src/shared/bricks/manifests/timeline.manifest.ts +0 -456
- package/src/shared/bricks/manifests/video.manifest.ts +0 -59
- package/src/shared/bricks/props/_style-presets.ts +0 -352
- package/src/shared/bricks/props/align.ts +0 -59
- package/src/shared/bricks/props/background.ts +0 -118
- package/src/shared/bricks/props/boolean.ts +0 -11
- package/src/shared/bricks/props/border.ts +0 -84
- package/src/shared/bricks/props/color.ts +0 -24
- package/src/shared/bricks/props/common.ts +0 -37
- package/src/shared/bricks/props/container.ts +0 -356
- package/src/shared/bricks/props/css-length.ts +0 -25
- package/src/shared/bricks/props/datasource.ts +0 -60
- package/src/shared/bricks/props/date.ts +0 -24
- package/src/shared/bricks/props/effects.ts +0 -123
- package/src/shared/bricks/props/enum.ts +0 -42
- package/src/shared/bricks/props/file.ts +0 -12
- package/src/shared/bricks/props/geolocation.ts +0 -30
- package/src/shared/bricks/props/helpers.ts +0 -101
- package/src/shared/bricks/props/image.ts +0 -90
- package/src/shared/bricks/props/number.ts +0 -16
- package/src/shared/bricks/props/padding.ts +0 -21
- package/src/shared/bricks/props/position.ts +0 -27
- package/src/shared/bricks/props/preset.ts +0 -136
- package/src/shared/bricks/props/string.ts +0 -56
- package/src/shared/bricks/props/tests/align.test.ts +0 -37
- package/src/shared/bricks/props/tests/background.test.ts +0 -102
- package/src/shared/bricks/props/tests/border.test.ts +0 -38
- package/src/shared/bricks/props/tests/effects.test.ts +0 -37
- package/src/shared/bricks/props/tests/helpers.test.ts +0 -133
- package/src/shared/bricks/props/tests/image.test.ts +0 -71
- package/src/shared/bricks/props/tests/padding.ts +0 -12
- package/src/shared/bricks/props/tests/string.test.ts +0 -79
- package/src/shared/bricks/props/text.ts +0 -66
- package/src/shared/bricks/props/types.ts +0 -57
- package/src/shared/bricks.ts +0 -232
- package/src/shared/context.ts +0 -39
- package/src/shared/datarecords/external/airtable/handler.ts +0 -21
- package/src/shared/datarecords/external/airtable/options.ts +0 -22
- package/src/shared/datarecords/external/generic-webhook/handler.ts +0 -10
- package/src/shared/datarecords/external/generic-webhook/options.ts +0 -13
- package/src/shared/datarecords/external/google/oauth/config.ts +0 -30
- package/src/shared/datarecords/external/google/sheets/handler.ts +0 -26
- package/src/shared/datarecords/external/google/sheets/options.ts +0 -9
- package/src/shared/datarecords/types.ts +0 -120
- package/src/shared/datarecords.ts +0 -5
- package/src/shared/datasources/README.md +0 -3
- package/src/shared/datasources/external/facebook/posts/fetcher.ts +0 -52
- package/src/shared/datasources/external/facebook/posts/sample.ts +0 -35
- package/src/shared/datasources/external/facebook/posts/schema.ts +0 -33
- package/src/shared/datasources/external/facebook/posts/tests/fetcher.test.ts +0 -73
- package/src/shared/datasources/external/http-json/fetcher.ts +0 -28
- package/src/shared/datasources/external/http-json/options.ts +0 -12
- package/src/shared/datasources/external/http-json/schema.ts +0 -6
- package/src/shared/datasources/external/http-json/tests/fetcher.test.ts +0 -70
- package/src/shared/datasources/external/instagram/feed/fetcher.ts +0 -33
- package/src/shared/datasources/external/instagram/feed/sample.ts +0 -22
- package/src/shared/datasources/external/instagram/feed/schema.ts +0 -23
- package/src/shared/datasources/external/instagram/feed/tests/fetcher.test.ts +0 -64
- package/src/shared/datasources/external/mastodon/account/fetcher.ts +0 -24
- package/src/shared/datasources/external/mastodon/account/sample.ts +0 -33
- package/src/shared/datasources/external/mastodon/account/schema.ts +0 -45
- package/src/shared/datasources/external/mastodon/account/tests/fetcher.test.ts +0 -47
- package/src/shared/datasources/external/mastodon/options.ts +0 -11
- package/src/shared/datasources/external/mastodon/status/fetcher.ts +0 -35
- package/src/shared/datasources/external/mastodon/status/sample.array.ts +0 -59
- package/src/shared/datasources/external/mastodon/status/sample.single.ts +0 -55
- package/src/shared/datasources/external/mastodon/status/schema.ts +0 -130
- package/src/shared/datasources/external/mastodon/status/tests/fetcher.test.ts +0 -74
- package/src/shared/datasources/external/meta/oauth/config.ts +0 -16
- package/src/shared/datasources/external/meta/options.ts +0 -11
- package/src/shared/datasources/external/rss/fetcher.ts +0 -29
- package/src/shared/datasources/external/rss/options.ts +0 -11
- package/src/shared/datasources/external/rss/sample.ts +0 -22
- package/src/shared/datasources/external/rss/schema.ts +0 -42
- package/src/shared/datasources/external/threads/media/fetcher.ts +0 -53
- package/src/shared/datasources/external/threads/media/sample.ts +0 -44
- package/src/shared/datasources/external/threads/media/schema.ts +0 -37
- package/src/shared/datasources/external/tiktok/oauth/config.ts +0 -17
- package/src/shared/datasources/external/tiktok/video/fetcher.ts +0 -39
- package/src/shared/datasources/external/tiktok/video/options.ts +0 -12
- package/src/shared/datasources/external/tiktok/video/sample.ts +0 -26
- package/src/shared/datasources/external/tiktok/video/schema.ts +0 -27
- package/src/shared/datasources/external/youtube/list/fetcher.ts +0 -37
- package/src/shared/datasources/external/youtube/list/options.ts +0 -15
- package/src/shared/datasources/external/youtube/list/sample.ts +0 -33
- package/src/shared/datasources/external/youtube/list/schema.ts +0 -38
- package/src/shared/datasources/external/youtube/oauth/config.ts +0 -15
- package/src/shared/datasources/fetcher.ts +0 -17
- package/src/shared/datasources/internal/blog/schema.ts +0 -69
- package/src/shared/datasources/internal/changelog/schema.ts +0 -48
- package/src/shared/datasources/internal/contact-info/schema.ts +0 -20
- package/src/shared/datasources/internal/cv/schema.ts +0 -217
- package/src/shared/datasources/internal/faq/schema.ts +0 -27
- package/src/shared/datasources/internal/job-board/schema.ts +0 -228
- package/src/shared/datasources/internal/links/schema.ts +0 -15
- package/src/shared/datasources/internal/recipes/schema.ts +0 -42
- package/src/shared/datasources/internal/restaurant/schema.ts +0 -225
- package/src/shared/datasources/provider-options.ts +0 -7
- package/src/shared/datasources/samples.ts +0 -26
- package/src/shared/datasources/schemas.ts +0 -45
- package/src/shared/datasources/types.ts +0 -276
- package/src/shared/datasources/utils.ts +0 -16
- package/src/shared/datasources.ts +0 -42
- package/src/shared/env.ts +0 -23
- package/src/shared/errors.ts +0 -1
- package/src/shared/images.ts +0 -44
- package/src/shared/index.ts +0 -3
- package/src/shared/layout-constants.ts +0 -25
- package/src/shared/manifest.ts +0 -50
- package/src/shared/oauth.ts +0 -16
- package/src/shared/page.ts +0 -61
- package/src/shared/prompt.ts +0 -9
- package/src/shared/responsive.ts +0 -5
- package/src/shared/site.ts +0 -97
- package/src/shared/sitemap.ts +0 -66
- package/src/shared/social-icons.ts +0 -307
- package/src/shared/tests/attributes.test.ts +0 -37
- package/src/shared/theme.ts +0 -245
- package/src/shared/themes/README.md +0 -34
- package/src/shared/themes/color-system.ts +0 -127
- package/src/shared/utils/canvas-data-uri.ts +0 -2
- package/src/shared/utils/invariant.ts +0 -25
- package/src/shared/utils/json-date.ts +0 -8
- package/src/shared/utils/merge.ts +0 -12
- package/src/shared/utils/object-hash.ts +0 -7
- package/src/shared/utils/schema.ts +0 -35
- package/src/shared/utils/try-catch.ts +0 -12
- package/src/shared/utils/typed-ref.ts +0 -41
package/package.json
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@upstart.gg/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.106",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
|
-
"dist"
|
|
7
|
-
"env.d.ts",
|
|
8
|
-
"src"
|
|
6
|
+
"dist"
|
|
9
7
|
],
|
|
10
8
|
"sideEffects": true,
|
|
11
9
|
"exports": {
|
|
@@ -34,6 +32,7 @@
|
|
|
34
32
|
"@radix-ui/react-context-menu": "2.2.2",
|
|
35
33
|
"@radix-ui/react-toggle-group": "1.1.0",
|
|
36
34
|
"@radix-ui/themes": "3.1.4",
|
|
35
|
+
"@rowanmanning/feed-parser": "2.1.0",
|
|
37
36
|
"@sinclair/typebox": "0.33.7",
|
|
38
37
|
"ajv": "8.17.1",
|
|
39
38
|
"ajv-formats": "3.0.1",
|
|
@@ -46,10 +45,8 @@
|
|
|
46
45
|
"fast-glob": "3.3.2",
|
|
47
46
|
"form-data": "4.0.0",
|
|
48
47
|
"get-port": "7.1.0",
|
|
49
|
-
"htmlparser2": "9.1.0",
|
|
50
48
|
"http-errors-enhanced": "2.0.8",
|
|
51
49
|
"immer": "10.1.1",
|
|
52
|
-
"import-meta-resolve": "4.1.0",
|
|
53
50
|
"json-schema-default": "1.0.2",
|
|
54
51
|
"lodash-es": "4.17.21",
|
|
55
52
|
"nanoid": "5.0.7",
|
|
@@ -59,14 +56,13 @@
|
|
|
59
56
|
"react-hotkeys-hook": "4.5.1",
|
|
60
57
|
"react-icons": "5.3.0",
|
|
61
58
|
"react-selecto": "1.26.3",
|
|
62
|
-
"rollup-plugin-strip-banner": "3.1.0",
|
|
63
59
|
"usehooks-ts": "3.1.0",
|
|
64
60
|
"zundo": "2.3.0",
|
|
65
61
|
"zustand": "4.5.5",
|
|
66
|
-
"@upstart.gg/style-system": "0.0.
|
|
62
|
+
"@upstart.gg/style-system": "0.0.106"
|
|
67
63
|
},
|
|
68
64
|
"peerDependencies": {
|
|
69
|
-
"@headlessui/react": "2.2.1",
|
|
65
|
+
"@headlessui/react": "^2.2.1",
|
|
70
66
|
"react": "18.3.0-canary-3d9b20132-20240124",
|
|
71
67
|
"react-dom": "18.3.0-canary-3d9b20132-20240124"
|
|
72
68
|
},
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
|
-
|
|
3
|
-
import{b as a}from"./chunk-OD2PRCLH.js";import{a as s,e as i,g as c,h as u}from"./chunk-BJSO43AS.js";import{a as l}from"./chunk-OYIL5SCU.js";import{Type as t}from"@sinclair/typebox";var n=(e,o)=>{let p=c(e),r=u(p,o,"#styles:containerLayout");return r?.type==="flex"||!r?.type},y=(e,o)=>!n(e,o);function d(e={}){return t.Object({...e.disableGrid?{}:{type:a(["flex","grid"],{enumNames:["Flex","Grid"],title:"Layout type",description:"Type of the container. Flex layout arranges items in a one-dimensional line. Grid layout arranges items in a two-dimensional grid","ui:field":"enum","ui:responsive":!0})},gap:t.Optional(t.String({title:"Gap",description:"Space between items. Can be a tailwind gap class like 'gap-1' or 'gap-2', or a custom value like '10px'","ui:placeholder":"Not specified"})),direction:i(a(["flex-row","flex-col"],{enumNames:["Row","Column"],title:"Direction",description:"The direction of the container. Only applies to flex layout",metadata:{filter:n}})),columns:i(t.Number({title:"Columns",description:"Number of columns. Only applies to grid layout","ui:field":"slider",minimum:1,maximum:16,metadata:{filter:y}})),wrap:i(t.Boolean({title:"Wrap",description:"Wrap items.","ai:instructions":"Only applies to flex layout",metadata:{filter:n}})),fillSpace:i(t.Boolean({title:"Fill space",description:"Makes items of the container fill the available space","ai:instructions":"Only applies to flex layout",metadata:{filter:n}})),justifyContent:t.Optional(a(["justify-start","justify-center","justify-end","justify-between","justify-around","justify-evenly","justify-stretch"],{enumNames:["Start","Center","End","Space between","Space around","Evenly distributed","Stretch"],title:"Justify",description:"Justify content along the main axis (horizontal for row, vertical for column)","ai:instructions":"Only applies to flex layout",metadata:{filter:n}})),alignItems:i(t.Union([t.Literal("items-start",{title:"Start"}),t.Literal("items-center",{title:"Center"}),t.Literal("items-end",{title:"End"}),t.Literal("items-stretch",{title:"Stretch"})],{title:"Alignment",description:"Align items along the cross axis (vertical for row, horizontal for column)","ai:instructions":"Only applies to flex layout",metadata:{filter:n}}))},{$id:"styles:containerLayout"})}function S({title:e="Layout",options:o={}}={}){return s({title:e,options:{"ui:styleId":"#styles:containerLayout",$id:"styles:containerLayout"},children:d(o)})}function x(e={}){return l("styles:containerLayout",{title:"Container layout",description:"Settings for the layout of the container",options:{...e,disableGrid:e.disableGrid??!1}})}function L(){return{$childrenType:t.Optional(t.String({title:"Dynamic child brick type",description:"Type of the child bricks that will be created when container is dynamic","ui:field":"brick-type",metadata:{category:"content"}})),$children:t.Array(t.Any(),{"ui:field":"hidden",description:"List of nested bricks",default:[]})}}export{S as a,x as b,L as c};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
|
-
|
|
3
|
-
import{b as f}from"./chunk-U5XOIYSS.js";import{a as b}from"./chunk-CUCUHPQ7.js";import{a as u}from"./chunk-OUI2VDNM.js";import{c}from"./chunk-VBWC36L2.js";import{b as p}from"./chunk-PK6UAFPW.js";import{b as d}from"./chunk-VTFWVTPI.js";import{b as s}from"./chunk-WEQRYCPD.js";import{b as a}from"./chunk-CAVNF3BU.js";import{a as m}from"./chunk-ATDJCXC2.js";import{a as g,d as i}from"./chunk-YJTGZQEV.js";import{d as l}from"./chunk-HYVQXAK5.js";import{a as e,b as t,d as n,e as o}from"./chunk-BJSO43AS.js";import{Type as r}from"@sinclair/typebox";import{VscLayoutPanelOff as h}from"react-icons/vsc";var v=r.Array(r.Object({href:i(),label:r.String()}),{default:[{href:"#",label:"Link 1"},{href:"#",label:"Link 2"},{href:"#",label:"Link 3"}]}),V=b({type:"navbar",kind:"widget",name:"Navbar",description:"A navigation bar with logo and navigation",aiInstructions:"This brick should be used on most sites/pages.",datasource:v,duplicatable:!1,defaultHeight:{desktop:3,mobile:3},maxHeight:{desktop:3,mobile:3},minHeight:{desktop:3,mobile:3},icon:h,iconClassName:"rotate-180",props:n({container:o(e({title:"Main element",children:{backgroundColor:o(l()),border:o(s),shadow:o(p()),fixedPositioned:o(f())},metadata:{"ui:responsive":!0}})),brand:e({title:"Brand",children:{name:o(c({title:"Brand name",default:"Acme Inc.",disableSizing:!0})),logo:o(d({title:"Logo",noObjectOptions:!0})),hideText:o(m("Hide text")),color:o(a())}}),navigation:e({title:"Links",children:{position:t({title:"Position",schema:r.Union([r.Literal("left",{title:"Left"}),r.Literal("center",{title:"Center"}),r.Literal("right",{title:"Right"})],{default:"right"})}),color:o(a()),datasource:o(u()),staticItems:o(t({title:"Nav items",schema:r.Array(r.Object({urlOrPageId:i(),label:o(g("Label"))}),{title:"Navigation items",default:[]})}))}})})}),z=[{description:"Corporate navbar with logo and right-aligned navigation",type:"navbar",props:{preset:"prominent-primary",container:{},brand:{name:"TechCorp Solutions",logo:{src:"https://via.placeholder.com/120x40.png?text=TechCorp",alt:"TechCorp Solutions logo"},color:"#1f2937"},navigation:{position:"right",color:"#374151",staticItems:[{urlOrPageId:"/services"},{urlOrPageId:"/about"},{urlOrPageId:"/portfolio"},{urlOrPageId:"/contact"}]}}},{description:"Dark theme navbar with centered navigation",type:"navbar",props:{container:{backgroundColor:"#1f2937",shadow:"shadow-lg"},brand:{name:"Creative Studio",logo:{src:"https://via.placeholder.com/100x35.png?text=Studio",alt:"Creative Studio logo"},color:"#ffffff"},navigation:{position:"center",color:"#d1d5db",staticItems:[{urlOrPageId:"/work"},{urlOrPageId:"/services"},{urlOrPageId:"/team"},{urlOrPageId:"/blog"}]}}},{description:"SaaS platform navbar with fixed positioning",type:"navbar",props:{container:{backgroundColor:"#3b82f6",fixedPositioned:!0,shadow:"shadow-md"},brand:{name:"CloudFlow",logo:{src:"https://via.placeholder.com/110x38.png?text=CloudFlow",alt:"CloudFlow platform logo"},color:"#ffffff"},navigation:{position:"right",color:"#f1f5f9",staticItems:[{urlOrPageId:"/features"},{urlOrPageId:"/pricing"},{urlOrPageId:"/docs"},{urlOrPageId:"/login"}]}}},{description:"E-commerce navbar",type:"navbar",props:{preset:"prominent-primary",brand:{name:"ShopEasy",logo:{src:"https://via.placeholder.com/130x45.png?text=ShopEasy",alt:"ShopEasy store logo"}},navigation:{position:"right",staticItems:[{urlOrPageId:"/products"},{urlOrPageId:"/categories"},{urlOrPageId:"/deals"},{urlOrPageId:"/account"},{urlOrPageId:"/cart"}]}}},{description:"Agency navbar with logo-only brand",type:"navbar",props:{container:{shadow:"shadow-sm"},brand:{logo:{src:"https://via.placeholder.com/140x50.png?text=Agency+Logo",alt:"Digital agency logo"},hideText:!0},navigation:{position:"right",color:"#64748b",staticItems:[{urlOrPageId:"/projects"},{urlOrPageId:"/capabilities"},{urlOrPageId:"/insights"},{urlOrPageId:"/contact"}]}}},{description:"Restaurant navbar with warm styling",type:"navbar",props:{container:{backgroundColor:"#7c2d12",shadow:"shadow-lg"},brand:{name:"Bella Vista",logo:{src:"https://via.placeholder.com/80x50.png?text=BV",alt:"Bella Vista restaurant logo"},color:"#fed7aa"},navigation:{position:"center",color:"#fdba74",staticItems:[{urlOrPageId:"/menu"},{urlOrPageId:"/reservations"},{urlOrPageId:"/events"},{urlOrPageId:"/location"}]}}},{description:"Portfolio navbar with left-aligned navigation",type:"navbar",props:{preset:"prominent-secondary",container:{backgroundColor:"#f1f5f9",border:{sides:["border-b"],color:"border-accent"}},brand:{name:"Alex Martinez",color:"#334155"},navigation:{position:"left",color:"#64748b",staticItems:[{urlOrPageId:"/work"},{urlOrPageId:"/about"},{urlOrPageId:"/experience"},{urlOrPageId:"/contact"}]}}},{description:"Non-profit navbar with mission-focused design",type:"navbar",props:{preset:"prominent-primary",container:{shadow:"shadow-md"},brand:{name:"Green Future",logo:{src:"https://via.placeholder.com/100x40.png?text=GF",alt:"Green Future organization logo"},color:"#d1fae5"},navigation:{position:"right",color:"#a7f3d0",staticItems:[{urlOrPageId:"/mission"},{urlOrPageId:"/programs"},{urlOrPageId:"/volunteer"},{urlOrPageId:"/donate"}]}}}];export{v as a,V as b,z as c};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
|
-
|
|
3
|
-
import{b as r}from"./chunk-JFDOR3UH.js";import{b as l}from"./chunk-WEQRYCPD.js";import{b as a}from"./chunk-F63ANNAK.js";import{b as p}from"./chunk-OD2PRCLH.js";import{b as o}from"./chunk-ALFOZHAH.js";import{a as c}from"./chunk-G7LX3UKQ.js";import{b as s}from"./chunk-HYVQXAK5.js";import{b as n}from"./chunk-ZMDHKAWL.js";import{Type as t}from"@sinclair/typebox";import{customAlphabet as h}from"nanoid";import{merge as u}from"lodash-es";var R=h("1234567890azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN",7),z=t.Object({left:t.Optional(t.String({title:"top",description:"The left position in css unit."})),top:t.Optional(t.String({title:"top",description:"The top position in css unit."})),right:t.Optional(t.String({title:"right",description:"The right position in css unit."})),bottom:t.Optional(t.String({title:"bottom",description:"The bottom position in css unit."})),inset:t.Optional(t.String({title:"inset",description:"The inset position in css unit."})),translateX:t.Optional(t.String({title:"translateX",description:"The translateX position in css unit."})),translateY:t.Optional(t.String({title:"translateY",description:"The translateY position in css unit."})),rotate:t.Optional(t.String({title:"rotate",description:"The rotate position in css unit."}))}),f=p(Object.keys(r),{title:"Brick type"}),g=t.Object({id:t.String({title:"ID",description:"A unique identifier for the brick."}),type:f,props:t.Any({title:"Props",description:"The props of the brick. The available props depends on the brick type."}),mobileProps:t.Optional(t.Object({},{additionalProperties:!0,description:"The props for mobile, merged with the default props"}))},{$id:"brick",additionalProperties:!0}),d=t.Object({layout:t.Optional(a({options:{disableGrid:!0},defaults:{gap:"gap-4",wrap:!0,fillSpace:!1,alignItems:"items-stretch",justifyContent:"justify-stretch"}})),background:t.Optional(s()),preset:t.Optional(n),border:t.Optional(l),minHeight:t.Optional(o({title:"Minimum height",default:"0px",description:"The min height of the section"})),maxWidth:t.Optional(c("Maximum width","max-w-full",{options:[{value:"max-w-screen-lg",title:"Medium",description:"Common for text-heavy content/blog posts"},{value:"max-w-screen-xl",title:"Large",description:"Usefull or some landing pages"},{value:"max-w-screen-2xl",title:"Extra large",description:"Common width"},{value:"max-w-full",title:"Full width",description:"Takes the entire space"}],description:"The maximum width of the section. Desktop only",displayAs:"select"})),horizontalPadding:t.Optional(o({title:"Horizontal padding",default:"20px",description:"Horizontal padding. Desktop only"})),verticalPadding:t.Optional(o({title:"Vertical padding",default:"20px",description:"Vertical padding."})),lastTouched:t.Optional(t.Number({description:"Do not use this field. It is used internally by the editor.","ui:field":"hidden"}))},{additionalProperties:!0,"ai:instructions":"Do not use the border prop"}),L=t.Object({id:t.String({description:"The unique ID of the section. Use a human readable url-safe slug"}),label:t.Optional(t.String({description:"The label (name) of the section. Used for editor purposes only."})),order:t.Number({description:"Determines section order in the page (lower numbers appear first). 0-based"}),props:d,mobileProps:t.Optional(t.Partial(d,{additionalProperties:!1})),bricks:t.Array(g)},{$id:"section",description:"Sections are direct children of the page that are stacked vertically, but they always align their children horizontally (flex-row)."});function $(e){return e.map(i=>({...i,bricks:i.bricks.map(m)}))}function m(e){let i=r[e.type];return{...e,props:u({},i.props,{...e.props,...e.props.$children?{$children:e.props.$children.map(m)}:{}})}}export{R as a,f as b,g as c,d,L as e,$ as f,m as g};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
|
-
|
|
3
|
-
import{a as k,b as J}from"./chunk-22KRCQK5.js";import{a as p,b as D}from"./chunk-5IEGQ7YT.js";import{a as s,b as B}from"./chunk-WCNVFVDK.js";import{b as n,c as j}from"./chunk-I5S2MPPR.js";import{a as o,b as W}from"./chunk-POYVTV5F.js";import{b as l,c as w}from"./chunk-GPKRRX3D.js";import{a as d,b as G}from"./chunk-CEXHD4BO.js";import{a as E,b as F}from"./chunk-QALNFBY7.js";import{a as u,b as I}from"./chunk-LJQXN32B.js";import{a as m,b as R}from"./chunk-TCZBR3ZU.js";import{a as r,b as L}from"./chunk-E2EBTWJI.js";import{a as y,b as q}from"./chunk-CW5FWW5W.js";import{b as i,c as h}from"./chunk-TEPFFY32.js";import{a as g,b as H}from"./chunk-I43NIQ2K.js";import{a as x,b as z}from"./chunk-VDHLON5R.js";import{a as f,b as P}from"./chunk-ZFTWLZ3G.js";import{a,b as v}from"./chunk-O22VV7YR.js";import{a as M,b as C}from"./chunk-OQIFFJ7I.js";import{a as t,b}from"./chunk-F6MLW6DO.js";import{a as c,b as A}from"./chunk-7L3UOEMR.js";import{b as e}from"./chunk-CUCUHPQ7.js";var oe={[m.type]:m,[a.type]:a,[s.type]:s,[p.type]:p,[r.type]:r,[o.type]:o,[f.type]:f,[d.type]:d,[n.type]:n,[y.type]:y,[l.type]:l,[x.type]:x,[c.type]:c,[M.type]:M,[E.type]:E,[i.type]:i,[g.type]:g,[u.type]:u,[k.type]:k,[t.type]:t},fe={[m.type]:e(m),[a.type]:e(a),[s.type]:e(s),[p.type]:e(p),[r.type]:e(r),[d.type]:e(d),[o.type]:e(o),[f.type]:e(f),[n.type]:e(n),[y.type]:e(y),[l.type]:e(l),[x.type]:e(x),[c.type]:e(c),[M.type]:e(M),[E.type]:e(E),[i.type]:e(i),[g.type]:e(g),[u.type]:e(u),[k.type]:e(k),[t.type]:e(t)},ne={[m.type]:R,[a.type]:v,[s.type]:B,[p.type]:D,[r.type]:L,[o.type]:W,[f.type]:P,[d.type]:G,[n.type]:j,[y.type]:q,[l.type]:w,[x.type]:z,[c.type]:A,[M.type]:C,[E.type]:F,[i.type]:h,[g.type]:H,[u.type]:I,[k.type]:J,[t.type]:b};export{oe as a,fe as b,ne as c};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
|
-
|
|
3
|
-
import{Type as o}from"@sinclair/typebox";import{jsonDefault as i}from"json-schema-default";function p(e){return JSON.parse(JSON.stringify(e))}var u=(e,t={})=>o.Unsafe({type:"string",enum:e,...t});function S(e){if(!("enum"in e)||!("enumNames"in e))throw new Error("Schema does not contain enum or enumNames properties");let{enum:t,enumNames:n}=e;return t.map((r,m)=>({const:r,title:n?n[m]:r}))}function c(e){return i(e)}export{p as a,u as b,S as c,c as d};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
|
-
|
|
3
|
-
import{b as a}from"./chunk-OD2PRCLH.js";import{b as o}from"./chunk-BJSO43AS.js";import{a as i}from"./chunk-OYIL5SCU.js";import{Type as s}from"@sinclair/typebox";function h({title:t="Shadow",defaultValue:e="shadow-none"}={}){return o({title:t,schema:a(["shadow-none","shadow-sm","shadow-md","shadow-lg","shadow-xl","shadow-2xl"],{$id:"styles:shadow",title:t,default:e,enumNames:["None","S","M","L","XL","2XL"],"ui:placeholder":"Not specified","ui:field":"enum","ui:display":"select"})})}function m(t={}){return i("styles:shadow",{...t,"ui:styleId":"#styles:shadow"})}function w({title:t="Text shadow",defaultValue:e="text-shadow-none"}={}){return o({title:t,schema:a(["text-shadow-none","text-shadow-sm","text-shadow-md","text-shadow-lg","text-shadow-xl"],{default:e,enumNames:["None","Small","Medium","Large","Extra large"],"ui:placeholder":"Not specified","ui:field":"enum"})})}function y({defaultValue:t=1,title:e="Opacity"}={}){return o({title:e,schema:s.Number({minimum:.1,maximum:1,default:t,multipleOf:.1,"ui:field":"slider","ui:unit":"%","ui:multiplier":100})})}export{h as a,m as b,w as c,y as d};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
|
-
|
|
3
|
-
import{a as c}from"./chunk-CUCUHPQ7.js";import{a as i}from"./chunk-UL7L3HYV.js";import{b as s}from"./chunk-VTFWVTPI.js";import{a as l,d as u}from"./chunk-YJTGZQEV.js";import{d as n}from"./chunk-HYVQXAK5.js";import{d as r,e,f as o}from"./chunk-BJSO43AS.js";import{Type as t}from"@sinclair/typebox";import{VscLayoutPanelOff as a}from"react-icons/vsc";var S=c({type:"footer",kind:"widget",name:"Footer",description:"A footer with links and an optional logo",icon:a,props:r({variants:t.Array(t.Union([t.Literal("logo-left",{title:"Logo on the left",description:"Logo on the left"}),t.Literal("logo-right",{title:"Logo on the right",description:"Logo on the right"}),t.Literal("logo-center",{title:"Logo on the center",description:"Logo at center"}),t.Literal("multiple-rows",{title:"Span on multiple rows.",description:"Span on multiple rows. Use when there a a lot of links sections"})],{title:"Variant",description:"Footer variants."})),backgroundColor:e(n()),logo:e(s({title:"Logo"})),linksSections:o(t.Object({sectionTitle:l("Links Section title"),row:e(i("Row",0,{description:"Row number of the section"})),links:o(t.Object({title:l("Title"),url:u(),column:e(i("Column",1))}))}))})}),w=[{description:"Simple footer with logo on the left",type:"footer",props:{variants:["logo-left"],backgroundColor:"#f8f9fa",logo:{src:"https://via.placeholder.com/120x40.png?text=Logo",alt:"Company logo"},linksSections:[{sectionTitle:"Quick Links",links:[{title:"Home",url:"/"},{title:"About",url:"/about"},{title:"Contact",url:"/contact"}]},{sectionTitle:"Legal",links:[{title:"Privacy Policy",url:"/privacy"},{title:"Terms of Service",url:"/terms"}]}]}},{description:"Corporate footer with centered logo",type:"footer",props:{variants:["logo-center"],backgroundColor:"#2c3e50",logo:{src:"https://via.placeholder.com/150x50.png?text=Corporate",alt:"Corporate logo"},linksSections:[{sectionTitle:"Products",links:[{title:"Software Solutions",url:"/products/software"},{title:"Consulting",url:"/products/consulting"},{title:"Support",url:"/products/support"},{title:"Training",url:"/products/training"}]},{sectionTitle:"Company",links:[{title:"About Us",url:"/about"},{title:"Careers",url:"/careers"},{title:"News",url:"/news"},{title:"Investors",url:"/investors"}]},{sectionTitle:"Resources",links:[{title:"Documentation",url:"/docs"},{title:"API Reference",url:"/api"},{title:"Community",url:"/community"},{title:"Blog",url:"/blog"}]}]}},{description:"E-commerce footer with logo on the right",type:"footer",props:{variants:["logo-right"],backgroundColor:"#ffffff",logo:{src:"https://via.placeholder.com/140x45.png?text=Shop",alt:"Shop logo"},linksSections:[{sectionTitle:"Shop",links:[{title:"All Products",url:"/products"},{title:"New Arrivals",url:"/new"},{title:"Sale",url:"/sale"},{title:"Gift Cards",url:"/gift-cards"}]},{sectionTitle:"Customer Service",links:[{title:"Help Center",url:"/help"},{title:"Returns",url:"/returns"},{title:"Shipping Info",url:"/shipping"},{title:"Size Guide",url:"/size-guide"}]},{sectionTitle:"Account",links:[{title:"My Account",url:"/account"},{title:"Order History",url:"/orders"},{title:"Wishlist",url:"/wishlist"}]}]}},{description:"Large organization footer with multiple rows",type:"footer",props:{variants:["logo-center","multiple-rows"],backgroundColor:"#1a1a1a",logo:{src:"https://via.placeholder.com/180x60.png?text=Enterprise",alt:"Enterprise logo"},linksSections:[{sectionTitle:"Products & Services",row:0,links:[{title:"Cloud Solutions",url:"/cloud",column:1},{title:"Data Analytics",url:"/analytics",column:1},{title:"AI & Machine Learning",url:"/ai",column:1},{title:"Cybersecurity",url:"/security",column:2},{title:"DevOps Tools",url:"/devops",column:2},{title:"IoT Platform",url:"/iot",column:2}]},{sectionTitle:"Industries",row:0,links:[{title:"Healthcare",url:"/industries/healthcare",column:3},{title:"Finance",url:"/industries/finance",column:3},{title:"Retail",url:"/industries/retail",column:3},{title:"Manufacturing",url:"/industries/manufacturing",column:4},{title:"Education",url:"/industries/education",column:4},{title:"Government",url:"/industries/government",column:4}]},{sectionTitle:"Resources",row:1,links:[{title:"Documentation",url:"/docs",column:1},{title:"API Reference",url:"/api",column:1},{title:"Tutorials",url:"/tutorials",column:1},{title:"Webinars",url:"/webinars",column:2},{title:"White Papers",url:"/whitepapers",column:2},{title:"Case Studies",url:"/case-studies",column:2}]},{sectionTitle:"Support & Community",row:1,links:[{title:"Help Center",url:"/help",column:3},{title:"Community Forum",url:"/forum",column:3},{title:"Contact Support",url:"/support",column:3},{title:"Service Status",url:"/status",column:4},{title:"Partner Portal",url:"/partners",column:4},{title:"Developer Hub",url:"/developers",column:4}]}]}},{description:"Startup footer with minimal links and left logo",type:"footer",props:{variants:["logo-left"],backgroundColor:"#f5f5f5",logo:{src:"https://via.placeholder.com/100x35.png?text=Startup",alt:"Startup logo"},linksSections:[{sectionTitle:"Company",links:[{title:"About",url:"/about"},{title:"Team",url:"/team"},{title:"Jobs",url:"/jobs"}]},{sectionTitle:"Product",links:[{title:"Features",url:"/features"},{title:"Pricing",url:"/pricing"},{title:"Demo",url:"/demo"}]},{sectionTitle:"Support",links:[{title:"Help",url:"/help"},{title:"Contact",url:"/contact"}]}]}},{description:"Agency footer with centered logo and creative sections",type:"footer",props:{variants:["logo-center"],backgroundColor:"#6366f1",logo:{src:"https://via.placeholder.com/130x45.png?text=Agency",alt:"Creative agency logo"},linksSections:[{sectionTitle:"Services",links:[{title:"Web Design",url:"/services/web-design"},{title:"Branding",url:"/services/branding"},{title:"Digital Marketing",url:"/services/marketing"},{title:"Photography",url:"/services/photography"}]},{sectionTitle:"Portfolio",links:[{title:"Recent Work",url:"/portfolio"},{title:"Case Studies",url:"/case-studies"},{title:"Client Reviews",url:"/reviews"}]},{sectionTitle:"Connect",links:[{title:"Contact Us",url:"/contact"},{title:"Get Quote",url:"/quote"},{title:"Newsletter",url:"/newsletter"}]}]}},{description:"SaaS platform footer with comprehensive links",type:"footer",props:{variants:["logo-left","multiple-rows"],backgroundColor:"#0f172a",logo:{src:"https://via.placeholder.com/160x50.png?text=SaaS+Platform",alt:"SaaS platform logo"},linksSections:[{sectionTitle:"Platform",row:0,links:[{title:"Dashboard",url:"/dashboard",column:1},{title:"Analytics",url:"/analytics",column:1},{title:"Integrations",url:"/integrations",column:1},{title:"API",url:"/api",column:1}]},{sectionTitle:"Solutions",row:0,links:[{title:"For Startups",url:"/solutions/startups",column:2},{title:"For Enterprise",url:"/solutions/enterprise",column:2},{title:"For Agencies",url:"/solutions/agencies",column:2},{title:"For Developers",url:"/solutions/developers",column:2}]},{sectionTitle:"Resources",row:1,links:[{title:"Blog",url:"/blog",column:1},{title:"Documentation",url:"/docs",column:1},{title:"Help Center",url:"/help",column:1},{title:"Community",url:"/community",column:1}]},{sectionTitle:"Company",row:1,links:[{title:"About Us",url:"/about",column:2},{title:"Careers",url:"/careers",column:2},{title:"Press",url:"/press",column:2},{title:"Legal",url:"/legal",column:2}]}]}},{description:"Non-profit footer with mission-focused links",type:"footer",props:{variants:["logo-center"],backgroundColor:"#059669",logo:{src:"https://via.placeholder.com/140x50.png?text=Non+Profit",alt:"Non-profit organization logo"},linksSections:[{sectionTitle:"Our Work",links:[{title:"Programs",url:"/programs"},{title:"Impact",url:"/impact"},{title:"Success Stories",url:"/stories"},{title:"Research",url:"/research"}]},{sectionTitle:"Get Involved",links:[{title:"Donate",url:"/donate"},{title:"Volunteer",url:"/volunteer"},{title:"Events",url:"/events"},{title:"Partner with Us",url:"/partnerships"}]},{sectionTitle:"About",links:[{title:"Our Mission",url:"/mission"},{title:"Leadership",url:"/leadership"},{title:"Annual Reports",url:"/reports"},{title:"Contact",url:"/contact"}]}]}},{description:"Tech blog footer with right-aligned logo",type:"footer",props:{variants:["logo-right"],backgroundColor:"#111827",logo:{src:"https://via.placeholder.com/120x40.png?text=Tech+Blog",alt:"Tech blog logo"},linksSections:[{sectionTitle:"Categories",links:[{title:"Web Development",url:"/category/web-dev"},{title:"AI & ML",url:"/category/ai-ml"},{title:"DevOps",url:"/category/devops"},{title:"Mobile",url:"/category/mobile"}]},{sectionTitle:"Popular",links:[{title:"Latest Posts",url:"/latest"},{title:"Trending",url:"/trending"},{title:"Best of 2024",url:"/best-2024"},{title:"Tutorials",url:"/tutorials"}]},{sectionTitle:"Community",links:[{title:"Newsletter",url:"/newsletter"},{title:"Discord",url:"/discord"},{title:"Contributors",url:"/contributors"},{title:"Write for Us",url:"/write"}]}]}},{description:"Restaurant footer with location and menu links",type:"footer",props:{variants:["logo-center"],backgroundColor:"#7c2d12",logo:{src:"https://via.placeholder.com/150x60.png?text=Restaurant",alt:"Restaurant logo"},linksSections:[{sectionTitle:"Menu",links:[{title:"Appetizers",url:"/menu/appetizers"},{title:"Main Courses",url:"/menu/mains"},{title:"Desserts",url:"/menu/desserts"},{title:"Beverages",url:"/menu/drinks"}]},{sectionTitle:"Services",links:[{title:"Reservations",url:"/reservations"},{title:"Catering",url:"/catering"},{title:"Private Events",url:"/events"},{title:"Gift Cards",url:"/gift-cards"}]},{sectionTitle:"Info",links:[{title:"About Us",url:"/about"},{title:"Location",url:"/location"},{title:"Hours",url:"/hours"},{title:"Contact",url:"/contact"}]}]}}];export{S as a,w as b};
|
package/src/node/cli/api.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { logger } from "../shared/logger";
|
|
2
|
-
import { API_BASE_URL } from "./constants";
|
|
3
|
-
import { accessStore } from "./store";
|
|
4
|
-
|
|
5
|
-
type SuccessResponseWrapper<T> = {
|
|
6
|
-
isSuccess: true;
|
|
7
|
-
isError: false;
|
|
8
|
-
status: number;
|
|
9
|
-
statusText: string;
|
|
10
|
-
data: T;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
type ErrorResponseWrapper<E> = {
|
|
14
|
-
isSuccess: false;
|
|
15
|
-
isError: true;
|
|
16
|
-
status: number;
|
|
17
|
-
statusText: string;
|
|
18
|
-
data: E;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
type ResponseWrapper<T, E> = SuccessResponseWrapper<T> | ErrorResponseWrapper<E>;
|
|
22
|
-
|
|
23
|
-
type CommonResponseType = {
|
|
24
|
-
success: boolean;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
*
|
|
29
|
-
* @param pathOrUrl
|
|
30
|
-
* @param data
|
|
31
|
-
* @returns
|
|
32
|
-
*/
|
|
33
|
-
export async function post<
|
|
34
|
-
ResponseType extends CommonResponseType = CommonResponseType,
|
|
35
|
-
ErrorType = { error: string; error_description?: string },
|
|
36
|
-
>(path: string, data: Record<string, unknown> | URLSearchParams, headers: Record<string, string> = {}) {
|
|
37
|
-
if (accessStore.get("access_token")) {
|
|
38
|
-
headers.Authorization = `Bearer ${accessStore.get("access_token")}`;
|
|
39
|
-
}
|
|
40
|
-
const response = await fetch(toURL(path), {
|
|
41
|
-
method: "POST",
|
|
42
|
-
headers: {
|
|
43
|
-
"Content-Type":
|
|
44
|
-
data instanceof URLSearchParams ? "application/x-www-form-urlencoded" : "application/json",
|
|
45
|
-
...headers,
|
|
46
|
-
},
|
|
47
|
-
body: data instanceof URLSearchParams ? data : JSON.stringify(data),
|
|
48
|
-
}).catch((error) => {
|
|
49
|
-
logger.error(`Fatal Error requesting API: ${error.message} (${error.cause.code})`);
|
|
50
|
-
logger.error(`Please check your internet connection and try again, or retry later.`);
|
|
51
|
-
process.exit(1);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
return formatResponse<ResponseType, ErrorType>(response);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export async function get<ResponseType = unknown, ErrorType = { error: string; error_description?: string }>(
|
|
58
|
-
path: string,
|
|
59
|
-
headers: Record<string, string> = {},
|
|
60
|
-
) {
|
|
61
|
-
if (accessStore.get("access_token")) {
|
|
62
|
-
headers.Authorization = `Bearer ${accessStore.get("access_token")}`;
|
|
63
|
-
}
|
|
64
|
-
const response = await fetch(toURL(path), { headers, method: "GET" }).catch((error) => {
|
|
65
|
-
logger.error(`Fatal Error requesting API: ${error.message} (${error.cause.code})`);
|
|
66
|
-
logger.error(`Please check your internet connection and try again, or retry later.`);
|
|
67
|
-
process.exit(1);
|
|
68
|
-
});
|
|
69
|
-
return formatResponse<ResponseType, ErrorType>(response);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function toURL(path: string) {
|
|
73
|
-
const apiBaseURL = new URL(API_BASE_URL.endsWith("/") ? API_BASE_URL : `${API_BASE_URL}/`);
|
|
74
|
-
return new URL(path, apiBaseURL);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async function formatResponse<SuccessType, ErrorType>(
|
|
78
|
-
response: Response,
|
|
79
|
-
): Promise<ResponseWrapper<SuccessType, ErrorType>> {
|
|
80
|
-
const data = response.headers.get("content-type")?.startsWith("application/json")
|
|
81
|
-
? ((await response.json()) as ResponseType)
|
|
82
|
-
: ((await response.text()) as ResponseType);
|
|
83
|
-
|
|
84
|
-
if (response.ok) {
|
|
85
|
-
return {
|
|
86
|
-
isSuccess: true,
|
|
87
|
-
isError: false,
|
|
88
|
-
status: response.status,
|
|
89
|
-
statusText: response.statusText,
|
|
90
|
-
data: data as SuccessType,
|
|
91
|
-
};
|
|
92
|
-
} else {
|
|
93
|
-
return {
|
|
94
|
-
isSuccess: false,
|
|
95
|
-
isError: true,
|
|
96
|
-
status: response.status,
|
|
97
|
-
statusText: response.statusText,
|
|
98
|
-
data: data as ErrorType,
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { build } from "vite";
|
|
2
|
-
import path, { resolve } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { sync as rmSync } from "rimraf";
|
|
5
|
-
import type { CommandArgOpts, BuildOptions, CommonOptions } from "../types";
|
|
6
|
-
|
|
7
|
-
const __dirname = fileURLToPath(new URL(".", import.meta.url));
|
|
8
|
-
const configFile = resolve(__dirname, "../builder/vite-config.js");
|
|
9
|
-
const serverEntryFile = resolve(__dirname, "../builder/vite-entry-server.js");
|
|
10
|
-
|
|
11
|
-
export async function buildTemplate({ options, logger }: CommandArgOpts<CommonOptions & BuildOptions>) {
|
|
12
|
-
logger.info("Building template...\n");
|
|
13
|
-
|
|
14
|
-
if (options.clean) {
|
|
15
|
-
rmSync(path.join(process.cwd(), "dist"));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
let mode = "production";
|
|
19
|
-
|
|
20
|
-
if (options.ssr === "local") {
|
|
21
|
-
mode = "development";
|
|
22
|
-
process.env.NODE_ENV = mode;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (options.ssr) {
|
|
26
|
-
// 1. client build
|
|
27
|
-
await build({
|
|
28
|
-
configFile,
|
|
29
|
-
customLogger: logger,
|
|
30
|
-
mode,
|
|
31
|
-
logLevel: options.logLevel,
|
|
32
|
-
clearScreen: options.clearScreen,
|
|
33
|
-
build: {
|
|
34
|
-
ssrManifest: true,
|
|
35
|
-
emptyOutDir: true,
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
// 2. server build
|
|
40
|
-
await build({
|
|
41
|
-
configFile,
|
|
42
|
-
customLogger: logger,
|
|
43
|
-
mode,
|
|
44
|
-
logLevel: options.logLevel,
|
|
45
|
-
clearScreen: options.clearScreen,
|
|
46
|
-
ssr: {
|
|
47
|
-
target: "webworker",
|
|
48
|
-
},
|
|
49
|
-
build: {
|
|
50
|
-
ssr: serverEntryFile,
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
} else {
|
|
54
|
-
await build({
|
|
55
|
-
configFile,
|
|
56
|
-
customLogger: logger,
|
|
57
|
-
logLevel: options.logLevel,
|
|
58
|
-
clearScreen: options.clearScreen,
|
|
59
|
-
build: {
|
|
60
|
-
emptyOutDir: true,
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
import { confirm } from "@inquirer/prompts";
|
|
3
|
-
import open from "open";
|
|
4
|
-
import { CLI_LOGIN_CLIENT_ID, OAUTH_ENDPOINT_DEVICE_CODE, OAUTH_ENDPOINT_TOKEN } from "../../constants";
|
|
5
|
-
import { post } from "../../api";
|
|
6
|
-
import type { Logger } from "~/node/shared/logger";
|
|
7
|
-
import type { CommandArgOpts, CommonOptions } from "../../types";
|
|
8
|
-
import { accessStore } from "../../store";
|
|
9
|
-
|
|
10
|
-
export async function pollForLogin(deviceCode: string, logger: Logger) {
|
|
11
|
-
while (true) {
|
|
12
|
-
const body = new URLSearchParams({
|
|
13
|
-
grant_type: "device_code",
|
|
14
|
-
device_code: deviceCode,
|
|
15
|
-
client_id: CLI_LOGIN_CLIENT_ID,
|
|
16
|
-
});
|
|
17
|
-
const tokenResponse = await post<DeviceCodeTokenSuccessResponse, DeviceCodeTokenErrorResponse>(
|
|
18
|
-
OAUTH_ENDPOINT_TOKEN,
|
|
19
|
-
body,
|
|
20
|
-
);
|
|
21
|
-
const { data, isSuccess } = tokenResponse;
|
|
22
|
-
|
|
23
|
-
if (isSuccess) {
|
|
24
|
-
return data;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (data.error === "authorization_pending") {
|
|
28
|
-
await new Promise((resolve) => setTimeout(resolve, 5000));
|
|
29
|
-
} else {
|
|
30
|
-
// other error handling
|
|
31
|
-
logger.error(`Error while polling for login: ${data.error_description ?? data.error}`);
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export async function login({ options, logger }: CommandArgOpts<CommonOptions>) {
|
|
38
|
-
logger.info(`Logging in to Enpage...\n`);
|
|
39
|
-
|
|
40
|
-
const { isError, data } = await post<DeviceCodeResponse>(OAUTH_ENDPOINT_DEVICE_CODE, {
|
|
41
|
-
client_id: CLI_LOGIN_CLIENT_ID,
|
|
42
|
-
scope: "profile,templates:publish",
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
if (isError) {
|
|
46
|
-
logger.error("Failed to get device code. Please try again.");
|
|
47
|
-
logger.error(`Error: ${data.error_description ?? data.error}`);
|
|
48
|
-
process.exit(1);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const { verification_uri, device_code } = data;
|
|
52
|
-
|
|
53
|
-
const confirmed = await confirm({
|
|
54
|
-
message: `Would you like to open the login page in your browser?`,
|
|
55
|
-
default: true,
|
|
56
|
-
}).catch((e) => {
|
|
57
|
-
process.exit(0);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
if (confirmed) {
|
|
61
|
-
open(verification_uri);
|
|
62
|
-
} else {
|
|
63
|
-
logger.info(`\nPlease visit the following URL to login:\n ${verification_uri}\n`);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
logger.info(chalk.gray("\nWaiting for login...\n"));
|
|
67
|
-
|
|
68
|
-
const loginData = await pollForLogin(device_code, logger);
|
|
69
|
-
|
|
70
|
-
if (!loginData) {
|
|
71
|
-
logger.error("Login failed. Please try again.");
|
|
72
|
-
process.exit(1);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// Store the access token info
|
|
76
|
-
accessStore.set({
|
|
77
|
-
...loginData,
|
|
78
|
-
...(loginData.expires_in ? { expires_at: Date.now() + loginData.expires_in * 1000 } : {}),
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
logger.info("Login successful!\n");
|
|
82
|
-
process.exitCode = 0;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
type DeviceCodeResponse = {
|
|
86
|
-
success: true;
|
|
87
|
-
device_code: string;
|
|
88
|
-
user_code: string;
|
|
89
|
-
verification_uri: string;
|
|
90
|
-
verification_uri_complete?: string; // Optional as per RFC 8628
|
|
91
|
-
expires_in: number;
|
|
92
|
-
interval?: number; // Optional as per RFC 8628
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
// Union type for the response
|
|
96
|
-
|
|
97
|
-
type DeviceCodeTokenSuccessResponse = {
|
|
98
|
-
success: true;
|
|
99
|
-
access_token: string;
|
|
100
|
-
token_type: string;
|
|
101
|
-
expires_in?: number;
|
|
102
|
-
refresh_token?: string;
|
|
103
|
-
scope?: string;
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
// Error response type for token request
|
|
107
|
-
type DeviceCodeTokenErrorResponse = {
|
|
108
|
-
error: "authorization_pending" | "slow_down" | "access_denied" | "expired_token" | string;
|
|
109
|
-
error_description?: string;
|
|
110
|
-
error_uri?: string;
|
|
111
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { CommandArgOpts, CommonOptions } from "../../types";
|
|
2
|
-
import { accessStore } from "../../store";
|
|
3
|
-
|
|
4
|
-
export async function logout({ options, logger }: CommandArgOpts<CommonOptions>) {
|
|
5
|
-
logger.info(`Logging out fom Enpage...`);
|
|
6
|
-
|
|
7
|
-
accessStore.clear();
|
|
8
|
-
|
|
9
|
-
logger.info("Done.\n");
|
|
10
|
-
process.exit(0);
|
|
11
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { resolve } from "node:path";
|
|
2
|
-
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
|
-
import chalk from "chalk";
|
|
4
|
-
import type { CommandArgOpts } from "../../types";
|
|
5
|
-
import { formatAPIError, getPackageManager } from "../../utils";
|
|
6
|
-
import { getTokenOrThrow } from "../../store";
|
|
7
|
-
import { uploadTemplate } from "./uploader";
|
|
8
|
-
import path from "node:path";
|
|
9
|
-
import { post } from "../../api";
|
|
10
|
-
import { API_ENDPOINT_REGISTER_TEMPLATE } from "../../constants";
|
|
11
|
-
import { loadConfigFromJsFile, validateTemplateConfig } from "~/node/shared/config";
|
|
12
|
-
import { isLoggedIn } from "../../is-logged-in";
|
|
13
|
-
|
|
14
|
-
export async function publish({ options, args, logger }: CommandArgOpts) {
|
|
15
|
-
// check if user is logged in
|
|
16
|
-
if (!(await isLoggedIn(true))) {
|
|
17
|
-
const pkgCmd = getPackageManager();
|
|
18
|
-
logger.error(
|
|
19
|
-
` ${chalk.redBright("Error")}: User token not found. Please run ${chalk.cyan(`${pkgCmd} run enpage:login`)} to authenticate or set the ${chalk.cyan("ENPAGE_API_TOKEN")} environment variable.\n`,
|
|
20
|
-
);
|
|
21
|
-
process.exit(1);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const templateDir = args.length
|
|
25
|
-
? path.isAbsolute(args[0])
|
|
26
|
-
? args[0]
|
|
27
|
-
: resolve(process.cwd(), args[0])
|
|
28
|
-
: process.cwd();
|
|
29
|
-
|
|
30
|
-
if (!existsSync(templateDir)) {
|
|
31
|
-
logger.error(` Template directory not found: ${templateDir}. Aborting.\n`);
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const distDir =
|
|
36
|
-
args.length > 1
|
|
37
|
-
? path.isAbsolute(args[1])
|
|
38
|
-
? args[1]
|
|
39
|
-
: resolve(process.cwd(), args[1])
|
|
40
|
-
: resolve(templateDir, "dist");
|
|
41
|
-
|
|
42
|
-
if (!existsSync(distDir)) {
|
|
43
|
-
logger.error(
|
|
44
|
-
` Dist directory not found: ${distDir}.\n Please run 'build' before publishing. Aborting.\n`,
|
|
45
|
-
);
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// check if enpage.config.js and package.json exist in the current directory
|
|
50
|
-
// if not, exit with an error
|
|
51
|
-
if (!existsSync(resolve(templateDir, "enpage.config.js"))) {
|
|
52
|
-
logger.error(
|
|
53
|
-
` ${chalk.redBright("Error")}: file enpage.config.js not found in ${templateDir}. Aborting.\n`,
|
|
54
|
-
);
|
|
55
|
-
process.exit(1);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// load manifest from both enpage.config.js and package.json
|
|
59
|
-
// manifest.json is used to store the template ID for future updates
|
|
60
|
-
const config = await loadConfigFromJsFile(resolve(templateDir, "enpage.config.js"), logger);
|
|
61
|
-
|
|
62
|
-
validateTemplateConfig(config, logger);
|
|
63
|
-
|
|
64
|
-
const token = getTokenOrThrow();
|
|
65
|
-
const pkgLocation = getPackageLocation(templateDir);
|
|
66
|
-
|
|
67
|
-
if (!pkgLocation) {
|
|
68
|
-
logger.error(` ${chalk.redBright("Error")}: package.json file not found in ${templateDir}. Aborting.\n`);
|
|
69
|
-
process.exit(1);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// load package.json to get the template ID (if it exists)
|
|
73
|
-
const pkg = await getPackageJsonContents(pkgLocation);
|
|
74
|
-
|
|
75
|
-
if (!pkg) {
|
|
76
|
-
logger.error(
|
|
77
|
-
` ${chalk.redBright("Error")}: cannot read/parse package.json file in ${templateDir}. Aborting.\n`,
|
|
78
|
-
);
|
|
79
|
-
process.exit(1);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (!pkg.enpage?.id) {
|
|
83
|
-
// call API to create a new template
|
|
84
|
-
const { data, isError, status } = await post<{ success: true; template: { id: string } }>(
|
|
85
|
-
API_ENDPOINT_REGISTER_TEMPLATE,
|
|
86
|
-
{}, // todo: fill with template data
|
|
87
|
-
);
|
|
88
|
-
if (isError) {
|
|
89
|
-
logger.error(` ${chalk.redBright("Error")}: Cannot register template: ${formatAPIError(data)}\n`);
|
|
90
|
-
process.exit(1);
|
|
91
|
-
}
|
|
92
|
-
pkg.enpage ??= {};
|
|
93
|
-
pkg.enpage.id = data.template.id;
|
|
94
|
-
|
|
95
|
-
// save the template ID to package.json
|
|
96
|
-
try {
|
|
97
|
-
if (!options.dryRun) writeFileSync(pkgLocation, JSON.stringify(pkg, null, 2));
|
|
98
|
-
} catch (e) {
|
|
99
|
-
logger.error(
|
|
100
|
-
` ${chalk.redBright("Error")}: Cannot update template id in package.json file located in ${templateDir}. Aborting.\n`,
|
|
101
|
-
);
|
|
102
|
-
process.exit(1);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const templateId = pkg.enpage.id;
|
|
107
|
-
|
|
108
|
-
// submit template to Enpage
|
|
109
|
-
logger.info(`Submitting template to Enpage...\n`);
|
|
110
|
-
|
|
111
|
-
const uploadResults = await uploadTemplate(templateId, templateDir, token, options.dryRun);
|
|
112
|
-
|
|
113
|
-
if (!uploadResults.success) {
|
|
114
|
-
logger.error("\nUpload failed. See details above.\n");
|
|
115
|
-
process.exit(1);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
logger.success(`Template ${templateId} published.\n`);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function getPackageLocation(templateDir: string) {
|
|
122
|
-
return existsSync(resolve(templateDir, "package.json"))
|
|
123
|
-
? resolve(templateDir, "package.json")
|
|
124
|
-
: existsSync(resolve(templateDir, "template-package.json"))
|
|
125
|
-
? resolve(templateDir, "template-package.json")
|
|
126
|
-
: false;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function getPackageJsonContents(pkgJsonPath: string) {
|
|
130
|
-
try {
|
|
131
|
-
return JSON.parse(readFileSync(pkgJsonPath, "utf-8"));
|
|
132
|
-
} catch (e) {
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
}
|