@rozenite/vite-plugin 1.13.0 → 2.0.0

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 (56) hide show
  1. package/README.md +12 -0
  2. package/dist/bundle-dts.d.ts.map +1 -1
  3. package/dist/client-plugin.d.ts.map +1 -1
  4. package/dist/dev-config-module.d.ts.map +1 -1
  5. package/dist/dev-host/assets/index-DU3zXL2c.css +1 -0
  6. package/dist/dev-host/assets/index-Xsb6uYhI.js +13 -0
  7. package/dist/dev-host/index.html +3 -3
  8. package/dist/dev-host/manifest.json +2 -2
  9. package/dist/index.cjs +24 -8
  10. package/dist/index.d.ts +9 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +24 -8
  13. package/dist/react-native-plugin.d.ts.map +1 -1
  14. package/dist/sdk-plugin.d.ts.map +1 -1
  15. package/dist/server-plugin.d.ts.map +1 -1
  16. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  17. package/package.json +9 -10
  18. package/src/bundle-dts.ts +7 -6
  19. package/src/client-plugin.ts +8 -6
  20. package/src/dev-config-module.ts +4 -1
  21. package/src/dev-host/App.tsx +219 -413
  22. package/src/dev-host/components/DispatchForm.tsx +108 -122
  23. package/src/dev-host/components/FlowList.tsx +81 -101
  24. package/src/dev-host/components/MessageDetailsPane.tsx +56 -83
  25. package/src/dev-host/components/MessageLogPane.tsx +84 -66
  26. package/src/dev-host/components/PanelTabs.tsx +29 -10
  27. package/src/dev-host/config.ts +6 -2
  28. package/src/dev-host/constants.ts +0 -19
  29. package/src/dev-host/flow-runtime.ts +33 -12
  30. package/src/dev-host/index.html +1 -1
  31. package/src/dev-host/main.tsx +1 -10
  32. package/src/dev-host/server.ts +9 -3
  33. package/src/dev-host/styles.css +162 -830
  34. package/src/dev-host/types.ts +5 -10
  35. package/src/dev-host/utils.ts +9 -6
  36. package/src/dev-host/vite.config.mts +2 -0
  37. package/src/index.ts +15 -5
  38. package/src/load-config.ts +4 -4
  39. package/src/package-json.ts +1 -1
  40. package/src/react-native-plugin.ts +3 -0
  41. package/src/sdk-plugin.ts +3 -0
  42. package/src/server-plugin.ts +3 -0
  43. package/src/utils.ts +1 -1
  44. package/dist/dev-host/assets/index-CkxvBMpp.css +0 -1
  45. package/dist/dev-host/assets/index-cNKHRwej.js +0 -11
  46. package/src/dev-host/components/MessagePayloadDetail.tsx +0 -32
  47. package/src/dev-host/components/ResizeHandle.tsx +0 -33
  48. package/src/dev-host/components/icons.tsx +0 -79
  49. package/src/dev-host/components/ui/Button.tsx +0 -91
  50. package/src/dev-host/components/ui/DropdownMenu.tsx +0 -84
  51. package/src/dev-host/components/ui/IconButton.tsx +0 -41
  52. package/src/dev-host/components/ui/Input.tsx +0 -73
  53. package/src/dev-host/components/ui/ScrollArea.tsx +0 -20
  54. package/src/dev-host/components/ui/Tabs.tsx +0 -166
  55. package/src/dev-host/components/ui/Textarea.tsx +0 -79
  56. package/src/dev-host/components/ui/ToggleGroup.tsx +0 -120
