@chaibuilder/sdk 1.0.13 → 1.0.15

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 (168) hide show
  1. package/dist/{AddBlocks-H7BZYHUC.js → AddBlocks-eoo1CzaK.js} +114 -111
  2. package/dist/AddBlocks-jU0NwP_s.cjs +3 -0
  3. package/dist/BrandingOptions-WSCFnWAf.cjs +1 -0
  4. package/dist/{BrandingOptions-PAgY-kvj.js → BrandingOptions-_Og7VUHA.js} +57 -41
  5. package/dist/{CanvasArea-zn2ox-5h.js → CanvasArea-cky_d2Lu.js} +517 -519
  6. package/dist/CanvasArea-hT9uHhkz.cjs +46 -0
  7. package/dist/Class-RZuPYbUS.cjs +1 -0
  8. package/dist/{Class-l7qYbuoN.js → Class-nQk08vqd.js} +204 -124
  9. package/dist/{CurrentPage-6Jp4xAWK.js → CurrentPage--OlBwyNE.js} +58 -40
  10. package/dist/CurrentPage-x6Ez11gP.cjs +1 -0
  11. package/dist/Layers-gEA0qWYP.cjs +1 -0
  12. package/dist/{Layers-WkZ48AUm.js → Layers-uzA3QA-4.js} +158 -141
  13. package/dist/MarkAsGlobalBlock-lYL8cO9x.cjs +1 -0
  14. package/dist/MarkAsGlobalBlock-ySc-D4SB.js +84 -0
  15. package/dist/PagesPanel-5t0bV9T2.cjs +1 -0
  16. package/dist/PagesPanel-tH6c9Mnv.js +70 -0
  17. package/dist/ProjectPanel-NdrR6a8t.cjs +1 -0
  18. package/dist/ProjectPanel-Q2-15-In.js +91 -0
  19. package/dist/Settings-DBiwm1hY.cjs +1 -0
  20. package/dist/{Settings-fH8fZKpm.js → Settings-LOqpvQ_1.js} +411 -408
  21. package/dist/SidePanels-8JWYXGqN.cjs +1 -0
  22. package/dist/{SidePanels-w8ZHKJaR.js → SidePanels-F7ccs2Xf.js} +106 -88
  23. package/dist/{Topbar-hm1D_5sb.js → Topbar-lX9OMPwj.js} +47 -45
  24. package/dist/Topbar-qi5ab8rR.cjs +1 -0
  25. package/dist/UnsplashImages-a2r7b3kB.cjs +1 -0
  26. package/dist/{UnsplashImages-gPcBLjgB.js → UnsplashImages-u_QTABzi.js} +56 -44
  27. package/dist/{UploadImages-_ZyUU66E.js → UploadImages-gV5xDHIu.js} +55 -34
  28. package/dist/UploadImages-jLQgLujd.cjs +1 -0
  29. package/dist/add-page-modal-U5ramelz.js +110 -0
  30. package/dist/add-page-modal-tIt3N8jH.cjs +1 -0
  31. package/dist/confirm-alert-ZQ-sxX0X.js +58 -0
  32. package/dist/confirm-alert-z74-fGOT.cjs +1 -0
  33. package/dist/core.cjs +1 -1
  34. package/dist/core.js +99 -124
  35. package/dist/delete-page-modal-5XuSfQT0.cjs +1 -0
  36. package/dist/delete-page-modal-_E87bVUZ.js +89 -0
  37. package/dist/form-Osm1AmO5.cjs +1 -0
  38. package/dist/{form-dVpOAyRl.js → form-zZJyZuNH.js} +12 -12
  39. package/dist/index-2EHcmZqL.js +2947 -0
  40. package/dist/index-RVm8Txnj.js +1149 -0
  41. package/dist/index-_jFEo7h5.cjs +206 -0
  42. package/dist/index-c8zW_D2V.cjs +1 -0
  43. package/dist/index-cU5eyVRU.js +40872 -0
  44. package/dist/index-fwo4wa7u.cjs +1 -0
  45. package/dist/index-gmZcUXyn.js +25 -0
  46. package/dist/index-m2muA80V.cjs +9 -0
  47. package/dist/{jsx-runtime-JYMCiFoE.cjs → jsx-runtime-WKRPbKtm.cjs} +7 -7
  48. package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-qAwJ85SY.js} +109 -106
  49. package/dist/lib.cjs +2 -1
  50. package/dist/lib.js +1333 -71
  51. package/dist/page-viewer-BSc-5M4B.cjs +1 -0
  52. package/dist/{page-viewer-Y4YiaZ_m.js → page-viewer-nLqIs_9w.js} +62 -44
  53. package/dist/project-general-setting-14MA_cX5.cjs +1 -0
  54. package/dist/{project-general-setting-U4S_KlhU.js → project-general-setting-kXh5myAr.js} +46 -36
  55. package/dist/project-seo-setting-POGPEJZ8.cjs +1 -0
  56. package/dist/project-seo-setting-nT1qo1Bb.js +89 -0
  57. package/dist/render.cjs +1 -1
  58. package/dist/render.js +23 -19
  59. package/dist/server.cjs +1 -1
  60. package/dist/server.js +1 -1
  61. package/dist/single-page-detail-EgQd9TSA.cjs +1 -0
  62. package/dist/{single-page-detail-pAxCy_Pe.js → single-page-detail-fV-A6vJR.js} +90 -80
  63. package/dist/studio.cjs +1 -1
  64. package/dist/studio.js +45 -25
  65. package/dist/ui.cjs +1 -1
  66. package/dist/ui.js +156 -357
  67. package/package.json +1 -1
  68. package/dist/AddBlocks-7ACJv8LW.cjs +0 -3
  69. package/dist/BrandingOptions-5j-XszLM.cjs +0 -1
  70. package/dist/CanvasArea-Dnm-yeus.cjs +0 -46
  71. package/dist/ChaiBuilderEditor-BoE-sArB.cjs +0 -163
  72. package/dist/ChaiBuilderEditor-hEuUONQ3.js +0 -27094
  73. package/dist/Class-_uCzl5v1.cjs +0 -1
  74. package/dist/CurrentPage-YMpqOqx7.cjs +0 -1
  75. package/dist/ImagesPanel-6us7hiLN.cjs +0 -1
  76. package/dist/ImagesPanel-oaHOD-Ex.js +0 -27
  77. package/dist/Layers-EzOZdWvd.cjs +0 -1
  78. package/dist/MODIFIERS-DsEzQ3aH.js +0 -73
  79. package/dist/MODIFIERS-Fx6WAZcw.cjs +0 -1
  80. package/dist/MarkAsGlobalBlock-0HubcRkY.js +0 -77
  81. package/dist/MarkAsGlobalBlock-HmeIyLCP.cjs +0 -1
  82. package/dist/PagesPanel-6JuwBLFQ.js +0 -50
  83. package/dist/PagesPanel-zJq8p1ja.cjs +0 -1
  84. package/dist/ProjectPanel-Zml2F8b9.cjs +0 -1
  85. package/dist/ProjectPanel-cu2QSDW9.js +0 -73
  86. package/dist/Settings-lc9PfnmG.cjs +0 -1
  87. package/dist/SidePanels-VH72zFE2.cjs +0 -1
  88. package/dist/Topbar-vQPo9xSY.cjs +0 -1
  89. package/dist/UnsplashImages-BoBBSi1a.cjs +0 -1
  90. package/dist/UploadImages-T6kW0s3G.cjs +0 -1
  91. package/dist/accordion-oPUeqPCZ.js +0 -42
  92. package/dist/accordion-ynvFtV_p.cjs +0 -1
  93. package/dist/add-page-modal--qZSwJuB.cjs +0 -1
  94. package/dist/add-page-modal-bj7qbZuK.js +0 -99
  95. package/dist/alert-dialog-GNfnpqFB.js +0 -64
  96. package/dist/alert-dialog-Mv0-wAvS.cjs +0 -1
  97. package/dist/command-ThdTuUxt.cjs +0 -1
  98. package/dist/command-VHca6CcN.js +0 -97
  99. package/dist/confirm-alert-8EHe0OOd.cjs +0 -1
  100. package/dist/confirm-alert-b0e_BLhF.js +0 -36
  101. package/dist/context-menu-8dC9uGXj.js +0 -122
  102. package/dist/context-menu-IgLbIuth.cjs +0 -1
  103. package/dist/controls-Ni5kEzLz.js +0 -103
  104. package/dist/controls-W97-POR_.cjs +0 -1
  105. package/dist/controls-enQY7NI8.js +0 -118
  106. package/dist/controls-xUKa23ic.cjs +0 -1
  107. package/dist/delete-page-modal-2LuDLEiP.cjs +0 -1
  108. package/dist/delete-page-modal-cnrR8tWH.js +0 -69
  109. package/dist/dialog-S_QbL1iq.cjs +0 -1
  110. package/dist/dialog-jrw9DF1f.js +0 -65
  111. package/dist/dropdown-menu-S03K_fNs.js +0 -164
  112. package/dist/dropdown-menu-sMXR59cB.cjs +0 -1
  113. package/dist/form-nRAvKPQj.cjs +0 -1
  114. package/dist/functions-nNTuSTsR.js +0 -1106
  115. package/dist/functions-pcUZhFJM.js +0 -12
  116. package/dist/functions-sCuB7nvZ.cjs +0 -2
  117. package/dist/functions-uw7QP2kT.cjs +0 -1
  118. package/dist/html-to-json-P6GpbcQX.cjs +0 -1
  119. package/dist/html-to-json-pdHQfRkN.js +0 -178
  120. package/dist/index-HAue58ea.cjs +0 -1
  121. package/dist/index-T4_wfKl5.js +0 -2256
  122. package/dist/index-X9ZgD09V.cjs +0 -1
  123. package/dist/index-ehKdBRUK.js +0 -18
  124. package/dist/label-KaP7MRrs.js +0 -10
  125. package/dist/label-tFm8HZdb.cjs +0 -1
  126. package/dist/link-6o6n2Tnd.js +0 -204
  127. package/dist/link-ece8dZGH.cjs +0 -1
  128. package/dist/page-viewer-IARz6OSp.cjs +0 -1
  129. package/dist/popover-a84pbVhQ.js +0 -23
  130. package/dist/popover-fKjgcRUx.cjs +0 -1
  131. package/dist/project-general-setting-eSl3t-VH.cjs +0 -1
  132. package/dist/project-seo-setting-Ga9v_ECU.js +0 -67
  133. package/dist/project-seo-setting-rankm1z3.cjs +0 -1
  134. package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
  135. package/dist/scroll-area-ewXbxc3n.js +0 -30
  136. package/dist/select-7bjg-rr9.cjs +0 -1
  137. package/dist/select-POGdEDHT.js +0 -75
  138. package/dist/separator-3Civ-6hb.cjs +0 -1
  139. package/dist/separator-SctTn0Qi.js +0 -18
  140. package/dist/single-page-detail-yPgnu2AI.cjs +0 -1
  141. package/dist/skeleton-CU_FIbg3.js +0 -239
  142. package/dist/skeleton-JHP9zwL2.cjs +0 -1
  143. package/dist/tabs-Gb9v5dVb.js +0 -46
  144. package/dist/tabs-iWeaaVrg.cjs +0 -1
  145. package/dist/textarea-1kZEh7ki.cjs +0 -1
  146. package/dist/textarea-b2QvVhrK.js +0 -73
  147. package/dist/toggle-ASJRAaGP.js +0 -30
  148. package/dist/toggle-ehNIPmme.cjs +0 -1
  149. package/dist/useAddBlock-WJc3OgG8.js +0 -86
  150. package/dist/useAddBlock-dCKRFPRU.cjs +0 -1
  151. package/dist/useAllBlocks-6hvuNuyw.cjs +0 -1
  152. package/dist/useAllBlocks-PQKYvs-e.js +0 -20
  153. package/dist/useChaiExternalData-4K9WxANa.js +0 -6
  154. package/dist/useChaiExternalData-DkyBJ81C.cjs +0 -1
  155. package/dist/useDarkMode-ZKCO_gkt.js +0 -23
  156. package/dist/useDarkMode-dV6FM6l-.cjs +0 -1
  157. package/dist/useFeatureSupport-OLwNgEZb.js +0 -16
  158. package/dist/useFeatureSupport-c9IgPW2t.cjs +0 -1
  159. package/dist/useHiddenBlocks-3MsGOJ1s.js +0 -15
  160. package/dist/useHiddenBlocks-oJuQDmTy.cjs +0 -1
  161. package/dist/useLanguage-NKKKaxVM.cjs +0 -1
  162. package/dist/useLanguage-gVC5rxO5.js +0 -216
  163. package/dist/useMarkAsGlobalBlock-X73Vny8u.js +0 -25
  164. package/dist/useMarkAsGlobalBlock-ebBVGHg4.cjs +0 -1
  165. package/dist/useUiLibraries-4hPOi8DI.js +0 -12
  166. package/dist/useUiLibraries-9FhQCpKo.cjs +0 -1
  167. package/dist/utils-dze1SGvB.js +0 -6
  168. package/dist/utils-qK_SjzzV.cjs +0 -1
