blazer 3.5.0 → 3.5.1

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: ec2b494fc5ea15a06d18125d5c9d9173ee84adedb30016f935225904b31dbd65
4
- data.tar.gz: a6ea63deaff42cce760843f2171ef125e946b5a1f68f14f49ed2051b94f4d4d1
3
+ metadata.gz: b7506f6c446fe95dce3cc747a7687c958c3bbf16fe936d339af3dad38cd4266d
4
+ data.tar.gz: 2885833c997a9145746158a5431330e67bb11a18af780dc57b45795b9fd34ceb
5
5
  SHA512:
6
- metadata.gz: a777e72613329d828de10a17d6e43f2edeaf0ac9c84cc757372b19f8f63586c67866801e215aa67507a34c06b41c0e53c1c7316a5472d3a390addbec0c4259be
7
- data.tar.gz: 43621f36af5f8069184ace5f0519c051de42fa5b367353614c34a3344203984221909aeb4f36852247e8ac909c2f03e7d9269cca493c669b0dcaef254b741946
6
+ metadata.gz: 8e773b1b9bd9a470f33a52d98d89bc4067a5aad85d4b7173a36f2c486b287b13d2f282ea7a4506a9a4e85c1d293a53a6dbe7e7bf47c849b27dfe98fae9e4fbc3
7
+ data.tar.gz: e944e8de07d1032c80fd501b08f9bf06e9176503fa6c3fe15a3134af756b31cbaa7d215556ba12f8e8f433339d5ba415a90eb1834b951404035a7db0c0836689
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 3.5.1 (2026-07-31)
2
+
3
+ - Fixed delete buttons
4
+ - Fixed table preview and schema page for Postgres < 16
5
+ - Fixed error with Sass
6
+
1
7
  ## 3.5.0 (2026-07-27)
2
8
 
3
9
  - Fixed stored XSS vulnerability - [more info](https://github.com/ankane/blazer/security/advisories/GHSA-m5f6-4589-m89f)
@@ -58,10 +58,43 @@ document.addEventListener("click", function (e) {
58
58
  if (target) {
59
59
  if (!window.confirm(target.getAttribute("data-confirm"))) {
60
60
  e.preventDefault()
61
+ e.stopImmediatePropagation()
61
62
  }
62
63
  }
63
64
  })
64
65
 
66
+ function isSameOrigin(href) {
67
+ return new URL(href, window.location.href).origin === window.location.origin
68
+ }
69
+
70
+ document.addEventListener("click", function (e) {
71
+ const target = e.target.closest("a[data-method]")
72
+ if (target) {
73
+ e.preventDefault()
74
+
75
+ const form = document.createElement("form")
76
+ form.method = "post"
77
+ form.action = target.href
78
+ form.hidden = true
79
+
80
+ let params = {"_method": target.getAttribute("data-method")}
81
+ if (isSameOrigin(target.href)) {
82
+ params = csrfProtect(params)
83
+ }
84
+
85
+ for (const [k, v] of Object.entries(params)) {
86
+ const input = document.createElement("input")
87
+ input.type = "hidden"
88
+ input.name = k
89
+ input.value = v
90
+ form.append(input)
91
+ }
92
+
93
+ document.body.append(form)
94
+ form.submit()
95
+ }
96
+ })
97
+
65
98
  // make autofocus work with back button
66
99
  window.addEventListener("pageshow", function (e) {
67
100
  if (e.persisted) {
@@ -225,7 +225,7 @@
225
225
  cursor: pointer;
226
226
  }
227
227
  .plugin-clear_button.form-select .clear-button, .plugin-clear_button.single .clear-button {
228
- right: max(var(--ts-pr-caret), 8px);
228
+ right: Max(var(--ts-pr-caret), 8px);
229
229
  }
230
230
  .plugin-clear_button.focus.has-items .clear-button, .plugin-clear_button:not(.disabled):hover.has-items .clear-button {
231
231
  opacity: 1;
@@ -373,11 +373,11 @@
373
373
  }
374
374
 
375
375
  .ts-control:not(.rtl) {
376
- padding-right: max(var(--ts-pr-min), var(--ts-pr-clear-button) + var(--ts-pr-caret)) !important;
376
+ padding-right: Max(var(--ts-pr-min), calc(var(--ts-pr-clear-button) + var(--ts-pr-caret))) !important;
377
377
  }
378
378
 
379
379
  .ts-control.rtl {
380
- padding-left: max(var(--ts-pr-min), var(--ts-pr-clear-button) + var(--ts-pr-caret)) !important;
380
+ padding-left: Max(var(--ts-pr-min), calc(var(--ts-pr-clear-button) + var(--ts-pr-caret))) !important;
381
381
  }
382
382
 
383
383
  .ts-wrapper {
@@ -75,7 +75,7 @@ module Blazer
75
75
  if sqlite?
76
76
  "SELECT NULL, name FROM sqlite_master WHERE type IN ('table', 'view') ORDER BY name"
77
77
  elsif postgresql?
78
- add_schemas("SELECT * FROM (SELECT table_schema, table_name FROM information_schema.tables UNION ALL SELECT n.nspname AS table_schema, c.relname AS table_name FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE c.relkind = 'm' AND has_any_column_privilege(c.oid, 'SELECT'))")
78
+ add_schemas("SELECT * FROM (SELECT table_schema, table_name FROM information_schema.tables UNION ALL SELECT n.nspname AS table_schema, c.relname AS table_name FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE c.relkind = 'm' AND has_any_column_privilege(c.oid, 'SELECT')) AS tables")
79
79
  else
80
80
  add_schemas("SELECT table_schema, table_name FROM information_schema.tables")
81
81
  end
@@ -106,7 +106,7 @@ module Blazer
106
106
  if sqlite?
107
107
  "SELECT NULL, t.name, c.name, c.type, c.cid FROM sqlite_master t INNER JOIN pragma_table_info(t.name) c WHERE t.type IN ('table', 'view')"
108
108
  elsif postgresql?
109
- add_schemas("SELECT * FROM (SELECT table_schema, table_name, column_name, data_type, ordinal_position FROM information_schema.columns UNION ALL SELECT n.nspname AS table_schema, c.relname AS table_name, a.attname AS column_name, format_type(a.atttypid, a.atttypmod) AS data_type, a.attnum AS ordinal_position FROM pg_attribute a INNER JOIN pg_class c ON a.attrelid = c.oid INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE a.attnum > 0 AND NOT a.attisdropped AND c.relkind = 'm' AND has_column_privilege(c.oid, a.attnum, 'SELECT'))")
109
+ add_schemas("SELECT * FROM (SELECT table_schema, table_name, column_name, data_type, ordinal_position FROM information_schema.columns UNION ALL SELECT n.nspname AS table_schema, c.relname AS table_name, a.attname AS column_name, format_type(a.atttypid, a.atttypmod) AS data_type, a.attnum AS ordinal_position FROM pg_attribute a INNER JOIN pg_class c ON a.attrelid = c.oid INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE a.attnum > 0 AND NOT a.attisdropped AND c.relkind = 'm' AND has_column_privilege(c.oid, a.attnum, 'SELECT')) AS columns")
110
110
  else
111
111
  add_schemas("SELECT table_schema, table_name, column_name, data_type, ordinal_position FROM information_schema.columns")
112
112
  end
@@ -1,3 +1,3 @@
1
1
  module Blazer
2
- VERSION = "3.5.0"
2
+ VERSION = "3.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blazer
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane