@chaibuilder/sdk 3.1.19 → 3.1.21

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.
@@ -2811,7 +2811,6 @@ const useWrapperBlock = () => useAtomValue$1(wrapperBlockAtom), useCanvasIframe
2811
2811
  return useCallback(
2812
2812
  (n) => {
2813
2813
  const r = syncBlocksWithDefaults(getBlocksFromHTML(n)), a = mergeBlocksWithExisting(r, o);
2814
- debugger;
2815
2814
  return handlei18N(a, o);
2816
2815
  },
2817
2816
  [o]
@@ -4255,6 +4254,7 @@ const INLINE_EDITABLE_BLOCKS = ["Heading", "Paragraph", "Text", "Link", "Span",
4255
4254
  cursor: pointer !important;
4256
4255
  z-index: 10002 !important;
4257
4256
  }
4257
+ #active-inline-editing-element{outline: 2px solid #00c951;}
4258
4258
  </style>
4259
4259
  <style type="text/tailwindcss">
4260
4260
  @layer utilities {
@@ -5122,7 +5122,7 @@ const RichTextEditor = memo(
5122
5122
  }, [c]);
5123
5123
  const d = useMemo(() => {
5124
5124
  var m;
5125
- const u = "max-w-none shadow-none outline outline-[2px] outline-green-500 [&_*]:shadow-none";
5125
+ const u = "max-w-none shadow-none outline outline-[2px] [&_*]:shadow-none";
5126
5126
  if (!n) return u;
5127
5127
  const g = ((m = n == null ? void 0 : n.className) == null ? void 0 : m.replace("sr-only", "")) || "";
5128
5128
  return `${u} ${g}`;
@@ -5140,7 +5140,16 @@ const RichTextEditor = memo(
5140
5140
  children: /* @__PURE__ */ jsx(RteMenubar, { editor: c, from: "canvas" })
5141
5141
  }
5142
5142
  ),
5143
- /* @__PURE__ */ jsx(EditorContent, { onKeyDown: p, value: o, editor: c, className: d })
5143
+ /* @__PURE__ */ jsx(
5144
+ EditorContent,
5145
+ {
5146
+ id: "active-inline-editing-element",
5147
+ onKeyDown: p,
5148
+ value: o,
5149
+ editor: c,
5150
+ className: d
5151
+ }
5152
+ )
5144
5153
  ] });
5145
5154
  }
5146
5155
  ), MemoizedEditor = memo(
@@ -5504,7 +5513,7 @@ const RichTextEditor = memo(
5504
5513
  /* @__PURE__ */ jsx("p", { className: "font-semibold", children: o("Oops! Something went wrong.") }),
5505
5514
  /* @__PURE__ */ jsx("p", { children: o("Please try again.") })
5506
5515
  ] }) });
5507
- }, CodeEditor$1 = React__default.lazy(() => import("./code-editor-tQ-y-Wn4.js")), CanvasArea = () => {
5516
+ }, CodeEditor$1 = React__default.lazy(() => import("./code-editor-DRLBAEJb.js")), CanvasArea = () => {
5508
5517
  const [o] = useCodeEditor(), n = useBuilderProp("onError", noop);
5509
5518
  return /* @__PURE__ */ jsx("div", { className: "flex h-full max-h-full w-full flex-1 flex-col", children: /* @__PURE__ */ jsxs("div", { className: "relative flex h-full max-h-full flex-col overflow-hidden bg-gray-100/40", children: [
5510
5519
  /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsx(FallbackError, {}), onError: n, children: /* @__PURE__ */ jsx(StaticCanvas, {}) }) }),
@@ -6074,7 +6083,7 @@ const DataBindingSelector = ({
6074
6083
  ]
6075
6084
  }
6076
6085
  ) });
