@edifice.io/react 2.2.5-develop-integration.20250513201630 → 2.2.5-develop-integration.20250515200442

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.
@@ -2,9 +2,11 @@ import { ReactNode } from 'react';
2
2
  export type TableRef = HTMLTableElement;
3
3
  export interface TableProps {
4
4
  children?: Array<React.ReactElement<HTMLTableSectionElement>> | any;
5
+ maxHeight?: string;
5
6
  }
6
7
  declare const Table: import('react').ForwardRefExoticComponent<{
7
8
  children: ReactNode;
9
+ maxHeight?: string;
8
10
  } & import('react').RefAttributes<HTMLTableElement>> & {
9
11
  Thead: {
10
12
  (props: React.HTMLAttributes<HTMLTableSectionElement>): import("react/jsx-runtime").JSX.Element;
@@ -6,8 +6,14 @@ import { TableTh } from "./TableTh.js";
6
6
  import { TableThead } from "./TableThead.js";
7
7
  import { TableTr } from "./TableTr.js";
8
8
  const Root = /* @__PURE__ */ forwardRef(({
9
- children
10
- }, ref) => /* @__PURE__ */ jsx("div", { className: "table-responsive", children: /* @__PURE__ */ jsx("table", { ref, className: "table align-middle mb-0", children }) })), Table = /* @__PURE__ */ Object.assign(Root, {
9
+ children,
10
+ maxHeight
11
+ }, ref) => /* @__PURE__ */ jsx("div", { className: "table-responsive", style: maxHeight ? {
12
+ maxHeight,
13
+ overflowY: "auto"
14
+ } : {}, children: /* @__PURE__ */ jsx("table", { ref, className: "table align-middle mb-0", style: {
15
+ overflow: maxHeight ? "visible" : "hidden"
16
+ }, children }) })), Table = /* @__PURE__ */ Object.assign(Root, {
11
17
  Thead: TableThead,
12
18
  Th: TableTh,
13
19
  Tbody: TableTbody,
@@ -40,6 +40,7 @@ export interface EditorProps {
40
40
  onContentChange?: ({ editor }: {
41
41
  editor: any;
42
42
  }) => void;
43
+ cantooParam?: 'simplify' | 'none';
43
44
  }
44
45
  declare const Editor: import('react').ForwardRefExoticComponent<EditorProps & import('react').RefAttributes<EditorRef>>;
45
46
  export default Editor;
@@ -31,7 +31,8 @@ const MathsModal = /* @__PURE__ */ lazy(async () => await import("../MathsModal/
31
31
  focus = "start",
32
32
  placeholder = "",
33
33
  visibility = "protected",
34
- onContentChange
34
+ onContentChange,
35
+ cantooParam = "none"
35
36
  }, ref) => {
36
37
  const editorId = useId(), {
37
38
  appCode
@@ -61,7 +62,7 @@ const MathsModal = /* @__PURE__ */ lazy(async () => await import("../MathsModal/
61
62
  toogleSpeechSynthetisis: speechSynthetisis.toggle,
62
63
  isSpeeching: () => speechSynthetisis.isActivated
63
64
  }));
64
- const contooEditor = useCantooEditor(editor);
65
+ const contooEditor = useCantooEditor(editor, cantooParam);
65
66
  if (!editor) return null;
66
67
  const borderClass = clsx(variant === "outline" && "border rounded-3"), contentClass = clsx(variant === "outline" && "py-12 px-16");
67
68
  return /* @__PURE__ */ jsxs(EditorContext.Provider, { value: {
@@ -13,7 +13,6 @@ import SvgIconWand from "../../../icons/components/IconWand.js";
13
13
  import Tooltip from "../../../../components/Tooltip/Tooltip.js";
14
14
  import IconButton from "../../../../components/Button/IconButton.js";
15
15
  import Dropdown from "../../../../components/Dropdown/Dropdown.js";
16
- import { useEdificeClient } from "../../../../providers/EdificeClientProvider/EdificeClientProvider.hook.js";
17
16
  const EditorToolbarCantoo = ({
18
17
  triggerProps,
19
18
  cantooEditor
@@ -21,14 +20,13 @@ const EditorToolbarCantoo = ({
21
20
  const {
22
21
  t
23
22
  } = useTranslation(), {
24
- appCode
25
- } = useEdificeClient(), {
26
23
  speech2textIsAvailable,
27
24
  speech2textIsActive,
28
25
  text2speechIsActive,
29
26
  toggleSpeech2Text,
30
27
  toggleText2Speech,
31
- toogleSettings
28
+ toogleSettings,
29
+ cantooParam
32
30
  } = cantooEditor, cantooOptionsAdaptText = [{
33
31
  id: "right",
34
32
  label: t("tiptap.toolbar.cantoo.formatText.show.on.right"),
@@ -41,7 +39,7 @@ const EditorToolbarCantoo = ({
41
39
  icon: /* @__PURE__ */ jsx(SvgIconDeleteRowHighlight, {}),
42
40
  className: cantooEditor.openPositionAdaptText.bottom ? "fw-bold" : "",
43
41
  action: () => cantooEditor.handleCantooAdaptTextPosition("bottom")
44
- }], cantooOptions = [...appCode === "collaborativewall" ? [{
42
+ }], cantooOptions = [...cantooParam === "simplify" ? [{
45
43
  id: "formatText",
46
44
  label: t("tiptap.toolbar.cantoo.formatText"),
47
45
  className: cantooEditor.openPositionAdaptText.bottom ? "fw-bold" : "",
@@ -59,16 +57,16 @@ const EditorToolbarCantoo = ({
59
57
  className: text2speechIsActive ? "fw-bold" : "",
60
58
  icon: text2speechIsActive ? /* @__PURE__ */ jsx(SvgIconTextToSpeechOff, {}) : /* @__PURE__ */ jsx(SvgIconTextToSpeech, {}),
61
59
  action: () => toggleText2Speech()
62
- }, ...appCode === "collaborativewall" ? [] : [{
60
+ }, ...cantooParam === "simplify" ? [] : [{
63
61
  id: "settings",
64
62
  label: t("tiptap.toolbar.cantoo.settings"),
65
63
  icon: /* @__PURE__ */ jsx(SvgIconSettings, {}),
66
64
  action: () => toogleSettings()
67
65
  }]];
68
66
  return /* @__PURE__ */ jsxs(Fragment, { children: [
69
- /* @__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 || cantooEditor.openPositionAdaptText.right || cantooEditor.openPositionAdaptText.bottom ? "is-selected" : "", "aria-label": t("tiptap.toolbar.cantoo.choice") }) }),
67
+ /* @__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 || cantooEditor.openPositionAdaptText.right || cantooEditor.openPositionAdaptText.bottom ? "is-selected" : "", "aria-label": t("tiptap.toolbar.cantoo.choice"), isLoading: !window.Cantoo }) }),
70
68
  /* @__PURE__ */ jsxs(Dropdown.Menu, { children: [
71
- appCode != "collaborativewall" && /* @__PURE__ */ jsxs(Fragment, { children: [
69
+ cantooParam != "simplify" && /* @__PURE__ */ jsxs(Fragment, { children: [
72
70
  /* @__PURE__ */ jsx(Dropdown.MenuGroup, { label: t("tiptap.toolbar.cantoo.formatText"), children: cantooOptionsAdaptText.map((option) => /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(Dropdown.Item, { onClick: option.action, icon: option.icon, className: option.className, children: /* @__PURE__ */ jsx("span", { children: option.label }) }) }, option.id)) }),
73
71
  /* @__PURE__ */ jsx(Dropdown.Separator, {})
74
72
  ] }),
@@ -1,5 +1,6 @@
1
1
  import { Editor } from '@tiptap/react';
2
2
  export interface CantooEditor {
3
+ cantooParam: string;
3
4
  isAvailable: boolean;
4
5
  speech2textIsAvailable: boolean;
5
6
  speech2textIsActive: boolean;
@@ -13,4 +14,4 @@ export interface CantooEditor {
13
14
  };
14
15
  handleCantooAdaptTextPosition: (position: string) => void;
15
16
  }
16
- export declare const useCantooEditor: (editor: Editor | null) => CantooEditor;
17
+ export declare const useCantooEditor: (editor: Editor | null, cantooParam: string) => CantooEditor;
@@ -1,8 +1,8 @@
1
1
  import { useState, useCallback } from "react";
2
2
  import { odeServices } from "@edifice.io/client";
3
3
  import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
4
- const useCantooEditor = (editor) => {
5
- const Cantoo = window.Cantoo, isAvailable = useHasWorkflow("org.entcore.portal.controllers.PortalController|optionalFeatureCantoo") && Cantoo, [speech2textIsActive, setSpeech2textActive] = useState(!1), [text2speechIsActive, setText2speechActive] = useState(!1), [openPositionAdaptText, setOpenPositionAdaptText] = useState({
4
+ const useCantooEditor = (editor, cantooParam) => {
5
+ const Cantoo = window.Cantoo, isAvailable = useHasWorkflow("org.entcore.portal.controllers.PortalController|optionalFeatureCantoo"), [speech2textIsActive, setSpeech2textActive] = useState(!1), [text2speechIsActive, setText2speechActive] = useState(!1), [openPositionAdaptText, setOpenPositionAdaptText] = useState({
6
6
  right: !1,
7
7
  bottom: !1
8
8
  }), speech2textIsAvailable = (Cantoo == null ? void 0 : Cantoo.speech2text.isAvailableOnDevice()) || !1, toggleSpeech2Text = async () => {
@@ -72,6 +72,7 @@ const useCantooEditor = (editor) => {
72
72
  }
73
73
  }, []);
74
74
  return {
75
+ cantooParam,
75
76
  isAvailable,
76
77
  speech2textIsAvailable,
77
78
  speech2textIsActive,
@@ -80,15 +80,16 @@ const InternalLinker = ({
80
80
  setOptions(applicationList.sort((app1, app2) => app1.displayName.localeCompare(app2.displayName)));
81
81
  return;
82
82
  }
83
- const appPromises = resourceApplications.map((application) => odeServices.session().getWebApp(application)), webApps = await Promise.all(appPromises);
84
- setOptions(resourceApplications.map((application, index) => {
83
+ const appPromises = resourceApplications.map((application) => odeServices.session().getWebApp(application)), webApps = await Promise.all(appPromises), opts = resourceApplications.map((application, index) => {
85
84
  var _a;
86
- return {
85
+ let displayName = ((_a = webApps[index]) == null ? void 0 : _a.displayName) ?? application;
86
+ return application === "exercizer" ? displayName = "bbm.linker.int.app.exercizer" : application === "formulaire" && (displayName = "bbm.linker.int.app.forms"), {
87
87
  application,
88
- displayName: t(((_a = webApps[index]) == null ? void 0 : _a.displayName) ?? application),
88
+ displayName: t(displayName ?? application),
89
89
  icon: /* @__PURE__ */ jsx(AppIcon, { app: webApps[index], size: "24" })
90
90
  };
91
- }).sort((app1, app2) => app1.displayName.localeCompare(app2.displayName)));
91
+ }).sort((a, b) => a.displayName.localeCompare(b.displayName));
92
+ setOptions(opts);
92
93
  })();
93
94
  }, [resourceApplications, t, applicationList]), useEffect(() => {
94
95
  loadAndDisplayResources(debounceSearch);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.2.5-develop-integration.20250513201630",
3
+ "version": "2.2.5-develop-integration.20250515200442",
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.2.5-develop-integration.20250513201630",
122
- "@edifice.io/tiptap-extensions": "2.2.5-develop-integration.20250513201630",
123
- "@edifice.io/utilities": "2.2.5-develop-integration.20250513201630"
121
+ "@edifice.io/bootstrap": "2.2.5-develop-integration.20250515200442",
122
+ "@edifice.io/tiptap-extensions": "2.2.5-develop-integration.20250515200442",
123
+ "@edifice.io/utilities": "2.2.5-develop-integration.20250515200442"
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.2.5-develop-integration.20250513201630",
155
- "@edifice.io/config": "2.2.5-develop-integration.20250513201630"
154
+ "@edifice.io/config": "2.2.5-develop-integration.20250515200442",
155
+ "@edifice.io/client": "2.2.5-develop-integration.20250515200442"
156
156
  },
157
157
  "peerDependencies": {
158
158
  "@react-spring/web": "^9.7.5",