@yoopta/ui 6.0.0-beta.6 → 6.0.0-beta.8

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.
Files changed (106) hide show
  1. package/dist/action-menu-list/action-menu-list.d.ts +49 -13
  2. package/dist/action-menu-list/action-menu-list.d.ts.map +1 -1
  3. package/dist/action-menu-list/context.d.ts +25 -0
  4. package/dist/action-menu-list/context.d.ts.map +1 -0
  5. package/dist/action-menu-list/index.d.ts +5 -5
  6. package/dist/action-menu-list/index.d.ts.map +1 -1
  7. package/dist/action-menu-list.js +1 -1
  8. package/dist/block-options/block-options.d.ts.map +1 -1
  9. package/dist/block-options.js +1 -1
  10. package/dist/chunks/{floating-ui.react-33212df0.js → floating-ui.react-727e4287.js} +1 -1
  11. package/dist/chunks/highlight-color-picker-ce0b19ac.js +1 -0
  12. package/dist/chunks/index-e0185864.js +1 -0
  13. package/dist/element-options/components/element-options-color-picker.d.ts +6 -0
  14. package/dist/element-options/components/element-options-color-picker.d.ts.map +1 -0
  15. package/dist/element-options/components/element-options-content.d.ts +6 -0
  16. package/dist/element-options/components/element-options-content.d.ts.map +1 -0
  17. package/dist/element-options/components/element-options-group.d.ts +6 -0
  18. package/dist/element-options/components/element-options-group.d.ts.map +1 -0
  19. package/dist/element-options/components/element-options-input.d.ts +6 -0
  20. package/dist/element-options/components/element-options-input.d.ts.map +1 -0
  21. package/dist/element-options/components/element-options-label.d.ts +6 -0
  22. package/dist/element-options/components/element-options-label.d.ts.map +1 -0
  23. package/dist/element-options/components/element-options-root.d.ts +6 -0
  24. package/dist/element-options/components/element-options-root.d.ts.map +1 -0
  25. package/dist/element-options/components/element-options-select.d.ts +6 -0
  26. package/dist/element-options/components/element-options-select.d.ts.map +1 -0
  27. package/dist/element-options/components/element-options-separator.d.ts +6 -0
  28. package/dist/element-options/components/element-options-separator.d.ts.map +1 -0
  29. package/dist/element-options/components/element-options-slider.d.ts +6 -0
  30. package/dist/element-options/components/element-options-slider.d.ts.map +1 -0
  31. package/dist/element-options/components/element-options-toggle.d.ts +6 -0
  32. package/dist/element-options/components/element-options-toggle.d.ts.map +1 -0
  33. package/dist/element-options/components/element-options-trigger.d.ts +6 -0
  34. package/dist/element-options/components/element-options-trigger.d.ts.map +1 -0
  35. package/dist/element-options/context/element-options-context.d.ts +13 -0
  36. package/dist/element-options/context/element-options-context.d.ts.map +1 -0
  37. package/dist/element-options/index.d.ts +64 -0
  38. package/dist/element-options/index.d.ts.map +1 -0
  39. package/dist/element-options/types.d.ts +107 -0
  40. package/dist/element-options/types.d.ts.map +1 -0
  41. package/dist/element-options.js +27 -0
  42. package/dist/floating-block-actions/context.d.ts +15 -0
  43. package/dist/floating-block-actions/context.d.ts.map +1 -0
  44. package/dist/floating-block-actions/floating-block-actions.d.ts +30 -7
  45. package/dist/floating-block-actions/floating-block-actions.d.ts.map +1 -1
  46. package/dist/floating-block-actions/hooks.d.ts +1 -29
  47. package/dist/floating-block-actions/hooks.d.ts.map +1 -1
  48. package/dist/floating-block-actions/index.d.ts +3 -4
  49. package/dist/floating-block-actions/index.d.ts.map +1 -1
  50. package/dist/floating-block-actions.js +1 -1
  51. package/dist/floating-toolbar/context.d.ts +12 -0
  52. package/dist/floating-toolbar/context.d.ts.map +1 -0
  53. package/dist/floating-toolbar/floating-toolbar.d.ts +44 -0
  54. package/dist/floating-toolbar/floating-toolbar.d.ts.map +1 -0
  55. package/dist/floating-toolbar/index.d.ts +5 -0
  56. package/dist/floating-toolbar/index.d.ts.map +1 -0
  57. package/dist/floating-toolbar.js +1 -0
  58. package/dist/highlight-color-picker.js +1 -1
  59. package/dist/index.d.ts +7 -5
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +1 -1
  62. package/dist/overlay.js +1 -1
  63. package/dist/portal.js +1 -1
  64. package/dist/selection-box/SelectionBox.d.ts +19 -0
  65. package/dist/selection-box/SelectionBox.d.ts.map +1 -0
  66. package/dist/selection-box/hooks.d.ts +7 -0
  67. package/dist/selection-box/hooks.d.ts.map +1 -0
  68. package/dist/selection-box/index.d.ts +4 -0
  69. package/dist/selection-box/index.d.ts.map +1 -0
  70. package/dist/selection-box.js +1 -0
  71. package/dist/slash-command-menu.js +1 -1
  72. package/package.json +21 -16
  73. package/dist/action-menu-list/hooks.d.ts +0 -912
  74. package/dist/action-menu-list/hooks.d.ts.map +0 -1
  75. package/dist/action-menu-list/store.d.ts +0 -22
  76. package/dist/action-menu-list/store.d.ts.map +0 -1
  77. package/dist/action-menu-list/store.test.d.ts +0 -2
  78. package/dist/action-menu-list/store.test.d.ts.map +0 -1
  79. package/dist/chunks/highlight-color-picker-534fa3e2.js +0 -1
  80. package/dist/chunks/hooks-814f49b9.js +0 -1
  81. package/dist/chunks/hooks-879d4b4f.js +0 -1
  82. package/dist/chunks/index-06d5c4e7.js +0 -10
  83. package/dist/floating-block-actions/store.d.ts +0 -19
  84. package/dist/floating-block-actions/store.d.ts.map +0 -1
  85. package/dist/floating-block-actions/store.test.d.ts +0 -2
  86. package/dist/floating-block-actions/store.test.d.ts.map +0 -1
  87. package/dist/theme/ThemeProvider.d.ts +0 -16
  88. package/dist/theme/ThemeProvider.d.ts.map +0 -1
  89. package/dist/theme/ThemeToggle.d.ts +0 -6
  90. package/dist/theme/ThemeToggle.d.ts.map +0 -1
  91. package/dist/theme/index.d.ts +0 -5
  92. package/dist/theme/index.d.ts.map +0 -1
  93. package/dist/theme/useTheme.d.ts +0 -8
  94. package/dist/theme/useTheme.d.ts.map +0 -1
  95. package/dist/theme.js +0 -1
  96. package/dist/toolbar/hooks.d.ts +0 -879
  97. package/dist/toolbar/hooks.d.ts.map +0 -1
  98. package/dist/toolbar/index.d.ts +0 -6
  99. package/dist/toolbar/index.d.ts.map +0 -1
  100. package/dist/toolbar/store.d.ts +0 -12
  101. package/dist/toolbar/store.d.ts.map +0 -1
  102. package/dist/toolbar/store.test.d.ts +0 -2
  103. package/dist/toolbar/store.test.d.ts.map +0 -1
  104. package/dist/toolbar/toolbar.d.ts +0 -20
  105. package/dist/toolbar/toolbar.d.ts.map +0 -1
  106. package/dist/toolbar.js +0 -1
