@rogieking/figui3 8.9.16 → 8.9.18
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/.cursor/skills/fig-editor/SKILL.md +9 -5
- package/.cursor/skills/figui3/SKILL.md +1 -1
- package/README.md +15 -5
- package/components.css +17 -2
- package/dist/components.css +1 -1
- package/dist/fig-editor.css +1 -1
- package/dist/fig-editor.js +3 -3
- package/dist/fig.css +1 -1
- package/dist/fig.js +7 -7
- package/fig-editor.css +10 -5
- package/fig-editor.js +363 -153
- package/fig.js +127 -28
- package/package.json +1 -1
|
@@ -136,20 +136,24 @@ Playground: `#fill-picker` — `all-modes`, `solid`, `gradient`, `image`, `video
|
|
|
136
136
|
| `alpha` | `"true"` default; hide alpha with `"false"` |
|
|
137
137
|
| `mode` | Lock modes: `solid`, `gradient`, `image`, `video`, `webcam`, comma-separated, plus custom names |
|
|
138
138
|
| `disabled` | Presence |
|
|
139
|
+
| `webcam-mode` | `live` (default) or `snapshot`. Webcam tab starts the camera. Capture writes a still and switches to Image |
|
|
140
|
+
| `default-video` | Sample clip URL when Video has no file |
|
|
139
141
|
|
|
140
|
-
Events: `input` / `change` with fill payload in `detail`.
|
|
142
|
+
Events: `input` / `change` with fill payload in `detail`. `webcamstream` with `{ stream, deviceId }`. Live camera is `webcamStream` / `releaseWebcam()`, never JSON.
|
|
141
143
|
|
|
142
144
|
Value shapes:
|
|
143
145
|
|
|
144
146
|
```txt
|
|
145
147
|
solid { type, colorSpace, color, alpha, hsv }
|
|
146
148
|
gradient { type, colorSpace, gradient, css }
|
|
147
|
-
image { type, colorSpace, image }
|
|
148
|
-
video { type, colorSpace, video }
|
|
149
|
-
webcam { type, colorSpace,
|
|
149
|
+
image { type, colorSpace, image: { url, scaleMode, scale } } // scaleMode includes tile
|
|
150
|
+
video { type, colorSpace, video: { url, poster, scaleMode, scale, opacity } } // fill | fit | crop
|
|
151
|
+
webcam { type, colorSpace, webcam: { live, snapshot, deviceId, scaleMode, scale, opacity } }
|
|
150
152
|
custom { type: <modeName>, ...payload }
|
|
151
153
|
```
|
|
152
154
|
|
|
155
|
+
Legacy `{ type: "webcam", image: { url } }` still parses as `webcam.snapshot` for one release. `fig-input-fill` uses the same `webcam` / `video.poster` shapes.
|
|
156
|
+
|
|
153
157
|
`fig-input-color` expects solid data (`detail.color`, optional `detail.alpha`). Keep legacy `value` / `hex` / `rgba` on color input events.
|
|
154
158
|
|
|
155
159
|
Do not use `picker` or `picker-anchor` on `fig-input-color`. Forward picker chrome with `picker-*` (e.g. `picker-dialog-position`).
|
|
@@ -174,7 +178,7 @@ Child `slot="mode-<name>"` plus `<name>` in `mode`. Custom content must dispatch
|
|
|
174
178
|
|
|
175
179
|
## `fig-interpolation-swatch`
|
|
176
180
|
|
|
177
|
-
Preview for gradient interpolation (linear or polar hue arc). Playground attrs: `size="small|large"`.
|
|
181
|
+
Preview for gradient interpolation (linear or polar hue arc). Playground attrs: `size="small|large"`. Can be used standalone with a gradient `value`. The fill picker interpolation row is hidden for now and locks to `srgb`.
|
|
178
182
|
|
|
179
183
|
## Maintainer notes
|
|
180
184
|
|
|
@@ -138,7 +138,7 @@ Playground hashes: `/figui3#{id}`. Full attrs: [reference.md](reference.md).
|
|
|
138
138
|
| Tag | Playground | Notes |
|
|
139
139
|
|---|---|---|
|
|
140
140
|
| `fig-input-color` | (propkit `#color`) | Solid color. `text`, `alpha`. Auto-detects `fig-fill-picker` |
|
|
141
|
-
| `fig-input-fill` | `#fill-input` | Solid/gradient/image/video JSON `value`. `picker-*` forwarded if picker registered |
|
|
141
|
+
| `fig-input-fill` | `#fill-input` | Solid/gradient/image/video/webcam JSON `value`. Same `webcam` / `video.poster` shape as the picker. `webcam-mode`, `default-video`, `picker-*` forwarded if picker registered |
|
|
142
142
|
| `fig-input-palette` | (propkit `#palette`) | Multi-color. `fixed`, `open` |
|
|
143
143
|
| `fig-input-gradient` | (propkit `#gradient`) | Stops. `edit`, `mode="handle\|tip"` |
|
|
144
144
|
| `fig-swatch` | `#swatch` | `size`, `selected`, `alpha` |
|
package/README.md
CHANGED
|
@@ -939,7 +939,7 @@ Supported interpolation spaces: `srgb`, `srgb-linear`, `display-p3`, `oklab`, `o
|
|
|
939
939
|
|
|
940
940
|
`<fig-input-fill>` — [demo](https://rog.ie/figui3/#fill-input)
|
|
941
941
|
|
|
942
|
-
A comprehensive fill input supporting solid, gradient, image, and
|
|
942
|
+
A comprehensive fill input supporting solid, gradient, image, video, and webcam fills. Without the optional picker, it renders a passive preview.
|
|
943
943
|
|
|
944
944
|
| Attribute | Type | Default | Description |
|
|
945
945
|
|---|---|---|---|
|
|
@@ -947,16 +947,21 @@ A comprehensive fill input supporting solid, gradient, image, and video fills. W
|
|
|
947
947
|
| `disabled` | boolean | `false` | Disabled state |
|
|
948
948
|
| `mode` | string | — | Lock to a fill mode |
|
|
949
949
|
| `alpha` | boolean | `true` | Show alpha controls |
|
|
950
|
+
| `webcam-mode` | string | `live` | Forwarded to the picker: `live` or `snapshot` |
|
|
951
|
+
| `default-video` | string | — | Forwarded sample clip URL when Video has no file |
|
|
950
952
|
| `picker-*` | string | — | Forwarded to `<fig-fill-picker>` when the optional picker is registered |
|
|
951
953
|
|
|
952
954
|
Add `aria-label` to name the generated picker, hex field, and opacity field as one fill control group.
|
|
953
955
|
|
|
956
|
+
Solid `alpha` is 0–1 (canonical). `opacity` 0–100 is also emitted for compatibility. Gradient values include `css`. Webcam JSON is `{ type, webcam }` — never a live `MediaStream`. Read `webcamStream` or listen for `webcamstream`. Video swatches use `video.poster`, not the mp4 URL.
|
|
957
|
+
|
|
954
958
|
**Events:**
|
|
955
959
|
|
|
956
960
|
| Event | Detail |
|
|
957
961
|
|---|---|
|
|
958
|
-
| `input` | `{ type, color?, gradient?, image?, video?, css }` |
|
|
959
|
-
| `change` | `{ type, color?, gradient?, image?, video?, css }` |
|
|
962
|
+
| `input` | `{ type, color?, gradient?, image?, video?, webcam?, css }` |
|
|
963
|
+
| `change` | `{ type, color?, gradient?, image?, video?, webcam?, css }` |
|
|
964
|
+
| `webcamstream` | `{ stream, deviceId }` |
|
|
960
965
|
|
|
961
966
|
```html
|
|
962
967
|
<fig-input-fill value='{"type":"solid","color":"#FF5733","opacity":100}'></fig-input-fill>
|
|
@@ -976,13 +981,18 @@ Optional full fill picker dialog supporting solid, gradient, image, video, and w
|
|
|
976
981
|
| `disabled` | boolean | `false` | Disabled state |
|
|
977
982
|
| `alpha` | boolean | `true` | Show alpha controls |
|
|
978
983
|
| `mode` | string | — | Lock to mode: `"solid"`, `"gradient"`, `"image"`, `"video"`, `"webcam"` |
|
|
984
|
+
| `webcam-mode` | string | `live` | `live` keeps the camera after close; Capture always writes an image still |
|
|
985
|
+
| `default-video` | string | — | Sample clip URL when Video is selected with no file |
|
|
986
|
+
|
|
987
|
+
Webcam JSON is `{ type: "webcam", webcam: { live, snapshot, deviceId, scaleMode, scale, opacity } }`. The live `MediaStream` is `webcamStream` / `webcamstream`, not `value`. Closing the dialog does not stop a live camera; call `releaseWebcam()` or disconnect the element. Capture in `live` mode only updates `webcam.snapshot`. Video JSON includes `poster`; the swatch paints that, never `url(file.mp4)`.
|
|
979
988
|
|
|
980
989
|
**Events:**
|
|
981
990
|
|
|
982
991
|
| Event | Detail |
|
|
983
992
|
|---|---|
|
|
984
|
-
| `input` | `{ type, gradient?, color?, css }` |
|
|
985
|
-
| `change` | `{ type, gradient?, color?, css }` |
|
|
993
|
+
| `input` | `{ type, gradient?, color?, image?, video?, webcam?, css }` |
|
|
994
|
+
| `change` | `{ type, gradient?, color?, image?, video?, webcam?, css }` |
|
|
995
|
+
| `webcamstream` | `{ stream, deviceId }` |
|
|
986
996
|
|
|
987
997
|
```html
|
|
988
998
|
<fig-fill-picker value='{"type":"solid","color":"#FF5733"}'>
|
package/components.css
CHANGED
|
@@ -1495,7 +1495,8 @@ input[type="color"] {
|
|
|
1495
1495
|
}
|
|
1496
1496
|
&::before {
|
|
1497
1497
|
content: "";
|
|
1498
|
-
background:
|
|
1498
|
+
background-color: transparent;
|
|
1499
|
+
background-image: var(--swatch-background);
|
|
1499
1500
|
background-size: var(--swatch-bg-size);
|
|
1500
1501
|
background-position: var(--swatch-bg-position);
|
|
1501
1502
|
background-repeat: no-repeat;
|
|
@@ -1780,6 +1781,18 @@ fig-media-controls {
|
|
|
1780
1781
|
gap: var(--spacer-1);
|
|
1781
1782
|
width: 100%;
|
|
1782
1783
|
|
|
1784
|
+
/* display:contents on fig-tooltip drops the play button out of this flex
|
|
1785
|
+
row until hover/reflow. Keep a real box so the control is always visible. */
|
|
1786
|
+
> fig-tooltip {
|
|
1787
|
+
display: inline-flex;
|
|
1788
|
+
flex-shrink: 0;
|
|
1789
|
+
align-items: center;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
fig-icon {
|
|
1793
|
+
contain: none;
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1783
1796
|
&[overlay]:not([overlay="false"]) {
|
|
1784
1797
|
border-radius: var(--radius-medium);
|
|
1785
1798
|
background-color: var(--figma-color-bg);
|
|
@@ -4891,7 +4904,9 @@ fig-skeleton {
|
|
|
4891
4904
|
|
|
4892
4905
|
.fig-mask-icon,
|
|
4893
4906
|
fig-icon {
|
|
4894
|
-
|
|
4907
|
+
/* size only — paint containment skips mask-image when `name` / `--icon` updates
|
|
4908
|
+
until a sibling hover (e.g. fig-preview) forces a repaint. */
|
|
4909
|
+
contain: size;
|
|
4895
4910
|
--size: var(--spacer-4);
|
|
4896
4911
|
--icon: var(--icon-24-add);
|
|
4897
4912
|
|