@edifice.io/react 2.5.6 → 2.5.8-develop-b2school.20260122173252

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 (183) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +8 -0
  2. package/dist/_virtual/common.js +4 -0
  3. package/dist/_virtual/de_DE.js +4 -0
  4. package/dist/_virtual/de_DE2.js +4 -0
  5. package/dist/_virtual/de_DE3.js +4 -0
  6. package/dist/_virtual/de_DE4.js +4 -0
  7. package/dist/_virtual/de_DE5.js +4 -0
  8. package/dist/_virtual/de_DE6.js +4 -0
  9. package/dist/_virtual/defineProperty.js +4 -0
  10. package/dist/_virtual/es_ES.js +4 -0
  11. package/dist/_virtual/es_ES2.js +4 -0
  12. package/dist/_virtual/es_ES3.js +4 -0
  13. package/dist/_virtual/es_ES4.js +4 -0
  14. package/dist/_virtual/es_ES5.js +4 -0
  15. package/dist/_virtual/es_ES6.js +4 -0
  16. package/dist/_virtual/fr_FR.js +4 -0
  17. package/dist/_virtual/fr_FR2.js +4 -0
  18. package/dist/_virtual/fr_FR3.js +4 -0
  19. package/dist/_virtual/fr_FR4.js +4 -0
  20. package/dist/_virtual/fr_FR5.js +4 -0
  21. package/dist/_virtual/fr_FR6.js +4 -0
  22. package/dist/_virtual/interopRequireDefault.js +4 -0
  23. package/dist/_virtual/it_IT.js +4 -0
  24. package/dist/_virtual/it_IT2.js +4 -0
  25. package/dist/_virtual/it_IT3.js +4 -0
  26. package/dist/_virtual/it_IT4.js +4 -0
  27. package/dist/_virtual/it_IT5.js +4 -0
  28. package/dist/_virtual/it_IT6.js +4 -0
  29. package/dist/_virtual/localeData.js +4 -0
  30. package/dist/_virtual/objectSpread2.js +4 -0
  31. package/dist/_virtual/pt_PT.js +4 -0
  32. package/dist/_virtual/pt_PT2.js +4 -0
  33. package/dist/_virtual/pt_PT3.js +4 -0
  34. package/dist/_virtual/pt_PT4.js +4 -0
  35. package/dist/_virtual/pt_PT5.js +4 -0
  36. package/dist/_virtual/pt_PT6.js +4 -0
  37. package/dist/_virtual/toPrimitive.js +4 -0
  38. package/dist/_virtual/toPropertyKey.js +4 -0
  39. package/dist/_virtual/typeof.js +4 -0
  40. package/dist/_virtual/weekday.js +4 -0
  41. package/dist/components/AppIcon/index.d.ts +1 -0
  42. package/dist/components/Badge/Badge.d.ts +12 -1
  43. package/dist/components/Badge/Badge.js +15 -2
  44. package/dist/components/Combobox/Combobox.js +1 -1
  45. package/dist/components/Combobox/ComboboxTrigger.js +1 -1
  46. package/dist/components/DatePicker/DatePicker.d.ts +57 -0
  47. package/dist/components/DatePicker/DatePicker.js +38 -0
  48. package/dist/components/DatePicker/index.d.ts +2 -0
  49. package/dist/components/Divider/Divider.d.ts +38 -0
  50. package/dist/components/Divider/Divider.js +11 -0
  51. package/dist/components/Divider/index.d.ts +2 -0
  52. package/dist/components/Dropdown/DropdownContext.js +1 -1
  53. package/dist/components/Flex/Flex.js +1 -1
  54. package/dist/components/Form/FormContext.js +1 -1
  55. package/dist/components/Layout/Layout.js +1 -2
  56. package/dist/components/Menu/components/MenuButton.d.ts +2 -0
  57. package/dist/components/Menu/components/MenuButton.js +13 -4
  58. package/dist/components/Modal/Modal.d.ts +4 -0
  59. package/dist/components/Modal/Modal.js +13 -12
  60. package/dist/components/SegmentedControl/SegmentedControl.d.ts +59 -0
  61. package/dist/components/SegmentedControl/SegmentedControl.js +24 -0
  62. package/dist/components/SegmentedControl/index.d.ts +2 -0
  63. package/dist/components/Select/Select.d.ts +6 -2
  64. package/dist/components/Select/Select.js +10 -4
  65. package/dist/components/Toolbar/Toolbar.js +1 -1
  66. package/dist/components/index.d.ts +3 -0
  67. package/dist/editor.js +42 -38
  68. package/dist/hooks/index.d.ts +1 -0
  69. package/dist/hooks/useConversation/useConversation.js +3 -1
  70. package/dist/hooks/useDropdown/useDropdown.js +1 -1
  71. package/dist/hooks/useDropzone/useDropzone.d.ts +2 -2
  72. package/dist/hooks/useDropzone/useDropzone.js +24 -4
  73. package/dist/hooks/useInfiniteScroll/index.d.ts +1 -0
  74. package/dist/hooks/useInfiniteScroll/useInfiniteScroll.d.ts +33 -0
  75. package/dist/hooks/useInfiniteScroll/useInfiniteScroll.js +20 -0
  76. package/dist/icons.js +302 -298
  77. package/dist/index.js +230 -212
  78. package/dist/modals.js +14 -12
  79. package/dist/modules/comments/components/Comment.js +8 -6
  80. package/dist/modules/comments/components/CommentDate.js +7 -10
  81. package/dist/modules/comments/components/CommentDeleted.js +1 -1
  82. package/dist/modules/comments/components/CommentForm.d.ts +1 -1
  83. package/dist/modules/comments/components/CommentForm.js +6 -6
  84. package/dist/modules/comments/components/CommentList.js +1 -1
  85. package/dist/modules/comments/components/CommentTitle.js +1 -1
  86. package/dist/modules/comments/components/DeleteModal.js +14 -8
  87. package/dist/modules/comments/provider/CommentProvider.js +4 -4
  88. package/dist/modules/comments/types.d.ts +3 -1
  89. package/dist/modules/editor/components/Editor/Editor.js +1 -1
  90. package/dist/modules/editor/components/Editor/EditorPreview.d.ts +14 -0
  91. package/dist/modules/editor/components/Editor/EditorPreview.js +56 -0
  92. package/dist/modules/editor/components/Editor/EditorPreviewSkeleton.d.ts +8 -0
  93. package/dist/modules/editor/components/Editor/EditorPreviewSkeleton.js +24 -0
  94. package/dist/modules/editor/components/Editor/index.d.ts +2 -0
  95. package/dist/modules/editor/components/Renderer/AttachmentRenderer.js +2 -2
  96. package/dist/modules/editor/hooks/useMediaLibraryEditor.js +4 -3
  97. package/dist/modules/editor/hooks/useTipTapEditor.js +4 -4
  98. package/dist/modules/icons/components/IconClockAlert.d.ts +7 -0
  99. package/dist/modules/icons/components/IconClockAlert.js +17 -0
  100. package/dist/modules/icons/components/IconSubmitToValidate.d.ts +7 -0
  101. package/dist/modules/icons/components/IconSubmitToValidate.js +12 -0
  102. package/dist/modules/icons/components/index.d.ts +2 -0
  103. package/dist/modules/modals/OnboardingModal/OnboardingModal.js +5 -5
  104. package/dist/modules/modals/ResourceModal/ResourceModal.js +1 -2
  105. package/dist/modules/modals/ShareModal/ShareBookmark.d.ts +1 -1
  106. package/dist/modules/modals/ShareModal/ShareBookmark.js +6 -3
  107. package/dist/modules/modals/ShareModal/ShareBookmarkLine.js +4 -4
  108. package/dist/modules/modals/ShareModal/ShareModal.d.ts +1 -11
  109. package/dist/modules/modals/ShareModal/ShareModal.js +13 -105
  110. package/dist/modules/modals/ShareModal/ShareResources.d.ts +187 -0
  111. package/dist/modules/modals/ShareModal/ShareResources.js +148 -0
  112. package/dist/modules/modals/ShareModal/hooks/useSearch.d.ts +5 -3
  113. package/dist/modules/modals/ShareModal/hooks/useSearch.js +12 -16
  114. package/dist/modules/modals/ShareModal/hooks/useShare.d.ts +12 -5
  115. package/dist/modules/modals/ShareModal/hooks/useShare.js +20 -13
  116. package/dist/modules/modals/ShareModal/hooks/useShareBookmark.d.ts +1 -1
  117. package/dist/modules/modals/ShareModal/hooks/useShareBookmark.js +1 -1
  118. package/dist/modules/modals/ShareModal/index.d.ts +3 -1
  119. package/dist/modules/multimedia/Linker/ExternalLinker/ExternalLinker.js +1 -2
  120. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +1 -2
  121. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +1 -1
  122. package/dist/modules/multimedia/MediaLibrary/index.d.ts +2 -0
  123. package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js +1 -1
  124. package/dist/modules/multimedia/index.d.ts +1 -0
  125. package/dist/multimedia.js +20 -14
  126. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/defineProperty.js +18 -0
  127. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/interopRequireDefault.js +13 -0
  128. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/objectSpread2.js +31 -0
  129. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/toPrimitive.js +20 -0
  130. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/toPropertyKey.js +15 -0
  131. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/typeof.js +16 -0
  132. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/calendar/locale/de_DE.js +11 -0
  133. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/calendar/locale/es_ES.js +11 -0
  134. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/calendar/locale/fr_FR.js +11 -0
  135. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/calendar/locale/it_IT.js +11 -0
  136. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/calendar/locale/pt_PT.js +11 -0
  137. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/date-picker/locale/de_DE.js +22 -0
  138. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/date-picker/locale/es_ES.js +22 -0
  139. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/date-picker/locale/fr_FR.js +27 -0
  140. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/date-picker/locale/it_IT.js +20 -0
  141. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/date-picker/locale/pt_PT.js +45 -0
  142. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/locale/de_DE.js +145 -0
  143. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/locale/es_ES.js +145 -0
  144. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/locale/fr_FR.js +144 -0
  145. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/locale/it_IT.js +156 -0
  146. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/locale/pt_PT.js +158 -0
  147. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/time-picker/locale/de_DE.js +10 -0
  148. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/time-picker/locale/es_ES.js +10 -0
  149. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/time-picker/locale/fr_FR.js +10 -0
  150. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/time-picker/locale/it_IT.js +10 -0
  151. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/time-picker/locale/pt_PT.js +10 -0
  152. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/locale/de_DE.js +8 -0
  153. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/locale/es_ES.js +8 -0
  154. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/locale/fr_FR.js +8 -0
  155. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/locale/it_IT.js +8 -0
  156. package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/locale/pt_PT.js +8 -0
  157. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/localeData.js +82 -0
  158. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/weekday.js +19 -0
  159. package/dist/node_modules/.pnpm/rc-pagination@5.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-pagination/lib/locale/de_DE.js +21 -0
  160. package/dist/node_modules/.pnpm/rc-pagination@5.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-pagination/lib/locale/es_ES.js +21 -0
  161. package/dist/node_modules/.pnpm/rc-pagination@5.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-pagination/lib/locale/fr_FR.js +21 -0
  162. package/dist/node_modules/.pnpm/rc-pagination@5.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-pagination/lib/locale/it_IT.js +21 -0
  163. package/dist/node_modules/.pnpm/rc-pagination@5.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-pagination/lib/locale/pt_PT.js +21 -0
  164. package/dist/node_modules/.pnpm/rc-picker@4.11.3_dayjs@1.11.19_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-picker/lib/locale/common.js +14 -0
  165. package/dist/node_modules/.pnpm/rc-picker@4.11.3_dayjs@1.11.19_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-picker/lib/locale/de_DE.js +37 -0
  166. package/dist/node_modules/.pnpm/rc-picker@4.11.3_dayjs@1.11.19_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-picker/lib/locale/es_ES.js +37 -0
  167. package/dist/node_modules/.pnpm/rc-picker@4.11.3_dayjs@1.11.19_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-picker/lib/locale/fr_FR.js +38 -0
  168. package/dist/node_modules/.pnpm/rc-picker@4.11.3_dayjs@1.11.19_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-picker/lib/locale/it_IT.js +37 -0
  169. package/dist/node_modules/.pnpm/rc-picker@4.11.3_dayjs@1.11.19_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-picker/lib/locale/pt_PT.js +39 -0
  170. package/dist/providers/AntThemeProvider/AntProvider.d.ts +2 -2
  171. package/dist/providers/AntThemeProvider/AntProvider.js +19 -2
  172. package/dist/providers/AntThemeProvider/antThemeConfig.js +1 -2
  173. package/dist/style.css +1 -1
  174. package/dist/utilities/index.d.ts +1 -0
  175. package/dist/utilities/mime-types/index.d.ts +1 -0
  176. package/dist/utilities/mime-types/mime-types-utils.d.ts +1 -0
  177. package/dist/utilities/mime-types/mime-types-utils.js +4 -0
  178. package/dist/utilities/react-query/index.d.ts +1 -0
  179. package/dist/utilities/react-query/react-query-utils.d.ts +21 -0
  180. package/dist/utilities/react-query/react-query-utils.js +13 -0
  181. package/package.json +8 -7
  182. package/dist/modules/comments/components/CommentHeader.d.ts +0 -3
  183. package/dist/modules/comments/components/CommentHeader.js +0 -8
