@edifice.io/react 2.1.1-develop-integration.20250218112719 → 2.1.1-develop-integration.20250218194811

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.
@@ -0,0 +1,2 @@
1
+ declare const CantooAdaptTextBoxView: () => import("react/jsx-runtime").JSX.Element;
2
+ export default CantooAdaptTextBoxView;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useEditorContext } from "../../hooks/useEditorContext.js";
3
- const CantooModal = () => {
3
+ const CantooAdaptTextBoxView = () => {
4
4
  const {
5
5
  editor
6
6
  } = useEditorContext(), Cantoo = window.Cantoo, editorHTML = editor == null ? void 0 : editor.getHTML(), cantooHTML = (Cantoo == null ? void 0 : Cantoo.formatText(editorHTML)) || editorHTML;
@@ -9,5 +9,5 @@ const CantooModal = () => {
9
9
  } }) });
10
10
  };
11
11
  export {
12
- CantooModal as default
12
+ CantooAdaptTextBoxView as default
13
13
  };
@@ -18,7 +18,7 @@ import TableToolbar from "../Toolbar/TableToolbar.js";
18
18
  import BubbleMenuEditImage from "../BubbleMenuEditImage/BubbleMenuEditImage.js";
19
19
  import MediaLibrary from "../../../multimedia/MediaLibrary/MediaLibrary.js";
20
20
  import LoadingScreen from "../../../../components/LoadingScreen/LoadingScreen.js";
21
- const MathsModal = /* @__PURE__ */ lazy(async () => await import("../MathsModal/MathsModal.js")), ImageEditor = /* @__PURE__ */ lazy(async () => await import("../../../multimedia/ImageEditor/components/ImageEditor.js")), CantooModal = /* @__PURE__ */ lazy(async () => await import("./CantooModal.js")), Editor = /* @__PURE__ */ forwardRef(({
21
+ const MathsModal = /* @__PURE__ */ lazy(async () => await import("../MathsModal/MathsModal.js")), ImageEditor = /* @__PURE__ */ lazy(async () => await import("../../../multimedia/ImageEditor/components/ImageEditor.js")), CantooAdaptTextBoxView = /* @__PURE__ */ lazy(async () => await import("./CantooAdaptTextBoxView.js")), Editor = /* @__PURE__ */ forwardRef(({
22
22
  id,
23
23
  content,
24
24
  mode = "read",
@@ -75,7 +75,7 @@ const MathsModal = /* @__PURE__ */ lazy(async () => await import("../MathsModal/
75
75
  editable && /* @__PURE__ */ jsx(MediaLibrary, { appCode, visibility, multiple: !0, ref: mediaLibraryModalRef, ...mediaLibraryModalHandlers }),
76
76
  editable && mathsModalHandlers.isOpen && /* @__PURE__ */ jsx(MathsModal, { ...mathsModalHandlers }),
77
77
  editable && (imageModal == null ? void 0 : imageModal.isOpen) && (imageModal == null ? void 0 : imageModal.currentImage) && /* @__PURE__ */ jsx(ImageEditor, { altText: imageModal == null ? void 0 : imageModal.currentImage.alt, legend: imageModal == null ? void 0 : imageModal.currentImage.title, image: imageModal == null ? void 0 : imageModal.currentImage.src, isOpen: imageModal.isOpen, onCancel: imageModal.handleCancel, onSave: imageModal.handleSave, onError: console.error }),
78
- editable && cantooAdaptTextBox.isOpen && /* @__PURE__ */ jsx(CantooModal, {})
78
+ editable && cantooAdaptTextBox.isOpen && /* @__PURE__ */ jsx(CantooAdaptTextBoxView, {})
79
79
  ] })
80
80
  ] });
81
81
  });
@@ -2,8 +2,8 @@ import { RefAttributes } from 'react';
2
2
  import { IconButtonProps } from '../../../../components';
3
3
  interface Props {
4
4
  triggerProps: JSX.IntrinsicAttributes & Omit<IconButtonProps, 'ref'> & RefAttributes<HTMLButtonElement>;
5
- openCantooAdaptTextBox: () => void | undefined;
6
- isCantooAdaptTextBoxOpen: boolean | null;
5
+ openCantooAdaptTextBox: () => void;
6
+ isCantooAdaptTextBoxOpen: boolean;
7
7
  }
8
8
  export declare const EditorToolbarCantoo: ({ triggerProps, openCantooAdaptTextBox, isCantooAdaptTextBoxOpen, }: Props) => import("react/jsx-runtime").JSX.Element;
9
9
  export {};
