@synopackageland/ui 0.23.3 → 0.23.4

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.
@@ -690,8 +690,39 @@ no offset of its own.
690
690
  of its scroller (the covered padding, a sticky `PageHeader` that keeps a row
691
691
  of its own, and the phone's tabs strip). Every element in the page body gets
692
692
  it as `scroll-margin-top`, so `scrollIntoView`, a `#hash` link and focus
693
- land below the stuck rows. A row an App makes sticky under them uses
694
- `top: var(--ui-sticky-top-offset)` instead of a hardcoded 44 or 96px.
693
+ land below the stuck rows.
694
+
695
+ **An App's own sticky row: `data-ui-sticky`.** A row the App keeps at the
696
+ top of its page (a sticky audio player on a detail page, a filter row) is
697
+ marked `data-ui-sticky`, anywhere in the PageContent's body. PageContent
698
+ measures it (ResizeObserver, again when rows mount, unmount or change size)
699
+ and, while it sticks, adds its height to `--ui-sticky-top-offset`, so
700
+ `scrollToStart`, `scrollIntoViewWithinScroller`, a `#hash` link and focus
701
+ land below it too. The UI also sticks it: `position: sticky`, `top` right
702
+ under what sticks above it (`--ui-sticky-row-top`: the covered padding, a
703
+ sticky `PageHeader`, the phone's tabs strip and earlier rows; several rows
704
+ stack in document order), `z-index: 2` and the page header's background.
705
+ An App sets no `top` of its own and measures nothing.
706
+
707
+ ```vue
708
+ <PageContent>
709
+ <PageHeader :title="meeting.title" back @back="goBack" />
710
+ <div class="player" data-ui-sticky><AudioPlayer :src="meeting.audio" /></div>
711
+ <p v-for="line in transcript" :id="line.id" :key="line.id">{{ line.text }}</p>
712
+ </PageContent>
713
+ <!-- scrollToStart(document.getElementById(line.id)) lands the line under the player -->
714
+ ```
715
+
716
+ - A row is counted while its computed `position` is `sticky`: an App that
717
+ lets it scroll at some widths (`position: static` in a media query) drops
718
+ it from the offset there. A row in a nested PageContent counts for that
719
+ page only.
720
+ - The offset is the page's, not per element: content above a sticky row in
721
+ the middle of a page also stops that much lower (never under it).
722
+ - The rule has one attribute's specificity, so an App's own class wins for
723
+ `position`, `background` or `z-index`.
724
+ - Before 0.23.4 an App measured its row and added it to the token by hand;
725
+ remove that code when it marks the row instead.
695
726
 
696
727
  **The end of a page: `--ui-page-end-space`.** The room after a page's last
697
728
  row, 24px. While the bars are hidden on a fill page (`data-ui-page-fills`)
@@ -708,6 +739,20 @@ the default, or `start`), honours `scroll-margin-top` / `-bottom` (so the
708
739
  sticky offset above applies) and moves at once under reduced motion.
709
740
  `scrollToStart(el)` is the `block: 'start'` case.
710
741
 
