@chaibuilder/sdk 3.1.10 → 3.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { jsx as o, jsxs as d } from "react/jsx-runtime";
2
- import { u as C, a as k, b as v, c as g } from "./index-BXLWWUUp.js";
2
+ import { u as C, a as k, b as v, c as g } from "./index-B4arQ22-.js";
3
3
  import "lodash-es";
4
4
  import "clsx";
5
5
  import "tailwind-merge";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("./index--Qiql02b.cjs");require("lodash-es");require("clsx");require("tailwind-merge");require("tree-model");const i=require("react");require("jotai");require("@chaibuilder/runtime");require("sonner");const q=require("react-i18next"),r=require("./tooltip-C2BCZ8Al.cjs"),g=require("@react-hookz/web"),m=n=>{const s=document.createElement("div");return s.innerHTML=n,s.innerHTML};function j(){const{t:n}=q.useTranslation(),[s,h]=i.useState(!1),[a,p]=i.useState(""),[t,d]=c.useCodeEditor(),[u]=c.useSelectedBlockIds(),b=c.useUpdateBlocksProps(),f=c.useUpdateBlocksPropsRealtime(),C=g.useThrottledCallback(o=>{const l=m(o);f([t.blockId],{[t.blockProp]:l})},[],300),x=i.useCallback(()=>{if(s){const o=m(a);b([t.blockId],{[t.blockProp]:o})}},[s,a]);i.useEffect(()=>{u.includes(t==null?void 0:t.blockId)||(x(),d(null))},[u]);const k=()=>{x(),d(null)};return e.jsx(r.Dialog,{open:!0,onOpenChange:k,children:e.jsxs(r.DialogContent,{className:"flex max-h-[400px] min-h-[200px] max-w-4xl flex-col border-gray-700 text-black",children:[e.jsx(r.DialogHeader,{className:"shrink-0 border-b border-gray-700 pb-3",children:e.jsx(r.DialogTitle,{className:"flex items-center justify-between text-black",children:e.jsxs("div",{className:"space-x-3 text-sm font-semibold",children:[e.jsx("span",{children:n("HTML Code Editor |")}),e.jsx("span",{className:"text-xs text-gray-400",children:n("Scripts will be only executed in preview and live mode.")})]})})}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(r.Textarea,{className:"h-full w-full resize-none font-mono text-xs",value:a||t.initialCode,onChange:o=>{const l=o.target.value;h(!0),p(l),C(l)},rows:10,placeholder:"Enter your code here..."})})]})})}exports.default=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("./index-B506vH5V.cjs");require("lodash-es");require("clsx");require("tailwind-merge");require("tree-model");const i=require("react");require("jotai");require("@chaibuilder/runtime");require("sonner");const q=require("react-i18next"),r=require("./tooltip-C2BCZ8Al.cjs"),g=require("@react-hookz/web"),m=n=>{const s=document.createElement("div");return s.innerHTML=n,s.innerHTML};function j(){const{t:n}=q.useTranslation(),[s,h]=i.useState(!1),[a,p]=i.useState(""),[t,d]=c.useCodeEditor(),[u]=c.useSelectedBlockIds(),b=c.useUpdateBlocksProps(),f=c.useUpdateBlocksPropsRealtime(),C=g.useThrottledCallback(o=>{const l=m(o);f([t.blockId],{[t.blockProp]:l})},[],300),x=i.useCallback(()=>{if(s){const o=m(a);b([t.blockId],{[t.blockProp]:o})}},[s,a]);i.useEffect(()=>{u.includes(t==null?void 0:t.blockId)||(x(),d(null))},[u]);const k=()=>{x(),d(null)};return e.jsx(r.Dialog,{open:!0,onOpenChange:k,children:e.jsxs(r.DialogContent,{className:"flex max-h-[400px] min-h-[200px] max-w-4xl flex-col border-gray-700 text-black",children:[e.jsx(r.DialogHeader,{className:"shrink-0 border-b border-gray-700 pb-3",children:e.jsx(r.DialogTitle,{className:"flex items-center justify-between text-black",children:e.jsxs("div",{className:"space-x-3 text-sm font-semibold",children:[e.jsx("span",{children:n("HTML Code Editor |")}),e.jsx("span",{className:"text-xs text-gray-400",children:n("Scripts will be only executed in preview and live mode.")})]})})}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(r.Textarea,{className:"h-full w-full resize-none font-mono text-xs",value:a||t.initialCode,onChange:o=>{const l=o.target.value;h(!0),p(l),C(l)},rows:10,placeholder:"Enter your code here..."})})]})})}exports.default=j;