6077
- }, RTEModal = React__default.lazy(() => import("./rte-widget-modal-Ao1azHBf.js")), RichTextEditorFieldComp = ({ blockId: o, id: n, placeholder: r, value: a, onChange: l, onBlur: i }) => {
6086
+ }, RTEModal = React__default.lazy(() => import("./rte-widget-modal-MiC8MgXv.js")), RichTextEditorFieldComp = ({ blockId: o, id: n, placeholder: r, value: a, onChange: l, onBlur: i }) => {
6078
6087
  const c = useRef(null), [d, p] = useState(!1), u = useRTEditor({
6079
6088
  blockId: o,
6080
6089
  value: a,
@@ -7782,7 +7791,6 @@ function ManualClasses() {
7782
7791
  }),
7783
7792
  [f, c, o]
7784
7793
  ), j = (T) => {
7785
- debugger;
7786
7794
  const D = n.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
7787
7795
  g(m, [T]), u(m, D, !0), r(""), l(-1);
7788
7796
  }, _ = () => {
@@ -12032,6 +12040,7 @@ ${l})
12032
12040
  }, ChaiBuilderComponent = (o) => {
12033
12041
  const n = useMemo(() => o.layout || RootLayout, [o.layout]), r = useBuilderProp("builderTheme", defaultThemeValues), a = useBuilderProp("flags.exportCode", !1);
12034
12042
  return /* @__PURE__ */ jsxs(Fragment, { children: [
12043
+ o.children,
12035
12044
  /* @__PURE__ */ jsx(CssThemeVariables, { theme: r }),
12036
12045
  /* @__PURE__ */ jsx(n, {}),
12037
12046
  a && /* @__PURE__ */ jsx(ExportCodeModal, {})
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("./index-DV1NenGF.cjs"),n=require("./tooltip-CzZ7Fvt7.cjs");require("clsx");require("tailwind-merge");const S=({isOpen:m,onClose:l,editor:t,rteElement:f})=>{const r=u.usePageExternalData(),j=o=>{if(!t)return;const i=`{{${o}}}`;t.commands.focus();const{from:p,to:g}=t.state.selection;if(p!==g)t.chain().deleteSelection().insertContent(i).run();else{const{state:c}=t,s=c.selection.from,x=c.doc.textBetween(Math.max(0,s-1),s),a=c.doc.textBetween(s,Math.min(s+1,c.doc.content.size));let d="";s>0&&x!==" "&&!/[.,!?;:]/.test(x)&&(d=" ");let h="";a&&a!==" "&&!/[.,!?;:]/.test(a)&&(h=" "),t.chain().insertContent(d+i+h).run()}};return e.jsx(n.Dialog,{open:m,onOpenChange:o=>!o&&l(),children:e.jsxs(n.DialogContent,{className:"max-h-[90vh] overflow-y-auto sm:max-w-[800px]",children:[e.jsx(n.DialogHeader,{children:e.jsxs(n.DialogTitle,{className:"flex items-center justify-between pr-8",children:[e.jsx("span",{children:"Rich Text Editor"}),Object.keys(r).length>0&&e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{className:"mr-2 text-sm text-muted-foreground",children:"Add field:"}),e.jsx("div",{className:"rte-path-selector",children:e.jsx(u.NestedPathSelector,{data:r,onSelect:j})})]})]})}),f,e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx(n.Button,{onClick:l,children:"Done"})})]})})};exports.default=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("./index-B-HhWOKS.cjs"),n=require("./tooltip-CzZ7Fvt7.cjs");require("clsx");require("tailwind-merge");const S=({isOpen:m,onClose:l,editor:t,rteElement:f})=>{const r=u.usePageExternalData(),j=o=>{if(!t)return;const i=`{{${o}}}`;t.commands.focus();const{from:p,to:g}=t.state.selection;if(p!==g)t.chain().deleteSelection().insertContent(i).run();else{const{state:c}=t,s=c.selection.from,x=c.doc.textBetween(Math.max(0,s-1),s),a=c.doc.textBetween(s,Math.min(s+1,c.doc.content.size));let d="";s>0&&x!==" "&&!/[.,!?;:]/.test(x)&&(d=" ");let h="";a&&a!==" "&&!/[.,!?;:]/.test(a)&&(h=" "),t.chain().insertContent(d+i+h).run()}};return e.jsx(n.Dialog,{open:m,onOpenChange:o=>!o&&l(),children:e.jsxs(n.DialogContent,{className:"max-h-[90vh] overflow-y-auto sm:max-w-[800px]",children:[e.jsx(n.DialogHeader,{children:e.jsxs(n.DialogTitle,{className:"flex items-center justify-between pr-8",children:[e.jsx("span",{children:"Rich Text Editor"}),Object.keys(r).length>0&&e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{className:"mr-2 text-sm text-muted-foreground",children:"Add field:"}),e.jsx("div",{className:"rte-path-selector",children:e.jsx(u.NestedPathSelector,{data:r,onSelect:j})})]})]})}),f,e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx(n.Button,{onClick:l,children:"Done"})})]})})};exports.default=S;
@@ -1,5 +1,5 @@
1
1
  import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
- import { d as N, N as D } from "./index-BjbJYOzg.js";
2
+ import { d as N, N as D } from "./index-D5zinQbA.js";
3
3
  import { a1 as v, a3 as S, a6 as j, a9 as w, v as y } from "./tooltip-Bz2MxMHf.js";
4
4
  import "clsx";
5
5
  import "tailwind-merge";
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": "3.1.19",
8
+ "version": "3.1.21",
9
9
  "type": "module",
10
10
  "repository": {
11
11
  "type": "git",