@edifice.io/react 2.2.10-develop-b2school.20250625143621 → 2.2.10-develop-b2school.20250702140459
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.
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/IconButton.js +2 -1
- package/dist/components/Toolbar/Toolbar.js +1 -1
- package/dist/hooks/useDropdown/useDropdown.js +6 -1
- package/dist/modules/editor/components/BubbleMenuEditInformationPane/BubbleMenuEditInformationPane.js +4 -4
- package/package.json +6 -6
|
@@ -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
|
|
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
|
|
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":
|
|
@@ -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
|
|
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();
|
|
@@ -23,7 +23,7 @@ const BubbleMenuEditInformationPane = ({
|
|
|
23
23
|
name: "info",
|
|
24
24
|
props: {
|
|
25
25
|
size: "lg",
|
|
26
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.10-develop-b2school.
|
|
3
|
+
"version": "2.2.10-develop-b2school.20250702140459",
|
|
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.10-develop-b2school.
|
|
134
|
-
"@edifice.io/tiptap-extensions": "2.2.10-develop-b2school.
|
|
135
|
-
"@edifice.io/utilities": "2.2.10-develop-b2school.
|
|
133
|
+
"@edifice.io/bootstrap": "2.2.10-develop-b2school.20250702140459",
|
|
134
|
+
"@edifice.io/tiptap-extensions": "2.2.10-develop-b2school.20250702140459",
|
|
135
|
+
"@edifice.io/utilities": "2.2.10-develop-b2school.20250702140459"
|
|
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.10-develop-b2school.
|
|
167
|
-
"@edifice.io/config": "2.2.10-develop-b2school.
|
|
166
|
+
"@edifice.io/client": "2.2.10-develop-b2school.20250702140459",
|
|
167
|
+
"@edifice.io/config": "2.2.10-develop-b2school.20250702140459"
|
|
168
168
|
},
|
|
169
169
|
"peerDependencies": {
|
|
170
170
|
"@react-spring/web": "^9.7.5",
|