nquery 0.1.2 → 0.1.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.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -0
  3. data/README.md +54 -0
  4. data/app/assets/builds/nquery/application.css +110 -6
  5. data/app/assets/builds/nquery/application.js +401 -37
  6. data/app/controllers/concerns/nquery/breadcrumbs.rb +2 -13
  7. data/app/controllers/concerns/nquery/chart_actions.rb +5 -5
  8. data/app/controllers/concerns/nquery/chart_results.rb +70 -9
  9. data/app/controllers/concerns/nquery/sharing_page.rb +38 -0
  10. data/app/controllers/nquery/application_controller.rb +2 -0
  11. data/app/controllers/nquery/dashboard/cards_controller.rb +28 -0
  12. data/app/controllers/nquery/dashboards_controller.rb +56 -11
  13. data/app/controllers/nquery/embed/charts_controller.rb +15 -13
  14. data/app/controllers/nquery/embed/dashboards_controller.rb +34 -8
  15. data/app/controllers/nquery/public/charts_controller.rb +19 -0
  16. data/app/controllers/nquery/public/dashboards_controller.rb +33 -0
  17. data/app/controllers/nquery/public_resources_controller.rb +79 -0
  18. data/app/controllers/nquery/queries_controller.rb +25 -48
  19. data/app/controllers/nquery/sharing/base_controller.rb +89 -0
  20. data/app/controllers/nquery/sharing/embed_tokens_controller.rb +41 -0
  21. data/app/controllers/nquery/sharing/embeddings_controller.rb +17 -0
  22. data/app/controllers/nquery/sharing/public_links_controller.rb +21 -0
  23. data/app/helpers/nquery/charts_helper.rb +13 -0
  24. data/app/helpers/nquery/sharing_helper.rb +67 -0
  25. data/app/javascript/nquery/controllers/chart_preview_controller.js +19 -1
  26. data/app/javascript/nquery/controllers/clipboard_controller.js +23 -0
  27. data/app/models/concerns/nquery/shareable.rb +43 -0
  28. data/app/models/nquery/chart.rb +18 -2
  29. data/app/models/nquery/dashboard.rb +131 -0
  30. data/app/models/nquery/data_source.rb +1 -1
  31. data/app/models/nquery/query.rb +72 -0
  32. data/app/services/nquery/application_service.rb +9 -0
  33. data/app/services/nquery/dashboards/card_parameters.rb +37 -0
  34. data/app/services/nquery/dashboards/filters.rb +75 -0
  35. data/app/services/nquery/dashboards/parameter_charts.rb +31 -0
  36. data/app/services/nquery/dashboards/parameter_rows.rb +60 -0
  37. data/app/views/layouts/nquery/application.html.erb +8 -0
  38. data/app/views/layouts/nquery/embed.html.erb +3 -1
  39. data/app/views/nquery/charts/_builder_form.html.erb +13 -6
  40. data/app/views/nquery/charts/_variable_row.html.erb +10 -0
  41. data/app/views/nquery/charts/_variables.html.erb +28 -0
  42. data/app/views/nquery/charts/embed.html.erb +5 -11
  43. data/app/views/nquery/charts/new.html.erb +2 -1
  44. data/app/views/nquery/charts/update.turbo_stream.erb +3 -0
  45. data/app/views/nquery/dashboard/charts/new.html.erb +2 -1
  46. data/app/views/nquery/dashboards/_chart_card.html.erb +27 -1
  47. data/app/views/nquery/dashboards/_parameter_chart_ids.html.erb +6 -0
  48. data/app/views/nquery/dashboards/_parameters.html.erb +159 -0
  49. data/app/views/nquery/dashboards/edit.html.erb +10 -0
  50. data/app/views/nquery/dashboards/embed.html.erb +9 -0
  51. data/app/views/nquery/dashboards/show.html.erb +41 -1
  52. data/app/views/nquery/embed/charts/show.html.erb +7 -8
  53. data/app/views/nquery/embed/dashboards/show.html.erb +12 -6
  54. data/app/views/nquery/embed/unavailable.html.erb +1 -0
  55. data/app/views/nquery/shared/_icon.html.erb +10 -0
  56. data/app/views/nquery/shared/_shared_chart_card.html.erb +20 -0
  57. data/app/views/nquery/shared/_sharing_panel.html.erb +94 -0
  58. data/app/views/nquery/shared/_sidebar.html.erb +1 -1
  59. data/app/views/nquery/shared/_topbar.html.erb +3 -0
  60. data/config/routes.rb +24 -1
  61. data/db/migrate/20260907120000_add_sharing_to_nquery_charts_and_dashboards.rb +19 -0
  62. data/db/migrate/20260907130000_remove_embedding_params_from_nquery_charts_and_dashboards.rb +8 -0
  63. data/db/migrate/20261005145000_add_parameters_to_nquery_dashboards.rb +7 -0
  64. data/db/migrate/20261005190000_add_parameters_to_nquery_queries.rb +7 -0
  65. data/lib/nquery/boolean.rb +9 -0
  66. data/lib/nquery/configuration.rb +6 -0
  67. data/lib/nquery/dashboard_parameters.rb +56 -0
  68. data/lib/nquery/data_sources/adapter.rb +10 -1
  69. data/lib/nquery/data_sources/mysql_adapter.rb +2 -2
  70. data/lib/nquery/data_sources/postgresql_adapter.rb +2 -2
  71. data/lib/nquery/data_sources/rails_adapter.rb +2 -7
  72. data/lib/nquery/data_sources/row_limit.rb +211 -0
  73. data/lib/nquery/embed_token_service.rb +10 -5
  74. data/lib/nquery/encryption.rb +1 -1
  75. data/lib/nquery/parameter_value.rb +97 -0
  76. data/lib/nquery/query_runner.rb +37 -4
  77. data/lib/nquery/seeder.rb +29 -7
  78. data/lib/nquery/statement_binds.rb +112 -0
  79. data/lib/nquery/version.rb +1 -1
  80. data/lib/nquery.rb +5 -0
  81. data/nquery.gemspec +2 -2
  82. metadata +40 -9
  83. data/app/javascript/nquery/controllers/query_editor_controller.js +0 -41
  84. data/app/views/nquery/queries/edit.html.erb +0 -40
  85. data/app/views/nquery/queries/new.html.erb +0 -37
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0460bb4897b3a7fbd9516dc0c8e39a69eb397fb4ab221bc2c27f5879a40fc04e
4
- data.tar.gz: ffd6e74059060bb039706b611a1ee6b193b7d71a6a18a02ea01f88d58c8e3a79
3
+ metadata.gz: 0e586b48ffb884fbeaf4cecaf5247784a7b74de36bf9d0d3830d346117608b7a
4
+ data.tar.gz: 4fdb3e7a0274cd1c4956138b84d1c1d539a08856b5b04a07bcc70cc547bc193c
5
5
  SHA512:
