@edifice.io/react 2.0.0-develop-b2school.20250106162136 → 2.0.0-develop-pedago.20250107165218

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.
@@ -12,11 +12,12 @@ const AttachmentRenderer = (props) => {
12
12
  const {
13
13
  t
14
14
  } = useTranslation(), {
15
- node
15
+ node,
16
+ editor
16
17
  } = props, {
17
18
  editable
18
- } = useEditorContext(), [attachmentArrayAttrs, setAttachmentArrayAttrs] = useState(node.attrs.links), handleDelete = (index) => {
19
- setAttachmentArrayAttrs((oldAttachments) => oldAttachments.filter((_, i) => i !== index));
19
+ } = useEditorContext(), [attachmentArrayAttrs, setAttachmentArrayAttrs] = useState(node.attrs.links), handleDelete = (index, documentId) => {
20
+ editor.commands.unsetAttachment(documentId), setAttachmentArrayAttrs((oldAttachments) => oldAttachments.filter((_, i) => i !== index));
20
21
  };
21
22
  return attachmentArrayAttrs.length !== 0 && /* @__PURE__ */ jsx(NodeViewWrapper, { children: /* @__PURE__ */ jsxs("div", { style: {
22
23
  backgroundColor: "#F2F2F2",
@@ -26,7 +27,7 @@ const AttachmentRenderer = (props) => {
26
27
  /* @__PURE__ */ jsx("p", { className: "m-12 mt-0", children: t("tiptap.attachments.bloc") }),
27
28
  /* @__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: [
28
29
  /* @__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" }) }),
29
- editable && /* @__PURE__ */ jsx(IconButton, { "aria-label": t("tiptap.attachments.delete"), color: "danger", type: "button", icon: /* @__PURE__ */ jsx(SvgIconDelete, {}), variant: "ghost", onClick: () => handleDelete(index) })
30
+ 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) })
30
31
  ] }) }) }, index)) })
31
32
  ] }) });
32
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.0.0-develop-b2school.20250106162136",
3
+ "version": "2.0.0-develop-pedago.20250107165218",
4
4
  "description": "Edifice React Library",
5
5
  "keywords": [
6
6
  "react",
@@ -119,9 +119,9 @@
119
119
  "react-slugify": "^3.0.3",
120
120
  "swiper": "^10.1.0",
121
121
  "ua-parser-js": "^1.0.36",
122
- "@edifice.io/bootstrap": "2.0.0-develop-b2school.20250106162136",
123
- "@edifice.io/tiptap-extensions": "2.0.0-develop-b2school.20250106162136",
124
- "@edifice.io/utilities": "2.0.0-develop-b2school.20250106162136"
122
+ "@edifice.io/bootstrap": "2.0.0-develop-pedago.20250107165218",
123
+ "@edifice.io/tiptap-extensions": "2.0.0-develop-pedago.20250107165218",
124
+ "@edifice.io/utilities": "2.0.0-develop-pedago.20250107165218"
125
125
  },
126
126
  "devDependencies": {
127
127
  "@babel/plugin-transform-react-pure-annotations": "^7.23.3",
@@ -147,7 +147,7 @@
147
147
  "typescript-eslint": "^8.8.1",
148
148
  "vite": "^5.4.11",
149
149
  "vite-plugin-dts": "^4.1.0",
150
- "@edifice.io/client": "2.0.0-develop-b2school.20250106162136"
150
+ "@edifice.io/client": "2.0.0-develop-pedago.20250107165218"
151
151
  },
152
152
  "peerDependencies": {
153
153
  "@react-spring/web": "^9.7.5",