package/dist/ui.js CHANGED
@@ -1,377 +1,176 @@
1
- import { T as we, t as Me } from "./toggle-ASJRAaGP.js";
2
- import { D as ve, f as De, d as je, k as Ie, e as Re, h as Ae, l as ke, p as Pe, g as Le, i as Fe, j as Ge, m as He, n as ze, o as Ve, c as Be, H as Ee, b as Oe, a as qe, S as Je } from "./dropdown-menu-S03K_fNs.js";
3
- import { B as Qe, S as Ue, g as We, T as Xe, c as Ye, e as Ze, d as _e, a as $e, b as et, r as tt, t as at, f as ot } from "./skeleton-CU_FIbg3.js";
4
- import { A as rt, c as nt, a as it, b as dt } from "./accordion-oPUeqPCZ.js";
5
- import { A as mt, b as ct, a as pt, C as ut, g as ft, f as gt, d as xt, c as bt, e as ht, T as Ct } from "./textarea-b2QvVhrK.js";
6
- import { j as a } from "./jsx-runtime-Sp0orL4X.js";
7
- import { cva as m } from "class-variance-authority";
8
- import { c as r } from "./utils-dze1SGvB.js";
9
- import { A as Nt, g as St, h as wt, b as Mt, f as Tt, d as vt, c as Dt, e as jt, a as It } from "./alert-dialog-GNfnpqFB.js";
10
- import { D as At, b as kt, f as Pt, d as Lt, c as Ft, e as Gt, a as Ht } from "./dialog-jrw9DF1f.js";
11
- import { C as Vt, a as Bt, d as Et, e as Ot, b as qt, f as Jt, c as Kt, h as Qt, g as Ut, I as Wt } from "./command-VHca6CcN.js";
12
- import { L as Yt } from "./label-KaP7MRrs.js";
13
- import { S as _t, a as $t } from "./scroll-area-ewXbxc3n.js";
14
- import { T as ta, c as aa, a as oa, b as sa } from "./tabs-Gb9v5dVb.js";
15
- import { P as na, b as ia, a as da } from "./popover-a84pbVhQ.js";
16
- import * as i from "react";
17
- import { ChevronRightIcon as f, CheckIcon as g, DotFilledIcon as x, Cross2Icon as b } from "@radix-ui/react-icons";
18
- import * as s from "@radix-ui/react-menubar";
19
- import { S as ma, d as ca, a as pa, f as ua, e as fa, g as ga, c as xa, b as ba } from "./select-POGdEDHT.js";
20
- import * as n from "@radix-ui/react-dialog";
21
- import { S as Ca } from "./separator-SctTn0Qi.js";
22
- import { C as Na, d as Sa, b as wa, i as Ma, c as Ta, f as va, j as Da, n as ja, e as Ia, g as Ra, h as Aa, k as ka, l as Pa, m as La, a as Fa } from "./context-menu-8dC9uGXj.js";
23
- import { I as Ha, a as za, L as Va, R as Ba } from "./link-6o6n2Tnd.js";
1
+ import { bi as f, bl as q, bj as J, bk as K, bD as j, bI as N, D as O, at as Q, K as U, F as W, I as z, J as X, G as Y, H as Z, E as _, bE as $, bJ as aa, B as ea, bw as oa, bA as ta, bz as ra, bC as sa, bx as na, by as ia, b4 as ba, cl as pa, b7 as ua, b8 as ca, b5 as la, b9 as ma, b6 as Ca, cn as da, cm as ga, bs as Ma, co as Sa, br as Da, ct as Ta, bq as xa, cq as wa, cu as Aa, cy as Ia, cp as ha, cr as Pa, cs as Ga, cv as Fa, cw as Ha, cx as La, bt as ka, ao as va, ap as Ra, as as Ba, ba as Va, aq as Ea, ar as ya, bb as fa, aR as qa, aW as Ja, aT as Ka, cc as ja, c9 as Na, aU as Oa, cd as Qa, ch as Ua, ca as Wa, aV as za, cb as Xa, ce as Ya, cf as Za, cg as _a, aS as $a, aO as ae, aQ as ee, aP as oe, bf as te, bg as re, bm as se, aM as ne, bh as ie, bM as be, bT as pe, bP as ue, bZ as ce, bQ as le, bS as me, bN as Ce, bW as de, bU as ge, bV as Me, bR as Se, b$ as De, b_ as Te, bX as xe, bY as we, bO as Ae, b1 as Ie, b3 as he, b2 as Pe, be as Ge, bp as Fe, bL as He, au as Le, ax as ke, aF as ve, ay as Re, aG as Be, c0 as Ve, av as Ee, aw as ye, aL as fe, c1 as qe, c3 as Je, c4 as Ke, c8 as je, c6 as Ne, c5 as Oe, c7 as Qe, c2 as Ue, S as We, aN as ze, aB as Xe, aE as Ye, aC as Ze, aD as _e, bB as $e, C as ao, aJ as eo, aH as oo, aK as to, bn as ro, T as so, aI as no, bK as io, bH as bo, ci as po, ck as uo, bG as co, cj as lo } from "./index-2EHcmZqL.js";
2
+ import "./jsx-runtime-qAwJ85SY.js";
3
+ import "./Class-nQk08vqd.js";
4
+ import "clsx";
5
+ import "tailwind-merge";
6
+ import "lodash";
7
+ import "react";
24
8
  import "@radix-ui/react-toggle";
