@chaibuilder/sdk 1.0.9 → 1.0.11

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 (167) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +123 -21
  3. package/dist/AddBlocks-7ACJv8LW.cjs +3 -0
  4. package/dist/{AddBlocks-d10b7b87.js → AddBlocks-H7BZYHUC.js} +43 -40
  5. package/dist/BrandingOptions-5j-XszLM.cjs +1 -0
  6. package/dist/{BrandingOptions-f4ab5d9f.js → BrandingOptions-PAgY-kvj.js} +19 -22
  7. package/dist/CanvasArea-Dnm-yeus.cjs +46 -0
  8. package/dist/{CanvasArea-10356200.js → CanvasArea-zn2ox-5h.js} +492 -503
  9. package/dist/ChaiBuilderEditor-BoE-sArB.cjs +163 -0
  10. package/dist/{index-aa42febc.js → ChaiBuilderEditor-hEuUONQ3.js} +11215 -15404
  11. package/dist/Class-_uCzl5v1.cjs +1 -0
  12. package/dist/{html-to-json-45e0e3b5.js → Class-l7qYbuoN.js} +185 -366
  13. package/dist/{CurrentPage-35e14043.js → CurrentPage-6Jp4xAWK.js} +27 -24
  14. package/dist/CurrentPage-YMpqOqx7.cjs +1 -0
  15. package/dist/{ImagesPanel-8b7a989d.cjs → ImagesPanel-6us7hiLN.cjs} +1 -1
  16. package/dist/{ImagesPanel-47ac13c3.js → ImagesPanel-oaHOD-Ex.js} +4 -4
  17. package/dist/Layers-EzOZdWvd.cjs +1 -0
  18. package/dist/{Layers-c3dd4fc8.js → Layers-WkZ48AUm.js} +43 -42
  19. package/dist/{MarkAsGlobalBlock-505ae793.js → MarkAsGlobalBlock-0HubcRkY.js} +18 -21
  20. package/dist/MarkAsGlobalBlock-HmeIyLCP.cjs +1 -0
  21. package/dist/{PagesPanel-bafc506f.js → PagesPanel-6JuwBLFQ.js} +17 -14
  22. package/dist/PagesPanel-zJq8p1ja.cjs +1 -0
  23. package/dist/ProjectPanel-Zml2F8b9.cjs +1 -0
  24. package/dist/{ProjectPanel-6113f394.js → ProjectPanel-cu2QSDW9.js} +23 -20
  25. package/dist/{Settings-1c41c514.js → Settings-fH8fZKpm.js} +266 -264
  26. package/dist/Settings-lc9PfnmG.cjs +1 -0
  27. package/dist/SidePanels-VH72zFE2.cjs +1 -0
  28. package/dist/{SidePanels-c13f87dc.js → SidePanels-w8ZHKJaR.js} +34 -42
  29. package/dist/{Topbar-b38d5d50.js → Topbar-hm1D_5sb.js} +34 -36
  30. package/dist/Topbar-vQPo9xSY.cjs +1 -0
  31. package/dist/UnsplashImages-BoBBSi1a.cjs +1 -0
  32. package/dist/{UnsplashImages-4edb97e7.js → UnsplashImages-gPcBLjgB.js} +13 -14
  33. package/dist/UploadImages-T6kW0s3G.cjs +1 -0
  34. package/dist/{UploadImages-52181c3e.js → UploadImages-_ZyUU66E.js} +11 -12
  35. package/dist/{accordion-c0176dc5.js → accordion-oPUeqPCZ.js} +2 -2
  36. package/dist/{accordion-0afd8143.cjs → accordion-ynvFtV_p.cjs} +1 -1
  37. package/dist/add-page-modal--qZSwJuB.cjs +1 -0
  38. package/dist/{add-page-modal-08a19915.js → add-page-modal-bj7qbZuK.js} +27 -23
  39. package/dist/alert-dialog-GNfnpqFB.js +64 -0
  40. package/dist/alert-dialog-Mv0-wAvS.cjs +1 -0
  41. package/dist/{command-b1103666.cjs → command-ThdTuUxt.cjs} +1 -1
  42. package/dist/{command-6f260f61.js → command-VHca6CcN.js} +3 -3
  43. package/dist/confirm-alert-8EHe0OOd.cjs +1 -0
  44. package/dist/confirm-alert-b0e_BLhF.js +36 -0
  45. package/dist/{context-menu-e1c240ce.js → context-menu-8dC9uGXj.js} +2 -2
  46. package/dist/{context-menu-fec580f2.cjs → context-menu-IgLbIuth.cjs} +1 -1
  47. package/dist/controls-Ni5kEzLz.js +103 -0
  48. package/dist/controls-W97-POR_.cjs +1 -0
  49. package/dist/controls-enQY7NI8.js +118 -0
  50. package/dist/controls-xUKa23ic.cjs +1 -0
  51. package/dist/core.cjs +1 -1
  52. package/dist/core.d.ts +1 -10
  53. package/dist/core.js +117 -70
  54. package/dist/delete-page-modal-2LuDLEiP.cjs +1 -0
  55. package/dist/{delete-page-modal-9b37665b.js → delete-page-modal-cnrR8tWH.js} +26 -23
  56. package/dist/{dialog-170eaad9.cjs → dialog-S_QbL1iq.cjs} +1 -1
  57. package/dist/{dialog-18207bef.js → dialog-jrw9DF1f.js} +2 -2
  58. package/dist/{dropdown-menu-ae3ed09b.js → dropdown-menu-S03K_fNs.js} +2 -2
  59. package/dist/{dropdown-menu-84b2439e.cjs → dropdown-menu-sMXR59cB.cjs} +1 -1
  60. package/dist/{form-25e1af37.js → form-dVpOAyRl.js} +2 -2
  61. package/dist/{form-ea21db6c.cjs → form-nRAvKPQj.cjs} +1 -1
  62. package/dist/{functions-83b1de8d.js → functions-nNTuSTsR.js} +1 -1
  63. package/dist/functions-pcUZhFJM.js +12 -0
  64. package/dist/{functions-f84d5e2a.cjs → functions-sCuB7nvZ.cjs} +1 -1
  65. package/dist/functions-uw7QP2kT.cjs +1 -0
  66. package/dist/html-to-json-P6GpbcQX.cjs +1 -0
  67. package/dist/html-to-json-pdHQfRkN.js +178 -0
  68. package/dist/index-HAue58ea.cjs +1 -0
  69. package/dist/index-T4_wfKl5.js +2256 -0
  70. package/dist/index-X9ZgD09V.cjs +1 -0
  71. package/dist/index-ehKdBRUK.js +18 -0
  72. package/dist/{label-e770a087.js → label-KaP7MRrs.js} +2 -2
  73. package/dist/{label-167415e5.cjs → label-tFm8HZdb.cjs} +1 -1
  74. package/dist/lib.cjs +1 -1
  75. package/dist/lib.d.ts +20 -13
  76. package/dist/lib.js +24 -23
  77. package/dist/{link-57de608a.js → link-6o6n2Tnd.js} +4 -4
  78. package/dist/link-ece8dZGH.cjs +1 -0
  79. package/dist/page-viewer-IARz6OSp.cjs +1 -0
  80. package/dist/{page-viewer-5c733179.js → page-viewer-Y4YiaZ_m.js} +30 -27
  81. package/dist/{popover-f7addcf4.js → popover-a84pbVhQ.js} +2 -2
  82. package/dist/{popover-7cb9079b.cjs → popover-fKjgcRUx.cjs} +1 -1
  83. package/dist/{project-general-setting-d9736056.js → project-general-setting-U4S_KlhU.js} +29 -25
  84. package/dist/project-general-setting-eSl3t-VH.cjs +1 -0
  85. package/dist/{project-seo-setting-d81fc1e3.js → project-seo-setting-Ga9v_ECU.js} +18 -19
  86. package/dist/project-seo-setting-rankm1z3.cjs +1 -0
  87. package/dist/render.cjs +1 -1
  88. package/dist/render.d.ts +7 -7
  89. package/dist/render.js +36 -36
  90. package/dist/{scroll-area-bb343b86.cjs → scroll-area-FiHvy-TZ.cjs} +1 -1
  91. package/dist/{scroll-area-83bd9e8f.js → scroll-area-ewXbxc3n.js} +2 -2
  92. package/dist/{select-0e32300c.cjs → select-7bjg-rr9.cjs} +1 -1
  93. package/dist/{select-7fddd7c3.js → select-POGdEDHT.js} +2 -2
  94. package/dist/{separator-a597dba7.cjs → separator-3Civ-6hb.cjs} +1 -1
  95. package/dist/{separator-a80d065b.js → separator-SctTn0Qi.js} +2 -2
  96. package/dist/server.cjs +1 -1
  97. package/dist/server.d.ts +7 -10
  98. package/dist/server.js +1 -4
  99. package/dist/{single-page-detail-04410e64.js → single-page-detail-pAxCy_Pe.js} +69 -65
  100. package/dist/single-page-detail-yPgnu2AI.cjs +1 -0
  101. package/dist/skeleton-CU_FIbg3.js +239 -0
  102. package/dist/skeleton-JHP9zwL2.cjs +1 -0
  103. package/dist/studio.cjs +1 -0
  104. package/dist/studio.d.ts +13 -0
  105. package/dist/studio.js +39 -0
  106. package/dist/{tabs-85caa1e8.js → tabs-Gb9v5dVb.js} +2 -2
  107. package/dist/{tabs-860e37aa.cjs → tabs-iWeaaVrg.cjs} +1 -1
  108. package/dist/{textarea-a338ede6.cjs → textarea-1kZEh7ki.cjs} +1 -1
  109. package/dist/{textarea-0750bcd2.js → textarea-b2QvVhrK.js} +2 -2
  110. package/dist/{toggle-00c9d11e.js → toggle-ASJRAaGP.js} +2 -2
  111. package/dist/{toggle-b90fed97.cjs → toggle-ehNIPmme.cjs} +1 -1
  112. package/dist/ui.cjs +1 -1
  113. package/dist/ui.d.ts +72 -7
  114. package/dist/ui.js +272 -212
  115. package/dist/useAddBlock-WJc3OgG8.js +86 -0
  116. package/dist/useAddBlock-dCKRFPRU.cjs +1 -0
  117. package/dist/useAllBlocks-6hvuNuyw.cjs +1 -0
  118. package/dist/useAllBlocks-PQKYvs-e.js +20 -0
  119. package/dist/useChaiExternalData-4K9WxANa.js +6 -0
  120. package/dist/useChaiExternalData-DkyBJ81C.cjs +1 -0
  121. package/dist/useDarkMode-ZKCO_gkt.js +23 -0
  122. package/dist/useDarkMode-dV6FM6l-.cjs +1 -0
  123. package/dist/useFeatureSupport-OLwNgEZb.js +16 -0
  124. package/dist/useFeatureSupport-c9IgPW2t.cjs +1 -0
  125. package/dist/useHiddenBlocks-3MsGOJ1s.js +15 -0
  126. package/dist/useHiddenBlocks-oJuQDmTy.cjs +1 -0
  127. package/dist/useLanguage-NKKKaxVM.cjs +1 -0
  128. package/dist/useLanguage-gVC5rxO5.js +216 -0
  129. package/dist/useMarkAsGlobalBlock-X73Vny8u.js +25 -0
  130. package/dist/useMarkAsGlobalBlock-ebBVGHg4.cjs +1 -0
  131. package/dist/useUiLibraries-4hPOi8DI.js +12 -0
  132. package/dist/useUiLibraries-9FhQCpKo.cjs +1 -0
  133. package/package.json +20 -6
  134. package/dist/AddBlocks-76275943.cjs +0 -3
  135. package/dist/BrandingOptions-d3b3309a.cjs +0 -1
  136. package/dist/CanvasArea-9f94cd28.cjs +0 -46
  137. package/dist/CurrentPage-edb509db.cjs +0 -1
  138. package/dist/Layers-ecba52c1.cjs +0 -1
  139. package/dist/MarkAsGlobalBlock-3a06a159.cjs +0 -1
  140. package/dist/PagesPanel-f4329082.cjs +0 -1
  141. package/dist/ProjectPanel-ce3116d3.cjs +0 -1
  142. package/dist/Settings-b6a2bef6.cjs +0 -1
  143. package/dist/SidePanels-2cc72c0b.cjs +0 -1
  144. package/dist/Topbar-3b9db9f3.cjs +0 -1
  145. package/dist/UnsplashImages-98c085c2.cjs +0 -1
  146. package/dist/UploadImages-61ef83ad.cjs +0 -1
  147. package/dist/add-page-modal-7f9ff733.cjs +0 -1
  148. package/dist/confirm-alert-c1fdf1e4.js +0 -35
  149. package/dist/confirm-alert-e1ea5110.cjs +0 -1
  150. package/dist/delete-page-modal-7066b01f.cjs +0 -1
  151. package/dist/html-to-json-aadcbf66.cjs +0 -1
  152. package/dist/index-c535cc95.cjs +0 -164
  153. package/dist/link-24679521.cjs +0 -1
  154. package/dist/page-viewer-da99c71e.cjs +0 -1
  155. package/dist/project-general-setting-90f8416d.cjs +0 -1
  156. package/dist/project-seo-setting-6eef8387.cjs +0 -1
  157. package/dist/single-page-detail-90f49d7a.cjs +0 -1
  158. package/dist/useBuilderProp-21feb2da.js +0 -296
  159. package/dist/useBuilderProp-adacf42f.cjs +0 -1
  160. package/dist/useChaiExternalData-192c7896.js +0 -5
  161. package/dist/useChaiExternalData-a90e8aac.cjs +0 -1
  162. /package/dist/{MODIFIERS-2f19c314.js → MODIFIERS-DsEzQ3aH.js} +0 -0
  163. /package/dist/{MODIFIERS-4716c669.cjs → MODIFIERS-Fx6WAZcw.cjs} +0 -0
  164. /package/dist/{jsx-runtime-5c3ac4f7.cjs → jsx-runtime-JYMCiFoE.cjs} +0 -0
  165. /package/dist/{jsx-runtime-944c88e2.js → jsx-runtime-Sp0orL4X.js} +0 -0
  166. /package/dist/{utils-ac68b2c8.js → utils-dze1SGvB.js} +0 -0
  167. /package/dist/{utils-3c452dd0.cjs → utils-qK_SjzzV.cjs} +0 -0
