@edifice.io/react 2.2.6 → 2.2.7-develop-b2school.20250521111614

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.
Files changed (97) hide show
  1. package/dist/components/Button/Button.d.ts +1 -1
  2. package/dist/components/Button/Button.js +1 -1
  3. package/dist/components/Button/IconButton.js +1 -1
  4. package/dist/components/Combobox/Combobox.d.ts +60 -5
  5. package/dist/components/Combobox/Combobox.js +18 -7
  6. package/dist/components/Combobox/ComboboxTrigger.d.ts +34 -3
  7. package/dist/components/Combobox/ComboboxTrigger.js +33 -8
  8. package/dist/components/Dropdown/Dropdown.d.ts +10 -2
  9. package/dist/components/Dropdown/Dropdown.js +5 -3
  10. package/dist/components/Dropdown/DropdownItem.d.ts +5 -1
  11. package/dist/components/Dropdown/DropdownItem.js +4 -1
  12. package/dist/components/Dropdown/DropdownTrigger.js +5 -1
  13. package/dist/components/List/List.d.ts +15 -1
  14. package/dist/components/List/List.js +15 -12
  15. package/dist/components/SearchBar/SearchBar.d.ts +1 -1
  16. package/dist/components/SearchBar/SearchBar.js +3 -1
  17. package/dist/components/Toolbar/Toolbar.d.ts +4 -0
  18. package/dist/components/Toolbar/Toolbar.js +8 -3
  19. package/dist/components/Tree/components/Tree.js +1 -2
  20. package/dist/components/Tree/hooks/useTree.d.ts +0 -1
  21. package/dist/components/Tree/hooks/useTree.js +2 -25
  22. package/dist/components/Tree/types/index.d.ts +0 -4
  23. package/dist/editor.js +28 -26
  24. package/dist/hooks/index.d.ts +1 -0
  25. package/dist/hooks/useCheckable/useCheckable.js +10 -3
  26. package/dist/hooks/useConversation/useConversation.d.ts +1 -1
  27. package/dist/hooks/useConversation/useConversation.js +13 -17
  28. package/dist/hooks/useDate/useDate.d.ts +1 -0
  29. package/dist/hooks/useDate/useDate.js +33 -27
  30. package/dist/hooks/useDropdown/useDropdown.d.ts +2 -1
  31. package/dist/hooks/useDropdown/useDropdown.js +5 -3
  32. package/dist/hooks/useHttpErrorToast/useHttpErrorToast.js +12 -3
  33. package/dist/hooks/useWorkspaceFolders/index.d.ts +3 -0
  34. package/dist/hooks/useWorkspaceFolders/useWorkspaceFolders.js +54 -0
  35. package/dist/hooks/useWorkspaceFolders/useWorkspaceFoldersTree.d.ts +13 -0
  36. package/dist/hooks/useWorkspaceFolders/useWorkspaceFoldersTree.js +51 -0
  37. package/dist/icons.js +280 -266
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.js +50 -20
  40. package/dist/modals.js +16 -14
  41. package/dist/modules/editor/components/Editor/Editor.d.ts +8 -2
  42. package/dist/modules/editor/components/Editor/Editor.js +11 -19
  43. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.d.ts +1 -4
  44. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +3 -15
  45. package/dist/modules/editor/components/NodeView/ConversationHistoryNodeView.d.ts +2 -0
  46. package/dist/modules/editor/components/NodeView/ConversationHistoryNodeView.js +10 -0
  47. package/dist/modules/editor/components/NodeView/index.d.ts +2 -1
  48. package/dist/modules/editor/components/Renderer/ConversationHistoryRenderer.d.ts +8 -0
  49. package/dist/modules/editor/components/Renderer/ConversationHistoryRenderer.js +28 -0
  50. package/dist/modules/editor/components/Renderer/index.d.ts +2 -1
  51. package/dist/modules/editor/hooks/index.d.ts +0 -1
  52. package/dist/modules/editor/hooks/useTipTapEditor.d.ts +6 -2
  53. package/dist/modules/editor/hooks/useTipTapEditor.js +2 -2
  54. package/dist/modules/icons/components/IconFolderAdd.d.ts +7 -0
  55. package/dist/modules/icons/components/IconFolderAdd.js +13 -0
  56. package/dist/modules/icons/components/IconFolderDelete.d.ts +7 -0
  57. package/dist/modules/icons/components/IconFolderDelete.js +12 -0
  58. package/dist/modules/icons/components/{IconCantoo.d.ts → IconGlobe2.d.ts} +2 -2
  59. package/dist/modules/icons/components/IconGlobe2.js +16 -0
  60. package/dist/modules/icons/components/IconGroupAvatar.d.ts +7 -0
  61. package/dist/modules/icons/components/IconGroupAvatar.js +12 -0
  62. package/dist/modules/icons/components/IconMailRecall.d.ts +7 -0
  63. package/dist/modules/icons/components/IconMailRecall.js +13 -0
  64. package/dist/modules/icons/components/IconQuestionMark.d.ts +7 -0
  65. package/dist/modules/icons/components/IconQuestionMark.js +13 -0
  66. package/dist/modules/icons/components/IconReadMail.d.ts +7 -0
  67. package/dist/modules/icons/components/IconReadMail.js +16 -0
  68. package/dist/modules/icons/components/IconSignature.d.ts +7 -0
  69. package/dist/modules/icons/components/IconSignature.js +13 -0
  70. package/dist/modules/icons/components/IconUndoAll.d.ts +7 -0
  71. package/dist/modules/icons/components/IconUndoAll.js +14 -0
  72. package/dist/modules/icons/components/IconUnreadMail.d.ts +7 -0
  73. package/dist/modules/icons/components/IconUnreadMail.js +16 -0
  74. package/dist/modules/icons/components/index.d.ts +10 -3
  75. package/dist/modules/modals/ConfirmModal/ConfirmModal.d.ts +47 -0
  76. package/dist/modules/modals/ConfirmModal/ConfirmModal.js +37 -0
  77. package/dist/modules/modals/ConfirmModal/index.d.ts +1 -0
  78. package/dist/modules/modals/index.d.ts +1 -0
  79. package/dist/modules/multimedia/WorkspaceFolders/WorkspaceFolders.d.ts +8 -0
  80. package/dist/modules/multimedia/WorkspaceFolders/WorkspaceFolders.js +55 -0
  81. package/dist/modules/multimedia/WorkspaceFolders/components/NewFolderForm.d.ts +16 -0
  82. package/dist/modules/multimedia/WorkspaceFolders/components/NewFolderForm.js +39 -0
  83. package/dist/modules/multimedia/WorkspaceFolders/index.d.ts +1 -0
  84. package/dist/modules/multimedia/index.d.ts +1 -0
  85. package/dist/multimedia.js +3 -1
  86. package/package.json +6 -6
  87. package/dist/modules/editor/components/Editor/CantooAdaptTextBoxView.d.ts +0 -7
  88. package/dist/modules/editor/components/Editor/CantooAdaptTextBoxView.js +0 -33
  89. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Cantoo.d.ts +0 -9
  90. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Cantoo.js +0 -79
  91. package/dist/modules/editor/hooks/useCantooEditor.d.ts +0 -17
  92. package/dist/modules/editor/hooks/useCantooEditor.js +0 -89
  93. package/dist/modules/icons/components/IconCantoo.js +0 -23
  94. package/dist/modules/icons/components/IconMicOff.d.ts +0 -7
  95. package/dist/modules/icons/components/IconMicOff.js +0 -12
  96. package/dist/modules/icons/components/IconTextToSpeechOff.d.ts +0 -7
  97. package/dist/modules/icons/components/IconTextToSpeechOff.js +0 -12