@@ -9,17 +9,14 @@ const CommentDate = ({
9
9
  fromNow
10
10
  } = useDate(), {
11
11
  t
12
- } = useTranslation(), getPublishedDate = (date) => t("comment.publish.date", {
13
- date: fromNow(date)
14
- }), getUpdatedDate = (date) => t("comment.update.date", {
15
- date: fromNow(date)
16
- });
17
- return updatedAt ? /* @__PURE__ */ jsxs(Fragment, { children: [
12
+ } = useTranslation();
13
+ return updatedAt || createdAt ? /* @__PURE__ */ jsxs(Fragment, { children: [
18
14
  /* @__PURE__ */ jsx("span", { className: "small text-gray-700", children: "|" }),
19
- /* @__PURE__ */ jsx("span", { className: "small text-gray-700", children: getUpdatedDate(updatedAt) })
20
- ] }) : createdAt ? /* @__PURE__ */ jsxs(Fragment, { children: [
21
- /* @__PURE__ */ jsx("span", { className: "small text-gray-700", children: "|" }),
22
- /* @__PURE__ */ jsx("span", { className: "small text-gray-700", children: getPublishedDate(createdAt) })
15
+ /* @__PURE__ */ jsx("span", { "data-testid": "comment-info-date", className: "small text-gray-700", children: updatedAt ? ((date) => t("comment.update.date", {
16
+ date: fromNow(date)
17
+ }))(updatedAt) : ((date) => t("comment.publish.date", {
18
+ date: fromNow(date)
19
+ }))(createdAt) })
23
20
  ] }) : null;
24
21
  };
25
22
  export {
@@ -4,7 +4,7 @@ const CommentDeleted = () => {
4
4
  const {
5
5
  t
6
6
  } = useTranslation();
7
- return /* @__PURE__ */ jsx("div", { className: "border rounded-3 p-12 pb-8 d-flex gap-12 bg-gray-200 my-16", children: t("comment.deleted") });
7
+ return /* @__PURE__ */ jsx("div", { "data-testid": "div-comment-deleted", className: "border rounded-3 p-12 pb-8 d-flex gap-12 bg-gray-200 my-16", children: t("comment.deleted") });
8
8
  };
9
9
  export {
10
10
  CommentDeleted
@@ -1,4 +1,4 @@
1
1
  export declare const CommentForm: ({ userId, replyTo, }: {
2
2
  userId: string;
3
3
  replyTo?: string;
4
- }) => import("react/jsx-runtime").JSX.Element;
4
+ }) => false | import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,11 @@
1
- import { jsx, Fragment, jsxs } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useState } from "react";
2
3
  import { useTranslation } from "react-i18next";
3
4
  import SvgIconSend from "../../icons/components/IconSend.js";
4
5
  import { useAutosizeTextarea } from "../hooks/useAutosizeTextarea.js";
5
6
  import { useCommentsContext } from "../hooks/useCommentsContext.js";
6
7
  import { CommentAvatar } from "./CommentAvatar.js";
7
8
  import { TextCounter } from "./TextCounter.js";
8
- import { useState } from "react";
9
9
  import Button from "../../../components/Button/Button.js";
10
10
  const CommentForm = ({
11
11
  userId,
@@ -22,19 +22,19 @@ const CommentForm = ({
22
22
  }, handleSubmit = () => {
23
23
  handleCreateComment(content, replyTo), setContent("");
24
24
  };
25
- return /* @__PURE__ */ jsx(Fragment, { children: type === "edit" && /* @__PURE__ */ jsxs("div", { className: "border rounded-3 p-12 pb-8 d-flex gap-12 bg-gray-200", children: [
25
+ return type === "edit" && /* @__PURE__ */ jsxs("div", { "data-testid": "div-comment-create", className: "border rounded-3 p-12 pb-8 d-flex gap-12 bg-gray-200 d-print-none", children: [
26
26
  /* @__PURE__ */ jsx(CommentAvatar, { id: userId }),
27
27
  /* @__PURE__ */ jsxs("div", { className: "d-flex flex-column flex-fill gap-4", children: [
28
- /* @__PURE__ */ jsx("textarea", { id: "add-comment", ref, value: content, className: "form-control", placeholder: t("comment.placeholder.textarea"), maxLength: options.maxCommentLength, onChange: handleChangeContent, onFocus, rows: 1, style: {
28
+ /* @__PURE__ */ jsx("textarea", { id: "add-comment", "data-testid": "comment-form", ref, value: content, className: "form-control", placeholder: t("comment.placeholder.textarea"), maxLength: options.maxCommentLength, onChange: handleChangeContent, onFocus, rows: 1, style: {
29
29
  resize: "none",
30
30
  overflow: "hidden"
31
31
  } }),
32
32
  /* @__PURE__ */ jsxs("div", { className: "d-flex justify-content-end align-items-center gap-4", children: [
33
33
  /* @__PURE__ */ jsx(TextCounter, { content, maxLength: options.maxCommentLength }),
34
- /* @__PURE__ */ jsx(Button, { type: "submit", variant: "ghost", size: "sm", leftIcon: /* @__PURE__ */ jsx(SvgIconSend, {}), disabled: !(content != null && content.length), onClick: handleSubmit, children: t("comment.post") })
34
+ /* @__PURE__ */ jsx(Button, { "data-testid": "comment-publish", type: "submit", variant: "ghost", size: "sm", leftIcon: /* @__PURE__ */ jsx(SvgIconSend, {}), disabled: !(content != null && content.length), onClick: handleSubmit, children: t("comment.post") })
35
35
  ] })
36
36
  ] })
37
- ] }) });
37
+ ] });
38
38
  };
39
39
  export {
40
40
  CommentForm
@@ -14,7 +14,7 @@ function CommentList() {
14
14
  const {
15
15
  authorId
16
16
  } = comment, profile = ((_a = profiles == null ? void 0 : profiles.find((user2) => (user2 == null ? void 0 : user2.userId) === authorId)) == null ? void 0 : _a.profile) ?? "Guest";
17
- return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Comment, { comment, profile, userId: user == null ? void 0 : user.userId }) }, comment.id);
17
+ return /* @__PURE__ */ jsx("div", { id: `comment-${comment.id}`, children: /* @__PURE__ */ jsx(Comment, { comment, profile, userId: user == null ? void 0 : user.userId }) }, comment.id);
18
18
  });
19
19
  }
20
20
  export {
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  const CommentTitle = ({
3
3
  children
4
- }) => /* @__PURE__ */ jsx("span", { className: "small text-gray-800", children });
4
+ }) => /* @__PURE__ */ jsx("span", { "data-testid": "comment-info-author", className: "small text-gray-800", children });
5
5
  export {
6
6
  CommentTitle
7
7
  };
@@ -1,18 +1,24 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useTranslation } from "react-i18next";
2
3
  import Modal from "../../../components/Modal/Modal.js";
