@chaibuilder/sdk 4.0.0-beta.7 → 4.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -3
- package/dist/{2SSKDMRQ-DDOgISWg.cjs → 2SSKDMRQ-DHv4u_0i.cjs} +1 -1
- package/dist/{2SSKDMRQ-hL7THuKW.js → 2SSKDMRQ-DewwiCoQ.js} +2 -2
- package/dist/{AP7HFJJL-BsLQ13V_.js → AP7HFJJL-ComnZw7J.js} +1 -1
- package/dist/{AP7HFJJL-tcAhVllC.cjs → AP7HFJJL-cz754qhG.cjs} +1 -1
- package/dist/{IconPicker-FLSVAZxx.js → IconPicker-2H9IGKMS.js} +2 -2
- package/dist/{IconPicker-J1KLNrSB.cjs → IconPicker-U0Z2dWeR.cjs} +1 -1
- package/dist/{WDYDFRGG-BTj8AXV6.cjs → WDYDFRGG-BfRX3M58.cjs} +1 -1
- package/dist/{WDYDFRGG-Yi0eNS2V.js → WDYDFRGG-vy7nMYD4.js} +2 -2
- package/dist/{active-in-another-tab-Dozn833d.js → active-in-another-tab-5hn17Jeq.js} +3 -3
- package/dist/{active-in-another-tab-BtAiatqq.cjs → active-in-another-tab-ijahI5qu.cjs} +1 -1
- package/dist/{add-new-language-page-DD-CAoAQ.js → add-new-language-page-DmOyPy0u.js} +4 -4
- package/dist/{add-new-language-page-9AMizlES.cjs → add-new-language-page-vmNKNx-e.cjs} +1 -1
- package/dist/{add-new-page-uZKCk9eB.js → add-new-page-NHScAQn8.js} +2 -2
- package/dist/{add-new-page-BS9vPnFG.cjs → add-new-page-XDuCkOyb.cjs} +1 -1
- package/dist/{ai-panel-content-PovaKJaj.cjs → ai-panel-content-BDqW16AW.cjs} +1 -1
- package/dist/{ai-panel-content-CK4XOkEh.js → ai-panel-content-CHJ0JcQI.js} +4 -4
- package/dist/{ai-panel-default-lang-BtLjUl9d.js → ai-panel-default-lang-BIomgsN0.js} +4 -4
- package/dist/{ai-panel-default-lang-B37k5ADH.cjs → ai-panel-default-lang-HeYWpbMu.cjs} +2 -2
- package/dist/{ai-panel-other-lang-CdQmASqv.cjs → ai-panel-other-lang-BMelEs3p.cjs} +1 -1
- package/dist/{ai-panel-other-lang-Dp1MNaLi.js → ai-panel-other-lang-CbAgG-qX.js} +3 -3
- package/dist/{ai-prompt-input-BT-mEdTX.js → ai-prompt-input-BH8LOVT4.js} +2 -2
- package/dist/{ai-prompt-input-Dtym4w8J.cjs → ai-prompt-input-C_GG6nwq.cjs} +1 -1
- package/dist/{ai-translation-prompt-B-lH7emI.cjs → ai-translation-prompt-CkHaFv5I.cjs} +1 -1
- package/dist/{ai-translation-prompt-B17GK1QR.js → ai-translation-prompt-DxsNw8YR.js} +2 -2
- package/dist/{code-display-DloSPyPr.cjs → code-display-9Onx6RCq.cjs} +1 -1
- package/dist/{code-display-Ck81Id9K.js → code-display-oa1j0ri7.js} +1 -1
- package/dist/{code-editor-EZT2pMsU.js → code-editor-CGBAc-A6.js} +1 -1
- package/dist/{code-editor-CUeNiMzA.cjs → code-editor-GV8ibQ4h.cjs} +1 -1
- package/dist/{continue-editing-in-this-client-DMZOc36k.cjs → continue-editing-in-this-client-DKHP0pq8.cjs} +1 -1
- package/dist/{continue-editing-in-this-client-CS7C6h9Q.js → continue-editing-in-this-client-Da8ab_9d.js} +3 -3
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -90
- package/dist/core.js +22 -34
- package/dist/css-import-modal-B4j26_cO.cjs +13 -0
- package/dist/{css-import-modal-s7t5gZQo.js → css-import-modal-CcZVLsF9.js} +5 -4
- package/dist/{delete-design-token-Mbw_6sYI.cjs → delete-design-token-3-WwqXMO.cjs} +1 -1
- package/dist/{delete-design-token-C1smbx4E.js → delete-design-token-DzINIVtO.js} +1 -1
- package/dist/{delete-page-B7J3t0FN.cjs → delete-page-B7ODELqM.cjs} +1 -1
- package/dist/{delete-page-2GfBi8Iv.js → delete-page-DwZDMwfI.js} +3 -3
- package/dist/{design-token-usage-DyO3xM-F.js → design-token-usage-DQf180Lg.js} +2 -2
- package/dist/{design-token-usage-BoGOULG8.cjs → design-token-usage-Dy08kcIc.cjs} +1 -1
- package/dist/{digital-asset-manager-DDk2ucTE.cjs → digital-asset-manager-C7subULa.cjs} +1 -1
- package/dist/{digital-asset-manager-Cz3Nlrzl.js → digital-asset-manager-CDy9kHZO.js} +4 -4
- package/dist/{duplicate-page-Dw3U4wTT.cjs → duplicate-page-CWQ9aMd9.cjs} +1 -1
- package/dist/{duplicate-page-BwAY4Ssm.js → duplicate-page-DTnSztlr.js} +4 -4
- package/dist/{dynamic-page-selector-CvBFyX2F.cjs → dynamic-page-selector-DJuxLcsM.cjs} +1 -1
- package/dist/{dynamic-page-selector-sViJuQlU.js → dynamic-page-selector-DYW3ov_u.js} +3 -3
- package/dist/{image-editor-AIsccrqC.cjs → image-editor-C4H3AkZK.cjs} +1 -1
- package/dist/{image-editor-BgGQuESa.js → image-editor-DLeSST0K.js} +1 -1
- package/dist/{index-RYr8kQdI.js → index-BK0xWO1z.js} +5132 -5602
- package/dist/{index-BwH1mRm_.cjs → index-BRJCj7c_.cjs} +2 -2
- package/dist/index-Bm8iS2OH.cjs +160 -0
- package/dist/{index-B7eWP_hB.js → index-D5d4QDq7.js} +19 -21
- package/dist/{json-diff-viewer-Svw-kbhe.js → json-diff-viewer-BYHieVod.js} +3 -3
- package/dist/{json-diff-viewer-B2A78udz.cjs → json-diff-viewer-g6SY62bl.cjs} +1 -1
- package/dist/{lang-panel-Bnc-9wkM.js → lang-panel-BG1GMn-1.js} +4 -4
- package/dist/{lang-panel-AmEkoWid.cjs → lang-panel-Dm1eOO2J.cjs} +1 -1
- package/dist/{manage-design-tokens-BBkh1t4w.js → manage-design-tokens-BdWQUHhw.js} +3 -3
- package/dist/{manage-design-tokens-B2fG80bi.cjs → manage-design-tokens-XWs_B6jo.cjs} +1 -1
- package/dist/{mark-as-template-0CPzZnk-.js → mark-as-template-D2XxagVO.js} +3 -3
- package/dist/{mark-as-template-CE6tRoQy.cjs → mark-as-template-DUFnfVM3.cjs} +1 -1
- package/dist/{nested-path-selector-content-SmfjElr-.cjs → nested-path-selector-content-CQOx2L9C.cjs} +1 -1
- package/dist/{nested-path-selector-content-kGznHufl.js → nested-path-selector-content-Wd6-Eql0.js} +2 -2
- package/dist/{no-language-page-content-DXsAPDZd.js → no-language-page-content-BOv6TZIk.js} +3 -3
- package/dist/{no-language-page-content-B4bQLc4K.cjs → no-language-page-content-C11uF6hs.cjs} +1 -1
- package/dist/{no-language-page-dialog-BC8NHzK2.cjs → no-language-page-dialog-CY5XhXsC.cjs} +1 -1
- package/dist/{no-language-page-dialog-BpPqmw9a.js → no-language-page-dialog-DIXyKRJq.js} +2 -2
- package/dist/{page-creator-Bazn6yH4.js → page-creator-WX9lMrJY.js} +4 -4
- package/dist/{page-creator-82qTbBj4.cjs → page-creator-zSUFF4eT.cjs} +1 -1
- package/dist/{page-lock-CRFyqKZE.js → page-lock-D9miLZjm.js} +2 -2
- package/dist/{page-lock-D2iFZDUK.cjs → page-lock-DGhR_url.cjs} +1 -1
- package/dist/{page-locked-dialog-GKfQEOmk.js → page-locked-dialog-CNCUCcvH.js} +3 -3
- package/dist/{page-locked-dialog-xLqvKzax.cjs → page-locked-dialog-DTLnbfuP.cjs} +1 -1
- package/dist/{page-manager-new-DItY2hjd.js → page-manager-new-BFFOLh-l.js} +4 -4
- package/dist/{page-manager-new-Bn2QKjbf.cjs → page-manager-new-Dd2c-Q_O.cjs} +1 -1
- package/dist/{page-manager-search-and-filter-Dc4ky-qV.cjs → page-manager-search-and-filter-BKdQUJ2W.cjs} +1 -1
- package/dist/{page-manager-search-and-filter-CPa8IXdd.js → page-manager-search-and-filter-C1IWF_4d.js} +3 -3
- package/dist/page-revisions-content-D0cflnj1.cjs +1 -0
- package/dist/{page-revisions-content-CH-PZK0O.js → page-revisions-content-DHapiLck.js} +75 -67
- package/dist/pages.cjs +1 -1
- package/dist/pages.d.ts +2 -1
- package/dist/pages.js +1 -1
- package/dist/{publish-pages-content-CSJCFElu.js → publish-pages-content-Bd2zJHtK.js} +4 -4
- package/dist/{publish-pages-content-BzJDObqr.cjs → publish-pages-content-BqLcnKry.cjs} +1 -1
- package/dist/{register-chai-top-bar-ESJHs5s-.js → register-chai-top-bar-CX_JkRJn.js} +78 -78
- package/dist/register-chai-top-bar-DWTuRU53.cjs +1 -0
- package/dist/render.d.ts +2 -1
- package/dist/{rte-widget-modal-BfXcA7OP.cjs → rte-widget-modal-DiB5BjH1.cjs} +1 -1
- package/dist/{rte-widget-modal-5T81P_hg.js → rte-widget-modal-RS8PMKOn.js} +7 -7
- package/dist/runtime-client.cjs +1 -0
- package/dist/runtime-client.d.ts +158 -0
- package/dist/runtime-client.js +32 -0
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.ts +1 -163
- package/dist/runtime.js +71 -72
- package/dist/{save-to-lib-MtWKSVeN.js → save-to-lib--6ZXHEbC.js} +3 -3
- package/dist/{save-to-lib-DGAdSa-0.cjs → save-to-lib-BXJvaC1N.cjs} +1 -1
- package/dist/{selected-block-display-DLt_nMn9.cjs → selected-block-display-BfpJda4h.cjs} +1 -1
- package/dist/{selected-block-display-CB1-hVR5.js → selected-block-display-CUnCqXQw.js} +3 -3
- package/dist/{seo-panel-CRzzw4FW.js → seo-panel-Bs-FcY1A.js} +3 -3
- package/dist/{seo-panel-_kGXE9MC.cjs → seo-panel-CQITMfZ6.cjs} +1 -1
- package/dist/{shared-json-ld-CXukkDeS.js → shared-json-ld-7EujD341.js} +3 -3
- package/dist/{shared-json-ld-DoRgzDPC.cjs → shared-json-ld-DDXXi-Mj.cjs} +1 -1
- package/dist/{slug-input-Dp187Tiy.cjs → slug-input-CsVJAr7r.cjs} +1 -1
- package/dist/{slug-input-CeEQ0zyv.js → slug-input-DoEIq5rs.js} +2 -2
- package/dist/{take-over-request-C9J3_rev.js → take-over-request-C14kJ356.js} +3 -3
- package/dist/{take-over-request-CXuakFBm.cjs → take-over-request-D5Oo3MPo.cjs} +1 -1
- package/dist/{theme-panel-footer-DvwsyHNQ.js → theme-panel-footer-Dvknelm8.js} +3 -3
- package/dist/{theme-panel-footer-CWZ0qs13.cjs → theme-panel-footer-Eeibz2JA.cjs} +1 -1
- package/dist/{translation-warning-modal-DEt_ExQp.cjs → translation-warning-modal-CPzdHzqq.cjs} +1 -1
- package/dist/{translation-warning-modal-_aBp5ZZQ.js → translation-warning-modal-YlzP2XoO.js} +2 -2
- package/dist/{unmark-as-template-BYL5naYx.cjs → unmark-as-template-BGDwuCnv.cjs} +1 -1
- package/dist/{unmark-as-template-JN-cDUV_.js → unmark-as-template-CPJvQk7L.js} +3 -3
- package/dist/{unpublish-page-B06iZEIO.cjs → unpublish-page-BMowW5wT.cjs} +1 -1
- package/dist/{unpublish-page-DqwBY2yI.js → unpublish-page-DlFHLlmI.js} +3 -3
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +43 -43
- package/dist/{web-preview-h39D3TUh.js → web-preview-BUnv3jIc.js} +2 -2
- package/dist/{web-preview-wRgRY3Tv.cjs → web-preview-D8GQHCjs.cjs} +1 -1
- package/package.json +8 -7
- package/dist/css-import-modal-kHB0ramf.cjs +0 -13
- package/dist/index-B-rSiAp_.cjs +0 -1
- package/dist/index-Dxfyt4d4.js +0 -39
- package/dist/index-xYnNKovy.cjs +0 -160
- package/dist/page-revisions-content-CcLFI4YK.cjs +0 -1
- package/dist/register-chai-top-bar-BqwKw4uy.cjs +0 -1
package/dist/web-blocks.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { isEmpty as w, get as k, map as R, isNull as U, omit as M, pick as H } from "lodash-es";
|
|
1
2
|
import { jsx as i, jsxs as h, Fragment as N } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
+
import { registerChaiBlockSchema as p, StylesProp as u, stylesProp as L } from "./runtime.js";
|
|
3
4
|
import { c as _, g as I } from "./common-functions-D2lMFR6K.js";
|
|
4
5
|
import * as b from "react";
|
|
5
6
|
import { createElement as x } from "react";
|
|
6
|
-
import { ButtonIcon as
|
|
7
|
-
import { isEmpty as w, get as k, map as R, isNull as ue, omit as z, pick as F } from "lodash-es";
|
|
7
|
+
import { ButtonIcon as $, CodeIcon as j, FrameIcon as D, SketchLogoIcon as Z, RowsIcon as V, LayoutIcon as q, DividerHorizontalIcon as G, CheckboxIcon as W, FileTextIcon as O, InputIcon as z, LetterCaseToggleIcon as Y, RadiobuttonIcon as Q, DropdownMenuIcon as J, HeadingIcon as X, TableIcon as K, BorderTopIcon as ee, BorderAllIcon as te, ViewHorizontalIcon as oe, DragHandleHorizontalIcon as le, ImageIcon as re, Link1Icon as ne, ColumnsIcon as ie, TextIcon as ae, CursorTextIcon as se, SpaceBetweenVerticallyIcon as ce, VideoIcon as de, ChevronLeftIcon as pe, ChevronRightIcon as ue, LoopIcon as F } from "@radix-ui/react-icons";
|
|
8
8
|
import { r as d, e as me, c as ye } from "./core-Dr7QYemB.js";
|
|
9
9
|
const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div", { className: _("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ i("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ i("div", { className: "flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700" }) }) }) : null, ge = (e) => {
|
|
10
10
|
const { blockProps: o, inBuilder: t, backgroundImage: l, children: r, tag: n = "div", styles: a } = e;
|
|
@@ -81,7 +81,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
81
81
|
description: "similar to a button element in HTML",
|
|
82
82
|
label: "Button",
|
|
83
83
|
category: "core",
|
|
84
|
-
icon:
|
|
84
|
+
icon: $,
|
|
85
85
|
group: "basic",
|
|
86
86
|
...p({
|
|
87
87
|
properties: {
|
|
@@ -150,7 +150,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
150
150
|
description: "similar to a div or section elements in HTML",
|
|
151
151
|
label: "Custom HTML",
|
|
152
152
|
category: "core",
|
|
153
|
-
icon:
|
|
153
|
+
icon: j,
|
|
154
154
|
group: "advanced",
|
|
155
155
|
...p({
|
|
156
156
|
properties: {
|
|
@@ -171,7 +171,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
171
171
|
description: "similar to a script element in HTML",
|
|
172
172
|
label: "Custom Script",
|
|
173
173
|
category: "core",
|
|
174
|
-
icon:
|
|
174
|
+
icon: j,
|
|
175
175
|
hidden: !0,
|
|
176
176
|
group: "advanced",
|
|
177
177
|
...p({
|
|
@@ -205,7 +205,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
205
205
|
type: "GlobalBlock",
|
|
206
206
|
description: "A global block component",
|
|
207
207
|
label: "Global Block",
|
|
208
|
-
icon:
|
|
208
|
+
icon: D,
|
|
209
209
|
category: "core",
|
|
210
210
|
group: "basic",
|
|
211
211
|
hidden: !0,
|
|
@@ -241,7 +241,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
241
241
|
label: "web_blocks.icon",
|
|
242
242
|
category: "core",
|
|
243
243
|
description: "Icon block is used to display an icon/svg.",
|
|
244
|
-
icon:
|
|
244
|
+
icon: Z,
|
|
245
245
|
group: "media",
|
|
246
246
|
...p({
|
|
247
247
|
properties: {
|
|
@@ -284,7 +284,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
284
284
|
type: "PartialBlock",
|
|
285
285
|
description: "A partial block component. Partial blocks are global blocks that can be used in multiple pages.",
|
|
286
286
|
label: "Partial Block",
|
|
287
|
-
icon:
|
|
287
|
+
icon: D,
|
|
288
288
|
category: "core",
|
|
289
289
|
group: "basic",
|
|
290
290
|
hidden: !0,
|
|
@@ -355,7 +355,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
355
355
|
label: "Column",
|
|
356
356
|
group: "basic",
|
|
357
357
|
category: "core",
|
|
358
|
-
icon:
|
|
358
|
+
icon: q,
|
|
359
359
|
wrapper: !0,
|
|
360
360
|
hidden: !0,
|
|
361
361
|
canDelete: () => !0,
|
|
@@ -394,7 +394,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
394
394
|
description: "A row component",
|
|
395
395
|
label: "Row",
|
|
396
396
|
group: "basic",
|
|
397
|
-
icon:
|
|
397
|
+
icon: V,
|
|
398
398
|
hidden: !0,
|
|
399
399
|
blocks: () => [
|
|
400
400
|
{ _type: "Row", _id: "row", styles: "#styles:,p-1" },
|
|
@@ -429,7 +429,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
429
429
|
description: "A horizontal line component",
|
|
430
430
|
label: "Divider",
|
|
431
431
|
category: "core",
|
|
432
|
-
icon:
|
|
432
|
+
icon: G,
|
|
433
433
|
group: "basic",
|
|
434
434
|
...p({
|
|
435
435
|
properties: {
|
|
@@ -478,7 +478,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
478
478
|
type: "Checkbox",
|
|
479
479
|
label: "web_blocks.checkbox",
|
|
480
480
|
category: "core",
|
|
481
|
-
icon:
|
|
481
|
+
icon: W,
|
|
482
482
|
group: "form",
|
|
483
483
|
...p({
|
|
484
484
|
properties: {
|
|
@@ -542,7 +542,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
542
542
|
type: "Form",
|
|
543
543
|
label: "Form",
|
|
544
544
|
category: "core",
|
|
545
|
-
icon:
|
|
545
|
+
icon: O,
|
|
546
546
|
group: "form",
|
|
547
547
|
blocks: () => [
|
|
548
548
|
{ _type: "Form", _id: "form", styles: "#styles:p-1 space-y-2," },
|
|
@@ -596,7 +596,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
596
596
|
type: "FormButton",
|
|
597
597
|
label: "Submit Button",
|
|
598
598
|
category: "core",
|
|
599
|
-
icon:
|
|
599
|
+
icon: $,
|
|
600
600
|
group: "form",
|
|
601
601
|
...p({
|
|
602
602
|
properties: {
|
|
@@ -744,7 +744,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
744
744
|
type: "Input",
|
|
745
745
|
label: "web_blocks.input",
|
|
746
746
|
category: "core",
|
|
747
|
-
icon:
|
|
747
|
+
icon: z,
|
|
748
748
|
group: "form",
|
|
749
749
|
...p({
|
|
750
750
|
properties: {
|
|
@@ -865,7 +865,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
865
865
|
type: "Label",
|
|
866
866
|
label: "Label",
|
|
867
867
|
category: "core",
|
|
868
|
-
icon:
|
|
868
|
+
icon: Y,
|
|
869
869
|
group: "form",
|
|
870
870
|
...p({
|
|
871
871
|
properties: {
|
|
@@ -900,7 +900,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
900
900
|
type: "Radio",
|
|
901
901
|
label: "web_blocks.radio",
|
|
902
902
|
category: "core",
|
|
903
|
-
icon:
|
|
903
|
+
icon: Q,
|
|
904
904
|
group: "form",
|
|
905
905
|
...p({
|
|
906
906
|
properties: {
|
|
@@ -984,7 +984,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
984
984
|
type: "Select",
|
|
985
985
|
label: "web_blocks.select",
|
|
986
986
|
category: "core",
|
|
987
|
-
icon:
|
|
987
|
+
icon: J,
|
|
988
988
|
group: "form",
|
|
989
989
|
...p({
|
|
990
990
|
properties: {
|
|
@@ -1081,7 +1081,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
1081
1081
|
type: "TextArea",
|
|
1082
1082
|
label: "web_blocks.textarea",
|
|
1083
1083
|
category: "core",
|
|
1084
|
-
icon:
|
|
1084
|
+
icon: z,
|
|
1085
1085
|
group: "form",
|
|
1086
1086
|
...p({
|
|
1087
1087
|
properties: {
|
|
@@ -1140,7 +1140,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
1140
1140
|
description: "A heading component similar to h1, h2, h3, h4, h5, h6 elements in HTML",
|
|
1141
1141
|
label: "Heading",
|
|
1142
1142
|
category: "core",
|
|
1143
|
-
icon:
|
|
1143
|
+
icon: X,
|
|
1144
1144
|
group: "typography",
|
|
1145
1145
|
...p({
|
|
1146
1146
|
properties: {
|
|
@@ -1206,7 +1206,7 @@ d(rt, {
|
|
|
1206
1206
|
category: "core",
|
|
1207
1207
|
group: "table",
|
|
1208
1208
|
hidden: !0,
|
|
1209
|
-
icon:
|
|
1209
|
+
icon: K,
|
|
1210
1210
|
...p({
|
|
1211
1211
|
properties: {
|
|
1212
1212
|
styles: u("")
|
|
@@ -1220,7 +1220,7 @@ d(nt, {
|
|
|
1220
1220
|
category: "core",
|
|
1221
1221
|
group: "table",
|
|
1222
1222
|
hidden: !0,
|
|
1223
|
-
icon:
|
|
1223
|
+
icon: ee,
|
|
1224
1224
|
...p({
|
|
1225
1225
|
properties: {
|
|
1226
1226
|
styles: u("")
|
|
@@ -1234,7 +1234,7 @@ d(it, {
|
|
|
1234
1234
|
category: "core",
|
|
1235
1235
|
group: "table",
|
|
1236
1236
|
hidden: !0,
|
|
1237
|
-
icon:
|
|
1237
|
+
icon: te,
|
|
1238
1238
|
...p({
|
|
1239
1239
|
properties: {
|
|
1240
1240
|
styles: u("")
|
|
@@ -1248,7 +1248,7 @@ d(at, {
|
|
|
1248
1248
|
category: "core",
|
|
1249
1249
|
group: "table",
|
|
1250
1250
|
hidden: !0,
|
|
1251
|
-
icon:
|
|
1251
|
+
icon: oe,
|
|
1252
1252
|
...p({
|
|
1253
1253
|
properties: {
|
|
1254
1254
|
styles: u("")
|
|
@@ -1262,7 +1262,7 @@ d(st, {
|
|
|
1262
1262
|
category: "core",
|
|
1263
1263
|
group: "table",
|
|
1264
1264
|
hidden: !0,
|
|
1265
|
-
icon:
|
|
1265
|
+
icon: le,
|
|
1266
1266
|
...p({
|
|
1267
1267
|
properties: {
|
|
1268
1268
|
styles: u(""),
|
|
@@ -1343,7 +1343,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1343
1343
|
description: "A image component",
|
|
1344
1344
|
label: "Image",
|
|
1345
1345
|
category: "core",
|
|
1346
|
-
icon:
|
|
1346
|
+
icon: re,
|
|
1347
1347
|
group: "media",
|
|
1348
1348
|
...p({
|
|
1349
1349
|
properties: {
|
|
@@ -1427,7 +1427,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1427
1427
|
description: "A link component",
|
|
1428
1428
|
label: "Link",
|
|
1429
1429
|
category: "core",
|
|
1430
|
-
icon:
|
|
1430
|
+
icon: ne,
|
|
1431
1431
|
group: "basic",
|
|
1432
1432
|
...p({
|
|
1433
1433
|
properties: {
|
|
@@ -1470,7 +1470,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1470
1470
|
type: "List",
|
|
1471
1471
|
description: "A list component",
|
|
1472
1472
|
label: "List",
|
|
1473
|
-
icon:
|
|
1473
|
+
icon: V,
|
|
1474
1474
|
category: "core",
|
|
1475
1475
|
group: "basic",
|
|
1476
1476
|
...p({
|
|
@@ -1514,7 +1514,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1514
1514
|
type: "ListItem",
|
|
1515
1515
|
description: "A list item component",
|
|
1516
1516
|
label: "List Item",
|
|
1517
|
-
icon:
|
|
1517
|
+
icon: ie,
|
|
1518
1518
|
category: "core",
|
|
1519
1519
|
group: "basic",
|
|
1520
1520
|
...p({
|
|
@@ -1536,7 +1536,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1536
1536
|
canBeNested: (e) => e === "List" || e === "Repeater"
|
|
1537
1537
|
}, ht = (e) => {
|
|
1538
1538
|
const { blockProps: o, styles: t, content: l } = e;
|
|
1539
|
-
if (!
|
|
1539
|
+
if (!U(e.children)) return b.createElement("p", { ...t, ...o }, e.children);
|
|
1540
1540
|
const r = T(t, "rte");
|
|
1541
1541
|
return b.createElement("div", {
|
|
1542
1542
|
...r,
|
|
@@ -1548,7 +1548,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1548
1548
|
description: "A paragraph component",
|
|
1549
1549
|
label: "Paragraph",
|
|
1550
1550
|
category: "core",
|
|
1551
|
-
icon:
|
|
1551
|
+
icon: ae,
|
|
1552
1552
|
group: "typography",
|
|
1553
1553
|
...p({
|
|
1554
1554
|
properties: {
|
|
@@ -1573,7 +1573,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1573
1573
|
label: "Rich Text",
|
|
1574
1574
|
hidden: !0,
|
|
1575
1575
|
category: "core",
|
|
1576
|
-
icon:
|
|
1576
|
+
icon: se,
|
|
1577
1577
|
group: "typography",
|
|
1578
1578
|
...p({
|
|
1579
1579
|
properties: {
|
|
@@ -1622,7 +1622,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1622
1622
|
category: "core",
|
|
1623
1623
|
group: "typography",
|
|
1624
1624
|
blocks: () => [{ _id: "a", _type: "Text", _name: "Text", content: "" }],
|
|
1625
|
-
icon:
|
|
1625
|
+
icon: ce,
|
|
1626
1626
|
...p({
|
|
1627
1627
|
properties: {
|
|
1628
1628
|
styles: u("text-black"),
|
|
@@ -1687,8 +1687,8 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1687
1687
|
return null;
|
|
1688
1688
|
}, Bt = (e) => {
|
|
1689
1689
|
const { url: o, blockProps: t, styles: l, controls: r, videoSource: n, inBuilder: a, title: s } = e, c = Lt(o, r);
|
|
1690
|
-
return /* @__PURE__ */ h("div", { ...
|
|
1691
|
-
!c && a ? /* @__PURE__ */ i("div", { className: "absolute flex h-full w-full items-center justify-center bg-gray-300 text-center", children: w(o) ? `Provided ${n} video link in settings Video URL.` : `Provided ${n} video link is invalid.` }) : /* @__PURE__ */ i("iframe", { width: "100%", src: c ?? "", title: s || "Video player", ...
|
|
1690
|
+
return /* @__PURE__ */ h("div", { ...M(l, "className"), className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
|
|
1691
|
+
!c && a ? /* @__PURE__ */ i("div", { className: "absolute flex h-full w-full items-center justify-center bg-gray-300 text-center", children: w(o) ? `Provided ${n} video link in settings Video URL.` : `Provided ${n} video link is invalid.` }) : /* @__PURE__ */ i("iframe", { width: "100%", src: c ?? "", title: s || "Video player", ...H(l, "className") }),
|
|
1692
1692
|
a && /* @__PURE__ */ i("div", { ...t, className: "absolute top-0 h-full w-full" })
|
|
1693
1693
|
] });
|
|
1694
1694
|
}, St = (e) => {
|
|
@@ -1729,7 +1729,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1729
1729
|
type: "Video",
|
|
1730
1730
|
label: "Video",
|
|
1731
1731
|
category: "core",
|
|
1732
|
-
icon:
|
|
1732
|
+
icon: de,
|
|
1733
1733
|
group: "media",
|
|
1734
1734
|
...p({
|
|
1735
1735
|
properties: {
|
|
@@ -1817,13 +1817,13 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1817
1817
|
i18nProps: ["url", "title"]
|
|
1818
1818
|
}, Tt = (e) => {
|
|
1819
1819
|
const { paginationStyles: o } = e, t = me("Pagination");
|
|
1820
|
-
return /* @__PURE__ */ i("div", { ...o, children: t ? b.createElement(t.component, { ...
|
|
1820
|
+
return /* @__PURE__ */ i("div", { ...o, children: t ? b.createElement(t.component, { ...M(e, ["paginationStyles"]), blockProps: {} }) : /* @__PURE__ */ h(N, { children: [
|
|
1821
1821
|
/* @__PURE__ */ i(
|
|
1822
1822
|
"button",
|
|
1823
1823
|
{
|
|
1824
1824
|
className: "flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",
|
|
1825
1825
|
disabled: !0,
|
|
1826
|
-
children: /* @__PURE__ */ i(
|
|
1826
|
+
children: /* @__PURE__ */ i(pe, { className: "h-4 w-4" })
|
|
1827
1827
|
}
|
|
1828
1828
|
),
|
|
1829
1829
|
/* @__PURE__ */ i("button", { className: "flex h-9 w-9 items-center justify-center rounded-md border border-blue-500 bg-blue-500 font-medium text-white", children: "1" }),
|
|
@@ -1831,7 +1831,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1831
1831
|
/* @__PURE__ */ i("button", { className: "flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50", children: "3" }),
|
|
1832
1832
|
/* @__PURE__ */ i("button", { className: "flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50", children: "4" }),
|
|
1833
1833
|
/* @__PURE__ */ i("button", { className: "flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50", children: "5" }),
|
|
1834
|
-
/* @__PURE__ */ i("button", { className: "flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50", children: /* @__PURE__ */ i(
|
|
1834
|
+
/* @__PURE__ */ i("button", { className: "flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50", children: /* @__PURE__ */ i(ue, { className: "h-4 w-4" }) })
|
|
1835
1835
|
] }) });
|
|
1836
1836
|
}, Rt = (e) => {
|
|
1837
1837
|
const { children: o, tag: t, styles: l, blockProps: r, $loading: n } = e, { pagination: a, inBuilder: s } = e;
|
|
@@ -1851,7 +1851,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1851
1851
|
a && /* @__PURE__ */ i(
|
|
1852
1852
|
Tt,
|
|
1853
1853
|
{
|
|
1854
|
-
...
|
|
1854
|
+
...H(e, [
|
|
1855
1855
|
"limit",
|
|
1856
1856
|
"totalItems",
|
|
1857
1857
|
"paginationStrategy",
|
|
@@ -1866,7 +1866,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1866
1866
|
}, At = {
|
|
1867
1867
|
type: "Repeater",
|
|
1868
1868
|
label: "Repeater",
|
|
1869
|
-
icon:
|
|
1869
|
+
icon: F,
|
|
1870
1870
|
group: "basic",
|
|
1871
1871
|
description: "Repeater block is used to display a list of items based on data binding in repeaterItems",
|
|
1872
1872
|
dataProviderMode: "live",
|
|
@@ -1984,7 +1984,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1984
1984
|
}, Mt = {
|
|
1985
1985
|
type: "RepeaterItem",
|
|
1986
1986
|
label: "Repeater Item",
|
|
1987
|
-
icon:
|
|
1987
|
+
icon: F,
|
|
1988
1988
|
hidden: !0,
|
|
1989
1989
|
group: "basic",
|
|
1990
1990
|
...p({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as d, createElement as m } from "react";
|
|
3
|
-
import { B as s } from "./register-chai-top-bar-
|
|
3
|
+
import { B as s } from "./register-chai-top-bar-CX_JkRJn.js";
|
|
4
4
|
import { useAtom as h } from "jotai";
|
|
5
5
|
import { map as p } from "lodash-es";
|
|
6
6
|
import { Smartphone as w, Tablet as f, Laptop as u, LaptopMinimal as x } from "lucide-react";
|
|
7
|
-
import { p as v, T as _ } from "./index-
|
|
7
|
+
import { p as v, T as _ } from "./index-D5d4QDq7.js";
|
|
8
8
|
const b = [
|
|
9
9
|
{
|
|
10
10
|
title: "mobile_xs_title",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),a=require("./register-chai-top-bar-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),a=require("./register-chai-top-bar-DWTuRU53.cjs"),u=require("jotai"),x=require("lodash-es"),n=require("lucide-react"),c=require("./index-BRJCj7c_.cjs"),m=[{title:"mobile_xs_title",content:"mobile_xs_content",icon:e.jsx(n.Smartphone,{className:"h-4 w-4"}),width:400},{title:"tablet_md_title",content:"tablet_md_content",icon:e.jsx(n.Tablet,{className:"h-4 w-4"}),width:800},{title:"desktop_xl_title",content:"desktop_xl_content",icon:e.jsx(n.Laptop,{className:"h-4 w-4"}),width:1200},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",icon:e.jsx(n.LaptopMinimal,{className:"h-4 w-4"}),width:1600}],w=({currentWidth:t,width:s,icon:o,setIframeWidth:r})=>e.jsx(a.Button,{className:"px-3 py-3",onClick:()=>r(s),variant:s===t?"default":"ghost",children:o}),p=()=>{const[t,s]=l.useState(1200),o=i=>s(i),[r,d]=u.useAtom(c.previewUrlAtom);if(!r)return null;const h=()=>{d("")};return e.jsxs("div",{className:"absolute inset-0 z-[999999] flex h-screen w-screen flex-col overflow-hidden bg-gray-100",children:[e.jsxs("div",{className:"flex h-[50px] items-center justify-center border-b border-gray-200 px-4 shadow-sm",children:[e.jsx("div",{className:"flex items-center justify-center rounded-md border border-gray-300",children:x.map(m,i=>l.createElement(w,{...i,setIframeWidth:o,key:i.title,currentWidth:t}))})," ",e.jsx(c.Tooltip,{content:"Exit Preview",delayDuration:0,children:e.jsx(a.Button,{variant:"destructive",size:"sm",onClick:h,children:e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H12C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H3C2.44772 13 2 12.5523 2 12V3ZM12 3H3V12H12V3Z",fill:"currentColor",fillRule:"evenodd","clip-rule":"evenodd"})})})})]}),e.jsx("iframe",{style:{width:`${t}px`,transition:"width 0.3s ease-in-out"},className:"no-scrollbar mx-auto h-full overflow-y-auto border bg-white",src:r})]})};exports.default=p;
|
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": "4.0.0-beta.
|
|
8
|
+
"version": "4.0.0-beta.8",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -47,6 +47,11 @@
|
|
|
47
47
|
"import": "./dist/runtime.js",
|
|
48
48
|
"require": "./dist/runtime.cjs"
|
|
49
49
|
},
|
|
50
|
+
"./runtime/client": {
|
|
51
|
+
"types": "./dist/runtime-client.d.ts",
|
|
52
|
+
"import": "./dist/runtime-client.js",
|
|
53
|
+
"require": "./dist/runtime-client.cjs"
|
|
54
|
+
},
|
|
50
55
|
"./actions/supabase": {
|
|
51
56
|
"types": "./dist/supabase-actions.d.ts",
|
|
52
57
|
"import": "./dist/supabase-actions.js",
|
|
@@ -71,8 +76,7 @@
|
|
|
71
76
|
"postgres": "^3.4.8",
|
|
72
77
|
"react": "^18.0 || ^19.0 || ^19.1 || ^19.2",
|
|
73
78
|
"react-dom": "^18.0 || ^19.0 || ^19.1 || ^19.2",
|
|
74
|
-
"sharp": "^0.34.5"
|
|
75
|
-
"streamdown": "^1.6.10"
|
|
79
|
+
"sharp": "^0.34.5"
|
|
76
80
|
},
|
|
77
81
|
"peerDependenciesMeta": {
|
|
78
82
|
"@types/react": {
|
|
@@ -90,9 +94,6 @@
|
|
|
90
94
|
"ai": {
|
|
91
95
|
"optional": true
|
|
92
96
|
},
|
|
93
|
-
"streamdown": {
|
|
94
|
-
"optional": true
|
|
95
|
-
},
|
|
96
97
|
"sharp": {
|
|
97
98
|
"optional": true
|
|
98
99
|
},
|
|
@@ -188,6 +189,7 @@
|
|
|
188
189
|
"react-i18next": "16.0.0",
|
|
189
190
|
"react-wrap-balancer": "^1.1.1",
|
|
190
191
|
"sonner": "^2.0.7",
|
|
192
|
+
"streamdown": "^1.6.10",
|
|
191
193
|
"tailwind-merge": "^3.4.0",
|
|
192
194
|
"tree-model": "^1.0.7",
|
|
193
195
|
"undo-manager": "1.1.1",
|
|
@@ -246,7 +248,6 @@
|
|
|
246
248
|
"react-router-dom": "^7.11.0",
|
|
247
249
|
"shadcn": "2.3.0",
|
|
248
250
|
"sharp": "^0.34.5",
|
|
249
|
-
"streamdown": "^1.6.10",
|
|
250
251
|
"tailwindcss": "^3.4.19",
|
|
251
252
|
"ts-jest": "^29.4.6",
|
|
252
253
|
"ts-node": "^10.9.2",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),y=require("./register-chai-top-bar-BqwKw4uy.cjs"),f=require("./index-xYnNKovy.cjs"),T=require("culori"),V=require("./fonts-B-Xt29pe.cjs"),N=require("react"),R=require("react-i18next");function j(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const b=j(T),C=j(N),d=e=>e?e%1===0?e:e.toFixed(4):"0",E=e=>`hsl(${d(e.h)} ${d(e.s*100)}% ${d(e.l*100)}%)`,I=(e,o="hsl",t="4")=>{try{const r=b.parse(e);if(!r)throw new Error("Invalid color input");switch(o){case"hsl":{const s=b.converter("hsl")(r);return t==="4"?E(s):`${d(s.h)} ${d(s.s*100)}% ${d(s.l*100)}%`}case"rgb":return b.formatRgb(r);case"oklch":{const s=b.converter("oklch")(r);return`oklch(${d(s.l)} ${d(s.c)} ${d(s.h)})`}case"hex":return b.formatHex(r);default:return e}}catch(r){return console.error(`Failed to convert color: ${e}`,r),e}},x=e=>I(e,"hex"),q=e=>{const o={fontFamily:{heading:"",body:""},borderRadius:"",colors:{}};try{const t=w(e);if(!t.isValid)return console.warn("CSS validation failed:",t.error),$();const r=v(e,":root"),s=v(e,".dark"),c=u(r,"--font-sans")||u(r,"--font-family")||u(r,"--font-heading")||u(r,"--font-body"),a=D(c);o.fontFamily={heading:a,body:a};const h=u(r,"--radius")||u(r,"--border-radius")||"0.5rem";o.borderRadius=P(h),["background","foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","destructive","destructive-foreground","border","input","ring","card","card-foreground","popover","popover-foreground"].forEach(i=>{const p=u(r,`--${i}`),g=u(s,`--${i}`);if(p||g){const l=p?k(p):"#000000",S=g?k(g):l;o.colors[i]=[l,S]}})}catch(t){return console.error("Error parsing CSS to ChaiThemeValues:",t),$()}return o},v=(e,o)=>{var r,s;const t=new RegExp(`${F(o)}\\s*{([^}]+)}`);return((s=(r=e.match(t))==null?void 0:r[1])==null?void 0:s.trim())||null},u=(e,o)=>{var s;if(!e)return null;const t=new RegExp(`${F(o)}\\s*:\\s*([^;]+)`),r=e.match(t);return((s=r==null?void 0:r[1])==null?void 0:s.trim())||null},k=e=>{if(!e||typeof e!="string")return"#000000";try{const o=e.replace(/var\([^)]+\)/g,"").trim();if(!o)return"#000000";if(/^[a-z]+$/i.test(o))return x(o)||"#000000";if(/^#?([0-9A-F]{3,4}|[0-9A-F]{6}|[0-9A-F]{8})$/i.test(o.replace(/#/g,""))){const r=o.startsWith("#")?o:`#${o}`;return r.length<=5?`#${r.slice(1).split("").map(s=>s+s).join("")}`.slice(0,7):r.length>7?r.slice(0,7):r}if(/^(rgb|hsl|oklch)a?\(/i.test(o))return x(o)||"#000000";const t=o.match(/^(\d+\.?\d*)\s+(\d+\.?\d*)%\s+(\d+\.?\d*)%$/);if(t){const[,r,s,c]=t,a=`hsl(${r} ${s}% ${c}%)`;return x(a)||"#000000"}if(/^[\d.]+[\s,]+[\d.]+[\s,]+[\d.]+(?:[\s,/]+[\d.]+)?$/.test(o)){const r=o.split(/[\s,]+/).filter(Boolean);if(r.length>=3){const c=r.some(a=>a.includes("%"))?`hsl(${r[0]} ${r[1]} ${r[2]})`:`rgb(${r[0]}, ${r[1]}, ${r[2]})`;return x(c)||"#000000"}}return x(o)||"#000000"}catch(o){return console.warn("Failed to process color:",e,o),"#000000"}},D=e=>{const o=V.getAllRegisteredFonts();if(!e)return"ui-sans-serif, system-ui, sans-serif";try{const r=e.replace(/["']/g,"").trim().split(",")[0].trim(),s=o.find(c=>c.family.toLowerCase()===r.toLowerCase());return(s==null?void 0:s.family)||"ui-sans-serif, system-ui, sans-serif"}catch(t){return console.warn("Error processing font family:",e,t),"ui-sans-serif, system-ui, sans-serif"}},P=e=>{try{const o=e.trim();if(o.endsWith("px"))return o;if(o.endsWith("rem")){const r=parseFloat(o.replace("rem",""));if(!isNaN(r))return`${Math.round(r*16)}px`}if(o.endsWith("em")){const r=parseFloat(o.replace("em",""));if(!isNaN(r))return`${Math.round(r*16)}px`}const t=parseFloat(o);return isNaN(t)?"8px":`${Math.round(t)}px`}catch(o){return console.warn("Error converting border radius to px:",e,o),"8px"}},$=()=>({fontFamily:{heading:"ui-sans-serif, system-ui, sans-serif",body:"ui-sans-serif, system-ui, sans-serif"},borderRadius:"8px",colors:{background:["#ffffff","#000000"],foreground:["#000000","#ffffff"],primary:["#3b82f6","#60a5fa"],"primary-foreground":["#ffffff","#1e293b"],secondary:["#f1f5f9","#334155"],"secondary-foreground":["#0f172a","#f8fafc"],muted:["#f8fafc","#1e293b"],"muted-foreground":["#64748b","#94a3b8"],accent:["#f1f5f9","#334155"],"accent-foreground":["#0f172a","#f8fafc"],destructive:["#ef4444","#f87171"],"destructive-foreground":["#ffffff","#1e293b"],border:["#e2e8f0","#475569"],input:["#e2e8f0","#475569"],ring:["#3b82f6","#60a5fa"],card:["#ffffff","#0f172a"],"card-foreground":["#000000","#f8fafc"],popover:["#ffffff","#0f172a"],"popover-foreground":["#000000","#f8fafc"]}}),F=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),B=e=>["background","foreground","primary","primary-foreground"].every(r=>e.colors[r]&&Array.isArray(e.colors[r])&&e.colors[r].length>=2)&&!!e.fontFamily.heading&&!!e.fontFamily.body&&!!e.borderRadius,w=e=>{if(!e||typeof e!="string")return{isValid:!1,error:"Please enter valid CSS content"};const o=e.trim();if(!o)return{isValid:!1,error:"Please enter CSS content"};try{if(!o.includes("{")||!o.includes("}"))return{isValid:!1,error:"Invalid CSS format. CSS should contain proper block structure with { }"};const t=(o.match(/{/g)||[]).length,r=(o.match(/}/g)||[]).length;return t!==r?{isValid:!1,error:"Invalid CSS format. Unmatched braces detected"}:!o.includes("--")||!o.includes(":")?{isValid:!1,error:"Invalid CSS format. CSS should contain variable definitions like --primary: #color"}:!o.includes(":root")&&!o.includes(".dark")?{isValid:!1,error:"CSS should contain at least :root or .dark selector with theme variables"}:{isValid:!0}}catch(t){return console.error("CSS validation error:",t),{isValid:!1,error:"Failed to parse CSS. Please check your syntax."}}},M=`:root {
|
|
2
|
-
--background: 0 0% 100%;
|
|
3
|
-
--foreground: oklch(0.52 0.13 144.17);
|
|
4
|
-
--primary: #3e2723;
|
|
5
|
-
--primary-foreground: #ffffff;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.dark {
|
|
9
|
-
--background: 222.2 84% 4.9%;
|
|
10
|
-
--foreground: hsl(37.50 36.36% 95.69%);
|
|
11
|
-
--primary: rgb(46, 125, 50);
|
|
12
|
-
--primary-foreground: #ffffff;
|
|
13
|
-
}`,_=({open:e,onOpenChange:o,onImport:t})=>{const[r,s]=C.useState(""),[c,a]=C.useState(null),[h,m]=C.useState(!1),{t:i}=R.useTranslation(),p=async()=>{m(!0),a(null);try{const l=w(r);if(!l.isValid){a(l.error||i("Invalid CSS format")),setTimeout(()=>{a(null)},5e3),m(!1);return}const S=q(r);if(!B(S)){a(i("The CSS doesn't contain enough theme information. Please ensure it includes at least background, foreground, primary, and primary-foreground colors.")),setTimeout(()=>{a(null)},5e3),m(!1);return}t(S),s(""),a(null),o(!1)}catch(l){console.error("Error importing CSS:",l),a(i("Failed to parse CSS. Please check your syntax and try again.")),setTimeout(()=>{a(null)},5e3)}finally{m(!1)}},g=()=>{s(""),a(null),o(!1)};return n.jsx(f.Dialog,{open:e,onOpenChange:o,children:n.jsxs(f.DialogContent,{className:"flex max-h-[80vh] max-w-2xl flex-col",children:[n.jsxs(f.DialogHeader,{children:[n.jsx(f.DialogTitle,{children:i("Import CSS Theme")}),n.jsxs(f.DialogDescription,{className:"space-y-2",children:[n.jsx("p",{children:i("Paste your CSS variables to import a custom theme. The CSS should contain :root and .dark blocks with CSS custom properties.")}),n.jsxs("div",{className:"flex items-center",children:[n.jsx("p",{className:"font-bold",children:"Get theme resources:"}),n.jsx(y.Button,{variant:"link",size:"sm",onClick:()=>window.open("https://tweakcn.com/","_blank"),children:"TweakCN"}),n.jsx(y.Button,{variant:"link",size:"sm",onClick:()=>window.open("https://ui.shadcn.com/themes#themes","_blank"),children:"shadcn/ui Themes"}),n.jsx(y.Button,{variant:"link",size:"sm",onClick:()=>window.open("https://zippystarter.com/tools/shadcn-ui-theme-generator","_blank"),children:"ZippyStarter"})]})]})]}),n.jsxs("div",{className:"flex-1 space-y-4 overflow-hidden",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(f.Label,{htmlFor:"css-input",children:i("CSS Variables")}),n.jsx(f.Textarea,{id:"css-input",placeholder:M,value:r,onChange:l=>s(l.target.value),className:"min-h-[300px] resize-none font-mono text-sm",disabled:h})]}),c&&n.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 p-3",children:n.jsx("p",{className:"text-sm text-red-600",children:c})})]}),n.jsxs(f.DialogFooter,{className:"gap-2",children:[n.jsx(y.Button,{variant:"outline",onClick:g,disabled:h,children:i("Cancel")}),n.jsx(y.Button,{onClick:p,disabled:!r.trim()||h,children:i(h?"Importing...":"Import Theme")})]})]})})};exports.CssImportModal=_;
|
package/dist/index-B-rSiAp_.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("lodash-es"),s="#styles:",l=e=>{const n=["_type","_id","_parent","_bindings","_name"],o=["$loading","blockProps","inBuilder","lang","draft","pageProps","pageData","children"],r=t.keys(e.properties);if(t.intersection(r,n).length>0)throw new Error(`Reserved props are not allowed: ${t.intersection(r,n).join(", ")}`);if(t.intersection(r,o).length>0)throw new Error(`Runtime props are not allowed in schema: ${t.intersection(r,o).join(", ")}`);const i=t.get(e,"properties",{}),u={};return t.each(i,(p,a)=>{t.isEmpty(p.ui)||(u[a]={...p.ui},delete i[a].ui)}),{schema:t.isEmpty(i)?{}:{...t.omit(e,["ui"])},uiSchema:{...t.get(e,"ui",{}),...u}}},d=(e="")=>({type:"string",styles:!0,default:`${s},${e}`,ui:{"ui:widget":"hidden"}}),c=(e="")=>({type:"string",styles:!0,default:`${s},${e}`,ui:{"ui:widget":"hidden"}}),h=e=>(console.warn("runtimeProp is deprecated, use builderProp instead"),{runtime:!0,...e}),g=e=>({builderProp:!0,...e}),y=e=>`${s},${e}`;exports.StylesProp=d;exports.builderProp=g;exports.defaultChaiStyles=y;exports.registerChaiBlockSchema=l;exports.runtimeProp=h;exports.stylesProp=c;
|
package/dist/index-Dxfyt4d4.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { keys as c, intersection as t, get as d, each as g, isEmpty as l, omit as h } from "lodash-es";
|
|
2
|
-
const i = "#styles:", y = (e) => {
|
|
3
|
-
const n = ["_type", "_id", "_parent", "_bindings", "_name"], o = ["$loading", "blockProps", "inBuilder", "lang", "draft", "pageProps", "pageData", "children"], r = c(e.properties);
|
|
4
|
-
if (t(r, n).length > 0)
|
|
5
|
-
throw new Error(`Reserved props are not allowed: ${t(r, n).join(", ")}`);
|
|
6
|
-
if (t(r, o).length > 0)
|
|
7
|
-
throw new Error(`Runtime props are not allowed in schema: ${t(r, o).join(", ")}`);
|
|
8
|
-
const s = d(e, "properties", {}), u = {};
|
|
9
|
-
return g(s, (a, p) => {
|
|
10
|
-
l(a.ui) || (u[p] = { ...a.ui }, delete s[p].ui);
|
|
11
|
-
}), {
|
|
12
|
-
schema: l(s) ? {} : { ...h(e, ["ui"]) },
|
|
13
|
-
uiSchema: { ...d(e, "ui", {}), ...u }
|
|
14
|
-
};
|
|
15
|
-
}, P = (e = "") => ({
|
|
16
|
-
type: "string",
|
|
17
|
-
styles: !0,
|
|
18
|
-
default: `${i},${e}`,
|
|
19
|
-
ui: { "ui:widget": "hidden" }
|
|
20
|
-
}), w = (e = "") => ({
|
|
21
|
-
type: "string",
|
|
22
|
-
styles: !0,
|
|
23
|
-
default: `${i},${e}`,
|
|
24
|
-
ui: { "ui:widget": "hidden" }
|
|
25
|
-
}), $ = (e) => (console.warn("runtimeProp is deprecated, use builderProp instead"), {
|
|
26
|
-
runtime: !0,
|
|
27
|
-
...e
|
|
28
|
-
}), f = (e) => ({
|
|
29
|
-
builderProp: !0,
|
|
30
|
-
...e
|
|
31
|
-
}), _ = (e) => `${i},${e}`;
|
|
32
|
-
export {
|
|
33
|
-
P as S,
|
|
34
|
-
$ as a,
|
|
35
|
-
f as b,
|
|
36
|
-
_ as d,
|
|
37
|
-
y as r,
|
|
38
|
-
w as s
|
|
39
|
-
};
|