6
- metadata.gz: b2631cd177c4840a24d2c81f07669a02b168bd0a15f9ac90f80e0cb7f027348624521807f64c50783e8d8e66cb74554f01dfc8ac06941d70cfe9b8b768a0122d
7
- data.tar.gz: 182717511432fa142146e3fcc097667ae8fbda4f923447aa6ebfabd3e39a23ce0ca23b61c8b4a3f006ad6f00d1a37d50335308222697443d4e3e50767d9a32a5
6
+ metadata.gz: 1255083420dea72ff15f705764af93d33eede4e99b58b97ba411440775bd96eaea02b8f4436ae8606404691ce6a7c74950422b9cabcbcc220ab2523611573c6e
7
+ data.tar.gz: 94043e4ee6b0f08bb2b024c515df5a9c35929a7540f13e54f2af8fcaeb092de5ad30392ee721c3de6ee7c3371c526c94fe3d75e834c729d6c42754d20e444e7b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ## [0.1.4] - 2026-11-21
6
+
7
+ Host apps should `bundle update nquery` and run `rails db:migrate`.
8
+
9
+ ### Added
10
+ - Dashboard and chart parameters (`{{name}}`) with typed values bound into SQL (#31)
11
+ - Dashboard filter bar to link chart variables and apply dates, strings, integers, UUIDs, and booleans
12
+ - Embed and public dashboard URLs accept declared values from the query string or token
13
+ - Sidebar hide/show control
14
+
15
+ ### Changed
16
+ - Tighten Puma (`>= 7.2.2`) and sqlite3 (`>= 2.10.2`) minimums for known CVEs
17
+ - Patch Rails to 8.1.4.1 and related sanitizer/parser gems
18
+
19
+ ### Fixed
20
+ - Wrap or rewrite SQL that already ends with a LIMIT (#30)
21
+
22
+ ## [0.1.3] - 2026-09-08
23
+
24
+ Host apps should `bundle update nquery` and run `rails db:migrate`. Re-run `rails generate nquery:install` (or add the sharing/embed keys to `config/initializers/nquery.rb`) if you want public links or static embeds.
25
+
26
+ ### Added
27
+ - Public sharing links and static signed embeds for charts and dashboards (Metabase-style)
28
+ - Sharing UI with expiry picker, revoke/regenerate, and copy-to-clipboard
29
+ - Real query execution on public and embed pages, including dashboard card grids
30
+
31
+ ### Changed
32
+ - Public embed endpoints require `static_embedding_enabled` and per-resource `enable_embedding`
33
+ - Embed layout loads application JS so chart previews initialize, and allows cross-origin iframes via CSP `frame-ancestors`
34
+ - Remove standalone query pages so SQL lives only on charts
35
+
36
+ ### Fixed
37
+ - Query runner and schema endpoints honor the engine mount path (#25)
38
+
3
39
  ## [0.1.2] - 2026-09-07
4
40
 
5
41
  ### Changed
data/README.md CHANGED
@@ -21,6 +21,7 @@ nquery lets a host Rails app expose a self-contained analytics UI. It:
21
21
  - [First admin onboarding](#first-admin-onboarding)
22
22
  - [Mail and SMTP](#mail-and-smtp)
23
23
  - [Data sources](#data-sources)
24
+ - [Sharing and embedding](#sharing-and-embedding)
24
25
  - [Active Storage](#active-storage)
25
26
  - [Development](#development)
26
27
  - [Contributing](#contributing)
@@ -135,6 +136,9 @@ end
135
136
  | `query_timeout` | `15` | Query timeout (seconds) |
136
137
  | `query_row_limit` | `10_000` | Max rows returned by a query |
137
138
  | `embed_secret` | `nil` | Override for embed token signing (falls back to `secret_key_base`) |
139
+ | `public_sharing_enabled` | `false` | Allow public UUID links for charts and dashboards |
140
+ | `static_embedding_enabled` | `false` | Allow signed iframe embeds for charts and dashboards |
141
+ | `embed_frame_ancestors` | `nil` | CSP `frame-ancestors` origins (`nil` allows any origin) |
138
142
 
139
143
  **Not supported in config:** storing database credentials for data sources, SSO/hybrid auth hooks, or public self-registration.
140
144
 
@@ -233,6 +237,56 @@ config.default_data_source = :main
233
237
 
234
238
  After setup, review sources under **Admin → Data sources**.
235
239
 
240
+ ## Sharing and embedding
241
+
242
+ nquery mirrors Metabase’s two sharing mechanisms for **charts** and **dashboards** (not collections). Both are **off by default** and must be enabled in the host initializer:
243
+
244
+ ```ruby
245
+ Nquery.configure do |config|
246
+ config.public_sharing_enabled = true
247
+ config.static_embedding_enabled = true
248
+ config.embed_secret = Rails.application.secret_key_base
249
+ # Optional: restrict which sites may iframe embeds
250
+ # config.embed_frame_ancestors = ["https://app.example.com"]
251
+ end
252
+ ```
253
+
254
+ Users with **view** access can open **Embed** on a chart or dashboard. Creating, revoking, or regenerating links and tokens requires **curate** access on the collection and `view_data` on the underlying data sources.
255
+
256
+ Public and embed endpoints rate-limit to 60 requests per minute per IP when the host uses Rails 7.2+ `rate_limit`. Older Rails versions log a warning and skip rate limiting.
257
+
258
+ ### Public links
259
+
260
+ An unguessable UUID stored on the resource. No expiry and no signature. Removing the link clears the UUID.
261
+
262
+ | Resource | Path |
263
+ |----------|------|
264
+ | Chart | `/public/charts/:uuid` |
265
+ | Dashboard | `/public/dashboards/:uuid` |
266
+
267
+ ### Static embeds
268
+
269
+ HMAC-signed tokens (`Nquery::EmbedToken` + `EmbedTokenService`) with optional expiry. The resource must also have **Enable embedding** turned on. Revoked or expired tokens return 403.
270
+
271
+ | Resource | Path |
272
+ |----------|------|
273
+ | Chart | `/embed/charts/show?token=…` |
274
+ | Dashboard | `/embed/dashboards/show?token=…` |
275
+
276
+ Tokens stay in the query string because the signed value contains a `.` that would collide with Rails format parsing in a path segment.
277
+
278
+ ### Hosting embeds (CSP / framing)
279
+
280
+ Public and embed responses:
281
+
282
+ * Delete Rails’ default `X-Frame-Options: SAMEORIGIN` so cross-origin iframes work
283
+ * Set `Content-Security-Policy: frame-ancestors *` (or the origins in `embed_frame_ancestors`)
284
+ * Send `X-Robots-Tag: noindex`
285
+
286
+ Host apps that set a global CSP should allow the nquery origin in `frame-src` (or `child-src`) on the page that contains the iframe.
287
+
288
+ Suggested iframe defaults from the Embed page: `width="800"` `height="600"` (charts) or `800` (dashboards), `loading="lazy"`. Optional query params: `titled=false`, `bordered=false`, `theme=night` or `theme=transparent`.
289
+
236
290
  ## Active Storage
237
291
 
238
292
  Required for organization `logo` and `cover_image` during company onboarding (and later branding):
@@ -9,11 +9,22 @@
9
9
  --nq-muted: #64748b;
10
10
  --nq-card: #ffffff;
11
11
  --nq-danger: #ef4444;
12
+ --nq-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
13
+ --nq-sidebar-width: 240px;
14
+ --nq-topbar-height: 3.75rem;
12
15
  }
13
16
  * { box-sizing: border-box; }
14
- body.nq-body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--nq-text); background: var(--nq-bg); }
15
- .nq-layout { display: flex; min-height: 100vh; }
16
- .nq-sidebar { width: 240px; background: var(--nq-sidebar); color: #fff; padding: 1rem; flex-shrink: 0; }
17
+ body.nq-body { margin: 0; font-family: var(--nq-font); color: var(--nq-text); background: var(--nq-bg); }
18
+ .nq-layout { display: flex; min-height: 100vh; overflow-x: clip; }
19
+ .nq-sidebar { width: var(--nq-sidebar-width); background: var(--nq-sidebar); color: #fff; padding: 1rem; flex-shrink: 0; transition: margin-left 0.22s ease; }
20
+ html.nq-sidebar-collapsed .nq-sidebar,
21
+ .nq-layout.is-sidebar-collapsed .nq-sidebar { margin-left: calc(var(--nq-sidebar-width) * -1); }
22
+ .nq-sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; padding: 0; border: none; border-radius: 6px; background: transparent; color: var(--nq-text); cursor: pointer; }
23
+ .nq-sidebar-toggle:hover { background: #f1f5f9; }
24
+ .nq-sidebar-toggle:focus-visible { outline: 2px solid var(--nq-primary); outline-offset: 2px; }
25
+ .nq-sidebar-toggle .nq-icon { width: 1.25rem; height: 1.25rem; }
26
+ .nq-sidebar-backdrop { position: fixed; inset: 0; z-index: 30; border: 0; padding: 0; background: rgba(15, 23, 42, 0.45); cursor: pointer; }
27
+ .nq-sidebar-backdrop[hidden] { display: none; }
17
28
  .nq-logo { font-size: 1.5rem; font-weight: 700; margin-bottom: 2rem; color: var(--nq-primary); }
18
29
  .nq-nav-link { display: block; padding: 0.5rem 0.75rem; color: #cbd5e1; text-decoration: none; border-radius: 6px; margin-bottom: 0.25rem; border-left: 3px solid transparent; }
19
30
  .nq-nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
@@ -28,7 +39,7 @@ body.nq-body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe
28
39
  .nq-breadcrumb-item a[aria-current="page"] { color: var(--nq-text); font-weight: 500; }
29
40
  .nq-nav-section { font-size: 0.75rem; text-transform: uppercase; color: #94a3b8; margin: 1rem 0 0.5rem; }
30
41
  .nq-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
31
- .nq-topbar { display: flex; justify-content: flex-end; align-items: center; padding: 0.75rem 1.5rem; background: var(--nq-card); border-bottom: 1px solid var(--nq-border); }
42
+ .nq-topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; height: var(--nq-topbar-height); padding: 0 1.5rem; background: var(--nq-card); border-bottom: 1px solid var(--nq-border); }
32
43
  .nq-content { padding: 1.5rem; flex: 1; }
33
44
  .nq-page-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title actions" "meta meta"; gap: 0.375rem 1rem; align-items: start; margin-bottom: 1.5rem; }
34
45
  .nq-page-header h1 { grid-area: title; margin: 0; font-size: 1.5rem; }
@@ -77,9 +88,21 @@ body.nq-body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe
77
88
  .nq-chart-builder-workspace .CodeMirror-cursor { border-left: 2px solid var(--nq-primary); }
78
89
  .nq-chart-builder-workspace .CodeMirror-activeline-background { background: rgba(80, 158, 227, 0.08); }
79
90
  .nq-chart-builder-workspace .cm-s-eclipse .CodeMirror-selected { background: rgba(80, 158, 227, 0.2); }
91
+ .nq-chart-builder-workspace .CodeMirror .nq-sql-parameter { background: rgba(80, 158, 227, 0.35); border-radius: 3px; box-shadow: inset 0 -2px 0 var(--nq-primary); }
80
92
  .nq-sql-editor-hint { margin-left: auto; font-size: 0.75rem; }
81
93
  .nq-sql-save-status { font-size: 0.75rem; min-width: 3.5rem; }
82
94
  .nq-chart-builder-query-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
95
+ .nq-chart-variables { display: flex; flex-direction: column; gap: 0.5rem; }
96
+ .nq-chart-variables-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
97
+ .nq-chart-variables-rows { display: contents; }
98
+ .nq-chart-variable-chip { display: inline-flex; align-items: center; padding: 0.25rem 0.55rem; border: 1px solid var(--nq-border); border-radius: 999px; background: #fff; color: var(--nq-text); cursor: pointer; font: inherit; }
99
+ .nq-chart-variable-chip code { font-size: 0.8125rem; }
100
+ .nq-chart-variable-chip.is-selected { border-color: var(--nq-primary); background: rgba(80, 158, 227, 0.12); color: var(--nq-primary-dark); }
101
+ .nq-chart-variable-add { height: 2rem; padding: 0.25rem 0.7rem; }
102
+ .nq-chart-variable-options { display: flex; flex-direction: column; gap: 0.35rem; padding-bottom: 0.875rem; margin-bottom: 0.25rem; border-bottom: 1px solid var(--nq-border); }
103
+ .nq-chart-variable-options[hidden] { display: none !important; }
104
+ .nq-chart-variable-options code { display: inline-block; width: fit-content; padding: 0.2rem 0.45rem; border-radius: 6px; background: #f1f5f9; font-size: 0.8125rem; }
105
+ .nq-chart-variable-options label { margin-top: 0.35rem; font-size: 0.75rem; font-weight: 600; color: var(--nq-muted); }
83
106
  .nq-query-meta { font-size: 0.8125rem; }
84
107
  .nq-output-tabs { display: inline-flex; gap: 0.25rem; padding: 0.25rem; background: #f1f5f9; border-radius: 8px; }
85
108
  .nq-output-tab { padding: 0.4375rem 0.875rem; border: none; border-radius: 6px; background: transparent; color: var(--nq-muted); font-size: 0.8125rem; font-weight: 600; cursor: pointer; transition: background-color 0.15s, color 0.15s, box-shadow 0.15s; }
@@ -133,6 +156,45 @@ button.nq-menu-item-button.is-loading::before { content: ""; width: 1em; height:
133
156
  .nq-input, .nq-textarea { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--nq-border); border-radius: 6px; font-size: 0.875rem; }
134
157
  .nq-textarea { font-family: ui-monospace, monospace; resize: vertical; }
135
158
  .nq-form-row { margin-bottom: 1rem; }
159
+ .nq-dashboard-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; margin-bottom: 1.75rem; }
160
+ .nq-dashboard-filter-bar { display: flex; flex: 1; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; }
161
+ .nq-dashboard-filter { position: relative; }
162
+ .nq-dashboard-filter label { display: block; margin-bottom: 0.25rem; font-size: 0.75rem; font-weight: 600; }
163
+ .nq-dashboard-filter .nq-input { width: auto; min-width: 11rem; height: 2.25rem; box-sizing: border-box; }
164
+ .nq-dashboard-filter-actions { display: flex; align-items: center; gap: 0.75rem; }
165
+ .nq-dashboard-filter-actions .nq-btn { height: 2.25rem; box-sizing: border-box; }
166
+ .nq-dashboard-filter.is-invalid .nq-input { border-color: var(--nq-danger); }
167
+ .nq-dashboard-filter-error { position: absolute; top: calc(100% + 0.2rem); left: 0; margin: 0; font-size: 0.75rem; line-height: 1.2; color: var(--nq-danger); white-space: nowrap; }
168
+ .nq-dashboard-filter-edit { margin-left: auto; align-self: flex-end; height: 2.25rem; box-sizing: border-box; }
169
+ .nq-dashboard-filter-editor.is-editing { flex-basis: 100%; align-self: stretch; margin: 0.25rem 0 0; border: 1px solid var(--nq-border); border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); overflow: hidden; }
170
+ .nq-dashboard-filter-editor-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--nq-border); background: #f8fafc; font-weight: 600; }
171
+ .nq-dashboard-filter-panel { padding: 1rem 1rem 0.5rem; }
172
+ .nq-dashboard-filter-hint { margin: 0 0 0.875rem; font-size: 0.8125rem; line-height: 1.45; color: var(--nq-muted); }
173
+ .nq-dashboard-filter-hint code { padding: 0.1rem 0.35rem; border-radius: 4px; background: #f1f5f9; color: var(--nq-text); font-size: 0.75rem; }
174
+ .nq-dashboard-filter-add,
175
+ .nq-dashboard-parameter-create { display: grid; grid-template-columns: minmax(10rem, 1.3fr) minmax(8rem, 0.7fr) minmax(10rem, 1fr) auto; gap: 0.75rem; align-items: end; margin: 0 0 0.875rem; padding: 0.875rem; border: 1px solid var(--nq-border); border-radius: 8px; background: #f8fafc; }
176
+ .nq-dashboard-filter-field label { display: block; margin-bottom: 0.3rem; font-size: 0.75rem; font-weight: 600; color: var(--nq-muted); }
177
+ .nq-dashboard-filter-field .nq-input { width: 100%; min-width: 0; background: #fff; }
178
+ .nq-dashboard-filter-add-action { display: flex; }
179
+ .nq-dashboard-filter-list-title { margin: 1rem 0 0.25rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--nq-muted); }
180
+ .nq-dashboard-filter-list { list-style: none; margin: 0; padding: 0; }
181
+ .nq-dashboard-filter-list li:last-child { border-bottom: none; }
182
+ .nq-dashboard-filter-list form { margin: 0; }
183
+ .nq-dashboard-filter-meta { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
184
+ .nq-dashboard-filter-meta code { padding: 0.15rem 0.45rem; border-radius: 6px; background: #f1f5f9; color: var(--nq-text); font-size: 0.8125rem; }
185
+ .nq-badge-filter { font-weight: 600; }
186
+ .nq-badge-filter-string { background: #e2e8f0; color: #334155; }
187
+ .nq-badge-filter-integer { background: #dbeafe; color: #1d4ed8; }
188
+ .nq-badge-filter-date { background: #dcfce7; color: #15803d; }
189
+ .nq-badge-filter-datetime { background: #ede9fe; color: #6d28d9; }
190
+ .nq-badge-filter-uuid { background: #ffedd5; color: #c2410c; }
191
+ .nq-badge-filter-boolean { background: #ccfbf1; color: #0f766e; }
192
+ .nq-dashboard-filter-default { font-size: 0.8125rem; color: var(--nq-muted); }
193
+ .nq-dashboard-filter-default strong { color: var(--nq-text); font-weight: 600; }
194
+ @media (max-width: 760px) {
195
+ .nq-dashboard-filter-add,
196
+ .nq-dashboard-parameter-create { grid-template-columns: 1fr; }
197
+ }
136
198
  .nq-form-row label { display: block; margin-bottom: 0.25rem; font-weight: 500; font-size: 0.875rem; }
137
199
  .nq-form-grid { margin-bottom: 1rem; }
138
200
  .nq-form-grid .nq-form-row { margin-bottom: 0; }
@@ -250,6 +312,21 @@ button.nq-menu-item-button.is-loading::before { content: ""; width: 1em; height:
250
312
  .nq-dashboard-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; }
251
313
  .nq-dashboard-card { background: var(--nq-card); border: 1px solid var(--nq-border); border-radius: 8px; padding: 1rem; min-height: 120px; display: flex; flex-direction: column; }
252
314
  .nq-dashboard-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.75rem; }
315
+ .nq-dashboard-filter-list li { display: flex; flex-direction: column; align-items: stretch; gap: 0.65rem; padding: 0.75rem 0; border-bottom: 1px solid var(--nq-border); }
316
+ .nq-dashboard-filter-list-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
317
+ .nq-dashboard-wire { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin: -0.5rem 0 1rem; padding: 0.75rem 1rem; border: 1px solid var(--nq-primary); border-radius: 8px; background: rgba(80, 158, 227, 0.08); }
318
+ .nq-dashboard-wire p { margin: 0; font-size: 0.875rem; }
319
+ .nq-dashboard-wire form { margin: 0; }
320
+ .nq-dashboard-wire code { padding: 0.1rem 0.35rem; border-radius: 4px; background: #fff; }
321
+ .nq-dashboard-card.is-wiring { position: relative; border-color: var(--nq-primary); box-shadow: 0 0 0 1px var(--nq-primary); }
322
+ .nq-dashboard-card.is-wiring .nq-chart-preview { opacity: 0.45; }
323
+ .nq-dashboard-card-column { position: absolute; left: 1rem; right: 1rem; top: 3.25rem; bottom: 1rem; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; pointer-events: none; }
324
+ .nq-dashboard-card-column-label { margin: 0; font-size: 0.8125rem; color: var(--nq-muted); }
325
+ .nq-dashboard-card-wire { margin: 0; pointer-events: auto; }
326
+ .nq-dashboard-card-column .nq-input { width: auto; min-width: 9rem; pointer-events: auto; background: #fff; }
327
+ .nq-dashboard-filter-field-link { text-decoration: none; }
328
+ .nq-dashboard-filter-field-link[aria-current="true"] code { box-shadow: 0 0 0 2px var(--nq-primary); }
329
+ .nq-dashboard-filter-list li.is-wiring { margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; background: rgba(80, 158, 227, 0.08); }
253
330
  .nq-dashboard-card-title { margin: 0; font-size: 0.9375rem; font-weight: 600; min-width: 0; flex: 1; }
254
331
  .nq-dashboard-card-header .nq-menu { flex-shrink: 0; }
255
332
  .nq-dashboard-card .nq-chart-preview { flex: 1; }
@@ -279,7 +356,8 @@ button.nq-menu-item-button.is-loading::before { content: ""; width: 1em; height:
279
356
  .nq-radio { display: inline-flex; align-items: center; gap: 0.25rem; margin-right: 1rem; }
280
357
  .nq-checkbox { display: block; margin-bottom: 0.25rem; }
281
358
  .nq-csv-preview { margin: 1rem 0; overflow: auto; }
282
- .nq-embed-body { margin: 0; padding: 1rem; background: #fff; }
359
+ .nq-embed-body { margin: 0; padding: 1rem; background: #fff; font-family: var(--nq-font); color: var(--nq-text); }
360
+ .nq-embed-body h1 { margin: 0 0 1rem; font-size: 1.5rem; font-weight: 600; color: inherit; }
283
361
  .nq-icon-lg { width: 2.5rem; height: 2.5rem; color: var(--nq-muted); }
284
362
  .nq-type-badge { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.625rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
285
363
  .nq-type-badge-folder { background: #fef3c7; color: #92400e; }
@@ -364,9 +442,17 @@ button.nq-menu-item-button.is-loading::before { content: ""; width: 1em; height:
364
442
  .nq-home-list-time { flex-shrink: 0; font-size: 0.75rem; white-space: nowrap; }
365
443
  .nq-home-empty { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 2.5rem 1.25rem 1.75rem; text-align: center; border-top: 1px solid var(--nq-border); margin-top: 1rem; }
366
444
  .nq-home-empty p { margin: 0; }
445
+ @media (prefers-reduced-motion: reduce) {
446
+ .nq-sidebar { transition: none; }
447
+ }
367
448
  @media (max-width: 768px) {
368
449
  .nq-grid-2, .nq-grid-3, .nq-grid-sidebar, .nq-grid-editor, .nq-chart-builder-layout { grid-template-columns: 1fr; }
369
- .nq-sidebar { display: none; }
450
+ .nq-topbar { position: sticky; top: 0; z-index: 50; }
451
+ .nq-sidebar { position: fixed; top: var(--nq-topbar-height); left: 0; bottom: 0; z-index: 40; margin-left: 0; transform: translateX(-100%); transition: transform 0.22s ease; }
452
+ .nq-sidebar-backdrop { top: var(--nq-topbar-height); }
453
+ html.nq-sidebar-collapsed .nq-sidebar,
454
+ .nq-layout.is-sidebar-collapsed .nq-sidebar { margin-left: 0; }
455
+ .nq-layout.is-sidebar-open .nq-sidebar { transform: translateX(0); }
370
456
  .nq-page-header { grid-template-columns: 1fr; grid-template-areas: "title" "meta" "actions"; }
371
457
  .nq-page-header > .nq-actions,
372
458
  .nq-page-header > .nq-btn,
@@ -394,3 +480,21 @@ button.nq-menu-item-button.is-loading::before { content: ""; width: 1em; height:
394
480
  .nq-logs-empty td { display: block; }
395
481
  .nq-logs-empty td::before { content: none; }
396
482
  }
483
+ .nq-sharing-section { margin-bottom: 1.25rem; }
484
+ .nq-sharing-section h2 { margin-top: 0; }
485
+ .nq-sharing-section h3 { margin: 1rem 0 0.5rem; font-size: 0.9375rem; }
486
+ .nq-sharing-section > .nq-actions { margin-top: 1rem; }
487
+ .nq-sharing-token-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
488
+ .nq-sharing-token-form .nq-form-row { margin-bottom: 0; }
489
+ .nq-copy-field { display: flex; align-items: flex-start; gap: 0.5rem; }
490
+ .nq-copy-field .nq-code { flex: 1; margin: 0; white-space: pre-wrap; word-break: break-all; }
491
+ .nq-copy-field .nq-btn { flex-shrink: 0; }
492
+ .nq-embed-grid { margin-top: 1rem; }
493
+ .nq-chart-error { margin: 0; padding: 1rem; border-radius: 6px; background: #fef2f2; color: #991b1b; }
494
+ .nq-chart-preview.is-error { min-height: 0; }
495
+ .nq-embed-body.nq-embed-untitled h1 { display: none; }
496
+ .nq-embed-body.nq-embed-borderless .nq-dashboard-card { border-color: transparent; box-shadow: none; }
497
+ .nq-embed-body.nq-embed-theme-night { background: #0f172a; color: #e2e8f0; }
498
+ .nq-embed-body.nq-embed-theme-night .nq-dashboard-card { background: #1e293b; border-color: #334155; }
499
+ .nq-embed-body.nq-embed-theme-night .nq-chart-error { background: #450a0a; color: #fecaca; }
500
+ .nq-embed-body.nq-embed-theme-transparent { background: transparent; }