3
4
  import Button from "../../../components/Button/Button.js";
4
5
  const DeleteModal = ({
5
6
  isOpen,
6
7
  onCancel,
7
8
  onSuccess
8
- }) => /* @__PURE__ */ jsxs(Modal, { isOpen, onModalClose: onCancel, id: "delete-comment-modal", children: [
9
- /* @__PURE__ */ jsx(Modal.Header, { onModalClose: onCancel, children: "Suppression de commentaire" }),
10
- /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx("p", { children: "Voulez-vous vraiment supprimer ce commentaire ?" }) }),
11
- /* @__PURE__ */ jsxs(Modal.Footer, { children: [
12
- /* @__PURE__ */ jsx(Button, { color: "tertiary", onClick: onCancel, type: "button", variant: "ghost", children: "Annuler" }),
13
- /* @__PURE__ */ jsx(Button, { color: "danger", onClick: onSuccess, type: "button", variant: "filled", children: "Supprimer le commentaire" })
14
- ] })
15
- ] });
9
+ }) => {
10
+ const {
11
+ t
12
+ } = useTranslation();
13
+ return /* @__PURE__ */ jsxs(Modal, { size: "sm", isOpen, onModalClose: onCancel, id: "delete-comment-modal", children: [
14
+ /* @__PURE__ */ jsx(Modal.Header, { onModalClose: onCancel, children: t("comment.delete.modal.title") }),
15
+ /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx("p", { children: t("comment.delete.modal.body") }) }),
16
+ /* @__PURE__ */ jsxs(Modal.Footer, { children: [
17
+ /* @__PURE__ */ jsx(Button, { color: "tertiary", onClick: onCancel, type: "button", variant: "ghost", children: t("cancel") }),
18
+ /* @__PURE__ */ jsx(Button, { color: "danger", onClick: onSuccess, type: "button", variant: "filled", children: t("comment.delete.modal.delete") })
19
+ ] })
20
+ ] });
21
+ };
16
22
  export {
17
23
  DeleteModal,
18
24
  DeleteModal as default
@@ -1,11 +1,11 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
3
  import { CommentForm } from "../components/CommentForm.js";
4
- import { CommentHeader } from "../components/CommentHeader.js";
5
4
  import { CommentList } from "../components/CommentList.js";
6
5
  import { DEFAULT_ALLOW_REPLIES, DEFAULT_ADD_REPLIES, DEFAULT_MAX_REPLIES, DEFAULT_ADD_COMMENTS, DEFAULT_MAX_COMMENTS, DEFAULT_MAX_REPLY_LENGTH, DEFAULT_MAX_COMMENT_LENGTH } from "../constants.js";
7
6
  import { CommentContext } from "../context/Context.js";
8
7
  import { useComments } from "../hooks/useComments.js";
8
+ import Heading from "../../../components/Heading/Heading.js";
9
9
  import Button from "../../../components/Button/Button.js";
10
10
  import EmptyScreen from "../../../components/EmptyScreen/EmptyScreen.js";
11
11
  const CommentProvider = ({
@@ -71,15 +71,15 @@ const CommentProvider = ({
71
71
  [displayedComments, editCommentId, profilesQueries, options]
72
72
  );
73
73
  return /* @__PURE__ */ jsx(CommentContext.Provider, { value: values, children: /* @__PURE__ */ jsxs("div", { className: "my-24", children: [
74
- /* @__PURE__ */ jsx(CommentHeader, { title }),
74
+ /* @__PURE__ */ jsx(Heading, { "data-testid": "comments-info-count-text", level: "h3", headingStyle: "h3", className: displayedComments.length === 0 ? "d-print-none" : "", children: title }),
75
75
  /* @__PURE__ */ jsxs("div", { className: "my-24", children: [
76
76
  user && /* @__PURE__ */ jsx(CommentForm, { userId: user.userId }),
77
- profilesQueries.isLoading ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
77
+ !profilesQueries.isLoading && /* @__PURE__ */ jsxs(Fragment, { children: [
78
78
  /* @__PURE__ */ jsx(CommentList, {}),
79
79
  showMoreComments && /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", onClick: handleMoreComments, className: "my-16", children: t("comment.more") })
80
80
  ] })
81
81
  ] }),
82
- !displayedComments.length && type === "edit" && /* @__PURE__ */ jsxs("div", { className: "comments-emptyscreen", children: [
82
+ !displayedComments.length && type === "edit" && /* @__PURE__ */ jsxs("div", { className: "comments-emptyscreen d-print-none", children: [
83
83
  /* @__PURE__ */ jsx("div", { className: "comments-emptyscreen-wrapper", children: /* @__PURE__ */ jsx(EmptyScreen, { imageSrc: emptyscreenPath, size: 150 }) }),
84
84
  /* @__PURE__ */ jsx("p", { children: t("comment.emptyscreen") })
85
85
  ] })
@@ -71,7 +71,9 @@ interface EditRootProps extends BaseProps {
71
71
  */
72
72
  callbacks: CommentCallbacks;
73
73
  /**
74
- * Rights to perform CRUD on comment
74
+ * Rights to perform CRUD on comment (type=`edit` required):
75
+ * - manager => delete
76
+ * Also, comment's author can update, delete
75
77
  */
76
78
  rights?: Record<RightRole, boolean>;
77
79
  }
@@ -78,7 +78,7 @@ const MathsModal = /* @__PURE__ */ lazy(async () => await import("../MathsModal/
78
78
  /* @__PURE__ */ jsxs("div", { className: borderClass, children: [
79
79
  toolbar !== "none" && editable && /* @__PURE__ */ jsx(EditorToolbar, { mediaLibraryRef: mediaLibraryModalRef, toggleMathsModal, cantooEditor: contooEditor }),
80
80
  /* @__PURE__ */ jsxs(Flex, { direction: "row", children: [
81
- /* @__PURE__ */ jsx(EditorContent, { id: id ?? editorId, editor, className: contentClass, style: {
81
+ /* @__PURE__ */ jsx(EditorContent, { "data-testid": "editor-content", id: id ?? editorId, editor, className: contentClass, style: {
82
82
  flex: 1
83
83
  } }),
84
84
  editable && contooEditor.openPositionAdaptText.right && /* @__PURE__ */ jsx(CantooAdaptTextBoxView, { openPosition: contooEditor.openPositionAdaptText })
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Editor component properties
3
+ */
4
+ export interface EditorPreviewProps {
5
+ /** Rich content to render. */
6
+ content: string;
7
+ /** Display with or without a border */
8
+ variant?: 'outline' | 'ghost';
9
+ onDetailClick?: () => void;
10
+ onMediaClick?: () => void;
11
+ maxMediaDisplayed?: number;
12
+ }
13
+ declare const EditorPreview: ({ content, variant, onDetailClick, onMediaClick, maxMediaDisplayed, }: EditorPreviewProps) => import("react/jsx-runtime").JSX.Element;
14
+ export default EditorPreview;
@@ -0,0 +1,56 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useState, useEffect } from "react";
3
+ import clsx from "clsx";
4
+ import { getThumbnail } from "@edifice.io/utilities";
5
+ import { useTranslation } from "react-i18next";
6
+ import Image from "../../../../components/Image/Image.js";
7
+ const EditorPreview = ({
8
+ content,
9
+ variant = "outline",
10
+ onDetailClick,
11
+ onMediaClick,
12
+ maxMediaDisplayed = 3
13
+ }) => {
14
+ const {
15
+ t
16
+ } = useTranslation(), [summaryContent, setSummaryContent] = useState(""), [medias, setMedias] = useState([]), borderClass = clsx(variant === "outline" && "border rounded-3 py-12 px-16"), hasMediaCallback = onDetailClick || onMediaClick, handleMediaClick = (e) => {
17
+ onMediaClick && (e.stopPropagation(), onMediaClick());
18
+ };
19
+ return useEffect(() => {
20
+ const contentHTML = content;
21
+ if (contentHTML) {
22
+ const doc = new DOMParser().parseFromString(contentHTML, "text/html"), mediaElements = Array.from(doc.querySelectorAll("img, video, iframe, audio, embed"));
23
+ setMedias(mediaElements.filter((el) => el.tagName.toLowerCase() === "img").map((el) => {
24
+ const image = el;
25
+ return image.src ? {
26
+ url: getThumbnail(image.src, 0, 300),
27
+ alt: image.alt
28
+ } : {
29
+ url: "",
30
+ alt: ""
31
+ };
32
+ })), mediaElements.forEach((el) => {
33
+ var _a;
34
+ return (_a = el.parentNode) == null ? void 0 : _a.removeChild(el);
35
+ }), setSummaryContent(doc.body.textContent || "");
36
+ }
37
+ }, [content]), /* @__PURE__ */ jsxs("div", { className: borderClass, "data-testid": "editor-preview", onClick: onDetailClick, tabIndex: onDetailClick ? -1 : void 0, role: onDetailClick ? "button" : void 0, children: [
38
+ /* @__PURE__ */ jsx("div", { className: "flex-fill text-truncate text-truncate-2 post-preview-content overflow-hidden", style: {
39
+ overflowWrap: "anywhere"
40
+ }, children: summaryContent }),
41
+ /* @__PURE__ */ jsx("div", { onClick: handleMediaClick, tabIndex: hasMediaCallback ? -1 : void 0, role: hasMediaCallback ? "button" : void 0, className: "d-flex align-items-center justify-content-center gap-24 px-32 pt-16", children: medias.slice(0, maxMediaDisplayed).map((media, index) => /* @__PURE__ */ jsxs("div", { className: clsx("position-relative col-12 col-md-4 ", {
42
+ "d-none d-md-block": index >= 1
43
+ }), children: [
44
+ /* @__PURE__ */ jsx(Image, { alt: media.alt, objectFit: "cover", ratio: "16", className: "rounded", loading: "lazy", src: media.url, sizes: "" }),
45
+ (index === 0 || index === 2) && medias.length - (index + 1) > 0 && /* @__PURE__ */ jsx("div", { className: clsx("position-absolute top-0 bottom-0 start-0 end-0 d-flex justify-content-center align-items-center rounded text-light bg-dark bg-opacity-50", {
46
+ "d-flex d-md-none": index === 0,
47
+ "d-none d-md-flex": index === 2
48
+ }), children: t("editor.preview.moreMedia", {
49
+ mediaCount: medias.length - (index + 1)
50
+ }) })
51
+ ] }, media.url)) })
52
+ ] });
53
+ };
54
+ export {
55
+ EditorPreview as default
56
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Editor component properties
3
+ */
4
+ export interface EditorPreviewSkeletonProps {
5
+ variant?: 'outline' | 'ghost';
6
+ }
7
+ declare const EditorPreview: ({ variant }: EditorPreviewSkeletonProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default EditorPreview;
@@ -0,0 +1,24 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import clsx from "clsx";
3
+ import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
4
+ import Image from "../../../../components/Image/Image.js";
5
+ const EditorPreview = ({
6
+ variant = "outline"
7
+ }) => {
8
+ const borderClass = clsx(variant === "outline" && "border rounded-3"), contentClass = clsx("mt-16", variant === "outline" && "my-12 mx-16");
9
+ return /* @__PURE__ */ jsx("div", { className: borderClass, "data-testid": "editor-preview", children: /* @__PURE__ */ jsxs("div", { className: contentClass, children: [
10
+ /* @__PURE__ */ jsx(TextSkeleton, { className: "col-12" }),
11
+ /* @__PURE__ */ jsx(TextSkeleton, { className: "col-12" }),
12
+ /* @__PURE__ */ jsxs("div", { className: "d-flex justify-content-center gap-24 px-32 pt-16", children: [
13
+ /* @__PURE__ */ jsx("div", { style: {
14
+ maxWidth: "150px"
15
+ }, className: "col-12 col-md-4", children: /* @__PURE__ */ jsx(Image, { alt: "", objectFit: "cover", ratio: "16", className: "rounded placeholder", src: "", sizes: "" }) }),
16
+ /* @__PURE__ */ jsx("div", { style: {
17
+ maxWidth: "150px"
18
+ }, className: "col-12 col-md-4", children: /* @__PURE__ */ jsx(Image, { alt: "", objectFit: "cover", ratio: "16", className: "rounded placeholder", src: "", sizes: "" }) })
19
+ ] })
20
+ ] }) });
21
+ };
22
+ export {
23
+ EditorPreview as default
24
+ };
@@ -1,3 +1,5 @@
1
1
  export * from './Editor';
2
2
  export { default as Editor } from './Editor';
3
+ export { default as EditorPreview } from './EditorPreview';
4
+ export { default as EditorPreviewSkeleton } from './EditorPreviewSkeleton';
3
5
  export { default as EditorSkeleton } from './EditorSkeleton';
@@ -31,8 +31,8 @@ const AttachmentRenderer = (props) => {
31
31
  }, "data-drag-handle": !0, children: [
32
32
  /* @__PURE__ */ jsx("p", { className: "m-12 mt-0", children: t("tiptap.attachments.bloc") }),
33
33
  /* @__PURE__ */ jsx(Grid, { children: attachmentArrayAttrs == null ? void 0 : attachmentArrayAttrs.map((attachment, index) => /* @__PURE__ */ jsx(Grid.Col, { sm: "6", children: /* @__PURE__ */ jsx(Attachment, { name: attachment.name, options: /* @__PURE__ */ jsxs(Fragment, { children: [
34
- /* @__PURE__ */ jsx("a", { href: attachment.href, download: !0, children: /* @__PURE__ */ jsx(IconButton, { "aria-label": t("tiptap.attachments.download"), color: "tertiary", type: "button", icon: /* @__PURE__ */ jsx(SvgIconDownload, {}), variant: "ghost" }) }),
35
- editable && /* @__PURE__ */ jsx(IconButton, { "aria-label": t("tiptap.attachments.delete"), color: "danger", type: "button", icon: /* @__PURE__ */ jsx(SvgIconDelete, {}), variant: "ghost", onClick: () => handleDelete(index, attachment.documentId) })
34
+ /* @__PURE__ */ jsx("a", { href: attachment.href, "data-document-id": attachment.dataDocumentId, "data-content-type": attachment.dataContentType, download: !0, children: /* @__PURE__ */ jsx(IconButton, { "aria-label": t("tiptap.attachments.download"), color: "tertiary", type: "button", icon: /* @__PURE__ */ jsx(SvgIconDownload, {}), variant: "ghost" }) }),
35
+ editable && /* @__PURE__ */ jsx(IconButton, { "aria-label": t("tiptap.attachments.delete"), color: "danger", type: "button", icon: /* @__PURE__ */ jsx(SvgIconDelete, {}), variant: "ghost", onClick: () => handleDelete(index, attachment.dataDocumentId) })
36
36
  ] }) }) }, index)) })
37
37
  ] }) });
38
38
  };
@@ -5,6 +5,7 @@ const useMediaLibraryEditor = (editor) => {
5
5
  const {
6
6
  remove
7
7
  } = useWorkspaceFile(), appendResult = useCallback((type, result) => {
8
+ var _a;
8
9
  if (!(!type || !editor))
9
10
  switch (type) {
10
11
  case "image": {
@@ -48,7 +49,7 @@ const useMediaLibraryEditor = (editor) => {
48
49
  let innerHtml = "";
49
50
  for (let i = 0; i < result.length; i++) {
50
51
  const link = result[i];
51
- innerHtml += `<a href="/workspace/${link.public ? "pub/" : ""}document/${link._id}">${link.name}
52
+ innerHtml += `<a href="/workspace/${link.public ? "pub/" : ""}document/${link._id}" data-content-type="${(_a = link.metadata) == null ? void 0 : _a["content-type"]}">${link.name}
52
53
  </a>`;
53
54
  }
54
55
  const richContent = `<div class="attachments">
@@ -80,7 +81,7 @@ const useMediaLibraryEditor = (editor) => {
80
81
  };
81
82
  if (Array.isArray(resourceTabResult.resources))
82
83
  resourceTabResult.resources.forEach((link) => {
83
- var _a;
84
+ var _a2;
84
85
  editor.state.selection.empty && insertAndSelectText(link.name), editor == null || editor.commands.setLink({
85
86
  href: link.path,
86
87
  target: resourceTabResult.target ?? null
@@ -89,7 +90,7 @@ const useMediaLibraryEditor = (editor) => {
89
90
  editor.commands.setTextSelection({
90
91
  from: newPosition,
91
92
  to: newPosition
92
- }), resourceTabResult != null && resourceTabResult.resources && ((_a = resourceTabResult == null ? void 0 : resourceTabResult.resources) == null ? void 0 : _a.length) > 1 && editor.commands.enter();
93
+ }), resourceTabResult != null && resourceTabResult.resources && ((_a2 = resourceTabResult == null ? void 0 : resourceTabResult.resources) == null ? void 0 : _a2.length) > 1 && editor.commands.enter();
93
94
  });
94
95
  else {
95
96
  const {
@@ -27,16 +27,16 @@ import { useTranslation } from "react-i18next";
27
27
  import { useEdificeClient } from "../../../providers/EdificeClientProvider/EdificeClientProvider.hook.js";
28
28
  import useUpload from "../../../hooks/useUpload/useUpload.js";
29
29
  import IframeNodeView from "../components/NodeView/IframeNodeView.js";
30
+ import MediaRenderer from "../components/Renderer/MediaRenderer.js";
30
31
  import VideoNodeView from "../components/NodeView/VideoNodeView.js";
31
32
  import AudioNodeView from "../components/NodeView/AudioNodeView.js";
33
+ import AudioRenderer from "../components/Renderer/AudioRenderer.js";
32
34
  import LinkerNodeView from "../components/NodeView/LinkerNodeView.js";
35
+ import LinkerRenderer from "../components/Renderer/LinkerRenderer.js";
33
36
  import ImageNodeView from "../components/NodeView/ImageNodeView.js";
34
37
  import AttachmentNodeView from "../components/NodeView/AttachmentNodeView.js";
35
- import InformationPaneNodeView from "../components/NodeView/InformationPaneNodeView.js";
36
- import MediaRenderer from "../components/Renderer/MediaRenderer.js";
37
- import AudioRenderer from "../components/Renderer/AudioRenderer.js";
38
- import LinkerRenderer from "../components/Renderer/LinkerRenderer.js";
39
38
  import AttachmentRenderer from "../components/Renderer/AttachmentRenderer.js";
39
+ import InformationPaneNodeView from "../components/NodeView/InformationPaneNodeView.js";
40
40
  import InformationPaneRenderer from "../components/Renderer/InformationPaneRenderer.js";
41
41
  const useTipTapEditor = (editable, content, focus, placeholder, onContentChange, visibility = "protected", extensions) => {
42
42
  const {
@@ -0,0 +1,7 @@
1
+ import { SVGProps } from 'react';
2
+ interface SVGRProps {
3
+ title?: string;
4
+ titleId?: string;
5
+ }
6
+ declare const SvgIconClockAlert: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default SvgIconClockAlert;
@@ -0,0 +1,17 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ const SvgIconClockAlert = ({
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__ */ jsxs("g", { fill: "currentColor", clipPath: "url(#icon-clock-alert_svg__a)", children: [
9
+ /* @__PURE__ */ jsx("path", { d: "M0 10.075C0 4.51 4.51 0 10.075 0c4.573 0 8.431 3.046 9.663 7.217a1 1 0 0 1-1.918.566A8.075 8.075 0 1 0 7.783 17.82a1 1 0 0 1-.566 1.918C3.046 18.506 0 14.648 0 10.075" }),
10
+ /* @__PURE__ */ jsx("path", { d: "M10.075 4.108a1 1 0 0 1 1 1v5.43a1 1 0 0 1-.357.767L7.83 13.728a1 1 0 1 1-1.286-1.532l2.53-2.123V5.108a1 1 0 0 1 1-1M17 13.3a1 1 0 0 1 1 1v2.2a1 1 0 1 1-2 0v-2.2a1 1 0 0 1 1-1M17 18.4a1 1 0 1 0 0 2h.006a1 1 0 1 0 0-2z" }),
11
+ /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M17 10a7 7 0 1 0 0 14 7 7 0 0 0 0-14m-5 7a5 5 0 1 1 10 0 5 5 0 0 1-10 0", clipRule: "evenodd" })
12
+ ] }),
13
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "icon-clock-alert_svg__a", children: /* @__PURE__ */ jsx("path", { fill: "#fff", d: "M0 0h24v24H0z" }) }) })
14
+ ] });
15
+ export {
16
+ SvgIconClockAlert as default
17
+ };
@@ -0,0 +1,7 @@
1
+ import { SVGProps } from 'react';
2
+ interface SVGRProps {
3
+ title?: string;
4
+ titleId?: string;
5
+ }
6
+ declare const SvgIconSubmitToValidate: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default SvgIconSubmitToValidate;
@@ -0,0 +1,12 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ const SvgIconSubmitToValidate = ({
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: "M10.844 7.9a1 1 0 0 0-.085 1.41c.366.417.998.463 1.412.1l4.18-3.656a.99.99 0 0 0 .337-.762 1.01 1.01 0 0 0-.363-.757L12.019.632a1 1 0 0 0-1.408.118 1 1 0 0 0 .134 1.41l2.2 1.84h-.939c-5.617-.067-9.838 4.478-9.905 9.887-.05 4.03 2.374 7.51 5.865 9.091a1 1 0 0 0 .825-1.822c-2.815-1.274-4.73-4.058-4.69-7.244C4.156 9.521 7.554 5.945 11.988 6h1.028zm10.785.822a1 1 0 0 1 .148 1.407l-6.875 8.5a1 1 0 0 1-1.572-.022l-3.125-4.09a1 1 0 0 1 1.59-1.215l2.352 3.08 6.076-7.51a1 1 0 0 1 1.406-.15", clipRule: "evenodd" })
9
+ ] });
10
+ export {
11
+ SvgIconSubmitToValidate as default
12
+ };
@@ -24,6 +24,7 @@ export { default as IconCantoo } from './IconCantoo';
24
24
  export { default as IconCenter } from './IconCenter';
25
25
  export { default as IconCheck } from './IconCheck';
26
26
  export { default as IconChecklist } from './IconChecklist';
27
+ export { default as IconClockAlert } from './IconClockAlert';
27
28
  export { default as IconClock } from './IconClock';
28
29
  export { default as IconCloseFullScreen } from './IconCloseFullScreen';
29
30
  export { default as IconClose } from './IconClose';
@@ -134,6 +135,7 @@ export { default as IconSplitCells } from './IconSplitCells';
134
135
  export { default as IconSquareRoot } from './IconSquareRoot';
135
136
  export { default as IconStarFull } from './IconStarFull';
136
137
  export { default as IconStar } from './IconStar';
138
+ export { default as IconSubmitToValidate } from './IconSubmitToValidate';
137
139
  export { default as IconSubscript } from './IconSubscript';
138
140
  export { default as IconSuccessFill } from './IconSuccessFill';
139
141
  export { default as IconSuccessOutline } from './IconSuccessOutline';
@@ -44,7 +44,7 @@ const OnboardingModal = /* @__PURE__ */ forwardRef(({
44
44
  }, handleCloseWithoutPreference = () => {
45
45
  setIsOpen(!1), setSwiperprogress(0);
46
46
  };
47
- return /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs(Modal, { id: "onboarding-modal", size: "md", isOpen, focusId: "nextButtonId", onModalClose: handleCloseWithoutPreference, children: [
47
+ return /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs(Modal, { id: "onboarding-modal", "data-testid": "modal-onboarding", size: "md", isOpen, focusId: "nextButtonId", onModalClose: handleCloseWithoutPreference, children: [
48
48
  /* @__PURE__ */ jsx(Modal.Header, { onModalClose: handleCloseWithoutPreference, centered: !0, children: t(currentTitle || "explorer.modal.onboarding.trash.title") }),
49
49
  /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx(Swiper, { modules: [Pagination], onSwiper: (swiper) => {
50
50
  setSwiperInstance(swiper);
@@ -59,10 +59,10 @@ const OnboardingModal = /* @__PURE__ */ forwardRef(({
59
59
  } })
60
60
  ] }, index)) }) }),
61
61
  /* @__PURE__ */ jsxs(Modal.Footer, { children: [
62
- /* @__PURE__ */ jsx(Button, { type: "button", color: "tertiary", variant: "ghost", onClick: handleCloseWithoutPreference, children: t("explorer.modal.onboarding.trash.later") }),
63
- swiperProgress > 0 && /* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "outline", onClick: () => swiperInstance.slidePrev(), children: t(prevText || "explorer.modal.onboarding.trash.prev") }),
64
- swiperProgress < 1 && /* @__PURE__ */ jsx(Button, { id: "nextButtonId", type: "button", color: "primary", variant: "filled", onClick: () => swiperInstance.slideNext(), children: t(nextText || "explorer.modal.onboarding.trash.next") }),
65
- swiperProgress === 1 && /* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "filled", onClick: () => {
62
+ /* @__PURE__ */ jsx(Button, { "data-testid": "modal-onboarding-later", type: "button", color: "tertiary", variant: "ghost", onClick: handleCloseWithoutPreference, children: t("explorer.modal.onboarding.trash.later") }),
63
+ swiperProgress > 0 && /* @__PURE__ */ jsx(Button, { "data-testid": "modal-onboarding-previous", type: "button", color: "primary", variant: "outline", onClick: () => swiperInstance.slidePrev(), children: t(prevText || "explorer.modal.onboarding.trash.prev") }),
64
+ swiperProgress < 1 && /* @__PURE__ */ jsx(Button, { id: "nextButtonId", "data-testid": "modal-onboarding-next", type: "button", color: "primary", variant: "filled", onClick: () => swiperInstance.slideNext(), children: t(nextText || "explorer.modal.onboarding.trash.next") }),
65
+ swiperProgress === 1 && /* @__PURE__ */ jsx(Button, { "data-testid": "modal-onboarding-close", type: "button", color: "primary", variant: "filled", onClick: () => {
66
66
  isOnboarding ? handleCloseWithPreference() : handleCloseWithoutPreference();
67
67
  }, children: t(closeText || "explorer.modal.onboarding.trash.close") })
68
68
  ] })
@@ -160,6 +160,5 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
160
160
  ] }), document.getElementById("portal"));
161
161
  };
162
162
  export {
163
- ResourceModal,
164
- ResourceModal as default
163
+ ResourceModal
165
164
  };
@@ -4,5 +4,5 @@ export declare const ShareBookmark: ({ bookmark, refBookmark, onBookmarkChange,
4
4
  bookmark: BookmarkProps;
5
5
  refBookmark: Ref<HTMLInputElement>;
6
6
  onBookmarkChange: () => void;
7
- onSave: () => void;
7
+ onSave: () => Promise<void>;
8
8
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
2
3
  import { useTranslation } from "react-i18next";
3
4
  import SvgIconSave from "../../icons/components/IconSave.js";
4
5
  import FormControl from "../../../components/Form/FormControl.js";
@@ -11,10 +12,12 @@ const ShareBookmark = ({
11
12
  }) => {
12
13
  const {
13
14
  t
14
- } = useTranslation();
15
+ } = useTranslation(), [isSaving, setIsSaving] = useState(!1), handleSaveClick = async () => {
16
+ setIsSaving(!0), await onSave(), setIsSaving(!1);
17
+ };
15
18
  return /* @__PURE__ */ jsx("div", { className: "mt-16", children: /* @__PURE__ */ jsxs(FormControl, { id: "bookmarkName", className: "d-flex flex-wrap align-items-center gap-16", children: [
16
- /* @__PURE__ */ jsx("div", { className: "flex-fill", children: /* @__PURE__ */ jsx(FormControl.Input, { ref: refBookmark, onChange: onBookmarkChange, placeholder: t("explorer.modal.share.sharebookmark.placeholder"), size: "sm", type: "text" }, bookmark.id) }),
17
- /* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "ghost", disabled: bookmark.name.length === 0, leftIcon: /* @__PURE__ */ jsx(SvgIconSave, {}), onClick: onSave, className: "text-nowrap", children: t("explorer.modal.share.sharebookmark.save") })
19
+ /* @__PURE__ */ jsx("div", { className: "flex-fill", children: /* @__PURE__ */ jsx(FormControl.Input, { "data-testid": "share-bookmark-name-input", ref: refBookmark, onChange: onBookmarkChange, placeholder: t("explorer.modal.share.sharebookmark.placeholder"), size: "sm", type: "text" }, bookmark.id) }),
20
+ /* @__PURE__ */ jsx(Button, { "data-testid": "share-bookmark-save-button", type: "button", color: "primary", variant: "ghost", disabled: bookmark.name.length === 0 || isSaving, leftIcon: /* @__PURE__ */ jsx(SvgIconSave, {}), onClick: handleSaveClick, className: "text-nowrap", isLoading: isSaving, children: t("explorer.modal.share.sharebookmark.save") })
18
21
  ] }) });
19
22
  };
20
23
  export {
@@ -4,10 +4,10 @@ import SvgIconBookmark from "../../icons/components/IconBookmark.js";
4
4
  import SvgIconClose from "../../icons/components/IconClose.js";
5
5
  import SvgIconRafterDown from "../../icons/components/IconRafterDown.js";
6
6
  import SvgIconUsers from "../../icons/components/IconUsers.js";
7
- import { hasRight } from "./utils/hasRight.js";
8
- import { showShareRightLine } from "./utils/showShareRightLine.js";
9
7
  import { useShareRightDisabled } from "./hooks/useShareRightDisabled.js";
10
8
  import { useShareRightVisible } from "./hooks/useShareRightVisible.js";
9
+ import { hasRight } from "./utils/hasRight.js";
10
+ import { showShareRightLine } from "./utils/showShareRightLine.js";
11
11
  import Avatar from "../../../components/Avatar/Avatar.js";
12
12
  import Button from "../../../components/Button/Button.js";
13
13
  import Checkbox from "../../../components/Checkbox/Checkbox.js";
@@ -45,8 +45,8 @@ const ShareBookmarkLine = ({
45
45
  ] }) }),
46
46
  shareRightActions.map((shareRightAction) => /* @__PURE__ */ jsx("td", { style: {
47
47
  width: "80px"
48
- }, className: "text-center text-white", children: /* @__PURE__ */ jsx(Checkbox, { checked: hasRight(shareRight, shareRightAction), onChange: () => toggleRight(shareRight, shareRightAction.id), disabled: isDisabled }) }, shareRightAction.displayName)),
49
- /* @__PURE__ */ jsx("td", { children: !shareRight.isBookmarkMember && !isDisabled && /* @__PURE__ */ jsx(IconButton, { "aria-label": t("close"), color: "tertiary", icon: /* @__PURE__ */ jsx(SvgIconClose, {}), type: "button", variant: "ghost", title: t("close"), onClick: () => onDeleteRow(shareRight) }) })
48
+ }, className: "text-center text-white", children: /* @__PURE__ */ jsx(Checkbox, { checked: hasRight(shareRight, shareRightAction), onChange: () => toggleRight(shareRight, shareRightAction.id), disabled: isDisabled, "data-testid": `share-right-${shareRightAction.id}-checkbox` }) }, shareRightAction.displayName)),
49
+ /* @__PURE__ */ jsx("td", { children: !shareRight.isBookmarkMember && !isDisabled && /* @__PURE__ */ jsx(IconButton, { "data-testid": "share-right-close-button", "aria-label": t("close"), color: "tertiary", icon: /* @__PURE__ */ jsx(SvgIconClose, {}), type: "button", variant: "ghost", title: t("close"), onClick: () => onDeleteRow(shareRight) }) })
50
50
  ] }, shareRight.id) : null;
51
51
  });
52
52
  };
@@ -1,15 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { ID, PutShareResponse, RightStringified, ShareRight } from '@edifice.io/client';
3
- import { UseMutationResult } from '../../../node_modules/@tanstack/react-query';
4
- export type ShareOptions = {
5
- resourceId: ID;
6
- resourceRights: RightStringified[];
7
- resourceCreatorId: string;
8
- };
9
- export type ShareResourceMutation = UseMutationResult<PutShareResponse, unknown, {
10
- resourceId: string;
11
- rights: ShareRight[];
12
- }, unknown>;
2
+ import { ShareOptions, ShareResourceMutation } from './ShareResources';
13
3
  interface ShareResourceModalProps {
14
4
  /** Handle open/close state */
15
5
  isOpen: boolean;