@easybits.cloud/html-tailwind-generator 0.1.6 → 0.2.1
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/chunk-24P7DHB7.js +41 -0
- package/dist/chunk-24P7DHB7.js.map +1 -0
- package/dist/chunk-464CGCFJ.js +912 -0
- package/dist/chunk-464CGCFJ.js.map +1 -0
- package/{src/refine.ts → dist/chunk-CB2LECVT.js} +30 -60
- package/dist/chunk-CB2LECVT.js.map +1 -0
- package/{src/images/dalleImages.ts → dist/chunk-LPI2QUCL.js} +10 -12
- package/dist/chunk-LPI2QUCL.js.map +1 -0
- package/{src/generate.ts → dist/chunk-S7YLW6ZU.js} +68 -115
- package/dist/chunk-S7YLW6ZU.js.map +1 -0
- package/{src/iframeScript.ts → dist/chunk-UGIQBLG5.js} +260 -10
- package/dist/chunk-UGIQBLG5.js.map +1 -0
- package/{src/images/enrichImages.ts → dist/chunk-YPK3DAFK.js} +44 -61
- package/dist/chunk-YPK3DAFK.js.map +1 -0
- package/dist/components.d.ts +65 -0
- package/dist/components.js +16 -0
- package/dist/components.js.map +1 -0
- package/dist/deploy.d.ts +39 -0
- package/dist/deploy.js +10 -0
- package/dist/deploy.js.map +1 -0
- package/dist/generate.d.ts +41 -0
- package/dist/generate.js +14 -0
- package/dist/generate.js.map +1 -0
- package/dist/images.d.ts +30 -0
- package/dist/images.js +15 -0
- package/dist/images.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -0
- package/dist/refine.d.ts +32 -0
- package/dist/refine.js +10 -0
- package/dist/refine.js.map +1 -0
- package/dist/themes-CWFZ6GB-.d.ts +35 -0
- package/dist/types-Flpl4wDs.d.ts +31 -0
- package/package.json +53 -50
- package/src/buildHtml.ts +0 -78
- package/src/components/Canvas.tsx +0 -162
- package/src/components/CodeEditor.tsx +0 -239
- package/src/components/FloatingToolbar.tsx +0 -350
- package/src/components/SectionList.tsx +0 -217
- package/src/components/index.ts +0 -4
- package/src/deploy.ts +0 -73
- package/src/images/index.ts +0 -3
- package/src/images/pexels.ts +0 -27
- package/src/index.ts +0 -58
- package/src/themes.ts +0 -204
- package/src/types.ts +0 -30
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildDeployHtml
|
|
3
|
+
} from "./chunk-UGIQBLG5.js";
|
|
4
|
+
|
|
5
|
+
// src/deploy.ts
|
|
6
|
+
async function deployToS3(options) {
|
|
7
|
+
const { sections, theme, customColors, upload } = options;
|
|
8
|
+
const html = buildDeployHtml(sections, theme, customColors);
|
|
9
|
+
return upload(html);
|
|
10
|
+
}
|
|
11
|
+
async function deployToEasyBits(options) {
|
|
12
|
+
const {
|
|
13
|
+
apiKey,
|
|
14
|
+
slug,
|
|
15
|
+
sections,
|
|
16
|
+
theme,
|
|
17
|
+
customColors,
|
|
18
|
+
baseUrl = "https://easybits.cloud"
|
|
19
|
+
} = options;
|
|
20
|
+
const html = buildDeployHtml(sections, theme, customColors);
|
|
21
|
+
const res = await fetch(`${baseUrl}/api/v2/websites`, {
|
|
22
|
+
method: "POST",
|
|
23
|
+
headers: {
|
|
24
|
+
"Content-Type": "application/json",
|
|
25
|
+
Authorization: `Bearer ${apiKey}`
|
|
26
|
+
},
|
|
27
|
+
body: JSON.stringify({ slug, html })
|
|
28
|
+
});
|
|
29
|
+
if (!res.ok) {
|
|
30
|
+
const error = await res.json().catch(() => ({ error: "Deploy failed" }));
|
|
31
|
+
throw new Error(error.error || "Deploy failed");
|
|
32
|
+
}
|
|
33
|
+
const data = await res.json();
|
|
34
|
+
return data.url || `https://${slug}.easybits.cloud`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
deployToS3,
|
|
39
|
+
deployToEasyBits
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=chunk-24P7DHB7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/deploy.ts"],"sourcesContent":["import { buildDeployHtml } from \"./buildHtml\";\nimport type { Section3 } from \"./types\";\nimport type { CustomColors } from \"./themes\";\n\nexport interface DeployToS3Options {\n /** The sections to deploy */\n sections: Section3[];\n /** Theme ID */\n theme?: string;\n /** Custom colors (when theme is \"custom\") */\n customColors?: CustomColors;\n /** S3-compatible upload function. Receives the HTML string, returns the URL */\n upload: (html: string) => Promise<string>;\n}\n\n/**\n * Deploy a landing page to any S3-compatible storage.\n * The consumer provides their own upload function.\n */\nexport async function deployToS3(options: DeployToS3Options): Promise<string> {\n const { sections, theme, customColors, upload } = options;\n const html = buildDeployHtml(sections, theme, customColors);\n return upload(html);\n}\n\nexport interface DeployToEasyBitsOptions {\n /** EasyBits API key */\n apiKey: string;\n /** Website slug (e.g. \"my-landing\" → my-landing.easybits.cloud) */\n slug: string;\n /** The sections to deploy */\n sections: Section3[];\n /** Theme ID */\n theme?: string;\n /** Custom colors (when theme is \"custom\") */\n customColors?: CustomColors;\n /** EasyBits API base URL (default: https://easybits.cloud) */\n baseUrl?: string;\n}\n\n/**\n * Deploy a landing page to EasyBits hosting (slug.easybits.cloud).\n * Uses the EasyBits API to create/update a website.\n */\nexport async function deployToEasyBits(options: DeployToEasyBitsOptions): Promise<string> {\n const {\n apiKey,\n slug,\n sections,\n theme,\n customColors,\n baseUrl = \"https://easybits.cloud\",\n } = options;\n\n const html = buildDeployHtml(sections, theme, customColors);\n\n const res = await fetch(`${baseUrl}/api/v2/websites`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${apiKey}`,\n },\n body: JSON.stringify({ slug, html }),\n });\n\n if (!res.ok) {\n const error = await res.json().catch(() => ({ error: \"Deploy failed\" }));\n throw new Error(error.error || \"Deploy failed\");\n }\n\n const data = await res.json();\n return data.url || `https://${slug}.easybits.cloud`;\n}\n"],"mappings":";;;;;AAmBA,eAAsB,WAAW,SAA6C;AAC5E,QAAM,EAAE,UAAU,OAAO,cAAc,OAAO,IAAI;AAClD,QAAM,OAAO,gBAAgB,UAAU,OAAO,YAAY;AAC1D,SAAO,OAAO,IAAI;AACpB;AAqBA,eAAsB,iBAAiB,SAAmD;AACxF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,EACZ,IAAI;AAEJ,QAAM,OAAO,gBAAgB,UAAU,OAAO,YAAY;AAE1D,QAAM,MAAM,MAAM,MAAM,GAAG,OAAO,oBAAoB;AAAA,IACpD,QAAQ;AAAA,IACR,SAAS;AAAA,MACP,gBAAgB;AAAA,MAChB,eAAe,UAAU,MAAM;AAAA,IACjC;AAAA,IACA,MAAM,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAAA,EACrC,CAAC;AAED,MAAI,CAAC,IAAI,IAAI;AACX,UAAM,QAAQ,MAAM,IAAI,KAAK,EAAE,MAAM,OAAO,EAAE,OAAO,gBAAgB,EAAE;AACvE,UAAM,IAAI,MAAM,MAAM,SAAS,eAAe;AAAA,EAChD;AAEA,QAAM,OAAO,MAAM,IAAI,KAAK;AAC5B,SAAO,KAAK,OAAO,WAAW,IAAI;AACpC;","names":[]}
|