single-file-core 1.5.8 → 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 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;
@@ -67,6 +68,11 @@ const INFOBAR_STYLES = `
67
68
  border-color: #eee;
68
69
  border-radius: 16px;
69
70
  z-index: 2147483647;
71
+ animation-name: flash;
72
+ animation-duration: .5s;
73
+ animation-timing-function: cubic-bezier(0.39, 0.58, 0.57, 1);
74
+ animation-delay: 1s;
75
+ animation-iteration-count: 2;
70
76
  }
71
77
 
72
78
  .infobar:valid, .infobar:not(:focus-within) .infobar-content {
@@ -78,12 +84,15 @@ const INFOBAR_STYLES = `
78
84
  border-color: #878787;
79
85
  border-radius: 8px;
80
86
  opacity: 1;
81
- transition-property: opacity, background-color, border-color, border-radius,
82
- color;
87
+ transition-property: opacity, background-color, border-color, border-radius, color;
83
88
  }
84
89
 
85
90
  .infobar-content {
86
- align-items: center;
91
+ border: 2px solid;
92
+ border-color: #f9f9f9;
93
+ border-radius: 6px;
94
+ background-color: #f9f9f9;
95
+ overflow: auto;
87
96
  }
88
97
 
89
98
  .infobar-content span {
@@ -94,6 +103,7 @@ const INFOBAR_STYLES = `
94
103
  white-space: pre-wrap;
95
104
  margin-inline: 4px;
96
105
  margin-block: 4px;
106
+ padding-inline: 24px;
97
107
  }
98
108
 
99
109
  .infobar .infobar-icon,
@@ -106,6 +116,7 @@ const INFOBAR_STYLES = `
106
116
 
107
117
  .infobar .infobar-close-icon,
108
118
  .infobar .infobar-link-icon {
119
+ position: fixed;
109
120
  align-self: flex-start;
110
121
  }
111
122
 
@@ -115,6 +126,15 @@ const INFOBAR_STYLES = `
115
126
  min-block-size: 24px;
116
127
  }
117
128
 
129
+ @keyframes flash {
130
+ 0%, 100% {
131
+ background-color: #737373;
132
+ }
133
+ 50% {
134
+ background-color: #dd6a00;
135
+ }
136
+ }
137
+
118
138
  .infobar:focus-within .infobar-icon {
119
139
  z-index: -1;
120
140
  background-image: none;
@@ -132,6 +152,7 @@ const INFOBAR_STYLES = `
132
152
  }
133
153
 
134
154
  .infobar .infobar-link-icon {
155
+ right: 20px;
135
156
  background-size: 60%;
136
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);
137
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.5.8",
3
+ "version": "1.5.10",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",