@@ -25,8 +25,7 @@ const EditorToolbarCantoo = ({
25
25
  speech2textIsActive,
26
26
  text2speechIsActive,
27
27
  toggleSpeech2Text,
28
- toggleText2Speech,
29
- formatText
28
+ toggleText2Speech
30
29
  } = useCantooEditor(editor), cantooOptions = [{
31
30
  id: "speech2text",
32
31
  label: t("tiptap.toolbar.cantoo.speech2text"),
@@ -44,7 +43,7 @@ const EditorToolbarCantoo = ({
44
43
  label: t("tiptap.toolbar.cantoo.formatText"),
45
44
  className: isCantooAdaptTextBoxOpen ? "fw-bold" : "",
46
45
  icon: /* @__PURE__ */ jsx(SvgIconWand, {}),
47
- action: () => formatText(openCantooAdaptTextBox)
46
+ action: () => openCantooAdaptTextBox()
48
47
  }];
49
48
  return /* @__PURE__ */ jsxs(Fragment, { children: [
50
49
  /* @__PURE__ */ jsx(Tooltip, { message: t("tiptap.toolbar.cantoo.choice"), placement: "top", children: /* @__PURE__ */ jsx(IconButton, { ...triggerProps, type: "button", variant: "ghost", color: "tertiary", icon: /* @__PURE__ */ jsx(SvgIconCantoo, {}), className: speech2textIsActive || text2speechIsActive || isCantooAdaptTextBoxOpen ? "is-selected" : "", "aria-label": t("tiptap.toolbar.cantoo.choice") }) }),
@@ -1,14 +1,14 @@
1
1
  /**
2
- * Custom hook to manage CantooModal events in an editor.
2
+ * Custom hook to manage CantooAdaptTextBoxView events in an editor.
3
3
  * @returns {
4
- * `isOpen`: truthy boolean when CantooModal sholud be visible,
4
+ * `isOpen`: truthy boolean when CantooAdaptTextBoxView sholud be visible,
5
5
  * `toggle`: an imperative function to toggle the `isOpen` value,
6
6
  * `onCancel`: Cancel event handler,
7
7
  * }
8
8
  */
9
9
  export declare const useCantooAdaptTextBox: () => CantooAdaptTextBox;
10
10
  export interface CantooAdaptTextBox {
11
- isOpen: boolean | null;
11
+ isOpen: boolean;
12
12
  toggle: () => void;
13
13
  onCancel: () => void;
14
14
  }
@@ -5,5 +5,4 @@ export declare const useCantooEditor: (editor: Editor | null) => {
5
5
  text2speechIsActive: boolean;
6
6
  toggleSpeech2Text: () => Promise<void>;
7
7
  toggleText2Speech: () => void;
8
- formatText: (openModal: () => void) => void;
9
8
  };
@@ -40,9 +40,6 @@ const useCantooEditor = (editor) => {
40
40
  } catch (e) {
41
41
  console.warn("Error while trying to use Cantoo (text2speech)", e), setText2speechActive(!1);
42
42
  }
43
- },
44
- formatText: (openModal) => {
45
- openModal();
46
43
  }
47
44
  };
48
45
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.1.1-develop-integration.20250218112719",
3
+ "version": "2.1.1-develop-integration.20250218194811",
4
4
  "description": "Edifice React Library",
5
5
  "keywords": [
6
6
  "react",
@@ -118,9 +118,9 @@
118
118
  "react-slugify": "^3.0.3",
119
119
  "swiper": "^10.1.0",
120
120
  "ua-parser-js": "^1.0.36",
121
- "@edifice.io/bootstrap": "2.1.1-develop-integration.20250218112719",
122
- "@edifice.io/tiptap-extensions": "2.1.1-develop-integration.20250218112719",
123
- "@edifice.io/utilities": "2.1.1-develop-integration.20250218112719"
121
+ "@edifice.io/bootstrap": "2.1.1-develop-integration.20250218194811",
122
+ "@edifice.io/tiptap-extensions": "2.1.1-develop-integration.20250218194811",
123
+ "@edifice.io/utilities": "2.1.1-develop-integration.20250218194811"
124
124
  },
125
125
  "devDependencies": {
126
126
  "@babel/plugin-transform-react-pure-annotations": "^7.23.3",
@@ -151,8 +151,8 @@
151
151
  "vite": "^5.4.11",
152
152
  "vite-plugin-dts": "^4.1.0",
153
153
  "vite-tsconfig-paths": "^5.0.1",
154
- "@edifice.io/client": "2.1.1-develop-integration.20250218112719",
155
- "@edifice.io/config": "2.1.1-develop-integration.20250218112719"
154
+ "@edifice.io/client": "2.1.1-develop-integration.20250218194811",
155
+ "@edifice.io/config": "2.1.1-develop-integration.20250218194811"
156
156
  },
157
157
  "peerDependencies": {
158
158
  "@react-spring/web": "^9.7.5",
@@ -1,2 +0,0 @@
1
- declare const CantooModal: () => import("react/jsx-runtime").JSX.Element;
2
- export default CantooModal;