vintage-frames 0.12.8 → 0.13.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.
- package/custom-elements.json +19 -19
- package/dist/chrome.d.ts +1 -1
- package/dist/components/vf-container.d.ts +5 -7
- package/dist/components/vf-container.js +1 -5
- package/dist/components/vf-desktop.d.ts +4 -5
- package/dist/components/vf-desktop.js +13 -18
- package/dist/components/vf-progress-bar.d.ts +2 -2
- package/dist/components/vf-progress-bar.js +55 -41
- package/dist/components/vf-slider.js +11 -11
- package/dist/components/vf-swatch.d.ts +2 -2
- package/dist/components/vf-swatch.js +37 -38
- package/dist/components/vf-window.d.ts +6 -9
- package/dist/components/vf-window.js +73 -74
- package/dist/index.d.ts +10 -9
- package/dist/index.js +62 -62
- package/dist/pattern-fill.d.ts +21 -50
- package/dist/pattern-fill.js +19 -54
- package/dist/scroll-rail.d.ts +6 -6
- package/dist/scroll-rail.js +24 -29
- package/dist/styles/recipes/pattern.d.ts +19 -10
- package/dist/styles/recipes/pattern.js +27 -18
- package/dist/styles/recipes/scroll-rail.d.ts +14 -7
- package/dist/styles/recipes/scroll-rail.js +14 -24
- package/dist/styles/recipes/tile.d.ts +11 -3
- package/dist/styles/recipes/tile.js +12 -12
- package/dist/tile-grid.d.ts +98 -64
- package/dist/tile-grid.js +63 -30
- package/dist/track-width.d.ts +1 -2
- package/docs/SPEC.md +11 -11
- package/editor/vscode.html-custom-data.json +2 -2
- package/editor/web-types.json +3 -3
- package/package.json +1 -1
|
@@ -3,17 +3,17 @@ import { ScaleController as t, sysLength as n } from "../scale.js";
|
|
|
3
3
|
import r from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
4
4
|
import { VfPositioned as i } from "../position.js";
|
|
5
5
|
import { vfBase as a } from "../styles/recipes/host.js";
|
|
6
|
-
import { tileImage as o, tileRects as s, tileSpan as c
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { tileImage as o, tileRects as s, tileSpan as c } from "../styles/recipes/tile.js";
|
|
7
|
+
import { RepeatTileController as l, patternOverride as u, tileGrid as d, vfRepeatTileSize as f, vfTileGrid as p } from "../tile-grid.js";
|
|
8
|
+
import { vfHardShadowDecls as m } from "../styles/recipes/shadow.js";
|
|
9
|
+
import { vfFocusUnderline as h } from "../styles/recipes/focus.js";
|
|
10
10
|
import { GridSnapController as g } from "../grid-snap.js";
|
|
11
11
|
import { VfShadowRoleControl as _ } from "../form-control.js";
|
|
12
12
|
import { css as v, html as y, unsafeCSS as b } from "lit";
|
|
13
13
|
import { property as x } from "lit/decorators.js";
|
|
14
14
|
import { styleMap as S } from "lit/directives/style-map.js";
|
|
15
15
|
//#region src/components/vf-swatch.ts
|
|
16
|
-
var C =
|
|
16
|
+
var C = [
|
|
17
17
|
[
|
|
18
18
|
0,
|
|
19
19
|
0,
|
|
@@ -35,9 +35,17 @@ var C = 4, w = [
|
|
|
35
35
|
2,
|
|
36
36
|
"#c0c0c0"
|
|
37
37
|
]
|
|
38
|
-
],
|
|
38
|
+
], w = {
|
|
39
|
+
width: 4,
|
|
40
|
+
height: 4,
|
|
41
|
+
rects: C
|
|
42
|
+
}, T = o(w.width, w.height, s(C)), E = c(w.width), D = class extends i(_) {
|
|
39
43
|
constructor(...e) {
|
|
40
|
-
super(...e), this.width = 24, this.height = 18, this.shadow = !1, this.label = "", this.disabled = !1, this.scale = new t(this), this.gridSnap = new g(this), this._pattern = "", this.#e = new
|
|
44
|
+
super(...e), this.width = 24, this.height = 18, this.shadow = !1, this.label = "", this.disabled = !1, this.scale = new t(this), this.gridSnap = new g(this), this._pattern = "", this.#e = new l(this, {
|
|
45
|
+
getBox: () => this.renderRoot?.querySelector(".fill"),
|
|
46
|
+
getArt: () => this._pattern ? null : w,
|
|
47
|
+
property: "--_vf-checker-tile"
|
|
48
|
+
});
|
|
41
49
|
}
|
|
42
50
|
static {
|
|
43
51
|
this.shadowRootOptions = {
|
|
@@ -48,19 +56,15 @@ var C = 4, w = [
|
|
|
48
56
|
static {
|
|
49
57
|
this.styles = [
|
|
50
58
|
a,
|
|
51
|
-
|
|
59
|
+
p,
|
|
52
60
|
v`
|
|
53
61
|
:host {
|
|
54
62
|
display: inline-flex;
|
|
55
63
|
cursor: var(--vf-cursor, default);
|
|
56
|
-
/* The
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
shows is the exact fill rendered into .fill (see src/tile-grid.ts):
|
|
61
|
-
the whole-surface raster for the kit checker, or the placed tile
|
|
62
|
-
grid at the token's documented 60-px tile geometry for a consumer
|
|
63
|
-
override. */
|
|
64
|
+
/* The consumer's checker token, as the art channel of the placed
|
|
65
|
+
tile grid .fill renders for it at the token's documented 60-px
|
|
66
|
+
tile geometry (src/tile-grid.ts). The kit checker is .fill's own
|
|
67
|
+
repeating tile instead. */
|
|
64
68
|
--_checker: var(--vf-swatch-checker, ${b(T)});
|
|
65
69
|
/* How deep a shadow this swatch actually casts — nothing unless the
|
|
66
70
|
shadow attribute is set. Resolved here once so the focus rule below
|
|
@@ -88,7 +92,7 @@ var C = 4, w = [
|
|
|
88
92
|
/* Opt-in depth: the kit's one hard shadow, painted outside the border
|
|
89
93
|
box like every raised surface's. */
|
|
90
94
|
:host([shadow]) button {
|
|
91
|
-
${
|
|
95
|
+
${m}
|
|
92
96
|
}
|
|
93
97
|
/* Pressed: the white inset inverts to black — instant 1-bit feedback. */
|
|
94
98
|
button:active:not(:disabled) {
|
|
@@ -112,37 +116,35 @@ var C = 4, w = [
|
|
|
112
116
|
}
|
|
113
117
|
button:focus-visible::after {
|
|
114
118
|
--vf-focus-underline-offset: calc(-3px - var(--_shadow-depth));
|
|
115
|
-
${
|
|
119
|
+
${h}
|
|
116
120
|
left: calc(var(--vf-scale, 1) * -1px);
|
|
117
121
|
right: calc(var(--vf-scale, 1) * -1px);
|
|
118
122
|
}
|
|
119
123
|
.fill {
|
|
120
124
|
display: block;
|
|
121
|
-
/* The containing block for the
|
|
125
|
+
/* The containing block for the token's tile grid and the tint. */
|
|
122
126
|
position: relative;
|
|
123
127
|
width: 100%;
|
|
124
128
|
height: 100%;
|
|
125
|
-
/* The
|
|
126
|
-
|
|
127
|
-
background-image: var(--
|
|
128
|
-
${
|
|
129
|
+
/* The kit checker: the repeating tile the swatch writes
|
|
130
|
+
(src/tile-grid.ts). */
|
|
131
|
+
background-image: var(--_vf-checker-tile, none);
|
|
132
|
+
${f}
|
|
133
|
+
image-rendering: pixelated;
|
|
129
134
|
/* Forced colors would delete the color layer and keep the checker,
|
|
130
135
|
showing "transparent" for every color. The fill is CONTENT, not
|
|
131
136
|
chrome — the color is the one thing the control exists to show,
|
|
132
137
|
the case forced-color-adjust's own spec exempts (its example is a
|
|
133
|
-
color picker). It inherits to the
|
|
134
|
-
|
|
135
|
-
|
|
138
|
+
color picker). It inherits to the tiles and tint. Frame, inset
|
|
139
|
+
and press feedback stay on the forced palette like every other
|
|
140
|
+
control's. */
|
|
136
141
|
@media (forced-colors: active) {
|
|
137
142
|
forced-color-adjust: none;
|
|
138
143
|
}
|
|
139
144
|
}
|
|
140
|
-
/* A consumer checker token switches the fill to the placed tile grid
|
|
141
|
-
|
|
142
|
-
would show the underlay's drifting copy of itself. The grid's tiles
|
|
143
|
-
resolve the token through the shared private property. */
|
|
145
|
+
/* A consumer checker token switches the fill to the placed tile grid,
|
|
146
|
+
whose tiles resolve the token through the shared private property. */
|
|
144
147
|
.fill.patterned {
|
|
145
|
-
background-image: none;
|
|
146
148
|
--_vf-tile-image: var(--_checker);
|
|
147
149
|
}
|
|
148
150
|
/* The color, painted over the checker so a translucent value reads as
|
|
@@ -156,17 +158,14 @@ var C = 4, w = [
|
|
|
156
158
|
}
|
|
157
159
|
#e;
|
|
158
160
|
willUpdate(e) {
|
|
159
|
-
super.willUpdate(e), this._pattern =
|
|
161
|
+
super.willUpdate(e), this._pattern = u(this, "--vf-swatch-checker");
|
|
160
162
|
}
|
|
161
163
|
render() {
|
|
162
|
-
let e = Math.max(1, (this.width ?? 24) - 4), t = Math.max(1, (this.height ?? 18) - 4), r =
|
|
164
|
+
let e = Math.max(1, (this.width ?? 24) - 4), t = Math.max(1, (this.height ?? 18) - 4), r = this._pattern ? d({
|
|
163
165
|
cols: Math.ceil(e / E),
|
|
164
166
|
rows: Math.ceil(t / E),
|
|
165
167
|
tile: E
|
|
166
|
-
}) : y`<span
|
|
167
|
-
class="vf-tile-raster"
|
|
168
|
-
style="width:${n(r(e))};height:${n(r(t))};background-image:${this.#e.for(C, C, w, r(e), r(t))}"
|
|
169
|
-
></span>`, a = this.color ? y`<span
|
|
168
|
+
}) : null, i = this.color ? y`<span
|
|
170
169
|
class="tint"
|
|
171
170
|
style=${S({ "background-color": this.color })}
|
|
172
171
|
></span>` : null;
|
|
@@ -183,7 +182,7 @@ var C = 4, w = [
|
|
|
183
182
|
<span
|
|
184
183
|
class="fill vf-tile-grid${this._pattern ? " patterned" : ""}"
|
|
185
184
|
part="fill"
|
|
186
|
-
>${
|
|
185
|
+
>${r}${i}</span
|
|
187
186
|
>
|
|
188
187
|
</button>
|
|
189
188
|
${this.renderDescription()}
|
|
@@ -227,20 +227,17 @@ export declare class VfWindow extends VfWindow_base {
|
|
|
227
227
|
private readonly titleCenter;
|
|
228
228
|
/**
|
|
229
229
|
* The consumer's `--vf-dots-pattern` override, or `''` for the kit dots —
|
|
230
|
-
* which
|
|
231
|
-
*
|
|
230
|
+
* which path the utility bar takes (src/tile-grid.ts). Re-read every
|
|
231
|
+
* update; a runtime token swap wants a `requestUpdate()`.
|
|
232
232
|
*/
|
|
233
233
|
private _dotsPattern;
|
|
234
234
|
protected willUpdate(changed: PropertyValues<this>): void;
|
|
235
235
|
/**
|
|
236
|
-
*
|
|
236
|
+
* A consumer `--vf-dots-pattern`'s placed tile grid, rendered into the
|
|
237
|
+
* utility bar's `.vf-dots` layer at the token's documented 30-px geometry
|
|
237
238
|
* (src/tile-grid.ts): the bar interior is the declared width minus the
|
|
238
|
-
* frame borders.
|
|
239
|
-
*
|
|
240
|
-
* boundary — the layer's clip crops the overdraw; a consumer
|
|
241
|
-
* `--vf-dots-pattern` renders the placed tile grid at the token's
|
|
242
|
-
* documented 30-px geometry instead. A window with no declared width
|
|
243
|
-
* renders neither and the layer keeps its CSS-repeated tile.
|
|
239
|
+
* frame borders. A window with no declared width renders none, and the
|
|
240
|
+
* layer repeats the token in CSS instead (`vf-dots-token`).
|
|
244
241
|
*/
|
|
245
242
|
private _dotsTexture;
|
|
246
243
|
/**
|
|
@@ -4,37 +4,41 @@ import { ScaleController as n, effectiveScale as r, snapSys as i, sysLength as a
|
|
|
4
4
|
import s from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
5
5
|
import { PlacementController as c, VfPositioned as l, placementIn as u, warnMovableContract as d } from "../position.js";
|
|
6
6
|
import { vfBase as f } from "../styles/recipes/host.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { GridSnapController as
|
|
14
|
-
import { DocumentListenersController as
|
|
15
|
-
import { VfSized as
|
|
16
|
-
import { DragController as
|
|
17
|
-
import { TitleCenterController as
|
|
18
|
-
import { prefersReducedMotion as
|
|
19
|
-
import { paintSelectionRect as
|
|
7
|
+
import { RepeatTileController as p, patternOverride as m, tileGrid as h, vfTileGrid as g } from "../tile-grid.js";
|
|
8
|
+
import { DOTS as _, DOT_SPAN as v, vfDots as y, vfStripes as b } from "../styles/recipes/pattern.js";
|
|
9
|
+
import { vfChromeFrame as x } from "../styles/recipes/surface.js";
|
|
10
|
+
import { vfRule as S } from "../styles/recipes/rule.js";
|
|
11
|
+
import { vfTitleBar as C, vfWindowWidgets as w } from "../styles/recipes/title-bar.js";
|
|
12
|
+
import { vfFocus as T } from "../styles/recipes/focus.js";
|
|
13
|
+
import { GridSnapController as E } from "../grid-snap.js";
|
|
14
|
+
import { DocumentListenersController as D } from "../document-listeners.js";
|
|
15
|
+
import { VfSized as O } from "../size.js";
|
|
16
|
+
import { DragController as k } from "../drag.js";
|
|
17
|
+
import { TitleCenterController as A, chromeTitleBar as j, closeBox as M, widgetLabel as N, zoomBox as P } from "../chrome.js";
|
|
18
|
+
import { prefersReducedMotion as F, windowRectFraction as I } from "../motion.js";
|
|
19
|
+
import { paintSelectionRect as L, penPhase as R, xorPenCanvas as z } from "../open-art.js";
|
|
20
20
|
import "./vf-scroll-area.js";
|
|
21
|
-
import { LitElement as
|
|
22
|
-
import { property as
|
|
21
|
+
import { LitElement as B, css as V, html as H, nothing as U } from "lit";
|
|
22
|
+
import { property as W, query as G, state as K } from "lit/decorators.js";
|
|
23
23
|
//#region src/components/vf-window.ts
|
|
24
|
-
var
|
|
25
|
-
function
|
|
24
|
+
var q = 80, J = 54;
|
|
25
|
+
function Y(e, t, n) {
|
|
26
26
|
let r = Math.max(t, e);
|
|
27
27
|
return n == null ? r : Math.min(n, r);
|
|
28
28
|
}
|
|
29
|
-
var
|
|
29
|
+
var X = 24, Z = class extends O(l(B)) {
|
|
30
30
|
constructor(...e) {
|
|
31
|
-
super(...e), this.heading = "", this.active = !0, this.closable = !0, this.zoomable = !1, this.movable = !1, this.outlineDrag = !1, this.resizable = !1, this._hasHeader = !1, this._hasStatus = !1, this.scale = new n(this), this.gridSnap = new
|
|
31
|
+
super(...e), this.heading = "", this.active = !0, this.closable = !0, this.zoomable = !1, this.movable = !1, this.outlineDrag = !1, this.resizable = !1, this._hasHeader = !1, this._hasStatus = !1, this.scale = new n(this), this.gridSnap = new E(this), this.titleCenter = new A(this), this._dotsPattern = "", this.#e = new p(this, {
|
|
32
|
+
getBox: () => this.renderRoot?.querySelector(".vf-dots"),
|
|
33
|
+
getArt: () => this.variant === "utility" && !this._dotsPattern ? _ : null,
|
|
34
|
+
property: "--_vf-dots-tile"
|
|
35
|
+
}), this.#t = (e, t, n) => {
|
|
32
36
|
let r = o(this.offsetWidth, this);
|
|
33
37
|
return {
|
|
34
|
-
x: Math.min(Math.max(e,
|
|
35
|
-
y: Math.min(Math.max(t, 0), Math.max(0, n.height -
|
|
38
|
+
x: Math.min(Math.max(e, X - r), n.width - X),
|
|
39
|
+
y: Math.min(Math.max(t, 0), Math.max(0, n.height - X))
|
|
36
40
|
};
|
|
37
|
-
}, this._placement = new c(this, (e, t, n) => this.#t(e, t, n)), this._drag = new
|
|
41
|
+
}, this._placement = new c(this, (e, t, n) => this.#t(e, t, n)), this._drag = new k(this, {
|
|
38
42
|
onDragStart: (e) => {
|
|
39
43
|
if (!this.movable || e.button !== 0 || e.composedPath().some((e) => e instanceof HTMLElement && e.classList.contains("box"))) return null;
|
|
40
44
|
this.#S();
|
|
@@ -47,7 +51,7 @@ var Z = 24, Q = 8, $ = class extends k(l(V)) {
|
|
|
47
51
|
onDragEnd: (e, t) => {
|
|
48
52
|
this.#y(t);
|
|
49
53
|
}
|
|
50
|
-
}), this._resizeState = null, this.#n = this.attachInternals(), this.#r = null, this.#i = new
|
|
54
|
+
}), this._resizeState = null, this.#n = this.attachInternals(), this.#r = null, this.#i = new D(this, () => [[
|
|
51
55
|
document,
|
|
52
56
|
"pointerdown",
|
|
53
57
|
this.#a,
|
|
@@ -61,7 +65,7 @@ var Z = 24, Q = 8, $ = class extends k(l(V)) {
|
|
|
61
65
|
this.#s("finish");
|
|
62
66
|
}, this.#o = (e) => {
|
|
63
67
|
e.key !== "Escape" || !this.#r || (e.preventDefault(), e.stopPropagation(), this.#s("finish"));
|
|
64
|
-
}, this.#f = null, this.#p = new
|
|
68
|
+
}, this.#f = null, this.#p = new D(this, () => [[
|
|
65
69
|
document,
|
|
66
70
|
"keydown",
|
|
67
71
|
this.#m,
|
|
@@ -73,15 +77,15 @@ var Z = 24, Q = 8, $ = class extends k(l(V)) {
|
|
|
73
77
|
static {
|
|
74
78
|
this.styles = [
|
|
75
79
|
f,
|
|
76
|
-
_,
|
|
77
|
-
g,
|
|
78
|
-
E,
|
|
79
|
-
S,
|
|
80
|
-
v,
|
|
81
|
-
y,
|
|
82
80
|
b,
|
|
81
|
+
y,
|
|
82
|
+
g,
|
|
83
|
+
T,
|
|
83
84
|
x,
|
|
84
|
-
|
|
85
|
+
S,
|
|
86
|
+
C,
|
|
87
|
+
w,
|
|
88
|
+
V`
|
|
85
89
|
:host {
|
|
86
90
|
display: block;
|
|
87
91
|
position: relative;
|
|
@@ -354,21 +358,16 @@ var Z = 24, Q = 8, $ = class extends k(l(V)) {
|
|
|
354
358
|
}
|
|
355
359
|
#e;
|
|
356
360
|
willUpdate(e) {
|
|
357
|
-
super.willUpdate(e), this.variant === "utility" && (this._dotsPattern =
|
|
361
|
+
super.willUpdate(e), this.variant === "utility" && (this._dotsPattern = m(this, "--vf-dots-pattern"));
|
|
358
362
|
}
|
|
359
363
|
_dotsTexture() {
|
|
360
|
-
if (this.width == null) return;
|
|
364
|
+
if (!this._dotsPattern || this.width == null) return;
|
|
361
365
|
let e = Math.max(1, this.width - 2);
|
|
362
|
-
|
|
363
|
-
cols: Math.ceil(e /
|
|
366
|
+
return h({
|
|
367
|
+
cols: Math.ceil(e / v),
|
|
364
368
|
rows: 1,
|
|
365
|
-
tile:
|
|
369
|
+
tile: v
|
|
366
370
|
});
|
|
367
|
-
let t = Math.ceil((e + p) / h) * h, n = Q + p;
|
|
368
|
-
return U`<div
|
|
369
|
-
class="vf-tile-raster"
|
|
370
|
-
style="width:${a(t)};height:${a(n)};background-image:${this.#e.for(p, p, m, t, n)}"
|
|
371
|
-
></div>`;
|
|
372
371
|
}
|
|
373
372
|
#t;
|
|
374
373
|
placementAt(e, t, n) {
|
|
@@ -381,7 +380,7 @@ var Z = 24, Q = 8, $ = class extends k(l(V)) {
|
|
|
381
380
|
async show(e = {}) {
|
|
382
381
|
this.#s("finish"), this.hidden = !1;
|
|
383
382
|
let t = e.from;
|
|
384
|
-
if (!t ||
|
|
383
|
+
if (!t || F()) return !1;
|
|
385
384
|
let n = {
|
|
386
385
|
closing: !1,
|
|
387
386
|
animations: []
|
|
@@ -397,7 +396,7 @@ var Z = 24, Q = 8, $ = class extends k(l(V)) {
|
|
|
397
396
|
async hide(e = {}) {
|
|
398
397
|
let t = this.#r?.closing === !1, n = !this.hidden && !t;
|
|
399
398
|
this.#s(t ? "cancel" : "finish");
|
|
400
|
-
let r = e.to, i = r && n && this.isConnected && !
|
|
399
|
+
let r = e.to, i = r && n && this.isConnected && !F() ? this.#u(r, this.getBoundingClientRect(), !0) : null;
|
|
401
400
|
if (this.hidden = !0, !i) return !1;
|
|
402
401
|
let a = {
|
|
403
402
|
closing: !0,
|
|
@@ -440,8 +439,8 @@ var Z = 24, Q = 8, $ = class extends k(l(V)) {
|
|
|
440
439
|
animations: []
|
|
441
440
|
};
|
|
442
441
|
for (let e = 0; e < 14; e++) {
|
|
443
|
-
let t =
|
|
444
|
-
m.position = "absolute", m.left = a(o), m.top = a(s), m.width = a(c), m.height = a(f), m.visibility = "hidden",
|
|
442
|
+
let t = I(e), r = (e, n) => e + Math.trunc((n - e) * t), o = r(l.left, u.left), s = r(l.top, u.top), c = Math.max(1, r(l.right, u.right) - o), f = Math.max(1, r(l.bottom, u.bottom) - s), p = z("window-rect"), m = p.style;
|
|
443
|
+
m.position = "absolute", m.left = a(o), m.top = a(s), m.width = a(c), m.height = a(f), m.visibility = "hidden", L(p, c, f, R(o, s)), i.append(p), d.canvases.push(p);
|
|
445
444
|
let h = n ? 13 - e : e;
|
|
446
445
|
d.animations.push(p.animate([{ visibility: "visible" }, { visibility: "visible" }], {
|
|
447
446
|
delay: h * 17,
|
|
@@ -476,13 +475,13 @@ var Z = 24, Q = 8, $ = class extends k(l(V)) {
|
|
|
476
475
|
#_(e, t, n) {
|
|
477
476
|
let r = e.base.x + t, i = e.base.y + n;
|
|
478
477
|
e.canvas.style.left = a(r), e.canvas.style.top = a(i);
|
|
479
|
-
let o =
|
|
480
|
-
o !== e.phase && (e.phase = o,
|
|
478
|
+
let o = R(r, i);
|
|
479
|
+
o !== e.phase && (e.phase = o, L(e.canvas, e.width, e.height, o));
|
|
481
480
|
}
|
|
482
481
|
#v(e) {
|
|
483
482
|
let t = this.#d();
|
|
484
483
|
if (!t) return null;
|
|
485
|
-
let n = r(this), i = t.getBoundingClientRect(), o = Math.max(1, Math.round(e.width / n)), s = Math.max(1, Math.round(e.height / n)), c =
|
|
484
|
+
let n = r(this), i = t.getBoundingClientRect(), o = Math.max(1, Math.round(e.width / n)), s = Math.max(1, Math.round(e.height / n)), c = z("drag-outline"), l = c.style;
|
|
486
485
|
return l.position = "absolute", l.width = a(o), l.height = a(s), t.append(c), {
|
|
487
486
|
canvas: c,
|
|
488
487
|
base: {
|
|
@@ -555,7 +554,7 @@ var Z = 24, Q = 8, $ = class extends k(l(V)) {
|
|
|
555
554
|
_onGrowPointerMove(e) {
|
|
556
555
|
let t = this._resizeState;
|
|
557
556
|
if (!t || e.pointerId !== t.pointerId) return;
|
|
558
|
-
let n =
|
|
557
|
+
let n = Y(i(t.baseWidth + o(e.clientX - t.startX, this), this), this.minWidth ?? q, this.maxWidth), r = Y(i(t.baseHeight + o(e.clientY - t.startY, this), this), this.minHeight ?? J, this.maxHeight);
|
|
559
558
|
(n !== this.width || r !== this.height) && (t.emitPending = !0, t.resized = !0), this.width = n, this.height = r;
|
|
560
559
|
}
|
|
561
560
|
_onGrowPointerEnd(t) {
|
|
@@ -570,42 +569,42 @@ var Z = 24, Q = 8, $ = class extends k(l(V)) {
|
|
|
570
569
|
});
|
|
571
570
|
}
|
|
572
571
|
render() {
|
|
573
|
-
return
|
|
572
|
+
return H`
|
|
574
573
|
<div
|
|
575
574
|
class="vf-frame vf-snap"
|
|
576
575
|
part="frame"
|
|
577
576
|
role="group"
|
|
578
|
-
aria-labelledby=${this.heading ? "title" :
|
|
577
|
+
aria-labelledby=${this.heading ? "title" : U}
|
|
579
578
|
>
|
|
580
|
-
${
|
|
581
|
-
${this.closable ? N(
|
|
579
|
+
${j(this._drag, H`
|
|
580
|
+
${this.closable ? M(N("Close", this.heading), this._onCloseClick) : U}
|
|
582
581
|
<span class="vf-title" part="title" id="title">${this.heading}</span>
|
|
583
|
-
${this.zoomable ?
|
|
584
|
-
`, this.variant === "utility" ? "vf-dots" : "vf-stripes", this.variant === "utility" ? this._dotsTexture() : void 0)}
|
|
582
|
+
${this.zoomable ? P(N("Zoom", this.heading), this._onZoomClick) : U}
|
|
583
|
+
`, this.variant === "utility" ? this._dotsPattern ? "vf-dots vf-dots-token" : "vf-dots" : "vf-stripes", this.variant === "utility" ? this._dotsTexture() : void 0)}
|
|
585
584
|
<div
|
|
586
585
|
class="header vf-rule-bottom ${this._hasHeader ? "" : "empty"}"
|
|
587
586
|
part="header"
|
|
588
|
-
style=${this.headerHeight == null ?
|
|
587
|
+
style=${this.headerHeight == null ? U : `height:${a(this.headerHeight)}`}
|
|
589
588
|
>
|
|
590
589
|
<slot name="header" @slotchange=${this._onHeaderSlotChange}></slot>
|
|
591
590
|
</div>
|
|
592
591
|
<div class="body" part="body">
|
|
593
|
-
${this.scrollbars ?
|
|
592
|
+
${this.scrollbars ? H`
|
|
594
593
|
<vf-scroll-area
|
|
595
594
|
class="edge-scroll"
|
|
596
595
|
axis=${this.scrollbars}
|
|
597
596
|
?corner=${this.resizable && !this._hasStatus}
|
|
598
|
-
label=${this.heading ||
|
|
597
|
+
label=${this.heading || U}
|
|
599
598
|
exportparts="viewport"
|
|
600
599
|
>
|
|
601
600
|
<slot></slot>
|
|
602
601
|
</vf-scroll-area>
|
|
603
|
-
` :
|
|
602
|
+
` : H`<slot></slot>`}
|
|
604
603
|
</div>
|
|
605
604
|
<div class="status vf-rule-top ${this._hasStatus ? "" : "empty"}" part="status-bar">
|
|
606
605
|
<slot name="status" @slotchange=${this._onStatusSlotChange}></slot>
|
|
607
606
|
</div>
|
|
608
|
-
${this.resizable ?
|
|
607
|
+
${this.resizable ? H`
|
|
609
608
|
<div
|
|
610
609
|
class="grow"
|
|
611
610
|
part="grow-box"
|
|
@@ -615,45 +614,45 @@ var Z = 24, Q = 8, $ = class extends k(l(V)) {
|
|
|
615
614
|
@pointercancel=${this._onGrowPointerEnd}
|
|
616
615
|
@lostpointercapture=${this._onGrowPointerEnd}
|
|
617
616
|
></div>
|
|
618
|
-
` :
|
|
617
|
+
` : U}
|
|
619
618
|
</div>
|
|
620
619
|
`;
|
|
621
620
|
}
|
|
622
621
|
};
|
|
623
|
-
s([
|
|
622
|
+
s([W({ reflect: !0 })], Z.prototype, "variant", void 0), s([W()], Z.prototype, "heading", void 0), s([W({
|
|
624
623
|
type: Boolean,
|
|
625
624
|
reflect: !0
|
|
626
|
-
})],
|
|
625
|
+
})], Z.prototype, "active", void 0), s([W({
|
|
627
626
|
type: Boolean,
|
|
628
627
|
reflect: !0
|
|
629
|
-
})],
|
|
628
|
+
})], Z.prototype, "closable", void 0), s([W({
|
|
630
629
|
type: Boolean,
|
|
631
630
|
reflect: !0
|
|
632
|
-
})],
|
|
631
|
+
})], Z.prototype, "zoomable", void 0), s([W({
|
|
633
632
|
type: Boolean,
|
|
634
633
|
reflect: !0
|
|
635
|
-
})],
|
|
634
|
+
})], Z.prototype, "movable", void 0), s([W({
|
|
636
635
|
type: Boolean,
|
|
637
636
|
reflect: !0,
|
|
638
637
|
attribute: "outline-drag"
|
|
639
|
-
})],
|
|
638
|
+
})], Z.prototype, "outlineDrag", void 0), s([W({
|
|
640
639
|
type: Boolean,
|
|
641
640
|
reflect: !0
|
|
642
|
-
})],
|
|
641
|
+
})], Z.prototype, "resizable", void 0), s([W({
|
|
643
642
|
type: Number,
|
|
644
643
|
attribute: "min-width"
|
|
645
|
-
})],
|
|
644
|
+
})], Z.prototype, "minWidth", void 0), s([W({
|
|
646
645
|
type: Number,
|
|
647
646
|
attribute: "min-height"
|
|
648
|
-
})],
|
|
647
|
+
})], Z.prototype, "minHeight", void 0), s([W({
|
|
649
648
|
type: Number,
|
|
650
649
|
attribute: "max-width"
|
|
651
|
-
})],
|
|
650
|
+
})], Z.prototype, "maxWidth", void 0), s([W({
|
|
652
651
|
type: Number,
|
|
653
652
|
attribute: "max-height"
|
|
654
|
-
})],
|
|
653
|
+
})], Z.prototype, "maxHeight", void 0), s([W({ reflect: !0 })], Z.prototype, "scrollbars", void 0), s([W({
|
|
655
654
|
type: Number,
|
|
656
655
|
attribute: "header-height"
|
|
657
|
-
})],
|
|
656
|
+
})], Z.prototype, "headerHeight", void 0), s([K()], Z.prototype, "_hasHeader", void 0), s([K()], Z.prototype, "_hasStatus", void 0), s([G(".body")], Z.prototype, "body", void 0), s([G("vf-scroll-area")], Z.prototype, "scrollArea", void 0), Z = s([t("vf-window")], Z);
|
|
658
657
|
//#endregion
|
|
659
|
-
export {
|
|
658
|
+
export { Z as VfWindow };
|
package/dist/index.d.ts
CHANGED
|
@@ -102,16 +102,17 @@ export type { TileRect } from './styles/base.js';
|
|
|
102
102
|
export { RULE_EDGES, parseRule, ruleClasses } from './styles/base.js';
|
|
103
103
|
export type { RuleEdge } from './styles/base.js';
|
|
104
104
|
/**
|
|
105
|
-
* The exact tiled fill (
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
105
|
+
* The exact tiled fill (src/tile-grid.ts): a surface's own art as a CSS
|
|
106
|
+
* repeat of one tile drawn at the display's resolution — `repeatTile()` for
|
|
107
|
+
* the image at `devicePxAt()` a box, `vfRepeatTileSize` for its
|
|
108
|
+
* `background-size`, `RepeatTileController` to keep a box's tile current —
|
|
109
|
+
* and a consumer pattern token as a flat grid of absolutely placed tiles
|
|
110
|
+
* (`tileGrid()`, with `vfTileGrid`'s container and tile rules), each box
|
|
111
|
+
* paint-snapped to the device grid on its own. `patternOverride` reads
|
|
112
|
+
* whether a token is in play.
|
|
113
113
|
*/
|
|
114
|
-
export { vfTileGrid, tileGrid, patternOverride,
|
|
114
|
+
export { vfTileGrid, tileGrid, patternOverride, REPEAT_TILE, vfRepeatTileSize, repeatTile, devicePxAt, RepeatTileController, } from './tile-grid.js';
|
|
115
|
+
export type { TileMotif, RepeatTileOptions } from './tile-grid.js';
|
|
115
116
|
/**
|
|
116
117
|
* The standard pattern set — the 38 MacPaint fills as 8-byte QuickDraw
|
|
117
118
|
* patterns (`PATTERNS`, named; `PATTERN_NAMES` in palette order), the
|