@fc3/mmcadi 0.1.48 → 0.1.49
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/.last-compile-time +1 -1
- package/dist/.last-publish-time +1 -1
- package/dist/client.js +978 -49
- package/dist/src/client/page/cursor.d.ts +8 -1
- package/dist/src/client/page/cursor.js +190 -29
- package/dist/src/client/page/cursor.js.map +1 -1
- package/dist/src/client/page/history.js.map +1 -1
- package/dist/src/client/page/view-custom.js +3 -0
- package/dist/src/client/page/view-custom.js.map +1 -1
- package/dist/src/client/page.d.ts +1 -1
- package/dist/src/client/page.js +24 -13
- package/dist/src/client/page.js.map +1 -1
- package/dist/src/enum/emoji.d.ts +3 -1
- package/dist/src/enum/emoji.js +2 -0
- package/dist/src/enum/emoji.js.map +1 -1
- package/dist/src/server/serializer/base.d.ts +1 -0
- package/dist/src/server/serializer/base.js +46 -2
- package/dist/src/server/serializer/base.js.map +1 -1
- package/dist/src/server/serializer/block/audio.js +31 -5
- package/dist/src/server/serializer/block/audio.js.map +1 -1
- package/dist/src/server/serializer/block/video.js +1 -1
- package/dist/src/server/serializer/page.js +5 -3
- package/dist/src/server/serializer/page.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/client.js
CHANGED
|
@@ -888,10 +888,10 @@
|
|
|
888
888
|
"node_modules/@fc3/array/dist/src/get-first-value.js"(exports) {
|
|
889
889
|
"use strict";
|
|
890
890
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
891
|
-
function
|
|
891
|
+
function getFirstValue2(array) {
|
|
892
892
|
return array[0];
|
|
893
893
|
}
|
|
894
|
-
exports.default =
|
|
894
|
+
exports.default = getFirstValue2;
|
|
895
895
|
}
|
|
896
896
|
});
|
|
897
897
|
|
|
@@ -963,6 +963,767 @@
|
|
|
963
963
|
}
|
|
964
964
|
});
|
|
965
965
|
|
|
966
|
+
// node_modules/@fc3/time/dist/src/enum/time-interval.js
|
|
967
|
+
var require_time_interval = __commonJS({
|
|
968
|
+
"node_modules/@fc3/time/dist/src/enum/time-interval.js"(exports) {
|
|
969
|
+
"use strict";
|
|
970
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
971
|
+
var TimeInterval2;
|
|
972
|
+
(function(TimeInterval3) {
|
|
973
|
+
TimeInterval3[TimeInterval3["ONE_FRAME"] = 16] = "ONE_FRAME";
|
|
974
|
+
TimeInterval3[TimeInterval3["ONE_SECOND"] = 1e3] = "ONE_SECOND";
|
|
975
|
+
TimeInterval3[TimeInterval3["ONE_MINUTE"] = 6e4] = "ONE_MINUTE";
|
|
976
|
+
TimeInterval3[TimeInterval3["ONE_HOUR"] = 36e5] = "ONE_HOUR";
|
|
977
|
+
TimeInterval3[TimeInterval3["ONE_DAY"] = 864e5] = "ONE_DAY";
|
|
978
|
+
TimeInterval3[TimeInterval3["ONE_WEEK"] = 6048e5] = "ONE_WEEK";
|
|
979
|
+
TimeInterval3[TimeInterval3["ONE_MONTH"] = 2592e6] = "ONE_MONTH";
|
|
980
|
+
TimeInterval3[TimeInterval3["ONE_YEAR"] = 31536e6] = "ONE_YEAR";
|
|
981
|
+
})(TimeInterval2 || (TimeInterval2 = {}));
|
|
982
|
+
exports.default = TimeInterval2;
|
|
983
|
+
}
|
|
984
|
+
});
|
|
985
|
+
|
|
986
|
+
// node_modules/@fc3/time/dist/src/utility/sleep.js
|
|
987
|
+
var require_sleep = __commonJS({
|
|
988
|
+
"node_modules/@fc3/time/dist/src/utility/sleep.js"(exports) {
|
|
989
|
+
"use strict";
|
|
990
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
991
|
+
function sleep(duration) {
|
|
992
|
+
return new Promise((resolve) => {
|
|
993
|
+
setTimeout(() => {
|
|
994
|
+
resolve();
|
|
995
|
+
}, duration);
|
|
996
|
+
});
|
|
997
|
+
}
|
|
998
|
+
exports.default = sleep;
|
|
999
|
+
}
|
|
1000
|
+
});
|
|
1001
|
+
|
|
1002
|
+
// node_modules/@fc3/grammar/dist/src/noun-inflector.js
|
|
1003
|
+
var require_noun_inflector = __commonJS({
|
|
1004
|
+
"node_modules/@fc3/grammar/dist/src/noun-inflector.js"(exports) {
|
|
1005
|
+
"use strict";
|
|
1006
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1007
|
+
var SINGULAR_TO_PLURAL_MAP = {
|
|
1008
|
+
loot: "loot"
|
|
1009
|
+
};
|
|
1010
|
+
var NounInflector = class {
|
|
1011
|
+
singularize(plural_form) {
|
|
1012
|
+
for (const singular_key in SINGULAR_TO_PLURAL_MAP) {
|
|
1013
|
+
if (SINGULAR_TO_PLURAL_MAP[singular_key] === plural_form) {
|
|
1014
|
+
return singular_key;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
if (plural_form.slice(-3) === "ies") {
|
|
1018
|
+
return plural_form.slice(0, -3) + "y";
|
|
1019
|
+
}
|
|
1020
|
+
if (plural_form.slice(-1) === "i") {
|
|
1021
|
+
return plural_form.slice(0, -1) + "us";
|
|
1022
|
+
}
|
|
1023
|
+
if (plural_form.slice(-1) === "s") {
|
|
1024
|
+
return plural_form.slice(0, -1);
|
|
1025
|
+
}
|
|
1026
|
+
return plural_form;
|
|
1027
|
+
}
|
|
1028
|
+
pluralize(singular_form) {
|
|
1029
|
+
if (SINGULAR_TO_PLURAL_MAP[singular_form] !== void 0) {
|
|
1030
|
+
return SINGULAR_TO_PLURAL_MAP[singular_form];
|
|
1031
|
+
}
|
|
1032
|
+
if (singular_form.slice(-1) === "y") {
|
|
1033
|
+
if (!this.isVowel(singular_form.slice(-2, -1))) {
|
|
1034
|
+
return singular_form.slice(0, -1) + "ies";
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
if (singular_form.slice(-2) === "ch") {
|
|
1038
|
+
return singular_form + "es";
|
|
1039
|
+
}
|
|
1040
|
+
if (singular_form.slice(-2) === "us") {
|
|
1041
|
+
return singular_form.slice(0, -2) + "i";
|
|
1042
|
+
}
|
|
1043
|
+
if (singular_form.slice(-2) === "ss") {
|
|
1044
|
+
return singular_form + "es";
|
|
1045
|
+
}
|
|
1046
|
+
if (singular_form === "life") {
|
|
1047
|
+
return "lives";
|
|
1048
|
+
}
|
|
1049
|
+
return singular_form + "s";
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
* Takes a number, and a singular suffix noun, and returns the correctly
|
|
1053
|
+
* formatted result for the given number.
|
|
1054
|
+
*
|
|
1055
|
+
* Example:
|
|
1056
|
+
*
|
|
1057
|
+
* singularizeOrPluralize(1, 'account') => '1 account'
|
|
1058
|
+
* singularizeOrPluralize(6, 'account') => '6 accounts'
|
|
1059
|
+
*/
|
|
1060
|
+
singularizeOrPluralize(amount, suffix) {
|
|
1061
|
+
if (typeof amount === "string") {
|
|
1062
|
+
amount = parseFloat(amount);
|
|
1063
|
+
}
|
|
1064
|
+
if (amount === 1) {
|
|
1065
|
+
return `${amount} ${suffix}`;
|
|
1066
|
+
}
|
|
1067
|
+
const plural_suffix = this.pluralize(suffix);
|
|
1068
|
+
return `${amount} ${plural_suffix}`;
|
|
1069
|
+
}
|
|
1070
|
+
prependArticle(suffix) {
|
|
1071
|
+
const first_letter = suffix[0];
|
|
1072
|
+
const is_vowel = this.isVowel(first_letter);
|
|
1073
|
+
let article;
|
|
1074
|
+
if (is_vowel) {
|
|
1075
|
+
article = "an";
|
|
1076
|
+
} else {
|
|
1077
|
+
article = "a";
|
|
1078
|
+
}
|
|
1079
|
+
return `${article} ${suffix}`;
|
|
1080
|
+
}
|
|
1081
|
+
isVowel(letter) {
|
|
1082
|
+
return /[aeiou]/.test(letter.toLowerCase());
|
|
1083
|
+
}
|
|
1084
|
+
};
|
|
1085
|
+
exports.default = NounInflector;
|
|
1086
|
+
}
|
|
1087
|
+
});
|
|
1088
|
+
|
|
1089
|
+
// node_modules/@fc3/string/dist/src/create-slug.js
|
|
1090
|
+
var require_create_slug = __commonJS({
|
|
1091
|
+
"node_modules/@fc3/string/dist/src/create-slug.js"(exports) {
|
|
1092
|
+
"use strict";
|
|
1093
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1094
|
+
function createSlug(message) {
|
|
1095
|
+
if (message === "") {
|
|
1096
|
+
throw new Error("Tried to create slug, but message was empty");
|
|
1097
|
+
}
|
|
1098
|
+
return message.replace(/[^A-Za-z0-9-\s_]/g, "").trim().replace(/[\s_]/g, "-").toLowerCase();
|
|
1099
|
+
}
|
|
1100
|
+
exports.default = createSlug;
|
|
1101
|
+
}
|
|
1102
|
+
});
|
|
1103
|
+
|
|
1104
|
+
// node_modules/@fc3/string/dist/src/capitalize.js
|
|
1105
|
+
var require_capitalize = __commonJS({
|
|
1106
|
+
"node_modules/@fc3/string/dist/src/capitalize.js"(exports) {
|
|
1107
|
+
"use strict";
|
|
1108
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1109
|
+
function capitalize(str) {
|
|
1110
|
+
const first_character = str[0];
|
|
1111
|
+
const remaining_characters = str.slice(1);
|
|
1112
|
+
return first_character.toUpperCase() + remaining_characters;
|
|
1113
|
+
}
|
|
1114
|
+
exports.default = capitalize;
|
|
1115
|
+
}
|
|
1116
|
+
});
|
|
1117
|
+
|
|
1118
|
+
// node_modules/@fc3/string/dist/src/enum/string-encoding.js
|
|
1119
|
+
var require_string_encoding = __commonJS({
|
|
1120
|
+
"node_modules/@fc3/string/dist/src/enum/string-encoding.js"(exports) {
|
|
1121
|
+
"use strict";
|
|
1122
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1123
|
+
var StringEncoding;
|
|
1124
|
+
(function(StringEncoding2) {
|
|
1125
|
+
StringEncoding2["ASCII"] = "ascii";
|
|
1126
|
+
StringEncoding2["BASE64"] = "base64";
|
|
1127
|
+
StringEncoding2["BINARY"] = "binary";
|
|
1128
|
+
StringEncoding2["HEX"] = "hex";
|
|
1129
|
+
StringEncoding2["UTF8"] = "utf8";
|
|
1130
|
+
})(StringEncoding || (StringEncoding = {}));
|
|
1131
|
+
exports.default = StringEncoding;
|
|
1132
|
+
}
|
|
1133
|
+
});
|
|
1134
|
+
|
|
1135
|
+
// node_modules/@fc3/string/dist/src/index.js
|
|
1136
|
+
var require_src4 = __commonJS({
|
|
1137
|
+
"node_modules/@fc3/string/dist/src/index.js"(exports) {
|
|
1138
|
+
"use strict";
|
|
1139
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
1140
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1141
|
+
};
|
|
1142
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1143
|
+
exports.StringEncoding = exports.capitalize = exports.createSlug = void 0;
|
|
1144
|
+
var create_slug_1 = require_create_slug();
|
|
1145
|
+
Object.defineProperty(exports, "createSlug", { enumerable: true, get: function() {
|
|
1146
|
+
return __importDefault(create_slug_1).default;
|
|
1147
|
+
} });
|
|
1148
|
+
var capitalize_1 = require_capitalize();
|
|
1149
|
+
Object.defineProperty(exports, "capitalize", { enumerable: true, get: function() {
|
|
1150
|
+
return __importDefault(capitalize_1).default;
|
|
1151
|
+
} });
|
|
1152
|
+
var string_encoding_1 = require_string_encoding();
|
|
1153
|
+
Object.defineProperty(exports, "StringEncoding", { enumerable: true, get: function() {
|
|
1154
|
+
return __importDefault(string_encoding_1).default;
|
|
1155
|
+
} });
|
|
1156
|
+
}
|
|
1157
|
+
});
|
|
1158
|
+
|
|
1159
|
+
// node_modules/@fc3/grammar/dist/src/verb-inflector.js
|
|
1160
|
+
var require_verb_inflector = __commonJS({
|
|
1161
|
+
"node_modules/@fc3/grammar/dist/src/verb-inflector.js"(exports) {
|
|
1162
|
+
"use strict";
|
|
1163
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
1164
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1165
|
+
};
|
|
1166
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1167
|
+
var string_1 = require_src4();
|
|
1168
|
+
var noun_inflector_1 = __importDefault(require_noun_inflector());
|
|
1169
|
+
var VerbInflector = class {
|
|
1170
|
+
constructor(value) {
|
|
1171
|
+
this.value = value;
|
|
1172
|
+
const index = value.indexOf(" ");
|
|
1173
|
+
if (index !== -1) {
|
|
1174
|
+
this.suffix = value.slice(index);
|
|
1175
|
+
value = value.slice(0, index);
|
|
1176
|
+
} else {
|
|
1177
|
+
this.suffix = "";
|
|
1178
|
+
}
|
|
1179
|
+
this.uppercase = value !== value.toLowerCase();
|
|
1180
|
+
this.verb = value.toLowerCase();
|
|
1181
|
+
}
|
|
1182
|
+
toPresentParticiple() {
|
|
1183
|
+
if (this.verb === "group") {
|
|
1184
|
+
return this.finalize("grouping");
|
|
1185
|
+
}
|
|
1186
|
+
if (this.verb === "be") {
|
|
1187
|
+
return this.finalize("being");
|
|
1188
|
+
}
|
|
1189
|
+
if (/[aeiou]p$/.test(this.verb)) {
|
|
1190
|
+
return this.finalize(this.verb + "ping");
|
|
1191
|
+
}
|
|
1192
|
+
if (/[aeiou]g$/.test(this.verb)) {
|
|
1193
|
+
return this.finalize(this.verb + "ging");
|
|
1194
|
+
}
|
|
1195
|
+
if (/ee$/.test(this.verb)) {
|
|
1196
|
+
return this.finalize(this.verb + "ing");
|
|
1197
|
+
}
|
|
1198
|
+
if (/e$/.test(this.verb)) {
|
|
1199
|
+
return this.finalize(this.verb.slice(0, -1) + "ing");
|
|
1200
|
+
}
|
|
1201
|
+
if (/[aeiou]n$/.test(this.verb)) {
|
|
1202
|
+
return this.finalize(this.verb + "ning");
|
|
1203
|
+
}
|
|
1204
|
+
if (/[aeiou]t$/.test(this.verb)) {
|
|
1205
|
+
return this.finalize(this.verb + "ting");
|
|
1206
|
+
}
|
|
1207
|
+
return this.finalize(this.verb + "ing");
|
|
1208
|
+
}
|
|
1209
|
+
toPastParticiple() {
|
|
1210
|
+
switch (this.verb) {
|
|
1211
|
+
case "choose":
|
|
1212
|
+
return this.finalize("chosen");
|
|
1213
|
+
default:
|
|
1214
|
+
return this.toPastTense();
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
toInfinitive() {
|
|
1218
|
+
return this.finalize(`to ${this.verb}`);
|
|
1219
|
+
}
|
|
1220
|
+
toAdjective() {
|
|
1221
|
+
if (this.value.startsWith("be ")) {
|
|
1222
|
+
return this.value.slice(3);
|
|
1223
|
+
} else {
|
|
1224
|
+
return this.finalize(this.verb + "y");
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
toPresentTense() {
|
|
1228
|
+
switch (this.verb) {
|
|
1229
|
+
case "be":
|
|
1230
|
+
return this.finalize("is");
|
|
1231
|
+
default:
|
|
1232
|
+
return this.finalize(this.verb);
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
toImperfectTense() {
|
|
1236
|
+
const participle = this.toPresentParticiple();
|
|
1237
|
+
return this.finalize(`was ${participle}`);
|
|
1238
|
+
}
|
|
1239
|
+
toPastTense() {
|
|
1240
|
+
switch (this.verb) {
|
|
1241
|
+
case "find":
|
|
1242
|
+
return this.finalize("found");
|
|
1243
|
+
case "get":
|
|
1244
|
+
return this.finalize("got");
|
|
1245
|
+
case "run":
|
|
1246
|
+
return this.finalize("ran");
|
|
1247
|
+
case "read":
|
|
1248
|
+
return this.finalize("read");
|
|
1249
|
+
case "write":
|
|
1250
|
+
return this.finalize("wrote");
|
|
1251
|
+
case "choose":
|
|
1252
|
+
return this.finalize("chose");
|
|
1253
|
+
case "build":
|
|
1254
|
+
return this.finalize("built");
|
|
1255
|
+
}
|
|
1256
|
+
if (/[aeiou]p$/.test(this.verb)) {
|
|
1257
|
+
return this.finalize(this.verb + "ped");
|
|
1258
|
+
}
|
|
1259
|
+
if (/[aeiou]g$/.test(this.verb)) {
|
|
1260
|
+
return this.finalize(this.verb + "ged");
|
|
1261
|
+
}
|
|
1262
|
+
if (this.verb === "be") {
|
|
1263
|
+
return this.finalize("was");
|
|
1264
|
+
}
|
|
1265
|
+
if (this.verb === "draw") {
|
|
1266
|
+
return this.finalize("drew");
|
|
1267
|
+
}
|
|
1268
|
+
if (/e$/.test(this.verb)) {
|
|
1269
|
+
return this.finalize(this.verb + "d");
|
|
1270
|
+
}
|
|
1271
|
+
if (/[aeiou]y$/.test(this.verb)) {
|
|
1272
|
+
return this.finalize(this.verb + "ed");
|
|
1273
|
+
}
|
|
1274
|
+
if (/y$/.test(this.verb)) {
|
|
1275
|
+
return this.finalize(this.verb.slice(0, -1) + "ied");
|
|
1276
|
+
}
|
|
1277
|
+
return this.finalize(this.verb + "ed");
|
|
1278
|
+
}
|
|
1279
|
+
toFutureTense() {
|
|
1280
|
+
return this.finalize(`will ${this.verb}`);
|
|
1281
|
+
}
|
|
1282
|
+
toSingularNoun() {
|
|
1283
|
+
switch (this.verb) {
|
|
1284
|
+
case "cut":
|
|
1285
|
+
return this.finalize("cut");
|
|
1286
|
+
case "die":
|
|
1287
|
+
return this.finalize("death");
|
|
1288
|
+
case "live":
|
|
1289
|
+
return this.finalize("life");
|
|
1290
|
+
case "change":
|
|
1291
|
+
return this.finalize("change");
|
|
1292
|
+
case "make water":
|
|
1293
|
+
return this.finalize("water");
|
|
1294
|
+
case "do":
|
|
1295
|
+
return this.finalize("action");
|
|
1296
|
+
case "protect":
|
|
1297
|
+
return this.finalize("protection");
|
|
1298
|
+
case "affirm":
|
|
1299
|
+
return this.finalize("affirmation");
|
|
1300
|
+
case "choose":
|
|
1301
|
+
return this.finalize("choice");
|
|
1302
|
+
case "collide":
|
|
1303
|
+
return this.finalize("collision");
|
|
1304
|
+
case "encase":
|
|
1305
|
+
return this.finalize("casing");
|
|
1306
|
+
case "darken":
|
|
1307
|
+
return this.finalize("shadow");
|
|
1308
|
+
case "damage":
|
|
1309
|
+
return this.finalize("damage");
|
|
1310
|
+
case "define":
|
|
1311
|
+
return this.finalize("definition");
|
|
1312
|
+
case "describe":
|
|
1313
|
+
return this.finalize("description");
|
|
1314
|
+
case "hear":
|
|
1315
|
+
return this.finalize("sound");
|
|
1316
|
+
case "measure":
|
|
1317
|
+
return this.finalize("measurement");
|
|
1318
|
+
case "rate":
|
|
1319
|
+
return this.finalize("rating");
|
|
1320
|
+
case "move":
|
|
1321
|
+
return this.finalize("movement");
|
|
1322
|
+
case "regard":
|
|
1323
|
+
return this.finalize("regard");
|
|
1324
|
+
case "survey":
|
|
1325
|
+
return this.finalize("area");
|
|
1326
|
+
case "interact":
|
|
1327
|
+
return this.finalize("interaction");
|
|
1328
|
+
case "name":
|
|
1329
|
+
return this.finalize("name");
|
|
1330
|
+
case "speak":
|
|
1331
|
+
return this.finalize("speech");
|
|
1332
|
+
case "count":
|
|
1333
|
+
return this.finalize("number");
|
|
1334
|
+
case "reside":
|
|
1335
|
+
return this.finalize("residence");
|
|
1336
|
+
case "know":
|
|
1337
|
+
return this.finalize("knowledge");
|
|
1338
|
+
case "divide":
|
|
1339
|
+
return this.finalize("division");
|
|
1340
|
+
case "void":
|
|
1341
|
+
return this.finalize("void");
|
|
1342
|
+
case "make":
|
|
1343
|
+
switch (this.value) {
|
|
1344
|
+
case "make music":
|
|
1345
|
+
return "music";
|
|
1346
|
+
case "make noise":
|
|
1347
|
+
return "noise";
|
|
1348
|
+
default:
|
|
1349
|
+
return this.suffix.slice(1);
|
|
1350
|
+
}
|
|
1351
|
+
case "breathe":
|
|
1352
|
+
return this.finalize("breath");
|
|
1353
|
+
case "have":
|
|
1354
|
+
return this.finalize("belonging");
|
|
1355
|
+
case "bear":
|
|
1356
|
+
if (this.suffix === " fruit") {
|
|
1357
|
+
return "fruit";
|
|
1358
|
+
}
|
|
1359
|
+
case "dream":
|
|
1360
|
+
return "dream";
|
|
1361
|
+
case "test":
|
|
1362
|
+
return "test";
|
|
1363
|
+
case "prepare":
|
|
1364
|
+
return "preparation";
|
|
1365
|
+
case "ascend":
|
|
1366
|
+
return "ascension";
|
|
1367
|
+
case "sleep":
|
|
1368
|
+
return "sleep";
|
|
1369
|
+
default:
|
|
1370
|
+
if (this.verb.slice(-2) === "te") {
|
|
1371
|
+
return this.finalize(this.verb.slice(0, -2) + "tion");
|
|
1372
|
+
}
|
|
1373
|
+
return this.finalize(this.toPresentParticiple());
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
toPluralNoun() {
|
|
1377
|
+
const inflector = new noun_inflector_1.default();
|
|
1378
|
+
const singular = this.toSingularNoun();
|
|
1379
|
+
return this.finalize(inflector.pluralize(singular));
|
|
1380
|
+
}
|
|
1381
|
+
toSingularActor() {
|
|
1382
|
+
switch (this.verb) {
|
|
1383
|
+
case "be":
|
|
1384
|
+
return this.finalize("being");
|
|
1385
|
+
}
|
|
1386
|
+
if (this.verb.endsWith("ate")) {
|
|
1387
|
+
return this.finalize(`${this.verb.slice(0, -1)}or`);
|
|
1388
|
+
}
|
|
1389
|
+
if (this.verb.endsWith("e")) {
|
|
1390
|
+
return this.finalize(`${this.verb}r`);
|
|
1391
|
+
}
|
|
1392
|
+
if (this.verb.endsWith("ct")) {
|
|
1393
|
+
return this.finalize(`${this.verb}or`);
|
|
1394
|
+
}
|
|
1395
|
+
return this.finalize(`${this.verb}er`);
|
|
1396
|
+
}
|
|
1397
|
+
toPluralActor() {
|
|
1398
|
+
const singular_actor = this.toSingularActor();
|
|
1399
|
+
const inflector = new noun_inflector_1.default();
|
|
1400
|
+
return this.finalize(inflector.pluralize(singular_actor));
|
|
1401
|
+
}
|
|
1402
|
+
finalize(value) {
|
|
1403
|
+
value += this.suffix;
|
|
1404
|
+
if (this.uppercase) {
|
|
1405
|
+
return (0, string_1.capitalize)(value);
|
|
1406
|
+
} else {
|
|
1407
|
+
return value.toLowerCase();
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
};
|
|
1411
|
+
exports.default = VerbInflector;
|
|
1412
|
+
}
|
|
1413
|
+
});
|
|
1414
|
+
|
|
1415
|
+
// node_modules/@fc3/grammar/dist/src/utility/get-words-from-identifier.js
|
|
1416
|
+
var require_get_words_from_identifier = __commonJS({
|
|
1417
|
+
"node_modules/@fc3/grammar/dist/src/utility/get-words-from-identifier.js"(exports) {
|
|
1418
|
+
"use strict";
|
|
1419
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1420
|
+
function getWordsFromIdentifier(identifier) {
|
|
1421
|
+
const delimited_identifier = identifier.replace(/[a-z][A-Z]/g, (match) => {
|
|
1422
|
+
return match[0] + "_" + match[1];
|
|
1423
|
+
});
|
|
1424
|
+
return delimited_identifier.split("_");
|
|
1425
|
+
}
|
|
1426
|
+
exports.default = getWordsFromIdentifier;
|
|
1427
|
+
}
|
|
1428
|
+
});
|
|
1429
|
+
|
|
1430
|
+
// node_modules/@fc3/grammar/dist/src/utility/singularize.js
|
|
1431
|
+
var require_singularize = __commonJS({
|
|
1432
|
+
"node_modules/@fc3/grammar/dist/src/utility/singularize.js"(exports) {
|
|
1433
|
+
"use strict";
|
|
1434
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
1435
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1436
|
+
};
|
|
1437
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1438
|
+
var noun_inflector_1 = __importDefault(require_noun_inflector());
|
|
1439
|
+
function singularize(word) {
|
|
1440
|
+
const inflector = new noun_inflector_1.default();
|
|
1441
|
+
return inflector.singularize(word);
|
|
1442
|
+
}
|
|
1443
|
+
exports.default = singularize;
|
|
1444
|
+
}
|
|
1445
|
+
});
|
|
1446
|
+
|
|
1447
|
+
// node_modules/@fc3/grammar/dist/src/utility/pluralize.js
|
|
1448
|
+
var require_pluralize = __commonJS({
|
|
1449
|
+
"node_modules/@fc3/grammar/dist/src/utility/pluralize.js"(exports) {
|
|
1450
|
+
"use strict";
|
|
1451
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
1452
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1453
|
+
};
|
|
1454
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1455
|
+
var noun_inflector_1 = __importDefault(require_noun_inflector());
|
|
1456
|
+
function pluralize(word) {
|
|
1457
|
+
const inflector = new noun_inflector_1.default();
|
|
1458
|
+
return inflector.pluralize(word);
|
|
1459
|
+
}
|
|
1460
|
+
exports.default = pluralize;
|
|
1461
|
+
}
|
|
1462
|
+
});
|
|
1463
|
+
|
|
1464
|
+
// node_modules/@fc3/grammar/dist/src/utility/singularize-or-pluralize.js
|
|
1465
|
+
var require_singularize_or_pluralize = __commonJS({
|
|
1466
|
+
"node_modules/@fc3/grammar/dist/src/utility/singularize-or-pluralize.js"(exports) {
|
|
1467
|
+
"use strict";
|
|
1468
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
1469
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1470
|
+
};
|
|
1471
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1472
|
+
var noun_inflector_1 = __importDefault(require_noun_inflector());
|
|
1473
|
+
function singularizeOrPluralize(count, word) {
|
|
1474
|
+
const inflector = new noun_inflector_1.default();
|
|
1475
|
+
return inflector.singularizeOrPluralize(count, word);
|
|
1476
|
+
}
|
|
1477
|
+
exports.default = singularizeOrPluralize;
|
|
1478
|
+
}
|
|
1479
|
+
});
|
|
1480
|
+
|
|
1481
|
+
// node_modules/@fc3/grammar/dist/src/index.js
|
|
1482
|
+
var require_src5 = __commonJS({
|
|
1483
|
+
"node_modules/@fc3/grammar/dist/src/index.js"(exports) {
|
|
1484
|
+
"use strict";
|
|
1485
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
1486
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1487
|
+
};
|
|
1488
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1489
|
+
exports.singularizeOrPluralize = exports.pluralize = exports.singularize = exports.getWordsFromIdentifier = exports.VerbInflector = exports.NounInflector = void 0;
|
|
1490
|
+
var noun_inflector_1 = require_noun_inflector();
|
|
1491
|
+
Object.defineProperty(exports, "NounInflector", { enumerable: true, get: function() {
|
|
1492
|
+
return __importDefault(noun_inflector_1).default;
|
|
1493
|
+
} });
|
|
1494
|
+
var verb_inflector_1 = require_verb_inflector();
|
|
1495
|
+
Object.defineProperty(exports, "VerbInflector", { enumerable: true, get: function() {
|
|
1496
|
+
return __importDefault(verb_inflector_1).default;
|
|
1497
|
+
} });
|
|
1498
|
+
var get_words_from_identifier_1 = require_get_words_from_identifier();
|
|
1499
|
+
Object.defineProperty(exports, "getWordsFromIdentifier", { enumerable: true, get: function() {
|
|
1500
|
+
return __importDefault(get_words_from_identifier_1).default;
|
|
1501
|
+
} });
|
|
1502
|
+
var singularize_1 = require_singularize();
|
|
1503
|
+
Object.defineProperty(exports, "singularize", { enumerable: true, get: function() {
|
|
1504
|
+
return __importDefault(singularize_1).default;
|
|
1505
|
+
} });
|
|
1506
|
+
var pluralize_1 = require_pluralize();
|
|
1507
|
+
Object.defineProperty(exports, "pluralize", { enumerable: true, get: function() {
|
|
1508
|
+
return __importDefault(pluralize_1).default;
|
|
1509
|
+
} });
|
|
1510
|
+
var singularize_or_pluralize_1 = require_singularize_or_pluralize();
|
|
1511
|
+
Object.defineProperty(exports, "singularizeOrPluralize", { enumerable: true, get: function() {
|
|
1512
|
+
return __importDefault(singularize_or_pluralize_1).default;
|
|
1513
|
+
} });
|
|
1514
|
+
}
|
|
1515
|
+
});
|
|
1516
|
+
|
|
1517
|
+
// node_modules/@fc3/time/dist/src/utility/format-duration.js
|
|
1518
|
+
var require_format_duration = __commonJS({
|
|
1519
|
+
"node_modules/@fc3/time/dist/src/utility/format-duration.js"(exports) {
|
|
1520
|
+
"use strict";
|
|
1521
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
1522
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1523
|
+
};
|
|
1524
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1525
|
+
var grammar_1 = require_src5();
|
|
1526
|
+
var time_interval_1 = __importDefault(require_time_interval());
|
|
1527
|
+
function formatMilliseconds(ms, shorthand = false) {
|
|
1528
|
+
if (shorthand) {
|
|
1529
|
+
return `${ms}ms`;
|
|
1530
|
+
}
|
|
1531
|
+
const inflector = new grammar_1.NounInflector();
|
|
1532
|
+
return inflector.singularizeOrPluralize(ms, "millisecond");
|
|
1533
|
+
}
|
|
1534
|
+
function formatSeconds(ms, shorthand = false) {
|
|
1535
|
+
const seconds = Math.floor(ms / time_interval_1.default.ONE_SECOND);
|
|
1536
|
+
if (shorthand) {
|
|
1537
|
+
return `${seconds}s`;
|
|
1538
|
+
}
|
|
1539
|
+
const inflector = new grammar_1.NounInflector();
|
|
1540
|
+
return inflector.singularizeOrPluralize(seconds, "second");
|
|
1541
|
+
}
|
|
1542
|
+
function formatMinutes(ms, shorthand = false) {
|
|
1543
|
+
const minutes = Math.floor(ms / time_interval_1.default.ONE_MINUTE);
|
|
1544
|
+
if (shorthand) {
|
|
1545
|
+
return `${minutes}m`;
|
|
1546
|
+
}
|
|
1547
|
+
const inflector = new grammar_1.NounInflector();
|
|
1548
|
+
return inflector.singularizeOrPluralize(minutes, "minute");
|
|
1549
|
+
}
|
|
1550
|
+
function formatHours(ms, shorthand = false) {
|
|
1551
|
+
const hours = Math.floor(ms / time_interval_1.default.ONE_HOUR);
|
|
1552
|
+
if (shorthand) {
|
|
1553
|
+
return `${hours}h`;
|
|
1554
|
+
}
|
|
1555
|
+
const inflector = new grammar_1.NounInflector();
|
|
1556
|
+
return inflector.singularizeOrPluralize(hours, "hour");
|
|
1557
|
+
}
|
|
1558
|
+
function formatDays(ms, shorthand = false) {
|
|
1559
|
+
const days = Math.floor(ms / time_interval_1.default.ONE_DAY);
|
|
1560
|
+
if (shorthand) {
|
|
1561
|
+
return `${days}d`;
|
|
1562
|
+
}
|
|
1563
|
+
const inflector = new grammar_1.NounInflector();
|
|
1564
|
+
return inflector.singularizeOrPluralize(days, "day");
|
|
1565
|
+
}
|
|
1566
|
+
function formatWeeks(ms, shorthand = false) {
|
|
1567
|
+
const weeks = Math.floor(ms / time_interval_1.default.ONE_WEEK);
|
|
1568
|
+
if (shorthand) {
|
|
1569
|
+
return `${weeks}w`;
|
|
1570
|
+
}
|
|
1571
|
+
const inflector = new grammar_1.NounInflector();
|
|
1572
|
+
return inflector.singularizeOrPluralize(weeks, "week");
|
|
1573
|
+
}
|
|
1574
|
+
function formatMonths(ms, shorthand = false) {
|
|
1575
|
+
const months = Math.floor(ms / time_interval_1.default.ONE_MONTH);
|
|
1576
|
+
if (shorthand) {
|
|
1577
|
+
return `${months}mo`;
|
|
1578
|
+
}
|
|
1579
|
+
const inflector = new grammar_1.NounInflector();
|
|
1580
|
+
return inflector.singularizeOrPluralize(months, "month");
|
|
1581
|
+
}
|
|
1582
|
+
function formatYears(ms, shorthand = false) {
|
|
1583
|
+
let years = ms / time_interval_1.default.ONE_YEAR;
|
|
1584
|
+
const years_rounded = Math.round(years);
|
|
1585
|
+
if (Math.abs(years - years_rounded) < 1 / 24) {
|
|
1586
|
+
years = years_rounded;
|
|
1587
|
+
} else {
|
|
1588
|
+
years = parseFloat(years.toFixed(1));
|
|
1589
|
+
}
|
|
1590
|
+
if (shorthand) {
|
|
1591
|
+
return `${years}y`;
|
|
1592
|
+
}
|
|
1593
|
+
const inflector = new grammar_1.NounInflector();
|
|
1594
|
+
return inflector.singularizeOrPluralize(years, "year");
|
|
1595
|
+
}
|
|
1596
|
+
function formatDuration(ms, shorthand = false) {
|
|
1597
|
+
if (ms < time_interval_1.default.ONE_SECOND) {
|
|
1598
|
+
return formatMilliseconds(ms, shorthand);
|
|
1599
|
+
}
|
|
1600
|
+
if (ms < time_interval_1.default.ONE_MINUTE) {
|
|
1601
|
+
return formatSeconds(ms, shorthand);
|
|
1602
|
+
}
|
|
1603
|
+
if (ms < time_interval_1.default.ONE_HOUR) {
|
|
1604
|
+
return formatMinutes(ms, shorthand);
|
|
1605
|
+
}
|
|
1606
|
+
if (ms < time_interval_1.default.ONE_DAY) {
|
|
1607
|
+
return formatHours(ms, shorthand);
|
|
1608
|
+
}
|
|
1609
|
+
if (ms < time_interval_1.default.ONE_WEEK) {
|
|
1610
|
+
return formatDays(ms, shorthand);
|
|
1611
|
+
}
|
|
1612
|
+
if (ms < time_interval_1.default.ONE_MONTH) {
|
|
1613
|
+
return formatWeeks(ms, shorthand);
|
|
1614
|
+
}
|
|
1615
|
+
if (ms < time_interval_1.default.ONE_YEAR) {
|
|
1616
|
+
return formatMonths(ms, shorthand);
|
|
1617
|
+
}
|
|
1618
|
+
return formatYears(ms, shorthand);
|
|
1619
|
+
}
|
|
1620
|
+
exports.default = formatDuration;
|
|
1621
|
+
}
|
|
1622
|
+
});
|
|
1623
|
+
|
|
1624
|
+
// node_modules/@fc3/time/dist/src/utility/format-relative-duration.js
|
|
1625
|
+
var require_format_relative_duration = __commonJS({
|
|
1626
|
+
"node_modules/@fc3/time/dist/src/utility/format-relative-duration.js"(exports) {
|
|
1627
|
+
"use strict";
|
|
1628
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
1629
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1630
|
+
};
|
|
1631
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1632
|
+
var format_duration_1 = __importDefault(require_format_duration());
|
|
1633
|
+
function formatRelativeDuration(date, shorthand = false) {
|
|
1634
|
+
let ms;
|
|
1635
|
+
if (date instanceof Date) {
|
|
1636
|
+
ms = date.getTime();
|
|
1637
|
+
} else if (typeof date === "string") {
|
|
1638
|
+
ms = new Date(date).getTime();
|
|
1639
|
+
} else {
|
|
1640
|
+
ms = date;
|
|
1641
|
+
}
|
|
1642
|
+
const elapsed_time = Date.now() - ms;
|
|
1643
|
+
return (0, format_duration_1.default)(elapsed_time, shorthand);
|
|
1644
|
+
}
|
|
1645
|
+
exports.default = formatRelativeDuration;
|
|
1646
|
+
}
|
|
1647
|
+
});
|
|
1648
|
+
|
|
1649
|
+
// node_modules/@fc3/time/dist/src/utility/format-relative-date.js
|
|
1650
|
+
var require_format_relative_date = __commonJS({
|
|
1651
|
+
"node_modules/@fc3/time/dist/src/utility/format-relative-date.js"(exports) {
|
|
1652
|
+
"use strict";
|
|
1653
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
1654
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1655
|
+
};
|
|
1656
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1657
|
+
var format_relative_duration_1 = __importDefault(require_format_relative_duration());
|
|
1658
|
+
function formatRelativeDate(ms) {
|
|
1659
|
+
return (0, format_relative_duration_1.default)(ms) + " ago";
|
|
1660
|
+
}
|
|
1661
|
+
exports.default = formatRelativeDate;
|
|
1662
|
+
}
|
|
1663
|
+
});
|
|
1664
|
+
|
|
1665
|
+
// node_modules/@fc3/time/dist/src/utility/format-timecode.js
|
|
1666
|
+
var require_format_timecode = __commonJS({
|
|
1667
|
+
"node_modules/@fc3/time/dist/src/utility/format-timecode.js"(exports) {
|
|
1668
|
+
"use strict";
|
|
1669
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
1670
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1671
|
+
};
|
|
1672
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1673
|
+
var time_interval_1 = __importDefault(require_time_interval());
|
|
1674
|
+
function formatTimecode2(ms) {
|
|
1675
|
+
const hours = Math.floor(ms / time_interval_1.default.ONE_HOUR);
|
|
1676
|
+
const leftover_hours = ms % time_interval_1.default.ONE_HOUR;
|
|
1677
|
+
const minutes = Math.floor(leftover_hours / time_interval_1.default.ONE_MINUTE);
|
|
1678
|
+
const leftover_minutes = ms % time_interval_1.default.ONE_MINUTE;
|
|
1679
|
+
const seconds = Math.floor(leftover_minutes / time_interval_1.default.ONE_SECOND);
|
|
1680
|
+
const padded_seconds = seconds.toString().padStart(2, "0");
|
|
1681
|
+
if (hours > 0) {
|
|
1682
|
+
const padded_minutes = minutes.toString().padStart(2, "0");
|
|
1683
|
+
return `${hours}:${padded_minutes}:${padded_seconds}`;
|
|
1684
|
+
}
|
|
1685
|
+
return `${minutes}:${padded_seconds}`;
|
|
1686
|
+
}
|
|
1687
|
+
exports.default = formatTimecode2;
|
|
1688
|
+
}
|
|
1689
|
+
});
|
|
1690
|
+
|
|
1691
|
+
// node_modules/@fc3/time/dist/src/index.js
|
|
1692
|
+
var require_src6 = __commonJS({
|
|
1693
|
+
"node_modules/@fc3/time/dist/src/index.js"(exports) {
|
|
1694
|
+
"use strict";
|
|
1695
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
1696
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1697
|
+
};
|
|
1698
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1699
|
+
exports.formatTimecode = exports.formatDuration = exports.formatRelativeDate = exports.formatRelativeDuration = exports.sleep = exports.TimeInterval = void 0;
|
|
1700
|
+
var time_interval_1 = require_time_interval();
|
|
1701
|
+
Object.defineProperty(exports, "TimeInterval", { enumerable: true, get: function() {
|
|
1702
|
+
return __importDefault(time_interval_1).default;
|
|
1703
|
+
} });
|
|
1704
|
+
var sleep_1 = require_sleep();
|
|
1705
|
+
Object.defineProperty(exports, "sleep", { enumerable: true, get: function() {
|
|
1706
|
+
return __importDefault(sleep_1).default;
|
|
1707
|
+
} });
|
|
1708
|
+
var format_relative_duration_1 = require_format_relative_duration();
|
|
1709
|
+
Object.defineProperty(exports, "formatRelativeDuration", { enumerable: true, get: function() {
|
|
1710
|
+
return __importDefault(format_relative_duration_1).default;
|
|
1711
|
+
} });
|
|
1712
|
+
var format_relative_date_1 = require_format_relative_date();
|
|
1713
|
+
Object.defineProperty(exports, "formatRelativeDate", { enumerable: true, get: function() {
|
|
1714
|
+
return __importDefault(format_relative_date_1).default;
|
|
1715
|
+
} });
|
|
1716
|
+
var format_duration_1 = require_format_duration();
|
|
1717
|
+
Object.defineProperty(exports, "formatDuration", { enumerable: true, get: function() {
|
|
1718
|
+
return __importDefault(format_duration_1).default;
|
|
1719
|
+
} });
|
|
1720
|
+
var format_timecode_1 = require_format_timecode();
|
|
1721
|
+
Object.defineProperty(exports, "formatTimecode", { enumerable: true, get: function() {
|
|
1722
|
+
return __importDefault(format_timecode_1).default;
|
|
1723
|
+
} });
|
|
1724
|
+
}
|
|
1725
|
+
});
|
|
1726
|
+
|
|
966
1727
|
// src/client/client.ts
|
|
967
1728
|
var import_errors12 = __toESM(require_src2());
|
|
968
1729
|
|
|
@@ -993,9 +1754,6 @@
|
|
|
993
1754
|
})(PageType || {});
|
|
994
1755
|
var page_type_default = PageType;
|
|
995
1756
|
|
|
996
|
-
// src/client/page.ts
|
|
997
|
-
var import_array = __toESM(require_src3());
|
|
998
|
-
|
|
999
1757
|
// src/client/enum/key-code.ts
|
|
1000
1758
|
var KeyCode = /* @__PURE__ */ ((KeyCode2) => {
|
|
1001
1759
|
KeyCode2[KeyCode2["ENTER"] = 13] = "ENTER";
|
|
@@ -1071,20 +1829,33 @@
|
|
|
1071
1829
|
return this.shift_pressed;
|
|
1072
1830
|
}
|
|
1073
1831
|
focusElement(element) {
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1832
|
+
let current_top = 0;
|
|
1833
|
+
let current_element = element;
|
|
1834
|
+
while (current_element) {
|
|
1835
|
+
current_top += current_element.offsetTop;
|
|
1836
|
+
current_element = current_element.offsetParent;
|
|
1837
|
+
}
|
|
1838
|
+
const current_bottom = current_top + element.offsetHeight;
|
|
1839
|
+
const [target_top, viewport_min] = (() => {
|
|
1840
|
+
const header = document.querySelector("header");
|
|
1841
|
+
if (header === null) {
|
|
1842
|
+
return [
|
|
1843
|
+
current_top,
|
|
1844
|
+
window.scrollY
|
|
1845
|
+
];
|
|
1081
1846
|
} else {
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
window.scrollBy(0, rectangle.bottom - window.innerHeight);
|
|
1847
|
+
return [
|
|
1848
|
+
current_top - header.offsetHeight,
|
|
1849
|
+
window.scrollY + header.offsetHeight
|
|
1850
|
+
];
|
|
1087
1851
|
}
|
|
1852
|
+
})();
|
|
1853
|
+
const viewport_max = window.scrollY + window.innerHeight;
|
|
1854
|
+
if (current_top < viewport_min) {
|
|
1855
|
+
window.scrollTo(0, target_top);
|
|
1856
|
+
}
|
|
1857
|
+
if (current_bottom > viewport_max) {
|
|
1858
|
+
window.scrollTo(0, current_bottom - window.innerHeight);
|
|
1088
1859
|
}
|
|
1089
1860
|
}
|
|
1090
1861
|
getNumericQueryParameter(key, fallback) {
|
|
@@ -1408,7 +2179,8 @@
|
|
|
1408
2179
|
|
|
1409
2180
|
// src/client/page/cursor.ts
|
|
1410
2181
|
var import_errors7 = __toESM(require_src2());
|
|
1411
|
-
var
|
|
2182
|
+
var import_array = __toESM(require_src3());
|
|
2183
|
+
var import_time = __toESM(require_src6());
|
|
1412
2184
|
|
|
1413
2185
|
// src/client/utility/get-meta-value.ts
|
|
1414
2186
|
var import_errors5 = __toESM(require_src2());
|
|
@@ -1503,13 +2275,91 @@
|
|
|
1503
2275
|
document.addEventListener("ended", (event) => {
|
|
1504
2276
|
this.handleMediaPlaybackEnded(event);
|
|
1505
2277
|
}, true);
|
|
2278
|
+
document.addEventListener("click", (event) => {
|
|
2279
|
+
this.handleGenericClick(event);
|
|
2280
|
+
}, true);
|
|
2281
|
+
window.addEventListener("popstate", (event) => {
|
|
2282
|
+
this.handlePopstate(event);
|
|
2283
|
+
});
|
|
2284
|
+
}
|
|
2285
|
+
handleGenericClick(event) {
|
|
2286
|
+
if (!this.hasActiveMedia()) {
|
|
2287
|
+
return;
|
|
2288
|
+
}
|
|
2289
|
+
if (event.defaultPrevented) {
|
|
2290
|
+
return;
|
|
2291
|
+
}
|
|
2292
|
+
const mouse_event = event;
|
|
2293
|
+
if (mouse_event.button !== 0) {
|
|
2294
|
+
return;
|
|
2295
|
+
}
|
|
2296
|
+
if (mouse_event.metaKey || mouse_event.ctrlKey || mouse_event.shiftKey || mouse_event.altKey) {
|
|
2297
|
+
return;
|
|
2298
|
+
}
|
|
2299
|
+
if (event.target === null) {
|
|
2300
|
+
return;
|
|
2301
|
+
}
|
|
2302
|
+
const target = event.target;
|
|
2303
|
+
const anchor = target.closest("a[href]");
|
|
2304
|
+
if (anchor === null) {
|
|
2305
|
+
return;
|
|
2306
|
+
}
|
|
2307
|
+
const url = new URL(anchor.href, window.location.href);
|
|
2308
|
+
if (url.origin !== window.location.origin) {
|
|
2309
|
+
return;
|
|
2310
|
+
}
|
|
2311
|
+
event.preventDefault();
|
|
2312
|
+
const path = url.pathname + url.search + url.hash;
|
|
2313
|
+
this.navigateToPath(path);
|
|
2314
|
+
}
|
|
2315
|
+
navigateToPath(path) {
|
|
2316
|
+
if (!this.hasActiveMedia()) {
|
|
2317
|
+
window.location.href = path;
|
|
2318
|
+
return;
|
|
2319
|
+
}
|
|
2320
|
+
history.pushState({ path }, "", path);
|
|
2321
|
+
this.fetchAndDisplay(path);
|
|
2322
|
+
}
|
|
2323
|
+
async fetchAndDisplay(path) {
|
|
2324
|
+
const response = await fetch(path, {
|
|
2325
|
+
headers: {
|
|
2326
|
+
"Accept": "text/html"
|
|
2327
|
+
}
|
|
2328
|
+
});
|
|
2329
|
+
if (!response.ok) {
|
|
2330
|
+
window.location.href = path;
|
|
2331
|
+
return;
|
|
2332
|
+
}
|
|
2333
|
+
const html = await response.text();
|
|
2334
|
+
const parser = new DOMParser();
|
|
2335
|
+
const updated_document = parser.parseFromString(html, "text/html");
|
|
2336
|
+
const tags = ["header", "main", "footer"];
|
|
2337
|
+
let index = 0;
|
|
2338
|
+
while (index < tags.length) {
|
|
2339
|
+
const tag = tags[index++];
|
|
2340
|
+
const old_element = document.querySelector(tag);
|
|
2341
|
+
const new_element = updated_document.querySelector(tag);
|
|
2342
|
+
if (old_element === null && new_element === null) {
|
|
2343
|
+
continue;
|
|
2344
|
+
}
|
|
2345
|
+
if (old_element === null || new_element === null) {
|
|
2346
|
+
window.location.href = path;
|
|
2347
|
+
return;
|
|
2348
|
+
}
|
|
2349
|
+
old_element.replaceWith(new_element);
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
handlePopstate(event) {
|
|
2353
|
+
const { pathname, search, hash } = window.location;
|
|
2354
|
+
const path = pathname + search + hash;
|
|
2355
|
+
this.fetchAndDisplay(path);
|
|
1506
2356
|
}
|
|
1507
2357
|
focusCurrentBlockElement() {
|
|
1508
|
-
const
|
|
1509
|
-
if (
|
|
2358
|
+
const current_block = this.getCurrentBlockElement();
|
|
2359
|
+
if (current_block === null) {
|
|
1510
2360
|
return;
|
|
1511
2361
|
}
|
|
1512
|
-
this.focusElement(
|
|
2362
|
+
this.focusElement(current_block);
|
|
1513
2363
|
}
|
|
1514
2364
|
handleKey(key_code) {
|
|
1515
2365
|
switch (key_code) {
|
|
@@ -1617,15 +2467,15 @@
|
|
|
1617
2467
|
}
|
|
1618
2468
|
jumpToPageTop() {
|
|
1619
2469
|
this.navigateToIndex(this.getFirstBlockIndex());
|
|
1620
|
-
|
|
2470
|
+
window.scrollTo(0, 0);
|
|
1621
2471
|
}
|
|
1622
2472
|
jumpToPageBottom() {
|
|
1623
2473
|
this.navigateToIndex(this.getLastBlockIndex());
|
|
1624
|
-
|
|
2474
|
+
window.scrollTo(0, document.documentElement.scrollHeight);
|
|
1625
2475
|
}
|
|
1626
2476
|
navigateToParentPage() {
|
|
1627
2477
|
const parent_path = get_parent_path_default(window.location.pathname);
|
|
1628
|
-
|
|
2478
|
+
this.navigateToPath(parent_path);
|
|
1629
2479
|
}
|
|
1630
2480
|
navigateToHistory() {
|
|
1631
2481
|
window.location.href = "/history";
|
|
@@ -1658,16 +2508,26 @@
|
|
|
1658
2508
|
if (this.shiftIsPressed()) {
|
|
1659
2509
|
this.promoteCurrentBlock();
|
|
1660
2510
|
} else {
|
|
1661
|
-
this.
|
|
1662
|
-
|
|
2511
|
+
const index = this.getPreviousBlockIndex();
|
|
2512
|
+
if (index === null) {
|
|
2513
|
+
window.scrollTo(0, 0);
|
|
2514
|
+
} else {
|
|
2515
|
+
this.navigateToIndex(index);
|
|
2516
|
+
this.focusCurrentBlockElement();
|
|
2517
|
+
}
|
|
1663
2518
|
}
|
|
1664
2519
|
}
|
|
1665
2520
|
selectNextBlock() {
|
|
1666
2521
|
if (this.shiftIsPressed()) {
|
|
1667
2522
|
this.demoteCurrentBlock();
|
|
1668
2523
|
} else {
|
|
1669
|
-
this.
|
|
1670
|
-
|
|
2524
|
+
const index = this.getNextBlockIndex();
|
|
2525
|
+
if (index === null) {
|
|
2526
|
+
window.scrollTo(0, document.documentElement.scrollHeight);
|
|
2527
|
+
} else {
|
|
2528
|
+
this.navigateToIndex(index);
|
|
2529
|
+
this.focusCurrentBlockElement();
|
|
2530
|
+
}
|
|
1671
2531
|
}
|
|
1672
2532
|
}
|
|
1673
2533
|
getCurrentBlockIndex() {
|
|
@@ -1711,7 +2571,7 @@
|
|
|
1711
2571
|
}
|
|
1712
2572
|
getFirstBlockIndex() {
|
|
1713
2573
|
const blocks = this.getBlockElements();
|
|
1714
|
-
const first_block = (0,
|
|
2574
|
+
const first_block = (0, import_array.getFirstValue)(blocks);
|
|
1715
2575
|
if (first_block === void 0) {
|
|
1716
2576
|
return null;
|
|
1717
2577
|
}
|
|
@@ -1719,7 +2579,7 @@
|
|
|
1719
2579
|
}
|
|
1720
2580
|
getLastBlockIndex() {
|
|
1721
2581
|
const blocks = this.getBlockElements();
|
|
1722
|
-
const last_block = (0,
|
|
2582
|
+
const last_block = (0, import_array.getLastValue)(blocks);
|
|
1723
2583
|
if (last_block === void 0) {
|
|
1724
2584
|
return null;
|
|
1725
2585
|
}
|
|
@@ -1788,7 +2648,7 @@
|
|
|
1788
2648
|
}
|
|
1789
2649
|
activateFolderBlock(block_element) {
|
|
1790
2650
|
const href = get_block_activation_href_default(block_element);
|
|
1791
|
-
|
|
2651
|
+
this.navigateToPath(href);
|
|
1792
2652
|
}
|
|
1793
2653
|
activateImageBlock(block_element) {
|
|
1794
2654
|
const href = get_block_activation_href_default(block_element);
|
|
@@ -1812,16 +2672,57 @@
|
|
|
1812
2672
|
if (element === null) {
|
|
1813
2673
|
return;
|
|
1814
2674
|
}
|
|
2675
|
+
this.playElement(element);
|
|
2676
|
+
}
|
|
2677
|
+
playElement(element) {
|
|
2678
|
+
this.pauseActiveMedia();
|
|
1815
2679
|
const media_block = element.closest("section.block");
|
|
1816
|
-
if (media_block
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
2680
|
+
if (media_block === null) {
|
|
2681
|
+
throw new import_errors7.InvariantViolation(`
|
|
2682
|
+
Tried to access closest block wrapper for media, but it was not found
|
|
2683
|
+
`);
|
|
2684
|
+
}
|
|
2685
|
+
const index_path = getIndexPathForElement(media_block);
|
|
2686
|
+
this.navigateToIndex(index_path);
|
|
2687
|
+
this.focusCurrentBlockElement();
|
|
2688
|
+
const persistent_element = document.getElementById("persistent-audio");
|
|
2689
|
+
const persistent_audio = persistent_element;
|
|
2690
|
+
const track_target = document.getElementById("persistent-track-name");
|
|
2691
|
+
const artist_target = document.getElementById("persistent-artist-name");
|
|
2692
|
+
const track_source = media_block.querySelector('[data-role="track_name"]');
|
|
2693
|
+
const artist_source = media_block.querySelector('[data-role="artist_name"]');
|
|
2694
|
+
if (persistent_audio === null) {
|
|
2695
|
+
throw new import_errors7.InvariantViolation(`
|
|
2696
|
+
Tried to access persistent audio element, but it was not found
|
|
2697
|
+
`);
|
|
2698
|
+
}
|
|
2699
|
+
if (track_target === null) {
|
|
2700
|
+
throw new import_errors7.InvariantViolation(`
|
|
2701
|
+
Tried to access persistent track name element, but it was not found
|
|
2702
|
+
`);
|
|
2703
|
+
}
|
|
2704
|
+
if (artist_target === null) {
|
|
2705
|
+
throw new import_errors7.InvariantViolation(`
|
|
2706
|
+
Tried to access persistent artist name element, but it was not found
|
|
2707
|
+
`);
|
|
1820
2708
|
}
|
|
2709
|
+
if (track_source === null) {
|
|
2710
|
+
throw new import_errors7.InvariantViolation(`
|
|
2711
|
+
Tried to read track name source, but it was not found
|
|
2712
|
+
`);
|
|
2713
|
+
}
|
|
2714
|
+
if (artist_source === null) {
|
|
2715
|
+
throw new import_errors7.InvariantViolation(`
|
|
2716
|
+
Tried to read artist name source, but it was not found
|
|
2717
|
+
`);
|
|
2718
|
+
}
|
|
2719
|
+
persistent_audio.src = element.src;
|
|
2720
|
+
track_target.innerHTML = track_source.innerHTML;
|
|
2721
|
+
artist_target.innerHTML = artist_source.innerHTML;
|
|
2722
|
+
document.body.classList.add("media-visible");
|
|
1821
2723
|
if (element.readyState >= media_ready_state_default.HAVE_CURRENT_DATA) {
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
return;
|
|
2724
|
+
persistent_audio.currentTime = 0;
|
|
2725
|
+
persistent_audio.play();
|
|
1825
2726
|
}
|
|
1826
2727
|
}
|
|
1827
2728
|
handleMediaCanPlay(event) {
|
|
@@ -1830,6 +2731,18 @@
|
|
|
1830
2731
|
return;
|
|
1831
2732
|
}
|
|
1832
2733
|
const media_target = target;
|
|
2734
|
+
const duration_ms = media_target.duration * import_time.TimeInterval.ONE_SECOND;
|
|
2735
|
+
const timecode = (0, import_time.formatTimecode)(duration_ms);
|
|
2736
|
+
const block = media_target.closest("section.block");
|
|
2737
|
+
if (block !== null) {
|
|
2738
|
+
const duration_label = block.querySelector('[data-role="duration"]');
|
|
2739
|
+
if (duration_label === null) {
|
|
2740
|
+
throw new import_errors7.InvariantViolation(`
|
|
2741
|
+
Tried to read duration label for media block, but it was not found
|
|
2742
|
+
`);
|
|
2743
|
+
}
|
|
2744
|
+
duration_label.innerHTML = timecode;
|
|
2745
|
+
}
|
|
1833
2746
|
if (this.queued_media !== media_target) {
|
|
1834
2747
|
return;
|
|
1835
2748
|
}
|
|
@@ -1837,8 +2750,7 @@
|
|
|
1837
2750
|
return;
|
|
1838
2751
|
}
|
|
1839
2752
|
this.ready_media.push(media_target);
|
|
1840
|
-
media_target
|
|
1841
|
-
media_target.play();
|
|
2753
|
+
this.playElement(media_target);
|
|
1842
2754
|
}
|
|
1843
2755
|
handleMediaPlaybackEnded(event) {
|
|
1844
2756
|
const target = event.target;
|
|
@@ -1846,16 +2758,20 @@
|
|
|
1846
2758
|
return;
|
|
1847
2759
|
}
|
|
1848
2760
|
const media_target = target;
|
|
1849
|
-
|
|
1850
|
-
|
|
2761
|
+
const queued_media = this.queued_media;
|
|
2762
|
+
if (queued_media !== null) {
|
|
2763
|
+
if (queued_media.src !== media_target.src) {
|
|
2764
|
+
return;
|
|
2765
|
+
}
|
|
1851
2766
|
}
|
|
1852
2767
|
this.setQueuedMedia(null);
|
|
1853
2768
|
media_target.currentTime = 0;
|
|
1854
|
-
const
|
|
2769
|
+
const elements = document.querySelectorAll("audio,video");
|
|
2770
|
+
const media_elements = Array.from(elements);
|
|
1855
2771
|
let index = 0;
|
|
1856
2772
|
while (index < media_elements.length) {
|
|
1857
2773
|
const element = media_elements[index++];
|
|
1858
|
-
if (element === media_target) {
|
|
2774
|
+
if (element.src === media_target.src) {
|
|
1859
2775
|
const next_element = media_elements[index];
|
|
1860
2776
|
if (next_element) {
|
|
1861
2777
|
return this.setQueuedMedia(next_element);
|
|
@@ -1863,17 +2779,27 @@
|
|
|
1863
2779
|
}
|
|
1864
2780
|
}
|
|
1865
2781
|
}
|
|
1866
|
-
|
|
1867
|
-
this.
|
|
2782
|
+
hasActiveMedia() {
|
|
2783
|
+
const active_media = this.getActiveMedia();
|
|
2784
|
+
return active_media.length > 0;
|
|
2785
|
+
}
|
|
2786
|
+
getActiveMedia() {
|
|
1868
2787
|
const elements = document.querySelectorAll("audio,video");
|
|
1869
2788
|
const media_elements = Array.from(elements);
|
|
1870
|
-
media_elements.
|
|
2789
|
+
return media_elements.filter((media_element) => {
|
|
1871
2790
|
if (media_element.paused || media_element.ended) {
|
|
1872
|
-
return;
|
|
2791
|
+
return false;
|
|
1873
2792
|
}
|
|
1874
2793
|
if (media_element.readyState < media_ready_state_default.HAVE_CURRENT_DATA) {
|
|
1875
|
-
return;
|
|
2794
|
+
return false;
|
|
1876
2795
|
}
|
|
2796
|
+
return true;
|
|
2797
|
+
});
|
|
2798
|
+
}
|
|
2799
|
+
pauseActiveMedia() {
|
|
2800
|
+
this.setQueuedMedia(null);
|
|
2801
|
+
const active_media = this.getActiveMedia();
|
|
2802
|
+
active_media.forEach((media_element) => {
|
|
1877
2803
|
media_element.pause();
|
|
1878
2804
|
});
|
|
1879
2805
|
}
|
|
@@ -2050,6 +2976,9 @@
|
|
|
2050
2976
|
if (!this.isLoggedIn()) {
|
|
2051
2977
|
return;
|
|
2052
2978
|
}
|
|
2979
|
+
if (this.shiftIsPressed()) {
|
|
2980
|
+
return;
|
|
2981
|
+
}
|
|
2053
2982
|
const block_element = this.getCurrentBlockElement();
|
|
2054
2983
|
if (block_element === null) {
|
|
2055
2984
|
return;
|