@ohhwells/bridge 0.1.39 → 0.1.41

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/index.d.cts CHANGED
@@ -27,6 +27,7 @@ type LinkModalProps = {
27
27
  onClose: () => void;
28
28
  onSubmit: (target: string) => void;
29
29
  };
30
+ type LinkModalStep = 'input' | 'sectionPicker' | 'confirmed';
30
31
  type SelectedPage = {
31
32
  path: string;
32
33
  title: string;
@@ -42,10 +43,55 @@ type LinkPopoverProps = LinkModalProps & {
42
43
  portalContainer?: HTMLElement | null;
43
44
  };
44
45
  /** Centered link editor dialog (shadcn Dialog + Radix). */
45
- declare function LinkPopover({ open, panelRef, portalContainer, onClose, ...editorProps }: LinkPopoverProps): react_jsx_runtime.JSX.Element;
46
+ declare function LinkPopover({ open, panelRef, portalContainer, onClose, mode, pages, sections, sectionsByPath, initialTarget, existingTargets, onSubmit, }: LinkPopoverProps): react_jsx_runtime.JSX.Element;
46
47
 
48
+ type UseLinkModalStateParams = {
49
+ open: boolean;
50
+ mode: LinkModalMode;
51
+ pages: LinkPage[];
52
+ sections: LinkSection[];
53
+ sectionsByPath?: Record<string, LinkSection[]>;
54
+ initialTarget?: string;
55
+ existingTargets: string[];
56
+ onClose: () => void;
57
+ onSubmit: (target: string) => void;
58
+ };
59
+ declare function useLinkModalState({ open, mode, pages, sections: _sections, sectionsByPath, initialTarget, existingTargets: _existingTargets, onClose, onSubmit, }: UseLinkModalStateParams): {
60
+ title: string;
61
+ submitLabel: string;
62
+ secondaryLabel: string;
63
+ searchValue: string;
64
+ selectedPage: SelectedPage | null;
65
+ selectedSection: SelectedSection | null;
66
+ step: LinkModalStep;
67
+ dropdownOpen: boolean;
68
+ setDropdownOpen: React.Dispatch<React.SetStateAction<boolean>>;
69
+ urlError: string;
70
+ filteredPages: LinkPage[];
71
+ showBreadcrumb: false | SelectedSection | null;
72
+ showSectionPicker: false | SelectedPage | null;
73
+ showChooseSection: boolean | null;
74
+ showSectionRow: boolean | null;
75
+ isValid: boolean;
76
+ activeSections: LinkSection[];
77
+ handleInputChange: (value: string) => void;
78
+ handlePageSelect: (page: LinkPage) => void;
79
+ handleChooseSection: () => void;
80
+ handleSectionSelect: (section: LinkSection) => void;
81
+ handleBackToSections: () => void;
82
+ handleSectionPickerBack: () => void;
83
+ handleClose: () => void;
84
+ handleSecondary: () => void;
85
+ handleSubmit: () => void;
86
+ };
87
+
88
+ type LinkModalState = ReturnType<typeof useLinkModalState>;
89
+ type LinkEditorPanelProps = {
90
+ state: LinkModalState;
91
+ onClose: () => void;
92
+ };
47
93
  /** Link destination editor body — Figma node 8365:7616 / 8382:4161 */
48
- declare function LinkEditorPanel({ open, mode, pages, sections, sectionsByPath, initialTarget, existingTargets, onClose, onSubmit, }: LinkModalProps): react_jsx_runtime.JSX.Element;
94
+ declare function LinkEditorPanel({ state, onClose }: LinkEditorPanelProps): react_jsx_runtime.JSX.Element;
49
95
 
50
96
  declare function parseTarget(target: string | null | undefined): {
51
97
  pageRoute: string;
@@ -96,13 +142,14 @@ type ItemActionToolbarProps = {
96
142
  onEditLink?: () => void;
97
143
  onAddItem?: () => void;
98
144
  onMore?: () => void;
145
+ editLinkDisabled?: boolean;
99
146
  addItemDisabled?: boolean;
100
147
  moreDisabled?: boolean;
101
148
  /** Tooltip placement relative to each icon — Figma uses bottom. */
102
149
  tooltipSide?: 'top' | 'bottom' | 'left' | 'right';
103
150
  };
104
151
  /** Item-action fill for Custom/Toolbar — Edit link / Add item / More. */
105
- declare function ItemActionToolbar({ onEditLink, onAddItem, onMore, addItemDisabled, moreDisabled, tooltipSide, }: ItemActionToolbarProps): react_jsx_runtime.JSX.Element;
152
+ declare function ItemActionToolbar({ onEditLink, onAddItem, onMore, editLinkDisabled, addItemDisabled, moreDisabled, tooltipSide, }: ItemActionToolbarProps): react_jsx_runtime.JSX.Element;
106
153
 
107
154
  type ItemInteractionState = 'default' | 'hover' | 'sibling-hint' | 'active-top' | 'active-bottom' | 'dragging';
108
155
  type ItemInteractionLayerProps = {
package/dist/index.d.ts CHANGED
@@ -27,6 +27,7 @@ type LinkModalProps = {
27
27
  onClose: () => void;
28
28
  onSubmit: (target: string) => void;
29
29
  };
30
+ type LinkModalStep = 'input' | 'sectionPicker' | 'confirmed';
30
31
  type SelectedPage = {
31
32
  path: string;
32
33
  title: string;
@@ -42,10 +43,55 @@ type LinkPopoverProps = LinkModalProps & {
42
43
  portalContainer?: HTMLElement | null;
43
44
  };
44
45
  /** Centered link editor dialog (shadcn Dialog + Radix). */
45
- declare function LinkPopover({ open, panelRef, portalContainer, onClose, ...editorProps }: LinkPopoverProps): react_jsx_runtime.JSX.Element;
46
+ declare function LinkPopover({ open, panelRef, portalContainer, onClose, mode, pages, sections, sectionsByPath, initialTarget, existingTargets, onSubmit, }: LinkPopoverProps): react_jsx_runtime.JSX.Element;
46
47
 
48
+ type UseLinkModalStateParams = {
49
+ open: boolean;
50
+ mode: LinkModalMode;
51
+ pages: LinkPage[];
52
+ sections: LinkSection[];
53
+ sectionsByPath?: Record<string, LinkSection[]>;
54
+ initialTarget?: string;
55
+ existingTargets: string[];
56
+ onClose: () => void;
57
+ onSubmit: (target: string) => void;
58
+ };
59
+ declare function useLinkModalState({ open, mode, pages, sections: _sections, sectionsByPath, initialTarget, existingTargets: _existingTargets, onClose, onSubmit, }: UseLinkModalStateParams): {
60
+ title: string;
61
+ submitLabel: string;
62
+ secondaryLabel: string;
63
+ searchValue: string;
64
+ selectedPage: SelectedPage | null;
65
+ selectedSection: SelectedSection | null;
66
+ step: LinkModalStep;
67
+ dropdownOpen: boolean;
68
+ setDropdownOpen: React.Dispatch<React.SetStateAction<boolean>>;
69
+ urlError: string;
70
+ filteredPages: LinkPage[];
71
+ showBreadcrumb: false | SelectedSection | null;
72
+ showSectionPicker: false | SelectedPage | null;
73
+ showChooseSection: boolean | null;
74
+ showSectionRow: boolean | null;
75
+ isValid: boolean;
76
+ activeSections: LinkSection[];
77
+ handleInputChange: (value: string) => void;
78
+ handlePageSelect: (page: LinkPage) => void;
79
+ handleChooseSection: () => void;
80
+ handleSectionSelect: (section: LinkSection) => void;
81
+ handleBackToSections: () => void;
82
+ handleSectionPickerBack: () => void;
83
+ handleClose: () => void;
84
+ handleSecondary: () => void;
85
+ handleSubmit: () => void;
86
+ };
87
+
88
+ type LinkModalState = ReturnType<typeof useLinkModalState>;
89
+ type LinkEditorPanelProps = {
90
+ state: LinkModalState;
91
+ onClose: () => void;
92
+ };
47
93
  /** Link destination editor body — Figma node 8365:7616 / 8382:4161 */
48
- declare function LinkEditorPanel({ open, mode, pages, sections, sectionsByPath, initialTarget, existingTargets, onClose, onSubmit, }: LinkModalProps): react_jsx_runtime.JSX.Element;
94
+ declare function LinkEditorPanel({ state, onClose }: LinkEditorPanelProps): react_jsx_runtime.JSX.Element;
49
95
 
50
96
  declare function parseTarget(target: string | null | undefined): {
51
97
  pageRoute: string;
@@ -96,13 +142,14 @@ type ItemActionToolbarProps = {
96
142
  onEditLink?: () => void;
97
143
  onAddItem?: () => void;
98
144
  onMore?: () => void;
145
+ editLinkDisabled?: boolean;
99
146
  addItemDisabled?: boolean;
100
147
  moreDisabled?: boolean;
101
148
  /** Tooltip placement relative to each icon — Figma uses bottom. */
102
149
  tooltipSide?: 'top' | 'bottom' | 'left' | 'right';
103
150
  };
104
151
  /** Item-action fill for Custom/Toolbar — Edit link / Add item / More. */
105
- declare function ItemActionToolbar({ onEditLink, onAddItem, onMore, addItemDisabled, moreDisabled, tooltipSide, }: ItemActionToolbarProps): react_jsx_runtime.JSX.Element;
152
+ declare function ItemActionToolbar({ onEditLink, onAddItem, onMore, editLinkDisabled, addItemDisabled, moreDisabled, tooltipSide, }: ItemActionToolbarProps): react_jsx_runtime.JSX.Element;
106
153
 
107
154
  type ItemInteractionState = 'default' | 'hover' | 'sibling-hint' | 'active-top' | 'active-bottom' | 'dragging';
108
155
  type ItemInteractionLayerProps = {