package/dist/core.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index--Qiql02b.cjs"),s=require("./common-functions-BZmyleS1.cjs"),a=require("./apply-binding-DCZAw7M-.cjs"),i=require("react-i18next"),l=require("i18next");exports.ChaiAddBlocksDialog=e.AddBlocksDialog;exports.ChaiAddBlocksPanel=e.AddBlocksPanel;exports.ChaiAskAiUserPrompt=e.AIUserPrompt;exports.ChaiBlockAttributesEditor=e.BlockAttributesEditor;exports.ChaiBlockPropsEditor=e.BlockSettings;exports.ChaiBlockStyleEditor=e.BlockStyling;exports.ChaiBuilderCanvas=e.CanvasArea;exports.ChaiBuilderEditor=e.ChaiBuilderEditor;exports.ChaiDarkModeSwitcher=e.DarkMode;exports.ChaiDefaultBlocks=e.DefaultChaiBlocks;exports.ChaiExportCodeModal=e.ExportCodeModal;exports.ChaiImportHTML=e.ImportHTML;exports.ChaiOutline=e.ListTree;exports.ChaiScreenSizes=e.Breakpoints;exports.ChaiThemeConfigPanel=e.ThemeConfigPanel;exports.ChaiUILibrariesPanel=e.UILibrariesPanel;exports.ChaiUndoRedo=e.UndoRedo;exports.IfChaiFeatureFlag=e.IfChaiFeatureFlag;exports.PERMISSIONS=e.PERMISSIONS;exports.getClassValueAndUnit=e.getClassValueAndUnit;exports.registerBlockSettingField=e.registerBlockSettingField;exports.registerBlockSettingTemplate=e.registerBlockSettingTemplate;exports.registerBlockSettingWidget=e.registerBlockSettingWidget;exports.registerChaiAddBlockTab=e.registerChaiAddBlockTab;exports.registerChaiFeatureFlag=e.registerChaiFeatureFlag;exports.registerChaiFeatureFlags=e.registerChaiFeatureFlags;exports.registerChaiLibrary=e.registerChaiLibrary;exports.registerChaiMediaManager=e.registerChaiMediaManager;exports.registerChaiPreImportHTMLHook=e.registerChaiPreImportHTMLHook;exports.registerChaiSaveToLibrary=e.registerChaiSaveToLibrary;exports.registerChaiSidebarPanel=e.registerChaiSidebarPanel;exports.registerChaiTopBar=e.registerChaiTopBar;exports.useAddBlock=e.useAddBlock;exports.useAddClassesToBlocks=e.useAddClassesToBlocks;exports.useAskAi=e.useAskAi;exports.useBlockHighlight=e.useBlockHighlight;exports.useBlocksHtmlForAi=e.useBlocksHtmlForAi;exports.useBlocksStore=e.useBlocksStore;exports.useBlocksStoreUndoableActions=e.useBlocksStoreUndoableActions;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderProp=e.useBuilderProp;exports.useBuilderReset=e.useBuilderReset;exports.useCanvasDisplayWidth=e.useCanvasDisplayWidth;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useChaiFeatureFlag=e.useChaiFeatureFlag;exports.useChaiFeatureFlags=e.useChaiFeatureFlags;exports.useCodeEditor=e.useCodeEditor;exports.useCopyBlockIds=e.useCopyBlocks;exports.useCopyToClipboard=e.useCopyToClipboard;exports.useCurrentPage=e.useCurrentPage;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useHighlightBlockId=e.useHighlightBlockId;exports.useHtmlToBlocks=e.useHtmlToBlocks;exports.useI18nBlocks=e.useI18nBlocks;exports.useInlineEditing=e.useInlineEditing;exports.useIsPageLoaded=e.useIsPageLoaded;exports.useLanguages=e.useLanguages;exports.useLibraryBlocks=e.useLibraryBlocks;exports.useMediaManagerComponent=e.useMediaManagerComponent;exports.usePartailBlocksStore=e.usePartialBlocksStore;exports.usePartialBlocksList=e.usePartialBlocksList;exports.usePasteBlocks=e.usePasteBlocks;exports.usePermissions=e.usePermissions;exports.usePreviewMode=e.usePreviewMode;exports.usePubSub=e.usePubSub;exports.useRemoveAllClassesForBlock=e.useRemoveAllClassesForBlock;exports.useRemoveBlocks=e.useRemoveBlocks;exports.useRemoveClassesFromBlocks=e.useRemoveClassesFromBlocks;exports.useReplaceBlock=e.useReplaceBlock;exports.useResetBlockStyles=e.useResetBlockStyles;exports.useRightPanel=e.useRightPanel;exports.useSavePage=e.useSavePage;exports.useScreenSizeWidth=e.useScreenSizeWidth;exports.useSelectedBlock=e.useSelectedBlock;exports.useSelectedBlockAllClasses=e.useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=e.useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=e.useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=e.useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=e.useSelectedBreakpoints;exports.useSelectedLibrary=e.useSelectedLibrary;exports.useSelectedStylingBlocks=e.useSelectedStylingBlocks;exports.useSidebarActivePanel=e.useSidebarActivePanel;exports.useStreamMultipleBlocksProps=e.useStreamMultipleBlocksProps;exports.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useTheme=e.useTheme;exports.useThemeOptions=e.useThemeOptions;exports.useToggleChaiFeatureFlag=e.useToggleChaiFeatureFlag;exports.useUndoManager=e.useUndoManager;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;exports.useWrapperBlock=e.useWrapperBlock;exports.generateBlockId=s.generateUUID;exports.mergeClasses=s.cn;exports.convertHTMLToChaiBlocks=a.getBlocksFromHTML;exports.getBlocksFromHTML=a.getBlocksFromHTML;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>i.useTranslation});exports.i18n=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-B506vH5V.cjs"),s=require("./common-functions-BZmyleS1.cjs"),a=require("./apply-binding-DCZAw7M-.cjs"),i=require("react-i18next"),l=require("i18next");exports.ChaiAddBlocksDialog=e.AddBlocksDialog;exports.ChaiAddBlocksPanel=e.AddBlocksPanel;exports.ChaiAskAiUserPrompt=e.AIUserPrompt;exports.ChaiBlockAttributesEditor=e.BlockAttributesEditor;exports.ChaiBlockPropsEditor=e.BlockSettings;exports.ChaiBlockStyleEditor=e.BlockStyling;exports.ChaiBuilderCanvas=e.CanvasArea;exports.ChaiBuilderEditor=e.ChaiBuilderEditor;exports.ChaiDarkModeSwitcher=e.DarkMode;exports.ChaiDefaultBlocks=e.DefaultChaiBlocks;exports.ChaiExportCodeModal=e.ExportCodeModal;exports.ChaiImportHTML=e.ImportHTML;exports.ChaiOutline=e.ListTree;exports.ChaiScreenSizes=e.Breakpoints;exports.ChaiThemeConfigPanel=e.ThemeConfigPanel;exports.ChaiUILibrariesPanel=e.UILibrariesPanel;exports.ChaiUndoRedo=e.UndoRedo;exports.IfChaiFeatureFlag=e.IfChaiFeatureFlag;exports.PERMISSIONS=e.PERMISSIONS;exports.getClassValueAndUnit=e.getClassValueAndUnit;exports.registerBlockSettingField=e.registerBlockSettingField;exports.registerBlockSettingTemplate=e.registerBlockSettingTemplate;exports.registerBlockSettingWidget=e.registerBlockSettingWidget;exports.registerChaiAddBlockTab=e.registerChaiAddBlockTab;exports.registerChaiFeatureFlag=e.registerChaiFeatureFlag;exports.registerChaiFeatureFlags=e.registerChaiFeatureFlags;exports.registerChaiLibrary=e.registerChaiLibrary;exports.registerChaiMediaManager=e.registerChaiMediaManager;exports.registerChaiPreImportHTMLHook=e.registerChaiPreImportHTMLHook;exports.registerChaiSaveToLibrary=e.registerChaiSaveToLibrary;exports.registerChaiSidebarPanel=e.registerChaiSidebarPanel;exports.registerChaiTopBar=e.registerChaiTopBar;exports.useAddBlock=e.useAddBlock;exports.useAddClassesToBlocks=e.useAddClassesToBlocks;exports.useAskAi=e.useAskAi;exports.useBlockHighlight=e.useBlockHighlight;exports.useBlocksHtmlForAi=e.useBlocksHtmlForAi;exports.useBlocksStore=e.useBlocksStore;exports.useBlocksStoreUndoableActions=e.useBlocksStoreUndoableActions;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderProp=e.useBuilderProp;exports.useBuilderReset=e.useBuilderReset;exports.useCanvasDisplayWidth=e.useCanvasDisplayWidth;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useChaiFeatureFlag=e.useChaiFeatureFlag;exports.useChaiFeatureFlags=e.useChaiFeatureFlags;exports.useCodeEditor=e.useCodeEditor;exports.useCopyBlockIds=e.useCopyBlocks;exports.useCopyToClipboard=e.useCopyToClipboard;exports.useCurrentPage=e.useCurrentPage;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useHighlightBlockId=e.useHighlightBlockId;exports.useHtmlToBlocks=e.useHtmlToBlocks;exports.useI18nBlocks=e.useI18nBlocks;exports.useInlineEditing=e.useInlineEditing;exports.useIsPageLoaded=e.useIsPageLoaded;exports.useLanguages=e.useLanguages;exports.useLibraryBlocks=e.useLibraryBlocks;exports.useMediaManagerComponent=e.useMediaManagerComponent;exports.usePartailBlocksStore=e.usePartialBlocksStore;exports.usePartialBlocksList=e.usePartialBlocksList;exports.usePasteBlocks=e.usePasteBlocks;exports.usePermissions=e.usePermissions;exports.usePreviewMode=e.usePreviewMode;exports.usePubSub=e.usePubSub;exports.useRemoveAllClassesForBlock=e.useRemoveAllClassesForBlock;exports.useRemoveBlocks=e.useRemoveBlocks;exports.useRemoveClassesFromBlocks=e.useRemoveClassesFromBlocks;exports.useReplaceBlock=e.useReplaceBlock;exports.useResetBlockStyles=e.useResetBlockStyles;exports.useRightPanel=e.useRightPanel;exports.useSavePage=e.useSavePage;exports.useScreenSizeWidth=e.useScreenSizeWidth;exports.useSelectedBlock=e.useSelectedBlock;exports.useSelectedBlockAllClasses=e.useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=e.useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=e.useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=e.useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=e.useSelectedBreakpoints;exports.useSelectedLibrary=e.useSelectedLibrary;exports.useSelectedStylingBlocks=e.useSelectedStylingBlocks;exports.useSidebarActivePanel=e.useSidebarActivePanel;exports.useStreamMultipleBlocksProps=e.useStreamMultipleBlocksProps;exports.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useTheme=e.useTheme;exports.useThemeOptions=e.useThemeOptions;exports.useToggleChaiFeatureFlag=e.useToggleChaiFeatureFlag;exports.useUndoManager=e.useUndoManager;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;exports.useWrapperBlock=e.useWrapperBlock;exports.generateBlockId=s.generateUUID;exports.mergeClasses=s.cn;exports.convertHTMLToChaiBlocks=a.getBlocksFromHTML;exports.getBlocksFromHTML=a.getBlocksFromHTML;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>i.useTranslation});exports.i18n=l;
package/dist/core.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as e, A as o, f as i, k as l, B as r, e as t, C as u, i as c, D as d, l as C, E as B, I as k, L as n, g, T as h, U as p, h as S, y as m, P, m as F, n as A, o as T, p as M, r as b, z as y, F as I, s as v, t as L, q as f, v as R, w as E, x as H, M as D, O as U, Q as x, R as W, S as O, V as w, aB as z, W as j, X as q, Y as G, aD as V, aC as Z, Z as J, G as K, H as N, u as Q, _ as X, $ as Y, a0 as _, a1 as $, a2 as aa, a3 as sa, a4 as ea, a5 as oa, a6 as ia, a7 as la, a8 as ra, a9 as ta, aa as ua, K as ca, ab as da, ac as Ca, ad as Ba, ae as ka, af as na, ag as ga, ah as ha, ai as pa, aj as Sa, ak as ma, al as Pa, am as Fa, an as Aa, aE as Ta, ao as Ma, ap as ba, aq as ya, a as Ia, ar as va, as as La, aF as fa, at as Ra, aG as Ea, au as Ha, av as Da, aw as Ua, ax as xa, ay as Wa, J as Oa, az as wa, b as za, c as ja, aA as qa } from "./index-BXLWWUUp.js";
1
+ import { j as e, A as o, f as i, k as l, B as r, e as t, C as u, i as c, D as d, l as C, E as B, I as k, L as n, g, T as h, U as p, h as S, y as m, P, m as F, n as A, o as T, p as M, r as b, z as y, F as I, s as v, t as L, q as f, v as R, w as E, x as H, M as D, O as U, Q as x, R as W, S as O, V as w, aB as z, W as j, X as q, Y as G, aD as V, aC as Z, Z as J, G as K, H as N, u as Q, _ as X, $ as Y, a0 as _, a1 as $, a2 as aa, a3 as sa, a4 as ea, a5 as oa, a6 as ia, a7 as la, a8 as ra, a9 as ta, aa as ua, K as ca, ab as da, ac as Ca, ad as Ba, ae as ka, af as na, ag as ga, ah as ha, ai as pa, aj as Sa, ak as ma, al as Pa, am as Fa, an as Aa, aE as Ta, ao as Ma, ap as ba, aq as ya, a as Ia, ar as va, as as La, aF as fa, at as Ra, aG as Ea, au as Ha, av as Da, aw as Ua, ax as xa, ay as Wa, J as Oa, az as wa, b as za, c as ja, aA as qa } from "./index-B4arQ22-.js";
2
2
  import { g as Va, c as Za } from "./common-functions-BGzDsf1z.js";
