@vibes.diy/use-vibes-base 0.12.14 → 0.12.15-dev02
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/components/AuthWall/AuthWall.d.ts +8 -0
- package/components/AuthWall/AuthWall.js +48 -0
- package/components/AuthWall/AuthWall.js.map +1 -0
- package/components/AuthWall/AuthWall.styles.d.ts +6 -0
- package/components/AuthWall/AuthWall.styles.js +50 -0
- package/components/AuthWall/AuthWall.styles.js.map +1 -0
- package/components/ControlsBar.d.ts +1 -1
- package/components/ControlsBar.js +4 -4
- package/components/ControlsBar.js.map +1 -1
- package/components/HiddenMenuWrapper/HiddenMenuWrapper.d.ts +6 -0
- package/components/HiddenMenuWrapper/HiddenMenuWrapper.js +52 -0
- package/components/HiddenMenuWrapper/HiddenMenuWrapper.js.map +1 -0
- package/components/HiddenMenuWrapper/HiddenMenuWrapper.styles.d.ts +30 -0
- package/components/HiddenMenuWrapper/HiddenMenuWrapper.styles.js +72 -0
- package/components/HiddenMenuWrapper/HiddenMenuWrapper.styles.js.map +1 -0
- package/components/ImgGen.d.ts +1 -2
- package/components/ImgGen.js +6 -4
- package/components/ImgGen.js.map +1 -1
- package/components/ImgGenUtils/ImgGenDisplayPlaceholder.js +1 -1
- package/components/ImgGenUtils/ImgGenDisplayPlaceholder.js.map +1 -1
- package/components/ImgGenUtils/ImgGenDisplayUtils.d.ts +2 -2
- package/components/ImgGenUtils/ImgGenModeUtils.d.ts +1 -1
- package/components/ImgGenUtils/ImgGenUploadWaiting.d.ts +1 -1
- package/components/ImgGenUtils/ImgGenUploadWaiting.js +2 -2
- package/components/ImgGenUtils/ImgGenUploadWaiting.js.map +1 -1
- package/components/ImgGenUtils/overlays/DeleteConfirmationOverlay.js +1 -1
- package/components/ImgGenUtils/overlays/DeleteConfirmationOverlay.js.map +1 -1
- package/components/ImgGenUtils/types.d.ts +1 -1
- package/components/VibeControl.d.ts +13 -0
- package/components/VibeControl.js +59 -0
- package/components/VibeControl.js.map +1 -0
- package/components/VibesButton/VibesButton.d.ts +10 -0
- package/components/VibesButton/VibesButton.js +20 -0
- package/components/VibesButton/VibesButton.js.map +1 -0
- package/components/VibesButton/VibesButton.styles.d.ts +6 -0
- package/components/VibesButton/VibesButton.styles.js +35 -0
- package/components/VibesButton/VibesButton.styles.js.map +1 -0
- package/components/VibesSwitch/VibesSwitch.d.ts +6 -0
- package/components/VibesSwitch/VibesSwitch.js +42 -0
- package/components/VibesSwitch/VibesSwitch.js.map +1 -0
- package/components/VibesSwitch/VibesSwitch.styles.d.ts +4 -0
- package/components/VibesSwitch/VibesSwitch.styles.js +5 -0
- package/components/VibesSwitch/VibesSwitch.styles.js.map +1 -0
- package/hooks/image-gen/image-generator.d.ts +1 -1
- package/hooks/image-gen/index.d.ts +1 -1
- package/hooks/image-gen/index.js.map +1 -1
- package/hooks/image-gen/use-image-gen.d.ts +2 -4
- package/hooks/image-gen/use-image-gen.js.map +1 -1
- package/hooks/image-gen/utils.d.ts +1 -1
- package/hooks/image-gen/utils.js.map +1 -1
- package/hooks/vibes-gen/IframeVibesComponent.d.ts +1 -0
- package/hooks/vibes-gen/IframeVibesComponent.js +8 -3
- package/hooks/vibes-gen/IframeVibesComponent.js.map +1 -1
- package/hooks/vibes-gen/index.d.ts +1 -1
- package/hooks/vibes-gen/use-vibes.d.ts +1 -1
- package/hooks/vibes-gen/use-vibes.js +4 -4
- package/hooks/vibes-gen/use-vibes.js.map +1 -1
- package/index.d.ts +22 -4
- package/index.js +12 -2
- package/index.js.map +1 -1
- package/package.json +16 -6
- package/stories/VibeControl.stories.d.ts +13 -0
- package/stories/VibeControl.stories.js +155 -0
- package/stories/VibeControl.stories.js.map +1 -0
- package/stories/VibeControlMount.stories.d.ts +14 -0
- package/stories/VibeControlMount.stories.js +182 -0
- package/stories/VibeControlMount.stories.js.map +1 -0
- package/tsconfig.json +0 -4
- package/utils/style-utils.d.ts +2 -15
- package/utils/style-utils.js.map +1 -1
- package/utils/vibe-control-styles.d.ts +148 -0
- package/utils/vibe-control-styles.js +170 -0
- package/utils/vibe-control-styles.js.map +1 -0
- package/vibe-auth-wall.d.ts +14 -0
- package/vibe-auth-wall.js +79 -0
- package/vibe-auth-wall.js.map +1 -0
- package/vibe-control-mount.d.ts +14 -0
- package/vibe-control-mount.js +75 -0
- package/vibe-control-mount.js.map +1 -0
- package/vibe-hidden-menu-mount.d.ts +18 -0
- package/vibe-hidden-menu-mount.js +73 -0
- package/vibe-hidden-menu-mount.js.map +1 -0
- package/hooks/image-gen/types.d.ts +0 -66
- package/hooks/image-gen/types.js +0 -2
- package/hooks/image-gen/types.js.map +0 -1
- package/hooks/vibes-gen/types.d.ts +0 -42
- package/hooks/vibes-gen/types.js +0 -2
- package/hooks/vibes-gen/types.js.map +0 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
export type VibeControlPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
2
|
+
export declare const vibeControlTheme: {
|
|
3
|
+
colors: {
|
|
4
|
+
buttonBg: string;
|
|
5
|
+
buttonBgHover: string;
|
|
6
|
+
buttonText: string;
|
|
7
|
+
buttonBorder: string;
|
|
8
|
+
overlayBackdrop: string;
|
|
9
|
+
overlayBg: string;
|
|
10
|
+
overlayText: string;
|
|
11
|
+
overlayBorder: string;
|
|
12
|
+
closeButtonBg: string;
|
|
13
|
+
closeButtonBgHover: string;
|
|
14
|
+
closeButtonText: string;
|
|
15
|
+
accent: string;
|
|
16
|
+
shadow: string;
|
|
17
|
+
};
|
|
18
|
+
dimensions: {
|
|
19
|
+
buttonWidth: string;
|
|
20
|
+
buttonHeight: string;
|
|
21
|
+
buttonPadding: string;
|
|
22
|
+
buttonBorderRadius: string;
|
|
23
|
+
buttonPosition: string;
|
|
24
|
+
overlayPadding: string;
|
|
25
|
+
overlayBorderRadius: string;
|
|
26
|
+
overlayMaxWidth: string;
|
|
27
|
+
overlayMaxHeight: string;
|
|
28
|
+
closeButtonSize: string;
|
|
29
|
+
closeButtonBorderRadius: string;
|
|
30
|
+
};
|
|
31
|
+
typography: {
|
|
32
|
+
buttonFontSize: string;
|
|
33
|
+
buttonFontWeight: string;
|
|
34
|
+
buttonLineHeight: string;
|
|
35
|
+
overlayTitleFontSize: string;
|
|
36
|
+
overlayTitleFontWeight: string;
|
|
37
|
+
overlayTitleLineHeight: string;
|
|
38
|
+
overlayBodyFontSize: string;
|
|
39
|
+
overlayBodyLineHeight: string;
|
|
40
|
+
};
|
|
41
|
+
effects: {
|
|
42
|
+
buttonShadow: string;
|
|
43
|
+
buttonShadowHover: string;
|
|
44
|
+
overlayShadow: string;
|
|
45
|
+
transition: string;
|
|
46
|
+
backdropFilter: string;
|
|
47
|
+
};
|
|
48
|
+
zIndex: {
|
|
49
|
+
button: number;
|
|
50
|
+
overlay: number;
|
|
51
|
+
backdrop: number;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export declare const createVibeControlStyles: (position?: VibeControlPosition) => {
|
|
55
|
+
button: {
|
|
56
|
+
position: "fixed";
|
|
57
|
+
width: string;
|
|
58
|
+
height: string;
|
|
59
|
+
padding: string;
|
|
60
|
+
backgroundColor: string;
|
|
61
|
+
color: string;
|
|
62
|
+
border: string;
|
|
63
|
+
borderRadius: string;
|
|
64
|
+
fontSize: string;
|
|
65
|
+
fontWeight: string;
|
|
66
|
+
lineHeight: string;
|
|
67
|
+
cursor: string;
|
|
68
|
+
boxShadow: string;
|
|
69
|
+
transition: string;
|
|
70
|
+
zIndex: number;
|
|
71
|
+
display: string;
|
|
72
|
+
alignItems: string;
|
|
73
|
+
justifyContent: string;
|
|
74
|
+
userSelect: "none";
|
|
75
|
+
};
|
|
76
|
+
buttonHover: {
|
|
77
|
+
backgroundColor: string;
|
|
78
|
+
boxShadow: string;
|
|
79
|
+
transform: string;
|
|
80
|
+
};
|
|
81
|
+
backdrop: {
|
|
82
|
+
position: "fixed";
|
|
83
|
+
top: number;
|
|
84
|
+
left: number;
|
|
85
|
+
right: number;
|
|
86
|
+
bottom: number;
|
|
87
|
+
backgroundColor: string;
|
|
88
|
+
backdropFilter: string;
|
|
89
|
+
zIndex: number;
|
|
90
|
+
display: string;
|
|
91
|
+
alignItems: string;
|
|
92
|
+
justifyContent: string;
|
|
93
|
+
};
|
|
94
|
+
overlay: {
|
|
95
|
+
backgroundColor: string;
|
|
96
|
+
color: string;
|
|
97
|
+
border: string;
|
|
98
|
+
borderRadius: string;
|
|
99
|
+
padding: string;
|
|
100
|
+
maxWidth: string;
|
|
101
|
+
maxHeight: string;
|
|
102
|
+
width: string;
|
|
103
|
+
boxShadow: string;
|
|
104
|
+
position: "relative";
|
|
105
|
+
overflow: "auto";
|
|
106
|
+
};
|
|
107
|
+
overlayTitle: {
|
|
108
|
+
fontSize: string;
|
|
109
|
+
fontWeight: string;
|
|
110
|
+
lineHeight: string;
|
|
111
|
+
margin: string;
|
|
112
|
+
paddingRight: string;
|
|
113
|
+
};
|
|
114
|
+
closeButton: {
|
|
115
|
+
position: "absolute";
|
|
116
|
+
top: string;
|
|
117
|
+
right: string;
|
|
118
|
+
width: string;
|
|
119
|
+
height: string;
|
|
120
|
+
backgroundColor: string;
|
|
121
|
+
color: string;
|
|
122
|
+
border: string;
|
|
123
|
+
borderRadius: string;
|
|
124
|
+
cursor: string;
|
|
125
|
+
display: string;
|
|
126
|
+
alignItems: string;
|
|
127
|
+
justifyContent: string;
|
|
128
|
+
fontSize: string;
|
|
129
|
+
fontWeight: string;
|
|
130
|
+
transition: string;
|
|
131
|
+
};
|
|
132
|
+
closeButtonHover: {
|
|
133
|
+
backgroundColor: string;
|
|
134
|
+
};
|
|
135
|
+
content: {
|
|
136
|
+
fontSize: string;
|
|
137
|
+
lineHeight: string;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
export declare const defaultVibeControlClasses: {
|
|
141
|
+
button: string;
|
|
142
|
+
backdrop: string;
|
|
143
|
+
overlay: string;
|
|
144
|
+
overlayTitle: string;
|
|
145
|
+
closeButton: string;
|
|
146
|
+
content: string;
|
|
147
|
+
};
|
|
148
|
+
export type VibeControlClasses = typeof defaultVibeControlClasses;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
export const vibeControlTheme = {
|
|
2
|
+
colors: {
|
|
3
|
+
buttonBg: 'var(--vc-button-bg, #dc2626)',
|
|
4
|
+
buttonBgHover: 'var(--vc-button-bg-hover, #b91c1c)',
|
|
5
|
+
buttonText: 'var(--vc-button-text, #ffffff)',
|
|
6
|
+
buttonBorder: 'var(--vc-button-border, #dc2626)',
|
|
7
|
+
overlayBackdrop: 'var(--vc-overlay-backdrop, rgba(0, 0, 0, 0.5))',
|
|
8
|
+
overlayBg: 'var(--vc-overlay-bg, #ffffff)',
|
|
9
|
+
overlayText: 'var(--vc-overlay-text, #333333)',
|
|
10
|
+
overlayBorder: 'var(--vc-overlay-border, #e0e0e0)',
|
|
11
|
+
closeButtonBg: 'var(--vc-close-bg, #f5f5f5)',
|
|
12
|
+
closeButtonBgHover: 'var(--vc-close-bg-hover, #e0e0e0)',
|
|
13
|
+
closeButtonText: 'var(--vc-close-text, #666666)',
|
|
14
|
+
accent: 'var(--vc-accent, #0066cc)',
|
|
15
|
+
shadow: 'var(--vc-shadow, rgba(0, 0, 0, 0.15))',
|
|
16
|
+
},
|
|
17
|
+
dimensions: {
|
|
18
|
+
buttonWidth: '120px',
|
|
19
|
+
buttonHeight: '40px',
|
|
20
|
+
buttonPadding: '8px 16px',
|
|
21
|
+
buttonBorderRadius: '20px',
|
|
22
|
+
buttonPosition: '20px', // Distance from edge
|
|
23
|
+
overlayPadding: '24px',
|
|
24
|
+
overlayBorderRadius: '12px',
|
|
25
|
+
overlayMaxWidth: '800px',
|
|
26
|
+
overlayMaxHeight: '90vh',
|
|
27
|
+
closeButtonSize: '32px',
|
|
28
|
+
closeButtonBorderRadius: '16px',
|
|
29
|
+
},
|
|
30
|
+
typography: {
|
|
31
|
+
buttonFontSize: '14px',
|
|
32
|
+
buttonFontWeight: '600',
|
|
33
|
+
buttonLineHeight: '1.2',
|
|
34
|
+
overlayTitleFontSize: '24px',
|
|
35
|
+
overlayTitleFontWeight: '700',
|
|
36
|
+
overlayTitleLineHeight: '1.3',
|
|
37
|
+
overlayBodyFontSize: '16px',
|
|
38
|
+
overlayBodyLineHeight: '1.5',
|
|
39
|
+
},
|
|
40
|
+
effects: {
|
|
41
|
+
buttonShadow: '0 2px 8px rgba(0, 0, 0, 0.15)',
|
|
42
|
+
buttonShadowHover: '0 4px 12px rgba(0, 0, 0, 0.2)',
|
|
43
|
+
overlayShadow: '0 8px 32px rgba(0, 0, 0, 0.2)',
|
|
44
|
+
transition: '0.2s ease-in-out',
|
|
45
|
+
backdropFilter: 'blur(4px)',
|
|
46
|
+
},
|
|
47
|
+
zIndex: {
|
|
48
|
+
button: 1000,
|
|
49
|
+
overlay: 1100,
|
|
50
|
+
backdrop: 1050,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
export const createVibeControlStyles = (position = 'bottom-right') => {
|
|
54
|
+
const pos = vibeControlTheme.dimensions.buttonPosition;
|
|
55
|
+
const anchor = {};
|
|
56
|
+
switch (position) {
|
|
57
|
+
case 'bottom-right':
|
|
58
|
+
anchor.bottom = pos;
|
|
59
|
+
anchor.right = pos;
|
|
60
|
+
break;
|
|
61
|
+
case 'bottom-left':
|
|
62
|
+
anchor.bottom = pos;
|
|
63
|
+
anchor.left = pos;
|
|
64
|
+
break;
|
|
65
|
+
case 'top-right':
|
|
66
|
+
anchor.top = pos;
|
|
67
|
+
anchor.right = pos;
|
|
68
|
+
break;
|
|
69
|
+
case 'top-left':
|
|
70
|
+
anchor.top = pos;
|
|
71
|
+
anchor.left = pos;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
button: {
|
|
76
|
+
position: 'fixed',
|
|
77
|
+
...anchor,
|
|
78
|
+
width: vibeControlTheme.dimensions.buttonWidth,
|
|
79
|
+
height: vibeControlTheme.dimensions.buttonHeight,
|
|
80
|
+
padding: vibeControlTheme.dimensions.buttonPadding,
|
|
81
|
+
backgroundColor: vibeControlTheme.colors.buttonBg,
|
|
82
|
+
color: vibeControlTheme.colors.buttonText,
|
|
83
|
+
border: `1px solid ${vibeControlTheme.colors.buttonBorder}`,
|
|
84
|
+
borderRadius: vibeControlTheme.dimensions.buttonBorderRadius,
|
|
85
|
+
fontSize: vibeControlTheme.typography.buttonFontSize,
|
|
86
|
+
fontWeight: vibeControlTheme.typography.buttonFontWeight,
|
|
87
|
+
lineHeight: vibeControlTheme.typography.buttonLineHeight,
|
|
88
|
+
cursor: 'pointer',
|
|
89
|
+
boxShadow: vibeControlTheme.effects.buttonShadow,
|
|
90
|
+
transition: `background-color ${vibeControlTheme.effects.transition}, box-shadow ${vibeControlTheme.effects.transition}, transform ${vibeControlTheme.effects.transition}`,
|
|
91
|
+
zIndex: vibeControlTheme.zIndex.button,
|
|
92
|
+
display: 'flex',
|
|
93
|
+
alignItems: 'center',
|
|
94
|
+
justifyContent: 'center',
|
|
95
|
+
userSelect: 'none',
|
|
96
|
+
},
|
|
97
|
+
buttonHover: {
|
|
98
|
+
backgroundColor: vibeControlTheme.colors.buttonBgHover,
|
|
99
|
+
boxShadow: vibeControlTheme.effects.buttonShadowHover,
|
|
100
|
+
transform: 'translateY(-2px)',
|
|
101
|
+
},
|
|
102
|
+
backdrop: {
|
|
103
|
+
position: 'fixed',
|
|
104
|
+
top: 0,
|
|
105
|
+
left: 0,
|
|
106
|
+
right: 0,
|
|
107
|
+
bottom: 0,
|
|
108
|
+
backgroundColor: vibeControlTheme.colors.overlayBackdrop,
|
|
109
|
+
backdropFilter: vibeControlTheme.effects.backdropFilter,
|
|
110
|
+
zIndex: vibeControlTheme.zIndex.backdrop,
|
|
111
|
+
display: 'flex',
|
|
112
|
+
alignItems: 'center',
|
|
113
|
+
justifyContent: 'center',
|
|
114
|
+
},
|
|
115
|
+
overlay: {
|
|
116
|
+
backgroundColor: vibeControlTheme.colors.overlayBg,
|
|
117
|
+
color: vibeControlTheme.colors.overlayText,
|
|
118
|
+
border: `1px solid ${vibeControlTheme.colors.overlayBorder}`,
|
|
119
|
+
borderRadius: vibeControlTheme.dimensions.overlayBorderRadius,
|
|
120
|
+
padding: vibeControlTheme.dimensions.overlayPadding,
|
|
121
|
+
maxWidth: vibeControlTheme.dimensions.overlayMaxWidth,
|
|
122
|
+
maxHeight: vibeControlTheme.dimensions.overlayMaxHeight,
|
|
123
|
+
width: '90%',
|
|
124
|
+
boxShadow: vibeControlTheme.effects.overlayShadow,
|
|
125
|
+
position: 'relative',
|
|
126
|
+
overflow: 'auto',
|
|
127
|
+
},
|
|
128
|
+
overlayTitle: {
|
|
129
|
+
fontSize: vibeControlTheme.typography.overlayTitleFontSize,
|
|
130
|
+
fontWeight: vibeControlTheme.typography.overlayTitleFontWeight,
|
|
131
|
+
lineHeight: vibeControlTheme.typography.overlayTitleLineHeight,
|
|
132
|
+
margin: '0 0 16px 0',
|
|
133
|
+
paddingRight: '40px',
|
|
134
|
+
},
|
|
135
|
+
closeButton: {
|
|
136
|
+
position: 'absolute',
|
|
137
|
+
top: vibeControlTheme.dimensions.overlayPadding,
|
|
138
|
+
right: vibeControlTheme.dimensions.overlayPadding,
|
|
139
|
+
width: vibeControlTheme.dimensions.closeButtonSize,
|
|
140
|
+
height: vibeControlTheme.dimensions.closeButtonSize,
|
|
141
|
+
backgroundColor: vibeControlTheme.colors.closeButtonBg,
|
|
142
|
+
color: vibeControlTheme.colors.closeButtonText,
|
|
143
|
+
border: 'none',
|
|
144
|
+
borderRadius: vibeControlTheme.dimensions.closeButtonBorderRadius,
|
|
145
|
+
cursor: 'pointer',
|
|
146
|
+
display: 'flex',
|
|
147
|
+
alignItems: 'center',
|
|
148
|
+
justifyContent: 'center',
|
|
149
|
+
fontSize: '18px',
|
|
150
|
+
fontWeight: 'bold',
|
|
151
|
+
transition: `background-color ${vibeControlTheme.effects.transition}`,
|
|
152
|
+
},
|
|
153
|
+
closeButtonHover: {
|
|
154
|
+
backgroundColor: vibeControlTheme.colors.closeButtonBgHover,
|
|
155
|
+
},
|
|
156
|
+
content: {
|
|
157
|
+
fontSize: vibeControlTheme.typography.overlayBodyFontSize,
|
|
158
|
+
lineHeight: vibeControlTheme.typography.overlayBodyLineHeight,
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
export const defaultVibeControlClasses = {
|
|
163
|
+
button: '',
|
|
164
|
+
backdrop: '',
|
|
165
|
+
overlay: '',
|
|
166
|
+
overlayTitle: '',
|
|
167
|
+
closeButton: '',
|
|
168
|
+
content: '',
|
|
169
|
+
};
|
|
170
|
+
//# sourceMappingURL=vibe-control-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vibe-control-styles.js","sourceRoot":"","sources":["../../jsr/utils/vibe-control-styles.ts"],"names":[],"mappings":"AAyBA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAE9B,MAAM,EAAE;QACN,QAAQ,EAAE,8BAA8B;QACxC,aAAa,EAAE,oCAAoC;QACnD,UAAU,EAAE,gCAAgC;QAC5C,YAAY,EAAE,kCAAkC;QAEhD,eAAe,EAAE,gDAAgD;QACjE,SAAS,EAAE,+BAA+B;QAC1C,WAAW,EAAE,iCAAiC;QAC9C,aAAa,EAAE,mCAAmC;QAElD,aAAa,EAAE,6BAA6B;QAC5C,kBAAkB,EAAE,mCAAmC;QACvD,eAAe,EAAE,+BAA+B;QAEhD,MAAM,EAAE,2BAA2B;QACnC,MAAM,EAAE,uCAAuC;KAChD;IAGD,UAAU,EAAE;QACV,WAAW,EAAE,OAAO;QACpB,YAAY,EAAE,MAAM;QACpB,aAAa,EAAE,UAAU;QACzB,kBAAkB,EAAE,MAAM;QAC1B,cAAc,EAAE,MAAM,EAAE,qBAAqB;QAE7C,cAAc,EAAE,MAAM;QACtB,mBAAmB,EAAE,MAAM;QAC3B,eAAe,EAAE,OAAO;QACxB,gBAAgB,EAAE,MAAM;QAExB,eAAe,EAAE,MAA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B,CAAC,UAAU,CAAC,eAAe;YACnD,eAAe,EAAE,gBAAgB,CAAC,MAAM,CAAC,aAAa;YACtD,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC,eAAe;YAC9C,MAAM,EAAE,MAAM;YACd,YAAY,EAAE,gBAAgB,CAAC,UAAU,CAAC,uBAAuB;YACjE,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,MAAM;YACf,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;YACxB,QAAQ,EAAE,MAAM;YAChB,UAAU,EAAE,MAAM;YAClB,UAAU,EAAE,oBAAoB,gBAAgB,CAAC,OAAO,CAAC,UAAU,EAAE;SACtE;QAED,gBAAgB,EAAE;YAChB,eAAe,EAAE,gBAAgB,CAAC,MAAM,CAAC,kBAAkB;SAC5D;QAED,OAAO,EAAE;YACP,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,mBAAmB;YACzD,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC,qBAAqB;SAC9D;KACF,CAAC;AAAA,CACH,CAAC;AAGF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,EAAE;IACZ,OAAO,EAAE,EAAE;IACX,YAAY,EAAE,EAAE;IAChB,WAAW,EAAE,EAAE;IACf,OAAO,EAAE,EAAE;CACZ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AuthWallProps } from './components/AuthWall/AuthWall.js';
|
|
2
|
+
export interface MountAuthWallOptions extends AuthWallProps {
|
|
3
|
+
readonly container?: string | HTMLElement;
|
|
4
|
+
}
|
|
5
|
+
export interface MountAuthWallResult {
|
|
6
|
+
unmount: () => void;
|
|
7
|
+
update: (newProps: Partial<AuthWallProps>) => void;
|
|
8
|
+
getProps: () => AuthWallProps;
|
|
9
|
+
getContainer: () => HTMLElement;
|
|
10
|
+
}
|
|
11
|
+
export declare function mountAuthWall(options?: MountAuthWallOptions): MountAuthWallResult;
|
|
12
|
+
export declare function mountAuthWallToBody(props: AuthWallProps): MountAuthWallResult;
|
|
13
|
+
export declare function autoMountAuthWall(): MountAuthWallResult | null;
|
|
14
|
+
export default mountAuthWall;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ReactDOM from 'react-dom/client';
|
|
3
|
+
import { AuthWall } from './components/AuthWall/AuthWall.js';
|
|
4
|
+
export function mountAuthWall(options = {
|
|
5
|
+
onLogin: function () {
|
|
6
|
+
throw new Error('Function not implemented.');
|
|
7
|
+
},
|
|
8
|
+
imageUrl: '',
|
|
9
|
+
title: '',
|
|
10
|
+
open: false,
|
|
11
|
+
}) {
|
|
12
|
+
const { container: containerOption, ...authWallProps } = options;
|
|
13
|
+
let containerElement;
|
|
14
|
+
if (typeof containerOption === 'string') {
|
|
15
|
+
const el = document.querySelector(containerOption);
|
|
16
|
+
if (!el)
|
|
17
|
+
throw new Error(`AuthWall mount container not found: ${containerOption}`);
|
|
18
|
+
containerElement = el;
|
|
19
|
+
}
|
|
20
|
+
else if (containerOption instanceof HTMLElement) {
|
|
21
|
+
containerElement = containerOption;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
containerElement = document.body;
|
|
25
|
+
}
|
|
26
|
+
const mountDiv = document.createElement('div');
|
|
27
|
+
containerElement.appendChild(mountDiv);
|
|
28
|
+
const root = ReactDOM.createRoot(mountDiv);
|
|
29
|
+
let currentProps = { ...authWallProps };
|
|
30
|
+
const render = (props) => {
|
|
31
|
+
root.render(React.createElement(AuthWall, props));
|
|
32
|
+
};
|
|
33
|
+
render(currentProps);
|
|
34
|
+
return {
|
|
35
|
+
unmount: () => {
|
|
36
|
+
root.unmount();
|
|
37
|
+
if (mountDiv.parentNode) {
|
|
38
|
+
mountDiv.parentNode.removeChild(mountDiv);
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
update: (newProps) => {
|
|
42
|
+
currentProps = { ...currentProps, ...newProps };
|
|
43
|
+
render(currentProps);
|
|
44
|
+
},
|
|
45
|
+
getProps: () => ({ ...currentProps }),
|
|
46
|
+
getContainer: () => containerElement,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export function mountAuthWallToBody(props) {
|
|
50
|
+
return mountAuthWall({ container: document.body, ...props });
|
|
51
|
+
}
|
|
52
|
+
export function autoMountAuthWall() {
|
|
53
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
54
|
+
console.warn('AuthWall: autoMountAuthWall called in non-browser environment');
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
const tryMount = () => {
|
|
58
|
+
const globalConfig = window
|
|
59
|
+
.AUTH_WALL_CONFIG;
|
|
60
|
+
if (!globalConfig) {
|
|
61
|
+
console.warn('AuthWall: No global AUTH_WALL_CONFIG found');
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
return mountAuthWallToBody(globalConfig);
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
console.error('AuthWall: Auto-mount failed:', error);
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
if (document.readyState === 'loading') {
|
|
73
|
+
window.addEventListener('DOMContentLoaded', tryMount, { once: true });
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return tryMount();
|
|
77
|
+
}
|
|
78
|
+
export default mountAuthWall;
|
|
79
|
+
//# sourceMappingURL=vibe-auth-wall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vibe-auth-wall.js","sourceRoot":"","sources":["../jsr/vibe-auth-wall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAiB,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AA8B5E,MAAM,UAAU,aAAa,CAC3B,OAAO,GAAyB;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CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACtC,MAAM,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACtE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,QAAQ,EAAE,CAAC;AAAA,CACnB;AAGD,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { VibeControlProps } from './components/VibeControl.js';
|
|
2
|
+
export interface MountVibeControlOptions extends VibeControlProps {
|
|
3
|
+
readonly container?: string | HTMLElement;
|
|
4
|
+
}
|
|
5
|
+
export interface MountVibeControlResult {
|
|
6
|
+
unmount: () => void;
|
|
7
|
+
update: (newProps: Partial<VibeControlProps>) => void;
|
|
8
|
+
getProps: () => VibeControlProps;
|
|
9
|
+
getContainer: () => HTMLElement;
|
|
10
|
+
}
|
|
11
|
+
export declare function mountVibeControl(options?: MountVibeControlOptions): MountVibeControlResult;
|
|
12
|
+
export declare function mountVibeControlToBody(props?: VibeControlProps): MountVibeControlResult;
|
|
13
|
+
export declare function autoMountVibeControl(): MountVibeControlResult | null;
|
|
14
|
+
export default mountVibeControl;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ReactDOM from 'react-dom/client';
|
|
3
|
+
import { VibeControl } from './components/VibeControl.js';
|
|
4
|
+
export function mountVibeControl(options = {}) {
|
|
5
|
+
const { container: containerOption, ...vibeControlProps } = options;
|
|
6
|
+
let containerElement;
|
|
7
|
+
if (typeof containerOption === 'string') {
|
|
8
|
+
const el = document.querySelector(containerOption);
|
|
9
|
+
if (!el) {
|
|
10
|
+
throw new Error(`VibeControl mount container not found: ${containerOption}`);
|
|
11
|
+
}
|
|
12
|
+
containerElement = el;
|
|
13
|
+
}
|
|
14
|
+
else if (containerOption instanceof HTMLElement) {
|
|
15
|
+
containerElement = containerOption;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
containerElement = document.body;
|
|
19
|
+
}
|
|
20
|
+
const mountDiv = document.createElement('div');
|
|
21
|
+
containerElement.appendChild(mountDiv);
|
|
22
|
+
const root = ReactDOM.createRoot(mountDiv);
|
|
23
|
+
let currentProps = { ...vibeControlProps };
|
|
24
|
+
const render = (props) => {
|
|
25
|
+
root.render(React.createElement(VibeControl, props));
|
|
26
|
+
};
|
|
27
|
+
render(currentProps);
|
|
28
|
+
return {
|
|
29
|
+
unmount: () => {
|
|
30
|
+
root.unmount();
|
|
31
|
+
if (mountDiv.parentNode) {
|
|
32
|
+
mountDiv.parentNode.removeChild(mountDiv);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
update: (newProps) => {
|
|
36
|
+
currentProps = { ...currentProps, ...newProps };
|
|
37
|
+
render(currentProps);
|
|
38
|
+
},
|
|
39
|
+
getProps: () => ({ ...currentProps }),
|
|
40
|
+
getContainer: () => containerElement,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function mountVibeControlToBody(props = {}) {
|
|
44
|
+
return mountVibeControl({
|
|
45
|
+
container: document.body,
|
|
46
|
+
...props,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export function autoMountVibeControl() {
|
|
50
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
51
|
+
console.warn('VibeControl: autoMountVibeControl called in non-browser environment');
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const tryMount = () => {
|
|
55
|
+
const globalConfig = window.VIBE_CONTROL_CONFIG;
|
|
56
|
+
if (!globalConfig) {
|
|
57
|
+
console.warn('VibeControl: No global VIBE_CONTROL_CONFIG found for auto-mount');
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
return mountVibeControlToBody(globalConfig);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
console.error('VibeControl: Auto-mount failed:', error);
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
if (document.readyState === 'loading') {
|
|
69
|
+
window.addEventListener('DOMContentLoaded', tryMount, { once: true });
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return tryMount();
|
|
73
|
+
}
|
|
74
|
+
export default mountVibeControl;
|
|
75
|
+
//# sourceMappingURL=vibe-control-mount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vibe-control-mount.js","sourceRoot":"","sources":["../jsr/vibe-control-mount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAoB,MAAM,6BAA6B,CAAC;AAwD5E,MAAM,UAAU,gBAAgB,CAAC,OAAO,GAA4B,EAAE,EAA0B;IAC9F,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,gBAAgB,EAAE,GAAG,OAAO,CAAC;IAGpE,IAAI,gBAA6B,CAAC;IAClC,IAAI,OAAO,eAAe,KAAK,QAAQ,EAAE,CAAC;QACxC,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;QACnD,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,MAAM,IAAI,KAAK,CAAC,0CAA0C,eAAe,EAAE,CAAC,CAAC;QAC/E,CAAC;QACD,gBAAgB,GAAG,EAAiB,CAAC;IACvC,CAAC;SAAM,IAAI,eAAe,YAAY,WAAW,EAAE,CAAC;QAClD,gBAAgB,GAAG,eAAe,CAAC;IACrC,CAAC;SAAM,CAAC;QAEN,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC;IACnC,CAAC;IAGD,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC/C,gBAAgB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAGvC,MAAM,IAAI,GAAG,QAAQ,CA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pD,MAAM,YAAY,GAAI,MAA6C,CAAC,mBAAmB,CAAC;QAExF,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;YAChF,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,CAAC;YACH,OAAO,sBAAsB,CAAC,YAAY,CAAC,CAAC;QAC9C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;YACxD,OAAO,IAAI,CAAC;QACd,CAAC;IAAA,CACF,CAAC;IAGF,IAAI,QAAQ,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACtC,MAAM,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACtE,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,OAAO,QAAQ,EAAE,CAAC;AAAA,CACnB;AAGD,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HiddenMenuWrapperProps } from './components/HiddenMenuWrapper/HiddenMenuWrapper.js';
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
HIDDEN_MENU_WRAPPER_CONFIG?: HiddenMenuWrapperProps;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export interface MountHiddenMenuWrapperOptions extends HiddenMenuWrapperProps {
|
|
8
|
+
readonly container?: string | HTMLElement;
|
|
9
|
+
}
|
|
10
|
+
export interface MountHiddenMenuWrapperResult {
|
|
11
|
+
unmount: () => void;
|
|
12
|
+
update: (newProps: Partial<HiddenMenuWrapperProps>) => void;
|
|
13
|
+
getProps: () => HiddenMenuWrapperProps;
|
|
14
|
+
getContainer: () => HTMLElement;
|
|
15
|
+
}
|
|
16
|
+
export declare function mountHiddenMenuWrapper(options?: MountHiddenMenuWrapperOptions): MountHiddenMenuWrapperResult;
|
|
17
|
+
export declare function mountHiddenMenuWrapperToBody(props?: HiddenMenuWrapperProps): MountHiddenMenuWrapperResult;
|
|
18
|
+
export declare function autoMountHiddenMenuWrapper(): MountHiddenMenuWrapperResult | null;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ReactDOM from 'react-dom/client';
|
|
3
|
+
import { HiddenMenuWrapper, } from './components/HiddenMenuWrapper/HiddenMenuWrapper.js';
|
|
4
|
+
export function mountHiddenMenuWrapper(options = {
|
|
5
|
+
children: undefined,
|
|
6
|
+
menuContent: undefined,
|
|
7
|
+
}) {
|
|
8
|
+
const { container: containerOption, ...initialProps } = options;
|
|
9
|
+
let containerElement;
|
|
10
|
+
if (typeof containerOption === 'string') {
|
|
11
|
+
const found = document.querySelector(containerOption);
|
|
12
|
+
if (!found) {
|
|
13
|
+
throw new Error(`HiddenMenuWrapper container not found: ${containerOption}`);
|
|
14
|
+
}
|
|
15
|
+
containerElement = found;
|
|
16
|
+
}
|
|
17
|
+
else if (containerOption instanceof HTMLElement) {
|
|
18
|
+
containerElement = containerOption;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
containerElement = document.body;
|
|
22
|
+
}
|
|
23
|
+
const mountDiv = document.createElement('div');
|
|
24
|
+
containerElement.appendChild(mountDiv);
|
|
25
|
+
const root = ReactDOM.createRoot(mountDiv);
|
|
26
|
+
let currentProps = { ...initialProps };
|
|
27
|
+
const render = (props) => {
|
|
28
|
+
root.render(React.createElement(HiddenMenuWrapper, props));
|
|
29
|
+
};
|
|
30
|
+
render(currentProps);
|
|
31
|
+
return {
|
|
32
|
+
unmount: () => {
|
|
33
|
+
root.unmount();
|
|
34
|
+
if (mountDiv.parentNode) {
|
|
35
|
+
mountDiv.parentNode.removeChild(mountDiv);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
update: (newProps) => {
|
|
39
|
+
currentProps = { ...currentProps, ...newProps };
|
|
40
|
+
render(currentProps);
|
|
41
|
+
},
|
|
42
|
+
getProps: () => ({ ...currentProps }),
|
|
43
|
+
getContainer: () => containerElement,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export function mountHiddenMenuWrapperToBody(props = {
|
|
47
|
+
children: undefined,
|
|
48
|
+
menuContent: undefined,
|
|
49
|
+
}) {
|
|
50
|
+
return mountHiddenMenuWrapper({
|
|
51
|
+
container: document.body,
|
|
52
|
+
...props,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
export function autoMountHiddenMenuWrapper() {
|
|
56
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
57
|
+
console.warn('HiddenMenuWrapper: autoMount called in non-browser environment');
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
const config = window.HIDDEN_MENU_WRAPPER_CONFIG;
|
|
61
|
+
if (!config) {
|
|
62
|
+
console.warn('HiddenMenuWrapper: No HIDDEN_MENU_WRAPPER_CONFIG found');
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
return mountHiddenMenuWrapperToBody(config);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
console.error('HiddenMenuWrapper: Auto-mount failed:', error);
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=vibe-hidden-menu-mount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vibe-hidden-menu-mount.js","sourceRoot":"","sources":["../jsr/vibe-hidden-menu-mount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,iBAAiB,GAElB,MAAM,qDAAqD,CAAC;AAgC7D,MAAM,UAAU,sBAAsB,CACpC,OAAO,GAAkC;IACvC,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,SAAS;CAC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