@ohhwells/bridge 0.1.16 → 0.1.17-next.15
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/README.md +237 -74
- package/dist/index.cjs +2292 -126
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +68 -2
- package/dist/index.d.ts +68 -2
- package/dist/index.js +2276 -119
- package/dist/index.js.map +1 -1
- package/dist/styles.css +829 -55
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default from 'react';
|
|
2
|
+
import React__default, { Ref } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
5
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -7,6 +7,66 @@ import { Toggle as Toggle$1 } from 'radix-ui';
|
|
|
7
7
|
|
|
8
8
|
declare function OhhwellsBridge(): React__default.ReactPortal | null;
|
|
9
9
|
|
|
10
|
+
type ParentScroll = {
|
|
11
|
+
iframeOffsetTop: number;
|
|
12
|
+
headerH: number;
|
|
13
|
+
canvasH: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type LinkPage = {
|
|
17
|
+
path: string;
|
|
18
|
+
title: string;
|
|
19
|
+
};
|
|
20
|
+
type LinkSection = {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
};
|
|
24
|
+
type LinkModalMode = 'create' | 'edit';
|
|
25
|
+
type LinkModalProps = {
|
|
26
|
+
open: boolean;
|
|
27
|
+
mode?: LinkModalMode;
|
|
28
|
+
pages: LinkPage[];
|
|
29
|
+
sections?: LinkSection[];
|
|
30
|
+
sectionsByPath?: Record<string, LinkSection[]>;
|
|
31
|
+
initialTarget?: string;
|
|
32
|
+
existingTargets?: string[];
|
|
33
|
+
onClose: () => void;
|
|
34
|
+
onSubmit: (target: string) => void;
|
|
35
|
+
};
|
|
36
|
+
type SelectedPage = {
|
|
37
|
+
path: string;
|
|
38
|
+
title: string;
|
|
39
|
+
};
|
|
40
|
+
type SelectedSection = {
|
|
41
|
+
id: string;
|
|
42
|
+
label: string;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
type LinkPopoverProps = LinkModalProps & {
|
|
46
|
+
rect: DOMRect;
|
|
47
|
+
parentScroll: ParentScroll | null;
|
|
48
|
+
panelRef?: Ref<HTMLDivElement>;
|
|
49
|
+
};
|
|
50
|
+
declare function LinkPopover({ rect, parentScroll, panelRef, ...editorProps }: LinkPopoverProps): react_jsx_runtime.JSX.Element;
|
|
51
|
+
|
|
52
|
+
/** Link destination editor body — Figma node 8365:7616 / 8382:4161 */
|
|
53
|
+
declare function LinkEditorPanel({ open, mode, pages, sections, sectionsByPath, initialTarget, existingTargets, onClose, onSubmit, }: LinkModalProps): react_jsx_runtime.JSX.Element;
|
|
54
|
+
|
|
55
|
+
declare function parseTarget(target: string | null | undefined): {
|
|
56
|
+
pageRoute: string;
|
|
57
|
+
sectionId: string | null;
|
|
58
|
+
};
|
|
59
|
+
declare function buildTarget(page: SelectedPage, section: SelectedSection | null): string;
|
|
60
|
+
declare function isValidUrl(urlString: string): boolean;
|
|
61
|
+
declare function validateUrlInput(value: string, pages: LinkPage[], allPages: LinkPage[]): string;
|
|
62
|
+
declare function getEditModeInitialState(target: string | undefined, pages: LinkPage[], sections: LinkSection[]): {
|
|
63
|
+
searchValue: string;
|
|
64
|
+
selectedPage: SelectedPage | null;
|
|
65
|
+
selectedSection: SelectedSection | null;
|
|
66
|
+
step: 'input' | 'sectionPicker' | 'confirmed';
|
|
67
|
+
};
|
|
68
|
+
declare function filterAvailablePages(pages: LinkPage[], existingTargets: string[]): LinkPage[];
|
|
69
|
+
|
|
10
70
|
declare const toggleVariants: (props?: ({
|
|
11
71
|
variant?: "default" | "outline" | null | undefined;
|
|
12
72
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
@@ -23,4 +83,10 @@ declare function ToggleGroupItem({ className, value, children, ...props }: {
|
|
|
23
83
|
children: React.ReactNode;
|
|
24
84
|
} & Omit<React.ComponentProps<typeof Toggle>, 'pressed' | 'onPressedChange'>): react_jsx_runtime.JSX.Element;
|
|
25
85
|
|
|
26
|
-
|
|
86
|
+
declare function SchedulingWidget({ notifyOnConnect, initialScheduleId, insertAfter }: {
|
|
87
|
+
notifyOnConnect?: boolean;
|
|
88
|
+
initialScheduleId?: string | null;
|
|
89
|
+
insertAfter: string;
|
|
90
|
+
}): react_jsx_runtime.JSX.Element;
|
|
91
|
+
|
|
92
|
+
export { LinkEditorPanel, type LinkModalMode, type LinkModalProps, type LinkPage, LinkPopover, type LinkSection, OhhwellsBridge, SchedulingWidget, Toggle, ToggleGroup, ToggleGroupItem, buildTarget, filterAvailablePages, getEditModeInitialState, isValidUrl, parseTarget, toggleVariants, validateUrlInput };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default from 'react';
|
|
2
|
+
import React__default, { Ref } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
5
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -7,6 +7,66 @@ import { Toggle as Toggle$1 } from 'radix-ui';
|
|
|
7
7
|
|
|
8
8
|
declare function OhhwellsBridge(): React__default.ReactPortal | null;
|
|
9
9
|
|
|
10
|
+
type ParentScroll = {
|
|
11
|
+
iframeOffsetTop: number;
|
|
12
|
+
headerH: number;
|
|
13
|
+
canvasH: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type LinkPage = {
|
|
17
|
+
path: string;
|
|
18
|
+
title: string;
|
|
19
|
+
};
|
|
20
|
+
type LinkSection = {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
};
|
|
24
|
+
type LinkModalMode = 'create' | 'edit';
|
|
25
|
+
type LinkModalProps = {
|
|
26
|
+
open: boolean;
|
|
27
|
+
mode?: LinkModalMode;
|
|
28
|
+
pages: LinkPage[];
|
|
29
|
+
sections?: LinkSection[];
|
|
30
|
+
sectionsByPath?: Record<string, LinkSection[]>;
|
|
31
|
+
initialTarget?: string;
|
|
32
|
+
existingTargets?: string[];
|
|
33
|
+
onClose: () => void;
|
|
34
|
+
onSubmit: (target: string) => void;
|
|
35
|
+
};
|
|
36
|
+
type SelectedPage = {
|
|
37
|
+
path: string;
|
|
38
|
+
title: string;
|
|
39
|
+
};
|
|
40
|
+
type SelectedSection = {
|
|
41
|
+
id: string;
|
|
42
|
+
label: string;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
type LinkPopoverProps = LinkModalProps & {
|
|
46
|
+
rect: DOMRect;
|
|
47
|
+
parentScroll: ParentScroll | null;
|
|
48
|
+
panelRef?: Ref<HTMLDivElement>;
|
|
49
|
+
};
|
|
50
|
+
declare function LinkPopover({ rect, parentScroll, panelRef, ...editorProps }: LinkPopoverProps): react_jsx_runtime.JSX.Element;
|
|
51
|
+
|
|
52
|
+
/** Link destination editor body — Figma node 8365:7616 / 8382:4161 */
|
|
53
|
+
declare function LinkEditorPanel({ open, mode, pages, sections, sectionsByPath, initialTarget, existingTargets, onClose, onSubmit, }: LinkModalProps): react_jsx_runtime.JSX.Element;
|
|
54
|
+
|
|
55
|
+
declare function parseTarget(target: string | null | undefined): {
|
|
56
|
+
pageRoute: string;
|
|
57
|
+
sectionId: string | null;
|
|
58
|
+
};
|
|
59
|
+
declare function buildTarget(page: SelectedPage, section: SelectedSection | null): string;
|
|
60
|
+
declare function isValidUrl(urlString: string): boolean;
|
|
61
|
+
declare function validateUrlInput(value: string, pages: LinkPage[], allPages: LinkPage[]): string;
|
|
62
|
+
declare function getEditModeInitialState(target: string | undefined, pages: LinkPage[], sections: LinkSection[]): {
|
|
63
|
+
searchValue: string;
|
|
64
|
+
selectedPage: SelectedPage | null;
|
|
65
|
+
selectedSection: SelectedSection | null;
|
|
66
|
+
step: 'input' | 'sectionPicker' | 'confirmed';
|
|
67
|
+
};
|
|
68
|
+
declare function filterAvailablePages(pages: LinkPage[], existingTargets: string[]): LinkPage[];
|
|
69
|
+
|
|
10
70
|
declare const toggleVariants: (props?: ({
|
|
11
71
|
variant?: "default" | "outline" | null | undefined;
|
|
12
72
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
@@ -23,4 +83,10 @@ declare function ToggleGroupItem({ className, value, children, ...props }: {
|
|
|
23
83
|
children: React.ReactNode;
|
|
24
84
|
} & Omit<React.ComponentProps<typeof Toggle>, 'pressed' | 'onPressedChange'>): react_jsx_runtime.JSX.Element;
|
|
25
85
|
|
|
26
|
-
|
|
86
|
+
declare function SchedulingWidget({ notifyOnConnect, initialScheduleId, insertAfter }: {
|
|
87
|
+
notifyOnConnect?: boolean;
|
|
88
|
+
initialScheduleId?: string | null;
|
|
89
|
+
insertAfter: string;
|
|
90
|
+
}): react_jsx_runtime.JSX.Element;
|
|
91
|
+
|
|
92
|
+
export { LinkEditorPanel, type LinkModalMode, type LinkModalProps, type LinkPage, LinkPopover, type LinkSection, OhhwellsBridge, SchedulingWidget, Toggle, ToggleGroup, ToggleGroupItem, buildTarget, filterAvailablePages, getEditModeInitialState, isValidUrl, parseTarget, toggleVariants, validateUrlInput };
|