@@ -1,79 +0,0 @@
1
- import type { ComponentProps } from 'react';
2
- import { mergeOverrides } from 'baseui';
3
- import { SIZE, Textarea as BaseTextarea } from 'baseui/textarea/index.js';
4
-
5
- type BaseTextareaProps = ComponentProps<typeof BaseTextarea>;
6
-
7
- export type TextareaProps = BaseTextareaProps & {
8
- spellCheck?: boolean;
9
- };
10
-
11
- const textareaOverrides = {
12
- Root: {
13
- style: {
14
- width: '100%',
15
- borderWidth: '0',
16
- backgroundColor: 'transparent',
17
- paddingLeft: '0',
18
- paddingRight: '0',
19
- },
20
- },
21
- InputContainer: {
22
- style: ({ $isFocused }: { $isFocused?: boolean }) => ({
23
- borderWidth: '1px',
24
- borderStyle: 'solid',
25
- borderColor: 'rgba(255, 255, 255, 0.08)',
26
- borderRadius: '4px',
27
- backgroundColor: 'rgba(255, 255, 255, 0.03)',
28
- outline: $isFocused ? '2px solid rgba(130, 50, 255, 0.95)' : 'none',
29
- outlineOffset: '-2px',
30
- alignItems: 'stretch',
31
- }),
32
- },
33
- Input: {
34
- style: {
35
- minHeight: '112px',
36
- display: 'block',
37
- alignSelf: 'stretch',
38
- resize: 'none',
39
- paddingTop: '12px',
40
- paddingRight: '12px',
41
- paddingBottom: '12px',
42
- paddingLeft: '12px',
43
- fontFamily: '"Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace',
44
- fontWeight: 400,
45
- color: 'rgba(255, 255, 255, 0.9)',
46
- fontSize: '12px',
47
- lineHeight: '1.5',
48
- letterSpacing: '-0.02em',
49
- '::placeholder': {
50
- color: 'rgba(255, 255, 255, 0.36)',
51
- },
52
- },
53
- },
54
- };
55
-
56
- export const Textarea = ({ overrides, rows = 6, spellCheck, ...props }: TextareaProps) => {
57
- return (
58
- <BaseTextarea
59
- rows={rows}
60
- size={SIZE.compact}
61
- overrides={mergeOverrides(
62
- textareaOverrides,
63
- spellCheck === undefined
64
- ? overrides
65
- : mergeOverrides(
66
- {
67
- Input: {
68
- props: {
69
- spellCheck,
70
- },
71
- },
72
- },
73
- overrides,
74
- ),
75
- )}
76
- {...props}
77
- />
78
- );
79
- };
@@ -1,120 +0,0 @@
1
- import type { Key, ReactNode } from 'react';
2
- import { mergeOverrides } from 'baseui';
3
- import { Segment } from 'baseui/segmented-control/segment.js';
4
- import { SegmentedControl } from 'baseui/segmented-control/index.js';
5
-
6
- export type ToggleGroupOption = {
7
- key: Key;
8
- label: ReactNode;
9
- disabled?: boolean;
10
- };
11
-
12
- type ToggleGroupProps = {
13
- value: Key;
14
- options: ToggleGroupOption[];
15
- onChange: (value: string) => void;
16
- 'aria-label'?: string;
17
- };
18
-
19
- const overrides = {
20
- Root: {
21
- style: {
22
- display: 'inline-flex',
23
- width: 'fit-content',
24
- maxWidth: '100%',
25
- paddingTop: '2px',
26
- paddingRight: '2px',
27
- paddingBottom: '2px',
28
- paddingLeft: '2px',
29
- border: '1px solid rgba(255, 255, 255, 0.08)',
30
- borderRadius: '4px',
31
- backgroundColor: 'rgba(255, 255, 255, 0.04)',
32
- overflow: 'hidden',
33
- },
34
- },
35
- SegmentList: {
36
- style: {
37
- display: 'inline-flex',
38
- width: 'fit-content',
39
- minHeight: '22px',
40
- maxWidth: '100%',
41
- alignItems: 'center',
42
- gap: '2px',
43
- overflow: 'hidden',
44
- minWidth: 'unset',
45
- backgroundColor: 'transparent',
46
- zIndex: 0,
47
- },
48
- },
49
- Active: {
50
- style: {
51
- backgroundColor: '#ffffff',
52
- borderRadius: '2px',
53
- zIndex: -1,
54
- },
55
- },
56
- };
57
-
58
- const segmentOverrides = {
59
- Segment: {
60
- style: ({ $isActive, $disabled, $isFocusVisible }: { $isActive?: boolean; $disabled?: boolean; $isFocusVisible?: boolean }) => ({
61
- minHeight: '22px',
62
- minWidth: 'auto',
63
- paddingTop: '3px',
64
- paddingRight: '9px',
65
- paddingBottom: '3px',
66
- paddingLeft: '9px',
67
- borderRadius: '2px',
68
- backgroundColor: 'transparent',
69
- color: $isActive ? '#000000' : 'rgba(255, 255, 255, 0.6)',
70
- fontSize: '12px',
71
- fontWeight: 500,
72
- lineHeight: 1.2,
73
- transitionProperty: 'background-color, color',
74
- transitionDuration: '120ms',
75
- outline: $isFocusVisible ? '2px solid rgba(130, 50, 255, 0.95)' : 'none',
76
- outlineOffset: '-2px',
77
- cursor: $disabled ? 'default' : 'pointer',
78
- opacity: $disabled ? 0.4 : 1,
79
- ':hover': $disabled || $isActive ? undefined : {
80
- color: '#ffffff',
81
- },
82
- }),
83
- },
84
- LabelBlock: {
85
- style: {
86
- paddingTop: '0',
87
- paddingRight: '0',
88
- paddingBottom: '0',
89
- paddingLeft: '0',
90
- },
91
- },
92
- Label: {
93
- style: {
94
- fontSize: '12px',
95
- fontWeight: 500,
96
- lineHeight: 1.2,
97
- color: 'inherit',
98
- },
99
- },
100
- };
101
-
102
- export const ToggleGroup = ({ value, options, onChange, 'aria-label': ariaLabel }: ToggleGroupProps) => {
103
- return (
104
- <SegmentedControl
105
- activeKey={value}
106
- onChange={({ activeKey }) => onChange(String(activeKey))}
107
- overrides={mergeOverrides(overrides, {
108
- Root: {
109
- props: {
110
- 'aria-label': ariaLabel,
111
- },
112
- },
113
- })}
114
- >
115
- {options.map((option) => (
116
- <Segment key={option.key} label={option.label} disabled={option.disabled} overrides={segmentOverrides} />
117
- ))}
118
- </SegmentedControl>
119
- );
120
- };