@edifice.io/react 2.2.11 → 2.2.12-develop.20250710143448

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.
@@ -19,7 +19,7 @@ const Button = /* @__PURE__ */ forwardRef(({
19
19
  const classes = clsx("btn", {
20
20
  [`btn-filled btn-${color}`]: variant === "filled",
21
21
  [`btn-${variant}-${color}`]: variant === "outline" || variant === "ghost",
22
- "btn-icon btn-sm": !children,
22
+ "btn-icon": !children,
23
23
  "btn-loading": isLoading,
24
24
  "btn-lg": size === "lg",
25
25
  "btn-sm": size === "sm",
@@ -9,7 +9,8 @@ const IconButton = /* @__PURE__ */ forwardRef(({
9
9
  }, ref) => {
10
10
  const buttonProps = {
11
11
  ...restProps,
12
- className: clsx("btn-icon btn-sm", className)
12
+ className: clsx("btn-icon", className),
13
+ size: restProps.size || "sm"
13
14
  };
14
15
  return /* @__PURE__ */ jsx(Button, { ref, ...buttonProps, leftIcon: icon });
15
16
  });
@@ -66,7 +66,7 @@ const Toolbar = /* @__PURE__ */ forwardRef(({
66
66
  case "divider":
67
67
  return /* @__PURE__ */ jsx("div", { className: "toolbar-divider" }, item.name ?? index);
68
68
  case "button":
69
- return /* @__PURE__ */ jsx(Tooltip, { message: hideLabel ? renderTooltipMessage(item) : void 0, placement: renderTooltipPosition(item), children: /* @__PURE__ */ createElement(Button, { ...item.props, children: !hideLabel && item.props.children, "aria-label": item.name, key: item.name ?? index, color: item.props.color || "tertiary", variant: "ghost", tabIndex: index === firstFocusableItemIndex ? 0 : -1, onKeyDown: handleKeyDown }) }, item.name ?? index);
69
+ return /* @__PURE__ */ jsx(Tooltip, { message: hideLabel ? renderTooltipMessage(item) : void 0, placement: renderTooltipPosition(item), children: /* @__PURE__ */ createElement(Button, { ...item.props, children: !hideLabel && item.props.children, "aria-label": item.name, key: item.name ?? index, color: item.props.color || "tertiary", variant: "ghost", size: item.props.size || hideLabel ? "sm" : "md", tabIndex: index === firstFocusableItemIndex ? 0 : -1, onKeyDown: handleKeyDown }) }, item.name ?? index);
70
70
  case "icon":
71
71
  return /* @__PURE__ */ jsx(Tooltip, { message: renderTooltipMessage(item), placement: renderTooltipPosition(item), children: /* @__PURE__ */ createElement(IconButton, { ...item.props, key: item.name ?? index, color: item.props.color ? item.props.color : "tertiary", variant: item.props.variant ? item.props.variant : "ghost", tabIndex: index === firstFocusableItemIndex ? 0 : -1, onKeyDown: handleKeyDown }) }, item.name ?? index);
72
72
  case "dropdown":
@@ -1,6 +1,6 @@
1
1
  import { ID } from '@edifice.io/client';
2
2
  declare const useDirectory: () => {
3
- getAvatarURL: (userId: ID, type: "user" | "group") => string;
3
+ getAvatarURL: (userId: ID, type: "user" | "group") => string | undefined;
4
4
  getUserbookURL: (userId: ID, type: "user" | "group") => string;
5
5
  };
6
6
  export default useDirectory;
@@ -1,7 +1,8 @@
1
1
  import { odeServices } from "@edifice.io/client";
2
2
  const useDirectory = () => {
3
3
  function getAvatarURL(userId, type) {
4
- return odeServices.directory().getAvatarUrl(userId, type);
4
+ if (userId !== "")
5
+ return odeServices.directory().getAvatarUrl(userId, type);
5
6
  }
6
7
  function getUserbookURL(userId, type) {
7
8
  return odeServices.directory().getDirectoryUrl(userId, type);
@@ -35,7 +35,12 @@ const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !
35
35
  visible && menuRef.current && focusOnVisible ? (menuRef.current.focus(), setActiveIndex(0)) : (setActiveIndex(-1), itemRefs.current = {});
36
36
  }, [visible]), useEffect(() => {
37
37
  if (activeIndex !== -1) {
38
- const currentItem = Object.values(itemRefs.current)[activeIndex];
38
+ const filteredItems = Object.values(itemRefs.current).filter((item) => !!item);
39
+ if (activeIndex < 0 || activeIndex >= filteredItems.length) {
40
+ setActiveIndex(-1), setIsFocused(null);
41
+ return;
42
+ }
43
+ const currentItem = filteredItems[activeIndex];
39
44
  if (currentItem) {
40
45
  const id2 = currentItem.getAttribute("id");
41
46
  setIsFocused(id2), currentItem.focus();
@@ -11,7 +11,8 @@ const useUploadFiles = ({
11
11
  const [uploadedFiles, setUploadedFiles] = useState([]), [editingImage, setEditingImage] = useState(void 0), {
12
12
  files,
13
13
  deleteFile,
14
- replaceFileAt
14
+ replaceFileAt,
15
+ inputRef
15
16
  } = useDropzoneContext(), {
16
17
  remove,
17
18
  createOrUpdate
@@ -21,18 +22,19 @@ const useUploadFiles = ({
21
22
  clearUploadStatus,
22
23
  uploadFile,
23
24
  uploadAlternateFile
24
- } = useUpload(visibility, application), tryUploading = useCallback((files2) => {
25
+ } = useUpload(visibility, application), resetInputValue = useCallback(() => {
26
+ inputRef.current && (inputRef.current.value = "");
27
+ }, [inputRef]), tryUploading = useCallback((files2) => {
25
28
  files2.forEach(async (file, index) => {
26
29
  if (file == null) return;
27
- let resource;
30
+ let resource, replacement;
28
31
  if (file.type.startsWith("image"))
29
32
  try {
30
- const replacement = await ImageResizer.resizeImageFile(file);
31
- resource = await uploadAlternateFile(file, replacement), replaceFileAt(index, replacement);
33
+ replacement = await ImageResizer.resizeImageFile(file), resource = await uploadAlternateFile(file, replacement), replaceFileAt(index, replacement);
32
34
  } catch (err) {
33
35
  console.error(err);
34
36
  }
35
- resource || (resource = await uploadFile(file)), resource && setUploadedFiles((prevFiles) => [...prevFiles, resource]);
37
+ !resource && !replacement && (resource = await uploadFile(file)), resource ? setUploadedFiles((prevFiles) => [...prevFiles, resource]) : resetInputValue();
36
38
  });
37
39
  }, [uploadAlternateFile, uploadFile, replaceFileAt]);
38
40
  useEffect(() => {
@@ -53,7 +55,7 @@ const useUploadFiles = ({
53
55
  };
54
56
  async function removeFile(file) {
55
57
  const resource = uploadedFiles.find((uploadedFile) => uploadedFile.name === file.name);
56
- resource && (await remove(resource), clearUploadStatus(file), setUploadedFiles((prevFiles) => prevFiles.filter((prevFile) => prevFile.name !== (resource == null ? void 0 : resource.name)))), deleteFile(file);
58
+ resource && (await remove(resource), clearUploadStatus(file), setUploadedFiles((prevFiles) => prevFiles.filter((prevFile) => prevFile.name !== (resource == null ? void 0 : resource.name)))), deleteFile(file), resetInputValue();
57
59
  }
58
60
  async function updateImage({
59
61
  blob,
@@ -60,7 +60,8 @@ function useZendeskGuide() {
60
60
  messageButton: {
61
61
  "*": "Assistance ENT",
62
62
  "es-419": "Asistencia ENT"
63
- }
63
+ },
64
+ originalArticleButton: zendeskGuideConfig.articleRedirectButton ?? !0
64
65
  }
65
66
  }
66
67
  }), window.addEventListener("scroll", () => {
@@ -23,7 +23,7 @@ const BubbleMenuEditInformationPane = ({
23
23
  name: "info",
24
24
  props: {
25
25
  size: "lg",
26
- leftIcon: /* @__PURE__ */ jsx(SvgIconInfoCircle, {}),
26
+ icon: /* @__PURE__ */ jsx(SvgIconInfoCircle, {}),
27
27
  "aria-label": t("tiptap.tooltip.bubblemenu.information.pane.info"),
28
28
  className: ((_a = selectedNode == null ? void 0 : selectedNode.attrs) == null ? void 0 : _a.type) === "info" ? "is-selected" : "",
29
29
  onClick: () => editor.chain().focus().updateAttributes("information-pane", {
@@ -39,7 +39,7 @@ const BubbleMenuEditInformationPane = ({
39
39
  name: "success",
40
40
  props: {
41
41
  size: "lg",
42
- leftIcon: /* @__PURE__ */ jsx(SvgIconSuccessOutline, {}),
42
+ icon: /* @__PURE__ */ jsx(SvgIconSuccessOutline, {}),
43
43
  "aria-label": t("tiptap.tooltip.bubblemenu.information.pane.success"),
44
44
  className: ((_b = selectedNode == null ? void 0 : selectedNode.attrs) == null ? void 0 : _b.type) === "success" ? "is-selected" : "",
45
45
  onClick: () => editor.chain().focus().updateAttributes("information-pane", {
@@ -55,7 +55,7 @@ const BubbleMenuEditInformationPane = ({
55
55
  name: "warning",
56
56
  props: {
57
57
  size: "lg",
58
- leftIcon: /* @__PURE__ */ jsx(SvgIconAlertTriangle, {}),
58
+ icon: /* @__PURE__ */ jsx(SvgIconAlertTriangle, {}),
59
59
  "aria-label": t("tiptap.tooltip.bubblemenu.information.pane.warning"),
60
60
  className: ((_c = selectedNode == null ? void 0 : selectedNode.attrs) == null ? void 0 : _c.type) === "warning" ? "is-selected" : "",
61
61
  onClick: () => editor.chain().focus().updateAttributes("information-pane", {
@@ -71,7 +71,7 @@ const BubbleMenuEditInformationPane = ({
71
71
  name: "question",
72
72
  props: {
73
73
  size: "lg",
74
- leftIcon: /* @__PURE__ */ jsx(SvgIconQuestion, {}),
74
+ icon: /* @__PURE__ */ jsx(SvgIconQuestion, {}),
75
75
  "aria-label": t("tiptap.tooltip.bubblemenu.information.pane.question"),
76
76
  className: ((_d = selectedNode == null ? void 0 : selectedNode.attrs) == null ? void 0 : _d.type) === "question" ? "is-selected" : "",
77
77
  onClick: () => editor.chain().focus().updateAttributes("information-pane", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.2.11",
3
+ "version": "2.2.12-develop.20250710143448",
4
4
  "description": "Edifice React Library",
5
5
  "keywords": [
6
6
  "react",
@@ -130,9 +130,9 @@
130
130
  "react-slugify": "^3.0.3",
131
131
  "swiper": "^10.1.0",
132
132
  "ua-parser-js": "^1.0.36",
133
- "@edifice.io/bootstrap": "2.2.11",
134
- "@edifice.io/tiptap-extensions": "2.2.11",
135
- "@edifice.io/utilities": "2.2.11"
133
+ "@edifice.io/tiptap-extensions": "2.2.12-develop.20250710143448",
134
+ "@edifice.io/utilities": "2.2.12-develop.20250710143448",
135
+ "@edifice.io/bootstrap": "2.2.12-develop.20250710143448"
136
136
  },
137
137
  "devDependencies": {
138
138
  "@babel/plugin-transform-react-pure-annotations": "^7.23.3",
@@ -163,8 +163,8 @@
163
163
  "vite": "^5.4.11",
164
164
  "vite-plugin-dts": "^4.1.0",
165
165
  "vite-tsconfig-paths": "^5.0.1",
166
- "@edifice.io/client": "2.2.11",
167
- "@edifice.io/config": "2.2.11"
166
+ "@edifice.io/client": "2.2.12-develop.20250710143448",
167
+ "@edifice.io/config": "2.2.12-develop.20250710143448"
168
168
  },
169
169
  "peerDependencies": {
170
170
  "@react-spring/web": "^9.7.5",