vintage-frames 0.4.0 → 0.5.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 +134 -30
- package/dist/components/vf-container.d.ts +37 -3
- package/dist/components/vf-container.js +32 -10
- package/dist/components/vf-desktop.d.ts +52 -19
- package/dist/components/vf-desktop.js +74 -104
- package/dist/components/vf-dialog.d.ts +19 -15
- package/dist/components/vf-dialog.js +45 -53
- package/dist/components/vf-progress-bar.js +3 -3
- package/dist/components/vf-slider.js +11 -11
- package/dist/components/vf-window.js +47 -47
- package/dist/index.d.ts +14 -0
- package/dist/index.js +60 -58
- package/dist/pattern-fill.d.ts +91 -0
- package/dist/pattern-fill.js +74 -0
- package/dist/patterns.d.ts +80 -0
- package/dist/patterns.js +477 -0
- package/dist/scroll-rail.js +37 -37
- package/dist/styles/recipes/pattern.d.ts +2 -12
- package/dist/styles/recipes/pattern.js +11 -15
- package/dist/styles/recipes/scroll-rail.d.ts +3 -12
- package/dist/styles/recipes/scroll-rail.js +7 -15
- package/dist/styles/recipes/surface.d.ts +18 -7
- package/dist/styles/recipes/surface.js +15 -0
- package/dist/tile-grid.d.ts +4 -2
- package/dist/tile-grid.js +3 -3
- package/dist/track-width.d.ts +7 -0
- package/dist/track-width.js +6 -3
- package/docs/SPEC.md +11 -9
- package/editor/vscode.html-custom-data.json +14 -4
- package/editor/web-types.json +29 -6
- package/package.json +2 -1
package/custom-elements.json
CHANGED
|
@@ -1974,7 +1974,7 @@
|
|
|
1974
1974
|
"declarations": [
|
|
1975
1975
|
{
|
|
1976
1976
|
"kind": "class",
|
|
1977
|
-
"description": "`<vf-container>` — a box that is nothing but its declared size.\n\nThe kit's positioned-placement story (src/position.ts) ends with one line of\nCSS it can't write for you: children placed with `top`/`left` need a\npositioned ancestor, and while every kit container is one — a window body, a\nstack, a fieldset — a region of *your own* needs `position: relative` in a\nstylesheet. This component is that region as an element: declare `width` and\n`height` in whole system px, slot anything into it, place children against\nits origin. A DITL's enclosing rectangle, with nothing drawn in it.\n\n```html\n<vf-container width=\"200\" height=\"120\">\n <vf-icon label=\"System\" width=\"64\" top=\"8\" left=\"12\">…</vf-icon>\n <vf-icon label=\"Finder\" width=\"64\" top=\"8\" left=\"104\">…</vf-icon>\n</vf-container>\n```\n\nThe rectangle is the whole API — `width`/`height` here, plus the `top`/`left`\npair nearly every component takes (VfPositioned), so a container is\nitself placeable: inside a window, a desktop, or another container, at whole\nsystem px that keep its box on the device-pixel grid by construction.\n\n**It is not a `vf-stack`.** The stack is a flexbox with opinions — it\ndistributes children along an axis, compiles `fill-width`/`fill-height` into\nflex, defaults a cross-axis alignment. This box has no layout opinion at\nall: in-flow children get normal flow, placed children get a coordinate\nsystem, and that is the whole API. Reach for it when the stack's opinions\nare the thing in the way — a field of placed icons, a fixed stage for\nabsolutely-positioned art, a consumer's own composition that brings its\nlayout with it.\n\n**The declared size is the layout.** `width`/`height` land on the host as a\nlive `calc(var(--vf-scale, 1) * Npx)` (VfSized), so the box scales\nwith the display and sits on the device-pixel grid by construction. Content\nthat outgrows the box overflows it rather than growing it — the number is\nthe layout, and content that doesn't fit is a number to raise. Leave a\ndimension off and that axis shrink-wraps: `fit-content`, not the parent's\nwidth, because a layout box that silently claimed a size nobody declared\nwould be inventing one (the `vf-stack` rule, held here too).\n\n**It paints nothing and means nothing
|
|
1977
|
+
"description": "`<vf-container>` — a box that is nothing but its declared size.\n\nThe kit's positioned-placement story (src/position.ts) ends with one line of\nCSS it can't write for you: children placed with `top`/`left` need a\npositioned ancestor, and while every kit container is one — a window body, a\nstack, a fieldset — a region of *your own* needs `position: relative` in a\nstylesheet. This component is that region as an element: declare `width` and\n`height` in whole system px, slot anything into it, place children against\nits origin. A DITL's enclosing rectangle, with nothing drawn in it.\n\n```html\n<vf-container width=\"200\" height=\"120\">\n <vf-icon label=\"System\" width=\"64\" top=\"8\" left=\"12\">…</vf-icon>\n <vf-icon label=\"Finder\" width=\"64\" top=\"8\" left=\"104\">…</vf-icon>\n</vf-container>\n```\n\nThe rectangle is the whole API — `width`/`height` here, plus the `top`/`left`\npair nearly every component takes (VfPositioned), so a container is\nitself placeable: inside a window, a desktop, or another container, at whole\nsystem px that keep its box on the device-pixel grid by construction.\n\n**It is not a `vf-stack`.** The stack is a flexbox with opinions — it\ndistributes children along an axis, compiles `fill-width`/`fill-height` into\nflex, defaults a cross-axis alignment. This box has no layout opinion at\nall: in-flow children get normal flow, placed children get a coordinate\nsystem, and that is the whole API. Reach for it when the stack's opinions\nare the thing in the way — a field of placed icons, a fixed stage for\nabsolutely-positioned art, a consumer's own composition that brings its\nlayout with it.\n\n**The declared size is the layout.** `width`/`height` land on the host as a\nlive `calc(var(--vf-scale, 1) * Npx)` (VfSized), so the box scales\nwith the display and sits on the device-pixel grid by construction. Content\nthat outgrows the box overflows it rather than growing it — the number is\nthe layout, and content that doesn't fit is a number to raise. Leave a\ndimension off and that axis shrink-wraps: `fit-content`, not the parent's\nwidth, because a layout box that silently claimed a size nobody declared\nwould be inventing one (the `vf-stack` rule, held here too).\n\n**It paints nothing and means nothing** — unless `pattern` says what to\npaint. No border, role, keyboard behavior or selection; what it holds\ndecides what it is.\n\n**`pattern` fills the box with a 1-bit pattern**: one of the 38 standard\nMacPaint patterns by name (`pattern=\"bricks\"`, `pattern=\"gray-50\"` —\ndocs/PATTERNS.md has the table), or sixteen hex digits stating a custom\n8×8 pattern row by row, the way a PAT resource did. It is painted as the\nbox's own background — black ink on a `--vf-white` ground, anchored at\nthe box's top-left corner, under the content — by the same whole-surface\nraster mechanism as the desktop dither, so it is 1-bit at every density\nand zoom (src/pattern-fill.ts). A declared `width`/`height` sizes the\nraster exactly; an undeclared axis (`fill-width`, a shrink-wrapped\nheight) is measured. Under forced colors the pattern goes flat Canvas.\n\n**It holds its box on the device-pixel grid** — with a `GridSnapController`.\nA container's box is itself the consumer's coordinate system, including for\nnon-`vf` content that cannot correct itself, so the box is the thing to\nhold on the grid. The shadow box below owns the `position: relative` anchor\nand the `vf-snap` class together, so the correction\nmoves the whole coordinate system — everything placed against it rides\nalong instead of being re-corrected child by child. (`vf-stack` shipped\nwithout a controller on the theory that slotted `vf-*` children correct\ntheir own origins; this component is where that theory's gap — consumer\ncontent — became visible, and the stack has since adopted the same\narrangement.)\n\nLike the stack it is **typographically transparent**: `vfBase`'s chrome\ndress is returned to `inherit` on the host, so wrapping content in a sized\nbox changes nothing about how that content reads.\n\n`fill-width` / `fill-height` work here the way they do everywhere: read\nabout the host (be as big as *its* parent allows), and compiled for slotted\nchildren — `width: 100%` in normal flow, so a child filling the cross of a\ndeclared box needs no stylesheet. A height fill needs a declared `height`\nto resolve against; with none it is inert, not an error.",
|
|
1978
1978
|
"name": "VfContainer",
|
|
1979
1979
|
"slots": [
|
|
1980
1980
|
{
|
|
@@ -1983,6 +1983,45 @@
|
|
|
1983
1983
|
}
|
|
1984
1984
|
],
|
|
1985
1985
|
"members": [
|
|
1986
|
+
{
|
|
1987
|
+
"kind": "field",
|
|
1988
|
+
"name": "pattern",
|
|
1989
|
+
"type": {
|
|
1990
|
+
"text": "string | null | undefined"
|
|
1991
|
+
},
|
|
1992
|
+
"description": "A 1-bit fill for the box: a library pattern by name (`bricks`,\n`gray-50`, … — the 38 standard MacPaint patterns, docs/PATTERNS.md) or\nsixteen hex digits stating a custom 8×8 pattern row by row, bit 7 the\nleftmost pixel, 1 = ink (`\"DD 77 DD 77 DD 77 DD 77\"`). Painted in black\non a `--vf-white` ground under the content, anchored at the box's\ntop-left. Unset, the container paints nothing; an unrecognized value\npaints nothing and warns once.",
|
|
1993
|
+
"attribute": "pattern"
|
|
1994
|
+
},
|
|
1995
|
+
{
|
|
1996
|
+
"kind": "field",
|
|
1997
|
+
"name": "_pattern",
|
|
1998
|
+
"type": {
|
|
1999
|
+
"text": "Pattern | null"
|
|
2000
|
+
},
|
|
2001
|
+
"privacy": "private",
|
|
2002
|
+
"default": "null",
|
|
2003
|
+
"description": "`pattern`, resolved — what the fill paints; null paints nothing."
|
|
2004
|
+
},
|
|
2005
|
+
{
|
|
2006
|
+
"kind": "field",
|
|
2007
|
+
"name": "#warnedPattern",
|
|
2008
|
+
"privacy": "private",
|
|
2009
|
+
"type": {
|
|
2010
|
+
"text": "boolean"
|
|
2011
|
+
},
|
|
2012
|
+
"default": "false",
|
|
2013
|
+
"description": "One warning per element for an unrecognized `pattern`, not per render."
|
|
2014
|
+
},
|
|
2015
|
+
{
|
|
2016
|
+
"kind": "field",
|
|
2017
|
+
"name": "box",
|
|
2018
|
+
"type": {
|
|
2019
|
+
"text": "HTMLDivElement"
|
|
2020
|
+
},
|
|
2021
|
+
"privacy": "private",
|
|
2022
|
+
"readonly": true,
|
|
2023
|
+
"description": "The shadow box the fill paints on; exists from the first render."
|
|
2024
|
+
},
|
|
1986
2025
|
{
|
|
1987
2026
|
"kind": "field",
|
|
1988
2027
|
"name": "scale",
|
|
@@ -1999,6 +2038,14 @@
|
|
|
1999
2038
|
"default": "new GridSnapController(this)",
|
|
2000
2039
|
"description": "Hold the box on the device-pixel grid — see the\nclass doc. The host is what gets measured; `.box` (vf-snap) is where the\ncorrection lands."
|
|
2001
2040
|
},
|
|
2041
|
+
{
|
|
2042
|
+
"kind": "field",
|
|
2043
|
+
"name": "patternFill",
|
|
2044
|
+
"privacy": "private",
|
|
2045
|
+
"readonly": true,
|
|
2046
|
+
"default": "new PatternFillController(this, { getBox: () => this.box, getPattern: () => this._pattern, getSize: () => ({ width: this.width, height: this.height }), })",
|
|
2047
|
+
"description": "The pattern fill, painted on `.box` so it rides the snap correction with\nthe coordinate system. A declared axis sizes the raster exactly; an\nundeclared one is measured (src/pattern-fill.ts)."
|
|
2048
|
+
},
|
|
2002
2049
|
{
|
|
2003
2050
|
"kind": "field",
|
|
2004
2051
|
"name": "width",
|
|
@@ -2052,23 +2099,15 @@
|
|
|
2052
2099
|
}
|
|
2053
2100
|
}
|
|
2054
2101
|
],
|
|
2055
|
-
"
|
|
2102
|
+
"attributes": [
|
|
2056
2103
|
{
|
|
2057
|
-
"name": "
|
|
2058
|
-
"
|
|
2104
|
+
"name": "pattern",
|
|
2105
|
+
"type": {
|
|
2106
|
+
"text": "string | null | undefined"
|
|
2107
|
+
},
|
|
2108
|
+
"description": "A 1-bit fill for the box: a library pattern by name (`bricks`,\n`gray-50`, … — the 38 standard MacPaint patterns, docs/PATTERNS.md) or\nsixteen hex digits stating a custom 8×8 pattern row by row, bit 7 the\nleftmost pixel, 1 = ink (`\"DD 77 DD 77 DD 77 DD 77\"`). Painted in black\non a `--vf-white` ground under the content, anchored at the box's\ntop-left. Unset, the container paints nothing; an unrecognized value\npaints nothing and warns once.",
|
|
2109
|
+
"fieldName": "pattern"
|
|
2059
2110
|
},
|
|
2060
|
-
{
|
|
2061
|
-
"name": "VfPositioned",
|
|
2062
|
-
"module": "/src/position.js"
|
|
2063
|
-
}
|
|
2064
|
-
],
|
|
2065
|
-
"superclass": {
|
|
2066
|
-
"name": "LitElement",
|
|
2067
|
-
"package": "lit"
|
|
2068
|
-
},
|
|
2069
|
-
"tagName": "vf-container",
|
|
2070
|
-
"customElement": true,
|
|
2071
|
-
"attributes": [
|
|
2072
2111
|
{
|
|
2073
2112
|
"name": "width",
|
|
2074
2113
|
"type": {
|
|
@@ -2117,7 +2156,23 @@
|
|
|
2117
2156
|
"module": "src/position.ts"
|
|
2118
2157
|
}
|
|
2119
2158
|
}
|
|
2120
|
-
]
|
|
2159
|
+
],
|
|
2160
|
+
"mixins": [
|
|
2161
|
+
{
|
|
2162
|
+
"name": "VfSized",
|
|
2163
|
+
"module": "/src/size.js"
|
|
2164
|
+
},
|
|
2165
|
+
{
|
|
2166
|
+
"name": "VfPositioned",
|
|
2167
|
+
"module": "/src/position.js"
|
|
2168
|
+
}
|
|
2169
|
+
],
|
|
2170
|
+
"superclass": {
|
|
2171
|
+
"name": "LitElement",
|
|
2172
|
+
"package": "lit"
|
|
2173
|
+
},
|
|
2174
|
+
"tagName": "vf-container",
|
|
2175
|
+
"customElement": true
|
|
2121
2176
|
}
|
|
2122
2177
|
],
|
|
2123
2178
|
"exports": [
|
|
@@ -2145,22 +2200,22 @@
|
|
|
2145
2200
|
"declarations": [
|
|
2146
2201
|
{
|
|
2147
2202
|
"kind": "class",
|
|
2148
|
-
"description": "`<vf-desktop>` — the full-bleed classic desktop container.\n\nRenders the 50
|
|
2203
|
+
"description": "`<vf-desktop>` — the full-bleed classic desktop container.\n\nRenders the desktop pattern — the classic 50% dither by default, or any of\nthe standard patterns by name (`pattern`, System 7's General Controls\nsetting) — and manages the stacking order and `active` state of slotted\n`vf-window` children: a `pointerdown` or\n`focusin` (keyboard focus) anywhere inside a window brings it to the front\nand makes it the single active window. The windows' light-DOM order is kept\nin step with the stacking order (bottom-most first, at pointer-gesture\nends), so tabbing walks the stack the way the eye does and Shift+Tab is\nits exact mirror.\n\nUtility windows (`vf-window[variant=\"utility\"]`) stack in a floating tier\nabove every document-tier window, restack only among themselves, and stand\noutside the single-active invariant entirely — clicking a palette neither\ndeactivates the active document window nor greys the palette, exactly as\nSystem 7's floating windoids behaved while their application was frontmost.\n\n**Deactivation.** On a real System 7 machine clicking the desktop clicked\nthe *Finder* — the frontmost application's windows lost their stripes.\nclearActive is that gesture's handler: it clears `active` from\nthe whole document tier, and **zero active windows is a legal state**,\nheld until a press or keyboard focus re-enters a document window (or a\nnew one is slotted, which activates it — opening a window brings its\napplication forward). The desktop never takes this decision itself: its\nfurniture is slotted light DOM (an icon layer, say), so only the page\nknows which of its children — or which presses on the bare dither — mean\n\"the Finder\", and it routes those through `clearActive()`. Left alone,\nthe classic always-one-active behavior is unchanged. activeWindow\nreads the current holder, and every change of holder — including to and\nfrom none — fires `vf-activate`.\n\nThe desktop is a raster with an explicit size, always: **`width` and\n`height`**, in system px, the way a WIND resource declared a window's —\nthe host box renders at the declared screen plus `2 × bezel` per axis, a\nwhole number of system pixels by construction (default 512×342, the\ncompact Mac's screen). Pure CSS sizing is not supported; the page sets\nthe numbers — directly, or via VfDesktop.fitWithin on\n`resize`/`onScaleChange` for a viewport-filling desktop — and positions\nthe sized box with its own stylesheet, keeping any sub-system-pixel\nslack on its side. `bezel` (system px) draws the black screen surround —\nthe CRT's unlit margin — around the screen, rounding its top corners\nwith the classic corner mask.\n\n**`pattern`** names the desktop pattern — `gray-50` (the dither) by\ndefault, any of the 38 standard patterns (docs/PATTERNS.md), or sixteen\nhex digits stating a custom 8×8 pattern, as on `vf-container`. It is\npainted as the screen's own background: black ink on an opaque white\npaper, one whole-surface raster at one image px per system px, 1-bit at\nevery density and zoom (src/pattern-fill.ts).\n\nCustom properties:\n- `--vf-desktop-pattern` — a consumer's own tile art in place of the\n pattern (the kit's default is a 1-bit 50% checker, opaque\n black-on-white on a 30-system-px tile). Set, it wins over `pattern` and\n renders as a placed tile grid at that same 30-px geometry\n (src/tile-grid.ts); a token swapped at runtime without touching the\n component wants a `requestUpdate()`.\n- `--vf-desktop` — base color painted *under* the pattern (default\n `#808080`). The pattern's paper is opaque, so this only becomes visible\n when `--vf-desktop-pattern` is overridden with a tile that has\n transparent cells (or with `none`).",
|
|
2149
2204
|
"name": "VfDesktop",
|
|
2150
2205
|
"cssProperties": [
|
|
2151
2206
|
{
|
|
2152
|
-
"description": "base color under the desktop
|
|
2207
|
+
"description": "base color under the desktop pattern — occluded by the pattern's opaque paper, so it only shows through a custom `--vf-desktop-pattern`",
|
|
2153
2208
|
"name": "--vf-desktop",
|
|
2154
2209
|
"default": "#808080"
|
|
2155
2210
|
},
|
|
2156
2211
|
{
|
|
2157
|
-
"description": "
|
|
2212
|
+
"description": "a consumer's own desktop tile, in place of `pattern` — the kit's default is the 50% checker drawn as opaque black-on-white rects on a 30-system-px tile. Override the whole tile; consumer art renders as a placed tile grid at that same geometry (raster art magnifies nearest-neighbor, the `vf-img` idiom)",
|
|
2158
2213
|
"name": "--vf-desktop-pattern"
|
|
2159
2214
|
}
|
|
2160
2215
|
],
|
|
2161
2216
|
"cssParts": [
|
|
2162
2217
|
{
|
|
2163
|
-
"description": "The
|
|
2218
|
+
"description": "The patterned screen surface — the whole-system-px raster (inset by `bezel` when one is set).",
|
|
2164
2219
|
"name": "desktop"
|
|
2165
2220
|
}
|
|
2166
2221
|
],
|
|
@@ -2201,6 +2256,16 @@
|
|
|
2201
2256
|
"description": "Width of the black screen bezel, in system px (`0` = none), added onto\nthe declared screen on every side — a `width=\"502\" bezel=\"5\"` desktop\nrenders a 512-system-px host box. The compact Mac's CRT showed an\nunlit black margin between the desktop's raster and the case; `bezel`\ndraws it around the screen and puts the classic screen-corner mask on\nthe screen's two *top* corners — only the top pair was rounded in the\nframebuffer. Flow, window coordinates and the drag clip all belong to\nthe screen, so windows crop at its edge. Inside a bezeled desktop a\nmenu bar needs no `rounded` of its own — the desktop's mask lands on\nthe same pixels.",
|
|
2202
2257
|
"attribute": "bezel"
|
|
2203
2258
|
},
|
|
2259
|
+
{
|
|
2260
|
+
"kind": "field",
|
|
2261
|
+
"name": "pattern",
|
|
2262
|
+
"type": {
|
|
2263
|
+
"text": "string | null | undefined"
|
|
2264
|
+
},
|
|
2265
|
+
"default": "'gray-50'",
|
|
2266
|
+
"description": "The desktop pattern — System 7's General Controls setting. A library\npattern by name (`gray-50`, the classic dither, by default; `gray-75`,\n`bricks`, … — docs/PATTERNS.md) or sixteen hex digits stating a custom\n8×8 pattern, as on `vf-container`. Painted black on opaque white over\nthe whole screen, 1-bit at every density and zoom. A\n`--vf-desktop-pattern` token override still wins and renders the\nconsumer's tile as a placed grid; an unrecognized value warns once and\nkeeps the dither.",
|
|
2267
|
+
"attribute": "pattern"
|
|
2268
|
+
},
|
|
2204
2269
|
{
|
|
2205
2270
|
"kind": "method",
|
|
2206
2271
|
"name": "fitWithin",
|
|
@@ -2252,21 +2317,51 @@
|
|
|
2252
2317
|
},
|
|
2253
2318
|
{
|
|
2254
2319
|
"kind": "field",
|
|
2255
|
-
"name": "
|
|
2320
|
+
"name": "_token",
|
|
2256
2321
|
"type": {
|
|
2257
2322
|
"text": "string"
|
|
2258
2323
|
},
|
|
2259
2324
|
"privacy": "private",
|
|
2260
2325
|
"default": "''",
|
|
2261
|
-
"description": "The consumer's `--vf-desktop-pattern` override, or `''` for the kit\
|
|
2326
|
+
"description": "The consumer's `--vf-desktop-pattern` override, or `''` for the kit\npattern — which of the two exact-fill paths render() takes (see\nsrc/tile-grid.ts). Re-read every update; a token swapped at runtime\nwithout touching the component wants a `requestUpdate()`."
|
|
2262
2327
|
},
|
|
2263
2328
|
{
|
|
2264
2329
|
"kind": "field",
|
|
2265
|
-
"name": "
|
|
2330
|
+
"name": "_desktopPattern",
|
|
2331
|
+
"type": {
|
|
2332
|
+
"text": "Pattern"
|
|
2333
|
+
},
|
|
2334
|
+
"privacy": "private",
|
|
2335
|
+
"default": "PATTERNS[DEFAULT_PATTERN]",
|
|
2336
|
+
"description": "`pattern`, resolved — the kit path's art; the dither when unset."
|
|
2337
|
+
},
|
|
2338
|
+
{
|
|
2339
|
+
"kind": "field",
|
|
2340
|
+
"name": "#warnedPattern",
|
|
2341
|
+
"privacy": "private",
|
|
2342
|
+
"type": {
|
|
2343
|
+
"text": "boolean"
|
|
2344
|
+
},
|
|
2345
|
+
"default": "false",
|
|
2346
|
+
"description": "One warning per element for an unrecognized `pattern`, not per render."
|
|
2347
|
+
},
|
|
2348
|
+
{
|
|
2349
|
+
"kind": "field",
|
|
2350
|
+
"name": "screen",
|
|
2351
|
+
"type": {
|
|
2352
|
+
"text": "HTMLDivElement"
|
|
2353
|
+
},
|
|
2266
2354
|
"privacy": "private",
|
|
2267
2355
|
"readonly": true,
|
|
2268
|
-
"
|
|
2269
|
-
|
|
2356
|
+
"description": "The screen surface the pattern paints on; exists from the first render."
|
|
2357
|
+
},
|
|
2358
|
+
{
|
|
2359
|
+
"kind": "field",
|
|
2360
|
+
"name": "patternFill",
|
|
2361
|
+
"privacy": "private",
|
|
2362
|
+
"readonly": true,
|
|
2363
|
+
"default": "new PatternFillController(this, { getBox: () => this.screen, getPattern: () => (this._token ? null : this._desktopPattern), getSize: () => ({ width: this.width ?? DEFAULT_SCREEN_WIDTH, height: this.height ?? DEFAULT_SCREEN_HEIGHT, }), })",
|
|
2364
|
+
"description": "The desktop pattern, painted as the screen's own background\n(src/pattern-fill.ts) from the declared raster — scale-independent, so\ndensity and zoom re-encode nothing — and silent while a consumer token\nowns the fill."
|
|
2270
2365
|
},
|
|
2271
2366
|
{
|
|
2272
2367
|
"kind": "field",
|
|
@@ -2640,6 +2735,15 @@
|
|
|
2640
2735
|
"description": "Width of the black screen bezel, in system px (`0` = none), added onto\nthe declared screen on every side — a `width=\"502\" bezel=\"5\"` desktop\nrenders a 512-system-px host box. The compact Mac's CRT showed an\nunlit black margin between the desktop's raster and the case; `bezel`\ndraws it around the screen and puts the classic screen-corner mask on\nthe screen's two *top* corners — only the top pair was rounded in the\nframebuffer. Flow, window coordinates and the drag clip all belong to\nthe screen, so windows crop at its edge. Inside a bezeled desktop a\nmenu bar needs no `rounded` of its own — the desktop's mask lands on\nthe same pixels.",
|
|
2641
2736
|
"fieldName": "bezel"
|
|
2642
2737
|
},
|
|
2738
|
+
{
|
|
2739
|
+
"name": "pattern",
|
|
2740
|
+
"type": {
|
|
2741
|
+
"text": "string | null | undefined"
|
|
2742
|
+
},
|
|
2743
|
+
"default": "DEFAULT_PATTERN",
|
|
2744
|
+
"description": "The desktop pattern — System 7's General Controls setting. A library\npattern by name (`gray-50`, the classic dither, by default; `gray-75`,\n`bricks`, … — docs/PATTERNS.md) or sixteen hex digits stating a custom\n8×8 pattern, as on `vf-container`. Painted black on opaque white over\nthe whole screen, 1-bit at every density and zoom. A\n`--vf-desktop-pattern` token override still wins and renders the\nconsumer's tile as a placed grid; an unrecognized value warns once and\nkeeps the dither.",
|
|
2745
|
+
"fieldName": "pattern"
|
|
2746
|
+
},
|
|
2643
2747
|
{
|
|
2644
2748
|
"name": "top",
|
|
2645
2749
|
"type": {
|
|
@@ -2704,7 +2808,7 @@
|
|
|
2704
2808
|
"declarations": [
|
|
2705
2809
|
{
|
|
2706
2810
|
"kind": "class",
|
|
2707
|
-
"description": "`<vf-dialog>` — the System 7 modal dialog shell.\n\nTwo chromes, one modal lifecycle (native `<dialog>` for top-layer rendering\nand focus trapping, with a fully transparent backdrop — no dimming):\n\n- **Default:**
|
|
2811
|
+
"description": "`<vf-dialog>` — the System 7 modal dialog shell.\n\nTwo chromes, one modal lifecycle (native `<dialog>` for top-layer rendering\nand focus trapping, with a fully transparent backdrop — no dimming). Both\nare the same dBoxProc double frame — 1px outer rule, 2px gap, 2px inner\nband, no shadow (vfModalFrame):\n\n- **Default:** the movable modal (movableDBoxProc) — the striped title bar\n set into the top of that frame, with a centered title over a white body.\n Drag the title bar to move it. `closable` adds the standard close box\n (left of the bar) — the HIG's own figures disagree on whether a movable\n modal carries one (Figure 5-1 says yes, Figure 6-1 and the Chapter 6 text\n say no), so the component enables either reading rather than enforcing\n one.\n- **`frame=\"plain\"`:** the modal dialog box — the bare frame, no title bar —\n and immovable, like the original. A `heading` renders as a centered\n display-face heading at the top of the body (the reference art's \"Dialog\n title\"); `closable` is ignored, there being no bar to carry the widget.\n\nOpen it with `show()` (or set the `open` attribute/property); close with\n`close()`. Escape closes it and fires `vf-close` with\n`{ reason: 'escape' }`; the close box and programmatic closing fire\n`{ reason: 'close' }`.",
|
|
2708
2812
|
"name": "VfDialog",
|
|
2709
2813
|
"cssProperties": [
|
|
2710
2814
|
{
|
|
@@ -2726,7 +2830,7 @@
|
|
|
2726
2830
|
],
|
|
2727
2831
|
"cssParts": [
|
|
2728
2832
|
{
|
|
2729
|
-
"description": "The outer
|
|
2833
|
+
"description": "The outer frame (the double frame's 1px rule; the bar and the inner band sit inside it).",
|
|
2730
2834
|
"name": "frame"
|
|
2731
2835
|
},
|
|
2732
2836
|
{
|
|
@@ -2822,7 +2926,7 @@
|
|
|
2822
2926
|
"type": {
|
|
2823
2927
|
"text": "'plain' | undefined"
|
|
2824
2928
|
},
|
|
2825
|
-
"description": "Frame chrome. Omit for the
|
|
2929
|
+
"description": "Frame chrome. Omit for the movable modal (the double frame with the\nstriped title bar set into it); `'plain'` for the immovable modal dialog\nbox (the bare double frame, no bar).",
|
|
2826
2930
|
"attribute": "frame",
|
|
2827
2931
|
"reflects": true
|
|
2828
2932
|
},
|
|
@@ -3377,7 +3481,7 @@
|
|
|
3377
3481
|
"type": {
|
|
3378
3482
|
"text": "'plain' | undefined"
|
|
3379
3483
|
},
|
|
3380
|
-
"description": "Frame chrome. Omit for the
|
|
3484
|
+
"description": "Frame chrome. Omit for the movable modal (the double frame with the\nstriped title bar set into it); `'plain'` for the immovable modal dialog\nbox (the bare double frame, no bar).",
|
|
3381
3485
|
"fieldName": "frame"
|
|
3382
3486
|
},
|
|
3383
3487
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
1
|
+
import { LitElement, type PropertyValues } from 'lit';
|
|
2
2
|
declare const VfContainer_base: (new (...args: any[]) => import("../size.js").VfSizedInterface) & (new (...args: any[]) => import("../position.js").VfPositionedInterface) & typeof LitElement;
|
|
3
3
|
/**
|
|
4
4
|
* `<vf-container>` — a box that is nothing but its declared size.
|
|
@@ -41,8 +41,20 @@ declare const VfContainer_base: (new (...args: any[]) => import("../size.js").Vf
|
|
|
41
41
|
* width, because a layout box that silently claimed a size nobody declared
|
|
42
42
|
* would be inventing one (the `vf-stack` rule, held here too).
|
|
43
43
|
*
|
|
44
|
-
* **It paints nothing and means nothing
|
|
45
|
-
* keyboard behavior or selection
|
|
44
|
+
* **It paints nothing and means nothing** — unless `pattern` says what to
|
|
45
|
+
* paint. No border, role, keyboard behavior or selection; what it holds
|
|
46
|
+
* decides what it is.
|
|
47
|
+
*
|
|
48
|
+
* **`pattern` fills the box with a 1-bit pattern**: one of the 38 standard
|
|
49
|
+
* MacPaint patterns by name (`pattern="bricks"`, `pattern="gray-50"` —
|
|
50
|
+
* docs/PATTERNS.md has the table), or sixteen hex digits stating a custom
|
|
51
|
+
* 8×8 pattern row by row, the way a PAT resource did. It is painted as the
|
|
52
|
+
* box's own background — black ink on a `--vf-white` ground, anchored at
|
|
53
|
+
* the box's top-left corner, under the content — by the same whole-surface
|
|
54
|
+
* raster mechanism as the desktop dither, so it is 1-bit at every density
|
|
55
|
+
* and zoom (src/pattern-fill.ts). A declared `width`/`height` sizes the
|
|
56
|
+
* raster exactly; an undeclared axis (`fill-width`, a shrink-wrapped
|
|
57
|
+
* height) is measured. Under forced colors the pattern goes flat Canvas.
|
|
46
58
|
*
|
|
47
59
|
* **It holds its box on the device-pixel grid** — with a `GridSnapController`.
|
|
48
60
|
* A container's box is itself the consumer's coordinate system, including for
|
|
@@ -71,7 +83,22 @@ declare const VfContainer_base: (new (...args: any[]) => import("../size.js").Vf
|
|
|
71
83
|
* fills it to the declared box.
|
|
72
84
|
*/
|
|
73
85
|
export declare class VfContainer extends VfContainer_base {
|
|
86
|
+
#private;
|
|
74
87
|
static styles: import("lit").CSSResult[];
|
|
88
|
+
/**
|
|
89
|
+
* A 1-bit fill for the box: a library pattern by name (`bricks`,
|
|
90
|
+
* `gray-50`, … — the 38 standard MacPaint patterns, docs/PATTERNS.md) or
|
|
91
|
+
* sixteen hex digits stating a custom 8×8 pattern row by row, bit 7 the
|
|
92
|
+
* leftmost pixel, 1 = ink (`"DD 77 DD 77 DD 77 DD 77"`). Painted in black
|
|
93
|
+
* on a `--vf-white` ground under the content, anchored at the box's
|
|
94
|
+
* top-left. Unset, the container paints nothing; an unrecognized value
|
|
95
|
+
* paints nothing and warns once.
|
|
96
|
+
*/
|
|
97
|
+
pattern?: string | null;
|
|
98
|
+
/** `pattern`, resolved — what the fill paints; null paints nothing. */
|
|
99
|
+
private _pattern;
|
|
100
|
+
/** The shadow box the fill paints on; exists from the first render. */
|
|
101
|
+
private readonly box;
|
|
75
102
|
/**
|
|
76
103
|
* Default-on display scaling (true 72dpi size); see src/scale.ts. Without
|
|
77
104
|
* one, a lone container on a plain page would resolve its declared size
|
|
@@ -85,6 +112,13 @@ export declare class VfContainer extends VfContainer_base {
|
|
|
85
112
|
* correction lands.
|
|
86
113
|
*/
|
|
87
114
|
private readonly gridSnap;
|
|
115
|
+
/**
|
|
116
|
+
* The pattern fill, painted on `.box` so it rides the snap correction with
|
|
117
|
+
* the coordinate system. A declared axis sizes the raster exactly; an
|
|
118
|
+
* undeclared one is measured (src/pattern-fill.ts).
|
|
119
|
+
*/
|
|
120
|
+
private readonly patternFill;
|
|
121
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
88
122
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
89
123
|
}
|
|
90
124
|
declare global {
|
|
@@ -3,16 +3,29 @@ import { ScaleController as t } from "../scale.js";
|
|
|
3
3
|
import n from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
4
4
|
import { VfPositioned as r } from "../position.js";
|
|
5
5
|
import { vfBase as i } from "../styles/recipes/host.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { parsePattern as a } from "../patterns.js";
|
|
7
|
+
import { PatternFillController as o, vfPatternFill as s } from "../pattern-fill.js";
|
|
8
|
+
import { GridSnapController as c } from "../grid-snap.js";
|
|
9
|
+
import { VfSized as l } from "../size.js";
|
|
10
|
+
import { LitElement as u, css as d, html as f } from "lit";
|
|
11
|
+
import { property as p, query as m } from "lit/decorators.js";
|
|
9
12
|
//#region src/components/vf-container.ts
|
|
10
|
-
var
|
|
13
|
+
var h = class extends l(r(u)) {
|
|
11
14
|
constructor(...e) {
|
|
12
|
-
super(...e), this.scale = new t(this), this.gridSnap = new
|
|
15
|
+
super(...e), this._pattern = null, this.#e = !1, this.scale = new t(this), this.gridSnap = new c(this), this.patternFill = new o(this, {
|
|
16
|
+
getBox: () => this.box,
|
|
17
|
+
getPattern: () => this._pattern,
|
|
18
|
+
getSize: () => ({
|
|
19
|
+
width: this.width,
|
|
20
|
+
height: this.height
|
|
21
|
+
})
|
|
22
|
+
});
|
|
13
23
|
}
|
|
14
24
|
static {
|
|
15
|
-
this.styles = [
|
|
25
|
+
this.styles = [
|
|
26
|
+
i,
|
|
27
|
+
s,
|
|
28
|
+
d`
|
|
16
29
|
:host {
|
|
17
30
|
display: block;
|
|
18
31
|
/* Shrink-wrap an undeclared axis rather than claim the parent's
|
|
@@ -75,12 +88,21 @@ var u = class extends o(r(s)) {
|
|
|
75
88
|
::slotted([fill-height]) {
|
|
76
89
|
height: 100%;
|
|
77
90
|
}
|
|
78
|
-
`
|
|
91
|
+
`
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
#e;
|
|
95
|
+
willUpdate(e) {
|
|
96
|
+
super.willUpdate(e), e.has("pattern") && (this._pattern = a(this.pattern), this._pattern === null && this.pattern?.trim() && !this.#e && (this.#e = !0, console.warn(`vf-container: unknown pattern "${this.pattern}" — a library name (docs/PATTERNS.md) or sixteen hex digits. Painting nothing.`)));
|
|
79
97
|
}
|
|
80
98
|
render() {
|
|
81
|
-
return
|
|
99
|
+
return f`<div
|
|
100
|
+
class="vf-snap box vf-pattern-fill${this._pattern ? " vf-patterned" : ""}"
|
|
101
|
+
>
|
|
102
|
+
<slot></slot>
|
|
103
|
+
</div>`;
|
|
82
104
|
}
|
|
83
105
|
};
|
|
84
|
-
|
|
106
|
+
n([p()], h.prototype, "pattern", void 0), n([m(".box")], h.prototype, "box", void 0), h = n([e("vf-container")], h);
|
|
85
107
|
//#endregion
|
|
86
|
-
export {
|
|
108
|
+
export { h as VfContainer };
|
|
@@ -3,8 +3,10 @@ declare const VfDesktop_base: (new (...args: any[]) => import("../position.js").
|
|
|
3
3
|
/**
|
|
4
4
|
* `<vf-desktop>` — the full-bleed classic desktop container.
|
|
5
5
|
*
|
|
6
|
-
* Renders the
|
|
7
|
-
*
|
|
6
|
+
* Renders the desktop pattern — the classic 50% dither by default, or any of
|
|
7
|
+
* the standard patterns by name (`pattern`, System 7's General Controls
|
|
8
|
+
* setting) — and manages the stacking order and `active` state of slotted
|
|
9
|
+
* `vf-window` children: a `pointerdown` or
|
|
8
10
|
* `focusin` (keyboard focus) anywhere inside a window brings it to the front
|
|
9
11
|
* and makes it the single active window. The windows' light-DOM order is kept
|
|
10
12
|
* in step with the stacking order (bottom-most first, at pointer-gesture
|
|
@@ -43,16 +45,24 @@ declare const VfDesktop_base: (new (...args: any[]) => import("../position.js").
|
|
|
43
45
|
* the CRT's unlit margin — around the screen, rounding its top corners
|
|
44
46
|
* with the classic corner mask.
|
|
45
47
|
*
|
|
48
|
+
* **`pattern`** names the desktop pattern — `gray-50` (the dither) by
|
|
49
|
+
* default, any of the 38 standard patterns (docs/PATTERNS.md), or sixteen
|
|
50
|
+
* hex digits stating a custom 8×8 pattern, as on `vf-container`. It is
|
|
51
|
+
* painted as the screen's own background: black ink on an opaque white
|
|
52
|
+
* paper, one whole-surface raster at one image px per system px, 1-bit at
|
|
53
|
+
* every density and zoom (src/pattern-fill.ts).
|
|
54
|
+
*
|
|
46
55
|
* Custom properties:
|
|
47
|
-
* - `--vf-desktop-pattern` —
|
|
48
|
-
*
|
|
49
|
-
*
|
|
56
|
+
* - `--vf-desktop-pattern` — a consumer's own tile art in place of the
|
|
57
|
+
* pattern (the kit's default is a 1-bit 50% checker, opaque
|
|
58
|
+
* black-on-white on a 30-system-px tile). Set, it wins over `pattern` and
|
|
59
|
+
* renders as a placed tile grid at that same 30-px geometry
|
|
50
60
|
* (src/tile-grid.ts); a token swapped at runtime without touching the
|
|
51
61
|
* component wants a `requestUpdate()`.
|
|
52
|
-
* - `--vf-desktop` — base color painted *under* the pattern
|
|
53
|
-
* `#808080`). The
|
|
54
|
-
* `--vf-desktop-pattern` is overridden with a tile that has
|
|
55
|
-
* cells (or with `none`).
|
|
62
|
+
* - `--vf-desktop` — base color painted *under* the pattern (default
|
|
63
|
+
* `#808080`). The pattern's paper is opaque, so this only becomes visible
|
|
64
|
+
* when `--vf-desktop-pattern` is overridden with a tile that has
|
|
65
|
+
* transparent cells (or with `none`).
|
|
56
66
|
*
|
|
57
67
|
* @slot - Default slot: menu bar, windows, anything.
|
|
58
68
|
* @fires vf-activate - The active document-tier window changed. Detail
|
|
@@ -60,15 +70,16 @@ declare const VfDesktop_base: (new (...args: any[]) => import("../position.js").
|
|
|
60
70
|
* document tier deactivated (a {@link clearActive} call, or the active
|
|
61
71
|
* window leaving the DOM with none behind it). Fired once per change of
|
|
62
72
|
* holder, never for a re-assertion of the same one.
|
|
63
|
-
* @csspart desktop - The
|
|
73
|
+
* @csspart desktop - The patterned screen surface — the whole-system-px
|
|
64
74
|
* raster (inset by `bezel` when one is set).
|
|
65
|
-
* @cssprop [--vf-desktop=#808080] - base color under the desktop
|
|
66
|
-
* occluded by the
|
|
67
|
-
* `--vf-desktop-pattern`
|
|
68
|
-
* @cssprop --vf-desktop-pattern -
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
75
|
+
* @cssprop [--vf-desktop=#808080] - base color under the desktop pattern —
|
|
76
|
+
* occluded by the pattern's opaque paper, so it only shows through a
|
|
77
|
+
* custom `--vf-desktop-pattern`
|
|
78
|
+
* @cssprop --vf-desktop-pattern - a consumer's own desktop tile, in place of
|
|
79
|
+
* `pattern` — the kit's default is the 50% checker drawn as opaque
|
|
80
|
+
* black-on-white rects on a 30-system-px tile. Override the whole tile;
|
|
81
|
+
* consumer art renders as a placed tile grid at that same geometry (raster
|
|
82
|
+
* art magnifies nearest-neighbor, the `vf-img` idiom)
|
|
72
83
|
*/
|
|
73
84
|
export declare class VfDesktop extends VfDesktop_base {
|
|
74
85
|
#private;
|
|
@@ -98,6 +109,17 @@ export declare class VfDesktop extends VfDesktop_base {
|
|
|
98
109
|
* the same pixels.
|
|
99
110
|
*/
|
|
100
111
|
bezel: number;
|
|
112
|
+
/**
|
|
113
|
+
* The desktop pattern — System 7's General Controls setting. A library
|
|
114
|
+
* pattern by name (`gray-50`, the classic dither, by default; `gray-75`,
|
|
115
|
+
* `bricks`, … — docs/PATTERNS.md) or sixteen hex digits stating a custom
|
|
116
|
+
* 8×8 pattern, as on `vf-container`. Painted black on opaque white over
|
|
117
|
+
* the whole screen, 1-bit at every density and zoom. A
|
|
118
|
+
* `--vf-desktop-pattern` token override still wins and renders the
|
|
119
|
+
* consumer's tile as a placed grid; an unrecognized value warns once and
|
|
120
|
+
* keeps the dither.
|
|
121
|
+
*/
|
|
122
|
+
pattern: string | null | undefined;
|
|
101
123
|
/**
|
|
102
124
|
* Size the screen to the largest whole-system-px raster whose host box —
|
|
103
125
|
* bezel included — fits a CSS-px bound, and return what was set. The
|
|
@@ -120,11 +142,22 @@ export declare class VfDesktop extends VfDesktop_base {
|
|
|
120
142
|
private readonly gridSnap;
|
|
121
143
|
/**
|
|
122
144
|
* The consumer's `--vf-desktop-pattern` override, or `''` for the kit
|
|
123
|
-
*
|
|
145
|
+
* pattern — which of the two exact-fill paths render() takes (see
|
|
124
146
|
* src/tile-grid.ts). Re-read every update; a token swapped at runtime
|
|
125
147
|
* without touching the component wants a `requestUpdate()`.
|
|
126
148
|
*/
|
|
127
|
-
private
|
|
149
|
+
private _token;
|
|
150
|
+
/** `pattern`, resolved — the kit path's art; the dither when unset. */
|
|
151
|
+
private _desktopPattern;
|
|
152
|
+
/** The screen surface the pattern paints on; exists from the first render. */
|
|
153
|
+
private readonly screen;
|
|
154
|
+
/**
|
|
155
|
+
* The desktop pattern, painted as the screen's own background
|
|
156
|
+
* (src/pattern-fill.ts) from the declared raster — scale-independent, so
|
|
157
|
+
* density and zoom re-encode nothing — and silent while a consumer token
|
|
158
|
+
* owns the fill.
|
|
159
|
+
*/
|
|
160
|
+
private readonly patternFill;
|
|
128
161
|
/** Monotonic z-index counter for window stacking. */
|
|
129
162
|
private _zCounter;
|
|
130
163
|
/**
|