3
3
  import { h as Ka, h as Na } from "./apply-binding-DXR0sMuX.js";
4
4
  import { useTranslation as Xa } from "react-i18next";
@@ -2708,7 +2708,7 @@ const getBlockWithChildren = (o, n) => {
2708
2708
  return null;
2709
2709
  });
2710
2710
  wrapperBlockAtom.debugLabel = "wrapperBlockAtom";
2711
- const useWrapperBlock = () => useAtomValue$1(wrapperBlockAtom), useCanvasIframe = () => useAtom$1(canvasIframeAtom), ATTRIBUTES_TO_REMOVE = ["data-block-index", "data-drop", "data-style-id", "data-block-parent", "data-style-prop"], CORE_BLOCKS$1 = [
2711
+ const useWrapperBlock = () => useAtomValue$1(wrapperBlockAtom), useCanvasIframe = () => useAtom$1(canvasIframeAtom), ATTRIBUTES_TO_REMOVE = ["data-block-index", "data-drop", "data-style-id", "data-block-parent", "data-style-prop", "data-highlighted"], CORE_BLOCKS$1 = [
2712
2712
  "Box",
2713
2713
  "Button",
2714
2714
  "Checkbox",
@@ -4561,7 +4561,7 @@ const RichTextEditor = memo(
4561
4561
  /* @__PURE__ */ jsx("p", { className: "font-semibold", children: o("Oops! Something went wrong.") }),
4562
4562
  /* @__PURE__ */ jsx("p", { children: o("Please try again.") })
4563
4563
  ] }) });