9
+ import "class-variance-authority";
25
10
  import "@radix-ui/react-switch";
26
- import "@radix-ui/react-hover-card";
27
- import "@radix-ui/react-dropdown-menu";
28
- import "jotai";
29
- import "lodash";
30
11
  import "@radix-ui/react-slot";
31
- import "@radix-ui/react-tooltip";
32
- import "@radix-ui/react-toast";
33
12
  import "@radix-ui/react-accordion";
34
- import "clsx";
35
- import "tailwind-merge";
13
+ import "@radix-ui/react-icons";
36
14
  import "@radix-ui/react-alert-dialog";
37
- import "cmdk";
15
+ import "@radix-ui/react-dialog";
38
16
  import "@radix-ui/react-label";
39
17
  import "@radix-ui/react-scroll-area";
40
18
  import "@radix-ui/react-tabs";
19
+ import "@radix-ui/react-tooltip";
41
20
  import "@radix-ui/react-popover";
21
+ import "@radix-ui/react-menubar";
22
+ import "@radix-ui/react-hover-card";
42
23
  import "@radix-ui/react-select";
24
+ import "@radix-ui/react-dropdown-menu";
43
25
  import "@radix-ui/react-separator";
26
+ import "@radix-ui/react-toast";
27
+ import "cmdk";
44
28
  import "@radix-ui/react-context-menu";