@@ -1,89 +0,0 @@
1
- import { useState, useCallback } from "react";
2
- import { odeServices } from "@edifice.io/client";
3
- import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
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
- right: !1,
7
- bottom: !1
8
- }), speech2textIsAvailable = (Cantoo == null ? void 0 : Cantoo.speech2text.isAvailableOnDevice()) || !1, toggleSpeech2Text = async () => {
9
- if (speech2textIsActive) {
10
- setSpeech2textActive(!1);
11
- try {
12
- await Cantoo.speech2text.stop();
13
- } catch (e) {
14
- console.warn("Error while trying to stop Cantoo (speech2text)", e);
15
- }
16
- } else
17
- try {
18
- if (setSpeech2textActive(!0), speech2textIsAvailable)
19
- if (await Cantoo.speech2text.requestPermission())
20
- cantooStoreEvent("CANTOO_EDITEUR_SPEECH_TO_TEXT"), await Cantoo.speech2text.start((data) => {
21
- editor == null || editor.chain().focus().insertContent(data.join(" ")).run();
22
- }, window.navigator.language);
23
- else
24
- throw setSpeech2textActive(!1), new Error("Cantoo speech2text permission denied, please check your browser settings");
25
- else
26
- throw setSpeech2textActive(!1), new Error("Cantoo speech2text not available on this device");
27
- } catch (e) {
28
- console.warn("Error while trying to use Cantoo (speech2text)", e), setSpeech2textActive(!1);
29
- }
30
- }, toggleText2Speech = () => {
31
- if (text2speechIsActive)
32
- setText2speechActive(!1), window.speechSynthesis.cancel();
33
- else
34
- try {
35
- setText2speechActive(!0), Cantoo.text2speech.readText(editor == null ? void 0 : editor.getText()), cantooStoreEvent("CANTOO_EDITEUR_TEXT_TO_SPEECH"), Cantoo.text2speech.utter.onend = () => {
36
- setText2speechActive(!1);
37
- };
38
- } catch (e) {
39
- console.warn("Error while trying to use Cantoo (text2speech)", e), setText2speechActive(!1);
40
- }
41
- }, handleCantooAdaptTextPosition = (position) => {
42
- switch (position) {
43
- case "right":
44
- openPositionAdaptText.right || cantooStoreEvent("CANTOO_EDITEUR_ADAPT_TEXT"), setOpenPositionAdaptText((prev) => ({
45
- bottom: !1,
46
- right: !prev.right
47
- }));
48
- break;
49
- case "bottom":
50
- openPositionAdaptText.bottom || cantooStoreEvent("CANTOO_EDITEUR_ADAPT_TEXT"), setOpenPositionAdaptText((prev) => ({
51
- right: !1,
52
- bottom: !prev.bottom
53
- }));
54
- break;
55
- }
56
- }, toogleSettings = () => {
57
- if (!Cantoo) {
58
- console.warn("Cantoo not available");
59
- return;
60
- }
61
- Cantoo.openCantooWebConfig();
62
- }, cantooStoreEvent = useCallback(async (eventType) => {
63
- if (eventType.length > 0) {
64
- const data = {
65
- "event-type": eventType
66
- };
67
- try {
68
- await odeServices.http().post("/infra/event/web/store", data);
69
- } catch (e) {
70
- console.warn("Error while storing event", e);
71
- }
72
- }
73
- }, []);
74
- return {
75
- cantooParam,
76
- isAvailable,
77
- speech2textIsAvailable,
78
- speech2textIsActive,
79
- text2speechIsActive,
80
- toggleSpeech2Text,
81
- toggleText2Speech,
82
- toogleSettings,
83
- openPositionAdaptText,
84
- handleCantooAdaptTextPosition
85
- };
86
- };
87
- export {
88
- useCantooEditor
89
- };
@@ -1,23 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- const SvgIconCantoo = ({
3
- title,
4
- titleId,
5
- ...props
6
- }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 88 104", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
7
- title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
8
- /* @__PURE__ */ jsx("ellipse", { cx: 44.305, cy: 15.281, fill: "url(#icon-cantoo_svg__a)", rx: 14.472, ry: 14.367, transform: "rotate(-.145 44.305 15.281)" }),
9
- /* @__PURE__ */ jsx("path", { fill: "url(#icon-cantoo_svg__b)", fillRule: "evenodd", d: "m44.529 39.653-28.126-8.41c-6.42-1.785-13.121 1.8-14.968 8.008C-.414 45.46 3.294 51.94 9.713 53.724l17.54 5.245-16.845 28.892c-2.73 5.401.023 11.938 6.147 14.601 6.125 2.662 13.301.442 16.03-4.96l11.88-20.374 11.974 20.3c2.757 5.387 9.945 7.57 16.055 4.877 6.111-2.694 8.83-9.244 6.074-14.632l-16.953-28.74 17.478-5.384c6.41-1.818 10.084-8.316 8.206-14.514-1.879-6.199-8.598-9.75-15.009-7.932z", clipRule: "evenodd" }),
10
- /* @__PURE__ */ jsxs("defs", { children: [
11
- /* @__PURE__ */ jsxs("linearGradient", { id: "icon-cantoo_svg__a", x1: 28.13, x2: 60.619, y1: -6.867, y2: 27.927, gradientUnits: "userSpaceOnUse", children: [
12
- /* @__PURE__ */ jsx("stop", { stopColor: "#0B4EFC" }),
13
- /* @__PURE__ */ jsx("stop", { offset: 1, stopColor: "#30B3E8" })
14
- ] }),
15
- /* @__PURE__ */ jsxs("linearGradient", { id: "icon-cantoo_svg__b", x1: -4.227, x2: 76.299, y1: 11.105, y2: 112.656, gradientUnits: "userSpaceOnUse", children: [
16
- /* @__PURE__ */ jsx("stop", { stopColor: "#0B4EFC" }),
17
- /* @__PURE__ */ jsx("stop", { offset: 1, stopColor: "#30B3E8" })
18
- ] })
19
- ] })
20
- ] });
21
- export {
22
- SvgIconCantoo as default
23
- };
@@ -1,7 +0,0 @@
1
- import { SVGProps } from 'react';
2
- interface SVGRProps {
3
- title?: string;
4
- titleId?: string;
5
- }
6
- declare const SvgIconMicOff: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
7
- export default SvgIconMicOff;
@@ -1,12 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- const SvgIconMicOff = ({
3
- title,
4
- titleId,
5
- ...props
6
- }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
7
- title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
8
- /* @__PURE__ */ jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M1.793 1.04c-.252.045-.546.274-.676.526a.87.87 0 0 0-.06.691c.082.279.119.318 4.107 4.323l2.829 2.84.019 1.58c.019 1.461.027 1.604.107 1.9.367 1.351 1.351 2.35 2.761 2.8.322.103.382.109 1.12.109s.798-.006 1.12-.109c.187-.06.45-.159.585-.22l.245-.111.689.69.689.69-.446.228a7 7 0 0 1-1.782.608c-.597.112-1.686.103-2.289-.017-1.205-.241-2.258-.789-3.093-1.607-.755-.741-1.233-1.531-1.524-2.521-.126-.431-.154-.759-.189-2.221-.031-1.296-.04-1.412-.116-1.559-.368-.717-1.401-.717-1.781 0-.08.15-.086.232-.101 1.273-.009.65.004 1.333.031 1.64A7.7 7.7 0 0 0 5.5 16.46c.277.376.959 1.084 1.335 1.387A8.8 8.8 0 0 0 9.26 19.2c.395.138 1.2.34 1.53.383l.21.027v1.904l-1.65.013-1.65.013-.192.113c-.342.201-.55.619-.489.983.046.269.254.567.499.714l.218.13h8.532l.236-.153c.641-.415.638-1.251-.008-1.655l-.236-.147-1.63-.003L13 21.52l.001-.91c0-.5.013-.93.03-.954.016-.025.119-.058.229-.074.341-.049 1.232-.29 1.646-.445.439-.164.981-.43 1.494-.733l.34-.201.26.248c.143.137 1.007.987 1.92 1.891 2.426 2.402 2.558 2.524 2.822 2.6.775.226 1.513-.639 1.153-1.35-.072-.143-5.933-6.059-11.781-11.895-6.987-6.971-8.607-8.563-8.762-8.61a1.2 1.2 0 0 0-.559-.047m9.567.004c-.576.074-1.3.371-1.8.738-.675.497-1.145 1.163-1.422 2.018-.096.298-.112.421-.129.99-.02.718.014.948.175 1.159.12.158.401.327.625.378.349.078.82-.138 1.011-.463.096-.164.112-.249.157-.844.049-.642.055-.671.202-.961C10.526 3.375 11.164 3 11.98 3c.819 0 1.481.406 1.825 1.12l.144.3.024 3.567.023 3.568.106.208c.112.222.755.915 1.016 1.096.263.182.615.132.762-.108.078-.129.08-.204.08-4.293V4.297l-.104-.359a3.93 3.93 0 0 0-1.115-1.849c-.893-.84-2.092-1.211-3.381-1.045m7.393 8.575c-.353.089-.663.379-.729.681-.014.066-.043.777-.064 1.58-.041 1.529-.058 1.683-.258 2.3-.218.669-.172 1.099.153 1.433.381.392 1.038.408 1.353.034.24-.285.633-1.573.711-2.327.054-.521.052-2.858-.002-3.054-.048-.172-.311-.48-.489-.572a1.1 1.1 0 0 0-.675-.075m-6.462 4.226c-.698.16-1.735-.343-2.069-1.002-.142-.279-.22-.664-.221-1.083L10 11.421l1.201 1.199c1.146 1.146 1.195 1.201 1.09 1.225", clipRule: "evenodd" })
9
- ] });
10
- export {
11
- SvgIconMicOff as default
12
- };
@@ -1,7 +0,0 @@
1
- import { SVGProps } from 'react';
2
- interface SVGRProps {
3
- title?: string;
4
- titleId?: string;
5
- }
6
- declare const SvgIconTextToSpeechOff: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
7
- export default SvgIconTextToSpeechOff;
@@ -1,12 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- const SvgIconTextToSpeechOff = ({
3
- title,
4
- titleId,
5
- ...props
6
- }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
7
- title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
8
- /* @__PURE__ */ jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M1.793 1.04c-.252.045-.546.274-.676.526a.87.87 0 0 0-.06.688c.08.277.2.405 3.076 3.292l2.038 2.046-1.715.018c-1.494.016-1.744.027-1.936.089-.717.229-1.203.697-1.41 1.356-.089.283-.09.302-.09 2.925 0 2.449.005 2.657.074 2.878.221.719.684 1.212 1.34 1.429.256.085.337.089 2.128.104l1.862.015 1.978 1.663c3.634 3.054 3.408 2.886 3.918 2.921.679.046 1.148-.122 1.577-.564.331-.341.487-.631.542-1.013.022-.15.04-1.002.04-1.893l.001-1.62 2.87 2.862c3.453 3.443 4.073 4.046 4.252 4.139.181.094.528.097.765.006.21-.08.447-.317.543-.541.084-.196.082-.591-.003-.754-.085-.162-5.712-5.847-11.793-11.915-6.987-6.971-8.607-8.563-8.762-8.61a1.2 1.2 0 0 0-.559-.047m10.424 1.974c-.09.029-.342.147-.56.261-.407.214-.858.555-1.967 1.492-.673.568-.77.704-.77 1.073 0 .314.107.493.56.938.359.353.406.387.47.337.038-.03.393-.325.788-.655l1.256-1.049c.296-.246.556-.437.578-.423.027.016.032.722.015 2.108-.029 2.306-.023 2.397.213 2.863.156.311.747.937.944 1.002.274.091.618-.082.698-.352.031-.105.04-1.033.03-3.129-.013-2.972-.013-2.981-.102-3.219-.111-.294-.341-.536-.825-.869-.546-.375-.969-.495-1.328-.378m7.881 4.539c-.295.138-.538.518-.538.84 0 .043.161.408.358.812.391.801.548 1.231.688 1.875.081.373.092.531.092 1.4.001.775-.014 1.055-.069 1.34-.123.625-.345 1.242-.715 1.982-.453.905-.456.938-.104 1.307.273.285.425.371.662.371.407 0 .749-.242 1.015-.72.335-.601.745-1.724.91-2.492.171-.795.195-2.134.057-3.103-.142-.996-.769-2.648-1.238-3.263-.264-.345-.782-.507-1.118-.349m-7.587 8.814c-.006 1.334-.023 2.439-.039 2.454-.031.031-.038.026-2.332-1.862-2.281-1.878-2.987-2.446-3.07-2.469-.066-.018-.07-.17-.07-2.474V9.562l.11-.058c.06-.031.208-.141.327-.244l.217-.186 2.434 2.433 2.435 2.433zM5 12v2.4H3V9.6h2zm11.68-2.293c-.444.228-.588.666-.349 1.053.062.099.203.288.315.42s.251.339.309.46c.091.19.105.272.105.6 0 .456-.11.839-.346 1.204-.085.131-.154.279-.154.329 0 .105 1.065 1.187 1.168 1.187s.25-.142.461-.448c.278-.402.427-.709.551-1.132a3.64 3.64 0 0 0-.695-3.29c-.254-.305-.532-.456-.881-.479-.231-.015-.291-.003-.484.096", clipRule: "evenodd" })
9
- ] });
10
- export {
11
- SvgIconTextToSpeechOff as default
12
- };