4564
- }, CodeEditor$1 = React__default.lazy(() => import("./code-editor-CfrDD-_Q.js")), CanvasArea = () => {
4564
+ }, CodeEditor$1 = React__default.lazy(() => import("./code-editor-3fQ6LcgC.js")), CanvasArea = () => {
4565
4565
  const [o] = useCodeEditor(), n = useBuilderProp("onError", noop);
4566
4566
  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: [
4567
4567
  /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsx(FallbackError, {}), onError: n, children: /* @__PURE__ */ jsx(StaticCanvas, {}) }) }),
@@ -5131,7 +5131,7 @@ const DataBindingSelector = ({
5131
5131
  ]
5132
5132
  }
5133
5133
  ) });
5134
- }, RTEModal = React__default.lazy(() => import("./rte-widget-modal-DG4qh6_A.js")), RichTextEditorFieldComp = ({ blockId: o, id: n, placeholder: r, value: a, onChange: l, onBlur: i }) => {
5134
+ }, RTEModal = React__default.lazy(() => import("./rte-widget-modal-CkdQf3xI.js")), RichTextEditorFieldComp = ({ blockId: o, id: n, placeholder: r, value: a, onChange: l, onBlur: i }) => {
5135
5135
  const c = useRef(null), [d, p] = useState(!1), u = useRTEditor({
5136
5136
  blockId: o,
5137
5137
  value: a,
@@ -10590,8 +10590,122 @@ function useAtom(o, n) {
10590
10590
  useSetAtom(o)
10591
10591
  ];
10592
10592
  }
10593
+ function convertAttributeName(o) {
10594
+ const n = {
10595
+ class: "className",
10596
+ for: "htmlFor",
10597
+ tabindex: "tabIndex",
10598
+ readonly: "readOnly",
10599
+ maxlength: "maxLength",
10600
+ minlength: "minLength",
10601
+ autocomplete: "autoComplete",
10602
+ autofocus: "autoFocus",
10603
+ autoplay: "autoPlay",
10604
+ formaction: "formAction",
10605
+ formenctype: "formEncType",
10606
+ formmethod: "formMethod",
10607
+ formnovalidate: "formNoValidate",
10608
+ formtarget: "formTarget",
10609
+ novalidate: "noValidate",
10610
+ crossorigin: "crossOrigin",
10611
+ datetime: "dateTime",
10612
+ rowspan: "rowSpan",
10613
+ colspan: "colSpan",
10614
+ usemap: "useMap",
10615
+ frameborder: "frameBorder",
10616
+ allowfullscreen: "allowFullScreen"
10617
+ };
10618
+ if (n[o.toLowerCase()])
10619
+ return n[o.toLowerCase()];
10620
+ const r = {
10621
+ "accent-height": "accentHeight",
10622
+ "alignment-baseline": "alignmentBaseline",
10623
+ "arabic-form": "arabicForm",
10624
+ "baseline-shift": "baselineShift",
10625
+ "cap-height": "capHeight",
10626
+ "clip-path": "clipPath",
10627
+ "clip-rule": "clipRule",
10628
+ "color-interpolation": "colorInterpolation",
10629
+ "color-interpolation-filters": "colorInterpolationFilters",
10630
+ "color-profile": "colorProfile",
10631
+ "color-rendering": "colorRendering",
10632
+ "dominant-baseline": "dominantBaseline",
10633
+ "enable-background": "enableBackground",
10634
+ "fill-opacity": "fillOpacity",
10635
+ "fill-rule": "fillRule",
10636
+ "flood-color": "floodColor",
10637
+ "flood-opacity": "floodOpacity",
10638
+ "font-family": "fontFamily",
10639
+ "font-size": "fontSize",
10640
+ "font-size-adjust": "fontSizeAdjust",
10641
+ "font-stretch": "fontStretch",
10642
+ "font-style": "fontStyle",
10643
+ "font-variant": "fontVariant",
10644
+ "font-weight": "fontWeight",
10645
+ "glyph-name": "glyphName",
10646
+ "glyph-orientation-horizontal": "glyphOrientationHorizontal",
10647
+ "glyph-orientation-vertical": "glyphOrientationVertical",
10648
+ "horiz-adv-x": "horizAdvX",
10649
+ "horiz-origin-x": "horizOriginX",
10650
+ "image-rendering": "imageRendering",
10651
+ "letter-spacing": "letterSpacing",
10652
+ "lighting-color": "lightingColor",
10653
+ "marker-end": "markerEnd",
10654
+ "marker-mid": "markerMid",
10655
+ "marker-start": "markerStart",
10656
+ "overline-position": "overlinePosition",
10657
+ "overline-thickness": "overlineThickness",
10658
+ "paint-order": "paintOrder",
10659
+ "panose-1": "panose1",
10660
+ "pointer-events": "pointerEvents",
10661
+ "rendering-intent": "renderingIntent",
10662
+ "shape-rendering": "shapeRendering",
10663
+ "stop-color": "stopColor",
10664
+ "stop-opacity": "stopOpacity",
10665
+ "strikethrough-position": "strikethroughPosition",
10666
+ "strikethrough-thickness": "strikethroughThickness",
10667
+ "stroke-dasharray": "strokeDasharray",
10668
+ "stroke-dashoffset": "strokeDashoffset",
10669
+ "stroke-linecap": "strokeLinecap",
10670
+ "stroke-linejoin": "strokeLinejoin",
10671
+ "stroke-miterlimit": "strokeMiterlimit",
10672
+ "stroke-opacity": "strokeOpacity",
10673
+ "stroke-width": "strokeWidth",
10674
+ "text-anchor": "textAnchor",
10675
+ "text-decoration": "textDecoration",
10676
+ "text-rendering": "textRendering",
10677
+ "underline-position": "underlinePosition",
10678
+ "underline-thickness": "underlineThickness",
10679
+ "unicode-bidi": "unicodeBidi",
10680
+ "unicode-range": "unicodeRange",
10681
+ "units-per-em": "unitsPerEm",
10682
+ "v-alphabetic": "vAlphabetic",
10683
+ "v-hanging": "vHanging",
10684
+ "v-ideographic": "vIdeographic",
10685
+ "v-mathematical": "vMathematical",
10686
+ "vector-effect": "vectorEffect",
10687
+ "vert-adv-y": "vertAdvY",
10688
+ "vert-origin-x": "vertOriginX",
10689
+ "vert-origin-y": "vertOriginY",
10690
+ "word-spacing": "wordSpacing",
10691
+ "writing-mode": "writingMode",
10692
+ "x-height": "xHeight"
10693
+ };
10694
+ return r[o] ? r[o] : o;
10695
+ }
10593
10696
  function domToJsx(o, n = 0) {
10594
10697
  var u;
10698
+ if (Array.isArray(o)) {
10699
+ if (o.length === 0) return "";
10700
+ if (o.length === 1) return domToJsx(o[0], n);
10701
+ const g = " ".repeat(n);
10702
+ let m = `${g}<>
10703
+ `;
10704
+ for (const h of o)
10705
+ m += domToJsx(h, n + 1);
10706
+ return m += `${g}</>
10707
+ `, m;
10708
+ }
10595
10709
  const r = " ".repeat(n);
10596
10710
  if (o.nodeType === Node.TEXT_NODE) {
10597
10711
  const g = (u = o.textContent) == null ? void 0 : u.trim();
@@ -10618,11 +10732,7 @@ function domToJsx(o, n = 0) {
10618
10732
  ].includes(a)) {
10619
10733
  const g = [];
10620
10734
  for (const h of o.attributes)
10621
- if (h.name === "class")
10622
- g.push(`className="${h.value}"`);
10623
- else if (h.name === "for")
10624
- g.push(`htmlFor="${h.value}"`);
10625
- else if (h.name.startsWith("on") && h.name !== "on") {
10735
+ if (h.name.startsWith("on") && h.name !== "on") {
10626
10736
  const f = h.name.toLowerCase().replace(/on(\w)/, (x, b) => "on" + b.toUpperCase());
10627
10737
  g.push(`${f}={${h.value}}`);
10628
10738
  } else if (h.name === "style" && h.value) {
@@ -10638,8 +10748,10 @@ function domToJsx(o, n = 0) {
10638
10748
  {}
10639
10749
  );
10640
10750
  g.push(`style={${JSON.stringify(f)}}`);
10641
- } else
10642
- g.push(`${h.name}="${h.value}"`);
10751
+ } else {
10752
+ const f = convertAttributeName(h.name);
10753
+ g.push(`${f}="${h.value}"`);
10754
+ }
10643
10755
  const m = g.length > 0 ? ` ${g.join(" ")}` : "";
10644
10756
  return `${r}<${a}${m} />
10645
10757
  `;
@@ -10647,11 +10759,7 @@ function domToJsx(o, n = 0) {
10647
10759
  let i = `${r}<${a}`;
10648
10760
  const c = [];
10649
10761
  for (const g of o.attributes)
10650
- if (g.name === "class")
10651
- c.push(`className="${g.value}"`);
10652
- else if (g.name === "for")
10653
- c.push(`htmlFor="${g.value}"`);
10654
- else if (g.name.startsWith("on") && g.name !== "on") {
10762
+ if (g.name.startsWith("on") && g.name !== "on") {
10655
10763
  const m = g.name.toLowerCase().replace(/on(\w)/, (h, f) => "on" + f.toUpperCase());
10656
10764
  c.push(`${m}={${g.value}}`);
10657
10765
  } else if (g.name === "style" && g.value) {
@@ -10667,8 +10775,10 @@ function domToJsx(o, n = 0) {
10667
10775
  {}
10668
10776
  );
10669
10777
  c.push(`style={${JSON.stringify(m)}}`);
10670
- } else
10671
- c.push(`${g.name}="${g.value}"`);
10778
+ } else {
10779
+ const m = convertAttributeName(g.name);
10780
+ c.push(`${m}="${g.value}"`);
10781
+ }
10672
10782
  c.length > 0 && (i += " " + c.join(" "));
10673
10783
  const d = Array.from(o.childNodes);
10674
10784
  if (!d.some((g) => {
@@ -10704,7 +10814,9 @@ const CodeDisplay = lazy(() => import("./code-display-BJJV-nKI.js"));
10704
10814
  async function convertHtmlToJsx(o) {
10705
10815
  try {
10706
10816
  const n = document.createElement("div");
10707
- return n.innerHTML = o, { jsx: domToJsx(n == null ? void 0 : n.children[0]), html: n == null ? void 0 : n.children[0].outerHTML };
10817
+ n.innerHTML = o;
10818
+ const r = Array.from(n.children);
10819
+ return { jsx: domToJsx(r.length === 1 ? r[0] : r), html: n.innerHTML };
10708
10820
  } catch {
10709
10821
  return { html: o, jsx: o };
10710
10822
  }
@@ -10752,8 +10864,9 @@ ${l})
10752
10864
  }
10753
10865
  }, h = useCallback(async () => {
10754
10866
  try {
10755
- u(!1), await new Promise((k) => setTimeout(k, 1e3));
10756
- const C = i({ EXTRA_CORE_BLOCKS: ["Icon"] }), v = o === "ts", {
10867
+ u(!1);
10868
+ let C = i({ EXTRA_CORE_BLOCKS: ["Icon"] });
10869
+ const v = o === "ts", {
10757
10870
  jsx: _,
10758
10871
  html: B,
10759
10872
  componentName: I