45
29
  import "react-icons-picker";
46
30
  import "react-dom";
47
- import "./ImagesPanel-oaHOD-Ex.js";
48
31
  import "react-quill";
32
+ import "jotai";
33
+ import "flat-to-nested";
34
+ import "redux-undo";
35
+ import "./index-gmZcUXyn.js";
36
+ import "@react-hookz/web";
49
37
  import "react-i18next";
50
- const h = m(
51
- "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
52
- {
53
- variants: {
54
- variant: {
55
- default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
56
- secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
57
- destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
58
- outline: "text-foreground"
59
- }
60
- },
61
- defaultVariants: {
62
- variant: "default"
63
- }
64
- }
65
- ), pe = ({ className: e, variant: t, ...o }) => /* @__PURE__ */ a.jsx("div", { className: r(h({ variant: t }), e), ...o }), ue = s.Menu, fe = s.Group, ge = s.Portal, xe = s.Sub, be = s.RadioGroup, C = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(
66
- s.Root,
67
- {
68
- ref: o,
69
- className: r("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm", e),
70
- ...t
71
- }
72
- ));
73
- C.displayName = s.Root.displayName;
74
- const y = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(
75
- s.Trigger,
76
- {
77
- ref: o,
78
- className: r(
79
- "flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
80
- e
81
- ),
82
- ...t
83
- }
84
- ));
85
- y.displayName = s.Trigger.displayName;
86
- const N = i.forwardRef(({ className: e, inset: t, children: o, ...d }, l) => /* @__PURE__ */ a.jsxs(
87
- s.SubTrigger,
88
- {
89
- ref: l,
90
- className: r(
91
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
92
- t && "pl-8",
93
- e
94
- ),
95
- ...d,
96
- children: [
97
- o,
98
- /* @__PURE__ */ a.jsx(f, { className: "ml-auto h-4 w-4" })
99
- ]
100
- }
101
- ));
102
- N.displayName = s.SubTrigger.displayName;
103
- const S = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(
104
- s.SubContent,
105
- {
106
- ref: o,
107
- className: r(
108
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
109
- e
110
- ),
111
- ...t
112
- }
113
- ));
114
- S.displayName = s.SubContent.displayName;
115
- const w = i.forwardRef(({ className: e, align: t = "start", alignOffset: o = -4, sideOffset: d = 8, ...l }, u) => /* @__PURE__ */ a.jsx(s.Portal, { children: /* @__PURE__ */ a.jsx(
116
- s.Content,
117
- {
118
- ref: u,
119
- align: t,
120
- alignOffset: o,
121
- sideOffset: d,
122
- className: r(
123
- "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
124
- e
125
- ),
126
- ...l
127
- }
128
- ) }));
129
- w.displayName = s.Content.displayName;
130
- const M = i.forwardRef(({ className: e, inset: t, ...o }, d) => /* @__PURE__ */ a.jsx(
131
- s.Item,
132
- {
133
- ref: d,
134
- className: r(
135
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
136
- t && "pl-8",
137
- e
138
- ),
139
- ...o
140
- }
141
- ));
142
- M.displayName = s.Item.displayName;
143
- const T = i.forwardRef(({ className: e, children: t, checked: o, ...d }, l) => /* @__PURE__ */ a.jsxs(
144
- s.CheckboxItem,
145
- {
146
- ref: l,
147
- className: r(
148
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
149
- e
150
- ),
151
- checked: o,
152
- ...d,
153
- children: [
154
- /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(s.ItemIndicator, { children: /* @__PURE__ */ a.jsx(g, { className: "h-4 w-4" }) }) }),
155
- t
156
- ]
157
- }
158
- ));
159
- T.displayName = s.CheckboxItem.displayName;
160
- const v = i.forwardRef(({ className: e, children: t, ...o }, d) => /* @__PURE__ */ a.jsxs(
161
- s.RadioItem,
162
- {
163
- ref: d,
164
- className: r(
165
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
166
- e
167
- ),
168
- ...o,
169
- children: [
170
- /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(s.ItemIndicator, { children: /* @__PURE__ */ a.jsx(x, { className: "h-4 w-4 fill-current" }) }) }),
171
- t
172
- ]
173
- }
174
- ));
175
- v.displayName = s.RadioItem.displayName;
176
- const D = i.forwardRef(({ className: e, inset: t, ...o }, d) => /* @__PURE__ */ a.jsx(
177
- s.Label,
178
- {
179
- ref: d,
180
- className: r("px-2 py-1.5 text-sm font-semibold", t && "pl-8", e),
181
- ...o
182
- }
183
- ));
184
- D.displayName = s.Label.displayName;
185
- const j = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(s.Separator, { ref: o, className: r("-mx-1 my-1 h-px bg-muted", e), ...t }));
186
- j.displayName = s.Separator.displayName;
187
- const I = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("span", { className: r("ml-auto text-xs tracking-widest text-muted-foreground", e), ...t });
188
- I.displayname = "MenubarShortcut";
189
- const he = n.Root, Ce = n.Trigger, ye = n.Close, c = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx(n.Portal, { className: r(e), ...t });
190
- c.displayName = n.Portal.displayName;
191
- const p = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(
192
- n.Overlay,
193
- {
194
- className: r(
195
- "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
196
- e
197
- ),
198
- ...t,
199
- ref: o
200
- }
201
- ));
202
- p.displayName = n.Overlay.displayName;
203
- const R = m(
204
- "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
205
- {
206
- variants: {
207
- side: {
208
- top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
209
- bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
210
- left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
211
- right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
212
- }
213
- },
214
- defaultVariants: {
215
- side: "right"
216
- }
217
- }
218
- ), A = i.forwardRef(
219
- ({ side: e = "right", className: t, children: o, ...d }, l) => /* @__PURE__ */ a.jsxs(c, { children: [
220
- /* @__PURE__ */ a.jsx(p, {}),
221
- /* @__PURE__ */ a.jsxs(n.Content, { ref: l, className: r(R({ side: e }), t), ...d, children: [
222
- o,
223
- /* @__PURE__ */ a.jsxs(n.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
224
- /* @__PURE__ */ a.jsx(b, { className: "h-4 w-4" }),
225
- /* @__PURE__ */ a.jsx("span", { className: "sr-only", children: "Close" })
226
- ] })
227
- ] })
228
- ] })
229
- );
230
- A.displayName = n.Content.displayName;
231
- const k = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: r("flex flex-col space-y-2 text-center sm:text-left", e), ...t });
232
- k.displayName = "SheetHeader";
233
- const P = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: r("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...t });
234
- P.displayName = "SheetFooter";
235
- const L = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(n.Title, { ref: o, className: r("text-lg font-semibold text-foreground", e), ...t }));
236
- L.displayName = n.Title.displayName;
237
- const F = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(n.Description, { ref: o, className: r("text-sm text-muted-foreground", e), ...t }));
238
- F.displayName = n.Description.displayName;
239
38
  export {
240
- rt as Accordion,
241
- nt as AccordionContent,
242
- it as AccordionItem,
243
- dt as AccordionTrigger,
244
- mt as Alert,
245
- ct as AlertDescription,
246
- Nt as AlertDialog,
247
- St as AlertDialogAction,
248
- wt as AlertDialogCancel,
249
- Mt as AlertDialogContent,
250
- Tt as AlertDialogDescription,
251
- vt as AlertDialogFooter,
252
- Dt as AlertDialogHeader,
253
- jt as AlertDialogTitle,
254
- It as AlertDialogTrigger,
255
- pt as AlertTitle,
256
- pe as Badge,
257
- Qe as Button,
258
- ut as Card,
259
- ft as CardContent,
260
- gt as CardDescription,
261
- xt as CardFooter,
262
- bt as CardHeader,
263
- ht as CardTitle,
264
- Vt as Command,
265
- Bt as CommandDialog,
266
- Et as CommandEmpty,
267
- Ot as CommandGroup,
268
- qt as CommandInput,
269
- Jt as CommandItem,
270
- Kt as CommandList,
271
- Qt as CommandSeparator,
272
- Ut as CommandShortcut,
273
- Na as ContextMenu,
39
+ f as Accordion,
40
+ q as AccordionContent,
41
+ J as AccordionItem,
42
+ K as AccordionTrigger,
43
+ j as Alert,
44
+ N as AlertDescription,
45
+ O as AlertDialog,
46
+ Q as AlertDialogAction,
47
+ U as AlertDialogCancel,
48
+ W as AlertDialogContent,
49
+ z as AlertDialogDescription,
50
+ X as AlertDialogFooter,
51
+ Y as AlertDialogHeader,
52
+ Z as AlertDialogTitle,
53
+ _ as AlertDialogTrigger,
54
+ $ as AlertTitle,
55
+ aa as Badge,
56
+ ea as Button,
57
+ oa as Card,
58
+ ta as CardContent,
59
+ ra as CardDescription,
60
+ sa as CardFooter,
61
+ na as CardHeader,
62
+ ia as CardTitle,
63
+ ba as Command,
64
+ pa as CommandDialog,
65
+ ua as CommandEmpty,
66
+ ca as CommandGroup,
67
+ la as CommandInput,
68
+ ma as CommandItem,
69
+ Ca as CommandList,
70
+ da as CommandSeparator,
71
+ ga as CommandShortcut,
72
+ Ma as ContextMenu,
274
73
  Sa as ContextMenuCheckboxItem,
275
- wa as ContextMenuContent,
276
- Ma as ContextMenuGroup,
277
- Ta as ContextMenuItem,
278
- va as ContextMenuLabel,
279
- Da as ContextMenuPortal,
280
- ja as ContextMenuRadioGroup,
281
- Ia as ContextMenuRadioItem,
282
- Ra as ContextMenuSeparator,
283
- Aa as ContextMenuShortcut,
284
- ka as ContextMenuSub,
285
- Pa as ContextMenuSubContent,
74
+ Da as ContextMenuContent,
75
+ Ta as ContextMenuGroup,
76
+ xa as ContextMenuItem,
77
+ wa as ContextMenuLabel,
78
+ Aa as ContextMenuPortal,
79
+ Ia as ContextMenuRadioGroup,
80
+ ha as ContextMenuRadioItem,
81
+ Pa as ContextMenuSeparator,
82
+ Ga as ContextMenuShortcut,
83
+ Fa as ContextMenuSub,
84
+ Ha as ContextMenuSubContent,
286
85
  La as ContextMenuSubTrigger,
287
- Fa as ContextMenuTrigger,
288
- At as Dialog,
289
- kt as DialogContent,
290
- Pt as DialogDescription,
291
- Lt as DialogFooter,
292
- Ft as DialogHeader,
293
- Gt as DialogTitle,
294
- Ht as DialogTrigger,
295
- ve as DropdownMenu,
296
- De as DropdownMenuCheckboxItem,
297
- je as DropdownMenuContent,
298
- Ie as DropdownMenuGroup,
299
- Re as DropdownMenuItem,
300
- Ae as DropdownMenuLabel,
301
- ke as DropdownMenuPortal,
302
- Pe as DropdownMenuRadioGroup,
303
- Le as DropdownMenuRadioItem,
304
- Fe as DropdownMenuSeparator,
305
- Ge as DropdownMenuShortcut,
306
- He as DropdownMenuSub,
307
- ze as DropdownMenuSubContent,
308
- Ve as DropdownMenuSubTrigger,
309
- Be as DropdownMenuTrigger,
310
- Ee as HoverCard,
311
- Oe as HoverCardContent,
312
- qe as HoverCardTrigger,
313
- Ha as IconPickerField,
314
- za as ImagePickerField,
315
- Wt as Input,
316
- Yt as Label,
317
- Va as LinkField,
318
- C as Menubar,
319
- T as MenubarCheckboxItem,
320
- w as MenubarContent,
321
- fe as MenubarGroup,
322
- M as MenubarItem,
323
- D as MenubarLabel,
324
- ue as MenubarMenu,
325
- ge as MenubarPortal,
326
- be as MenubarRadioGroup,
327
- v as MenubarRadioItem,
328
- j as MenubarSeparator,
329
- I as MenubarShortcut,
330
- xe as MenubarSub,
331
- S as MenubarSubContent,
332
- N as MenubarSubTrigger,
333
- y as MenubarTrigger,
334
- na as Popover,
335
- ia as PopoverContent,
336
- da as PopoverTrigger,
337
- Ba as RTEField,
338
- _t as ScrollArea,
339
- $t as ScrollBar,
340
- ma as Select,
341
- ca as SelectContent,
342
- pa as SelectGroup,
343
- ua as SelectItem,
344
- fa as SelectLabel,
345
- ga as SelectSeparator,
346
- xa as SelectTrigger,
347
- ba as SelectValue,
348
- Ca as Separator,
349
- he as Sheet,
350
- ye as SheetClose,
351
- A as SheetContent,
352
- F as SheetDescription,
353
- P as SheetFooter,
354
- k as SheetHeader,
355
- L as SheetTitle,
356
- Ce as SheetTrigger,
357
- Ue as Skeleton,
358
- Je as Switch,
359
- ta as Tabs,
360
- aa as TabsContent,
361
- oa as TabsList,
362
- sa as TabsTrigger,
363
- Ct as Textarea,
364
- We as Toaster,
365
- we as Toggle,
366
- Xe as Tooltip,
367
- Ye as TooltipContent,
368
- Ze as TooltipPortal,
369
- _e as TooltipProvider,
370
- $e as TooltipTrigger,
371
- h as badgeVariants,
372
- et as buttonVariants,
373
- tt as reducer,
374
- at as toast,
375
- Me as toggleVariants,
376
- ot as useToast
86
+ ka as ContextMenuTrigger,
87
+ va as Dialog,
88
+ Ra as DialogContent,
89
+ Ba as DialogDescription,
90
+ Va as DialogFooter,
91
+ Ea as DialogHeader,
92
+ ya as DialogTitle,
93
+ fa as DialogTrigger,
94
+ qa as DropdownMenu,
95
+ Ja as DropdownMenuCheckboxItem,
96
+ Ka as DropdownMenuContent,
97
+ ja as DropdownMenuGroup,
98
+ Na as DropdownMenuItem,
99
+ Oa as DropdownMenuLabel,
100
+ Qa as DropdownMenuPortal,
101
+ Ua as DropdownMenuRadioGroup,
102
+ Wa as DropdownMenuRadioItem,
103
+ za as DropdownMenuSeparator,
104
+ Xa as DropdownMenuShortcut,
105
+ Ya as DropdownMenuSub,
106
+ Za as DropdownMenuSubContent,
107
+ _a as DropdownMenuSubTrigger,
108
+ $a as DropdownMenuTrigger,
109
+ ae as HoverCard,
110
+ ee as HoverCardContent,
111
+ oe as HoverCardTrigger,
112
+ te as IconPickerField,
113
+ re as ImagePickerField,
114
+ se as Input,
115
+ ne as Label,
116
+ ie as LinkField,
117
+ be as Menubar,
118
+ pe as MenubarCheckboxItem,
119
+ ue as MenubarContent,
120
+ ce as MenubarGroup,
121
+ le as MenubarItem,
122
+ me as MenubarLabel,
123
+ Ce as MenubarMenu,
124
+ de as MenubarPortal,
125
+ ge as MenubarRadioGroup,
126
+ Me as MenubarRadioItem,
127
+ Se as MenubarSeparator,
128
+ De as MenubarShortcut,
129
+ Te as MenubarSub,
130
+ xe as MenubarSubContent,
131
+ we as MenubarSubTrigger,
132
+ Ae as MenubarTrigger,
133
+ Ie as Popover,
134
+ he as PopoverContent,
135
+ Pe as PopoverTrigger,
136
+ Ge as RTEField,
137
+ Fe as ScrollArea,
138
+ He as ScrollBar,
139
+ Le as Select,
140
+ ke as SelectContent,
141
+ ve as SelectGroup,
142
+ Re as SelectItem,
143
+ Be as SelectLabel,
144
+ Ve as SelectSeparator,
145
+ Ee as SelectTrigger,
146
+ ye as SelectValue,
147
+ fe as Separator,
148
+ qe as Sheet,
149
+ Je as SheetClose,
150
+ Ke as SheetContent,
151
+ je as SheetDescription,
152
+ Ne as SheetFooter,
153
+ Oe as SheetHeader,
154
+ Qe as SheetTitle,
155
+ Ue as SheetTrigger,
156
+ We as Skeleton,
157
+ ze as Switch,
158
+ Xe as Tabs,
159
+ Ye as TabsContent,
160
+ Ze as TabsList,
161
+ _e as TabsTrigger,
162
+ $e as Textarea,
163
+ ao as Toaster,
164
+ eo as Toggle,
165
+ oo as Tooltip,
166
+ to as TooltipContent,
167
+ ro as TooltipPortal,
168
+ so as TooltipProvider,
169
+ no as TooltipTrigger,
170
+ io as badgeVariants,
171
+ bo as buttonVariants,
172
+ po as reducer,
173
+ uo as toast,
174
+ co as toggleVariants,
175
+ lo as useToast
377
176
  };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "author": "Suraj Air",
6
6
  "license": "BSD-3-Clause",
7
7
  "homepage": "https://chaibuilder.com",
8
- "version": "1.0.13",
8
+ "version": "1.0.15",
9
9
  "type": "module",
10
10
  "repository": {
11
11
  "type": "git",
@@ -1,3 +0,0 @@
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 +0,0 @@
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;