single-file-core 1.5.9 → 1.5.10
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/core/infobar.js +10 -5
- package/modules/template-formatter.js +29 -1
- package/package.json +1 -1
package/core/infobar.js
CHANGED
|
@@ -57,6 +57,7 @@ const INFOBAR_STYLES = `
|
|
|
57
57
|
|
|
58
58
|
.infobar {
|
|
59
59
|
position: fixed;
|
|
60
|
+
max-height: calc(100% - 32px);
|
|
60
61
|
top: 16px;
|
|
61
62
|
right: 16px;
|
|
62
63
|
margin-inline-start: 16px;
|
|
@@ -84,11 +85,14 @@ const INFOBAR_STYLES = `
|
|
|
84
85
|
border-radius: 8px;
|
|
85
86
|
opacity: 1;
|
|
86
87
|
transition-property: opacity, background-color, border-color, border-radius, color;
|
|
87
|
-
animation-play-state: paused;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
.infobar-content {
|
|
91
|
-
|
|
91
|
+
border: 2px solid;
|
|
92
|
+
border-color: #f9f9f9;
|
|
93
|
+
border-radius: 6px;
|
|
94
|
+
background-color: #f9f9f9;
|
|
95
|
+
overflow: auto;
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
.infobar-content span {
|
|
@@ -99,6 +103,7 @@ const INFOBAR_STYLES = `
|
|
|
99
103
|
white-space: pre-wrap;
|
|
100
104
|
margin-inline: 4px;
|
|
101
105
|
margin-block: 4px;
|
|
106
|
+
padding-inline: 24px;
|
|
102
107
|
}
|
|
103
108
|
|
|
104
109
|
.infobar .infobar-icon,
|
|
@@ -111,6 +116,7 @@ const INFOBAR_STYLES = `
|
|
|
111
116
|
|
|
112
117
|
.infobar .infobar-close-icon,
|
|
113
118
|
.infobar .infobar-link-icon {
|
|
119
|
+
position: fixed;
|
|
114
120
|
align-self: flex-start;
|
|
115
121
|
}
|
|
116
122
|
|
|
@@ -123,11 +129,9 @@ const INFOBAR_STYLES = `
|
|
|
123
129
|
@keyframes flash {
|
|
124
130
|
0%, 100% {
|
|
125
131
|
background-color: #737373;
|
|
126
|
-
opacity: .7;
|
|
127
132
|
}
|
|
128
133
|
50% {
|
|
129
|
-
background-color: #
|
|
130
|
-
opacity: 1;
|
|
134
|
+
background-color: #dd6a00;
|
|
131
135
|
}
|
|
132
136
|
}
|
|
133
137
|
|
|
@@ -148,6 +152,7 @@ const INFOBAR_STYLES = `
|
|
|
148
152
|
}
|
|
149
153
|
|
|
150
154
|
.infobar .infobar-link-icon {
|
|
155
|
+
right: 20px;
|
|
151
156
|
background-size: 60%;
|
|
152
157
|
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABAAgMAAADXB5lNAAABhmlDQ1BJQ0MgcHJvZmlsZQAAKJF9kj1Iw0AYht+mSkUrDnYQcchQnSyIijqWKhbBQmkrtOpgcukfNGlIUlwcBdeCgz+LVQcXZ10dXAVB8AfEydFJ0UVK/C4ptIjx4LiH9+59+e67A4RGhalm1wSgapaRisfEbG5VDLyiDwEAvZiVmKkn0osZeI6ve/j4ehfhWd7n/hz9St5kgE8kjjLdsIg3iGc2LZ3zPnGIlSSF+Jx43KACiR+5Lrv8xrnosMAzQ0YmNU8cIhaLHSx3MCsZKvE0cVhRNcoXsi4rnLc4q5Uaa9XJbxjMaytprtMcQRxLSCAJETJqKKMCCxFaNVJMpGg/5uEfdvxJcsnkKoORYwFVqJAcP/gb/O6tWZiadJOCMaD7xbY/RoHALtCs2/b3sW03TwD/M3Cltf3VBjD3SXq9rYWPgIFt4OK6rcl7wOUOMPSkS4bkSH6aQqEAvJ/RM+WAwVv6EGtu31r7OH0AMtSr5Rvg4BAYK1L2use9ezr79u+ZVv9+AFlNcp0UUpiqAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH5AsHAB8H+DhhoQAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAAJUExURQAAAICHi4qKioTuJAkAAAABdFJOUwBA5thmAAAAAWJLR0QCZgt8ZAAAAJJJREFUOI3t070NRCEMA2CnYAOyDyPwpHj/Va7hJ3FzV7zy3ET5JIwoAF6Jk4wzAJAkzxAYG9YRTgB+24wBgKmfrGAKTcEfAY4KRlRoIeBTgKOCERVaCPgU4Khge2GqKOBTgKOCERVaAEC/4PNcnyoSWHpjqkhwKxbcig0Q6AorXYF/+A6eIYD1lVbwG/jdA6/kA2THRAURVubcAAAAAElFTkSuQmCC);
|
|
153
158
|
}
|
|
@@ -29,6 +29,7 @@ import { getContentSize, digest } from "./../core/helper.js";
|
|
|
29
29
|
const Blob = globalThis.Blob;
|
|
30
30
|
const FileReader = globalThis.FileReader;
|
|
31
31
|
const URL = globalThis.URL;
|
|
32
|
+
const Intl = globalThis.Intl;
|
|
32
33
|
const URLSearchParams = globalThis.URLSearchParams;
|
|
33
34
|
const navigator = globalThis.navigator;
|
|
34
35
|
|
|
@@ -17019,11 +17020,38 @@ async function evalTemplate(template = "", options, content, doc, dontReplaceSla
|
|
|
17019
17020
|
"decode-uri-component": value => { try { return decodeURIComponent(value); } catch (error) { return value; } },
|
|
17020
17021
|
"date-locale": locales => new Date().toLocaleDateString(locales),
|
|
17021
17022
|
"time-locale": locales => new Date().toLocaleTimeString(locales),
|
|
17022
|
-
"datetime-locale": locales => new Date().toLocaleString(locales)
|
|
17023
|
+
"datetime-locale": locales => new Date().toLocaleString(locales),
|
|
17024
|
+
"datetime-custom": (locale, year, month, day, weekday, hour, minute, second, hour12, timeZone, fractionalSecondDigits, timeZoneName, era, localeMatcher) => {
|
|
17025
|
+
const date = new Date();
|
|
17026
|
+
const options = {};
|
|
17027
|
+
setOption(options, "year", year);
|
|
17028
|
+
setOption(options, "month", month);
|
|
17029
|
+
setOption(options, "day", day);
|
|
17030
|
+
setOption(options, "weekday", weekday);
|
|
17031
|
+
setOption(options, "hour", hour);
|
|
17032
|
+
setOption(options, "minute", minute);
|
|
17033
|
+
setOption(options, "second", second);
|
|
17034
|
+
setOption(options, "hour12", hour12);
|
|
17035
|
+
setOption(options, "timeZone", timeZone);
|
|
17036
|
+
setOption(options, "fractionalSecondDigits", fractionalSecondDigits);
|
|
17037
|
+
setOption(options, "timeZoneName", timeZoneName);
|
|
17038
|
+
setOption(options, "era", era);
|
|
17039
|
+
setOption(options, "localeMatcher", localeMatcher);
|
|
17040
|
+
return new Intl.DateTimeFormat(locale, options).format(date);
|
|
17041
|
+
|
|
17042
|
+
function setOption(options, name, value) {
|
|
17043
|
+
if (value == " ") {
|
|
17044
|
+
options[name] = undefined;
|
|
17045
|
+
} else if (value) {
|
|
17046
|
+
options[name] = value;
|
|
17047
|
+
}
|
|
17048
|
+
}
|
|
17049
|
+
}
|
|
17023
17050
|
};
|
|
17024
17051
|
functions["date-locale"].dontReplaceSlash = false;
|
|
17025
17052
|
functions["time-locale"].dontReplaceSlash = false;
|
|
17026
17053
|
functions["datetime-locale"].dontReplaceSlash = false;
|
|
17054
|
+
functions["datetime-custom"].dontReplaceSlash = false;
|
|
17027
17055
|
if (doc) {
|
|
17028
17056
|
functions["page-element-text"] = (selector) => {
|
|
17029
17057
|
const element = doc.querySelector(selector);
|