plutonium 0.53.1 → 0.54.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 +4 -4
- data/CHANGELOG.md +24 -0
- data/app/assets/plutonium.css +1 -1
- data/app/assets/plutonium.js +22 -6
- data/app/assets/plutonium.js.map +3 -3
- data/app/assets/plutonium.min.js +8 -8
- data/app/assets/plutonium.min.js.map +3 -3
- data/app/views/plutonium/_flash_alerts.html.erb +8 -17
- data/app/views/plutonium/_flash_toasts.html.erb +9 -18
- data/docs/superpowers/specs/2026-06-01-interaction-repeater-inputs-design.md +178 -0
- data/gemfiles/rails_8.1.gemfile.lock +1 -1
- data/lib/plutonium/engine/validator.rb +11 -4
- data/lib/plutonium/ui/form/resource.rb +11 -4
- data/lib/plutonium/ui/form/theme.rb +14 -3
- data/lib/plutonium/version.rb +1 -1
- data/package.json +1 -1
- data/src/css/components.css +109 -0
- data/src/js/controllers/capture_url_controller.js +20 -7
- data/src/js/controllers/dirty_form_guard_controller.js +28 -4
- data/src/js/controllers/icon_rail_flyout_controller.js +5 -2
- data/src/js/controllers/remote_modal_controller.js +5 -0
- metadata +4 -3
data/app/assets/plutonium.js
CHANGED
|
@@ -27613,6 +27613,7 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e4.byteLength}`), e4.tif
|
|
|
27613
27613
|
this.#animateClose();
|
|
27614
27614
|
}
|
|
27615
27615
|
#onCancel(event) {
|
|
27616
|
+
if (event.target !== this.element) return;
|
|
27616
27617
|
if (event.defaultPrevented) return;
|
|
27617
27618
|
event.preventDefault();
|
|
27618
27619
|
this.#animateClose();
|
|
@@ -28066,7 +28067,8 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e4.byteLength}`), e4.tif
|
|
|
28066
28067
|
const viewportH = window.innerHeight;
|
|
28067
28068
|
if (panelRect.bottom > viewportH - 8) {
|
|
28068
28069
|
const overflow = panelRect.bottom - (viewportH - 8);
|
|
28069
|
-
|
|
28070
|
+
const top2 = Math.max(8, parseFloat(panel.style.top) - overflow);
|
|
28071
|
+
panel.style.top = `${top2}px`;
|
|
28070
28072
|
}
|
|
28071
28073
|
});
|
|
28072
28074
|
}
|
|
@@ -28125,9 +28127,12 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e4.byteLength}`), e4.tif
|
|
|
28125
28127
|
// src/js/controllers/capture_url_controller.js
|
|
28126
28128
|
var capture_url_controller_default = class extends Controller {
|
|
28127
28129
|
connect() {
|
|
28128
|
-
if ("value" in this.element)
|
|
28129
|
-
|
|
28130
|
-
|
|
28130
|
+
if (!("value" in this.element)) return;
|
|
28131
|
+
const base = this.element.value;
|
|
28132
|
+
if (!base) return;
|
|
28133
|
+
const { hash: hash3 } = window.location;
|
|
28134
|
+
if (!hash3) return;
|
|
28135
|
+
this.element.value = base.split("#")[0] + hash3;
|
|
28131
28136
|
}
|
|
28132
28137
|
};
|
|
28133
28138
|
|
|
@@ -28212,9 +28217,9 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e4.byteLength}`), e4.tif
|
|
|
28212
28217
|
this.confirmDialogTarget.removeEventListener("cancel", this.onConfirmCancel);
|
|
28213
28218
|
}
|
|
28214
28219
|
}
|
|
28215
|
-
|
|
28220
|
+
discard() {
|
|
28216
28221
|
this.forceClose = true;
|
|
28217
|
-
|
|
28222
|
+
this.#snapConfirmClosed();
|
|
28218
28223
|
this.dialog.dispatchEvent(new CustomEvent("modal:request-close"));
|
|
28219
28224
|
}
|
|
28220
28225
|
keepEditing() {
|
|
@@ -28258,6 +28263,7 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e4.byteLength}`), e4.tif
|
|
|
28258
28263
|
this.#promptDiscard();
|
|
28259
28264
|
}
|
|
28260
28265
|
#onCancel(event) {
|
|
28266
|
+
if (event.target !== this.dialog) return;
|
|
28261
28267
|
if (this.forceClose || this.submitting) return;
|
|
28262
28268
|
if (!this.#isDirty()) return;
|
|
28263
28269
|
event.preventDefault();
|
|
@@ -28285,6 +28291,16 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e4.byteLength}`), e4.tif
|
|
|
28285
28291
|
this.dialog.dispatchEvent(new CustomEvent("modal:request-close"));
|
|
28286
28292
|
}
|
|
28287
28293
|
}
|
|
28294
|
+
// Close the confirm immediately, skipping its exit transition. Used by
|
|
28295
|
+
// discard(), where the parent modal is about to animate away and a
|
|
28296
|
+
// separate confirm fade would only stutter against the modal's live
|
|
28297
|
+
// backdrop blur.
|
|
28298
|
+
#snapConfirmClosed() {
|
|
28299
|
+
if (!this.hasConfirmDialogTarget) return;
|
|
28300
|
+
const d4 = this.confirmDialogTarget;
|
|
28301
|
+
d4.removeAttribute("data-open");
|
|
28302
|
+
if (d4.open) d4.close();
|
|
28303
|
+
}
|
|
28288
28304
|
async #closeConfirm() {
|
|
28289
28305
|
if (!this.hasConfirmDialogTarget) return;
|
|
28290
28306
|
const d4 = this.confirmDialogTarget;
|