package/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024, Suraj Air
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name "Chai Builder" nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md CHANGED
@@ -1,41 +1,143 @@
1
- # Chai Builder - Multipurpose Tailwind CSS Builder
1
+ # Chai Builder - Low-Code Visual Builder
2
2
 
3
- Chai Builder is a simple multipurpose Tailwind CSS builder designed to streamline and enhance your web development workflow. This tool simplifies the process of customizing and generating Tailwind CSS styles, providing an intuitive interface for creating, editing, and exporting Tailwind configurations.
3
+ Chai Builder is an Open Source Low Code React + Tailwind CSS Builder to create beautiful content driven websites. The perfect tool for Startups and Indie-Hackers alike.
4
4
 
5
- ## Features
6
5
 
7
- - **Visual Editor**: Easily tweak and fine-tune Tailwind CSS settings visually.
8
- - **Live Preview**: See real-time changes in a live preview, enabling quick design decisions.
9
- - **Customization**: Modify colors, spacing, typography, and more to match your design requirements.
10
- - **Responsive Design**: Test and preview designs across various screen sizes to ensure responsiveness.
6
+ ### Try Chai Builder:
7
+
8
+ [Demo Link](https://chaibuilder-demo.vercel.app)
11
9
 
10
+ Source Code (React App): [GitHub](https://github.com/surajair/demo)
12
11
 
13
- ## Usage
14
12
 
15
- 2. **Install dependencies**:
13
+ ### Usage
16
14
 
15
+ > Please ensure `Tailwind CSS` is configured for your project depending on framework. [https://tailwindcss.com/docs/installation](https://tailwindcss.com/docs/installation)
16
+
17
+ Step 1: Install the package
17
18
  ```bash
18
- npx chaibuilder-app my-app
19
+ npm install @chaibuilder/sdk @chaibuilder/blocks
19
20
  ```
20
21
 
21
- 3. **Start the development server**:
22
+ Step 2: Add a custom tailwind config.
23
+ Create a new file: `tailwind.chaibuilder.config.ts` and add the following content.
24
+ ```js
25
+ import type { Config } from "tailwindcss";
26
+
27
+ /**
28
+ * NOTE: This file is only used for the ChaiBuilder UI.
29
+ * Any changes made here will only affect the ChaiBuilder UI and your website will not be affected.
30
+ */
31
+ const config: Config = {
32
+ content: [
33
+ "./chai-blocks/**/*.{js,ts,jsx,tsx,mdx}",
34
+ "./app/**/*.{js,ts,jsx,tsx,mdx}",
35
+ "node_modules/@chaibuilder/sdk/dist/*.{js,cjs}",
36
+ ],
37
+ darkMode: "class",
38
+ theme: {
39
+ extend: {
40
+ colors: {
41
+ border: "hsl(var(--border))",
42
+ input: "hsl(var(--input))",
43
+ ring: "hsl(var(--ring))",
44
+ background: "hsl(var(--background))",
45
+ foreground: "hsl(var(--foreground))",
46
+ primary: {
47
+ DEFAULT: "hsl(var(--primary))",
48
+ foreground: "hsl(var(--primary-foreground))",
49
+ },
50
+ secondary: {
51
+ DEFAULT: "hsl(var(--secondary))",
52
+ foreground: "hsl(var(--secondary-foreground))",
53
+ },
54
+ destructive: {
55
+ DEFAULT: "hsl(var(--destructive))",
56
+ foreground: "hsl(var(--destructive-foreground))",
57
+ },
58
+ muted: {
59
+ DEFAULT: "hsl(var(--muted))",
60
+ foreground: "hsl(var(--muted-foreground))",
61
+ },
62
+ accent: {
63
+ DEFAULT: "hsl(var(--accent))",
64
+ foreground: "hsl(var(--accent-foreground))",
65
+ },
66
+ popover: {
67
+ DEFAULT: "hsl(var(--popover))",
68
+ foreground: "hsl(var(--popover-foreground))",
69
+ },
70
+ card: {
71
+ DEFAULT: "hsl(var(--card))",
72
+ foreground: "hsl(var(--card-foreground))",
73
+ },
74
+ },
75
+ borderRadius: {
76
+ lg: `var(--radius)`,
77
+ md: `calc(var(--radius) - 2px)`,
78
+ sm: "calc(var(--radius) - 4px)",
79
+ },
80
+ keyframes: {
81
+ "accordion-down": {
82
+ from: { height: "0" },
83
+ to: { height: "var(--radix-accordion-content-height)" },
84
+ },
85
+ "accordion-up": {
86
+ from: { height: "var(--radix-accordion-content-height)" },
87
+ to: { height: "0" },
88
+ },
89
+ },
90
+ animation: {
91
+ "accordion-down": "accordion-down 0.2s ease-out",
92
+ "accordion-up": "accordion-up 0.2s ease-out",
93
+ },
94
+ },
95
+ },
96
+ // eslint-disable-next-line no-undef
97
+ plugins: [],
98
+ };
99
+ export default config;
22
100
 
23
- ```bash
24
- npm run dev
25
101
  ```
26
102
 
27
- 4. **Access the application**:
103
+ Step 3: Create a new `chaibuilder.tailwind.css`
104
+ ```css
105
+ @config "./tailwind.chaibuilder.config.ts";
106
+
107
+ @tailwind base;
108
+ @tailwind components;
109
+ @tailwind utilities;
110
+ ```
111
+
112
+ Step 4: Add the component on the page.
113
+ ```tsx
114
+ import "./chaibuilder.tailwind.css";
115
+ import "@chaibuilder/sdk/styles";
116
+ import {ChaiBuilderEditor} from "@chaibuilder/sdk";
117
+
118
+ const BuilderFullPage = () => {
119
+ return (
120
+ <ChaiBuilderEditor
121
+ logo={<h1>Your Logo</h1>}
122
+ blocks={[]}
123
+ onSaveBrandingOptions={(options) => console.log(options)}
124
+ onSavePage={pageData => console.log(pageData)}
125
+ />
126
+ );
127
+ }
128
+ ```
28
129
 
29
- Visit `http://localhost:3000` in your browser to start using Chai Builder.
30
130
 
31
- ## Fair Usage Policy
32
- Chai Builder operates under a Fair Usage Policy. While this tool is available for free and open use, we kindly request users to employ it responsibly and ethically. The Fair Usage Policy for Chai Builder encompasses:
131
+ ### Features
33
132
 
133
+ - **Visual Editor**: Easily tweak and fine-tune Tailwind CSS settings visually.
134
+ - **Customization**: Modify colors, spacing, typography, and more to match your design requirements.
135
+ - **Responsive Design**: Test and preview designs across various screen sizes to ensure responsiveness.
136
+
137
+ ### In Progress
138
+ - **Live Preview**: See real-time changes in a live preview, enabling quick design decisions.
139
+ - **Sub Pages**: Global reusable blocks. Eg: Header, Footer etc
34
140
 
35
141
  ## Acknowledgments
36
142
 
37
143
  Chai Builder stands on the shoulders of many open-source libraries and tools. We extend our gratitude to the developers and maintainers of these projects for their contributions.
38
-
39
- ---
40
-
41
- Feel free to adjust this to fit the specifics of your project, and add any additional sections or details as needed.
@@ -0,0 +1,3 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),i=require("react"),s=require("lodash"),b=require("jotai"),w=require("./accordion-ynvFtV_p.cjs"),L=require("./scroll-area-FiHvy-TZ.cjs"),k=require("./tabs-iWeaaVrg.cjs"),y=require("./skeleton-JHP9zwL2.cjs"),v=require("react-dnd"),C=require("@radix-ui/react-icons"),d=require("./ChaiBuilderEditor-BoE-sArB.cjs"),q=require("./useAddBlock-dCKRFPRU.cjs");require("react-i18next");const A=require("./index-HAue58ea.cjs"),I=require("./useUiLibraries-9FhQCpKo.cjs"),P=require("lucide-react"),S=require("./utils-qK_SjzzV.cjs"),M=require("./useAllBlocks-6hvuNuyw.cjs"),f=require("./textarea-1kZEh7ki.cjs"),F=require("./label-tFm8HZdb.cjs"),H=require("./html-to-json-P6GpbcQX.cjs");require("@radix-ui/react-accordion");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("./MODIFIERS-Fx6WAZcw.cjs");require("clsx");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@react-hookz/web");require("./controls-xUKa23ic.cjs");require("tailwind-merge");require("@radix-ui/react-label");require("himalaya");const D=({block:t})=>{const{type:r,icon:o,label:a}=t,{addCoreBlock:u,addPredefinedBlock:m}=q.useAddBlock(),[p]=d.useSelectedBlockIds(),[,x]=b.useAtom(d.activePanelAtom),[,l]=b.useAtom(d.addBlocksModalAtom),E=()=>{s.has(t,"blocks")?m(A.P(t.blocks),s.first(p)):u(t,s.first(p)),l(!1),x("layers")},[,g,j]=v.useDrag(()=>({type:"CHAI_BLOCK",item:t}));return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(v.DragPreviewImage,{connect:j,src:"https://placehold.co/100x30/000000/FFF?text="+(a||r).replace(/ /g,"+")}),e.jsxRuntimeExports.jsxs(y.Tooltip,{children:[e.jsxRuntimeExports.jsx(y.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{onClick:E,type:"button",ref:g,className:"cursor-grab space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50",children:[i.createElement(o||C.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"truncate text-xs",children:a||r})]})}),e.jsxRuntimeExports.jsx(y.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:a||r})})]})]})},O=({block:t,closePopover:r})=>{var j;const[o,a]=i.useState(!1),u=y.useBuilderProp("getExternalPredefinedBlock"),{addCoreBlock:m,addPredefinedBlock:p}=q.useAddBlock(),[x]=d.useSelectedBlockIds(),[,l,E]=v.useDrag(()=>({type:"CHAI_BLOCK",item:t}),[t]),g=i.useCallback(async R=>{if(R.stopPropagation(),s.has(t,"component")){m(t,s.first(x)),r();return}a(!0);const n=await u(t);s.isEmpty(n)||p(A.P(n),s.first(x)),r()},[t]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(v.DragPreviewImage,{connect:E,src:"https://placehold.co/100x30/000000/FFF?text="+((j=t.name||t.label)==null?void 0:j.replace(" ","+"))}),e.jsxRuntimeExports.jsxs("div",{ref:l,onClick:o?()=>{}:g,className:"relative cursor-grab overflow-hidden rounded-md border border-transparent duration-200 hover:scale-x-105 hover:border-foreground/20 hover:shadow-2xl",children:[o&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70",children:[e.jsxRuntimeExports.jsx(P.Loader,{className:"animate-spin",size:15,color:"white"})," ",e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),t.preview?e.jsxRuntimeExports.jsx("img",{src:t.preview,className:"min-h-[50px] w-full rounded-md border border-gray-300",alt:t.name}):e.jsxRuntimeExports.jsx("div",{className:"flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200",children:e.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-center text-sm text-gray-700",children:t.name})})]})]})},U=()=>{const{data:t,isLoading:r}=I.useUILibraryBlocks(),o=A.C(),a=s.filter(s.values(o),{category:"custom"}),u=s.groupBy(a,"group"),m=s.groupBy(t,"group"),[p,x]=i.useState(null),l=i.useMemo(()=>s.mergeWith(u,m,(n,h)=>{if(s.isArray(n)&&s.isArray(h))return[...n,...h]}),[u,m]),[,E]=b.useAtom(d.addBlocksModalAtom),[g,j]=i.useState("Navbar"),R=s.get(l,g,[]);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full max-h-full overflow-hidden py-2",children:[e.jsxRuntimeExports.jsx("ul",{className:"sticky top-0 h-full w-48 space-y-1 overflow-y-auto border-r px-2",children:r?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("li",{className:"h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"})]}):i.Children.toArray(s.map(l,(n,h)=>e.jsxRuntimeExports.jsx("li",{onMouseOut:()=>{clearTimeout(p),x(null)},onMouseEnter:()=>{const B=setTimeout(()=>{j(h)},300);x(B)},onClick:()=>j(h),className:S.cn("-mx-2 cursor-default rounded-md rounded-r-none px-2 py-1 text-sm font-medium capitalize",g===h?"bg-blue-500 text-white":" text-gray-700 hover:bg-foreground/10"),children:h})))}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-full space-y-2 overflow-y-auto px-8",children:i.Children.toArray(R.map(n=>e.jsxRuntimeExports.jsx(O,{block:n,closePopover:()=>E(!1)})))})]})},z=()=>{const[t,r]=i.useState(""),{addPredefinedBlock:o}=q.useAddBlock(),[a]=d.useSelectedBlockIds(),[,u]=b.useAtom(d.addBlockOffCanvasAtom),[,m]=b.useAtom(d.activePanelAtom),[,p]=b.useAtom(d.addBlocksModalAtom),x=()=>{const l=H.getBlocksFromHTML(t);o([...l],s.first(a)||null),r(""),u(!1),m("layers"),p(!1)};return e.jsxRuntimeExports.jsxs(f.Card,{className:"border-border/0 p-0 shadow-none",children:[e.jsxRuntimeExports.jsxs(f.CardHeader,{className:"p-3",children:[e.jsxRuntimeExports.jsx(f.CardTitle,{children:"Import HTML"}),e.jsxRuntimeExports.jsx(f.CardDescription,{children:"Use HTML snippets from component libraries like Tailwind UI, Flowbite, Preline, Kitwind, Tailblocks etc. or just copy paste your own HTML code. Only Tailwind CSS markup is supported."})]}),e.jsxRuntimeExports.jsx(f.CardContent,{className:"space-y-2 px-3 py-0",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[e.jsxRuntimeExports.jsx(F.Label,{htmlFor:"current",className:"text-sm",children:"Enter HTML Code:"}),e.jsxRuntimeExports.jsx(f.Textarea,{autoFocus:!0,tabIndex:1,ref:l=>l&&l.focus(),defaultValue:t,onChange:l=>r(l.target.value),rows:12,placeholder:`<div>
2
+ <h1>Enter code here</h1>
3
+ </div>`,className:"resize-none overflow-x-auto whitespace-pre font-mono font-normal"})]})}),e.jsxRuntimeExports.jsxs(f.CardFooter,{className:"flex flex-col justify-end p-3",children:[e.jsxRuntimeExports.jsx(y.Button,{disabled:t.trim()==="",onClick:()=>x(),size:"sm",className:"w-full",children:"Import"}),e.jsxRuntimeExports.jsxs(f.Alert,{variant:"default",className:"mt-2 p-1 text-blue-400",children:[e.jsxRuntimeExports.jsx(C.ExclamationTriangleIcon,{className:"h-4 w-4"}),e.jsxRuntimeExports.jsx(f.AlertTitle,{className:"text-sm leading-4",children:"Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page."})]})]})]})},G=z,N=["ListItem","TableHead","TableBody","TableRow","TableCell","Column"],_=(t,r)=>{if(!t)return!s.includes(N,r);const o=t._type;return o==="List"?r==="ListItem":o==="Table"?r==="TableHead"||r==="TableBody":o==="TableHead"||o==="TableBody"?r==="TableRow":o==="TableRow"?r==="TableCell":o==="Row"?r==="Column":!s.includes(N,r)},K=()=>{const[t,r]=i.useState("core"),[o,a]=i.useState("basic"),u=A.C(),[,m]=b.useAtom(d.showPredefinedBlockCategoryAtom),[,p]=b.useAtom(d.addBlocksModalAtom),[x]=d.useSelectedBlockIds(),l=M.useAllBlocks(),E=s.find(l,{_id:s.first(x)}),{data:g,isLoading:j}=I.useUILibraryBlocks(),R=s.groupBy(s.filter(u,c=>_(E,c.type)),"category"),n=s.uniq(s.map(R.core,"group"));i.useEffect(()=>{!s.includes(n,o)&&!s.isEmpty(n)&&!s.isEmpty(o)&&a(s.first(n))},[n,o]);const h=c=>a(T=>T===c?"":c),B=!j&&!s.isEmpty(g)||s.find(s.values(u),{category:"custom"})!==void 0;return e.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsxs("h1",{className:"flex flex-col items-baseline px-1 text-2xl font-semibold xl:flex-row",children:["Add block",e.jsxRuntimeExports.jsx("span",{className:"p-0 text-xs font-light leading-3 opacity-80 xl:pl-1",children:t==="html"?"(Enter or paste your own HTML code)":"(Drag & drop into tree view or click to add)"})]}),e.jsxRuntimeExports.jsxs("button",{onClick:()=>p(!1),className:"flex h-max items-center gap-x-1 rounded-full border p-px text-xs text-gray-800 hover:bg-gray-100 md:p-2",children:[e.jsxRuntimeExports.jsx(C.Cross1Icon,{width:12})," Close"]})]}),e.jsxRuntimeExports.jsx(k.Tabs,{onValueChange:c=>{m(""),r(c)},value:t,className:"h-max",children:e.jsxRuntimeExports.jsxs(k.TabsList,{className:"grid w-full "+(B?"grid-cols-3":"grid-cols-2"),children:[e.jsxRuntimeExports.jsx(k.TabsTrigger,{value:"core",children:"Core"}),B?e.jsxRuntimeExports.jsx(k.TabsTrigger,{value:"ui-blocks",children:"UI Blocks"}):null,e.jsxRuntimeExports.jsx(k.TabsTrigger,{value:"html",children:"Import"})]})}),t==="core"&&e.jsxRuntimeExports.jsx(L.ScrollArea,{className:"-mx-1.5 h-full",children:e.jsxRuntimeExports.jsx(w.Accordion,{type:"single",value:o,className:"w-full px-3",children:i.Children.toArray(s.map(n,c=>s.reject(s.filter(s.values(R.core),{group:c}),{hidden:!0}).length?e.jsxRuntimeExports.jsxs(w.AccordionItem,{value:c,className:"border-border",children:[e.jsxRuntimeExports.jsx(w.AccordionTrigger,{onClick:()=>h(c),className:"py-2 capitalize",children:c}),e.jsxRuntimeExports.jsx(w.AccordionContent,{children:e.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-4 gap-2",children:i.Children.toArray(s.reject(s.filter(s.values(R.core),{group:c}),{hidden:!0}).map(T=>e.jsxRuntimeExports.jsx(D,{block:T})))})})]}):null))})}),t==="ui-blocks"&&e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(y.Skeleton,{className:"h-32 w-full"}),children:e.jsxRuntimeExports.jsx(U,{})}),t==="html"&&e.jsxRuntimeExports.jsx(G,{})]})};exports.default=K;
@@ -1,30 +1,32 @@
1
- import { j as e } from "./jsx-runtime-944c88e2.js";
2
- import v, { createElement as K, useState as j, useMemo as W, useCallback as q, useEffect as V, Suspense as $ } from "react";
3
- import { has as _, first as b, filter as w, values as k, groupBy as I, mergeWith as Z, isArray as H, get as J, map as L, isEmpty as B, find as M, uniq as Q, includes as P, reject as E } from "lodash";
1
+ import { j as e } from "./jsx-runtime-Sp0orL4X.js";
2
+ import v, { createElement as K, useState as j, useMemo as q, useCallback as V, useEffect as Q, Suspense as W } from "react";
3
+ import { has as R, first as b, filter as w, values as k, groupBy as I, mergeWith as $, isArray as H, get as J, map as L, isEmpty as T, find as M, uniq as X, includes as P, reject as E } from "lodash";
4
4
  import { useAtom as h } from "jotai";
5
- import { A as X, a as Y, b as ee, c as se } from "./accordion-c0176dc5.js";
6
- import { S as re } from "./scroll-area-83bd9e8f.js";
7
- import { T as oe, a as te, b as A } from "./tabs-85caa1e8.js";
8
- import { l as le, m as ae, n as ce, u as ie, B as ne, S as de } from "./useBuilderProp-21feb2da.js";
9
- import { useDrag as R, DragPreviewImage as O } from "react-dnd";
5
+ import { A as Y, a as Z, b as ee, c as se } from "./accordion-oPUeqPCZ.js";
6
+ import { S as re } from "./scroll-area-ewXbxc3n.js";
7
+ import { T as oe, a as te, b as A } from "./tabs-Gb9v5dVb.js";
8
+ import { T as le, a as ae, c as ce, u as ie, B as ne, S as de } from "./skeleton-CU_FIbg3.js";
9
+ import { useDrag as _, DragPreviewImage as O } from "react-dnd";
10
10
  import { BoxIcon as me, ExclamationTriangleIcon as ue, Cross1Icon as pe } from "@radix-ui/react-icons";
11
- import { W as F, i as C, a as z, b as T, Z as D, _ as xe, $ as he, B as fe } from "./index-aa42febc.js";
11
+ import { l as C, w as z, x as B, P as xe, Q as he } from "./ChaiBuilderEditor-hEuUONQ3.js";
12
+ import { u as F } from "./useAddBlock-WJc3OgG8.js";
12
13
  import "react-i18next";
13
- import { syncBlocksWithDefaults as G, useChaiBlocks as U } from "@chaibuilder/blocks";
14
- import { Loader as ge } from "lucide-react";
15
- import { c as be } from "./utils-ac68b2c8.js";
16
- import { C as je, c as ye, e as we, f as ke, g as Be, T as ve, d as Ce, A as Te, a as Ne } from "./textarea-0750bcd2.js";
17
- import { L as Ae } from "./label-e770a087.js";
18
- import { b as Ie } from "./html-to-json-45e0e3b5.js";
14
+ import { P as G, C as U } from "./index-ehKdBRUK.js";
15
+ import { u as D } from "./useUiLibraries-4hPOi8DI.js";
16
+ import { Loader as fe } from "lucide-react";
17
+ import { c as ge } from "./utils-dze1SGvB.js";
18
+ import { u as be } from "./useAllBlocks-PQKYvs-e.js";
19
+ import { C as je, c as ye, e as we, f as ke, g as Te, T as ve, d as Ce, A as Be, a as Ne } from "./textarea-b2QvVhrK.js";
20
+ import { L as Ae } from "./label-KaP7MRrs.js";
21
+ import { g as Ie } from "./html-to-json-pdHQfRkN.js";
19
22
  import "@radix-ui/react-accordion";
20
23
  import "@radix-ui/react-scroll-area";
21
24
  import "@radix-ui/react-tabs";
22
- import "@radix-ui/react-alert-dialog";
23
25
  import "@radix-ui/react-slot";
24
26
  import "class-variance-authority";
25
27
  import "@radix-ui/react-tooltip";
26
28
  import "@radix-ui/react-toast";
27
- import "./MODIFIERS-2f19c314.js";
29
+ import "./MODIFIERS-DsEzQ3aH.js";
28
30
  import "clsx";
29
31
  import "react-dom";
30
32
  import "@floating-ui/react-dom";
@@ -33,16 +35,17 @@ import "flagged";
33
35
  import "@minoru/react-dnd-treeview";
34
36
  import "react-hotkeys-hook";
35
37
  import "flat-to-nested";
38
+ import "./functions-pcUZhFJM.js";
36
39
  import "redux-undo";
37
40
  import "@react-hookz/web";
38
- import "sonner";
41
+ import "./controls-Ni5kEzLz.js";
39
42
  import "tailwind-merge";
40
43
  import "@radix-ui/react-label";
41
44
  import "himalaya";
42
45
  const Le = ({ block: s }) => {
43
- const { type: r, icon: o, label: a } = s, { addCoreBlock: i, addPredefinedBlock: d } = F(), [m] = C(), [, n] = h(z), [, t] = h(T), f = () => {
44
- _(s, "blocks") ? d(G(s.blocks), b(m)) : i(s, b(m)), t(!1), n("layers");
45
- }, [, x, u] = R(() => ({
46
+ const { type: r, icon: o, label: a } = s, { addCoreBlock: i, addPredefinedBlock: d } = F(), [m] = C(), [, n] = h(z), [, t] = h(B), f = () => {
47
+ R(s, "blocks") ? d(G(s.blocks), b(m)) : i(s, b(m)), t(!1), n("layers");
48
+ }, [, x, u] = _(() => ({
46
49
  type: "CHAI_BLOCK",
47
50
  item: s
48
51
  }));
@@ -73,21 +76,21 @@ const Le = ({ block: s }) => {
73
76
  ] });
74
77
  }, Pe = ({ block: s, closePopover: r }) => {
75
78
  var u;
76
- const [o, a] = j(!1), i = ie("getExternalPredefinedBlock"), { addCoreBlock: d, addPredefinedBlock: m } = F(), [n] = C(), [, t, f] = R(
79
+ const [o, a] = j(!1), i = ie("getExternalPredefinedBlock"), { addCoreBlock: d, addPredefinedBlock: m } = F(), [n] = C(), [, t, f] = _(
77
80
  () => ({
78
81
  type: "CHAI_BLOCK",
79
82
  item: s
80
83
  }),
81
84
  [s]
82
- ), x = q(
85
+ ), x = V(
83
86
  async (g) => {
84
- if (g.stopPropagation(), _(s, "component")) {
87
+ if (g.stopPropagation(), R(s, "component")) {
85
88
  d(s, b(n)), r();
86
89
  return;
87
90
  }
88
91
  a(!0);
89
92
  const l = await i(s);
90
- B(l) || m(G(l), b(n)), r();
93
+ T(l) || m(G(l), b(n)), r();
91
94
  },
92
95
  [s]
93
96
  );
@@ -108,7 +111,7 @@ const Le = ({ block: s }) => {
108
111
  className: "relative cursor-grab overflow-hidden rounded-md border border-transparent duration-200 hover:scale-x-105 hover:border-foreground/20 hover:shadow-2xl",
109
112
  children: [
110
113
  o && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70", children: [
111
- /* @__PURE__ */ e.jsx(ge, { className: "animate-spin", size: 15, color: "white" }),
114
+ /* @__PURE__ */ e.jsx(fe, { className: "animate-spin", size: 15, color: "white" }),
112
115
  " ",
113
116
  /* @__PURE__ */ e.jsx("span", { className: "pl-2 text-sm text-white", children: "Adding..." })
114
117
  ] }),
@@ -118,10 +121,10 @@ const Le = ({ block: s }) => {
118
121
  )
119
122
  ] });
120
123
  }, Fe = () => {
121
- const { data: s, isLoading: r } = D(), o = U(), a = w(k(o), { category: "custom" }), i = I(a, "group"), d = I(s, "group"), [m, n] = j(null), t = W(() => Z(i, d, (l, p) => {
124
+ const { data: s, isLoading: r } = D(), o = U(), a = w(k(o), { category: "custom" }), i = I(a, "group"), d = I(s, "group"), [m, n] = j(null), t = q(() => $(i, d, (l, p) => {
122
125
  if (H(l) && H(p))
123
126
  return [...l, ...p];
124
- }), [i, d]), [, f] = h(T), [x, u] = j("Navbar"), g = J(t, x, []);
127
+ }), [i, d]), [, f] = h(B), [x, u] = j("Navbar"), g = J(t, x, []);
125
128
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full max-h-full overflow-hidden py-2", children: [
126
129
  /* @__PURE__ */ e.jsx("ul", { className: "sticky top-0 h-full w-48 space-y-1 overflow-y-auto border-r px-2", children: r ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
127
130
  /* @__PURE__ */ e.jsx("li", { className: "h-8 w-full animate-pulse bg-gray-200" }),
@@ -144,7 +147,7 @@ const Le = ({ block: s }) => {
144
147
  n(y);
145
148
  },
146
149
  onClick: () => u(p),
147
- className: be(
150
+ className: ge(
148
151
  "-mx-2 cursor-default rounded-md rounded-r-none px-2 py-1 text-sm font-medium capitalize",
149
152
  x === p ? "bg-blue-500 text-white" : " text-gray-700 hover:bg-foreground/10"
150
153
  ),
@@ -157,7 +160,7 @@ const Le = ({ block: s }) => {
157
160
  ) })
158
161
  ] });
159
162
  }, He = () => {
160
- const [s, r] = j(""), { addPredefinedBlock: o } = F(), [a] = C(), [, i] = h(xe), [, d] = h(z), [, m] = h(T), n = () => {
163
+ const [s, r] = j(""), { addPredefinedBlock: o } = F(), [a] = C(), [, i] = h(xe), [, d] = h(z), [, m] = h(B), n = () => {
161
164
  const t = Ie(s);
162
165
  o([...t], b(a) || null), r(""), i(!1), d("layers"), m(!1);
163
166
  };
@@ -166,7 +169,7 @@ const Le = ({ block: s }) => {
166
169
  /* @__PURE__ */ e.jsx(we, { children: "Import HTML" }),
167
170
  /* @__PURE__ */ e.jsx(ke, { children: "Use HTML snippets from component libraries like Tailwind UI, Flowbite, Preline, Kitwind, Tailblocks etc. or just copy paste your own HTML code. Only Tailwind CSS markup is supported." })
168
171
  ] }),
169
- /* @__PURE__ */ e.jsx(Be, { className: "space-y-2 px-3 py-0", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
172
+ /* @__PURE__ */ e.jsx(Te, { className: "space-y-2 px-3 py-0", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
170
173
  /* @__PURE__ */ e.jsx(Ae, { htmlFor: "current", className: "text-sm", children: "Enter HTML Code:" }),
171
174
  /* @__PURE__ */ e.jsx(
172
175
  ve,
@@ -186,7 +189,7 @@ const Le = ({ block: s }) => {
186
189
  ] }) }),
187
190
  /* @__PURE__ */ e.jsxs(Ce, { className: "flex flex-col justify-end p-3", children: [
188
191
  /* @__PURE__ */ e.jsx(ne, { disabled: s.trim() === "", onClick: () => n(), size: "sm", className: "w-full", children: "Import" }),
189
- /* @__PURE__ */ e.jsxs(Te, { variant: "default", className: "mt-2 p-1 text-blue-400", children: [
192
+ /* @__PURE__ */ e.jsxs(Be, { variant: "default", className: "mt-2 p-1 text-blue-400", children: [
190
193
  /* @__PURE__ */ e.jsx(ue, { className: "h-4 w-4" }),
191
194
  /* @__PURE__ */ e.jsx(Ne, { className: "text-sm leading-4", children: "Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page." })
192
195
  ] })
@@ -198,14 +201,14 @@ const Le = ({ block: s }) => {
198
201
  const o = s._type;
199
202
  return o === "List" ? r === "ListItem" : o === "Table" ? r === "TableHead" || r === "TableBody" : o === "TableHead" || o === "TableBody" ? r === "TableRow" : o === "TableRow" ? r === "TableCell" : o === "Row" ? r === "Column" : !P(S, r);
200
203
  }, Bs = () => {
201
- const [s, r] = j("core"), [o, a] = j("basic"), i = U(), [, d] = h(he), [, m] = h(T), [n] = C(), t = fe(), f = M(t, { _id: b(n) }), { data: x, isLoading: u } = D(), g = I(
204
+ const [s, r] = j("core"), [o, a] = j("basic"), i = U(), [, d] = h(he), [, m] = h(B), [n] = C(), t = be(), f = M(t, { _id: b(n) }), { data: x, isLoading: u } = D(), g = I(
202
205
  w(i, (c) => Ee(f, c.type)),
203
206
  "category"
204
- ), l = Q(L(g.core, "group"));
205
- V(() => {
206
- !P(l, o) && !B(l) && !B(o) && a(b(l));
207
+ ), l = X(L(g.core, "group"));
208
+ Q(() => {
209
+ !P(l, o) && !T(l) && !T(o) && a(b(l));
207
210
  }, [l, o]);
208
- const p = (c) => a((N) => N === c ? "" : c), y = !u && !B(x) || M(k(i), { category: "custom" }) !== void 0;
211
+ const p = (c) => a((N) => N === c ? "" : c), y = !u && !T(x) || M(k(i), { category: "custom" }) !== void 0;
209
212
  return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
210
213
  /* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex justify-between rounded-md bg-background/30 p-1", children: [
211
214
  /* @__PURE__ */ e.jsxs("h1", { className: "flex flex-col items-baseline px-1 text-2xl font-semibold xl:flex-row", children: [
@@ -239,12 +242,12 @@ const Le = ({ block: s }) => {
239
242
  ] })
240
243
  }
241
244
  ),
242
- s === "core" && /* @__PURE__ */ e.jsx(re, { className: "-mx-1.5 h-full", children: /* @__PURE__ */ e.jsx(X, { type: "single", value: o, className: "w-full px-3", children: v.Children.toArray(
245
+ s === "core" && /* @__PURE__ */ e.jsx(re, { className: "-mx-1.5 h-full", children: /* @__PURE__ */ e.jsx(Y, { type: "single", value: o, className: "w-full px-3", children: v.Children.toArray(
243
246
  L(
244
247
  l,
245
248
  (c) => E(w(k(g.core), { group: c }), {
246
249
  hidden: !0
247
- }).length ? /* @__PURE__ */ e.jsxs(Y, { value: c, className: "border-border", children: [
250
+ }).length ? /* @__PURE__ */ e.jsxs(Z, { value: c, className: "border-border", children: [
248
251
  /* @__PURE__ */ e.jsx(ee, { onClick: () => p(c), className: "py-2 capitalize", children: c }),
249
252
  /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 gap-2", children: v.Children.toArray(
250
253
  E(w(k(g.core), { group: c }), { hidden: !0 }).map((N) => /* @__PURE__ */ e.jsx(Le, { block: N }))
@@ -252,7 +255,7 @@ const Le = ({ block: s }) => {
252
255
  ] }) : null
253
256
  )
254
257
  ) }) }),
255
- s === "ui-blocks" && /* @__PURE__ */ e.jsx($, { fallback: /* @__PURE__ */ e.jsx(de, { className: "h-32 w-full" }), children: /* @__PURE__ */ e.jsx(Fe, {}) }),
258
+ s === "ui-blocks" && /* @__PURE__ */ e.jsx(W, { fallback: /* @__PURE__ */ e.jsx(de, { className: "h-32 w-full" }), children: /* @__PURE__ */ e.jsx(Fe, {}) }),
256
259
  s === "html" && /* @__PURE__ */ e.jsx(Me, {})
257
260
  ] });
258
261
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-JYMCiFoE.cjs"),O=require("react"),C=require("@rjsf/validator-ajv8"),B=require("@rjsf/core"),j=require("./ChaiBuilderEditor-BoE-sArB.cjs");require("react-i18next");const R=require("./skeleton-JHP9zwL2.cjs"),e=require("./controls-W97-POR_.cjs"),k=require("lodash");require("./MODIFIERS-Fx6WAZcw.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./utils-qK_SjzzV.cjs");require("tailwind-merge");require("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@react-hookz/web");require("./index-HAue58ea.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");function P(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const a in i)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(i,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>i[a]})}}return t.default=i,Object.freeze(t)}const c=P(O),v=[{title:"Roboto",value:"Roboto"},{title:"Open Sans",value:"Open Sans"},{title:"Montserrat",value:"Montserrat"},{title:"Lato",value:"Lato"},{title:"Poppins",value:"Poppins"},{title:"Oswald",value:"Oswald"},{title:"Raleway",value:"Raleway"},{title:"Ubuntu",value:"Ubuntu"},{title:"Nunito",value:"Nunito"},{title:"Merriweather",value:"Merriweather"},{title:"Nunito Sans",value:"Nunito Sans"},{title:"Playfair Display",value:"Playfair Display"},{title:"Rubik",value:"Rubik"},{title:"Inter",value:"Inter"},{title:"Lora",value:"Lora"},{title:"Kanit",value:"Kanit"},{title:"Fira Sans",value:"Fira Sans"},{title:"Hind",value:"Hind"},{title:"Quicksand",value:"Quicksand"},{title:"Mulish",value:"Mulish"},{title:"Barlow",value:"Barlow"},{title:"Inconsolata",value:"Inconsolata"},{title:"Titillium Web",value:"Titillium Web"},{title:"Heebo",value:"Heebo"},{title:"IBM Plex Sans",value:"IBM Plex Sans"},{title:"DM Sans",value:"DM Sans"},{title:"Nanum Gothic",value:"Nanum Gothic"},{title:"Karla",value:"Karla"},{title:"Arimo",value:"Arimo"},{title:"Cabin",value:"Cabin"},{title:"Oxygen",value:"Oxygen"},{title:"Overpass",value:"Overpass"},{title:"Assistant",value:"Assistant"},{title:"Tajawal",value:"Tajawal"},{title:"Play",value:"Play"},{title:"Exo",value:"Exo"},{title:"Cinzel",value:"Cinzel"},{title:"Faustina",value:"Faustina"},{title:"Philosopher",value:"Philosopher"},{title:"Gelasio",value:"Gelasio"},{title:"Sofia Sans Condensed",value:"Sofia Sans Condensed"},{title:"Noto Sans Devanagari",value:"Noto Sans Devanagari"},{title:"Actor",value:"Actor"},{title:"Epilogue",value:"Epilogue"},{title:"Glegoo",value:"Glegoo"},{title:"Overlock",value:"Overlock"},{title:"Lustria",value:"Lustria"},{title:"Ovo",value:"Ovo"},{title:"Suranna",value:"Suranna"}],D=()=>{const i=R.useBuilderProp("onSaveBrandingOptions",async()=>{}),[t,a]=j.useBrandingOptions(),r=c.useRef(t);c.useEffect(()=>()=>{k.isEqual(t,r.current)||i(r.current)},[]);const p=({formData:l},u)=>{u&&(a(l),r.current=l)},{bodyFont:y,headingFont:f,primaryColor:g,bodyTextDarkColor:b,bodyTextLightColor:m,bodyBgDarkColor:h,secondaryColor:q,bodyBgLightColor:x,roundedCorners:S}=t,s={headingFont:e.f({title:"Heading font",default:f,options:v}),bodyFont:e.f({title:"Body font",default:y,options:v}),roundedCorners:e.c({title:"Rounded Corner",default:parseInt(S||5,10)}),primaryColor:e.y({title:"Primary",default:g}),secondaryColor:e.y({title:"Secondary",default:q}),bodyBgLightColor:e.y({title:"Body Background (Light)",default:x}),bodyBgDarkColor:e.y({title:"Body Background (Dark)",default:h}),bodyTextLightColor:e.y({title:"Body Text (Light)",default:b}),bodyTextDarkColor:e.y({title:"Body Text (Dark)",default:m})},n={type:"object",properties:{}},d={};return Object.keys(s).forEach(l=>{const u=s[l];return n.properties||(n.properties={}),n.properties[l]=u.schema,d[l]=u.uiSchema,!0}),o.jsxRuntimeExports.jsxs("div",{className:"flex h-full select-none flex-col",children:[o.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:o.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Branding Options"})}),o.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:o.jsxRuntimeExports.jsx(B,{idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:d,schema:n,formData:t,validator:C,onChange:p})})]})};exports.default=D;
@@ -1,13 +1,13 @@
1
- import { j as a } from "./jsx-runtime-944c88e2.js";
1
+ import { j as a } from "./jsx-runtime-Sp0orL4X.js";
2
2
  import * as s from "react";
3
- import B from "@rjsf/validator-ajv8";
3
+ import O from "@rjsf/validator-ajv8";
4
4
  import k from "@rjsf/core";
5
- import { z as N } from "./index-aa42febc.js";
5
+ import { j } from "./ChaiBuilderEditor-hEuUONQ3.js";
6
6
  import "react-i18next";
7
- import { u as D } from "./useBuilderProp-21feb2da.js";
8
- import { SelectOption as p, Numeric as P, Color as e } from "@chaibuilder/blocks";
9
- import { isEqual as R } from "lodash";
10
- import "./MODIFIERS-2f19c314.js";
7
+ import { u as D } from "./skeleton-CU_FIbg3.js";
8
+ import { f as p, c as N, y as e } from "./controls-enQY7NI8.js";
9
+ import { isEqual as P } from "lodash";
10
+ import "./MODIFIERS-DsEzQ3aH.js";
11
11
  import "clsx";
12
12
  import "@radix-ui/react-scroll-area";
13
13
  import "react-dom";
@@ -17,21 +17,18 @@ import "i18next";
17
17
  import "flagged";
18
18
  import "react-dnd";
19
19
  import "@minoru/react-dnd-treeview";
20
- import "./utils-ac68b2c8.js";
20
+ import "./utils-dze1SGvB.js";
21
21
  import "tailwind-merge";
22
22
  import "react-hotkeys-hook";
23
23
  import "flat-to-nested";
24
- import "./html-to-json-45e0e3b5.js";
25
- import "himalaya";
24
+ import "./functions-pcUZhFJM.js";
26
25
  import "redux-undo";
27
26
  import "@react-hookz/web";
28
- import "@radix-ui/react-icons";
29
- import "sonner";
30
- import "lucide-react";
31
- import "@radix-ui/react-alert-dialog";
27
+ import "./index-ehKdBRUK.js";
32
28
  import "@radix-ui/react-slot";
33
29
  import "class-variance-authority";
34
30
  import "@radix-ui/react-tooltip";
31
+ import "@radix-ui/react-icons";
35
32
  import "@radix-ui/react-toast";
36
33
  const d = [
37
34
  { title: "Roboto", value: "Roboto" },
@@ -83,11 +80,11 @@ const d = [
83
80
  { title: "Lustria", value: "Lustria" },
84
81
  { title: "Ovo", value: "Ovo" },
85
82
  { title: "Suranna", value: "Suranna" }
86
- ], pt = () => {
83
+ ], nt = () => {
87
84
  const m = D("onSaveBrandingOptions", async () => {
88
- }), [o, v] = N(), r = s.useRef(o);
85
+ }), [o, v] = j(), r = s.useRef(o);
89
86
  s.useEffect(() => () => {
90
- R(o, r.current) || m(r.current);
87
+ P(o, r.current) || m(r.current);
91
88
  }, []);
92
89
  const c = ({ formData: t }, l) => {
93
90
  l && (v(t), r.current = t);
@@ -100,7 +97,7 @@ const d = [
100
97
  bodyBgDarkColor: S,
101
98
  secondaryColor: x,
102
99
  bodyBgLightColor: C,
103
- roundedCorners: O
100
+ roundedCorners: B
104
101
  } = o, n = {
105
102
  headingFont: p({
106
103
  title: "Heading font",
@@ -112,9 +109,9 @@ const d = [
112
109
  default: f,
113
110
  options: d
114
111
  }),
115
- roundedCorners: P({
112
+ roundedCorners: N({
116
113
  title: "Rounded Corner",
117
- default: parseInt(O || 5, 10)
114
+ default: parseInt(B || 5, 10)
118
115
  }),
119
116
  primaryColor: e({ title: "Primary", default: y }),
120
117
  secondaryColor: e({ title: "Secondary", default: x }),
@@ -155,12 +152,12 @@ const d = [
155
152
  uiSchema: u,
156
153
  schema: i,
157
154
  formData: o,
158
- validator: B,
155
+ validator: O,
159
156
  onChange: c
160
157
  }
161
158
  ) })
162
159
  ] });
163
160
  };
164
161
  export {
165
- pt as default
162
+ nt as default
166
163
  };