@@ -0,0 +1,6 @@
1
+ import type { ElementOptionsSelectProps } from '../types';
2
+ export declare const ElementOptionsSelect: {
3
+ <T extends string = string>({ value, options, onValueChange, placeholder, className, style, renderOption, renderValue, }: ElementOptionsSelectProps<T>): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ //# sourceMappingURL=element-options-select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-options-select.d.ts","sourceRoot":"","sources":["../../../src/element-options/components/element-options-select.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,UAAU,CAAC;AAExE,eAAO,MAAM,oBAAoB;;;CA0JhC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ElementOptionsSeparatorProps } from '../types';
2
+ export declare const ElementOptionsSeparator: {
3
+ ({ className, style, }: ElementOptionsSeparatorProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ //# sourceMappingURL=element-options-separator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-options-separator.d.ts","sourceRoot":"","sources":["../../../src/element-options/components/element-options-separator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAE7D,eAAO,MAAM,uBAAuB;4BAGjC,4BAA4B;;CAQ9B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ElementOptionsSliderProps } from '../types';
2
+ export declare const ElementOptionsSlider: {
3
+ ({ value, onValueChange, min, max, step, className, style, }: ElementOptionsSliderProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ //# sourceMappingURL=element-options-slider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-options-slider.d.ts","sourceRoot":"","sources":["../../../src/element-options/components/element-options-slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAE1D,eAAO,MAAM,oBAAoB;kEAQ9B,yBAAyB;;CAkC3B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ElementOptionsToggleProps } from '../types';
2
+ export declare const ElementOptionsToggle: {
3
+ ({ checked, onCheckedChange, label, className, style, }: ElementOptionsToggleProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ //# sourceMappingURL=element-options-toggle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-options-toggle.d.ts","sourceRoot":"","sources":["../../../src/element-options/components/element-options-toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAE1D,eAAO,MAAM,oBAAoB;6DAM9B,yBAAyB;;CAkC3B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ElementOptionsTriggerProps } from '../types';
2
+ export declare const ElementOptionsTrigger: {
3
+ ({ children, className, style, side, align, sideOffset, alignOffset, }: ElementOptionsTriggerProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ //# sourceMappingURL=element-options-trigger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-options-trigger.d.ts","sourceRoot":"","sources":["../../../src/element-options/components/element-options-trigger.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAE3D,eAAO,MAAM,qBAAqB;4EAQ/B,0BAA0B;;CAkE5B,CAAC"}
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import type { ElementOptionsContextValue } from '../types';
3
+ export declare const ElementOptionsContext: import("react").Context<ElementOptionsContextValue | null>;
4
+ export declare function useElementOptionsContext(): ElementOptionsContextValue;
5
+ export declare function useElementOptions(): {
6
+ blockId: string;
7
+ element: SlateElement;
8
+ editor: YooEditor;
9
+ isOpen: boolean;
10
+ setIsOpen: (open: boolean) => void;
11
+ };
12
+ export declare function useUpdateElementProps<T extends Record<string, unknown>>(): (props: Partial<T>) => void;
13
+ //# sourceMappingURL=element-options-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-options-context.d.ts","sourceRoot":"","sources":["../../../src/element-options/context/element-options-context.tsx"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAE3D,eAAO,MAAM,qBAAqB,4DAAyD,CAAC;AAG5F,wBAAgB,wBAAwB,IAAI,0BAA0B,CAQrE;AAED,wBAAgB,iBAAiB;;;;;;EAGhC;AAED,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,aAGtD,QAAQ,CAAC,CAAC,UAO1B"}
@@ -0,0 +1,64 @@
1
+ import './element-options.css';
2
+ export type { Side, Align, ElementOptionsContextValue, ElementOptionsRootProps, ElementOptionsTriggerProps, ElementOptionsContentProps, ElementOptionsGroupProps, ElementOptionsLabelProps, ElementOptionsSeparatorProps, ElementOptionsSelectProps, ElementOptionsColorPickerProps, ElementOptionsToggleProps, ElementOptionsSliderProps, ElementOptionsInputProps, SelectOption, } from './types';
3
+ export { ElementOptionsContext, useElementOptionsContext, useElementOptions, useUpdateElementProps, } from './context/element-options-context';
4
+ export { ElementOptionsRoot } from './components/element-options-root';
5
+ export { ElementOptionsTrigger } from './components/element-options-trigger';
6
+ export { ElementOptionsContent } from './components/element-options-content';
7
+ export { ElementOptionsGroup } from './components/element-options-group';
8
+ export { ElementOptionsLabel } from './components/element-options-label';
9
+ export { ElementOptionsSeparator } from './components/element-options-separator';
10
+ export { ElementOptionsSelect } from './components/element-options-select';
11
+ export { ElementOptionsColorPicker } from './components/element-options-color-picker';
12
+ export { ElementOptionsToggle } from './components/element-options-toggle';
13
+ export { ElementOptionsSlider } from './components/element-options-slider';
14
+ export { ElementOptionsInput } from './components/element-options-input';
15
+ export declare const ElementOptions: {
16
+ ({ blockId, element, children, anchorRef, className, style, }: import("./types").ElementOptionsRootProps): import("react/jsx-runtime").JSX.Element;
17
+ displayName: string;
18
+ } & {
19
+ Root: {
20
+ ({ blockId, element, children, anchorRef, className, style, }: import("./types").ElementOptionsRootProps): import("react/jsx-runtime").JSX.Element;
21
+ displayName: string;
22
+ };
23
+ Trigger: {
24
+ ({ children, className, style, side, align, sideOffset, alignOffset, }: import("./types").ElementOptionsTriggerProps): import("react/jsx-runtime").JSX.Element;
25
+ displayName: string;
26
+ };
27
+ Content: {
28
+ ({ children, className, style, side, align, sideOffset, alignOffset, }: import("./types").ElementOptionsContentProps): import("react/jsx-runtime").JSX.Element | null;
29
+ displayName: string;
30
+ };
31
+ Group: {
32
+ ({ children, className, style, }: import("./types").ElementOptionsGroupProps): import("react/jsx-runtime").JSX.Element;
33
+ displayName: string;
34
+ };
35
+ Label: {
36
+ ({ children, className, style, }: import("./types").ElementOptionsLabelProps): import("react/jsx-runtime").JSX.Element;
37
+ displayName: string;
38
+ };
39
+ Separator: {
40
+ ({ className, style, }: import("./types").ElementOptionsSeparatorProps): import("react/jsx-runtime").JSX.Element;
41
+ displayName: string;
42
+ };
43
+ Select: {
44
+ <T extends string = string>({ value, options, onValueChange, placeholder, className, style, renderOption, renderValue, }: import("./types").ElementOptionsSelectProps<T>): import("react/jsx-runtime").JSX.Element;
45
+ displayName: string;
46
+ };
47
+ ColorPicker: {
48
+ ({ value, onChange, presetColors, className, style, }: import("./types").ElementOptionsColorPickerProps): import("react/jsx-runtime").JSX.Element;
49
+ displayName: string;
50
+ };
51
+ Toggle: {
52
+ ({ checked, onCheckedChange, label, className, style, }: import("./types").ElementOptionsToggleProps): import("react/jsx-runtime").JSX.Element;
53
+ displayName: string;
54
+ };
55
+ Slider: {
56
+ ({ value, onValueChange, min, max, step, className, style, }: import("./types").ElementOptionsSliderProps): import("react/jsx-runtime").JSX.Element;
57
+ displayName: string;
58
+ };
59
+ Input: {
60
+ ({ value, onChange, placeholder, type, className, style, }: import("./types").ElementOptionsInputProps): import("react/jsx-runtime").JSX.Element;
61
+ displayName: string;
62
+ };
63
+ };
64
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/element-options/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC;AAe/B,YAAY,EACV,IAAI,EACJ,KAAK,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,yBAAyB,EACzB,8BAA8B,EAC9B,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,YAAY,GACb,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAGzE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYzB,CAAC"}
@@ -0,0 +1,107 @@
1
+ import type { CSSProperties, ReactNode, RefObject } from 'react';
2
+ import type { SlateElement, YooEditor } from '@yoopta/editor';
3
+ export type Side = 'top' | 'right' | 'bottom' | 'left';
4
+ export type Align = 'start' | 'center' | 'end';
5
+ export type ElementOptionsContextValue = {
6
+ blockId: string;
7
+ element: SlateElement;
8
+ editor: YooEditor;
9
+ isOpen: boolean;
10
+ setIsOpen: (open: boolean) => void;
11
+ triggerRef: RefObject<HTMLButtonElement | null>;
12
+ contentRef: RefObject<HTMLDivElement | null>;
13
+ anchorRef: RefObject<HTMLElement | null> | null;
14
+ };
15
+ export type ElementOptionsRootProps = {
16
+ blockId: string;
17
+ element: SlateElement;
18
+ children: ReactNode;
19
+ /** Ref to the element that Trigger should position relative to */
20
+ anchorRef?: RefObject<HTMLElement | null>;
21
+ className?: string;
22
+ style?: CSSProperties;
23
+ };
24
+ export type ElementOptionsTriggerProps = {
25
+ children?: ReactNode;
26
+ className?: string;
27
+ style?: CSSProperties;
28
+ /** Which side of the anchor to position the trigger */
29
+ side?: Side;
30
+ /** Alignment along the side */
31
+ align?: Align;
32
+ /** Offset from the side in pixels */
33
+ sideOffset?: number;
34
+ /** Offset along the alignment axis in pixels */
35
+ alignOffset?: number;
36
+ };
37
+ export type ElementOptionsContentProps = {
38
+ children: ReactNode;
39
+ className?: string;
40
+ style?: CSSProperties;
41
+ side?: Side;
42
+ align?: Align;
43
+ sideOffset?: number;
44
+ alignOffset?: number;
45
+ };
46
+ export type ElementOptionsGroupProps = {
47
+ children: ReactNode;
48
+ className?: string;
49
+ style?: CSSProperties;
50
+ };
51
+ export type ElementOptionsLabelProps = {
52
+ children: ReactNode;
53
+ className?: string;
54
+ style?: CSSProperties;
55
+ };
56
+ export type ElementOptionsSeparatorProps = {
57
+ className?: string;
58
+ style?: CSSProperties;
59
+ };
60
+ export type SelectOption<T = string> = {
61
+ value: T;
62
+ label: string;
63
+ icon?: ReactNode;
64
+ color?: string;
65
+ };
66
+ export type ElementOptionsSelectProps<T = string> = {
67
+ value: T;
68
+ options: SelectOption<T>[];
69
+ onValueChange: (value: T) => void;
70
+ placeholder?: string;
71
+ className?: string;
72
+ style?: CSSProperties;
73
+ renderOption?: (option: SelectOption<T>) => ReactNode;
74
+ renderValue?: (option: SelectOption<T> | undefined) => ReactNode;
75
+ };
76
+ export type ElementOptionsColorPickerProps = {
77
+ value: string;
78
+ onChange: (color: string) => void;
79
+ presetColors?: string[];
80
+ className?: string;
81
+ style?: CSSProperties;
82
+ };
83
+ export type ElementOptionsToggleProps = {
84
+ checked: boolean;
85
+ onCheckedChange: (checked: boolean) => void;
86
+ label?: string;
87
+ className?: string;
88
+ style?: CSSProperties;
89
+ };
90
+ export type ElementOptionsSliderProps = {
91
+ value: number;
92
+ onValueChange: (value: number) => void;
93
+ min?: number;
94
+ max?: number;
95
+ step?: number;
96
+ className?: string;
97
+ style?: CSSProperties;
98
+ };
99
+ export type ElementOptionsInputProps = {
100
+ value: string;
101
+ onChange: (value: string) => void;
102
+ placeholder?: string;
103
+ type?: 'text' | 'number' | 'url';
104
+ className?: string;
105
+ style?: CSSProperties;
106
+ };
107
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/element-options/types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,27 @@
1
+ import{s as e}from"./chunks/style-inject.es-e87a8d02.js";import{jsxs as t,Fragment as o,jsx as n}from"react/jsx-runtime";import{useState as a,useRef as r,useEffect as s,createContext as l,useContext as i,useMemo as d,forwardRef as c,createElement as p}from"react";import{u as m,o as u,f as g,s as b,a as f}from"./chunks/floating-ui.react-727e4287.js";import{Z as h}from"./chunks/index-e0185864.js";import{Portal as x}from"./portal.js";import{Elements as y,useYooptaEditor as k}from"@yoopta/editor";import"react-dom";e('[data-element-options-root]{position:relative}[data-element-options-trigger]{align-items:center;background:transparent;border:none;border-radius:4px;cursor:pointer;display:inline-flex;justify-content:center;padding:4px;transition:background-color .15s ease,opacity .15s ease}[data-element-options-trigger]:hover{background-color:rgba(0,0,0,.05)}[data-element-options-trigger]:focus-visible{outline:2px solid rgba(59,130,246,.5);outline-offset:2px}.yoo-element-options-trigger-icon{color:#6b7280;height:16px;width:16px}[data-element-options-content]{background-color:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);min-width:180px;padding:8px;z-index:50}[data-element-options-group]{display:flex;flex-direction:column;gap:6px}[data-element-options-group]+[data-element-options-group]{margin-top:8px}[data-element-options-label]{color:#6b7280;font-size:12px;font-weight:500}[data-element-options-separator]{background-color:#e5e7eb;height:1px;margin:8px 0}[data-element-options-select]{align-items:center;background-color:#fff;border:1px solid #e5e7eb;border-radius:6px;cursor:pointer;display:flex;font-size:13px;justify-content:space-between;padding:6px 10px;transition:border-color .15s ease;width:100%}[data-element-options-select]:hover{border-color:#d1d5db}[data-element-options-select]:focus-visible{outline:2px solid rgba(59,130,246,.5);outline-offset:2px}[data-element-options-select-value]{align-items:center;display:flex;gap:8px}[data-element-options-select-chevron]{color:#9ca3af;height:14px;transition:transform .15s ease;width:14px}[data-element-options-select][data-state=open] [data-element-options-select-chevron]{transform:rotate(180deg)}[data-element-options-select-content]{background-color:#fff;border:1px solid #e5e7eb;border-radius:6px;box-shadow:0 4px 6px -1px rgba(0,0,0,.1);min-width:140px;padding:4px;z-index:51}[data-element-options-select-item]{align-items:center;background:transparent;border:none;border-radius:4px;cursor:pointer;display:flex;font-size:13px;justify-content:space-between;padding:6px 8px;text-align:left;transition:background-color .15s ease;width:100%}[data-element-options-select-item]:hover{background-color:#f3f4f6}[data-element-options-select-item][data-selected=true]{background-color:#eff6ff}[data-element-options-select-item-content]{align-items:center;display:flex;gap:8px}[data-element-options-select-check]{color:#3b82f6;height:14px;width:14px}[data-element-options-select-icon]{align-items:center;display:flex;height:16px;justify-content:center;width:16px}[data-element-options-select-color]{border:1px solid rgba(0,0,0,.1);border-radius:50%;display:inline-block;height:12px;width:12px}[data-element-options-color-picker]{align-items:center;background-color:#fff;border:1px solid #e5e7eb;border-radius:6px;cursor:pointer;display:flex;font-size:13px;gap:8px;padding:6px 10px;transition:border-color .15s ease;width:100%}[data-element-options-color-picker]:hover{border-color:#d1d5db}[data-element-options-color-preview]{border:1px solid rgba(0,0,0,.1);border-radius:4px;display:inline-block;height:20px;width:20px}[data-element-options-color-value]{color:#6b7280;font-family:monospace;font-size:12px}[data-element-options-color-picker-content]{background-color:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 4px 6px -1px rgba(0,0,0,.1);padding:12px;z-index:51}[data-element-options-color-picker-content] .react-colorful{height:150px;width:180px}[data-element-options-color-presets]{border-top:1px solid #e5e7eb;display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;padding-top:10px}[data-element-options-color-preset]{border:2px solid transparent;border-radius:4px;cursor:pointer;height:20px;padding:0;transition:border-color .15s ease,transform .15s ease;width:20px}[data-element-options-color-preset]:hover{transform:scale(1.1)}[data-element-options-color-preset][data-selected=true]{border-color:#3b82f6}[data-element-options-toggle]{align-items:center;background:transparent;border:none;cursor:pointer;display:inline-flex;gap:8px;padding:0}[data-element-options-toggle-thumb]{background-color:#e5e7eb;border-radius:10px;height:20px;position:relative;transition:background-color .2s ease;width:36px}[data-element-options-toggle-thumb]:after{background-color:#fff;border-radius:50%;box-shadow:0 1px 3px rgba(0,0,0,.1);content:"";height:16px;left:2px;position:absolute;top:2px;transition:transform .2s ease;width:16px}[data-element-options-toggle][data-state=checked] [data-element-options-toggle-thumb]{background-color:#3b82f6}[data-element-options-toggle][data-state=checked] [data-element-options-toggle-thumb]:after{transform:translateX(16px)}[data-element-options-toggle-label]{color:#374151;font-size:13px}[data-element-options-slider]{align-items:center;display:flex;gap:10px}[data-element-options-slider-input]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(to right,#3b82f6 0,#3b82f6 var(--slider-percentage,0),#e5e7eb var(--slider-percentage,0),#e5e7eb 100%);border-radius:2px;cursor:pointer;flex:1;height:4px}[data-element-options-slider-input]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:#fff;border:2px solid #3b82f6;border-radius:50%;cursor:pointer;height:14px;-webkit-transition:transform .15s ease;transition:transform .15s ease;width:14px}[data-element-options-slider-input]::-webkit-slider-thumb:hover{transform:scale(1.1)}[data-element-options-slider-value]{color:#6b7280;font-family:monospace;font-size:12px;min-width:32px;text-align:right}[data-element-options-input]{background-color:#fff;border:1px solid #e5e7eb;border-radius:6px;font-size:13px;padding:6px 10px;transition:border-color .15s ease;width:100%}[data-element-options-input]:hover{border-color:#d1d5db}[data-element-options-input]:focus{border-color:#3b82f6;box-shadow:0 0 0 2px rgba(59,130,246,.1);outline:none}[data-element-options-input]::-moz-placeholder{color:#9ca3af}[data-element-options-input]::placeholder{color:#9ca3af}@media (prefers-color-scheme:dark){[data-element-options-color-picker-content],[data-element-options-content],[data-element-options-select-content]{background-color:#1f2937;border-color:#374151}[data-element-options-label]{color:#9ca3af}[data-element-options-separator]{background-color:#374151}[data-element-options-color-picker],[data-element-options-input],[data-element-options-select]{background-color:#1f2937;border-color:#374151;color:#f3f4f6}[data-element-options-color-picker]:hover,[data-element-options-input]:hover,[data-element-options-select]:hover{border-color:#4b5563}[data-element-options-select-item]:hover{background-color:#374151}[data-element-options-select-item][data-selected=true]{background-color:rgba(59,130,246,.2)}[data-element-options-color-presets]{border-top-color:#374151}[data-element-options-toggle-thumb]{background-color:#374151}[data-element-options-toggle-label]{color:#d1d5db}[data-element-options-slider-input]{background:linear-gradient(to right,#3b82f6 0,#3b82f6 var(--slider-percentage,0),#374151 var(--slider-percentage,0),#374151 100%)}.yoo-element-options-trigger-icon{color:#9ca3af}[data-element-options-trigger]:hover{background-color:hsla(0,0%,100%,.1)}}');const v=["#000000","#6B7280","#EF4444","#F59E0B","#22C55E","#3B82F6","#8B5CF6","#EC4899"],w=({value:e,onChange:l,presetColors:i=v,className:d,style:c})=>{const[p,y]=a(!1),k=r(null),{refs:w,floatingStyles:O}=m({open:p,placement:"bottom-start",middleware:[u(4),g({padding:8}),b({padding:8})],whileElementsMounted:f});s(()=>{k.current&&w.setReference(k.current)},[w]),s(()=>{if(!p)return;const e=e=>{const t=e.target;k.current&&!k.current.contains(t)&&w.floating.current&&!w.floating.current.contains(t)&&y(!1)},t=e=>{"Escape"===e.key&&y(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[p,w.floating]);const N=e=>{e.preventDefault()};return t(o,{children:[t("button",Object.assign({ref:k,type:"button",className:d,style:c,onClick:e=>{e.preventDefault(),e.stopPropagation(),y(!p)},onMouseDown:N,"data-element-options-color-picker":!0,"data-state":p?"open":"closed","aria-expanded":p},{children:[n("span",{"data-element-options-color-preview":!0,style:{backgroundColor:e}}),n("span",Object.assign({"data-element-options-color-value":!0},{children:e}))]})),p&&n(x,Object.assign({id:"element-options-color-picker-portal"},{children:t("div",Object.assign({ref:w.setFloating,style:O,"data-element-options-color-picker-content":!0,onMouseDown:N},{children:[n(h,{color:e,onChange:l}),i.length>0&&n("div",Object.assign({"data-element-options-color-presets":!0},{children:i.map(t=>n("button",{type:"button","data-element-options-color-preset":!0,"data-selected":t===e,style:{backgroundColor:t},onClick:()=>(e=>{l(e)})(t),onMouseDown:N,"aria-label":`Select color ${t}`},t))}))]}))}))]})};w.displayName="ElementOptions.ColorPicker";const O=l(null);function N(){const e=i(O);if(!e)throw new Error("useElementOptionsContext must be used within an ElementOptions.Root");return e}function j(){const{blockId:e,element:t,editor:o,isOpen:n,setIsOpen:a}=N();return{blockId:e,element:t,editor:o,isOpen:n,setIsOpen:a}}function E(){const{blockId:e,element:t,editor:o}=N();return n=>{y.updateElement(o,{blockId:e,type:t.type,props:Object.assign(Object.assign({},t.props),n)})}}O.displayName="ElementOptionsContext";const C=({children:e,className:t,style:o,side:a="bottom",align:l="end",sideOffset:i=4,alignOffset:d=0})=>{const{isOpen:c,setIsOpen:p,triggerRef:h,contentRef:y}=N(),k=r(null),v="center"===l?a:`${a}-${l}`,{refs:w,floatingStyles:O}=m({open:c,placement:v,middleware:[u({mainAxis:i,crossAxis:d}),g({padding:8}),b({padding:8})],whileElementsMounted:f});return s(()=>{h.current&&w.setReference(h.current)},[h,w]),s(()=>{if(!c)return;const e=e=>{const t=e.target,o=h.current,n=k.current;o&&!o.contains(t)&&n&&!n.contains(t)&&p(!1)},t=e=>{"Escape"===e.key&&p(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[c,p,h]),c?n(x,Object.assign({id:"element-options-portal"},{children:n("div",Object.assign({ref:e=>{w.setFloating(e),k.current=e,y&&(y.current=e)},className:t,style:Object.assign(Object.assign({},O),o),"data-element-options-content":!0,"data-state":"open","data-side":a,"data-align":l,role:"dialog","aria-modal":"true"},{children:e}))})):null};C.displayName="ElementOptions.Content";const D=({children:e,className:t,style:o})=>n("div",Object.assign({className:t,style:o,"data-element-options-group":!0},{children:e}));D.displayName="ElementOptions.Group";const z=({value:e,onChange:t,placeholder:o,type:a="text",className:r,style:s})=>n("input",{type:a,value:e,onChange:e=>{t(e.target.value)},onMouseDown:e=>{e.stopPropagation()},placeholder:o,className:r,style:s,"data-element-options-input":!0});z.displayName="ElementOptions.Input";const L=({children:e,className:t,style:o})=>n("label",Object.assign({className:t,style:o,"data-element-options-label":!0},{children:e}));L.displayName="ElementOptions.Label";const R=({blockId:e,element:t,children:o,anchorRef:s,className:l,style:i})=>{const c=k(),[p,m]=a(!1),u=r(null),g=r(null),b=d(()=>({blockId:e,element:t,editor:c,isOpen:p,setIsOpen:m,triggerRef:u,contentRef:g,anchorRef:null!=s?s:null}),[e,t,c,p,s]);return n(O.Provider,Object.assign({value:b},{children:n("div",Object.assign({className:l,style:i,"data-element-options-root":!0,"data-state":p?"open":"closed"},{children:o}))}))};R.displayName="ElementOptions.Root";
2
+ /**
3
+ * @license lucide-react v0.378.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
+ */
8
+ const I=(...e)=>e.filter((e,t,o)=>Boolean(e)&&o.indexOf(e)===t).join(" ");
9
+ /**
10
+ * @license lucide-react v0.378.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */
15
+ var M={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
16
+ /**
17
+ * @license lucide-react v0.378.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const S=c(({color:e="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:n,className:a="",children:r,iconNode:s,...l},i)=>p("svg",{ref:i,...M,width:t,height:t,stroke:e,strokeWidth:n?24*Number(o)/Number(t):o,className:I("lucide",a),...l},[...s.map(([e,t])=>p(e,t)),...Array.isArray(r)?r:[r]])),$=(e,t)=>{const o=c(({className:o,...n},a)=>{return p(S,{ref:a,iconNode:t,className:I(`lucide-${r=e,r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,o),...n});var r});return o.displayName=`${e}`,o},P=$("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),F=$("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),A=$("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),B=({value:e,options:l,onValueChange:i,placeholder:d="Select...",className:c,style:p,renderOption:h,renderValue:y})=>{const[k,v]=a(!1),w=r(null),O=l.find(t=>t.value===e),{refs:N,floatingStyles:j}=m({open:k,placement:"bottom-start",middleware:[u(4),g({padding:8}),b({padding:8})],whileElementsMounted:f});s(()=>{w.current&&N.setReference(w.current)},[N]),s(()=>{if(!k)return;const e=e=>{const t=e.target;w.current&&!w.current.contains(t)&&N.floating.current&&!N.floating.current.contains(t)&&v(!1)},t=e=>{"Escape"===e.key&&v(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[k,N.floating]);const E=e=>{e.preventDefault()},C=e=>t(o,{children:[e.icon&&n("span",Object.assign({"data-element-options-select-icon":!0},{children:e.icon})),e.color&&n("span",{"data-element-options-select-color":!0,style:{backgroundColor:e.color}}),n("span",{children:e.label})]});return t(o,{children:[t("button",Object.assign({ref:w,type:"button",className:c,style:p,onClick:e=>{e.preventDefault(),e.stopPropagation(),v(!k)},onMouseDown:E,"data-element-options-select":!0,"data-state":k?"open":"closed","aria-expanded":k,"aria-haspopup":"listbox"},{children:[n("span",Object.assign({"data-element-options-select-value":!0},{children:y?y(O):(D=O,t(o,{children:[(null==D?void 0:D.icon)&&n("span",Object.assign({"data-element-options-select-icon":!0},{children:D.icon})),(null==D?void 0:D.color)&&n("span",{"data-element-options-select-color":!0,style:{backgroundColor:D.color}}),n("span",{children:null!==(z=null==D?void 0:D.label)&&void 0!==z?z:d})]}))})),n(F,{"data-element-options-select-chevron":!0})]})),k&&n(x,Object.assign({id:"element-options-select-portal"},{children:n("div",Object.assign({ref:N.setFloating,style:j,"data-element-options-select-content":!0,role:"listbox","aria-activedescendant":e,tabIndex:0},{children:l.map(o=>t("button",Object.assign({type:"button",role:"option","aria-selected":o.value===e,"data-element-options-select-item":!0,"data-selected":o.value===e,onClick:()=>{return e=o.value,i(e),void v(!1);var e},onMouseDown:E},{children:[n("span",Object.assign({"data-element-options-select-item-content":!0},{children:h?h(o):C(o)})),o.value===e&&n(P,{"data-element-options-select-check":!0})]}),String(o.value)))}))}))]});var D,z};
22
+ /**
23
+ * @license lucide-react v0.378.0 - ISC
24
+ *
25
+ * This source code is licensed under the ISC license.
26
+ * See the LICENSE file in the root directory of this source tree.
27
+ */B.displayName="ElementOptions.Select";const T=({className:e,style:t})=>n("div",{className:e,style:t,"data-element-options-separator":!0,role:"separator","aria-orientation":"horizontal"});T.displayName="ElementOptions.Separator";const W=({value:e,onValueChange:o,min:a=0,max:r=100,step:s=1,className:l,style:i})=>{const d=(e-a)/(r-a)*100;return t("div",Object.assign({className:l,style:i,"data-element-options-slider":!0,onMouseDown:e=>{e.stopPropagation()}},{children:[n("input",{type:"range",min:a,max:r,step:s,value:e,onChange:e=>{o(Number(e.target.value))},"data-element-options-slider-input":!0,style:{"--slider-percentage":`${d}%`}}),n("span",Object.assign({"data-element-options-slider-value":!0},{children:e}))]}))};W.displayName="ElementOptions.Slider";const V=({checked:e,onCheckedChange:o,label:a,className:r,style:s})=>t("button",Object.assign({type:"button",role:"switch","aria-checked":e,className:r,style:s,onClick:t=>{t.preventDefault(),t.stopPropagation(),o(!e)},onMouseDown:e=>{e.preventDefault()},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),o(!e))},"data-element-options-toggle":!0,"data-state":e?"checked":"unchecked"},{children:[n("span",{"data-element-options-toggle-thumb":!0}),a&&n("span",Object.assign({"data-element-options-toggle-label":!0},{children:a}))]}));V.displayName="ElementOptions.Toggle";const G=({children:e,className:t,style:o,side:a,align:r,sideOffset:l=0,alignOffset:i=0})=>{const{isOpen:d,setIsOpen:c,triggerRef:p,anchorRef:h}=N(),x=Boolean(h&&a),y=a?"center"!==r&&r?`${a}-${r}`:a:"bottom",{refs:k,floatingStyles:v}=m({placement:y,middleware:[u({mainAxis:l,crossAxis:i}),g({padding:8}),b({padding:8})],whileElementsMounted:f});s(()=>{(null==h?void 0:h.current)&&x&&k.setReference(h.current)},[h,k,x]);const w=x?Object.assign(Object.assign({},v),o):o;return n("button",Object.assign({ref:e=>{p.current=e,x&&k.setFloating(e)},type:"button",className:t,style:w,onClick:e=>{e.preventDefault(),e.stopPropagation(),c(!d)},onMouseDown:e=>{e.preventDefault()},"data-element-options-trigger":!0,"data-state":d?"open":"closed","aria-expanded":d,"aria-haspopup":"dialog"},{children:null!=e?e:n(A,{className:"yoo-element-options-trigger-icon"})}))};G.displayName="ElementOptions.Trigger";const q=Object.assign(R,{Root:R,Trigger:G,Content:C,Group:D,Label:L,Separator:T,Select:B,ColorPicker:w,Toggle:V,Slider:W,Input:z});export{q as ElementOptions,w as ElementOptionsColorPicker,C as ElementOptionsContent,O as ElementOptionsContext,D as ElementOptionsGroup,z as ElementOptionsInput,L as ElementOptionsLabel,R as ElementOptionsRoot,B as ElementOptionsSelect,T as ElementOptionsSeparator,W as ElementOptionsSlider,V as ElementOptionsToggle,G as ElementOptionsTrigger,j as useElementOptions,N as useElementOptionsContext,E as useUpdateElementProps};
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import type { YooptaBlockData } from '@yoopta/editor';
3
+ export type FloatingBlockActionsContextValue = {
4
+ /** Currently hovered block ID */
5
+ blockId: string | null;
6
+ /** Block data for the hovered block */
7
+ blockData: YooptaBlockData | null;
8
+ /** Whether actions are visible */
9
+ isVisible: boolean;
10
+ /** Hide the floating actions manually */
11
+ hide: () => void;
12
+ };
13
+ export declare const FloatingBlockActionsContext: import("react").Context<FloatingBlockActionsContextValue | null>;
14
+ export declare const useFloatingBlockActionsContext: () => FloatingBlockActionsContextValue;
15
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/floating-block-actions/context.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,MAAM,gCAAgC,GAAG;IAC7C,iCAAiC;IACjC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,uCAAuC;IACvC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IAClC,kCAAkC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,2BAA2B,kEAA+D,CAAC;AAExG,eAAO,MAAM,8BAA8B,wCAQ1C,CAAC"}
@@ -1,14 +1,37 @@
1
- import { type ReactNode, type CSSProperties } from 'react';
1
+ import { type ReactNode } from 'react';
2
+ import { type YooptaBlockData } from '@yoopta/editor';
2
3
  import './floating-block-actions.css';
4
+ type FloatingBlockActionsApi = {
5
+ /** Currently hovered block ID */
6
+ blockId: string | null;
7
+ /** Block data for the hovered block */
8
+ blockData: YooptaBlockData | null;
9
+ /** Whether actions are visible */
10
+ isVisible: boolean;
11
+ /** Hide the floating actions manually */
12
+ hide: () => void;
13
+ };
3
14
  type FloatingBlockActionsRootProps = {
4
- children: ReactNode;
15
+ children: ReactNode | ((api: FloatingBlockActionsApi) => ReactNode);
16
+ /** When true, hover tracking is paused (e.g., when BlockOptions is open) */
17
+ frozen?: boolean;
5
18
  className?: string;
6
- style?: CSSProperties;
7
19
  };
8
- export declare const FloatingBlockActions: import("react").NamedExoticComponent<FloatingBlockActionsRootProps> & {
9
- readonly type: ({ children, className }: FloatingBlockActionsRootProps) => import("react/jsx-runtime").JSX.Element;
20
+ type FloatingBlockActionsButtonProps = {
21
+ children: ReactNode;
22
+ onClick?: (event: React.MouseEvent) => void;
23
+ className?: string;
24
+ disabled?: boolean;
25
+ title?: string;
26
+ } & React.ButtonHTMLAttributes<HTMLButtonElement>;
27
+ export declare const FloatingBlockActions: {
28
+ ({ children, frozen, className }: FloatingBlockActionsRootProps): import("react/jsx-runtime").JSX.Element;
29
+ displayName: string;
10
30
  } & {
11
- Root: import("react").MemoExoticComponent<({ children, className }: FloatingBlockActionsRootProps) => import("react/jsx-runtime").JSX.Element>;
31
+ Root: {
32
+ ({ children, frozen, className }: FloatingBlockActionsRootProps): import("react/jsx-runtime").JSX.Element;
33
+ displayName: string;
34
+ };
12
35
  Button: import("react").ForwardRefExoticComponent<{
13
36
  children: ReactNode;
14
37
  onClick?: ((event: React.MouseEvent) => void) | undefined;
@@ -17,5 +40,5 @@ export declare const FloatingBlockActions: import("react").NamedExoticComponent<
17
40
  title?: string | undefined;
18
41
  } & import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
19
42
  };
20
- export {};
43
+ export type { FloatingBlockActionsRootProps, FloatingBlockActionsButtonProps, FloatingBlockActionsApi };
21
44
  //# sourceMappingURL=floating-block-actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"floating-block-actions.d.ts","sourceRoot":"","sources":["../../src/floating-block-actions/floating-block-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,aAAa,EAAQ,MAAM,OAAO,CAAC;AAC7E,OAAO,8BAA8B,CAAC;AAGtC,KAAK,6BAA6B,GAAG;IACnC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AA8CF,eAAO,MAAM,oBAAoB;6CApC+B,6BAA6B;;wEAA7B,6BAA6B;;kBAPjF,SAAS;2BACD,gBAAgB,KAAK,IAAI;;;;;CA6C3C,CAAC"}
1
+ {"version":3,"file":"floating-block-actions.d.ts","sourceRoot":"","sources":["../../src/floating-block-actions/floating-block-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,eAAe,EAAmB,MAAM,gBAAgB,CAAC;AAIvE,OAAO,8BAA8B,CAAC;AAEtC,KAAK,uBAAuB,GAAG;IAC7B,iCAAiC;IACjC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,uCAAuC;IACvC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IAClC,kCAAkC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,KAAK,6BAA6B,GAAG;IACnC,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,GAAG,EAAE,uBAAuB,KAAK,SAAS,CAAC,CAAC;IACpE,4EAA4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,+BAA+B,GAAG;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAgNlD,eAAO,MAAM,oBAAoB;sCA1L+C,6BAA6B;;;;0CAA7B,6BAA6B;;;;kBA3BjG,SAAS;2BACD,gBAAgB,KAAK,IAAI;;;;;CAuN3C,CAAC;AAEH,YAAY,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,uBAAuB,EAAE,CAAC"}
@@ -1,30 +1,2 @@
1
- /// <reference types="react" />
2
- /**
3
- * Lightweight hook for accessing only store actions
4
- * Use this when you only need to control the state programmatically
5
- * without needing the mouse tracking logic
6
- */
7
- export declare const useFloatingBlockActionsActions: () => {
8
- reference: HTMLElement | null;
9
- floatingBlockId: string | null;
10
- state: import("./store").FloatingBlockActionsState;
11
- styles: import("react").CSSProperties;
12
- toggle: (actionState: import("./store").FloatingBlockActionsState, blockId?: string | null | undefined) => void;
13
- hide: () => void;
14
- reset: () => void;
15
- };
16
- /**
17
- * Full hook for FloatingBlockActions
18
- * Handles mouse tracking, positioning, and provides access to store
19
- * Use this only in the component that renders the FloatingBlockActions
20
- */
21
- export declare const useFloatingBlockActions: () => {
22
- reference: HTMLElement | null;
23
- floatingBlockId: string | null;
24
- state: import("./store").FloatingBlockActionsState;
25
- styles: import("react").CSSProperties;
26
- toggle: (actionState: import("./store").FloatingBlockActionsState, blockId?: string | null | undefined) => void;
27
- hide: () => void;
28
- reset: () => void;
29
- };
1
+ export { useFloatingBlockActionsContext } from './context';
30
2
  //# sourceMappingURL=hooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/floating-block-actions/hooks.ts"],"names":[],"mappings":";AAKA;;;;GAIG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;CAY1C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;CA6HnC,CAAC"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/floating-block-actions/hooks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC"}
@@ -1,6 +1,5 @@
1
1
  export { FloatingBlockActions } from './floating-block-actions';
2
- export { useFloatingBlockActions, useFloatingBlockActionsActions } from './hooks';
3
- export { useFloatingBlockActionsStore } from './store';
4
- export type { FloatingBlockActionsState, FloatingBlockActionsStore } from './store';
5
- import './floating-block-actions.css';
2
+ export type { FloatingBlockActionsApi, FloatingBlockActionsButtonProps, FloatingBlockActionsRootProps, } from './floating-block-actions';
3
+ export { useFloatingBlockActionsContext } from './hooks';
4
+ export type { FloatingBlockActionsContextValue } from './context';
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/floating-block-actions/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,uBAAuB,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAGlF,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AACvD,YAAY,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAGpF,OAAO,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/floating-block-actions/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,YAAY,EACV,uBAAuB,EACvB,+BAA+B,EAC/B,6BAA6B,GAC9B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAGzD,YAAY,EAAE,gCAAgC,EAAE,MAAM,WAAW,CAAC"}
@@ -1 +1 @@
1
- import{_ as o}from"./chunks/_tslib-5e145dfd.js";import{jsx as t}from"react/jsx-runtime";import{memo as a,forwardRef as e,useCallback as i,useEffect as n}from"react";import{s as r}from"./chunks/style-inject.es-e87a8d02.js";import{c as l}from"./chunks/index-06d5c4e7.js";import{useYooptaEditor as s}from"@yoopta/editor";import{t as u}from"./chunks/throttle-dea4a39e.js";r(":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-floating-bg:var(--yoopta-ui-background);--yoopta-ui-floating-border:var(--yoopta-ui-border);--yoopta-ui-floating-shadow:0 1px 2px 0 rgba(0,0,0,.05);--yoopta-ui-floating-shadow-md:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-floating-z-index:100;--yoopta-ui-floating-gap:1px;--yoopta-ui-floating-padding:3px;--yoopta-ui-floating-radius:0.5rem;--yoopta-ui-floating-offset:46px;--yoopta-ui-floating-button-min-width:24px;--yoopta-ui-floating-button-min-height:24px;--yoopta-ui-floating-button-padding-y:4px;--yoopta-ui-floating-button-padding-x:6px;--yoopta-ui-floating-button-color:var(--yoopta-ui-foreground);--yoopta-ui-floating-button-bg:transparent;--yoopta-ui-floating-button-hover:var(--yoopta-ui-accent);--yoopta-ui-floating-button-active:var(--yoopta-ui-accent);--yoopta-ui-floating-button-radius:0.375rem;--yoopta-ui-floating-transition:color 0.15s ease-in-out,background-color 0.15s ease-in-out,border-color 0.15s ease-in-out,box-shadow 0.15s ease-in-out;--yoopta-ui-floating-ring-offset:2px;--yoopta-ui-floating-ring:var(--yoopta-ui-ring);--yoopta-ui-floating-icon-size:1rem}.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-floating-shadow:0 1px 2px 0 rgba(0,0,0,.3);--yoopta-ui-floating-shadow-md:0 4px 6px -1px rgba(0,0,0,.5),0 2px 4px -2px rgba(0,0,0,.3)}.yoopta-ui-floating-block-actions{align-items:center;background-color:hsl(var(--yoopta-ui-floating-bg));border:1px solid hsl(var(--yoopta-ui-floating-border));border-radius:var(--yoopta-ui-floating-radius);box-shadow:var(--yoopta-ui-floating-shadow-md);display:inline-flex;gap:var(--yoopta-ui-floating-gap);padding:var(--yoopta-ui-floating-padding);z-index:var(--yoopta-ui-floating-z-index)}.yoopta-ui-floating-action-button{align-items:center;background-color:var(--yoopta-ui-floating-button-bg);border:none;border-radius:var(--yoopta-ui-floating-button-radius);color:hsl(var(--yoopta-ui-floating-button-color));cursor:pointer;display:inline-flex;font-size:.875rem;font-weight:500;justify-content:center;line-height:1;min-height:var(--yoopta-ui-floating-button-min-height);min-width:var(--yoopta-ui-floating-button-min-width);outline:none;padding:var(--yoopta-ui-floating-button-padding-y) var(--yoopta-ui-floating-button-padding-x);touch-action:manipulation;transition:var(--yoopta-ui-floating-transition);-moz-user-select:none;user-select:none;-webkit-user-select:none;white-space:nowrap}.yoopta-ui-floating-action-button:hover{background-color:hsl(var(--yoopta-ui-floating-button-hover));color:hsl(var(--yoopta-ui-accent-foreground))}.yoopta-ui-floating-action-button:active{background-color:hsl(var(--yoopta-ui-floating-button-active));transform:scale(.98)}.yoopta-ui-floating-action-button:focus-visible{box-shadow:0 0 0 var(--yoopta-ui-floating-ring-offset) hsl(var(--yoopta-ui-background)),0 0 0 calc(var(--yoopta-ui-floating-ring-offset) + 2px) hsl(var(--yoopta-ui-floating-ring));outline:none}.yoopta-ui-floating-action-button:disabled{opacity:.5;pointer-events:none}.yoopta-ui-floating-action-button svg{flex-shrink:0;height:var(--yoopta-ui-floating-icon-size);width:var(--yoopta-ui-floating-icon-size)}@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--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%}}");const p={position:"fixed",top:0,left:0,opacity:0,pointerEvents:"none",transform:"scale(0.95) translateX(-46px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"},c=l()((o,t)=>({blockId:null,state:"closed",position:{top:0,left:0},styles:p,reference:null,setReference(t){o({reference:t})},toggle(t,a){o({state:t,blockId:a||null})},updatePosition(a,e,i=46){o({position:{top:a,left:e},styles:Object.assign(Object.assign({},t().styles),{top:a,left:e,opacity:1,transform:`scale(1) translateX(-${i+2}px)`,pointerEvents:"auto"})})},hide(){o({state:"closed",blockId:null,styles:Object.assign(Object.assign({},t().styles),{opacity:0,transform:p.transform,pointerEvents:"none"})})},reset(){o({blockId:null,state:"closed",position:{top:0,left:0},styles:p})}})),d=a(({children:o,className:a})=>{const{setReference:e,styles:i}=c();return t("div",Object.assign({ref:e,className:`yoopta-ui-floating-block-actions ${a}`,style:i,contentEditable:!1,onClick:o=>o.stopPropagation(),onMouseDown:o=>o.stopPropagation()},{children:o}))});d.displayName="FloatingBlockActions.Root";const g=e((a,e)=>{var{children:i,onClick:n,className:r="",disabled:l,title:s}=a,u=o(a,["children","onClick","className","disabled","title"]);return t("button",Object.assign({ref:e,type:"button",className:`yoopta-ui-floating-action-button ${r}`,onClick:n,disabled:l,title:s,"aria-label":s},u,{children:i}))});g.displayName="FloatingBlockActions.Button";const f=Object.assign(d,{Root:d,Button:g}),y=()=>{const o=c();return{reference:o.reference,floatingBlockId:o.blockId,state:o.state,styles:o.styles,toggle:o.toggle,hide:o.hide,reset:o.reset}},b=()=>{const o=s(),t=c(),a=i((o,a)=>{var e;const i=o.getBoundingClientRect(),n=(null===(e=t.reference)||void 0===e?void 0:e.offsetWidth)||46;t.updatePosition(i.top+2,i.left,n)},[t]),e=i(()=>{t.hide()},[t]),r=i(t=>{if(!o.refElement)return null;const a=o.refElement.querySelectorAll("[data-yoopta-block]"),e=window.innerHeight;let i=null,n=1/0;if(a.forEach(o=>{const a=o.getBoundingClientRect();if(a.bottom<-200||a.top>e+200)return;if(t>=a.top&&t<=a.bottom)return i=o,void(n=0);const r=t<a.top?a.top-t:t-a.bottom;r<n&&(n=r,i=o)}),i&&n<=100){const t=i.getAttribute("data-yoopta-block-id"),a=t?o.children[t]:null;if(t&&a)return{element:i,data:a}}return null},[o]),l=i(i=>{var n,l;if("frozen"===t.state)return;const s=i.target,u=null===(n=o.refElement)||void 0===n?void 0:n.contains(i.target),p=null===(l=t.reference)||void 0===l?void 0:l.contains(s);if(!u)return e();if(o.readOnly)return;if(p)return;const c=r(i.clientY);if(c){const{element:o,data:e}=c;e.id!==t.blockId&&(t.toggle("hovering",e.id),a(o,e))}else null!==t.blockId&&e()},[t,o,e,r,a]),p=u(l,100,{leading:!0,trailing:!0});return n(()=>{const o=()=>{"frozen"!==t.state&&e()};return document.addEventListener("mousemove",p),document.addEventListener("scroll",o,!0),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("scroll",o,!0)}},[p,e,t.state]),{reference:t.reference,floatingBlockId:t.blockId,state:t.state,styles:t.styles,toggle:t.toggle,hide:t.hide,reset:t.reset}};export{f as FloatingBlockActions,b as useFloatingBlockActions,y as useFloatingBlockActionsActions,c as useFloatingBlockActionsStore};
1
+ import{_ as o}from"./chunks/_tslib-5e145dfd.js";import{jsx as t}from"react/jsx-runtime";import{createContext as i,useContext as a,forwardRef as n,useRef as e,useState as r,useCallback as u,useMemo as l,useEffect as p}from"react";import{useYooptaEditor as s}from"@yoopta/editor";import{t as c}from"./chunks/throttle-dea4a39e.js";import{s as d}from"./chunks/style-inject.es-e87a8d02.js";const g=i(null),f=()=>{const o=a(g);if(!o)throw new Error("FloatingBlockActions components must be used within <FloatingBlockActions>");return o};d(":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-floating-bg:var(--yoopta-ui-background);--yoopta-ui-floating-border:var(--yoopta-ui-border);--yoopta-ui-floating-shadow:0 1px 2px 0 rgba(0,0,0,.05);--yoopta-ui-floating-shadow-md:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-floating-z-index:100;--yoopta-ui-floating-gap:1px;--yoopta-ui-floating-padding:3px;--yoopta-ui-floating-radius:0.5rem;--yoopta-ui-floating-offset:46px;--yoopta-ui-floating-button-min-width:24px;--yoopta-ui-floating-button-min-height:24px;--yoopta-ui-floating-button-padding-y:4px;--yoopta-ui-floating-button-padding-x:6px;--yoopta-ui-floating-button-color:var(--yoopta-ui-foreground);--yoopta-ui-floating-button-bg:transparent;--yoopta-ui-floating-button-hover:var(--yoopta-ui-accent);--yoopta-ui-floating-button-active:var(--yoopta-ui-accent);--yoopta-ui-floating-button-radius:0.375rem;--yoopta-ui-floating-transition:color 0.15s ease-in-out,background-color 0.15s ease-in-out,border-color 0.15s ease-in-out,box-shadow 0.15s ease-in-out;--yoopta-ui-floating-ring-offset:2px;--yoopta-ui-floating-ring:var(--yoopta-ui-ring);--yoopta-ui-floating-icon-size:1rem}.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-floating-shadow:0 1px 2px 0 rgba(0,0,0,.3);--yoopta-ui-floating-shadow-md:0 4px 6px -1px rgba(0,0,0,.5),0 2px 4px -2px rgba(0,0,0,.3)}.yoopta-ui-floating-block-actions{align-items:center;background-color:hsl(var(--yoopta-ui-floating-bg));border:1px solid hsl(var(--yoopta-ui-floating-border));border-radius:var(--yoopta-ui-floating-radius);box-shadow:var(--yoopta-ui-floating-shadow-md);display:inline-flex;gap:var(--yoopta-ui-floating-gap);padding:var(--yoopta-ui-floating-padding);z-index:var(--yoopta-ui-floating-z-index)}.yoopta-ui-floating-action-button{align-items:center;background-color:var(--yoopta-ui-floating-button-bg);border:none;border-radius:var(--yoopta-ui-floating-button-radius);color:hsl(var(--yoopta-ui-floating-button-color));cursor:pointer;display:inline-flex;font-size:.875rem;font-weight:500;justify-content:center;line-height:1;min-height:var(--yoopta-ui-floating-button-min-height);min-width:var(--yoopta-ui-floating-button-min-width);outline:none;padding:var(--yoopta-ui-floating-button-padding-y) var(--yoopta-ui-floating-button-padding-x);touch-action:manipulation;transition:var(--yoopta-ui-floating-transition);-moz-user-select:none;user-select:none;-webkit-user-select:none;white-space:nowrap}.yoopta-ui-floating-action-button:hover{background-color:hsl(var(--yoopta-ui-floating-button-hover));color:hsl(var(--yoopta-ui-accent-foreground))}.yoopta-ui-floating-action-button:active{background-color:hsl(var(--yoopta-ui-floating-button-active));transform:scale(.98)}.yoopta-ui-floating-action-button:focus-visible{box-shadow:0 0 0 var(--yoopta-ui-floating-ring-offset) hsl(var(--yoopta-ui-background)),0 0 0 calc(var(--yoopta-ui-floating-ring-offset) + 2px) hsl(var(--yoopta-ui-floating-ring));outline:none}.yoopta-ui-floating-action-button:disabled{opacity:.5;pointer-events:none}.yoopta-ui-floating-action-button svg{flex-shrink:0;height:var(--yoopta-ui-floating-icon-size);width:var(--yoopta-ui-floating-icon-size)}@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--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%}}");const y={position:"fixed",top:0,left:0,opacity:0,pointerEvents:"none",transform:"scale(0.95)",transition:"transform 150ms ease-out"},b=({children:o,frozen:i=!1,className:a=""})=>{var n;const d=s(),f=e(null),[b,m]=r(null),[v,h]=r(y),x=b&&null!==(n=d.children[b])&&void 0!==n?n:null,k=null!==b&&1===v.opacity,w=u(()=>{m(null),h(y)},[]),E=u(o=>{var t,i;const a=o.getBoundingClientRect(),n=null!==(i=null===(t=f.current)||void 0===t?void 0:t.offsetWidth)&&void 0!==i?i:46;var e,r;h((e=a.top+2,r=a.left,{position:"fixed",top:e,left:r,opacity:1,pointerEvents:"auto",transform:`scale(1) translateX(-${n+2}px)`,transition:"transform 150ms ease-out"}))},[]),j=u(o=>{if(!d.refElement)return null;const t=d.refElement.querySelectorAll("[data-yoopta-block]"),i=window.innerHeight;let a=null,n=1/0;for(const e of t){const t=e.getBoundingClientRect();if(t.bottom<-200||t.top>i+200)continue;if(o>=t.top&&o<=t.bottom){a=e,n=0;break}const r=o<t.top?t.top-o:o-t.bottom;r<n&&(n=r,a=e)}if(a&&n<=100){const o=a.getAttribute("data-yoopta-block-id"),t=o?d.children[o]:null;if(o&&t)return{element:a,data:t}}return null},[d]),z=u(o=>{var t,a;if(i)return;const n=o.target,e=null===(t=d.refElement)||void 0===t?void 0:t.contains(n),r=null===(a=f.current)||void 0===a?void 0:a.contains(n);if(!e)return void w();if(d.readOnly)return;if(r)return;const u=j(o.clientY);if(u){const{element:o,data:t}=u;t.id!==b&&(m(t.id),E(o))}else null!==b&&w()},[i,d,b,j,E,w]),B=l(()=>c(z,100,{leading:!0,trailing:!0}),[z]);p(()=>{const o=()=>{i||w()};return document.addEventListener("mousemove",B),document.addEventListener("scroll",o,!0),()=>{document.removeEventListener("mousemove",B),document.removeEventListener("scroll",o,!0)}},[B,w,i]);const N=l(()=>({blockId:b,blockData:x,isVisible:k,hide:w}),[b,x,k,w]),A="function"==typeof o?o(N):o;return t(g.Provider,Object.assign({value:N},{children:t("div",Object.assign({ref:f,className:`yoopta-ui-floating-block-actions ${a}`,style:v,contentEditable:!1,onClick:o=>o.stopPropagation(),onMouseDown:o=>o.stopPropagation()},{children:A}))}))};b.displayName="FloatingBlockActions";const m=n((i,a)=>{var{children:n,onClick:e,className:r="",disabled:u,title:l}=i,p=o(i,["children","onClick","className","disabled","title"]);return t("button",Object.assign({ref:a,type:"button",className:`yoopta-ui-floating-action-button ${r}`,onClick:e,disabled:u,title:l,"aria-label":l},p,{children:n}))});m.displayName="FloatingBlockActions.Button";const v=Object.assign(b,{Root:b,Button:m});export{v as FloatingBlockActions,f as useFloatingBlockActionsContext};
@@ -0,0 +1,12 @@
1
+ import type { CSSProperties } from 'react';
2
+ export type FloatingToolbarContextValue = {
3
+ /** Whether toolbar is open/visible */
4
+ isOpen: boolean;
5
+ /** Floating UI styles for positioning */
6
+ floatingStyles: CSSProperties;
7
+ /** Ref setter for the floating element */
8
+ setFloatingRef: (node: HTMLElement | null) => void;
9
+ };
10
+ export declare const FloatingToolbarContext: import("react").Context<FloatingToolbarContextValue | null>;
11
+ export declare const useFloatingToolbarContext: () => FloatingToolbarContextValue;
12
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/floating-toolbar/context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,2BAA2B,GAAG;IACxC,sCAAsC;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,yCAAyC;IACzC,cAAc,EAAE,aAAa,CAAC;IAC9B,0CAA0C;IAC1C,cAAc,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF,eAAO,MAAM,sBAAsB,6DAA0D,CAAC;AAE9F,eAAO,MAAM,yBAAyB,mCAQrC,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
+ import './floating-toolbar.css';
3
+ type FloatingToolbarApi = {
4
+ isOpen: boolean;
5
+ };
6
+ type FloatingToolbarRootProps = {
7
+ children: ReactNode | ((api: FloatingToolbarApi) => ReactNode);
8
+ /** When true, selection tracking is paused (e.g., when a popover is open) */
9
+ frozen?: boolean;
10
+ className?: string;
11
+ };
12
+ type FloatingToolbarContentProps = {
13
+ children: ReactNode;
14
+ className?: string;
15
+ } & HTMLAttributes<HTMLDivElement>;
16
+ type FloatingToolbarGroupProps = HTMLAttributes<HTMLDivElement>;
17
+ type FloatingToolbarSeparatorProps = HTMLAttributes<HTMLDivElement>;
18
+ type FloatingToolbarButtonProps = {
19
+ active?: boolean;
20
+ disabled?: boolean;
21
+ type?: 'button' | 'submit' | 'reset';
22
+ } & HTMLAttributes<HTMLButtonElement>;
23
+ export declare const FloatingToolbar: {
24
+ ({ children, frozen, className }: FloatingToolbarRootProps): import("react/jsx-runtime").JSX.Element;
25
+ displayName: string;
26
+ } & {
27
+ Root: {
28
+ ({ children, frozen, className }: FloatingToolbarRootProps): import("react/jsx-runtime").JSX.Element;
29
+ displayName: string;
30
+ };
31
+ Content: import("react").ForwardRefExoticComponent<{
32
+ children: ReactNode;
33
+ className?: string | undefined;
34
+ } & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
35
+ Group: import("react").ForwardRefExoticComponent<FloatingToolbarGroupProps & import("react").RefAttributes<HTMLDivElement>>;
36
+ Separator: import("react").ForwardRefExoticComponent<FloatingToolbarSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
37
+ Button: import("react").ForwardRefExoticComponent<{
38
+ active?: boolean | undefined;
39
+ disabled?: boolean | undefined;
40
+ type?: "button" | "submit" | "reset" | undefined;
41
+ } & HTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
42
+ };
43
+ export type { FloatingToolbarRootProps, FloatingToolbarContentProps, FloatingToolbarGroupProps, FloatingToolbarSeparatorProps, FloatingToolbarButtonProps, FloatingToolbarApi, };
44
+ //# sourceMappingURL=floating-toolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"floating-toolbar.d.ts","sourceRoot":"","sources":["../../src/floating-toolbar/floating-toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAyD,MAAM,OAAO,CAAC;AAgBnH,OAAO,wBAAwB,CAAC;AAEhC,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,GAAG,EAAE,kBAAkB,KAAK,SAAS,CAAC,CAAC;IAC/D,6EAA6E;IAC7E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAqLF,KAAK,2BAA2B,GAAG;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAiCnC,KAAK,yBAAyB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAgBhE,KAAK,6BAA6B,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAcpE,KAAK,0BAA0B,GAAG;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAuBtC,eAAO,MAAM,eAAe;sCAhR+C,wBAAwB;;;;0CAAxB,wBAAwB;;;;kBAoLvF,SAAS;;;;;;;;;;CAkGnB,CAAC;AAEH,YAAY,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,EACzB,6BAA6B,EAC7B,0BAA0B,EAC1B,kBAAkB,GACnB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { FloatingToolbar } from './floating-toolbar';
2
+ export type { FloatingToolbarApi, FloatingToolbarButtonProps, FloatingToolbarContentProps, FloatingToolbarGroupProps, FloatingToolbarRootProps, FloatingToolbarSeparatorProps, } from './floating-toolbar';
3
+ export { useFloatingToolbarContext } from './context';
4
+ export type { FloatingToolbarContextValue } from './context';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/floating-toolbar/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,EACzB,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAGtD,YAAY,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC"}