@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.
Files changed (47) hide show
  1. package/dist/chunk-24P7DHB7.js +41 -0
  2. package/dist/chunk-24P7DHB7.js.map +1 -0
  3. package/dist/chunk-464CGCFJ.js +912 -0
  4. package/dist/chunk-464CGCFJ.js.map +1 -0
  5. package/{src/refine.ts → dist/chunk-CB2LECVT.js} +30 -60
  6. package/dist/chunk-CB2LECVT.js.map +1 -0
  7. package/{src/images/dalleImages.ts → dist/chunk-LPI2QUCL.js} +10 -12
  8. package/dist/chunk-LPI2QUCL.js.map +1 -0
  9. package/{src/generate.ts → dist/chunk-S7YLW6ZU.js} +68 -115
  10. package/dist/chunk-S7YLW6ZU.js.map +1 -0
  11. package/{src/iframeScript.ts → dist/chunk-UGIQBLG5.js} +260 -10
  12. package/dist/chunk-UGIQBLG5.js.map +1 -0
  13. package/{src/images/enrichImages.ts → dist/chunk-YPK3DAFK.js} +44 -61
  14. package/dist/chunk-YPK3DAFK.js.map +1 -0
  15. package/dist/components.d.ts +65 -0
  16. package/dist/components.js +16 -0
  17. package/dist/components.js.map +1 -0
  18. package/dist/deploy.d.ts +39 -0
  19. package/dist/deploy.js +10 -0
  20. package/dist/deploy.js.map +1 -0
  21. package/dist/generate.d.ts +41 -0
  22. package/dist/generate.js +14 -0
  23. package/dist/generate.js.map +1 -0
  24. package/dist/images.d.ts +30 -0
  25. package/dist/images.js +15 -0
  26. package/dist/images.js.map +1 -0
  27. package/dist/index.d.ts +30 -0
  28. package/dist/index.js +67 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/refine.d.ts +32 -0
  31. package/dist/refine.js +10 -0
  32. package/dist/refine.js.map +1 -0
  33. package/dist/themes-CWFZ6GB-.d.ts +35 -0
  34. package/dist/types-Flpl4wDs.d.ts +31 -0
  35. package/package.json +53 -50
  36. package/src/buildHtml.ts +0 -78
  37. package/src/components/Canvas.tsx +0 -162
  38. package/src/components/CodeEditor.tsx +0 -239
  39. package/src/components/FloatingToolbar.tsx +0 -350
  40. package/src/components/SectionList.tsx +0 -217
  41. package/src/components/index.ts +0 -4
  42. package/src/deploy.ts +0 -73
  43. package/src/images/index.ts +0 -3
  44. package/src/images/pexels.ts +0 -27
  45. package/src/index.ts +0 -58
  46. package/src/themes.ts +0 -204
  47. 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":[]}