@edifice.io/react 2.2.2 → 2.2.3
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/Avatar/Avatar.d.ts +21 -0
- package/dist/components/Avatar/Avatar.js +15 -2
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +24 -0
- package/dist/components/AvatarGroup/AvatarGroup.js +24 -0
- package/dist/components/AvatarGroup/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +3 -1
- package/dist/components/Card/CardBody.d.ts +3 -1
- package/dist/components/Card/CardBody.js +4 -2
- package/dist/components/Dropdown/Dropdown.d.ts +6 -2
- package/dist/components/Dropdown/Dropdown.js +2 -0
- package/dist/components/Dropdown/DropdownItem.d.ts +5 -1
- package/dist/components/Dropdown/DropdownItem.js +7 -2
- package/dist/components/Dropdown/DropdownTrigger.d.ts +31 -2
- package/dist/components/Dropdown/DropdownTrigger.js +23 -3
- package/dist/components/PreventPropagation/PreventPropagation.d.ts +10 -0
- package/dist/components/PreventPropagation/PreventPropagation.js +9 -0
- package/dist/components/PreventPropagation/index.d.ts +2 -0
- package/dist/components/StackedGroup/StackedGroup.d.ts +23 -0
- package/dist/components/StackedGroup/StackedGroup.js +21 -0
- package/dist/components/StackedGroup/index.d.ts +1 -0
- package/dist/components/Switch/Switch.d.ts +29 -0
- package/dist/components/Switch/Switch.js +27 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/editor.js +16 -12
- package/dist/hooks/useConf/useConf.d.ts +1 -1
- package/dist/hooks/useSession/useSession.d.ts +1 -1
- package/dist/icons.js +178 -176
- package/dist/index.js +154 -146
- package/dist/modules/comments/components/Comment.js +49 -34
- package/dist/modules/comments/components/CommentDeleted.d.ts +1 -0
- package/dist/modules/comments/components/CommentDeleted.js +11 -0
- package/dist/modules/comments/components/CommentForm.d.ts +2 -1
- package/dist/modules/comments/components/CommentForm.js +12 -8
- package/dist/modules/comments/components/CommentList.js +3 -3
- package/dist/modules/comments/components/CommentReplies.d.ts +4 -0
- package/dist/modules/comments/components/CommentReplies.js +33 -0
- package/dist/modules/comments/constants.d.ts +4 -0
- package/dist/modules/comments/constants.js +2 -1
- package/dist/modules/comments/context/Context.d.ts +6 -4
- package/dist/modules/comments/hooks/useCommentReplies.d.ts +12 -0
- package/dist/modules/comments/hooks/useCommentReplies.js +36 -0
- package/dist/modules/comments/hooks/useComments.d.ts +7 -7
- package/dist/modules/comments/hooks/useComments.js +24 -19
- package/dist/modules/comments/hooks/useCommentsContext.d.ts +6 -4
- package/dist/modules/comments/provider/CommentProvider.js +16 -13
- package/dist/modules/comments/types.d.ts +14 -1
- package/dist/modules/editor/components/BubbleMenuEditInformationPane/BubbleMenuEditInformationPane.d.ts +6 -0
- package/dist/modules/editor/components/BubbleMenuEditInformationPane/BubbleMenuEditInformationPane.js +136 -0
- package/dist/modules/editor/components/BubbleMenuEditInformationPane/index.d.ts +1 -0
- package/dist/modules/editor/components/Editor/Editor.js +6 -2
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +12 -0
- package/dist/modules/editor/components/NodeView/InformationPaneNodeView.d.ts +2 -0
- package/dist/modules/editor/components/NodeView/InformationPaneNodeView.js +10 -0
- package/dist/modules/editor/components/NodeView/index.d.ts +1 -0
- package/dist/modules/editor/components/Renderer/InformationPaneRenderer.d.ts +3 -0
- package/dist/modules/editor/components/Renderer/InformationPaneRenderer.js +33 -0
- package/dist/modules/editor/components/Renderer/index.d.ts +1 -0
- package/dist/modules/editor/hooks/useTipTapEditor.js +3 -1
- package/dist/modules/icons/components/IconInfoRectangle.d.ts +7 -0
- package/dist/modules/icons/components/IconInfoRectangle.js +13 -0
- package/dist/modules/icons/components/index.d.ts +1 -0
- package/dist/modules/modals/ResourceModal/ResourceModal.d.ts +1 -1
- package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.d.ts +1 -1
- package/dist/modules/modals/ShareModal/ShareModal.d.ts +1 -1
- package/dist/modules/modals/ShareModal/apps/ShareBlog.d.ts +1 -1
- package/dist/modules/modals/ShareModal/hooks/useShareMutation.d.ts +1 -1
- package/dist/providers/EdificeClientProvider/EdificeClientProvider.context.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +6 -6
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Color } from 'src/types/color';
|
|
1
2
|
export type AvatarVariants = 'square' | 'rounded' | 'circle';
|
|
2
3
|
export type AvatarSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
4
|
export interface AvatarProps extends React.ComponentPropsWithRef<'img'> {
|
|
@@ -26,6 +27,26 @@ export interface AvatarProps extends React.ComponentPropsWithRef<'img'> {
|
|
|
26
27
|
* Optional class for styling purpose
|
|
27
28
|
*/
|
|
28
29
|
className?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Inner border color
|
|
32
|
+
*/
|
|
33
|
+
innerBorderColor?: Color;
|
|
34
|
+
/**
|
|
35
|
+
* Inner border width in pixels
|
|
36
|
+
*/
|
|
37
|
+
innerBorderWidth?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Outer border color
|
|
40
|
+
*/
|
|
41
|
+
outerBorderColor?: Color;
|
|
42
|
+
/**
|
|
43
|
+
* Outer border width in pixels
|
|
44
|
+
*/
|
|
45
|
+
outerBorderWidth?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Outer border offset in pixels
|
|
48
|
+
*/
|
|
49
|
+
outerBorderOffset?: number;
|
|
29
50
|
}
|
|
30
51
|
declare const Avatar: import('react').ForwardRefExoticComponent<Omit<AvatarProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
31
52
|
export default Avatar;
|
|
@@ -10,6 +10,11 @@ const Avatar = /* @__PURE__ */ forwardRef(({
|
|
|
10
10
|
src,
|
|
11
11
|
imgPlaceholder,
|
|
12
12
|
className,
|
|
13
|
+
innerBorderColor,
|
|
14
|
+
innerBorderWidth,
|
|
15
|
+
outerBorderColor,
|
|
16
|
+
outerBorderWidth,
|
|
17
|
+
outerBorderOffset,
|
|
13
18
|
...restProps
|
|
14
19
|
}, ref) => {
|
|
15
20
|
const placeholder = imgPlaceholder || noAvatar, classes = clsx("avatar", {
|
|
@@ -25,8 +30,16 @@ const Avatar = /* @__PURE__ */ forwardRef(({
|
|
|
25
30
|
rounded: variant === "rounded",
|
|
26
31
|
"rounded-circle": variant === "circle"
|
|
27
32
|
}
|
|
28
|
-
}, className)
|
|
29
|
-
|
|
33
|
+
}, className), style = {
|
|
34
|
+
...outerBorderColor && {
|
|
35
|
+
outline: `${outerBorderWidth}px solid var(--edifice-${outerBorderColor})`,
|
|
36
|
+
outlineOffset: outerBorderOffset
|
|
37
|
+
},
|
|
38
|
+
...innerBorderColor && {
|
|
39
|
+
border: `${innerBorderWidth}px solid var(--edifice-${innerBorderColor})`
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ jsx("div", { ref, className: classes, style, children: /* @__PURE__ */ jsx(Image, { src: src || placeholder, alt, imgPlaceholder: placeholder, ...restProps }) });
|
|
30
43
|
});
|
|
31
44
|
export {
|
|
32
45
|
Avatar as default
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AvatarProps } from '../Avatar';
|
|
2
|
+
export interface AvatarGroupProps extends Omit<AvatarProps, 'src'> {
|
|
3
|
+
/**
|
|
4
|
+
* List of avatar sources
|
|
5
|
+
*/
|
|
6
|
+
src: string[];
|
|
7
|
+
/**
|
|
8
|
+
* Maximum number of avatars to display
|
|
9
|
+
* @default 3
|
|
10
|
+
*/
|
|
11
|
+
maxAvatars?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Overlap between avatars (in pixels)
|
|
14
|
+
* @default 20
|
|
15
|
+
*/
|
|
16
|
+
overlap?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Controls stacking order. When 'rightFirst', rightmost avatar has highest z-index
|
|
19
|
+
* @default 'leftFirst'
|
|
20
|
+
*/
|
|
21
|
+
stackingOrder?: 'leftFirst' | 'rightFirst';
|
|
22
|
+
}
|
|
23
|
+
declare const AvatarGroup: import('react').ForwardRefExoticComponent<Omit<AvatarGroupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
24
|
+
export default AvatarGroup;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import StackedGroup from "../StackedGroup/StackedGroup.js";
|
|
5
|
+
import Avatar from "../Avatar/Avatar.js";
|
|
6
|
+
const AvatarGroup = /* @__PURE__ */ forwardRef(({
|
|
7
|
+
src,
|
|
8
|
+
maxAvatars = 3,
|
|
9
|
+
overlap = 20,
|
|
10
|
+
className,
|
|
11
|
+
size = "md",
|
|
12
|
+
variant = "circle",
|
|
13
|
+
alt,
|
|
14
|
+
stackingOrder = "leftFirst",
|
|
15
|
+
...restProps
|
|
16
|
+
}, ref) => {
|
|
17
|
+
const visibleAvatars = src.slice(0, maxAvatars), classes = clsx("avatar-group", className);
|
|
18
|
+
return /* @__PURE__ */ jsx("div", { ref, className: classes, style: {
|
|
19
|
+
display: "flex"
|
|
20
|
+
}, children: /* @__PURE__ */ jsx(StackedGroup, { overlap, stackingOrder, children: visibleAvatars.map((avatarSrc, index) => /* @__PURE__ */ jsx(Avatar, { src: avatarSrc, size, variant, alt: `${alt} ${index + 1}`, ...restProps })) }) });
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
AvatarGroup as default
|
|
24
|
+
};
|
|
@@ -59,8 +59,10 @@ declare const Card: import('react').ForwardRefExoticComponent<CardProps & import
|
|
|
59
59
|
displayName: string;
|
|
60
60
|
};
|
|
61
61
|
Body: {
|
|
62
|
-
({ children, space, flexDirection, }: {
|
|
62
|
+
({ children, gap, space, padding, flexDirection, }: {
|
|
63
|
+
gap?: "0" | "8" | "16" | null;
|
|
63
64
|
space?: "0" | "8" | "16" | null;
|
|
65
|
+
padding?: "0" | "8" | "16" | null;
|
|
64
66
|
flexDirection?: "row" | "column" | null;
|
|
65
67
|
children: ReactNode;
|
|
66
68
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
declare const CardBody: {
|
|
3
|
-
({ children, space, flexDirection, }: {
|
|
3
|
+
({ children, gap, space, padding, flexDirection, }: {
|
|
4
|
+
gap?: "0" | "8" | "16" | null;
|
|
4
5
|
space?: "0" | "8" | "16" | null;
|
|
6
|
+
padding?: "0" | "8" | "16" | null;
|
|
5
7
|
flexDirection?: "row" | "column" | null;
|
|
6
8
|
children: ReactNode;
|
|
7
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,12 +2,14 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
const CardBody = ({
|
|
4
4
|
children,
|
|
5
|
+
gap = null,
|
|
5
6
|
space = null,
|
|
7
|
+
padding = null,
|
|
6
8
|
flexDirection = "row"
|
|
7
9
|
}) => {
|
|
8
10
|
const cardbody = clsx("card-body", {
|
|
9
|
-
[`p-${space}`]: space,
|
|
10
|
-
[`gap-${space}`]: space,
|
|
11
|
+
[`p-${padding ?? space}`]: space,
|
|
12
|
+
[`gap-${gap ?? space}`]: space,
|
|
11
13
|
"align-items-start": flexDirection === "column",
|
|
12
14
|
"flex-column": flexDirection === "column"
|
|
13
15
|
});
|
|
@@ -14,6 +14,10 @@ export interface DropdownProps {
|
|
|
14
14
|
* Default placement with FloatingUI
|
|
15
15
|
*/
|
|
16
16
|
placement?: Placement;
|
|
17
|
+
/**
|
|
18
|
+
* If true, the text will not wrap
|
|
19
|
+
*/
|
|
20
|
+
noWrap?: boolean;
|
|
17
21
|
/**
|
|
18
22
|
* Extra keydown handler for the Dropdown Trigger.
|
|
19
23
|
* Useful for a11y keyboard navigation between a Dropdown element and other elements,
|
|
@@ -53,13 +57,13 @@ export type DropdownMenuOptions = {
|
|
|
53
57
|
type: 'divider';
|
|
54
58
|
};
|
|
55
59
|
declare const Dropdown: {
|
|
56
|
-
({ children, block, overflow, placement, extraTriggerKeyDownHandler, onToggle, isTriggerHovered, }: DropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
({ children, block, overflow, noWrap, placement, extraTriggerKeyDownHandler, onToggle, isTriggerHovered, }: DropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
57
61
|
displayName: string;
|
|
58
62
|
} & {
|
|
59
63
|
Trigger: import('react').ForwardRefExoticComponent<Omit<import('./DropdownTrigger').DropdownTriggerProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
60
64
|
Menu: import('react').ForwardRefExoticComponent<Omit<import('./DropdownMenu').DropdownMenuProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
61
65
|
Item: {
|
|
62
|
-
({ type, icon, onClick, children, className, ...restProps }: import('./DropdownItem').DropdownItemProps): import("react/jsx-runtime").JSX.Element;
|
|
66
|
+
({ type, icon, onClick, children, className, minWidth, ...restProps }: import('./DropdownItem').DropdownItemProps): import("react/jsx-runtime").JSX.Element;
|
|
63
67
|
displayName: string;
|
|
64
68
|
};
|
|
65
69
|
Separator: {
|
|
@@ -15,6 +15,7 @@ const Root = ({
|
|
|
15
15
|
children,
|
|
16
16
|
block,
|
|
17
17
|
overflow = !0,
|
|
18
|
+
noWrap,
|
|
18
19
|
placement = "bottom-start",
|
|
19
20
|
extraTriggerKeyDownHandler,
|
|
20
21
|
onToggle,
|
|
@@ -41,6 +42,7 @@ const Root = ({
|
|
|
41
42
|
setVisible
|
|
42
43
|
}), [visible, isFocused, triggerProps, menuProps, itemProps, itemRefs, block, setVisible]), dropdown = clsx("dropdown", {
|
|
43
44
|
"w-100": block,
|
|
45
|
+
"dropdown-nowrap": noWrap,
|
|
44
46
|
overflow
|
|
45
47
|
});
|
|
46
48
|
return useEffect(() => {
|
|
@@ -21,9 +21,13 @@ export interface DropdownItemProps {
|
|
|
21
21
|
* Additional class name
|
|
22
22
|
*/
|
|
23
23
|
className?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Set minimum width in pixels
|
|
26
|
+
*/
|
|
27
|
+
minWidth?: number;
|
|
24
28
|
}
|
|
25
29
|
declare const DropdownItem: {
|
|
26
|
-
({ type, icon, onClick, children, className, ...restProps }: DropdownItemProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
({ type, icon, onClick, children, className, minWidth, ...restProps }: DropdownItemProps): import("react/jsx-runtime").JSX.Element;
|
|
27
31
|
displayName: string;
|
|
28
32
|
};
|
|
29
33
|
export default DropdownItem;
|
|
@@ -8,6 +8,7 @@ const DropdownItem = ({
|
|
|
8
8
|
onClick,
|
|
9
9
|
children,
|
|
10
10
|
className,
|
|
11
|
+
minWidth,
|
|
11
12
|
...restProps
|
|
12
13
|
}) => {
|
|
13
14
|
const {
|
|
@@ -22,8 +23,12 @@ const DropdownItem = ({
|
|
|
22
23
|
onClick == null || onClick(event), type === "action" && (onMenuItemClick(), event.stopPropagation());
|
|
23
24
|
}, id = useId(), dropdownItem = clsx("dropdown-item", {
|
|
24
25
|
focus: isFocused === id
|
|
25
|
-
}, className)
|
|
26
|
-
|
|
26
|
+
}, className), style = {
|
|
27
|
+
...minWidth && {
|
|
28
|
+
minWidth: `${minWidth}px`
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ jsx("div", { id, role: "menuitem", style, ref: (el) => itemRefs.current[id] = el, tabIndex: isFocused === id ? 0 : -1, className: dropdownItem, "aria-current": isFocused === id, onClick: handleOnClick, onMouseEnter: onMenuItemMouseEnter, onKeyDown: (event) => onMenuItemKeyDown(event, onClick), ...restProps, children: /* @__PURE__ */ jsxs("div", { className: "d-flex gap-8 align-items-center", children: [
|
|
27
32
|
icon,
|
|
28
33
|
children
|
|
29
34
|
] }) });
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { Color } from 'src/types';
|
|
1
2
|
export interface DropdownTriggerProps extends React.ComponentPropsWithRef<'button'> {
|
|
2
3
|
/**
|
|
3
4
|
* Dropdown trigger title
|
|
4
5
|
*/
|
|
5
|
-
label?:
|
|
6
|
+
label?: React.ReactNode;
|
|
6
7
|
/**
|
|
7
8
|
* Add an icon in dropdown trigger
|
|
8
9
|
*/
|
|
@@ -14,7 +15,7 @@ export interface DropdownTriggerProps extends React.ComponentPropsWithRef<'butto
|
|
|
14
15
|
/**
|
|
15
16
|
* Set appearance
|
|
16
17
|
*/
|
|
17
|
-
variant?: 'ghost';
|
|
18
|
+
variant?: 'default' | 'ghost' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
18
19
|
/**
|
|
19
20
|
* Button size
|
|
20
21
|
*/
|
|
@@ -31,6 +32,34 @@ export interface DropdownTriggerProps extends React.ComponentPropsWithRef<'butto
|
|
|
31
32
|
* Hide the carret
|
|
32
33
|
*/
|
|
33
34
|
hideCarret?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Make the dropdown trigger a pill
|
|
37
|
+
*/
|
|
38
|
+
pill?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Inner border color
|
|
41
|
+
*/
|
|
42
|
+
innerBorderColor?: Color;
|
|
43
|
+
/**
|
|
44
|
+
* Inner border width in pixels
|
|
45
|
+
*/
|
|
46
|
+
innerBorderWidth?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Outer border color
|
|
49
|
+
*/
|
|
50
|
+
outerBorderColor?: Color;
|
|
51
|
+
/**
|
|
52
|
+
* Outer border width in pixels
|
|
53
|
+
*/
|
|
54
|
+
outerBorderWidth?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Outer border offset in pixels
|
|
57
|
+
*/
|
|
58
|
+
outerBorderOffset?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Use base shade color
|
|
61
|
+
*/
|
|
62
|
+
baseShade?: boolean;
|
|
34
63
|
}
|
|
35
64
|
export type DropdownTriggerType = React.ReactElement<DropdownTriggerProps>;
|
|
36
65
|
declare const DropdownTrigger: import('react').ForwardRefExoticComponent<Omit<DropdownTriggerProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -6,11 +6,18 @@ import { useDropdownContext } from "./DropdownContext.js";
|
|
|
6
6
|
const DropdownTrigger = /* @__PURE__ */ forwardRef(({
|
|
7
7
|
label,
|
|
8
8
|
icon,
|
|
9
|
-
variant,
|
|
9
|
+
variant = "default",
|
|
10
10
|
disabled = !1,
|
|
11
11
|
size,
|
|
12
12
|
badgeContent,
|
|
13
13
|
hideCarret = !1,
|
|
14
|
+
pill = !1,
|
|
15
|
+
innerBorderColor,
|
|
16
|
+
innerBorderWidth,
|
|
17
|
+
outerBorderColor,
|
|
18
|
+
outerBorderWidth,
|
|
19
|
+
outerBorderOffset,
|
|
20
|
+
baseShade,
|
|
14
21
|
...restProps
|
|
15
22
|
}, forwardRef2) => {
|
|
16
23
|
const {
|
|
@@ -18,10 +25,23 @@ const DropdownTrigger = /* @__PURE__ */ forwardRef(({
|
|
|
18
25
|
block
|
|
19
26
|
} = useDropdownContext(), className = clsx("dropdown-toggle ", size, variant, {
|
|
20
27
|
"w-100": block
|
|
21
|
-
}, triggerProps.className, restProps.className
|
|
28
|
+
}, triggerProps.className, restProps.className, {
|
|
29
|
+
"rounded-pill": pill
|
|
30
|
+
}, {
|
|
31
|
+
"base-shade": baseShade
|
|
32
|
+
}), style = {
|
|
33
|
+
...outerBorderColor && {
|
|
34
|
+
outline: `${outerBorderWidth}px solid var(--edifice-${outerBorderColor})`,
|
|
35
|
+
outlineOffset: outerBorderOffset
|
|
36
|
+
},
|
|
37
|
+
...innerBorderColor && {
|
|
38
|
+
border: `${innerBorderWidth}px solid var(--edifice-${innerBorderColor})`
|
|
39
|
+
}
|
|
40
|
+
}, mergedProps = {
|
|
22
41
|
...triggerProps,
|
|
23
42
|
...restProps,
|
|
24
|
-
className
|
|
43
|
+
className,
|
|
44
|
+
style
|
|
25
45
|
};
|
|
26
46
|
return /* @__PURE__ */ jsxs("button", { ref: forwardRef2, type: "button", disabled, ...mergedProps, children: [
|
|
27
47
|
icon,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface PreventPropagationProps {
|
|
3
|
+
/** Children Props */
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
declare const PreventPropagation: {
|
|
7
|
+
({ children }: PreventPropagationProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
export default PreventPropagation;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const Root = ({
|
|
3
|
+
children
|
|
4
|
+
}) => /* @__PURE__ */ jsx("div", { onClick: (e) => {
|
|
5
|
+
e.stopPropagation();
|
|
6
|
+
}, children }), PreventPropagation = /* @__PURE__ */ Object.assign(Root, {});
|
|
7
|
+
export {
|
|
8
|
+
PreventPropagation as default
|
|
9
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface StackedGroupProps {
|
|
3
|
+
/**
|
|
4
|
+
* Children to stack
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode[];
|
|
7
|
+
/**
|
|
8
|
+
* Overlap between items (in pixels)
|
|
9
|
+
* @default 20
|
|
10
|
+
*/
|
|
11
|
+
overlap?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Controls stacking order. When 'rightFirst', rightmost item has highest z-index
|
|
14
|
+
* @default 'leftFirst'
|
|
15
|
+
*/
|
|
16
|
+
stackingOrder?: 'leftFirst' | 'rightFirst';
|
|
17
|
+
/**
|
|
18
|
+
* Additional CSS class
|
|
19
|
+
*/
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
declare const StackedGroup: import('react').ForwardRefExoticComponent<StackedGroupProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export default StackedGroup;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
const StackedGroup = /* @__PURE__ */ forwardRef(({
|
|
5
|
+
children,
|
|
6
|
+
overlap = 20,
|
|
7
|
+
className,
|
|
8
|
+
stackingOrder = "leftFirst"
|
|
9
|
+
}, ref) => {
|
|
10
|
+
const classes = clsx("stacked-group", className);
|
|
11
|
+
return /* @__PURE__ */ jsx("div", { ref, className: classes, style: {
|
|
12
|
+
display: "flex",
|
|
13
|
+
alignItems: "center"
|
|
14
|
+
}, children: children.map((child, index) => /* @__PURE__ */ jsx("div", { style: {
|
|
15
|
+
marginLeft: index === 0 ? 0 : `-${overlap}px`,
|
|
16
|
+
zIndex: stackingOrder === "rightFirst" ? children.length - index : index + 1
|
|
17
|
+
}, children: child }, index)) });
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
StackedGroup as default
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as StackedGroup } from './StackedGroup';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
export interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
3
|
+
/**
|
|
4
|
+
* The label of the switch
|
|
5
|
+
*/
|
|
6
|
+
label?: string;
|
|
7
|
+
/**
|
|
8
|
+
* The value of the switch
|
|
9
|
+
*/
|
|
10
|
+
value?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Define if switch is disabled
|
|
13
|
+
*/
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Define switch size
|
|
17
|
+
*/
|
|
18
|
+
size?: 'sm' | 'md';
|
|
19
|
+
/**
|
|
20
|
+
* Additional class name for the label
|
|
21
|
+
*/
|
|
22
|
+
labelClassName?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Switch color variant
|
|
25
|
+
*/
|
|
26
|
+
variant?: 'default' | 'ghost' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
27
|
+
}
|
|
28
|
+
declare const Switch: import('react').ForwardRefExoticComponent<SwitchProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
29
|
+
export default Switch;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
const Switch = /* @__PURE__ */ forwardRef(({
|
|
5
|
+
className,
|
|
6
|
+
label,
|
|
7
|
+
value,
|
|
8
|
+
disabled,
|
|
9
|
+
size = "md",
|
|
10
|
+
variant = "default",
|
|
11
|
+
labelClassName,
|
|
12
|
+
...restProps
|
|
13
|
+
}, ref) => {
|
|
14
|
+
const switchClass = clsx("switch", {
|
|
15
|
+
[`switch-${size}`]: size,
|
|
16
|
+
[`switch-${variant}`]: variant,
|
|
17
|
+
"switch-disabled": disabled
|
|
18
|
+
}, className), labelClass = clsx("switch-label", labelClassName);
|
|
19
|
+
return /* @__PURE__ */ jsxs("label", { className: switchClass, children: [
|
|
20
|
+
/* @__PURE__ */ jsx("input", { type: "checkbox", ref, value, disabled, ...restProps }),
|
|
21
|
+
/* @__PURE__ */ jsx("span", { className: "slider" }),
|
|
22
|
+
label && /* @__PURE__ */ jsx("span", { className: labelClass, children: label })
|
|
23
|
+
] });
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
Switch as default
|
|
27
|
+
};
|
|
@@ -4,6 +4,7 @@ export * from './AppHeader';
|
|
|
4
4
|
export * from './AppIcon';
|
|
5
5
|
export * from './Attachment';
|
|
6
6
|
export * from './Avatar';
|
|
7
|
+
export * from './AvatarGroup';
|
|
7
8
|
export * from './Badge';
|
|
8
9
|
export * from './Breadcrumb';
|
|
9
10
|
export * from './Button';
|
|
@@ -28,9 +29,12 @@ export * from './Logo';
|
|
|
28
29
|
export * from './Menu';
|
|
29
30
|
export * from './Modal';
|
|
30
31
|
export * from './Popover';
|
|
32
|
+
export * from './PreventPropagation';
|
|
31
33
|
export * from './Radio';
|
|
32
34
|
export * from './SearchBar';
|
|
33
35
|
export * from './Select';
|
|
36
|
+
export * from './StackedGroup';
|
|
37
|
+
export * from './Switch';
|
|
34
38
|
export * from './Table';
|
|
35
39
|
export * from './Tabs';
|
|
36
40
|
export * from './TextArea';
|
package/dist/editor.js
CHANGED
|
@@ -7,12 +7,14 @@ import { default as default6 } from "./modules/editor/components/NodeView/Attach
|
|
|
7
7
|
import { default as default7 } from "./modules/editor/components/NodeView/ImageNodeView.js";
|
|
8
8
|
import { default as default8 } from "./modules/editor/components/NodeView/LinkerNodeView.js";
|
|
9
9
|
import { default as default9 } from "./modules/editor/components/NodeView/VideoNodeView.js";
|
|
10
|
-
import { default as default10 } from "./modules/editor/components/
|
|
11
|
-
import { default as default11 } from "./modules/editor/components/Renderer/
|
|
12
|
-
import { default as default12 } from "./modules/editor/components/Renderer/
|
|
13
|
-
import { default as default13 } from "./modules/editor/components/Renderer/
|
|
14
|
-
import { default as default14 } from "./modules/editor/components/
|
|
15
|
-
import { default as default15 } from "./modules/editor/components/
|
|
10
|
+
import { default as default10 } from "./modules/editor/components/NodeView/InformationPaneNodeView.js";
|
|
11
|
+
import { default as default11 } from "./modules/editor/components/Renderer/AudioRenderer.js";
|
|
12
|
+
import { default as default12 } from "./modules/editor/components/Renderer/AttachmentRenderer.js";
|
|
13
|
+
import { default as default13 } from "./modules/editor/components/Renderer/LinkerRenderer.js";
|
|
14
|
+
import { default as default14 } from "./modules/editor/components/Renderer/MediaRenderer.js";
|
|
15
|
+
import { default as default15 } from "./modules/editor/components/Renderer/InformationPaneRenderer.js";
|
|
16
|
+
import { default as default16 } from "./modules/editor/components/Toolbar/TableToolbar.js";
|
|
17
|
+
import { default as default17 } from "./modules/editor/components/Toolbar/LinkToolbar.js";
|
|
16
18
|
import { EditorToolbar } from "./modules/editor/components/EditorToolbar/EditorToolbar.js";
|
|
17
19
|
import { useActionOptions } from "./modules/editor/hooks/useActionOptions.js";
|
|
18
20
|
import { useCommentEditor } from "./modules/editor/hooks/useCommentEditor.js";
|
|
@@ -28,9 +30,9 @@ import { useSpeechSynthetisis } from "./modules/editor/hooks/useSpeechSynthetisi
|
|
|
28
30
|
import { useTipTapEditor } from "./modules/editor/hooks/useTipTapEditor.js";
|
|
29
31
|
export {
|
|
30
32
|
default6 as AttachmentNodeView,
|
|
31
|
-
|
|
33
|
+
default12 as AttachmentRenderer,
|
|
32
34
|
default5 as AudioNodeView,
|
|
33
|
-
|
|
35
|
+
default11 as AudioRenderer,
|
|
34
36
|
default4 as BubbleMenuEditImage,
|
|
35
37
|
default3 as Editor,
|
|
36
38
|
EditorContent,
|
|
@@ -38,12 +40,14 @@ export {
|
|
|
38
40
|
Editor as EditorInstance,
|
|
39
41
|
EditorToolbar,
|
|
40
42
|
default7 as ImageNodeView,
|
|
41
|
-
|
|
43
|
+
default10 as InformationPaneNodeView,
|
|
44
|
+
default15 as InformationPaneRenderer,
|
|
45
|
+
default17 as LinkToolbar,
|
|
42
46
|
default8 as LinkerNodeView,
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
default13 as LinkerRenderer,
|
|
48
|
+
default14 as MediaRenderer,
|
|
45
49
|
default2 as StarterKit,
|
|
46
|
-
|
|
50
|
+
default16 as TableToolbar,
|
|
47
51
|
default9 as VideoNodeView,
|
|
48
52
|
useActionOptions,
|
|
49
53
|
useCommentEditor,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { App, IGetConf } from '@edifice.io/client';
|
|
2
2
|
export default function useConf({ appCode }: {
|
|
3
3
|
appCode: App;
|
|
4
|
-
}): import('
|
|
4
|
+
}): import('../../node_modules/@tanstack/react-query').UseQueryResult<IGetConf, Error>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IGetSession } from '@edifice.io/client';
|
|
2
|
-
export default function useSession(): import('
|
|
2
|
+
export default function useSession(): import('../../node_modules/@tanstack/react-query').UseQueryResult<IGetSession, Error>;
|