@teambit/compositions.ui.composition-compare 0.0.258 → 0.0.260
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/composition-compare.context.tsx +6 -6
- package/composition-compare.module.scss +126 -14
- package/composition-compare.tsx +608 -169
- package/composition-dropdown.module.scss +28 -0
- package/composition-dropdown.tsx +16 -4
- package/dist/composition-compare.context.d.ts +1 -1
- package/dist/composition-compare.d.ts +1 -1
- package/dist/composition-compare.js +439 -110
- package/dist/composition-compare.js.map +1 -1
- package/dist/composition-compare.module.scss +126 -14
- package/dist/composition-dropdown.d.ts +1 -0
- package/dist/composition-dropdown.js +23 -9
- package/dist/composition-dropdown.js.map +1 -1
- package/dist/composition-dropdown.module.scss +28 -0
- package/index.ts +1 -1
- package/package.json +18 -10
- /package/dist/{preview-1738856884982.js → preview-1772488540837.js} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { useContext, createContext } from
|
|
2
|
-
import { CompositionContentProps } from
|
|
1
|
+
import { useContext, createContext } from 'react';
|
|
2
|
+
import { CompositionContentProps } from '@teambit/compositions';
|
|
3
3
|
|
|
4
4
|
export type CompositionCompareContextModel = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
compositionProps?: CompositionContentProps;
|
|
6
|
+
isBase?: boolean;
|
|
7
|
+
isCompare?: boolean;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export const CompositionCompareContext: React.Context<CompositionCompareContextModel | undefined> = createContext<
|
|
11
|
-
|
|
11
|
+
CompositionCompareContextModel | undefined
|
|
12
12
|
>(undefined);
|
|
13
13
|
|
|
14
14
|
export const useCompositionCompare = () => useContext(CompositionCompareContext);
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
height: 100%;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
|
|
7
|
+
&.isResizing {
|
|
8
|
+
cursor: ns-resize;
|
|
9
|
+
|
|
10
|
+
// Prevent iframes from capturing pointer events during resize
|
|
11
|
+
iframe {
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
1
17
|
.toolbar {
|
|
2
18
|
display: flex;
|
|
3
19
|
padding: 4px;
|
|
20
|
+
flex-shrink: 0;
|
|
4
21
|
}
|
|
5
22
|
|
|
6
23
|
.left,
|
|
@@ -17,20 +34,6 @@
|
|
|
17
34
|
justify-content: flex-end;
|
|
18
35
|
}
|
|
19
36
|
|
|
20
|
-
.mainContainer {
|
|
21
|
-
display: flex;
|
|
22
|
-
height: 100%;
|
|
23
|
-
min-height: 80vh;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.subContainerLeft {
|
|
27
|
-
flex: 1;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.subContainerRight {
|
|
31
|
-
flex: 1;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
37
|
.subView {
|
|
35
38
|
height: 100%;
|
|
36
39
|
background-color: var(--background-color);
|
|
@@ -50,3 +53,112 @@
|
|
|
50
53
|
.dropdown {
|
|
51
54
|
display: flex;
|
|
52
55
|
}
|
|
56
|
+
|
|
57
|
+
.compareLayout {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
flex: 1 1 auto;
|
|
61
|
+
min-height: 0;
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
position: relative;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.compareMain {
|
|
67
|
+
flex: 1 1 auto;
|
|
68
|
+
min-height: 150px;
|
|
69
|
+
min-width: 0;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.controlsPanel {
|
|
74
|
+
flex: 0 0 auto;
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
background: var(--background-color);
|
|
78
|
+
min-height: 36px;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
|
|
81
|
+
contain: layout;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.controlsResizeHandle {
|
|
85
|
+
height: 6px;
|
|
86
|
+
cursor: ns-resize;
|
|
87
|
+
background: transparent;
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
flex-shrink: 0;
|
|
92
|
+
user-select: none;
|
|
93
|
+
touch-action: none;
|
|
94
|
+
|
|
95
|
+
&::before {
|
|
96
|
+
content: '';
|
|
97
|
+
display: block;
|
|
98
|
+
width: 32px;
|
|
99
|
+
height: 3px;
|
|
100
|
+
border-radius: 3px;
|
|
101
|
+
background: var(--border-medium-color, rgba(0, 0, 0, 0.12));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&:hover::before,
|
|
105
|
+
&:active::before {
|
|
106
|
+
background: var(--primary-color, #6a57fd);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.controlsPanelHeader {
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
gap: 8px;
|
|
114
|
+
padding: 6px 12px;
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
user-select: none;
|
|
117
|
+
background: var(--background-color);
|
|
118
|
+
flex-shrink: 0;
|
|
119
|
+
|
|
120
|
+
&:hover {
|
|
121
|
+
background: var(--background-hover-color, rgba(0, 0, 0, 0.02));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.controlsArrow {
|
|
126
|
+
font-size: 10px;
|
|
127
|
+
color: var(--on-background-color, #222);
|
|
128
|
+
opacity: 0.5;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.controlsPanelTitle {
|
|
132
|
+
font-size: var(--bit-p-xs, 13px);
|
|
133
|
+
font-weight: 500;
|
|
134
|
+
color: var(--on-background-color, #222);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.controlsPanelContent {
|
|
138
|
+
flex: 1 1 auto;
|
|
139
|
+
overflow: auto;
|
|
140
|
+
padding: 12px 16px;
|
|
141
|
+
min-height: 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.missingComposition {
|
|
145
|
+
margin: 24px;
|
|
146
|
+
padding: 20px;
|
|
147
|
+
border: 1px dashed var(--border-color, rgba(0, 0, 0, 0.12));
|
|
148
|
+
border-radius: 10px;
|
|
149
|
+
background: var(--background-color, #ffffff);
|
|
150
|
+
text-align: center;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.missingCompositionTitle {
|
|
154
|
+
font-size: 14px;
|
|
155
|
+
font-weight: 600;
|
|
156
|
+
color: var(--on-background-color, #222222);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.missingCompositionSubtitle {
|
|
160
|
+
margin-top: 6px;
|
|
161
|
+
font-size: 12px;
|
|
162
|
+
color: var(--on-background-color, #222222);
|
|
163
|
+
opacity: 0.7;
|
|
164
|
+
}
|