@chaibuilder/sdk 3.0.6 → 3.0.7

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/dist/core.d.ts CHANGED
@@ -504,6 +504,8 @@ export declare const registerChaiLibrary: <T extends Record<string, any> = Recor
504
504
 
505
505
  export declare const registerChaiMediaManager: (component: React.ComponentType<MediaManagerProps>) => void;
506
506
 
507
+ export declare const registerChaiPreImportHTMLHook: (fn: (code: string) => string) => void;
508
+
507
509
  export declare const registerChaiSaveToLibrary: (component: ComponentType<SaveToLibraryProps>) => void;
508
510
 
509
511
  export declare const registerChaiSidebarPanel: (panelId: string, panelOptions: Omit<ChaiSidebarPanel, "id">) => void;
package/dist/core.js CHANGED
@@ -6832,10 +6832,14 @@ const CoreBlock = ({
6832
6832
  blocks: l.core
6833
6833
  }
6834
6834
  );
6835
- }, ImportHTML = ({ parentId: o, position: n }) => {
6835
+ };
6836
+ let PRE_IMPORT_HTML_HOOK = (o) => o;
6837
+ const registerChaiPreImportHTMLHook = (o) => {
6838
+ PRE_IMPORT_HTML_HOOK = o;
6839
+ }, getPreImportHTML = (o) => PRE_IMPORT_HTML_HOOK(o), ImportHTML = ({ parentId: o, position: n }) => {
6836
6840
  const { t: r } = useTranslation(), [a, l] = useState(""), { addPredefinedBlock: i } = useAddBlock(), c = () => {
6837
- const d = getBlocksFromHTML(a);
6838
- i([...d], o, n), l(""), pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK);
6841
+ const d = getPreImportHTML(a), p = getBlocksFromHTML(d);
6842
+ i([...p], o, n), l(""), pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK);
6839
6843
  };
6840
6844
  return /* @__PURE__ */ jsxs(Card, { className: "border-border/0 p-0 shadow-none", children: [
6841
6845
  /* @__PURE__ */ jsx(CardHeader, { className: "p-3", children: /* @__PURE__ */ jsx(CardDescription, { children: r("Use HTML snippets from Tailwind CSS component libraries") }) }),
@@ -10383,6 +10387,7 @@ export {
10383
10387
  registerChaiFeatureFlags,
10384
10388
  registerChaiLibrary,
10385
10389
  registerChaiMediaManager,
10390
+ registerChaiPreImportHTMLHook,
10386
10391
  registerChaiSaveToLibrary,
10387
10392
  registerChaiSidebarPanel,
10388
10393
  registerChaiTopBar,
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.0.6",
8
+ "version": "3.0.7",
9
9
  "type": "module",
10
10
  "repository": {
11
11
  "type": "git",