@gjsify/adwaita-web 0.62.0 → 0.63.1-next.235
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/README.md +31 -0
- package/dist/adwaita-web.css +4 -0
- package/dist/adwaita-web.css.map +1 -1
- package/lib/types/canvas2d/canvas2d-bridge.d.ts +26 -5
- package/lib/types/elements/adw-application-window.d.ts +26 -7
- package/lib/types/elements/adw-bottom-sheet.d.ts +3 -0
- package/lib/types/elements/adw-data-grid.d.ts +4 -0
- package/lib/types/elements/adw-window-features.d.ts +39 -0
- package/lib/types/elements/adw-window.d.ts +11 -24
- package/lib/types/elements/gtk-application-window.d.ts +12 -4
- package/lib/types/elements/gtk-window.d.ts +44 -0
- package/lib/types/gtk-window.spec.d.ts +6 -0
- package/lib/types/pango-markup.d.ts +10 -0
- package/lib/types/pango-markup.spec.d.ts +1 -0
- package/lib/types/source-view/copy-glyph.d.ts +6 -0
- package/lib/types/source-view/copy-glyph.spec.d.ts +1 -0
- package/lib/types/styles.generated.d.ts +1 -1
- package/package.json +13 -12
- package/scss/_window.scss +7 -2
- package/src/adw-application-window.spec.ts +8 -0
- package/src/adw-data-grid.spec.ts +11 -0
- package/src/adw-window.spec.ts +8 -0
- package/src/application.spec.ts +34 -1
- package/src/application.ts +16 -0
- package/src/bottom-sheet.spec.ts +9 -0
- package/src/canvas2d/canvas2d-bridge.ts +24 -8
- package/src/elements/adw-alert-dialog.ts +8 -5
- package/src/elements/adw-application-window.ts +90 -20
- package/src/elements/adw-banner.ts +14 -9
- package/src/elements/adw-bottom-sheet.ts +9 -0
- package/src/elements/adw-data-grid.ts +18 -0
- package/src/elements/adw-window-features.ts +128 -0
- package/src/elements/adw-window.ts +45 -108
- package/src/elements/gtk-application-window.ts +17 -6
- package/src/elements/gtk-window.ts +170 -18
- package/src/gtk-window.spec.ts +133 -0
- package/src/pango-markup.spec.ts +257 -0
- package/src/pango-markup.ts +266 -0
- package/src/source-view/adw-source-view.ts +2 -8
- package/src/source-view/copy-glyph.spec.ts +46 -0
- package/src/source-view/copy-glyph.ts +52 -0
- package/src/styles.generated.ts +1 -1
- package/src/test.browser.mts +4 -0
package/README.md
CHANGED
|
@@ -130,6 +130,37 @@ auto-dismiss runs on the browser's timers by default; assign
|
|
|
130
130
|
defines) to drive toast lifetimes from your own clock — that is how the
|
|
131
131
|
package's own regression tests advance time without real timers.
|
|
132
132
|
|
|
133
|
+
## Pango markup (`use-markup`)
|
|
134
|
+
|
|
135
|
+
`<adw-banner>`'s `title`, `<adw-alert-dialog>`'s `heading` and `body` and
|
|
136
|
+
`<gtk-label>` / `<gtk-inscription>`'s `markup` read Pango markup — GTK's eleven
|
|
137
|
+
tags (`b`, `i`, `u`, `s`, `tt`, `big`, `small`, `sub`, `sup`, `span`,
|
|
138
|
+
`markup`), `<span>` attributes, and `&`/`<`/`>`/`"`/`'`
|
|
139
|
+
plus numeric character references.
|
|
140
|
+
|
|
141
|
+
Pango markup is **not** HTML, and nothing here is handed to `innerHTML`:
|
|
142
|
+
`renderPangoMarkup` (in `src/pango-markup.ts`) builds elements and text nodes
|
|
143
|
+
from the tree `parsePangoMarkup` (`@gjsify/adwaita-core`) returns. The banner
|
|
144
|
+
and the alert dialog therefore DRAW the runs:
|
|
145
|
+
|
|
146
|
+
```html
|
|
147
|
+
<adw-banner title="<b>Metered</b> connection" use-markup revealed></adw-banner>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Anything pango cannot parse comes back as **text**, exactly as
|
|
151
|
+
`gtk_label_set_markup` keeps an unparseable string: a bare `&`, a `<` in prose,
|
|
152
|
+
a mismatched tag — and, importantly, every tag outside pango's set. An
|
|
153
|
+
`<img src=x onerror=…>` in a banner title is shown, not run; there is no code
|
|
154
|
+
path that creates an element for a name the parser did not recognise, and a
|
|
155
|
+
`<span>` attribute becomes a CSS declaration (or is dropped), never a DOM
|
|
156
|
+
attribute.
|
|
157
|
+
|
|
158
|
+
Without `use-markup` every one of these strings is literal text — that is
|
|
159
|
+
`Adw.Banner:use-markup`'s deliberate departure from the libadwaita default of
|
|
160
|
+
`TRUE`, documented in `src/elements/adw-banner.ts`.
|
|
161
|
+
`scripts/check-adwaita-no-markup-sinks.mjs` holds the no-`innerHTML` rule for
|
|
162
|
+
the package's shipping sources.
|
|
163
|
+
|
|
133
164
|
## Theming a page without `<adw-window>`
|
|
134
165
|
|
|
135
166
|
The components read their colours from the `--window-*` CSS custom properties,
|
package/dist/adwaita-web.css
CHANGED