742
+ `nearestScroller` skips an element whose content is not taller than it
743
+ (`scrollHeight > clientHeight`), as it has nothing to scroll. jsdom lays
744
+ nothing out (both are 0), so a unit test of code that calls these helpers
745
+ gives its scroller geometry, or the helpers fall back to the document:
746
+
747
+ ```ts
748
+ const list = document.createElement('div')
749
+ list.style.overflowY = 'auto'
750
+ Object.defineProperty(list, 'clientHeight', { value: 400 })
751
+ Object.defineProperty(list, 'scrollHeight', { value: 1200 })
752
+ list.scrollBy = vi.fn()
753
+ vi.spyOn(list, 'getBoundingClientRect').mockReturnValue(new DOMRect(0, 0, 390, 400))
754
+ ```
755
+
711
756
  ```ts
712
757
  import { scrollToStart, scrollIntoViewWithinScroller } from '@synopackageland/ui'
713
758
  scrollToStart(sectionHeading)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synopackageland/ui",
3
- "version": "0.23.3",
3
+ "version": "0.23.4",
4
4
  "description": "Shared Vue 3 UI component library with a DSM 7 inspired application theme",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -60,6 +60,63 @@
60
60
  "./themes/dsm7-embedded-reset.css": "./dist/themes/dsm7-embedded-reset.css",
61
61
  "./themes/dsm7-embedded-theme.css": "./dist/themes/dsm7-embedded-theme.css"
62
62
  },
63
+ "scripts": {
64
+ "check:docs": "node --test scripts/check-doc-versions.test.mjs && node scripts/check-doc-versions.mjs",
65
+ "dev": "vite build --watch",
66
+ "build": "vite build && vite build --mode json && vite build --mode rich-text && vite build --mode grid && vite build --mode cli && vite build --mode preview && vite build --mode embedded && node scripts/postbuild.mjs",
67
+ "lint": "eslint .",
68
+ "typecheck": "vue-tsc --noEmit -p tsconfig.json",
69
+ "test": "vitest run",
70
+ "test:watch": "vitest",
71
+ "test:changed": "echo \"test:changed skips the tests the changes since ${SYNOPKGLAND_GATE_BASE:-origin/master} do not reach (vitest --changed); pnpm check runs them all\" && vitest run --changed ${SYNOPKGLAND_GATE_BASE:-origin/master}",
72
+ "story": "histoire dev",
73
+ "story:build": "histoire build",
74
+ "check:host": "node scripts/dsm-host-shots.mjs",
75
+ "check:switch": "node scripts/check-switch.mjs",
76
+ "check:tabs": "node scripts/check-tabs.mjs",
77
+ "check:mobile": "node scripts/check-mobile-overflow.mjs",
78
+ "check:ui-patch": "node scripts/check-ui-patch.mjs",
79
+ "check:narrow": "node scripts/check-narrow-controls.mjs",
80
+ "check:drawer-form": "node scripts/check-drawer-form.mjs",
81
+ "check:responsive": "node scripts/check-responsive.mjs",
82
+ "check:adaptive": "node scripts/check-adaptive.mjs",
83
+ "check:sidebar-focus": "node scripts/check-sidebar-focus.mjs",
84
+ "check:json-render": "node scripts/check-json-render.mjs",
85
+ "check:motion": "node scripts/check-motion.mjs",
86
+ "check:topology": "node scripts/check-topology.mjs",
87
+ "check:wizard": "node scripts/check-wizard.mjs",
88
+ "check:edges": "node scripts/check-edges.mjs",
89
+ "check:data-grid": "node scripts/check-data-grid.mjs",
90
+ "check:truncation": "node scripts/check-truncation.mjs",
91
+ "check:link": "node scripts/check-link.mjs",
92
+ "check:text-select": "node scripts/check-text-select.mjs",
93
+ "check:date-picker": "node scripts/check-date-picker.mjs",
94
+ "check:full-page": "node scripts/check-full-page.mjs",
95
+ "check:short-viewport": "node scripts/check-short-viewport.mjs",
96
+ "check:phone-layout": "node scripts/check-phone-layout.mjs",
97
+ "check:text-zoom": "node scripts/check-text-zoom.mjs",
98
+ "check:focus-restore": "node scripts/check-focus-restore.mjs",
99
+ "check:detail-surface": "node scripts/check-detail-surface.mjs",
100
+ "check:internal": "node --test scripts/check-internal-content.test.mjs scripts/check-npm-metadata.test.mjs && node scripts/check-internal-content.mjs --repo .",
101
+ "check:npm-metadata": "node scripts/check-npm-metadata.mjs",
102
+ "check:package": "node scripts/check-package-content.mjs",
103
+ "check:public-api-consumer": "node scripts/check-public-api-consumer.mjs",
104
+ "notices:update": "node scripts/third-party-notices.mjs --write",
105
+ "notices:check": "node scripts/third-party-notices.mjs --check",
106
+ "check": "bash scripts/docker-check.sh \"npm run gates\"",
107
+ "check:fast": "bash scripts/docker-check.sh \"npm run gates\"",
108
+ "check:local-browser": "node scripts/app-local-browser.mjs",
109
+ "check:infotip": "node scripts/check-infotip.mjs",
110
+ "release:stage": "node scripts/stage-release.mjs",
111
+ "check:polish": "bash scripts/docker-check.sh --build --out .polish-shots 'node scripts/check-polish.mjs'",
112
+ "check:acceptance": "node scripts/check-acceptance.mjs",
113
+ "check:palette": "node scripts/check-palette.mjs",
114
+ "gates": "node scripts/gates.mjs",
115
+ "gates:full": "node scripts/gates.mjs --full",
116
+ "check:layout": "node scripts/check-layout.mjs",
117
+ "release:smoke": "node scripts/release-smoke.mjs",
118
+ "check:browser-install": "playwright install chromium"
119
+ },
63
120
  "peerDependencies": {
64
121
  "vue": "^3.5.0"
65
122
  },
@@ -110,6 +167,13 @@
110
167
  "engines": {
111
168
  "node": ">=20"
112
169
  },
170
+ "packageManager": "pnpm@10.33.2",
171
+ "pnpm": {
172
+ "onlyBuiltDependencies": [
173
+ "esbuild",
174
+ "vue-demi"
175
+ ]
176
+ },
113
177
  "config": {
114
178
  "bundledRuntime": {
115
179
  "@tanstack/vue-virtual": "3.13.39",
@@ -117,62 +181,5 @@
117
181
  "reka-ui": "2.11.0"
118
182
  }
119
183
  },
120
- "homepage": "https://www.varvis.me/docs/",
121
- "scripts": {
122
- "check:docs": "node --test scripts/check-doc-versions.test.mjs && node scripts/check-doc-versions.mjs",
123
- "dev": "vite build --watch",
124
- "build": "vite build && vite build --mode json && vite build --mode rich-text && vite build --mode grid && vite build --mode cli && vite build --mode preview && vite build --mode embedded && node scripts/postbuild.mjs",
125
- "lint": "eslint .",
126
- "typecheck": "vue-tsc --noEmit -p tsconfig.json",
127
- "test": "vitest run",
128
- "test:watch": "vitest",
129
- "test:changed": "echo \"test:changed skips the tests the changes since ${SYNOPKGLAND_GATE_BASE:-origin/master} do not reach (vitest --changed); pnpm check runs them all\" && vitest run --changed ${SYNOPKGLAND_GATE_BASE:-origin/master}",
130
- "story": "histoire dev",
131
- "story:build": "histoire build",
132
- "check:host": "node scripts/dsm-host-shots.mjs",
133
- "check:switch": "node scripts/check-switch.mjs",
134
- "check:tabs": "node scripts/check-tabs.mjs",
135
- "check:mobile": "node scripts/check-mobile-overflow.mjs",
136
- "check:ui-patch": "node scripts/check-ui-patch.mjs",
137
- "check:narrow": "node scripts/check-narrow-controls.mjs",
138
- "check:drawer-form": "node scripts/check-drawer-form.mjs",
139
- "check:responsive": "node scripts/check-responsive.mjs",
140
- "check:adaptive": "node scripts/check-adaptive.mjs",
141
- "check:sidebar-focus": "node scripts/check-sidebar-focus.mjs",
142
- "check:json-render": "node scripts/check-json-render.mjs",
143
- "check:motion": "node scripts/check-motion.mjs",
144
- "check:topology": "node scripts/check-topology.mjs",
145
- "check:wizard": "node scripts/check-wizard.mjs",
146
- "check:edges": "node scripts/check-edges.mjs",
147
- "check:data-grid": "node scripts/check-data-grid.mjs",
148
- "check:truncation": "node scripts/check-truncation.mjs",
149
- "check:link": "node scripts/check-link.mjs",
150
- "check:text-select": "node scripts/check-text-select.mjs",
151
- "check:date-picker": "node scripts/check-date-picker.mjs",
152
- "check:full-page": "node scripts/check-full-page.mjs",
153
- "check:short-viewport": "node scripts/check-short-viewport.mjs",
154
- "check:phone-layout": "node scripts/check-phone-layout.mjs",
155
- "check:text-zoom": "node scripts/check-text-zoom.mjs",
156
- "check:focus-restore": "node scripts/check-focus-restore.mjs",
157
- "check:detail-surface": "node scripts/check-detail-surface.mjs",
158
- "check:internal": "node --test scripts/check-internal-content.test.mjs scripts/check-npm-metadata.test.mjs && node scripts/check-internal-content.mjs --repo .",
159
- "check:npm-metadata": "node scripts/check-npm-metadata.mjs",
160
- "check:package": "node scripts/check-package-content.mjs",
161
- "check:public-api-consumer": "node scripts/check-public-api-consumer.mjs",
162
- "notices:update": "node scripts/third-party-notices.mjs --write",
163
- "notices:check": "node scripts/third-party-notices.mjs --check",
164
- "check": "bash scripts/docker-check.sh \"npm run gates\"",
165
- "check:fast": "bash scripts/docker-check.sh \"npm run gates\"",
166
- "check:local-browser": "node scripts/app-local-browser.mjs",
167
- "check:infotip": "node scripts/check-infotip.mjs",
168
- "release:stage": "node scripts/stage-release.mjs",
169
- "check:polish": "bash scripts/docker-check.sh --build --out .polish-shots 'node scripts/check-polish.mjs'",
170
- "check:acceptance": "node scripts/check-acceptance.mjs",
171
- "check:palette": "node scripts/check-palette.mjs",
172
- "gates": "node scripts/gates.mjs",
173
- "gates:full": "node scripts/gates.mjs --full",
174
- "check:layout": "node scripts/check-layout.mjs",
175
- "release:smoke": "node scripts/release-smoke.mjs",
176
- "check:browser-install": "playwright install chromium"
177
- }
178
- }
184
+ "homepage": "https://www.varvis.me/docs/"
185
+ }