@yoopta/ui 6.0.0-beta.2 → 6.0.0-beta.20
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/action-menu-list/action-menu-list.d.ts +49 -13
- package/dist/action-menu-list/action-menu-list.d.ts.map +1 -1
- package/dist/action-menu-list/context.d.ts +27 -0
- package/dist/action-menu-list/context.d.ts.map +1 -0
- package/dist/action-menu-list/index.d.ts +5 -5
- package/dist/action-menu-list/index.d.ts.map +1 -1
- package/dist/action-menu-list.js +1 -0
- package/dist/block-dnd/block-dnd-context.d.ts +5 -0
- package/dist/block-dnd/block-dnd-context.d.ts.map +1 -0
- package/dist/block-dnd/drag-handle.d.ts +4 -0
- package/dist/block-dnd/drag-handle.d.ts.map +1 -0
- package/dist/block-dnd/index.d.ts +7 -0
- package/dist/block-dnd/index.d.ts.map +1 -0
- package/dist/block-dnd/sortable-block.d.ts +3 -0
- package/dist/block-dnd/sortable-block.d.ts.map +1 -0
- package/dist/block-dnd/types.d.ts +78 -0
- package/dist/block-dnd/types.d.ts.map +1 -0
- package/dist/block-dnd/use-block-dnd.d.ts +29 -0
- package/dist/block-dnd/use-block-dnd.d.ts.map +1 -0
- package/dist/block-dnd.js +7 -0
- package/dist/block-options/block-options.d.ts +61 -8
- package/dist/block-options/block-options.d.ts.map +1 -1
- package/dist/block-options/context.d.ts +11 -0
- package/dist/block-options/context.d.ts.map +1 -0
- package/dist/block-options/hooks.d.ts +14 -894
- package/dist/block-options/hooks.d.ts.map +1 -1
- package/dist/block-options/index.d.ts +2 -3
- package/dist/block-options/index.d.ts.map +1 -1
- package/dist/block-options.js +1 -0
- package/dist/chunks/_tslib-29461875.js +1 -0
- package/dist/chunks/createLucideIcon-8605f860.js +13 -0
- package/dist/chunks/debounce-c595d128.js +1 -0
- package/dist/chunks/floating-ui.react-993d5ee4.js +5 -0
- package/dist/chunks/floating-ui.react-dom-59d096f1.js +1 -0
- package/dist/chunks/style-inject.es-e87a8d02.js +1 -0
- package/dist/chunks/throttle-dea4a39e.js +1 -0
- package/dist/element-options/components/element-options-color-picker.d.ts +6 -0
- package/dist/element-options/components/element-options-color-picker.d.ts.map +1 -0
- package/dist/element-options/components/element-options-content.d.ts +6 -0
- package/dist/element-options/components/element-options-content.d.ts.map +1 -0
- package/dist/element-options/components/element-options-group.d.ts +6 -0
- package/dist/element-options/components/element-options-group.d.ts.map +1 -0
- package/dist/element-options/components/element-options-input.d.ts +6 -0
- package/dist/element-options/components/element-options-input.d.ts.map +1 -0
- package/dist/element-options/components/element-options-label.d.ts +6 -0
- package/dist/element-options/components/element-options-label.d.ts.map +1 -0
- package/dist/element-options/components/element-options-root.d.ts +6 -0
- package/dist/element-options/components/element-options-root.d.ts.map +1 -0
- package/dist/element-options/components/element-options-select.d.ts +6 -0
- package/dist/element-options/components/element-options-select.d.ts.map +1 -0
- package/dist/element-options/components/element-options-separator.d.ts +6 -0
- package/dist/element-options/components/element-options-separator.d.ts.map +1 -0
- package/dist/element-options/components/element-options-slider.d.ts +6 -0
- package/dist/element-options/components/element-options-slider.d.ts.map +1 -0
- package/dist/element-options/components/element-options-toggle.d.ts +6 -0
- package/dist/element-options/components/element-options-toggle.d.ts.map +1 -0
- package/dist/element-options/components/element-options-trigger.d.ts +6 -0
- package/dist/element-options/components/element-options-trigger.d.ts.map +1 -0
- package/dist/element-options/context/element-options-context.d.ts +13 -0
- package/dist/element-options/context/element-options-context.d.ts.map +1 -0
- package/dist/element-options/index.d.ts +64 -0
- package/dist/element-options/index.d.ts.map +1 -0
- package/dist/element-options/types.d.ts +94 -0
- package/dist/element-options/types.d.ts.map +1 -0
- package/dist/element-options.js +14 -0
- package/dist/floating-block-actions/context.d.ts +15 -0
- package/dist/floating-block-actions/context.d.ts.map +1 -0
- package/dist/floating-block-actions/floating-block-actions.d.ts +30 -6
- package/dist/floating-block-actions/floating-block-actions.d.ts.map +1 -1
- package/dist/floating-block-actions/hooks.d.ts +1 -29
- package/dist/floating-block-actions/hooks.d.ts.map +1 -1
- package/dist/floating-block-actions/index.d.ts +3 -4
- package/dist/floating-block-actions/index.d.ts.map +1 -1
- package/dist/floating-block-actions.js +1 -1
- package/dist/floating-toolbar/context.d.ts +12 -0
- package/dist/floating-toolbar/context.d.ts.map +1 -0
- package/dist/floating-toolbar/floating-toolbar.d.ts +44 -0
- package/dist/floating-toolbar/floating-toolbar.d.ts.map +1 -0
- package/dist/floating-toolbar/index.d.ts +5 -0
- package/dist/floating-toolbar/index.d.ts.map +1 -0
- package/dist/floating-toolbar.js +1 -0
- package/dist/highlight-color-picker/highlight-color-picker.d.ts +1 -0
- package/dist/highlight-color-picker/highlight-color-picker.d.ts.map +1 -1
- package/dist/highlight-color-picker/index.d.ts +0 -1
- package/dist/highlight-color-picker/index.d.ts.map +1 -1
- package/dist/highlight-color-picker.js +1 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -5
- package/dist/overlay.js +1 -0
- package/dist/portal/Portal.d.ts +1 -1
- package/dist/portal/Portal.d.ts.map +1 -1
- package/dist/portal.js +1 -0
- package/dist/selection-box/SelectionBox.d.ts +19 -0
- package/dist/selection-box/SelectionBox.d.ts.map +1 -0
- package/dist/selection-box/hooks.d.ts +7 -0
- package/dist/selection-box/hooks.d.ts.map +1 -0
- package/dist/selection-box/index.d.ts +4 -0
- package/dist/selection-box/index.d.ts.map +1 -0
- package/dist/selection-box.js +1 -0
- package/dist/slash-command-menu/components/{SlashCommandContent.d.ts → slash-command-content.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-content.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandEmpty.d.ts → slash-command-empty.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-empty.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandFooter.d.ts → slash-command-footer.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-footer.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandGroup.d.ts → slash-command-group.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-group.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandInput.d.ts → slash-command-input.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-input.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandItem.d.ts → slash-command-item.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-item.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandList.d.ts → slash-command-list.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-list.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandLoading.d.ts → slash-command-loading.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-loading.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandRoot.d.ts → slash-command-root.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-root.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandSeparator.d.ts → slash-command-separator.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-separator.d.ts.map +1 -0
- package/dist/slash-command-menu/constants.d.ts.map +1 -1
- package/dist/slash-command-menu/context/{SlashCommandContext.d.ts → slash-command-context.d.ts} +1 -1
- package/dist/slash-command-menu/context/slash-command-context.d.ts.map +1 -0
- package/dist/slash-command-menu/index.d.ts +32 -33
- package/dist/slash-command-menu/index.d.ts.map +1 -1
- package/dist/slash-command-menu.js +1 -0
- package/dist/utils/debounce.d.ts +5 -0
- package/dist/utils/debounce.d.ts.map +1 -0
- package/package.json +93 -9
- package/dist/action-menu-list/hooks.d.ts +0 -912
- package/dist/action-menu-list/hooks.d.ts.map +0 -1
- package/dist/action-menu-list/store.d.ts +0 -22
- package/dist/action-menu-list/store.d.ts.map +0 -1
- package/dist/action-menu-list/store.test.d.ts +0 -2
- package/dist/action-menu-list/store.test.d.ts.map +0 -1
- package/dist/block-options/store.d.ts +0 -15
- package/dist/block-options/store.d.ts.map +0 -1
- package/dist/block-options/store.test.d.ts +0 -2
- package/dist/block-options/store.test.d.ts.map +0 -1
- package/dist/floating-block-actions/store.d.ts +0 -19
- package/dist/floating-block-actions/store.d.ts.map +0 -1
- package/dist/floating-block-actions/store.test.d.ts +0 -2
- package/dist/floating-block-actions/store.test.d.ts.map +0 -1
- package/dist/index-16ebe43d.js +0 -10
- package/dist/slash-command-menu/components/SlashCommandContent.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandEmpty.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandFooter.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandGroup.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandInput.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandItem.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandList.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandLoading.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandRoot.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandSeparator.d.ts.map +0 -1
- package/dist/slash-command-menu/context/SlashCommandContext.d.ts.map +0 -1
- package/dist/theme/ThemeProvider.d.ts +0 -16
- package/dist/theme/ThemeProvider.d.ts.map +0 -1
- package/dist/theme/ThemeToggle.d.ts +0 -6
- package/dist/theme/ThemeToggle.d.ts.map +0 -1
- package/dist/theme/index.d.ts +0 -5
- package/dist/theme/index.d.ts.map +0 -1
- package/dist/theme/useTheme.d.ts +0 -8
- package/dist/theme/useTheme.d.ts.map +0 -1
- package/dist/toolbar/hooks.d.ts +0 -879
- package/dist/toolbar/hooks.d.ts.map +0 -1
- package/dist/toolbar/index.d.ts +0 -6
- package/dist/toolbar/index.d.ts.map +0 -1
- package/dist/toolbar/store.d.ts +0 -12
- package/dist/toolbar/store.d.ts.map +0 -1
- package/dist/toolbar/store.test.d.ts +0 -2
- package/dist/toolbar/store.test.d.ts.map +0 -1
- package/dist/toolbar/toolbar.d.ts +0 -20
- package/dist/toolbar/toolbar.d.ts.map +0 -1
|
@@ -1,27 +1,63 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { Placement } from '@floating-ui/react';
|
|
2
3
|
import type { ActionMenuItem } from './types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import './action-menu-list.css';
|
|
5
|
+
type ActionMenuListApi = {
|
|
6
|
+
/** Available actions from editor plugins */
|
|
7
|
+
actions: ActionMenuItem[];
|
|
8
|
+
/** Currently selected action */
|
|
9
|
+
selectedAction: ActionMenuItem | null;
|
|
10
|
+
/** Execute action (toggle block type) */
|
|
11
|
+
onSelect: (type: string) => void;
|
|
12
|
+
/** Whether actions list is empty */
|
|
13
|
+
empty: boolean;
|
|
6
14
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
15
|
+
type ActionMenuListRootProps = {
|
|
16
|
+
children: ReactNode | ((api: ActionMenuListApi) => ReactNode);
|
|
17
|
+
/** Controlled open state */
|
|
18
|
+
open?: boolean;
|
|
19
|
+
/** Callback when open state changes */
|
|
20
|
+
onOpenChange?: (open: boolean) => void;
|
|
21
|
+
/** Default open state for uncontrolled usage */
|
|
22
|
+
defaultOpen?: boolean;
|
|
23
|
+
/** Anchor element for positioning */
|
|
24
|
+
anchor?: HTMLElement | null;
|
|
25
|
+
/** View mode - 'small' for compact, 'default' for full */
|
|
26
|
+
view?: 'small' | 'default';
|
|
27
|
+
/** Placement relative to anchor */
|
|
28
|
+
placement?: Placement;
|
|
29
|
+
className?: string;
|
|
30
|
+
};
|
|
31
|
+
type ActionMenuListContentProps = {
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
className?: string;
|
|
34
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
35
|
+
type ActionMenuListGroupProps = HTMLAttributes<HTMLDivElement>;
|
|
36
|
+
type ActionMenuListItemProps = HTMLAttributes<HTMLButtonElement> & {
|
|
37
|
+
action?: ActionMenuItem;
|
|
10
38
|
selected?: boolean;
|
|
11
39
|
icon?: string | ReactNode;
|
|
12
40
|
};
|
|
13
|
-
|
|
41
|
+
type ActionMenuListEmptyProps = HTMLAttributes<HTMLDivElement>;
|
|
14
42
|
export declare const ActionMenuList: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
43
|
+
({ children, open: controlledOpen, onOpenChange: controlledOnOpenChange, defaultOpen, anchor, view, placement, className, }: ActionMenuListRootProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
displayName: string;
|
|
45
|
+
} & {
|
|
46
|
+
Root: {
|
|
47
|
+
({ children, open: controlledOpen, onOpenChange: controlledOnOpenChange, defaultOpen, anchor, view, placement, className, }: ActionMenuListRootProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
displayName: string;
|
|
49
|
+
};
|
|
50
|
+
Content: import("react").ForwardRefExoticComponent<{
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
className?: string | undefined;
|
|
53
|
+
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
54
|
Group: import("react").ForwardRefExoticComponent<ActionMenuListGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
55
|
Item: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLButtonElement> & {
|
|
21
|
-
action
|
|
56
|
+
action?: ActionMenuItem | undefined;
|
|
22
57
|
selected?: boolean | undefined;
|
|
23
58
|
icon?: string | ReactNode;
|
|
24
59
|
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
25
60
|
Empty: import("react").ForwardRefExoticComponent<ActionMenuListEmptyProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
61
|
};
|
|
62
|
+
export type { ActionMenuListRootProps, ActionMenuListContentProps, ActionMenuListGroupProps, ActionMenuListItemProps, ActionMenuListEmptyProps, ActionMenuListApi, };
|
|
27
63
|
//# sourceMappingURL=action-menu-list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-menu-list.d.ts","sourceRoot":"","sources":["../../src/action-menu-list/action-menu-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"action-menu-list.d.ts","sourceRoot":"","sources":["../../src/action-menu-list/action-menu-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAepD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,OAAO,wBAAwB,CAAC;AAEhC,KAAK,iBAAiB,GAAG;IACvB,4CAA4C;IAC5C,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,gCAAgC;IAChC,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,yCAAyC;IACzC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,oCAAoC;IACpC,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAC7B,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,GAAG,EAAE,iBAAiB,KAAK,SAAS,CAAC,CAAC;IAC9D,4BAA4B;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uCAAuC;IACvC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,gDAAgD;IAChD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qCAAqC;IACrC,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,0DAA0D;IAC1D,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,mCAAmC;IACnC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AA4IF,KAAK,0BAA0B,GAAG;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAsFnC,KAAK,wBAAwB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAY/D,KAAK,uBAAuB,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG;IACjE,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,CAAC;AAgDF,KAAK,wBAAwB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAY/D,eAAO,MAAM,cAAc;iIAtSxB,uBAAuB;;;;qIAAvB,uBAAuB;;;;mBAkIb,SAAS;;;;;;;eAuGb,MAAM,GAAG,SAAS;;;CAmEzB,CAAC;AAEH,YAAY,EACV,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,GAClB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CSSProperties, HTMLProps } from 'react';
|
|
2
|
+
import type { ActionMenuItem } from './types';
|
|
3
|
+
export type ActionMenuListContextValue = {
|
|
4
|
+
/** Whether menu is open */
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
/** Current view mode */
|
|
7
|
+
view: 'small' | 'default';
|
|
8
|
+
/** Available actions from editor plugins */
|
|
9
|
+
actions: ActionMenuItem[];
|
|
10
|
+
/** Currently selected/hovered action */
|
|
11
|
+
selectedAction: ActionMenuItem | null;
|
|
12
|
+
/** Select an action (hover) */
|
|
13
|
+
setSelectedAction: (action: ActionMenuItem) => void;
|
|
14
|
+
/** Execute action (toggle block) */
|
|
15
|
+
onSelect: (type: string) => void;
|
|
16
|
+
/** Close the menu */
|
|
17
|
+
close: () => void;
|
|
18
|
+
/** Floating styles for positioning */
|
|
19
|
+
floatingStyles: CSSProperties;
|
|
20
|
+
/** Ref setter for floating element */
|
|
21
|
+
setFloatingRef: (node: HTMLElement | null) => void;
|
|
22
|
+
/** Props from useInteractions for dismiss handling */
|
|
23
|
+
getFloatingProps: (userProps?: HTMLProps<HTMLElement>) => Record<string, unknown>;
|
|
24
|
+
};
|
|
25
|
+
export declare const ActionMenuListContext: import("react").Context<ActionMenuListContextValue | null>;
|
|
26
|
+
export declare const useActionMenuListContext: () => ActionMenuListContextValue;
|
|
27
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/action-menu-list/context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,0BAA0B,GAAG;IACvC,2BAA2B;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,wBAAwB;IACxB,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,4CAA4C;IAC5C,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,wCAAwC;IACxC,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,+BAA+B;IAC/B,iBAAiB,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IACpD,oCAAoC;IACpC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,qBAAqB;IACrB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,sCAAsC;IACtC,cAAc,EAAE,aAAa,CAAC;IAC9B,sCAAsC;IACtC,cAAc,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,sDAAsD;IACtD,gBAAgB,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnF,CAAC;AAEF,eAAO,MAAM,qBAAqB,4DAAyD,CAAC;AAE5F,eAAO,MAAM,wBAAwB,kCAQpC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { ActionMenuList } from './action-menu-list';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export type {
|
|
5
|
-
export type {
|
|
6
|
-
|
|
2
|
+
export type { ActionMenuListApi, ActionMenuListContentProps, ActionMenuListEmptyProps, ActionMenuListGroupProps, ActionMenuListItemProps, ActionMenuListRootProps, } from './action-menu-list';
|
|
3
|
+
export { useActionMenuListContext } from './context';
|
|
4
|
+
export type { ActionMenuItem } from './types';
|
|
5
|
+
export type { ActionMenuListContextValue } from './context';
|
|
6
|
+
export { filterToggleActions, mapActionMenuItems } from './utils';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/action-menu-list/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/action-menu-list/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,YAAY,EACV,iBAAiB,EACjB,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAGrD,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,YAAY,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAG5D,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunks/_tslib-29461875.js";import{jsx as o,jsxs as i,Fragment as e}from"react/jsx-runtime";import{createContext as n,useContext as a,forwardRef as r,useRef as s,useEffect as l,useState as u,useMemo as p,useCallback as c,isValidElement as d,cloneElement as m}from"react";import{b as y,F as g,u as h,c as v,d as f}from"./chunks/floating-ui.react-993d5ee4.js";import{Blocks as b,getAllowedPluginsFromElement as x,getRootBlockElement as w,useYooptaEditor as k}from"@yoopta/editor";import{s as j}from"./chunks/style-inject.es-e87a8d02.js";import{Overlay as N}from"./overlay.js";import{l as O,s as z,o as A,j as F}from"./chunks/floating-ui.react-dom-59d096f1.js";import"react-dom";const M=n(null),S=()=>{const t=a(M);if(!t)throw new Error("ActionMenuList components must be used within <ActionMenuList>");return t};function C(t){const o=Object.keys(t.plugins);let i=null;if("number"==typeof t.path.current){const o=b.getBlockSlate(t,{at:t.path.current});o&&(i=x(t,o))}let e=o;return i&&i.length>0&&(e="string"==typeof o[0]?o.filter(t=>i.includes(t)):o.filter(t=>i.includes(t.type))),e.map(o=>{var i,e,n,a,r,s;if("string"==typeof o){return{type:o,title:(null===(e=null===(i=t.plugins[o].options)||void 0===i?void 0:i.display)||void 0===e?void 0:e.title)||o,description:null===(a=null===(n=t.plugins[o].options)||void 0===n?void 0:n.display)||void 0===a?void 0:a.description,icon:null===(s=null===(r=t.plugins[o].options)||void 0===r?void 0:r.display)||void 0===s?void 0:s.icon}}return o})}function E(t,o){var i;const e=t.plugins[o];if(!e)return!1;const n=w(e.elements);return"void"!==(null===(i=null==n?void 0:n.props)||void 0===i?void 0:i.nodeType)}j(":root{--yoopta-ui-background:0 0% 100%;--yoopta-ui-foreground:222.2 84% 4.9%;--yoopta-ui-muted:210 40% 96.1%;--yoopta-ui-muted-foreground:215.4 16.3% 46.9%;--yoopta-ui-border:214.3 31.8% 91.4%;--yoopta-ui-ring:222.2 84% 4.9%;--yoopta-ui-accent:210 40% 96.1%;--yoopta-ui-accent-foreground:222.2 47.4% 11.2%;--yoopta-ui-primary:221.2 83.2% 53.3%;--yoopta-ui-primary-foreground:210 40% 98%;--yoopta-ui-destructive:0 84.2% 60.2%;--yoopta-ui-destructive-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.05);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.18),0 4px 16px -4px rgba(0,0,0,.1);--yoopta-ui-radius-sm:0.375rem;--yoopta-ui-radius:0.5rem;--yoopta-ui-radius-lg:0.625rem;--yoopta-ui-z-dropdown:50;--yoopta-ui-z-sticky:100;--yoopta-ui-z-overlay:200;--yoopta-ui-z-modal:9999;--yoopta-ui-transition-fast:100ms ease;--yoopta-ui-transition:150ms ease;--yoopta-ui-transition-slow:200ms ease}.dark,[data-theme=dark],[data-yoopta-theme=dark]{--yoopta-ui-background:222.2 84% 4.9%;--yoopta-ui-foreground:210 40% 98%;--yoopta-ui-muted:217.2 32.6% 17.5%;--yoopta-ui-muted-foreground:215 20.2% 65.1%;--yoopta-ui-border:217.2 32.6% 17.5%;--yoopta-ui-ring:212.7 26.8% 83.9%;--yoopta-ui-accent:217.2 32.6% 17.5%;--yoopta-ui-accent-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.3);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.4),0 2px 4px -2px rgba(0,0,0,.3);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.5),0 4px 6px -4px rgba(0,0,0,.3);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.5),0 4px 16px -4px rgba(0,0,0,.3)}.yoopta-ui-action-menu-list-overlay{background:transparent;z-index:var(--yoopta-ui-action-menu-z-index,9999)}.yoopta-ui-action-menu-list{bottom:auto;left:0;margin:0;position:absolute;right:auto;top:0;z-index:var(--yoopta-ui-action-menu-z-index,9999)}.yoopta-ui-action-menu-list-content{background:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-action-menu-radius,.5rem);box-shadow:var(--yoopta-ui-action-menu-shadow,0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1));max-height:var(--yoopta-ui-action-menu-max-height,330px);overflow-x:hidden;overflow-y:auto;padding:var(--yoopta-ui-action-menu-padding,.5rem);-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoopta-ui-action-menu-list-group{color:hsl(var(--yoopta-ui-foreground));overflow:hidden;padding:0}.yoopta-ui-action-menu-list-item{align-items:center;background:transparent;border:none;border-radius:var(--yoopta-ui-action-menu-item-radius,.375rem);color:hsl(var(--yoopta-ui-foreground));cursor:pointer;display:flex;font-size:var(--yoopta-ui-action-menu-item-font-size,.875rem);gap:var(--yoopta-ui-action-menu-item-gap,.5rem);margin-bottom:.125rem;outline:none;padding:var(--yoopta-ui-action-menu-item-padding,.5rem);text-align:left;transition:background-color .15s ease-out;width:100%}.yoopta-ui-action-menu-list-item:last-child{margin-bottom:0}.yoopta-ui-action-menu-list-item:hover,.yoopta-ui-action-menu-list-item[data-selected=true]{background:hsl(var(--yoopta-ui-accent))}.yoopta-ui-action-menu-list-item:focus-visible{outline:2px solid hsl(var(--yoopta-ui-ring));outline-offset:2px}.yoopta-ui-action-menu-list-item-icon{align-items:center;background:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-action-menu-icon-radius,.375rem);display:flex;flex-shrink:0;justify-content:center}.yoopta-ui-action-menu-list-item-icon img,.yoopta-ui-action-menu-list-item-icon svg{height:100%;-o-object-fit:contain;object-fit:contain;width:100%}.yoopta-ui-action-menu-list-item-content{flex:1;min-width:0}.yoopta-ui-action-menu-list-item-title{font-weight:500;line-height:1.25}.yoopta-ui-action-menu-list-item-description{color:hsl(var(--yoopta-ui-muted-foreground));font-size:var(--yoopta-ui-action-menu-item-description-font-size,.75rem);line-height:1.25;margin-top:.125rem;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.yoopta-ui-action-menu-list-empty{color:hsl(var(--yoopta-ui-muted-foreground));font-size:var(--yoopta-ui-action-menu-empty-font-size,.75rem);padding:var(--yoopta-ui-action-menu-empty-padding,.5rem);text-align:left}.yoopta-ui-action-menu-list-small{max-height:280px;min-width:180px;padding:.375rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item{font-size:.8125rem;gap:.375rem;padding:.375rem .5rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-icon{height:20px;padding:2px;width:20px}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-title{font-size:.8125rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-description{display:none}.yoopta-ui-action-menu-list-default{min-width:244px}.yoopta-ui-action-menu-list-default .yoopta-ui-action-menu-list-item-icon{height:40px;padding:6px;width:40px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar{width:8px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-track{background:transparent}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-thumb{background:hsl(var(--yoopta-ui-border));border-radius:4px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-thumb:hover{background:hsl(var(--yoopta-ui-muted-foreground))}");const L=({children:t,open:i,onOpenChange:e,defaultOpen:n=!1,anchor:a=null,view:r="default",placement:s="bottom-start",className:d=""})=>{const m=k(),[y,g]=u(n),b=void 0!==i,x=b?i:y,j=p(()=>{if(!x)return[];return C(m).filter(t=>E(m,t.type)).filter(t=>{var o,i,e;const n=m.plugins[t.type],a=w(n.elements);return"inline"!==(null===(o=null==a?void 0:a.props)||void 0===o?void 0:o.nodeType)&&"inlineVoid"!==(null===(i=null==a?void 0:a.props)||void 0===i?void 0:i.nodeType)&&"void"!==(null===(e=null==a?void 0:a.props)||void 0===e?void 0:e.nodeType)})},[m,x]),[N,S]=u(null);l(()=>{j.length>0&&S(j[0])},[j]);const L=c(t=>{b||g(t),null==e||e(t)},[b,e]),{refs:P,floatingStyles:$,context:T}=h({elements:{reference:a},placement:s,open:x,onOpenChange:L,middleware:[O(),z(),A(10)],whileElementsMounted:F}),B=v(T,{escapeKey:!0,outsidePress:!1}),{getFloatingProps:I}=f([B]),R=p(()=>Object.assign(Object.assign({},$),{minWidth:"small"===r?200:244}),[$,r]),D=c(()=>{var t;L(!1),S(null!==(t=j[0])&&void 0!==t?t:null)},[L,j]),G=c(t=>{Array.isArray(m.path.selected)&&m.path.selected.length>0?m.batchOperations(()=>{m.path.selected.forEach(o=>{m.toggleBlock(t,{preserveContent:!0,focus:!0,at:o})})}):m.toggleBlock(t,{preserveContent:!0,focus:!0,at:m.path.current}),D()},[m,D]),q=p(()=>({isOpen:x,view:r,actions:j,selectedAction:N,setSelectedAction:S,onSelect:G,close:D,floatingStyles:R,setFloatingRef:P.setFloating,getFloatingProps:I}),[x,r,j,N,G,D,R,P.setFloating,I]),K={actions:j,selectedAction:N,onSelect:G,empty:0===j.length},V="function"==typeof t?t(K):t;return o(M.Provider,Object.assign({value:q},{children:o("div",Object.assign({className:d},{children:V}))}))};L.displayName="ActionMenuList";const P=r((i,e)=>{var{children:n,className:a=""}=i,r=t(i,["children","className"]);const{isOpen:u,floatingStyles:p,setFloatingRef:c,actions:d,selectedAction:m,setSelectedAction:h,onSelect:v,view:f,close:b,getFloatingProps:x}=S(),w=s(null),j=y([e,c,w]),O=k();if(l(()=>{let t;return u&&w.current&&(t=requestAnimationFrame(()=>{var t;null===(t=w.current)||void 0===t||t.focus()})),()=>cancelAnimationFrame(t)},[u]),!u)return null;const z=null!=n?n:0===d.length?o(B,{}):o($,{children:d.map(t=>o(T,{action:t,selected:t.type===(null==m?void 0:m.type),onMouseEnter:()=>h(t),onClick:()=>v(t.type)},t.type))});return o(g,Object.assign({root:O.refElement,id:`yoopta-ui-action-menu-list-portal-${O.id}`},{children:o(N,Object.assign({lockScroll:!1,onClick:b,className:"yoopta-ui-action-menu-list-overlay"},{children:o("div",Object.assign({ref:j,role:"listbox",tabIndex:0,className:`yoopta-ui-action-menu-list-content yoopta-ui-action-menu-list-${f} ${a}`,style:p},x({onMouseDown:t=>{t.preventDefault(),t.stopPropagation()},onClick:t=>t.stopPropagation()}),r,{children:z}))}))}))});P.displayName="ActionMenuList.Content";const $=r((i,e)=>{var{children:n,className:a=""}=i,r=t(i,["children","className"]);return o("div",Object.assign({ref:e,className:`yoopta-ui-action-menu-list-group ${a}`},r,{children:n}))});$.displayName="ActionMenuList.Group";const T=r((n,a)=>{var{action:r,selected:s,icon:l,className:u="",children:p}=n,c=t(n,["action","selected","icon","className","children"]);const y=null!=l?l:null==r?void 0:r.icon;return i("button",Object.assign({ref:a,type:"button",className:`yoopta-ui-action-menu-list-item ${s?"selected":""} ${u}`,"data-action-menu-item-type":null==r?void 0:r.type,"data-selected":s,"aria-pressed":s},c,{children:[r&&i(e,{children:[y&&o("div",Object.assign({className:"yoopta-ui-action-menu-list-item-icon"},{children:(t=>{if(!t)return null;if("string"==typeof t)return o("img",{src:t,alt:"icon"});if(d(t))return m(t);return o(t,{})})(y)})),i("div",Object.assign({className:"yoopta-ui-action-menu-list-item-content"},{children:[o("div",Object.assign({className:"yoopta-ui-action-menu-list-item-title"},{children:null==r?void 0:r.title})),(null==r?void 0:r.description)&&o("div",Object.assign({className:"yoopta-ui-action-menu-list-item-description"},{children:null==r?void 0:r.description}))]}))]}),p]}))});T.displayName="ActionMenuList.Item";const B=r((i,e)=>{var{children:n,className:a=""}=i,r=t(i,["children","className"]);return o("div",Object.assign({ref:e,className:`yoopta-ui-action-menu-list-empty ${a}`},r,{children:null!=n?n:"No actions available"}))});B.displayName="ActionMenuList.Empty";const I=Object.assign(L,{Root:L,Content:P,Group:$,Item:T,Empty:B});export{I as ActionMenuList,E as filterToggleActions,C as mapActionMenuItems,S as useActionMenuListContext};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BlockDndContextProps, BlockDndContextValue } from './types';
|
|
2
|
+
import './block-dnd.css';
|
|
3
|
+
export declare const useBlockDndContext: () => BlockDndContextValue;
|
|
4
|
+
export declare const BlockDndContext: ({ editor, children, onDragStart, onDragEnd, renderDragOverlay, enableMultiDrag, }: BlockDndContextProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=block-dnd-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-dnd-context.d.ts","sourceRoot":"","sources":["../../src/block-dnd/block-dnd-context.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAqB,MAAM,SAAS,CAAC;AAC7F,OAAO,iBAAiB,CAAC;AAIzB,eAAO,MAAM,kBAAkB,QAAO,oBAMrC,CAAC;AAQF,eAAO,MAAM,eAAe,sFAOzB,oBAAoB,4CAkMtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drag-handle.d.ts","sourceRoot":"","sources":["../../src/block-dnd/drag-handle.tsx"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,UAAU,+GA2KtB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { BlockDndContext, useBlockDndContext } from './block-dnd-context';
|
|
2
|
+
export { SortableBlock } from './sortable-block';
|
|
3
|
+
export { DragHandle } from './drag-handle';
|
|
4
|
+
export { useBlockDnd, getOrderedBlockIds } from './use-block-dnd';
|
|
5
|
+
export type { BlockDndContextProps, BlockDndContextValue, SortableBlockData, SortableBlockProps, DragHandleProps, DropIndicatorProps, } from './types';
|
|
6
|
+
export type { UseBlockDndOptions, UseBlockDndReturn } from './use-block-dnd';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/block-dnd/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAClE,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,GACnB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortable-block.d.ts","sourceRoot":"","sources":["../../src/block-dnd/sortable-block.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,eAAO,MAAM,aAAa,yDAAyE,kBAAkB,4CAkEpH,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { DragEndEvent, DragStartEvent, UniqueIdentifier } from '@dnd-kit/core';
|
|
3
|
+
import type { YooEditor, YooptaBlockData } from '@yoopta/editor';
|
|
4
|
+
export type SortableBlockData = {
|
|
5
|
+
/** setActivatorNodeRef from useSortable */
|
|
6
|
+
setActivatorNodeRef: (node: HTMLElement | null) => void;
|
|
7
|
+
/** listeners from useSortable */
|
|
8
|
+
listeners: Record<string, (event: any) => void>;
|
|
9
|
+
/** attributes from useSortable */
|
|
10
|
+
attributes: Record<string, any>;
|
|
11
|
+
};
|
|
12
|
+
export type BlockDndContextValue = {
|
|
13
|
+
/** Currently dragging block ID */
|
|
14
|
+
activeId: UniqueIdentifier | null;
|
|
15
|
+
/** Currently dragging block data */
|
|
16
|
+
activeBlock: YooptaBlockData | null;
|
|
17
|
+
/** Whether drag is in progress */
|
|
18
|
+
isDragging: boolean;
|
|
19
|
+
/** IDs of blocks being dragged (for multi-select) */
|
|
20
|
+
draggedIds: UniqueIdentifier[];
|
|
21
|
+
/** The editor instance */
|
|
22
|
+
editor: YooEditor;
|
|
23
|
+
/** Register sortable data for a block */
|
|
24
|
+
registerSortable: (blockId: string, data: SortableBlockData) => void;
|
|
25
|
+
/** Unregister sortable data for a block */
|
|
26
|
+
unregisterSortable: (blockId: string) => void;
|
|
27
|
+
/** Get sortable data for a block */
|
|
28
|
+
getSortable: (blockId: string) => SortableBlockData | null;
|
|
29
|
+
};
|
|
30
|
+
export type BlockDndContextProps = {
|
|
31
|
+
/** The Yoopta editor instance */
|
|
32
|
+
editor: YooEditor;
|
|
33
|
+
/** Children to render */
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
/** Called when drag starts */
|
|
36
|
+
onDragStart?: (event: DragStartEvent, blocks: YooptaBlockData[]) => void;
|
|
37
|
+
/** Called when drag ends */
|
|
38
|
+
onDragEnd?: (event: DragEndEvent, moved: boolean) => void;
|
|
39
|
+
/** Custom drag overlay render */
|
|
40
|
+
renderDragOverlay?: (blocks: YooptaBlockData[]) => ReactNode;
|
|
41
|
+
/** Enable multi-block drag when blocks are selected */
|
|
42
|
+
enableMultiDrag?: boolean;
|
|
43
|
+
};
|
|
44
|
+
export type SortableBlockProps = {
|
|
45
|
+
/** Unique block ID */
|
|
46
|
+
id: string;
|
|
47
|
+
/** Block index in the list */
|
|
48
|
+
index?: number;
|
|
49
|
+
/** Children to render */
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
/** Additional class name */
|
|
52
|
+
className?: string;
|
|
53
|
+
/** Whether this block is disabled for dragging */
|
|
54
|
+
disabled?: boolean;
|
|
55
|
+
/** If true, listeners won't be applied to the block (use DragHandle instead) */
|
|
56
|
+
useDragHandle?: boolean;
|
|
57
|
+
};
|
|
58
|
+
export type DragHandleProps = {
|
|
59
|
+
/** Block ID this handle controls */
|
|
60
|
+
blockId: string | null;
|
|
61
|
+
/** Children (usually an icon) */
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
/** Additional class name */
|
|
64
|
+
className?: string;
|
|
65
|
+
/** Called when drag handle is clicked (not dragged) */
|
|
66
|
+
onClick?: (e: MouseEvent) => void;
|
|
67
|
+
/** If true, merges props and event handlers with the child element */
|
|
68
|
+
asChild?: boolean;
|
|
69
|
+
};
|
|
70
|
+
export type DropIndicatorProps = {
|
|
71
|
+
/** Whether to show the indicator */
|
|
72
|
+
isVisible: boolean;
|
|
73
|
+
/** Position: 'before' or 'after' the target block */
|
|
74
|
+
position?: 'before' | 'after';
|
|
75
|
+
/** Additional class name */
|
|
76
|
+
className?: string;
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/block-dnd/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,2CAA2C;IAC3C,mBAAmB,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC;IAChD,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,kCAAkC;IAClC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClC,oCAAoC;IACpC,WAAW,EAAE,eAAe,GAAG,IAAI,CAAC;IACpC,kCAAkC;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,qDAAqD;IACrD,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,0BAA0B;IAC1B,MAAM,EAAE,SAAS,CAAC;IAClB,yCAAyC;IACzC,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACrE,2CAA2C;IAC3C,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,oCAAoC;IACpC,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,iBAAiB,GAAG,IAAI,CAAC;CAC5D,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,iCAAiC;IACjC,MAAM,EAAE,SAAS,CAAC;IAClB,yBAAyB;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,8BAA8B;IAC9B,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;IACzE,4BAA4B;IAC5B,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1D,iCAAiC;IACjC,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,SAAS,CAAC;IAC7D,uDAAuD;IACvD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,sBAAsB;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gFAAgF;IAChF,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,oCAAoC;IACpC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,iCAAiC;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAClC,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,oCAAoC;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC9B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { YooEditor } from '@yoopta/editor';
|
|
2
|
+
export type UseBlockDndOptions = {
|
|
3
|
+
blockId?: string | null;
|
|
4
|
+
};
|
|
5
|
+
export type UseBlockDndReturn = {
|
|
6
|
+
/** Whether any block is being dragged */
|
|
7
|
+
isDragging: boolean;
|
|
8
|
+
/** Whether this specific block is being dragged */
|
|
9
|
+
isBlockDragging: boolean;
|
|
10
|
+
/** Whether this block is part of a multi-drag selection */
|
|
11
|
+
isPartOfMultiDrag: boolean;
|
|
12
|
+
/** Number of blocks being dragged */
|
|
13
|
+
dragCount: number;
|
|
14
|
+
/** IDs of blocks being dragged */
|
|
15
|
+
draggedIds: string[];
|
|
16
|
+
/** Move a block to a new position */
|
|
17
|
+
moveBlock: (blockId: string, toIndex: number) => void;
|
|
18
|
+
/** Move multiple blocks to a new position */
|
|
19
|
+
moveBlocks: (blockIds: string[], toIndex: number) => void;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Hook to access block DnD state and actions
|
|
23
|
+
*/
|
|
24
|
+
export declare const useBlockDnd: (options?: UseBlockDndOptions) => UseBlockDndReturn;
|
|
25
|
+
/**
|
|
26
|
+
* Get sorted block IDs from the editor
|
|
27
|
+
*/
|
|
28
|
+
export declare const getOrderedBlockIds: (editor: YooEditor) => string[];
|
|
29
|
+
//# sourceMappingURL=use-block-dnd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-block-dnd.d.ts","sourceRoot":"","sources":["../../src/block-dnd/use-block-dnd.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAIhD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,yCAAyC;IACzC,UAAU,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,eAAe,EAAE,OAAO,CAAC;IACzB,2DAA2D;IAC3D,iBAAiB,EAAE,OAAO,CAAC;IAC3B,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,qCAAqC;IACrC,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,6CAA6C;IAC7C,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,aAAa,kBAAkB,KAAQ,iBAiD9D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,WAAY,SAAS,KAAG,MAAM,EAM5D,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r,{useMemo as o,useLayoutEffect as i,useEffect as a,useRef as l,useCallback as c,useState as s,createContext as d,memo as u,useReducer as g,useContext as p,cloneElement as v,forwardRef as h,isValidElement as f}from"react";import{unstable_batchedUpdates as b,createPortal as y}from"react-dom";import{Blocks as m,useYooptaEditor as x}from"@yoopta/editor";import{s as w}from"./chunks/style-inject.es-e87a8d02.js";import{c as D}from"./chunks/createLucideIcon-8605f860.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v0.294.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/const k=D("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);const C="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function R(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function E(e){return"nodeType"in e}function N(e){var t,n;return e?R(e)?e:E(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function O(e){const{Document:t}=N(e);return e instanceof t}function S(e){return!R(e)&&e instanceof N(e).HTMLElement}function I(e){return e instanceof N(e).SVGElement}function A(e){return e?R(e)?e.document:E(e)?O(e)?e:S(e)||I(e)?e.ownerDocument:document:document:document}const T=C?i:a;function M(e){const t=l(e);return T(()=>{t.current=e}),c(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function j(e,t){void 0===t&&(t=[e]);const n=l(e);return T(()=>{n.current!==e&&(n.current=e)},t),n}function L(e,t){const n=l();return o(()=>{const t=e(n.current);return n.current=t,t},[...t])}function B(e){const t=M(e),n=l(null),r=c(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function P(e){const t=l();return a(()=>{t.current=e},[e]),t.current}let z={};function Y(e,t){return o(()=>{if(t)return t;const n=null==z[e]?0:z[e]+1;return z[e]=n,e+"-"+n},[e,t])}function F(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t},{...t})}}const X=F(1),K=F(-1);function U(e){if(!e)return!1;const{KeyboardEvent:t}=N(e.target);return t&&e instanceof t}function W(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=N(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const H=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[H.Translate.toString(e),H.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),J="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function V(e){return e.matches(J)?e:e.querySelector(J)}const q={display:"none"};function G(e){let{id:t,value:n}=e;return r.createElement("div",{id:t,style:q},n)}function Q(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;return r.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":o,"aria-atomic":!0},n)}const Z=d(null);const $={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},_={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function ee(e){let{announcements:t=_,container:n,hiddenTextDescribedById:i,screenReaderInstructions:l=$}=e;const{announce:d,announcement:u}=function(){const[e,t]=s("");return{announce:c(e=>{null!=e&&t(e)},[]),announcement:e}}(),g=Y("DndLiveRegion"),[v,h]=s(!1);if(a(()=>{h(!0)},[]),function(e){const t=p(Z);a(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(o(()=>({onDragStart(e){let{active:n}=e;d(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&d(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;d(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;d(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;d(t.onDragCancel({active:n,over:r}))}}),[d,t])),!v)return null;const f=r.createElement(r.Fragment,null,r.createElement(G,{id:i,value:l.draggable}),r.createElement(Q,{id:g,announcement:u}));return n?y(f,n):f}var te;function ne(){}function re(e,t){return o(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(te||(te={}));const oe=Object.freeze({x:0,y:0});function ie(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ae(e,t){const n=W(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function le(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function ce(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function se(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function de(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function ue(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const ge=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=ue(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=ie(ue(r),o);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(le)};function pe(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*l;return Number((o/(n+r-o)).toFixed(4))}return 0}const ve=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=pe(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(ce)};function he(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:oe}function fe(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const be=fe(1);function ye(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const me={ignoreTransform:!1};function xe(e,t){void 0===t&&(t=me);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=N(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=ye(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,c=e.left-a-(1-o)*parseFloat(n),s=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:s,right:c+d,bottom:s+u,left:c}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:l,right:c}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:c}}function we(e){return xe(e,{ignoreTransform:!0})}function De(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(O(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!S(o)||I(o))return n;if(n.includes(o))return n;const i=N(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=N(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=N(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function ke(e){const[t]=De(e,1);return null!=t?t:null}function Ce(e){return C&&e?R(e)?e:E(e)?O(e)||e===A(e).scrollingElement?window:S(e)?e:null:null:null}function Re(e){return R(e)?e.scrollX:e.scrollLeft}function Ee(e){return R(e)?e.scrollY:e.scrollTop}function Ne(e){return{x:Re(e),y:Ee(e)}}var Oe;function Se(e){return!(!C||!e)&&e===document.scrollingElement}function Ie(e){const t={x:0,y:0},n=Se(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(Oe||(Oe={}));const Ae={x:.2,y:.2};function Te(e,t,n,r,o){let{top:i,left:a,right:l,bottom:c}=n;void 0===r&&(r=10),void 0===o&&(o=Ae);const{isTop:s,isBottom:d,isLeft:u,isRight:g}=Ie(e),p={x:0,y:0},v={x:0,y:0},h=t.height*o.y,f=t.width*o.x;return!s&&i<=t.top+h?(p.y=Oe.Backward,v.y=r*Math.abs((t.top+h-i)/h)):!d&&c>=t.bottom-h&&(p.y=Oe.Forward,v.y=r*Math.abs((t.bottom-h-c)/h)),!g&&l>=t.right-f?(p.x=Oe.Forward,v.x=r*Math.abs((t.right-f-l)/f)):!u&&a<=t.left+f&&(p.x=Oe.Backward,v.x=r*Math.abs((t.left+f-a)/f)),{direction:p,speed:v}}function Me(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function je(e){return e.reduce((e,t)=>X(e,Ne(t)),oe)}function Le(e,t){if(void 0===t&&(t=xe),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);ke(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Be=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Re(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+Ee(t),0)}]];class Pe{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=De(t),r=je(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Be)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ze{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Ye(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var Fe,Xe;function Ke(e){e.preventDefault()}function Ue(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Fe||(Fe={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Xe||(Xe={}));const We={start:[Xe.Space,Xe.Enter],cancel:[Xe.Esc],end:[Xe.Space,Xe.Enter,Xe.Tab]},He=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Xe.Right:return{...n,x:n.x+25};case Xe.Left:return{...n,x:n.x-25};case Xe.Down:return{...n,y:n.y+25};case Xe.Up:return{...n,y:n.y-25}}};class Je{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ze(A(t)),this.windowListeners=new ze(N(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Fe.Resize,this.handleCancel),this.windowListeners.add(Fe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Fe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Le(n),t(oe)}handleKeyDown(e){if(U(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=We,coordinateGetter:i=He,scrollBehavior:a="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:c}=n.current,s=c?{x:c.left,y:c.top}:oe;this.referenceCoordinates||(this.referenceCoordinates=s);const d=i(e,{active:t,context:n.current,currentCoordinates:s});if(d){const t=K(d,s),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:l,isLeft:c,isBottom:s,maxScroll:u,minScroll:g}=Ie(n),p=Me(n),v={x:Math.min(o===Xe.Right?p.right-p.width/2:p.right,Math.max(o===Xe.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(o===Xe.Down?p.bottom-p.height/2:p.bottom,Math.max(o===Xe.Down?p.top:p.top+p.height/2,d.y))},h=o===Xe.Right&&!l||o===Xe.Left&&!c,f=o===Xe.Down&&!s||o===Xe.Up&&!i;if(h&&v.x!==d.x){const e=n.scrollLeft+t.x,i=o===Xe.Right&&e<=u.x||o===Xe.Left&&e>=g.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Xe.Right?n.scrollLeft-u.x:n.scrollLeft-g.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(f&&v.y!==d.y){const e=n.scrollTop+t.y,i=o===Xe.Down&&e<=u.y||o===Xe.Up&&e>=g.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Xe.Down?n.scrollTop-u.y:n.scrollTop-g.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,X(K(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Ve(e){return Boolean(e&&"distance"in e)}function qe(e){return Boolean(e&&"delay"in e)}Je.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=We,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class Ge{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=N(e);return e instanceof t?e:A(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=A(i),this.documentListeners=new ze(this.document),this.listeners=new ze(n),this.windowListeners=new ze(N(i)),this.initialCoordinates=null!=(r=W(o))?r:oe,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Fe.Resize,this.handleCancel),this.windowListeners.add(Fe.DragStart,Ke),this.windowListeners.add(Fe.VisibilityChange,this.handleCancel),this.windowListeners.add(Fe.ContextMenu,Ke),this.documentListeners.add(Fe.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(qe(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Ve(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Fe.Click,Ue,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Fe.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const l=null!=(t=W(e))?t:oe,c=K(r,l);if(!n&&a){if(Ve(a)){if(null!=a.tolerance&&Ye(c,a.tolerance))return this.handleCancel();if(Ye(c,a.distance))return this.handleStart()}return qe(a)&&Ye(c,a.tolerance)?this.handleCancel():void this.handlePending(a,c)}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Xe.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Qe={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ze extends Ge{constructor(e){const{event:t}=e,n=A(t.target);super(e,Qe,n)}}Ze.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const $e={move:{name:"mousemove"},end:{name:"mouseup"}};var _e;!function(e){e[e.RightClick=2]="RightClick"}(_e||(_e={}));(class extends Ge{constructor(e){super(e,$e,A(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==_e.RightClick&&(null==r||r({event:n}),!0)}}];const et={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var tt,nt;function rt(e){let{acceleration:t,activator:n=tt.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:d=5,order:u=nt.TreeOrder,pointerCoordinates:g,scrollableAncestors:p,scrollableAncestorRects:v,delta:h,threshold:f}=e;const b=function(e){let{delta:t,disabled:n}=e;const r=P(t);return L(e=>{if(n||!r||!e)return ot;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Oe.Backward]:e.x[Oe.Backward]||-1===o.x,[Oe.Forward]:e.x[Oe.Forward]||1===o.x},y:{[Oe.Backward]:e.y[Oe.Backward]||-1===o.y,[Oe.Forward]:e.y[Oe.Forward]||1===o.y}}},[n,t,r])}({delta:h,disabled:!s}),[y,m]=function(){const e=l(null);return[c((t,n)=>{e.current=setInterval(t,n)},[]),c(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),x=l({x:0,y:0}),w=l({x:0,y:0}),D=o(()=>{switch(n){case tt.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case tt.DraggableRect:return i}},[n,i,g]),k=l(null),C=c(()=>{const e=k.current;if(!e)return;const t=x.current.x*w.current.x,n=x.current.y*w.current.y;e.scrollBy(t,n)},[]),R=o(()=>u===nt.TreeOrder?[...p].reverse():p,[u,p]);a(()=>{if(s&&p.length&&D){for(const e of R){if(!1===(null==r?void 0:r(e)))continue;const n=p.indexOf(e),o=v[n];if(!o)continue;const{direction:i,speed:a}=Te(e,o,D,t,f);for(const e of["x","y"])b[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return m(),k.current=e,y(C,d),x.current=a,void(w.current=i)}x.current={x:0,y:0},w.current={x:0,y:0},m()}else m()},[t,C,r,m,s,d,JSON.stringify(D),JSON.stringify(b),y,p,R,v,JSON.stringify(f)])}(class extends Ge{constructor(e){super(e,et)}static setup(){return window.addEventListener(et.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(et.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(tt||(tt={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(nt||(nt={}));const ot={x:{[Oe.Backward]:!1,[Oe.Forward]:!1},y:{[Oe.Backward]:!1,[Oe.Forward]:!1}};var it,at;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(it||(it={})),function(e){e.Optimized="optimized"}(at||(at={}));const lt=new Map;function ct(e,t){return L(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function st(e){let{callback:t,disabled:n}=e;const r=M(t),i=o(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return a(()=>()=>null==i?void 0:i.disconnect(),[i]),i}function dt(e){return new Pe(xe(e),e)}function ut(e,t,n){void 0===t&&(t=dt);const[r,i]=s(null);function l(){i(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}const c=function(e){let{callback:t,disabled:n}=e;const r=M(t),i=o(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return a(()=>()=>null==i?void 0:i.disconnect(),[i]),i}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){l();break}}}}),d=st({callback:l});return T(()=>{l(),e?(null==d||d.observe(e),null==c||c.observe(document.body,{childList:!0,subtree:!0})):(null==d||d.disconnect(),null==c||c.disconnect())},[e]),r}const gt=[];function pt(e,t){void 0===t&&(t=[]);const n=l(null);return a(()=>{n.current=null},t),a(()=>{const t=e!==oe;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?K(e,n.current):oe}function vt(e){return o(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const ht=[];function ft(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return S(t)?t:e}const bt=[{sensor:Ze,options:{}},{sensor:Je,options:{}}],yt={current:{}},mt={draggable:{measure:we},droppable:{measure:we,strategy:it.WhileDragging,frequency:at.Optimized},dragOverlay:{measure:xe}};class xt extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const wt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new xt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ne},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:mt,measureDroppableContainers:ne,windowRect:null,measuringScheduled:!1},Dt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ne,draggableNodes:new Map,over:null,measureDroppableContainers:ne},kt=d(Dt),Ct=d(wt);function Rt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new xt}}}function Et(e,t){switch(t.type){case te.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case te.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case te.DragEnd:case te.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case te.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new xt(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case te.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new xt(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case te.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new xt(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Nt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=p(kt),i=P(r),l=P(null==n?void 0:n.id);return a(()=>{if(!t&&!r&&i&&null!=l){if(!U(i))return;if(document.activeElement===i.target)return;const e=o.get(l);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=V(e);if(t){t.focus();break}}})}},[r,t,o,l,i]),null}function Ot(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const St=d({...oe,scaleX:1,scaleY:1});var It;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(It||(It={}));const At=u(function(e){var t,n,i,d;let{id:u,accessibility:p,autoScroll:v=!0,children:h,sensors:f=bt,collisionDetection:y=ve,measuring:m,modifiers:x,...w}=e;const D=g(Et,void 0,Rt),[k,R]=D,[E,O]=function(){const[e]=s(()=>new Set),t=c(t=>(e.add(t),()=>e.delete(t)),[e]);return[c(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[I,A]=s(It.Uninitialized),M=I===It.Initialized,{draggable:{active:P,nodes:z,translate:F},droppable:{containers:K}}=k,U=null!=P?z.get(P):null,H=l({initial:null,translated:null}),J=o(()=>{var e;return null!=P?{id:P,data:null!=(e=null==U?void 0:U.data)?e:yt,rect:H}:null},[P,U]),V=l(null),[q,G]=s(null),[Q,$]=s(null),_=j(w,Object.values(w)),ne=Y("DndDescribedBy",u),re=o(()=>K.getEnabled(),[K]),ie=o(()=>({draggable:{...mt.draggable,...null==ae?void 0:ae.draggable},droppable:{...mt.droppable,...null==ae?void 0:ae.droppable},dragOverlay:{...mt.dragOverlay,...null==ae?void 0:ae.dragOverlay}}),[null==(ae=m)?void 0:ae.draggable,null==ae?void 0:ae.droppable,null==ae?void 0:ae.dragOverlay]);var ae;const{droppableRects:le,measureDroppableContainers:ce,measuringScheduled:se}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,d]=s(null),{frequency:u,measure:g,strategy:p}=o,v=l(e),h=function(){switch(p){case it.Always:return!1;case it.BeforeDragging:return n;default:return!n}}(),f=j(h),b=c(function(e){void 0===e&&(e=[]),f.current||d(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),y=l(null),m=L(t=>{if(h&&!n)return lt;if(!t||t===lt||v.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new Pe(g(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,h,g]);return a(()=>{v.current=e},[e]),a(()=>{h||b()},[n,h]),a(()=>{i&&i.length>0&&d(null)},[JSON.stringify(i)]),a(()=>{h||"number"!=typeof u||null!==y.current||(y.current=setTimeout(()=>{b(),y.current=null},u))},[u,h,b,...r]),{droppableRects:m,measureDroppableContainers:b,measuringScheduled:null!=i}}(re,{dragging:M,dependencies:[F.x,F.y],config:ie.droppable}),ue=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return L(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(z,P),ge=o(()=>Q?W(Q):null,[Q]),pe=function(){const e=!1===(null==q?void 0:q.autoScrollEnabled),t="object"==typeof v?!1===v.enabled:!1===v,n=M&&!e&&!t;if("object"==typeof v)return{...v,enabled:n};return{enabled:n}}(),fe=function(e,t){return ct(e,t)}(ue,ie.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=l(!1),{x:a,y:c}="boolean"==typeof o?{x:o,y:o}:o;T(()=>{if(!a&&!c||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=he(n(e),r);if(a||(o.x=0),c||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=ke(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,c,r,n])}({activeNode:null!=P?z.get(P):null,config:pe.layoutShiftCompensation,initialRect:fe,measure:ie.draggable.measure});const ye=ut(ue,ie.draggable.measure,fe),me=ut(ue?ue.parentElement:null),we=l({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:le,draggableNodes:z,draggingNode:null,draggingNodeRect:null,droppableContainers:K,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Re=K.getNodeFor(null==(t=we.current.over)?void 0:t.id),Ee=function(e){let{measure:t}=e;const[n,r]=s(null),i=st({callback:c(e=>{for(const{target:n}of e)if(S(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),a=c(e=>{const n=ft(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)},[t,i]),[l,d]=B(a);return o(()=>({nodeRef:l,rect:n,setRef:d}),[n,l,d])}({measure:ie.dragOverlay.measure}),Oe=null!=(n=Ee.nodeRef.current)?n:ue,Ie=M?null!=(i=Ee.rect)?i:ye:null,Ae=Boolean(Ee.nodeRef.current&&Ee.rect),Te=he(Me=Ae?null:ye,ct(Me));var Me;const Le=vt(Oe?N(Oe):null),Be=function(e){const t=l(e),n=L(n=>e?n&&n!==gt&&e&&t.current&&e.parentNode===t.current.parentNode?n:De(e):gt,[e]);return a(()=>{t.current=e},[e]),n}(M?null!=Re?Re:ue:null),ze=function(e,t){void 0===t&&(t=xe);const[n]=e,r=vt(n?N(n):null),[o,i]=s(ht);function a(){i(()=>e.length?e.map(e=>Se(e)?r:new Pe(t(e),e)):ht)}const l=st({callback:a});return T(()=>{null==l||l.disconnect(),a(),e.forEach(e=>null==l?void 0:l.observe(e))},[e]),o}(Be),Ye=Ot(x,{transform:{x:F.x-Te.x,y:F.y-Te.y,scaleX:1,scaleY:1},activatorEvent:Q,active:J,activeNodeRect:ye,containerNodeRect:me,draggingNodeRect:Ie,over:we.current.over,overlayNodeRect:Ee.rect,scrollableAncestors:Be,scrollableAncestorRects:ze,windowRect:Le}),Fe=ge?X(ge,F):null,Xe=function(e){const[t,n]=s(null),r=l(e),i=c(e=>{const t=Ce(e.target);t&&n(e=>e?(e.set(t,Ne(t)),new Map(e)):null)},[]);return a(()=>{const t=r.current;if(e!==t){o(t);const a=e.map(e=>{const t=Ce(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,Ne(t)]):null}).filter(e=>null!=e);n(a.length?new Map(a):null),r.current=e}return()=>{o(e),o(t)};function o(e){e.forEach(e=>{const t=Ce(e);null==t||t.removeEventListener("scroll",i)})}},[i,e]),o(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>X(e,t),oe):je(e):oe,[e,t])}(Be),Ke=pt(Xe),Ue=pt(Xe,[ye]),We=X(Ye,Ke),He=Ie?be(Ie,Ye):null,Je=J&&He?y({active:J,collisionRect:He,droppableRects:le,droppableContainers:re,pointerCoordinates:Fe}):null,Ve=de(Je,"id"),[qe,Ge]=s(null),Qe=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Ae?Ye:X(Ye,Ue),null!=(d=null==qe?void 0:qe.rect)?d:null,ye),Ze=l(null),$e=c((e,t)=>{let{sensor:n,options:r}=t;if(null==V.current)return;const o=z.get(V.current);if(!o)return;const i=e.nativeEvent,a=new n({active:V.current,activeNode:o,event:i,options:r,context:we,onAbort(e){if(!z.get(e))return;const{onDragAbort:t}=_.current,n={id:e};null==t||t(n),E({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!z.get(e))return;const{onDragPending:o}=_.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),E({type:"onDragPending",event:i})},onStart(e){const t=V.current;if(null==t)return;const n=z.get(t);if(!n)return;const{onDragStart:r}=_.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:H}};b(()=>{null==r||r(o),A(It.Initializing),R({type:te.DragStart,initialCoordinates:e,active:t}),E({type:"onDragStart",event:o}),G(Ze.current),$(i)})},onMove(e){R({type:te.DragMove,coordinates:e})},onEnd:l(te.DragEnd),onCancel:l(te.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=we.current;let a=null;if(t&&o){const{cancelDrop:l}=_.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===te.DragEnd&&"function"==typeof l){await Promise.resolve(l(a))&&(e=te.DragCancel)}}V.current=null,b(()=>{R({type:e}),A(It.Uninitialized),Ge(null),G(null),$(null),Ze.current=null;const t=e===te.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=_.current[t];null==e||e(a),E({type:t,event:a})}})}}Ze.current=a},[z]),_e=c((e,t)=>(n,r)=>{const o=n.nativeEvent,i=z.get(r);if(null!==V.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},V.current=r,$e(n,t))},[z,$e]),et=function(e,t){return o(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(f,_e);!function(e){a(()=>{if(!C)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(f),T(()=>{ye&&I===It.Initializing&&A(It.Initialized)},[ye,I]),a(()=>{const{onDragMove:e}=_.current,{active:t,activatorEvent:n,collisions:r,over:o}=we.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:We.x,y:We.y},over:o};b(()=>{null==e||e(i),E({type:"onDragMove",event:i})})},[We.x,We.y]),a(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=we.current;if(!e||null==V.current||!t||!o)return;const{onDragOver:i}=_.current,a=r.get(Ve),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};b(()=>{Ge(l),null==i||i(c),E({type:"onDragOver",event:c})})},[Ve]),T(()=>{we.current={activatorEvent:Q,active:J,activeNode:ue,collisionRect:He,collisions:Je,droppableRects:le,draggableNodes:z,draggingNode:Oe,draggingNodeRect:Ie,droppableContainers:K,over:qe,scrollableAncestors:Be,scrollAdjustedTranslate:We},H.current={initial:Ie,translated:He}},[J,ue,Je,He,z,Oe,Ie,le,K,qe,Be,We]),rt({...pe,delta:F,draggingRect:He,pointerCoordinates:Fe,scrollableAncestors:Be,scrollableAncestorRects:ze});const tt=o(()=>({active:J,activeNode:ue,activeNodeRect:ye,activatorEvent:Q,collisions:Je,containerNodeRect:me,dragOverlay:Ee,draggableNodes:z,droppableContainers:K,droppableRects:le,over:qe,measureDroppableContainers:ce,scrollableAncestors:Be,scrollableAncestorRects:ze,measuringConfiguration:ie,measuringScheduled:se,windowRect:Le}),[J,ue,ye,Q,Je,me,Ee,z,K,le,qe,ce,Be,ze,ie,se,Le]),nt=o(()=>({activatorEvent:Q,activators:et,active:J,activeNodeRect:ye,ariaDescribedById:{draggable:ne},dispatch:R,draggableNodes:z,over:qe,measureDroppableContainers:ce}),[Q,et,J,ye,R,ne,z,qe,ce]);return r.createElement(Z.Provider,{value:O},r.createElement(kt.Provider,{value:nt},r.createElement(Ct.Provider,{value:tt},r.createElement(St.Provider,{value:Qe},h)),r.createElement(Nt,{disabled:!1===(null==p?void 0:p.restoreFocus)})),r.createElement(ee,{...p,hiddenTextDescribedById:ne}))}),Tt=d(null),Mt="button";function jt(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const a=Y("Draggable"),{activators:l,activatorEvent:c,active:s,activeNodeRect:d,ariaDescribedById:u,draggableNodes:g,over:v}=p(kt),{role:h=Mt,roleDescription:f="draggable",tabIndex:b=0}=null!=i?i:{},y=(null==s?void 0:s.id)===t,m=p(y?St:Tt),[x,w]=B(),[D,k]=B(),C=function(e,t){return o(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(l,t),R=j(n);T(()=>(g.set(t,{id:t,key:a,node:x,activatorNode:D,data:R}),()=>{const e=g.get(t);e&&e.key===a&&g.delete(t)}),[g,t]);return{active:s,activatorEvent:c,activeNodeRect:d,attributes:o(()=>({role:h,tabIndex:b,"aria-disabled":r,"aria-pressed":!(!y||h!==Mt)||void 0,"aria-roledescription":f,"aria-describedby":u.draggable}),[r,h,b,y,f,u.draggable]),isDragging:y,listeners:r?void 0:C,node:x,over:v,setNodeRef:w,setActivatorNodeRef:k,transform:m}}function Lt(){return p(Ct)}const Bt={timeout:25};function Pt(e){let{animation:t,children:n}=e;const[o,i]=s(null),[a,l]=s(null),c=P(n);return n||o||!c||i(c),T(()=>{if(!a)return;const e=null==o?void 0:o.key,n=null==o?void 0:o.props.id;null!=e&&null!=n?Promise.resolve(t(n,a)).then(()=>{i(null)}):i(null)},[t,o,a]),r.createElement(r.Fragment,null,n,o?v(o,{ref:l}):null)}const zt={x:0,y:0,scaleX:1,scaleY:1};function Yt(e){let{children:t}=e;return r.createElement(kt.Provider,{value:Dt},r.createElement(St.Provider,{value:zt},t))}const Ft={position:"fixed",touchAction:"none"},Xt=e=>U(e)?"transform 250ms ease":void 0,Kt=h((e,t)=>{let{as:n,activatorEvent:o,adjustScale:i,children:a,className:l,rect:c,style:s,transform:d,transition:u=Xt}=e;if(!c)return null;const g=i?d:{...d,scaleX:1,scaleY:1},p={...Ft,width:c.width,height:c.height,top:c.top,left:c.left,transform:H.Transform.toString(g),transformOrigin:i&&o?ae(o,c):void 0,transition:"function"==typeof u?u(o):u,...s};return r.createElement(n,{className:l,style:p,ref:t},a)}),Ut=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:a}=e;if(null!=i&&i.active)for(const[e,t]of Object.entries(i.active))void 0!==t&&(o[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=i&&i.dragOverlay)for(const[e,t]of Object.entries(i.dragOverlay))void 0!==t&&r.node.style.setProperty(e,t);return null!=a&&a.active&&n.node.classList.add(a.active),null!=a&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[e,t]of Object.entries(o))n.node.style.setProperty(e,t);null!=a&&a.active&&n.node.classList.remove(a.active)}},Wt={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:H.Transform.toString(t)},{transform:H.Transform.toString(n)}]},sideEffects:Ut({styles:{active:{opacity:"0"}}})};function Ht(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return M((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const l=a.node.current;if(!l)return;const c=ft(i);if(!c)return;const{transform:s}=N(i).getComputedStyle(i),d=ye(s);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Wt,...e};return e=>{let{active:i,dragOverlay:a,transform:l,...c}=e;if(!t)return;const s={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},d={scaleX:1!==l.scaleX?i.rect.width*l.scaleX/a.rect.width:1,scaleY:1!==l.scaleY?i.rect.height*l.scaleY/a.rect.height:1},u={x:l.x-s.x,y:l.y-s.y,...d},g=o({...c,active:i,dragOverlay:a,transform:{initial:l,final:u}}),[p]=g,v=g[g.length-1];if(JSON.stringify(p)===JSON.stringify(v))return;const h=null==r?void 0:r({active:i,dragOverlay:a,...c}),f=a.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{f.onfinish=()=>{null==h||h(),e()}})}}(t);return Le(l,o.draggable.measure),u({active:{id:e,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:o,transform:d})})}let Jt=0;function Vt(e){return o(()=>{if(null!=e)return Jt++,Jt},[e])}const qt=r.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:i,transition:a,modifiers:l,wrapperElement:c="div",className:s,zIndex:d=999}=e;const{activatorEvent:u,active:g,activeNodeRect:v,containerNodeRect:h,draggableNodes:f,droppableContainers:b,dragOverlay:y,over:m,measuringConfiguration:x,scrollableAncestors:w,scrollableAncestorRects:D,windowRect:k}=Lt(),C=p(St),R=Vt(null==g?void 0:g.id),E=Ot(l,{activatorEvent:u,active:g,activeNodeRect:v,containerNodeRect:h,draggingNodeRect:y.rect,over:m,overlayNodeRect:y.rect,scrollableAncestors:w,scrollableAncestorRects:D,transform:C,windowRect:k}),N=ct(v),O=Ht({config:o,draggableNodes:f,droppableContainers:b,measuringConfiguration:x}),S=N?y.setRef:void 0;return r.createElement(Yt,null,r.createElement(Pt,{animation:O},g&&R?r.createElement(Kt,{key:R,id:g.id,ref:S,as:c,activatorEvent:u,adjustScale:t,className:s,transition:a,rect:N,style:{zIndex:d,...i},transform:E},n):null))});function Gt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Qt(e,t){return e.reduce((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e},Array(e.length))}function Zt(e){return null!==e&&e>=0}const $t=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Gt(t,r,n),a=t[o],l=i[o];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},_t={scaleX:1,scaleY:1},en=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:a}=e;const l=null!=(t=i[n])?t:r;if(!l)return null;if(o===n){const e=i[a];return e?{x:0,y:n<a?e.top+e.height-(l.top+l.height):e.top-l.top,..._t}:null}const c=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];if(!r)return 0;if(n<t)return o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0;return i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0}(i,o,n);return o>n&&o<=a?{x:0,y:-l.height-c,..._t}:o<n&&o>=a?{x:0,y:l.height+c,..._t}:{x:0,y:0,..._t}};const tn="Sortable",nn=r.createContext({activeIndex:-1,containerId:tn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:$t,disabled:{draggable:!1,droppable:!1}});function rn(e){let{children:t,id:n,items:i,strategy:c=$t,disabled:s=!1}=e;const{active:d,dragOverlay:u,droppableRects:g,over:p,measureDroppableContainers:v}=Lt(),h=Y(tn,n),f=Boolean(null!==u.rect),b=o(()=>i.map(e=>"object"==typeof e&&"id"in e?e.id:e),[i]),y=null!=d,m=d?b.indexOf(d.id):-1,x=p?b.indexOf(p.id):-1,w=l(b),D=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(b,w.current),k=-1!==x&&-1===m||D,C=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(s);T(()=>{D&&y&&v(b)},[D,b,y,v]),a(()=>{w.current=b},[b]);const R=o(()=>({activeIndex:m,containerId:h,disabled:C,disableTransforms:k,items:b,overIndex:x,useDragOverlay:f,sortedRects:Qt(b,g),strategy:c}),[m,h,C.draggable,C.droppable,k,b,x,g,f,c]);return r.createElement(nn.Provider,{value:R},t)}const on=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Gt(n,r,o).indexOf(t)},an=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:s}=e;return!(!s||!r)&&((l===i||o!==a)&&(!!n||a!==o&&t===c))},ln={duration:200,easing:"ease"},cn="transform",sn=H.Transition.toString({property:cn,duration:0,easing:"linear"}),dn={roleDescription:"sortable"};function un(e){let{animateLayoutChanges:t=an,attributes:n,disabled:r,data:i,getNewIndex:d=on,id:u,strategy:g,resizeObserverConfig:v,transition:h=ln}=e;const{items:f,containerId:b,activeIndex:y,disabled:m,disableTransforms:x,sortedRects:w,overIndex:D,useDragOverlay:k,strategy:C}=p(nn),R=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(r,m),E=f.indexOf(u),N=o(()=>({sortable:{containerId:b,index:E,items:f},...i}),[b,i,E,f]),O=o(()=>f.slice(f.indexOf(u)),[f,u]),{rect:S,node:I,isOver:A,setNodeRef:M}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Y("Droppable"),{active:s,dispatch:d,over:u,measureDroppableContainers:g}=p(kt),v=l({disabled:n}),h=l(!1),f=l(null),b=l(null),{disabled:y,updateMeasurementsFor:m,timeout:x}={...Bt,...o},w=j(null!=m?m:r),D=st({callback:c(()=>{h.current?(null!=b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{g(Array.isArray(w.current)?w.current:[w.current]),b.current=null},x)):h.current=!0},[x]),disabled:y||!s}),k=c((e,t)=>{D&&(t&&(D.unobserve(t),h.current=!1),e&&D.observe(e))},[D]),[C,R]=B(k),E=j(t);return a(()=>{D&&C.current&&(D.disconnect(),h.current=!1,D.observe(C.current))},[C,D]),a(()=>(d({type:te.RegisterDroppable,element:{id:r,key:i,disabled:n,node:C,rect:f,data:E}}),()=>d({type:te.UnregisterDroppable,key:i,id:r})),[r]),a(()=>{n!==v.current.disabled&&(d({type:te.SetDroppableDisabled,id:r,key:i,disabled:n}),v.current.disabled=n)},[r,i,n,d]),{active:s,rect:f,isOver:(null==u?void 0:u.id)===r,node:C,over:u,setNodeRef:R}}({id:u,data:N,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...v}}),{active:L,activatorEvent:P,activeNodeRect:z,attributes:F,setNodeRef:X,listeners:K,isDragging:W,over:J,setActivatorNodeRef:V,transform:q}=jt({id:u,data:N,attributes:{...dn,...n},disabled:R.draggable}),G=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o(()=>e=>{t.forEach(t=>t(e))},t)}(M,X),Q=Boolean(L),Z=Q&&!x&&Zt(y)&&Zt(D),$=!k&&W,_=$&&Z?q:null,ee=Z?null!=_?_:(null!=g?g:C)({rects:w,activeNodeRect:z,activeIndex:y,overIndex:D,index:E}):null,ne=Zt(y)&&Zt(D)?d({id:u,items:f,activeIndex:y,overIndex:D}):E,re=null==L?void 0:L.id,oe=l({activeId:re,items:f,newIndex:ne,containerId:b}),ie=f!==oe.current.items,ae=t({active:L,containerId:b,isDragging:W,isSorting:Q,id:u,index:E,items:f,newIndex:oe.current.newIndex,previousItems:oe.current.items,previousContainerId:oe.current.containerId,transition:h,wasDragging:null!=oe.current.activeId}),le=function(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,c]=s(null),d=l(n);return T(()=>{if(!t&&n!==d.current&&r.current){const e=o.current;if(e){const t=xe(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&c(n)}}n!==d.current&&(d.current=n)},[t,n,r,o]),a(()=>{i&&c(null)},[i]),i}({disabled:!ae,index:E,node:I,rect:S});return a(()=>{Q&&oe.current.newIndex!==ne&&(oe.current.newIndex=ne),b!==oe.current.containerId&&(oe.current.containerId=b),f!==oe.current.items&&(oe.current.items=f)},[Q,ne,b,f]),a(()=>{if(re===oe.current.activeId)return;if(re&&!oe.current.activeId)return void(oe.current.activeId=re);const e=setTimeout(()=>{oe.current.activeId=re},50);return()=>clearTimeout(e)},[re]),{active:L,activeIndex:y,attributes:F,data:N,rect:S,index:E,newIndex:ne,items:f,isOver:A,isSorting:Q,isDragging:W,listeners:K,node:I,overIndex:D,over:J,setNodeRef:G,setActivatorNodeRef:V,setDroppableNodeRef:M,setDraggableNodeRef:X,transform:null!=le?le:ee,transition:function(){if(le||ie&&oe.current.newIndex===E)return sn;if($&&!U(P)||!h)return;if(Q||ae)return H.Transition.toString({...h,property:cn});return}()}}function gn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const pn=[Xe.Down,Xe.Right,Xe.Up,Xe.Left],vn=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:a,scrollableAncestors:l}}=t;if(pn.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];i.getEnabled().forEach(n=>{if(!n||null!=n&&n.disabled)return;const i=o.get(n.id);if(i)switch(e.code){case Xe.Down:r.top<i.top&&t.push(n);break;case Xe.Up:r.top>i.top&&t.push(n);break;case Xe.Left:r.left>i.left&&t.push(n);break;case Xe.Right:r.left<i.left&&t.push(n)}});const c=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=se(t),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=se(r),a=o.reduce((e,t,r)=>e+ie(n[r],t),0),l=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:l}})}}return i.sort(le)})({active:n,collisionRect:r,droppableRects:o,droppableContainers:t,pointerCoordinates:null});let s=de(c,"id");if(s===(null==a?void 0:a.id)&&c.length>1&&(s=c[1].id),null!=s){const e=i.get(n.id),t=i.get(s),a=t?o.get(t.id):null,c=null==t?void 0:t.node.current;if(c&&a&&e&&t){const n=De(c).some((e,t)=>l[t]!==e),o=hn(e,t),i=function(e,t){if(!gn(e)||!gn(t))return!1;if(!hn(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),s=n||!o?{x:0,y:0}:{x:i?r.width-a.width:0,y:i?r.height-a.height:0},d={x:a.left,y:a.top};return s.x&&s.y?d:K(d,s)}}}};function hn(e,t){return!(!gn(e)||!gn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}w(':root{--yoopta-ui-background:0 0% 100%;--yoopta-ui-foreground:222.2 84% 4.9%;--yoopta-ui-muted:210 40% 96.1%;--yoopta-ui-muted-foreground:215.4 16.3% 46.9%;--yoopta-ui-border:214.3 31.8% 91.4%;--yoopta-ui-ring:222.2 84% 4.9%;--yoopta-ui-accent:210 40% 96.1%;--yoopta-ui-accent-foreground:222.2 47.4% 11.2%;--yoopta-ui-primary:221.2 83.2% 53.3%;--yoopta-ui-primary-foreground:210 40% 98%;--yoopta-ui-destructive:0 84.2% 60.2%;--yoopta-ui-destructive-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.05);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.18),0 4px 16px -4px rgba(0,0,0,.1);--yoopta-ui-radius-sm:0.375rem;--yoopta-ui-radius:0.5rem;--yoopta-ui-radius-lg:0.625rem;--yoopta-ui-z-dropdown:50;--yoopta-ui-z-sticky:100;--yoopta-ui-z-overlay:200;--yoopta-ui-z-modal:9999;--yoopta-ui-transition-fast:100ms ease;--yoopta-ui-transition:150ms ease;--yoopta-ui-transition-slow:200ms ease}.dark,[data-theme=dark],[data-yoopta-theme=dark]{--yoopta-ui-background:222.2 84% 4.9%;--yoopta-ui-foreground:210 40% 98%;--yoopta-ui-muted:217.2 32.6% 17.5%;--yoopta-ui-muted-foreground:215 20.2% 65.1%;--yoopta-ui-border:217.2 32.6% 17.5%;--yoopta-ui-ring:212.7 26.8% 83.9%;--yoopta-ui-accent:217.2 32.6% 17.5%;--yoopta-ui-accent-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.3);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.4),0 2px 4px -2px rgba(0,0,0,.3);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.5),0 4px 6px -4px rgba(0,0,0,.3);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.5),0 4px 16px -4px rgba(0,0,0,.3)}:root{--yoopta-ui-block-dnd-overlay-shadow:0 10px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--yoopta-ui-block-dnd-overlay-radius:0.5rem;--yoopta-ui-block-dnd-overlay-padding-y:10px;--yoopta-ui-block-dnd-overlay-padding-x:14px;--yoopta-ui-block-dnd-overlay-min-width:140px;--yoopta-ui-block-dnd-transition:transform 200ms ease,opacity 200ms ease}.yoopta-ui-block-dnd-sortable{position:relative;transition:var(--yoopta-ui-block-dnd-transition)}.yoopta-ui-block-dnd-sortable--dragging{cursor:grabbing;z-index:1000}.yoopta-ui-block-dnd-drop-indicator{background-color:hsl(var(--yoopta-ui-primary));border-radius:1px;height:2px;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:100}.yoopta-ui-block-dnd-drop-indicator:after,.yoopta-ui-block-dnd-drop-indicator:before{background-color:hsl(var(--yoopta-ui-primary));border-radius:50%;content:"";height:6px;position:absolute;top:50%;transform:translateY(-50%);width:6px}.yoopta-ui-block-dnd-drop-indicator:before{left:-3px}.yoopta-ui-block-dnd-drop-indicator:after{right:-3px}.yoopta-ui-block-dnd-handle{cursor:grab;transition:opacity .15s ease}.yoopta-ui-block-dnd-handle:hover{opacity:.8}.yoopta-ui-block-dnd-handle:focus{outline:none}.yoopta-ui-block-dnd-handle:focus-visible{border-radius:4px;outline:2px solid hsl(var(--yoopta-ui-ring));outline-offset:2px}.yoopta-ui-block-dnd-handle--holding{cursor:grabbing;opacity:.7}.yoopta-ui-block-dnd-handle--dragging{cursor:grabbing;opacity:.5}.yoopta-ui-block-dnd-handle:disabled{cursor:not-allowed;opacity:.3}.yoopta-ui-block-dnd-overlay{align-items:center;animation:yoopta-ui-block-dnd-overlay-fade-in .15s ease;background-color:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-block-dnd-overlay-radius);box-shadow:var(--yoopta-ui-block-dnd-overlay-shadow);display:flex;gap:10px;min-width:var(--yoopta-ui-block-dnd-overlay-min-width);padding:var(--yoopta-ui-block-dnd-overlay-padding-y) var(--yoopta-ui-block-dnd-overlay-padding-x);pointer-events:none}.yoopta-ui-block-dnd-overlay-icon{align-items:center;color:hsl(var(--yoopta-ui-muted-foreground));display:flex;flex-shrink:0;height:20px;justify-content:center;width:20px}.yoopta-ui-block-dnd-overlay-content{align-items:center;display:flex;flex:1;min-width:0}.yoopta-ui-block-dnd-overlay-text{color:hsl(var(--yoopta-ui-foreground));font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.yoopta-ui-block-dnd-overlay-text strong{color:hsl(var(--yoopta-ui-foreground));font-weight:600}[data-block-dnd-dragging=true]{opacity:.5;pointer-events:none}.yoopta-ui-block-dnd-sortable:focus{outline:none}.yoopta-ui-block-dnd-sortable:focus-visible{border-radius:4px;outline:2px solid hsl(var(--yoopta-ui-ring));outline-offset:2px}@keyframes yoopta-ui-block-dnd-overlay-fade-in{0%{opacity:0;transform:scale(.95) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}');const fn=d(null),bn=()=>{const e=p(fn);if(!e)throw new Error("useBlockDndContext must be used within a BlockDndContext");return e},yn=({transform:e})=>Object.assign(Object.assign({},e),{x:0}),mn=({editor:r,children:i,onDragStart:a,onDragEnd:d,renderDragOverlay:u,enableMultiDrag:g=!0})=>{var p;const[v,h]=s(null),[f,b]=s([]),y=l(new Map),x=o(()=>Object.keys(r.children).sort((e,t)=>r.children[e].meta.order-r.children[t].meta.order),[r.children]),w=v&&null!==(p=r.children[v])&&void 0!==p?p:null,D=o(()=>f.map(e=>r.children[e]).filter(Boolean),[f,r.children]),C=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o(()=>[...t].filter(e=>null!=e),[...t])}(re(Ze,{activationConstraint:{distance:5}}),re(Je,{coordinateGetter:vn})),R=c(e=>{const{active:t}=e;h(t.id);const n=r.path.selected;let o=[t.id];if(g&&Array.isArray(n)&&n.length>1){const e=n.map(e=>{const t=m.getBlock(r,{at:e});return null==t?void 0:t.id}).filter(e=>void 0!==e);e.includes(t.id)&&(o=e)}b(o);const i=o.map(e=>r.children[e]).filter(Boolean);null==a||a(e,i)},[r,g,a]),E=c(e=>{const{active:t,over:n}=e;if(h(null),b([]),!n||t.id===n.id)return void(null==d||d(e,!1));const o=r.children[t.id],i=r.children[n.id];if(!o||!i)return void(null==d||d(e,!1));const a=o.meta.order,l=i.meta.order;a!==l?(r.batchOperations(()=>{if(f.length>1){const e=[...f].sort((e,t)=>{var n,o,i,a;return(null!==(o=null===(n=r.children[e])||void 0===n?void 0:n.meta.order)&&void 0!==o?o:0)-(null!==(a=null===(i=r.children[t])||void 0===i?void 0:i.meta.order)&&void 0!==a?a:0)}),t=l;e.forEach((e,n)=>{r.moveBlock(e,t+n)})}else r.moveBlock(t.id,l)}),r.setPath({current:l,selected:null}),null==d||d(e,!0)):null==d||d(e,!1)},[r,f,d]),N=c((e,t)=>{y.current.set(e,t)},[]),O=c(e=>{y.current.delete(e)},[]),S=c(e=>y.current.get(e)||null,[]),I=o(()=>({activeId:v,activeBlock:w,isDragging:null!==v,draggedIds:f,editor:r,registerSortable:N,unregisterSortable:O,getSortable:S}),[v,w,f,r,N,O,S]),A=D.length>0&&e("div",Object.assign({className:"yoopta-ui-block-dnd-overlay"},{children:[t("div",Object.assign({className:"yoopta-ui-block-dnd-overlay-icon"},{children:t(k,{size:16})})),t("div",Object.assign({className:"yoopta-ui-block-dnd-overlay-content"},{children:t("span",Object.assign({className:"yoopta-ui-block-dnd-overlay-text"},{children:1===D.length?t(n,{children:"Moving block"}):e(n,{children:["Moving ",t("strong",{children:D.length})," blocks"]})}))}))]}));return t(fn.Provider,Object.assign({value:I},{children:e(At,Object.assign({sensors:C,collisionDetection:ge,onDragStart:R,onDragEnd:E,modifiers:[yn]},{children:[t(rn,Object.assign({items:x,strategy:en},{children:i})),t(qt,Object.assign({dropAnimation:null},{children:v?u?u(D):A:null}))]}))}))},xn=({id:n,children:r,className:o,disabled:i=!1,useDragHandle:l=!0})=>{const{draggedIds:c,isDragging:s,registerSortable:d,unregisterSortable:u}=bn(),g=x(),{attributes:p,listeners:v,setNodeRef:h,setActivatorNodeRef:f,transform:b,transition:y,isDragging:m,isOver:w}=un({id:n,disabled:i||g.readOnly});a(()=>{if(l)return d(n,{setActivatorNodeRef:f,listeners:v,attributes:p}),()=>{u(n)}},[n,l,f,v,p,d,u]);const D=c.includes(n)&&c.length>1,k=m||s&&c.includes(n),C={transform:H.Transform.toString(b),transition:y,opacity:k?.5:1,position:"relative"},R=["yoopta-ui-block-dnd-sortable",m&&"yoopta-ui-block-dnd-sortable--dragging",w&&"yoopta-ui-block-dnd-sortable--over",D&&"yoopta-ui-block-dnd-sortable--multi",o].filter(Boolean).join(" ");return e("div",Object.assign({ref:h,style:C,className:R},l?{}:p,l?{}:v,{"data-block-dnd-id":n,"data-block-dnd-dragging":k||void 0,"data-block-dnd-over":w||void 0},{children:[r,w&&!m&&t("div",{className:"yoopta-ui-block-dnd-drop-indicator"})]}))},wn=h(({blockId:e,children:n,className:r,onClick:o,asChild:i=!1},d)=>{const{isDragging:u,getSortable:g}=bn(),[p,h]=s(!1),b=l(!1),y=e?g(e):null,m=l(d);m.current=d;const x=c(e=>{y&&y.setActivatorNodeRef(e);const t=m.current;"function"==typeof t?t(e):t&&(t.current=e)},[y]);a(()=>{if(!u){const e=setTimeout(()=>{b.current=!1,h(!1)},100);return()=>clearTimeout(e)}b.current=!0,h(!0)},[u]);const w=c(e=>{b.current||u||null==o||o(e)},[u,o]),D=["yoopta-ui-block-dnd-handle",p&&"yoopta-ui-block-dnd-handle--holding",u&&"yoopta-ui-block-dnd-handle--dragging",r].filter(Boolean).join(" ");if(!y||!e){if(i&&f(n)){const e=n.props,t=e.ref,o=e=>{"function"==typeof d?d(e):d&&(d.current=e),t&&("function"==typeof t?t(e):t&&"current"in t&&(t.current=e))};return v(n,Object.assign(Object.assign({},e),{ref:o,className:r,disabled:!0}))}return t("button",Object.assign({type:"button",ref:d,className:r,disabled:!0},{children:n}))}if(i&&f(n)){const t=n.props,r=t.ref,o=e=>{y&&y.setActivatorNodeRef(e);const t=m.current;"function"==typeof t?t(e):t&&(t.current=e),r&&("function"==typeof r?r(e):r&&"current"in r&&(r.current=e))};return v(n,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),{ref:o,className:[D,t.className].filter(Boolean).join(" "),onClick:e=>{var n;w(e),null===(n=t.onClick)||void 0===n||n.call(t,e)}}),y.attributes),y.listeners),{"data-block-dnd-handle":!0,"data-block-id":e,"aria-label":t["aria-label"]||"Drag to reorder block",title:t.title||"Drag to reorder"}))}return t("button",Object.assign({type:"button",ref:x,className:D,onClick:w},y.attributes,y.listeners,{"data-block-dnd-handle":!0,"data-block-id":e,"aria-label":"Drag to reorder block",title:"Drag to reorder"},{children:n}))});wn.displayName="DragHandle";const Dn=(e={})=>{const{blockId:t}=e,n=bn(),{isDragging:r,draggedIds:i,editor:a}=n,l=o(()=>!!t&&i.includes(t),[t,i]),s=o(()=>!!t&&(i.includes(t)&&i.length>1),[t,i]),d=c((e,t)=>{a.moveBlock(e,t)},[a]),u=c((e,t)=>{a.batchOperations(()=>{[...e].sort((e,t)=>{var n,r,o,i;return(null!==(r=null===(n=a.children[e])||void 0===n?void 0:n.meta.order)&&void 0!==r?r:0)-(null!==(i=null===(o=a.children[t])||void 0===o?void 0:o.meta.order)&&void 0!==i?i:0)}).forEach((e,n)=>{a.moveBlock(e,t+n)})})},[a]);return{isDragging:r,isBlockDragging:l,isPartOfMultiDrag:s,dragCount:i.length,draggedIds:i,moveBlock:d,moveBlocks:u}},kn=e=>Object.keys(e.children).sort((t,n)=>e.children[t].meta.order-e.children[n].meta.order);export{mn as BlockDndContext,wn as DragHandle,xn as SortableBlock,kn as getOrderedBlockIds,Dn as useBlockDnd,bn as useBlockDndContext};
|
|
@@ -1,30 +1,83 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import './block-options.css';
|
|
3
|
+
type Placement = 'top' | 'right' | 'bottom' | 'left';
|
|
4
|
+
type Align = 'start' | 'center' | 'end';
|
|
3
5
|
type BlockOptionsRootProps = {
|
|
4
6
|
children: ReactNode;
|
|
5
|
-
|
|
7
|
+
/** Controlled open state */
|
|
8
|
+
open?: boolean;
|
|
9
|
+
/** Callback when open state changes */
|
|
10
|
+
onOpenChange?: (open: boolean) => void;
|
|
11
|
+
/** Default open state for uncontrolled usage */
|
|
12
|
+
defaultOpen?: boolean;
|
|
13
|
+
/** External anchor element for positioning (use when no Trigger is present) */
|
|
14
|
+
anchor?: HTMLElement | null;
|
|
15
|
+
};
|
|
16
|
+
type BlockOptionsTriggerProps = {
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
/** Merge props onto child element instead of wrapping */
|
|
19
|
+
asChild?: boolean;
|
|
20
|
+
className?: string;
|
|
21
|
+
};
|
|
22
|
+
type BlockOptionsContentProps = {
|
|
23
|
+
children: ReactNode;
|
|
6
24
|
className?: string;
|
|
7
|
-
|
|
25
|
+
style?: CSSProperties;
|
|
26
|
+
/** Placement relative to trigger */
|
|
27
|
+
side?: Placement;
|
|
28
|
+
/** Alignment relative to trigger */
|
|
29
|
+
align?: Align;
|
|
30
|
+
/** Offset from trigger in pixels */
|
|
31
|
+
sideOffset?: number;
|
|
8
32
|
};
|
|
9
33
|
type BlockOptionsGroupProps = {
|
|
10
34
|
children: ReactNode;
|
|
11
35
|
className?: string;
|
|
12
36
|
};
|
|
37
|
+
type BlockOptionsItemProps = {
|
|
38
|
+
children: ReactNode;
|
|
39
|
+
/** Called when item is selected */
|
|
40
|
+
onSelect?: (event: React.MouseEvent) => void;
|
|
41
|
+
className?: string;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
icon?: ReactNode;
|
|
44
|
+
/** Visual variant */
|
|
45
|
+
variant?: 'default' | 'destructive';
|
|
46
|
+
/** Keep menu open after selection */
|
|
47
|
+
keepOpen?: boolean;
|
|
48
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onSelect'>;
|
|
13
49
|
type BlockOptionsSeparatorProps = {
|
|
14
50
|
className?: string;
|
|
15
51
|
};
|
|
16
|
-
|
|
17
|
-
|
|
52
|
+
type BlockOptionsLabelProps = {
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
className?: string;
|
|
55
|
+
};
|
|
56
|
+
export declare const BlockOptions: {
|
|
57
|
+
({ children, open: controlledOpen, onOpenChange: controlledOnOpenChange, defaultOpen, anchor, }: BlockOptionsRootProps): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
displayName: string;
|
|
59
|
+
} & {
|
|
60
|
+
Root: {
|
|
61
|
+
({ children, open: controlledOpen, onOpenChange: controlledOnOpenChange, defaultOpen, anchor, }: BlockOptionsRootProps): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
displayName: string;
|
|
63
|
+
};
|
|
64
|
+
Trigger: import("react").ForwardRefExoticComponent<BlockOptionsTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
65
|
+
Content: import("react").ForwardRefExoticComponent<BlockOptionsContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
66
|
Group: import("react").ForwardRefExoticComponent<BlockOptionsGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
-
|
|
67
|
+
Item: import("react").ForwardRefExoticComponent<{
|
|
20
68
|
children: ReactNode;
|
|
21
|
-
|
|
69
|
+
/** Called when item is selected */
|
|
70
|
+
onSelect?: ((event: React.MouseEvent) => void) | undefined;
|
|
22
71
|
className?: string | undefined;
|
|
23
72
|
disabled?: boolean | undefined;
|
|
24
73
|
icon?: ReactNode;
|
|
74
|
+
/** Visual variant */
|
|
25
75
|
variant?: "default" | "destructive" | undefined;
|
|
26
|
-
|
|
76
|
+
/** Keep menu open after selection */
|
|
77
|
+
keepOpen?: boolean | undefined;
|
|
78
|
+
} & Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "onSelect"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
27
79
|
Separator: import("react").ForwardRefExoticComponent<BlockOptionsSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
80
|
+
Label: import("react").ForwardRefExoticComponent<BlockOptionsLabelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
81
|
};
|
|
29
|
-
export {};
|
|
82
|
+
export type { BlockOptionsRootProps, BlockOptionsTriggerProps, BlockOptionsContentProps, BlockOptionsGroupProps, BlockOptionsItemProps, BlockOptionsSeparatorProps, BlockOptionsLabelProps, };
|
|
30
83
|
//# sourceMappingURL=block-options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-options.d.ts","sourceRoot":"","sources":["../../src/block-options/block-options.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"block-options.d.ts","sourceRoot":"","sources":["../../src/block-options/block-options.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAmBpE,OAAO,qBAAqB,CAAC;AAE7B,KAAK,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AACrD,KAAK,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExC,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uCAAuC;IACvC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,gDAAgD;IAChD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAC7B,CAAC;AA6CF,KAAK,wBAAwB,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,yDAAyD;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAsCF,KAAK,wBAAwB,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,oCAAoC;IACpC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,oCAAoC;IACpC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAoEF,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAYF,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,qBAAqB;IACrB,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IACpC,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,CAAC;AA0CpE,KAAK,0BAA0B,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAUF,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAYF,eAAO,MAAM,YAAY;qGA7PtB,qBAAqB;;;;yGAArB,qBAAqB;;;;;;;kBA8KZ,SAAS;QACnB,mCAAmC;4BAChB,gBAAgB,KAAK,IAAI;;;eAGrC,SAAS;QAChB,qBAAqB;;QAErB,qCAAqC;;;;;CA+ErC,CAAC;AAEH,YAAY,EACV,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,GACvB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type BlockOptionsContextValue = {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange: (open: boolean) => void;
|
|
5
|
+
triggerRef: HTMLElement | null;
|
|
6
|
+
setTriggerRef: (ref: HTMLElement | null) => void;
|
|
7
|
+
contentId: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const BlockOptionsContext: import("react").Context<BlockOptionsContextValue | null>;
|
|
10
|
+
export declare const useBlockOptionsContext: () => BlockOptionsContextValue;
|
|
11
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/block-options/context.tsx"],"names":[],"mappings":";AAEA,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,aAAa,EAAE,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACjD,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,mBAAmB,0DAAuD,CAAC;AAExF,eAAO,MAAM,sBAAsB,gCAMlC,CAAC"}
|