@social-mail/social-mail-web-server 1.8.481 → 1.8.483

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-web-server",
3
- "version": "1.8.481",
3
+ "version": "1.8.483",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -22,8 +22,8 @@
22
22
  "dependencies": {
23
23
  "@aws-sdk/client-s3": "^3.913.0",
24
24
  "@azure/storage-blob": "^12.29.1",
25
- "@entity-access/entity-access": "^1.0.528",
26
- "@entity-access/server-pages": "^1.1.565",
25
+ "@entity-access/entity-access": "^1.0.532",
26
+ "@entity-access/server-pages": "^1.1.575",
27
27
  "@parse/node-apn": "^6.5.0",
28
28
  "@paypal/paypal-server-sdk": "^1.0.0",
29
29
  "@peculiar/asn1-schema": "^2.3.15",
@@ -58,6 +58,85 @@ async function inlineCSS(window, document: Document){
58
58
 
59
59
  let id = Date.now();
60
60
 
61
+ window.CSS ??= {};
62
+
63
+ window.CSS.escape = function(value) {
64
+ if (!value) {
65
+ throw new TypeError('`CSS.escape` requires an argument.');
66
+ }
67
+ const text = String(value);
68
+ const length = text.length;
69
+ let index = -1;
70
+ let codeUnit;
71
+ let result = '';
72
+ const firstCodeUnit = text.charCodeAt(0);
73
+
74
+ if (
75
+ // If the character is the first character and is a `-` (U+002D), and
76
+ // there is no second character, […]
77
+ length === 1 &&
78
+ firstCodeUnit === 0x002D
79
+ ) {
80
+ return '\\' + text;
81
+ }
82
+
83
+ while (++index < length) {
84
+ codeUnit = text.charCodeAt(index);
85
+ // Note: there’s no need to special-case astral symbols, surrogate
86
+ // pairs, or lone surrogates.
87
+
88
+ // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER
89
+ // (U+FFFD).
90
+ if (codeUnit === 0x0000) {
91
+ result += '\uFFFD';
92
+ continue;
93
+ }
94
+
95
+ if (
96
+ // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
97
+ // U+007F, […]
98
+ (codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit === 0x007F ||
99
+ // If the character is the first character and is in the range [0-9]
100
+ // (U+0030 to U+0039), […]
101
+ (index === 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||
102
+ // If the character is the second character and is in the range [0-9]
103
+ // (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
104
+ (
105
+ index === 1 &&
106
+ codeUnit >= 0x0030 && codeUnit <= 0x0039 &&
107
+ firstCodeUnit === 0x002D
108
+ )
109
+ ) {
110
+ // https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
111
+ result += '\\' + codeUnit.toString(16) + ' ';
112
+ continue;
113
+ }
114
+
115
+ // If the character is not handled by one of the above rules and is
116
+ // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
117
+ // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
118
+ // U+005A), or [a-z] (U+0061 to U+007A), […]
119
+ if (
120
+ codeUnit >= 0x0080 ||
121
+ codeUnit === 0x002D ||
122
+ codeUnit === 0x005F ||
123
+ codeUnit >= 0x0030 && codeUnit <= 0x0039 ||
124
+ codeUnit >= 0x0041 && codeUnit <= 0x005A ||
125
+ codeUnit >= 0x0061 && codeUnit <= 0x007A
126
+ ) {
127
+ // the character itself
128
+ result += text.charAt(index);
129
+ continue;
130
+ }
131
+
132
+ // Otherwise, the escaped character.
133
+ // https://drafts.csswg.org/cssom/#escape-a-character
134
+ result += '\\' + text.charAt(index);
135
+ }
136
+ return result;
137
+ };
138
+
139
+
61
140
  async function flattenStyleSheets() {
62
141
  const includes = document.querySelectorAll(`link[rel="stylesheet"]`);
63
142
  const tasks = [];