@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.
Files changed (43) hide show
  1. package/README.md +31 -0
  2. package/dist/adwaita-web.css +4 -0
  3. package/dist/adwaita-web.css.map +1 -1
  4. package/lib/types/canvas2d/canvas2d-bridge.d.ts +26 -5
  5. package/lib/types/elements/adw-application-window.d.ts +26 -7
  6. package/lib/types/elements/adw-bottom-sheet.d.ts +3 -0
  7. package/lib/types/elements/adw-data-grid.d.ts +4 -0
  8. package/lib/types/elements/adw-window-features.d.ts +39 -0
  9. package/lib/types/elements/adw-window.d.ts +11 -24
  10. package/lib/types/elements/gtk-application-window.d.ts +12 -4
  11. package/lib/types/elements/gtk-window.d.ts +44 -0
  12. package/lib/types/gtk-window.spec.d.ts +6 -0
  13. package/lib/types/pango-markup.d.ts +10 -0
  14. package/lib/types/pango-markup.spec.d.ts +1 -0
  15. package/lib/types/source-view/copy-glyph.d.ts +6 -0
  16. package/lib/types/source-view/copy-glyph.spec.d.ts +1 -0
  17. package/lib/types/styles.generated.d.ts +1 -1
  18. package/package.json +13 -12
  19. package/scss/_window.scss +7 -2
  20. package/src/adw-application-window.spec.ts +8 -0
  21. package/src/adw-data-grid.spec.ts +11 -0
  22. package/src/adw-window.spec.ts +8 -0
  23. package/src/application.spec.ts +34 -1
  24. package/src/application.ts +16 -0
  25. package/src/bottom-sheet.spec.ts +9 -0
  26. package/src/canvas2d/canvas2d-bridge.ts +24 -8
  27. package/src/elements/adw-alert-dialog.ts +8 -5
  28. package/src/elements/adw-application-window.ts +90 -20
  29. package/src/elements/adw-banner.ts +14 -9
  30. package/src/elements/adw-bottom-sheet.ts +9 -0
  31. package/src/elements/adw-data-grid.ts +18 -0
  32. package/src/elements/adw-window-features.ts +128 -0
  33. package/src/elements/adw-window.ts +45 -108
  34. package/src/elements/gtk-application-window.ts +17 -6
  35. package/src/elements/gtk-window.ts +170 -18
  36. package/src/gtk-window.spec.ts +133 -0
  37. package/src/pango-markup.spec.ts +257 -0
  38. package/src/pango-markup.ts +266 -0
  39. package/src/source-view/adw-source-view.ts +2 -8
  40. package/src/source-view/copy-glyph.spec.ts +46 -0
  41. package/src/source-view/copy-glyph.ts +52 -0
  42. package/src/styles.generated.ts +1 -1
  43. 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 `&amp;`/`&lt;`/`&gt;`/`&quot;`/`&apos;`
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,
@@ -2093,6 +2093,10 @@ adw-application-window.fullscreen {
2093
2093
  outline: none;
2094
2094
  box-shadow: none;
2095
2095
  }
2096
+ adw-window[hidden],
2097
+ adw-application-window[hidden] {
2098
+ display: none;
2099
+ }
2096
2100
 
2097
2101
  .adw-window-content {
2098
2102
  display: flex;