studio-engine 0.103.0 → 0.104.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ed661773f8149123feb0d677eec217324c3346565fbab0bf27ff53c41a686cc
4
- data.tar.gz: 5bd261c837ec5a372fc5f36451bef2082df9f4cb136791bb6b0ae359e60ccc77
3
+ metadata.gz: 8b96c9bc4046a0dbf2f37602c67e682a23014076b8bb75e3267fa24b039262b9
4
+ data.tar.gz: efd37090658d3d72ab2dbda97c3f7bc0c44ceaae606ffad8ba5daa737cb23758
5
5
  SHA512:
6
- metadata.gz: f3a4a14bf0ec9d85137401cdfad96443492cfa162565edd69ab0f2864390ec17ef3ad5447d32de895685c7f06ad85246cf9557bffe3167502e0ccfef5f275ed1
7
- data.tar.gz: ecb32c2f49767010aaedd200cf39844922587419a03d22df781bf1ac1d744867b5762e44123a1c9b677b82706069bb66ab7d8eafc9b3f897318a2db0cb5ff3b8
6
+ metadata.gz: 5762cb7806278a0d147c2b352a08dea58f4e0b81f68c09dd5a6a94c2734c48350146044aef913518909fd9b20cba19ea56802f0a423ba6efad1fa330b473a3db
7
+ data.tar.gz: c1c387fcdf9f31d87e74e5e9d3bb18976afb289fee862841cd316ed67f72d7eea305e0ca1e2ea393ceb7b6f5f11739ca99dbfb5d8318362324f0b98e99d845ac
data/CHANGELOG.md CHANGED
@@ -4,6 +4,8 @@ The format is [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). This pro
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.104.0 — 2026-10-11
8
+
7
9
  ### Added
8
10
 
9
11
  - **`--color-primary-ink` and `text-primary-ink`: the primary colour as chip
@@ -14,6 +16,16 @@ The format is [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). This pro
14
16
 
15
17
  ### Changed
16
18
 
19
+ - **The Phantom callback's script carries the request's CSP nonce, and a
20
+ banner chip has no inline handler.** `solana_sessions/phantom_callback`
21
+ renders `nonce=` from `content_security_policy_nonce`, and no attribute for a
22
+ host with no nonce generator. `studio/banners/_button` drops its
23
+ `onmouseover`, `onmouseout`, `onfocus` and `onblur` handlers: the chip sets
24
+ `--studio-banner-hover-bg`, `-border` and `-color` inline and carries
25
+ `data-studio-banner-button`, and a rule in `layouts/studio/_head` paints its
26
+ hover, keyboard focus (`:focus-visible`) and tooltip. Both pages now run under a script-src with no
27
+ `'unsafe-inline'` (turf-monster's signing pages). A host that renders a banner
28
+ without the engine head keeps the resting look on hover.
17
29
  - **Primary chips are painted in the primary colour and clear AA in both
18
30
  themes.** `Studio::BadgeComponent`'s `tone: :primary` drew heading-coloured
19
31
  text (white in dark, near-black in light), and its `scheme: "primary"`, the
@@ -125,6 +125,19 @@
125
125
  showNavSpinner / hideNavSpinner and fireSuccessConfetti are studio/head_chrome,
126
126
  installed by studio/alpine_shims. %>
127
127
 
128
+ <style>
129
+ /* studio-engine: a banner chip's hover and focus look (studio/banners/_button
130
+ sets the three properties inline). !important because the chip's resting
131
+ look is inline too. */
132
+ [data-studio-banner-button]:hover, [data-studio-banner-button]:focus-visible {
133
+ background: var(--studio-banner-hover-bg) !important;
134
+ border-color: var(--studio-banner-hover-border) !important;
135
+ color: var(--studio-banner-hover-color) !important;
136
+ }
137
+ [data-studio-banner-button]:hover [data-studio-banner-tooltip],
138
+ [data-studio-banner-button]:focus-visible [data-studio-banner-tooltip] { opacity: 1 !important; }
139
+ </style>
140
+
128
141
  <style>
129
142
  /* studio-engine: a sticky navbar that shrinks on scroll changes layout
130
143
  above the fold — Chrome/Firefox scroll-anchoring then compensates by
@@ -28,7 +28,10 @@
28
28
  <% end %>
29
29
  </div>
30
30
 
31
- <script>
31
+ <%# The request's CSP nonce, or nil (no attribute) when the host sets no
32
+ nonce generator. %>
33
+ <% callback_nonce = (content_security_policy_nonce if respond_to?(:content_security_policy_nonce)) %>
34
+ <script<% if callback_nonce %> nonce="<%= callback_nonce %>"<% end %>>
32
35
  (function() {
33
36
  var logEl = document.getElementById('phantom-log');
34
37
  // The sink is absent on a real production deploy (see the ERB guard above), and that
@@ -14,9 +14,6 @@
14
14
  base_class = "group relative inline-flex items-center font-semibold rounded px-3 py-1 whitespace-nowrap gap-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-white/90"
15
15
  classes = [base_class, local_assigns[:class]].compact.join(" ")
16
16
 
17
- tooltip_show = tooltip.present? ? "var t=this.querySelector('[data-studio-banner-tooltip]'); if(t){t.style.opacity='1';}" : ""
18
- tooltip_hide = tooltip.present? ? "var t=this.querySelector('[data-studio-banner-tooltip]'); if(t){t.style.opacity='0';}" : ""
19
-
20
17
  if variant == :solid
21
18
  default_background = local_assigns.fetch(:background, "#ffffff")
22
19
  default_border = local_assigns.fetch(:border_color, "#ffffff")
@@ -43,21 +40,21 @@
43
40
  "font-weight:700",
44
41
  "text-decoration:none",
45
42
  "position:relative",
46
- "transition:background-color 150ms ease, color 150ms ease, border-color 150ms ease"
43
+ "transition:background-color 150ms ease, color 150ms ease, border-color 150ms ease",
44
+ # The hover and focus look, read by the [data-studio-banner-button] rule in
45
+ # layouts/studio/_head. CSS, not inline handlers, so a host whose
46
+ # script-src drops 'unsafe-inline' still styles the chip.
47
+ "--studio-banner-hover-bg:#{hover_background}",
48
+ "--studio-banner-hover-border:#{hover_border}",
49
+ "--studio-banner-hover-color:#{hover_color}"
47
50
  ].join("; ")
48
51
 
49
- show_styles = "this.style.background='#{hover_background}'; this.style.borderColor='#{hover_border}'; this.style.color='#{hover_color}';#{tooltip_show}"
50
- hide_styles = "this.style.background='#{default_background}'; this.style.borderColor='#{default_border}'; this.style.color='#{default_color}';#{tooltip_hide}"
51
-
52
52
  attrs = {
53
53
  class: classes,
54
54
  style: base_style,
55
55
  title: tooltip,
56
56
  "aria-label": aria_label.presence,
57
- onmouseover: show_styles,
58
- onmouseout: hide_styles,
59
- onfocus: show_styles,
60
- onblur: hide_styles
57
+ "data-studio-banner-button": ""
61
58
  }.compact
62
59
 
63
60
  attrs[:"@click"] = local_assigns[:alpine_click] if local_assigns[:alpine_click].present?
@@ -1,3 +1,3 @@
1
1
  module Studio
2
- VERSION = "0.103.0"
2
+ VERSION = "0.104.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: studio-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.103.0
4
+ version: 0.104.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex McRitchie