@hotwired/turbo 8.0.10 → 8.0.11
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.
- package/dist/turbo.es2017-esm.js +14 -8
- package/dist/turbo.es2017-umd.js +14 -8
- package/package.json +1 -1
package/dist/turbo.es2017-esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Turbo 8.0.
|
|
2
|
+
Turbo 8.0.11
|
|
3
3
|
Copyright © 2024 37signals LLC
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -313,7 +313,7 @@ function activateScriptElement(element) {
|
|
|
313
313
|
return element
|
|
314
314
|
} else {
|
|
315
315
|
const createdScriptElement = document.createElement("script");
|
|
316
|
-
const cspNonce =
|
|
316
|
+
const cspNonce = getCspNonce();
|
|
317
317
|
if (cspNonce) {
|
|
318
318
|
createdScriptElement.nonce = cspNonce;
|
|
319
319
|
}
|
|
@@ -486,6 +486,15 @@ function getMetaContent(name) {
|
|
|
486
486
|
return element && element.content
|
|
487
487
|
}
|
|
488
488
|
|
|
489
|
+
function getCspNonce() {
|
|
490
|
+
const element = getMetaElement("csp-nonce");
|
|
491
|
+
|
|
492
|
+
if (element) {
|
|
493
|
+
const { nonce, content } = element;
|
|
494
|
+
return nonce == "" ? content : nonce
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
489
498
|
function setMetaContent(name, content) {
|
|
490
499
|
let element = getMetaElement(name);
|
|
491
500
|
|
|
@@ -3035,8 +3044,9 @@ class ProgressBar {
|
|
|
3035
3044
|
const element = document.createElement("style");
|
|
3036
3045
|
element.type = "text/css";
|
|
3037
3046
|
element.textContent = ProgressBar.defaultCSS;
|
|
3038
|
-
|
|
3039
|
-
|
|
3047
|
+
const cspNonce = getCspNonce();
|
|
3048
|
+
if (cspNonce) {
|
|
3049
|
+
element.nonce = cspNonce;
|
|
3040
3050
|
}
|
|
3041
3051
|
return element
|
|
3042
3052
|
}
|
|
@@ -3046,10 +3056,6 @@ class ProgressBar {
|
|
|
3046
3056
|
element.className = "turbo-progress-bar";
|
|
3047
3057
|
return element
|
|
3048
3058
|
}
|
|
3049
|
-
|
|
3050
|
-
get cspNonce() {
|
|
3051
|
-
return getMetaContent("csp-nonce")
|
|
3052
|
-
}
|
|
3053
3059
|
}
|
|
3054
3060
|
|
|
3055
3061
|
class HeadSnapshot extends Snapshot {
|
package/dist/turbo.es2017-umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Turbo 8.0.
|
|
2
|
+
Turbo 8.0.11
|
|
3
3
|
Copyright © 2024 37signals LLC
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -319,7 +319,7 @@ Copyright © 2024 37signals LLC
|
|
|
319
319
|
return element
|
|
320
320
|
} else {
|
|
321
321
|
const createdScriptElement = document.createElement("script");
|
|
322
|
-
const cspNonce =
|
|
322
|
+
const cspNonce = getCspNonce();
|
|
323
323
|
if (cspNonce) {
|
|
324
324
|
createdScriptElement.nonce = cspNonce;
|
|
325
325
|
}
|
|
@@ -492,6 +492,15 @@ Copyright © 2024 37signals LLC
|
|
|
492
492
|
return element && element.content
|
|
493
493
|
}
|
|
494
494
|
|
|
495
|
+
function getCspNonce() {
|
|
496
|
+
const element = getMetaElement("csp-nonce");
|
|
497
|
+
|
|
498
|
+
if (element) {
|
|
499
|
+
const { nonce, content } = element;
|
|
500
|
+
return nonce == "" ? content : nonce
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
495
504
|
function setMetaContent(name, content) {
|
|
496
505
|
let element = getMetaElement(name);
|
|
497
506
|
|
|
@@ -3041,8 +3050,9 @@ Copyright © 2024 37signals LLC
|
|
|
3041
3050
|
const element = document.createElement("style");
|
|
3042
3051
|
element.type = "text/css";
|
|
3043
3052
|
element.textContent = ProgressBar.defaultCSS;
|
|
3044
|
-
|
|
3045
|
-
|
|
3053
|
+
const cspNonce = getCspNonce();
|
|
3054
|
+
if (cspNonce) {
|
|
3055
|
+
element.nonce = cspNonce;
|
|
3046
3056
|
}
|
|
3047
3057
|
return element
|
|
3048
3058
|
}
|
|
@@ -3052,10 +3062,6 @@ Copyright © 2024 37signals LLC
|
|
|
3052
3062
|
element.className = "turbo-progress-bar";
|
|
3053
3063
|
return element
|
|
3054
3064
|
}
|
|
3055
|
-
|
|
3056
|
-
get cspNonce() {
|
|
3057
|
-
return getMetaContent("csp-nonce")
|
|
3058
|
-
}
|
|
3059
3065
|
}
|
|
3060
3066
|
|
|
3061
3067
|
class HeadSnapshot extends Snapshot {
|
package/package.json
CHANGED