@vivix-labs/magic-edit 0.0.0-stage → 1.0.0-beta
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/HTML-TO-IMAGE-LICENSE.txt +21 -0
- package/README.md +44 -2
- package/dist/UI-SYSTEM-LICENSE.txt +21 -0
- package/dist/assets/toolbar-divider-DHGQDOLY.svg +5 -0
- package/dist/client-code.css +423 -0
- package/dist/client-code.js +2163 -0
- package/dist/client.js +3 -0
- package/dist/shared.d.ts +53 -0
- package/dist/shared.js +21 -0
- package/package.json +25 -3
- package/studio-plugin.json +6 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017-2025 W.Y.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,45 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Magic Edit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Magic Edit captures a visible page element or media frame. Select a target,
|
|
4
|
+
mark the image, describe the change, and choose **Copy for Chat**. Paste the instruction and
|
|
5
|
+
marked image into the Agent conversation. When a destination accepts only one format, use
|
|
6
|
+
**Copy instruction** and **Download marked PNG**.
|
|
7
|
+
|
|
8
|
+
The copied instruction includes the project, target label, visible text when available, the source time
|
|
9
|
+
for video, and numbered marks. The Agent uses that information and its own project tools to
|
|
10
|
+
identify the target and carry out the request.
|
|
11
|
+
|
|
12
|
+
Studio Home mounts one user-scoped toolbar. It can select content in Home and in the
|
|
13
|
+
active same-origin project frame. Embedded frontends can publish precise targets with
|
|
14
|
+
`publishMagicEditSource`. Ordinary text, cards, and media remain selectable on project
|
|
15
|
+
pages that do not publish targets.
|
|
16
|
+
|
|
17
|
+
A standalone frontend can mount the component through a configured Studio client
|
|
18
|
+
dependency. An embedded frontend that also supports standalone can use
|
|
19
|
+
`hasGlobalMagicEdit()` to leave the toolbar to Home when it is available.
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import type { MagicEditProps } from '@vivix-labs/magic-edit/shared';
|
|
23
|
+
|
|
24
|
+
// magicEditInstance is the declared same-page dependency ID.
|
|
25
|
+
const MagicEdit = client.resolveUI<MagicEditProps>({
|
|
26
|
+
plugin: magicEditInstance,
|
|
27
|
+
id: 'magic-edit.panel',
|
|
28
|
+
})?.component;
|
|
29
|
+
|
|
30
|
+
// Mount inside the frontend's StudioTheme.
|
|
31
|
+
{
|
|
32
|
+
MagicEdit && <MagicEdit />;
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The optional `targets` callback supplies more precise labels, stable asset versions, or
|
|
37
|
+
business context where the frontend already knows them.
|
|
38
|
+
|
|
39
|
+
The frontend can pass configured toolbar contributions in `tools`. Each entry has a
|
|
40
|
+
stable `id` and a component receiving `MagicEditToolProps`. The component renders when
|
|
41
|
+
the toolbar is open and receives the captured target metadata, region count, and busy
|
|
42
|
+
state. There is no target while choosing or before capture.
|
|
43
|
+
|
|
44
|
+
Copying runs entirely in the browser. Closing Magic Edit clears the current selection
|
|
45
|
+
and instruction.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 VIVIX
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="8" height="16" viewBox="0 0 8 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g id="Frame 2147226224">
|
|
3
|
+
<line id="Line 1" x1="4.5" y1="2.18557e-08" x2="4.5" y2="16" stroke="white" stroke-opacity="0.4"/>
|
|
4
|
+
</g>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
/* packages/magic-edit/src/activation.css */
|
|
2
|
+
@property --vx-magic-edit-beam-angle { syntax: "<angle>"; inherits: true; initial-value: 0deg; }
|
|
3
|
+
.magic-edit-effects {
|
|
4
|
+
--vx-media-selection-color: var(--vx-green-dark);
|
|
5
|
+
--vx-magic-edit-glow:
|
|
6
|
+
inset 0 0 0 1px color-mix(in srgb, var(--vx-media-selection-color) 65%, transparent),
|
|
7
|
+
inset 0 0 32px 6px color-mix(in srgb, var(--vx-media-selection-color) 36%, transparent),
|
|
8
|
+
inset 0 0 72px 12px color-mix(in srgb, var(--vx-state-success) 14%, transparent);
|
|
9
|
+
--vx-magic-edit-beam-blue: var(--vx-blue-beam);
|
|
10
|
+
--vx-magic-edit-beam-width: 2px;
|
|
11
|
+
--vx-magic-edit-beam-glow-width: 32px;
|
|
12
|
+
--vx-magic-edit-beam-glow-blur: 12px;
|
|
13
|
+
--vx-magic-edit-wave-glint: light-dark(var(--vx-white-white-6a), var(--vx-white-white-2a));
|
|
14
|
+
--vx-magic-edit-wave-blue: light-dark(rgb(110 150 255 / 22%), rgb(80 140 255 / 35%));
|
|
15
|
+
--vx-magic-edit-wave-green: light-dark( color-mix(in srgb, var(--vx-media-selection-color) 22%, transparent), color-mix(in srgb, var(--vx-media-selection-color) 34%, transparent) );
|
|
16
|
+
--vx-magic-edit-wave-orange: light-dark( color-mix(in srgb, var(--vx-orange-light) 24%, transparent), color-mix(in srgb, var(--vx-orange-dark) 39%, transparent) );
|
|
17
|
+
--vx-magic-edit-wave-peach: light-dark(rgb(255 180 120 / 18%), rgb(255 190 140 / 26%));
|
|
18
|
+
position: fixed;
|
|
19
|
+
inset: 0;
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
}
|
|
22
|
+
.magic-edit-wave {
|
|
23
|
+
--vx-wave-x: 50%;
|
|
24
|
+
--vx-wave-y: 50%;
|
|
25
|
+
--vx-wave-radius: 1px;
|
|
26
|
+
--vx-wave-opacity: 1;
|
|
27
|
+
--vx-wave-front: circle var(--vx-wave-radius) at var(--vx-wave-x) var(--vx-wave-y);
|
|
28
|
+
position: absolute;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
}
|
|
31
|
+
.magic-edit-wave::before,
|
|
32
|
+
.magic-edit-wave::after {
|
|
33
|
+
content: "";
|
|
34
|
+
position: absolute;
|
|
35
|
+
inset: 0;
|
|
36
|
+
opacity: var(--vx-wave-opacity);
|
|
37
|
+
}
|
|
38
|
+
.magic-edit-wave::before {
|
|
39
|
+
background:
|
|
40
|
+
radial-gradient(
|
|
41
|
+
var(--vx-wave-front),
|
|
42
|
+
transparent 62%,
|
|
43
|
+
var(--vx-magic-edit-wave-glint) 79%,
|
|
44
|
+
transparent 96%);
|
|
45
|
+
mask:
|
|
46
|
+
linear-gradient(
|
|
47
|
+
to bottom,
|
|
48
|
+
black,
|
|
49
|
+
transparent) top / 100% 8px no-repeat,
|
|
50
|
+
linear-gradient(
|
|
51
|
+
to top,
|
|
52
|
+
black,
|
|
53
|
+
transparent) bottom / 100% 8px no-repeat,
|
|
54
|
+
linear-gradient(
|
|
55
|
+
to right,
|
|
56
|
+
black,
|
|
57
|
+
transparent) left / 8px 100% no-repeat,
|
|
58
|
+
linear-gradient(
|
|
59
|
+
to left,
|
|
60
|
+
black,
|
|
61
|
+
transparent) right / 8px 100% no-repeat;
|
|
62
|
+
}
|
|
63
|
+
.magic-edit-wave::after {
|
|
64
|
+
background:
|
|
65
|
+
radial-gradient(
|
|
66
|
+
var(--vx-wave-front),
|
|
67
|
+
transparent 57%,
|
|
68
|
+
var(--vx-magic-edit-wave-blue) 67%,
|
|
69
|
+
var(--vx-magic-edit-wave-green) 74%,
|
|
70
|
+
var(--vx-magic-edit-wave-orange) 81%,
|
|
71
|
+
var(--vx-magic-edit-wave-peach) 88%,
|
|
72
|
+
transparent 99%);
|
|
73
|
+
mix-blend-mode: multiply;
|
|
74
|
+
}
|
|
75
|
+
[data-vx-theme=dark] .magic-edit-wave::after {
|
|
76
|
+
mix-blend-mode: screen;
|
|
77
|
+
}
|
|
78
|
+
.magic-edit-glow {
|
|
79
|
+
--vx-magic-edit-beam-angle: 0deg;
|
|
80
|
+
position: absolute;
|
|
81
|
+
inset: 0;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
opacity: 0;
|
|
84
|
+
box-shadow: var(--vx-magic-edit-glow);
|
|
85
|
+
}
|
|
86
|
+
.magic-edit-glow::before,
|
|
87
|
+
.magic-edit-glow::after {
|
|
88
|
+
content: "";
|
|
89
|
+
position: absolute;
|
|
90
|
+
inset: 0;
|
|
91
|
+
padding: var(--vx-magic-edit-beam-width);
|
|
92
|
+
background:
|
|
93
|
+
conic-gradient(
|
|
94
|
+
from var(--vx-magic-edit-beam-angle),
|
|
95
|
+
transparent 0% 2%,
|
|
96
|
+
var(--vx-magic-edit-beam-blue) 7%,
|
|
97
|
+
color-mix(in srgb, var(--vx-magic-edit-beam-blue) 30%, var(--vx-white-white)) 12.5%,
|
|
98
|
+
var(--vx-magic-edit-beam-blue) 18%,
|
|
99
|
+
transparent 25% 27%,
|
|
100
|
+
var(--vx-media-selection-color) 32%,
|
|
101
|
+
color-mix(in srgb, var(--vx-media-selection-color) 30%, var(--vx-white-white)) 37.5%,
|
|
102
|
+
var(--vx-media-selection-color) 43%,
|
|
103
|
+
transparent 50% 52%,
|
|
104
|
+
var(--vx-magic-edit-beam-blue) 57%,
|
|
105
|
+
color-mix(in srgb, var(--vx-magic-edit-beam-blue) 30%, var(--vx-white-white)) 62.5%,
|
|
106
|
+
var(--vx-magic-edit-beam-blue) 68%,
|
|
107
|
+
transparent 75% 77%,
|
|
108
|
+
var(--vx-media-selection-color) 82%,
|
|
109
|
+
color-mix(in srgb, var(--vx-media-selection-color) 30%, var(--vx-white-white)) 87.5%,
|
|
110
|
+
var(--vx-media-selection-color) 93%,
|
|
111
|
+
transparent 100%);
|
|
112
|
+
mask: linear-gradient(var(--vx-white-white) 0 0) content-box, linear-gradient(var(--vx-white-white) 0 0);
|
|
113
|
+
mask-composite: exclude;
|
|
114
|
+
}
|
|
115
|
+
.magic-edit-glow::after {
|
|
116
|
+
padding: 0;
|
|
117
|
+
filter: blur(var(--vx-magic-edit-beam-glow-blur));
|
|
118
|
+
mask:
|
|
119
|
+
linear-gradient(
|
|
120
|
+
to bottom,
|
|
121
|
+
var(--vx-white-white),
|
|
122
|
+
transparent) top / 100% var(--vx-magic-edit-beam-glow-width) no-repeat,
|
|
123
|
+
linear-gradient(
|
|
124
|
+
to top,
|
|
125
|
+
var(--vx-white-white),
|
|
126
|
+
transparent) bottom / 100% var(--vx-magic-edit-beam-glow-width) no-repeat,
|
|
127
|
+
linear-gradient(
|
|
128
|
+
to right,
|
|
129
|
+
var(--vx-white-white),
|
|
130
|
+
transparent) left / var(--vx-magic-edit-beam-glow-width) 100% no-repeat,
|
|
131
|
+
linear-gradient(
|
|
132
|
+
to left,
|
|
133
|
+
var(--vx-white-white),
|
|
134
|
+
transparent) right / var(--vx-magic-edit-beam-glow-width) 100% no-repeat;
|
|
135
|
+
mask-composite: add;
|
|
136
|
+
}
|
|
137
|
+
.magic-edit-effects[data-active=true]:not(:has(> .magic-edit-wave)) .magic-edit-glow {
|
|
138
|
+
opacity: 0.5;
|
|
139
|
+
}
|
|
140
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
141
|
+
.magic-edit-wave ~ .magic-edit-glow {
|
|
142
|
+
transition: none;
|
|
143
|
+
}
|
|
144
|
+
.magic-edit-glow {
|
|
145
|
+
transition: opacity var(--vx-motion-duration-enter) var(--vx-motion-easing-standard);
|
|
146
|
+
animation: vx-magic-edit-beam var(--vx-motion-duration-ambient) linear infinite paused;
|
|
147
|
+
}
|
|
148
|
+
.magic-edit-effects[data-active=true]:not(:has(> .magic-edit-wave)) .magic-edit-glow {
|
|
149
|
+
animation-play-state: running;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
@keyframes vx-magic-edit-beam {
|
|
153
|
+
to {
|
|
154
|
+
--vx-magic-edit-beam-angle: 360deg;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* packages/magic-edit/src/client.css */
|
|
159
|
+
.magic-edit {
|
|
160
|
+
position: fixed;
|
|
161
|
+
z-index: 4;
|
|
162
|
+
inset-inline-end: var(--vx-space-16);
|
|
163
|
+
inset-block-end: var(--vx-space-16);
|
|
164
|
+
}
|
|
165
|
+
.magic-edit > .vx-annotation-tools {
|
|
166
|
+
box-sizing: border-box;
|
|
167
|
+
min-height: 40px;
|
|
168
|
+
padding: 2px;
|
|
169
|
+
background: var(--vx-green-green);
|
|
170
|
+
color: var(--vx-text-on-content-primary);
|
|
171
|
+
}
|
|
172
|
+
.magic-edit > .vx-annotation-tools[role=toolbar] {
|
|
173
|
+
border: 0;
|
|
174
|
+
background: var(--vx-green-green);
|
|
175
|
+
color: var(--vx-text-on-content-primary);
|
|
176
|
+
box-shadow: none;
|
|
177
|
+
max-width: calc(100vw - 32px);
|
|
178
|
+
flex-wrap: wrap;
|
|
179
|
+
}
|
|
180
|
+
.magic-edit-project-tools {
|
|
181
|
+
display: contents;
|
|
182
|
+
}
|
|
183
|
+
.magic-edit > .vx-annotation-tools[role=toolbar] > .vx-button {
|
|
184
|
+
width: 36px;
|
|
185
|
+
height: 36px;
|
|
186
|
+
border-radius: var(--vx-radius-full);
|
|
187
|
+
}
|
|
188
|
+
.magic-edit > .vx-annotation-tools[role=toolbar] > .vx-button[aria-pressed=true] {
|
|
189
|
+
background: rgb(255 255 255 / 20%);
|
|
190
|
+
}
|
|
191
|
+
.magic-edit > .vx-annotation-tools[role=toolbar] > .vx-button:hover:not(:disabled, [aria-pressed=true]) {
|
|
192
|
+
background: rgb(255 255 255 / 10%);
|
|
193
|
+
}
|
|
194
|
+
.magic-edit > .vx-annotation-tools[role=toolbar] > .vx-button:focus-visible {
|
|
195
|
+
outline-color: currentColor;
|
|
196
|
+
}
|
|
197
|
+
.magic-edit > .vx-annotation-tools .vx-icon {
|
|
198
|
+
--vx-icon-size: 18px;
|
|
199
|
+
}
|
|
200
|
+
.magic-edit > .vx-annotation-tools[role=toolbar] .vx-icon::before {
|
|
201
|
+
mask-size: auto;
|
|
202
|
+
}
|
|
203
|
+
.magic-edit > .vx-annotation-tools > .vx-divider {
|
|
204
|
+
flex: 0 0 8px;
|
|
205
|
+
height: 16px;
|
|
206
|
+
margin: 0;
|
|
207
|
+
background: url("./assets/toolbar-divider-DHGQDOLY.svg") center no-repeat;
|
|
208
|
+
}
|
|
209
|
+
.magic-edit > .vx-annotation-tools:not([role]) {
|
|
210
|
+
padding: 0;
|
|
211
|
+
}
|
|
212
|
+
.magic-edit > .vx-annotation-tools:not([role]) .vx-button {
|
|
213
|
+
width: max-content;
|
|
214
|
+
height: 40px;
|
|
215
|
+
padding-inline: var(--vx-space-24);
|
|
216
|
+
border-radius: var(--vx-radius-full);
|
|
217
|
+
gap: var(--vx-space-6);
|
|
218
|
+
font: var(--vx-typography-inter-16-semi-bold);
|
|
219
|
+
}
|
|
220
|
+
.magic-edit > .vx-annotation-tools:not([role]) .vx-button-content {
|
|
221
|
+
flex: none;
|
|
222
|
+
gap: var(--vx-space-6);
|
|
223
|
+
}
|
|
224
|
+
.magic-edit > .vx-annotation-tools:not([role]) .vx-button::after {
|
|
225
|
+
content: "C";
|
|
226
|
+
display: grid;
|
|
227
|
+
place-items: center;
|
|
228
|
+
height: 16px;
|
|
229
|
+
padding: 0 var(--vx-space-4);
|
|
230
|
+
border-radius: var(--vx-radius-sm);
|
|
231
|
+
background: var(--vx-overlay-tag);
|
|
232
|
+
font: var(--vx-typography-inter-10-semi-bold);
|
|
233
|
+
}
|
|
234
|
+
.magic-edit-highlight {
|
|
235
|
+
position: fixed;
|
|
236
|
+
box-sizing: border-box;
|
|
237
|
+
pointer-events: none;
|
|
238
|
+
border-radius: var(--vx-radius-sm);
|
|
239
|
+
background: color-mix(in srgb, var(--vx-state-success) 16%, transparent);
|
|
240
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--vx-state-success) 50%, transparent);
|
|
241
|
+
}
|
|
242
|
+
.magic-edit-content {
|
|
243
|
+
position: absolute;
|
|
244
|
+
inset-inline-end: 0;
|
|
245
|
+
inset-block-end: calc(100% + var(--vx-space-8));
|
|
246
|
+
box-sizing: border-box;
|
|
247
|
+
display: grid;
|
|
248
|
+
grid-template-columns: minmax(0, 1fr);
|
|
249
|
+
gap: var(--vx-space-8);
|
|
250
|
+
width: min(460px, calc(100vw - 32px));
|
|
251
|
+
max-height: calc(100dvh - 88px);
|
|
252
|
+
padding: var(--vx-space-12);
|
|
253
|
+
overflow: auto;
|
|
254
|
+
border: 1px solid var(--vx-border-secondary);
|
|
255
|
+
border-radius: var(--vx-radius-lg);
|
|
256
|
+
background: var(--vx-background-dialog);
|
|
257
|
+
box-shadow: var(--vx-shadow-annotation);
|
|
258
|
+
}
|
|
259
|
+
.magic-edit-content[data-picking]:not(:focus-within) {
|
|
260
|
+
clip-path: inset(50%);
|
|
261
|
+
pointer-events: none;
|
|
262
|
+
}
|
|
263
|
+
.magic-edit-content[data-anchored] {
|
|
264
|
+
position: fixed;
|
|
265
|
+
inset: auto;
|
|
266
|
+
width: min(460px, calc(100vw - 16px));
|
|
267
|
+
}
|
|
268
|
+
.magic-edit-content[data-anchored]::before {
|
|
269
|
+
content: "";
|
|
270
|
+
position: absolute;
|
|
271
|
+
inset: 0;
|
|
272
|
+
z-index: 1;
|
|
273
|
+
border-radius: inherit;
|
|
274
|
+
background: inherit;
|
|
275
|
+
pointer-events: none;
|
|
276
|
+
}
|
|
277
|
+
.magic-edit-content[data-gesture] {
|
|
278
|
+
visibility: hidden;
|
|
279
|
+
}
|
|
280
|
+
.magic-edit-content[data-gesture] canvas[data-on-target] {
|
|
281
|
+
visibility: visible;
|
|
282
|
+
}
|
|
283
|
+
.magic-edit-actions,
|
|
284
|
+
.magic-edit-prompt {
|
|
285
|
+
display: flex;
|
|
286
|
+
flex-wrap: wrap;
|
|
287
|
+
align-items: center;
|
|
288
|
+
gap: var(--vx-space-8);
|
|
289
|
+
}
|
|
290
|
+
.magic-edit-target {
|
|
291
|
+
justify-content: space-between;
|
|
292
|
+
flex-wrap: nowrap;
|
|
293
|
+
}
|
|
294
|
+
.magic-edit-target > span {
|
|
295
|
+
min-width: 0;
|
|
296
|
+
overflow: hidden;
|
|
297
|
+
white-space: nowrap;
|
|
298
|
+
text-overflow: ellipsis;
|
|
299
|
+
}
|
|
300
|
+
.magic-edit-target > .vx-button {
|
|
301
|
+
flex: none;
|
|
302
|
+
}
|
|
303
|
+
.magic-edit-content :is(select, textarea) {
|
|
304
|
+
box-sizing: border-box;
|
|
305
|
+
min-width: 0;
|
|
306
|
+
max-width: 100%;
|
|
307
|
+
border: 1px solid var(--vx-border-secondary);
|
|
308
|
+
border-radius: var(--vx-radius-md);
|
|
309
|
+
background: var(--vx-background-page);
|
|
310
|
+
color: var(--vx-text-primary);
|
|
311
|
+
font: var(--vx-typography-inter-14-regular);
|
|
312
|
+
padding: var(--vx-space-8);
|
|
313
|
+
}
|
|
314
|
+
.magic-edit-prompt {
|
|
315
|
+
flex-wrap: nowrap;
|
|
316
|
+
gap: var(--vx-space-8);
|
|
317
|
+
padding: var(--vx-space-4) var(--vx-space-4) var(--vx-space-4) var(--vx-space-8);
|
|
318
|
+
border-radius: var(--vx-radius-full);
|
|
319
|
+
background: var(--vx-text-subtle-black);
|
|
320
|
+
color: var(--vx-text-on-content-primary);
|
|
321
|
+
}
|
|
322
|
+
.magic-edit-prompt:focus-within {
|
|
323
|
+
outline: 1px solid var(--vx-state-success);
|
|
324
|
+
}
|
|
325
|
+
.magic-edit-prompt-tag {
|
|
326
|
+
flex: none;
|
|
327
|
+
padding: 0 var(--vx-space-4);
|
|
328
|
+
border-radius: var(--vx-radius-sm);
|
|
329
|
+
background: var(--vx-overlay-tag);
|
|
330
|
+
font: var(--vx-typography-inter-10-semi-bold);
|
|
331
|
+
}
|
|
332
|
+
.magic-edit-prompt input {
|
|
333
|
+
flex: 1;
|
|
334
|
+
min-width: 0;
|
|
335
|
+
border: 0;
|
|
336
|
+
outline: 0;
|
|
337
|
+
padding: var(--vx-space-4) 0;
|
|
338
|
+
background: transparent;
|
|
339
|
+
color: inherit;
|
|
340
|
+
font: var(--vx-typography-inter-14-regular);
|
|
341
|
+
}
|
|
342
|
+
.magic-edit-prompt input::placeholder {
|
|
343
|
+
color: var(--vx-text-on-content-secondary);
|
|
344
|
+
}
|
|
345
|
+
.magic-edit-prompt .vx-button {
|
|
346
|
+
flex: none;
|
|
347
|
+
border-radius: var(--vx-radius-full);
|
|
348
|
+
background: var(--vx-green-green);
|
|
349
|
+
color: var(--vx-text-on-content-primary);
|
|
350
|
+
}
|
|
351
|
+
.magic-edit-instruction {
|
|
352
|
+
width: 100%;
|
|
353
|
+
}
|
|
354
|
+
.magic-edit-annotation canvas {
|
|
355
|
+
display: block;
|
|
356
|
+
width: auto;
|
|
357
|
+
height: auto;
|
|
358
|
+
max-width: 100%;
|
|
359
|
+
max-height: min(36vh, 280px);
|
|
360
|
+
margin-inline: auto;
|
|
361
|
+
border-radius: var(--vx-radius-sm);
|
|
362
|
+
background: var(--vx-background-page);
|
|
363
|
+
cursor: crosshair;
|
|
364
|
+
touch-action: none;
|
|
365
|
+
}
|
|
366
|
+
.magic-edit-annotation canvas[data-on-target] {
|
|
367
|
+
position: fixed;
|
|
368
|
+
max-width: none;
|
|
369
|
+
max-height: none;
|
|
370
|
+
margin: 0;
|
|
371
|
+
background: transparent;
|
|
372
|
+
}
|
|
373
|
+
.magic-edit-annotation canvas[data-on-target][data-tool=select] {
|
|
374
|
+
pointer-events: none;
|
|
375
|
+
}
|
|
376
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
377
|
+
.magic-edit-highlight,
|
|
378
|
+
.magic-edit-annotation canvas[data-on-target][data-tool=select] {
|
|
379
|
+
animation: magic-edit-mark-enter var(--vx-motion-duration-fast) var(--vx-motion-easing-enter);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
@keyframes magic-edit-mark-enter {
|
|
383
|
+
from {
|
|
384
|
+
opacity: 0;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
.magic-edit-prompt,
|
|
388
|
+
.magic-edit-target,
|
|
389
|
+
.magic-edit-annotation .magic-edit-actions,
|
|
390
|
+
.magic-edit-content > .magic-edit-error {
|
|
391
|
+
position: relative;
|
|
392
|
+
z-index: 1;
|
|
393
|
+
}
|
|
394
|
+
.magic-edit-annotation canvas[data-tool=select] {
|
|
395
|
+
cursor: pointer;
|
|
396
|
+
}
|
|
397
|
+
.magic-edit-feedback {
|
|
398
|
+
margin: 0;
|
|
399
|
+
}
|
|
400
|
+
.magic-edit-error {
|
|
401
|
+
color: var(--vx-state-danger);
|
|
402
|
+
}
|
|
403
|
+
.magic-edit-marking {
|
|
404
|
+
min-width: 0;
|
|
405
|
+
margin: 0;
|
|
406
|
+
padding: 0;
|
|
407
|
+
border: 0;
|
|
408
|
+
}
|
|
409
|
+
.magic-edit-marking:disabled {
|
|
410
|
+
pointer-events: none;
|
|
411
|
+
}
|
|
412
|
+
@media (max-width: 400px) {
|
|
413
|
+
.magic-edit-prompt {
|
|
414
|
+
display: grid;
|
|
415
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
416
|
+
border-radius: var(--vx-radius-lg);
|
|
417
|
+
padding: var(--vx-space-8);
|
|
418
|
+
}
|
|
419
|
+
.magic-edit-prompt > .vx-button {
|
|
420
|
+
grid-column: 2;
|
|
421
|
+
justify-self: end;
|
|
422
|
+
}
|
|
423
|
+
}
|