xpine 0.0.35 → 0.0.37
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/index.js
CHANGED
|
@@ -694,8 +694,8 @@ var plugin2 = (opts = {}) => {
|
|
|
694
694
|
},
|
|
695
695
|
OnceExit(root) {
|
|
696
696
|
root.append([
|
|
697
|
-
|
|
698
|
-
|
|
697
|
+
`:root {`,
|
|
698
|
+
`--active-breakpoint: "default";`,
|
|
699
699
|
`}`
|
|
700
700
|
].join(""));
|
|
701
701
|
const nodeValuesMapped = nodeValues.sort((a, b) => {
|
|
@@ -703,8 +703,8 @@ var plugin2 = (opts = {}) => {
|
|
|
703
703
|
}).map(({ breakpoint, value }) => {
|
|
704
704
|
return [
|
|
705
705
|
`@media (min-width: ${value}) {`,
|
|
706
|
-
|
|
707
|
-
|
|
706
|
+
`:root {`,
|
|
707
|
+
`--active-breakpoint: "${breakpoint}";`,
|
|
708
708
|
`}`,
|
|
709
709
|
`}`
|
|
710
710
|
].join("");
|
|
@@ -503,8 +503,8 @@ var plugin2 = (opts = {}) => {
|
|
|
503
503
|
},
|
|
504
504
|
OnceExit(root) {
|
|
505
505
|
root.append([
|
|
506
|
-
|
|
507
|
-
|
|
506
|
+
`:root {`,
|
|
507
|
+
`--active-breakpoint: "default";`,
|
|
508
508
|
`}`
|
|
509
509
|
].join(""));
|
|
510
510
|
const nodeValuesMapped = nodeValues.sort((a, b) => {
|
|
@@ -512,8 +512,8 @@ var plugin2 = (opts = {}) => {
|
|
|
512
512
|
}).map(({ breakpoint, value }) => {
|
|
513
513
|
return [
|
|
514
514
|
`@media (min-width: ${value}) {`,
|
|
515
|
-
|
|
516
|
-
|
|
515
|
+
`:root {`,
|
|
516
|
+
`--active-breakpoint: "${breakpoint}";`,
|
|
517
517
|
`}`,
|
|
518
518
|
`}`
|
|
519
519
|
].join("");
|
|
@@ -510,8 +510,8 @@ var plugin2 = (opts = {}) => {
|
|
|
510
510
|
},
|
|
511
511
|
OnceExit(root) {
|
|
512
512
|
root.append([
|
|
513
|
-
|
|
514
|
-
|
|
513
|
+
`:root {`,
|
|
514
|
+
`--active-breakpoint: "default";`,
|
|
515
515
|
`}`
|
|
516
516
|
].join(""));
|
|
517
517
|
const nodeValuesMapped = nodeValues.sort((a, b) => {
|
|
@@ -519,8 +519,8 @@ var plugin2 = (opts = {}) => {
|
|
|
519
519
|
}).map(({ breakpoint, value }) => {
|
|
520
520
|
return [
|
|
521
521
|
`@media (min-width: ${value}) {`,
|
|
522
|
-
|
|
523
|
-
|
|
522
|
+
`:root {`,
|
|
523
|
+
`--active-breakpoint: "${breakpoint}";`,
|
|
524
524
|
`}`,
|
|
525
525
|
`}`
|
|
526
526
|
].join("");
|
package/dist/src/static/spa.js
CHANGED
|
@@ -201,12 +201,13 @@ function handleBreakpointEvents() {
|
|
|
201
201
|
let lastSentBreakpoint = "";
|
|
202
202
|
let initial = true;
|
|
203
203
|
return function() {
|
|
204
|
-
const breakpoint = window.getComputedStyle(document.
|
|
204
|
+
const breakpoint = window.getComputedStyle(document.documentElement).getPropertyValue("--active-breakpoint")?.replace(/[\'\"]/g, "")?.trim() || "";
|
|
205
205
|
if (breakpoint !== lastSentBreakpoint) {
|
|
206
206
|
const event = new CustomEvent("breakpoint-change", {
|
|
207
207
|
detail: {
|
|
208
208
|
breakpoint,
|
|
209
|
-
initial
|
|
209
|
+
initial,
|
|
210
|
+
previous: lastSentBreakpoint
|
|
210
211
|
}
|
|
211
212
|
});
|
|
212
213
|
window.dispatchEvent(event);
|