@baleada/logic 0.20.29 → 0.20.34
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/lib/index.cjs +179 -22
- package/lib/index.d.ts +4 -1
- package/lib/index.js +173 -18
- package/package.json +4 -4
package/lib/index.cjs
CHANGED
|
@@ -140,9 +140,14 @@ function createReverse() {
|
|
|
140
140
|
return reversed;
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
+
function createSort(compare) {
|
|
144
|
+
return (array) => {
|
|
145
|
+
return new Pipeable(array).pipe(createSlice({ from: 0 }), (sliced) => sliced.sort(compare));
|
|
146
|
+
};
|
|
147
|
+
}
|
|
143
148
|
function createSlug(options) {
|
|
144
149
|
return (string) => {
|
|
145
|
-
return slugify__default[
|
|
150
|
+
return slugify__default["default"](string, options);
|
|
146
151
|
};
|
|
147
152
|
}
|
|
148
153
|
function createClip(required) {
|
|
@@ -169,7 +174,16 @@ function createDetermine(potentialities) {
|
|
|
169
174
|
function createRename({ from, to }) {
|
|
170
175
|
return (map2) => {
|
|
171
176
|
const keys = [...map2.keys()], keyToRenameIndex = lazyCollections.findIndex((k) => k === from)(keys), newKeys = createReplace({ index: keyToRenameIndex, item: to })(keys), values = [...map2.values()];
|
|
172
|
-
return createReduce((renamed, key, index) => renamed.set(key, values[index]), new Map())(newKeys);
|
|
177
|
+
return createReduce((renamed, key, index) => renamed.set(key, values[index]), /* @__PURE__ */ new Map())(newKeys);
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
function createToEntries() {
|
|
181
|
+
return (object) => {
|
|
182
|
+
const entries = [];
|
|
183
|
+
for (const key in object) {
|
|
184
|
+
entries.push([key, object[key]]);
|
|
185
|
+
}
|
|
186
|
+
return entries;
|
|
173
187
|
};
|
|
174
188
|
}
|
|
175
189
|
class Pipeable {
|
|
@@ -237,8 +251,6 @@ function toEvent(eventType, options) {
|
|
|
237
251
|
return new InputEvent(eventType, options.init);
|
|
238
252
|
if (eventType === "blur")
|
|
239
253
|
return new FocusEvent(eventType, options.init);
|
|
240
|
-
if (eventType === "cancel")
|
|
241
|
-
return new Event(eventType, options.init);
|
|
242
254
|
if (eventType === "canplay")
|
|
243
255
|
return new Event(eventType, options.init);
|
|
244
256
|
if (eventType === "canplaythrough")
|
|
@@ -267,8 +279,6 @@ function toEvent(eventType, options) {
|
|
|
267
279
|
return new DragEvent(eventType, options.init);
|
|
268
280
|
if (eventType === "dragenter")
|
|
269
281
|
return new DragEvent(eventType, options.init);
|
|
270
|
-
if (eventType === "dragexit")
|
|
271
|
-
return new Event(eventType, options.init);
|
|
272
282
|
if (eventType === "dragleave")
|
|
273
283
|
return new DragEvent(eventType, options.init);
|
|
274
284
|
if (eventType === "dragover")
|
|
@@ -491,7 +501,7 @@ function toCombo(type) {
|
|
|
491
501
|
function fromComboItemNameToType(name) {
|
|
492
502
|
return lazyCollections.find((type) => predicatesByType[type](name))(listenableComboItemTypes) ?? "custom";
|
|
493
503
|
}
|
|
494
|
-
const listenableComboItemTypes = new Set(["singleCharacter", "arrow", "other", "modifier", "click", "pointer"]);
|
|
504
|
+
const listenableComboItemTypes = /* @__PURE__ */ new Set(["singleCharacter", "arrow", "other", "modifier", "click", "pointer"]);
|
|
495
505
|
const predicatesByType = {
|
|
496
506
|
singleCharacter: (name) => typeREs["singleCharacter"].test(name),
|
|
497
507
|
arrow: (name) => typeREs["arrow"].test(name),
|
|
@@ -587,6 +597,10 @@ function isString(value) {
|
|
|
587
597
|
}
|
|
588
598
|
|
|
589
599
|
class Recognizeable {
|
|
600
|
+
maxSequenceLength;
|
|
601
|
+
effects;
|
|
602
|
+
effectApi;
|
|
603
|
+
toType;
|
|
590
604
|
constructor(sequence, options = { effectsIncludeCombos: true }) {
|
|
591
605
|
const defaultOptions = {
|
|
592
606
|
maxSequenceLength: true,
|
|
@@ -610,6 +624,7 @@ class Recognizeable {
|
|
|
610
624
|
};
|
|
611
625
|
this.ready();
|
|
612
626
|
}
|
|
627
|
+
computedMetadata;
|
|
613
628
|
resetComputedMetadata() {
|
|
614
629
|
this.computedMetadata = {};
|
|
615
630
|
}
|
|
@@ -619,6 +634,7 @@ class Recognizeable {
|
|
|
619
634
|
denied() {
|
|
620
635
|
this.computedStatus = "denied";
|
|
621
636
|
}
|
|
637
|
+
computedStatus;
|
|
622
638
|
ready() {
|
|
623
639
|
this.computedStatus = "ready";
|
|
624
640
|
}
|
|
@@ -634,6 +650,7 @@ class Recognizeable {
|
|
|
634
650
|
get metadata() {
|
|
635
651
|
return this.computedMetadata;
|
|
636
652
|
}
|
|
653
|
+
computedSequence;
|
|
637
654
|
setSequence(sequence) {
|
|
638
655
|
this.computedSequence = sequence;
|
|
639
656
|
return this;
|
|
@@ -737,9 +754,12 @@ function createToType({
|
|
|
737
754
|
}
|
|
738
755
|
};
|
|
739
756
|
}
|
|
740
|
-
const leftclickcomboEventTypes = new Set(["click", "mousedown", "mouseup", "dblclick"]), rightclickComboEventTypes = new Set(["contextmenu"]), keycomboEventTypes = new Set(["keydown", "keyup"]), toJoinedClickcombo = lazyCollections.join("+"), toJoinedKeycombo = lazyCollections.pipe(lazyCollections.map(({ name }) => name), toJoinedClickcombo);
|
|
757
|
+
const leftclickcomboEventTypes = /* @__PURE__ */ new Set(["click", "mousedown", "mouseup", "dblclick"]), rightclickComboEventTypes = /* @__PURE__ */ new Set(["contextmenu"]), keycomboEventTypes = /* @__PURE__ */ new Set(["keydown", "keyup"]), toJoinedClickcombo = lazyCollections.join("+"), toJoinedKeycombo = lazyCollections.pipe(lazyCollections.map(({ name }) => name), toJoinedClickcombo);
|
|
741
758
|
|
|
742
759
|
class Listenable {
|
|
760
|
+
computedRecognizeable;
|
|
761
|
+
recognizeableEffectsKeys;
|
|
762
|
+
computedActive;
|
|
743
763
|
constructor(type, options) {
|
|
744
764
|
if (type === "recognizeable") {
|
|
745
765
|
const recognizeableOptions = {
|
|
@@ -752,10 +772,11 @@ class Listenable {
|
|
|
752
772
|
this.computedRecognizeable = new Recognizeable([], recognizeableOptions);
|
|
753
773
|
this.recognizeableEffectsKeys = Object.keys(recognizeableOptions.effects);
|
|
754
774
|
}
|
|
755
|
-
this.computedActive = new Set();
|
|
775
|
+
this.computedActive = /* @__PURE__ */ new Set();
|
|
756
776
|
this.setType(type);
|
|
757
777
|
this.ready();
|
|
758
778
|
}
|
|
779
|
+
computedStatus;
|
|
759
780
|
ready() {
|
|
760
781
|
this.computedStatus = "ready";
|
|
761
782
|
}
|
|
@@ -774,6 +795,8 @@ class Listenable {
|
|
|
774
795
|
get recognizeable() {
|
|
775
796
|
return this.computedRecognizeable;
|
|
776
797
|
}
|
|
798
|
+
computedType;
|
|
799
|
+
implementation;
|
|
777
800
|
setType(type) {
|
|
778
801
|
this.stop();
|
|
779
802
|
this.computedType = type;
|
|
@@ -966,7 +989,7 @@ function stop(stoppable) {
|
|
|
966
989
|
function toImplementation(type) {
|
|
967
990
|
return lazyCollections.find((implementation) => predicatesByImplementation.get(implementation)(type))(predicatesByImplementation.keys());
|
|
968
991
|
}
|
|
969
|
-
const predicatesByImplementation = new Map([
|
|
992
|
+
const predicatesByImplementation = /* @__PURE__ */ new Map([
|
|
970
993
|
[
|
|
971
994
|
"recognizeable",
|
|
972
995
|
(type) => type === "recognizeable"
|
|
@@ -1016,7 +1039,7 @@ const predicatesByImplementation = new Map([
|
|
|
1016
1039
|
() => true
|
|
1017
1040
|
]
|
|
1018
1041
|
]);
|
|
1019
|
-
const documentEvents = new Set([
|
|
1042
|
+
const documentEvents = /* @__PURE__ */ new Set([
|
|
1020
1043
|
"fullscreenchange",
|
|
1021
1044
|
"fullscreenerror",
|
|
1022
1045
|
"pointerlockchange",
|
|
@@ -1039,6 +1062,11 @@ function eventMatchesKeycombo({ event, keycombo }) {
|
|
|
1039
1062
|
return lazyCollections.every(({ name, type }, index) => {
|
|
1040
1063
|
switch (type) {
|
|
1041
1064
|
case "singleCharacter":
|
|
1065
|
+
if (name === "!") {
|
|
1066
|
+
return event.key === "!";
|
|
1067
|
+
}
|
|
1068
|
+
const keyToTest = event.altKey && fromComboItemNameToType(event.key) === "custom" ? fromCodeToSingleCharacter(event.code) : event.key.toLowerCase();
|
|
1069
|
+
return name.startsWith("!") ? keyToTest !== toKey(name.slice(1)).toLowerCase() : keyToTest === toKey(name).toLowerCase();
|
|
1042
1070
|
case "other":
|
|
1043
1071
|
if (name === "!") {
|
|
1044
1072
|
return event.key === "!";
|
|
@@ -1054,7 +1082,34 @@ function eventMatchesKeycombo({ event, keycombo }) {
|
|
|
1054
1082
|
}
|
|
1055
1083
|
})(keycombo);
|
|
1056
1084
|
}
|
|
1057
|
-
|
|
1085
|
+
function fromCodeToSingleCharacter(code) {
|
|
1086
|
+
for (const c in aliasesByCode) {
|
|
1087
|
+
if (c === code) {
|
|
1088
|
+
return aliasesByCode[c];
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
for (const prefix of ["Key", "Digit"]) {
|
|
1092
|
+
const re = new RegExp(`^${prefix}`);
|
|
1093
|
+
if (re.test(code)) {
|
|
1094
|
+
return createClip(re)(code).toLowerCase();
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
return code;
|
|
1098
|
+
}
|
|
1099
|
+
const aliasesByCode = {
|
|
1100
|
+
"Backquote": "`",
|
|
1101
|
+
"Minus": "-",
|
|
1102
|
+
"Equal": "=",
|
|
1103
|
+
"BracketLeft": "[",
|
|
1104
|
+
"BracketRight": "]",
|
|
1105
|
+
"Backslash": "\\",
|
|
1106
|
+
"Semicolon": ";",
|
|
1107
|
+
"Quote": "'",
|
|
1108
|
+
"Comma": ",",
|
|
1109
|
+
"Period": ".",
|
|
1110
|
+
"Slash": "/"
|
|
1111
|
+
};
|
|
1112
|
+
const predicatesByArrow = /* @__PURE__ */ new Map([
|
|
1058
1113
|
[
|
|
1059
1114
|
"arrow",
|
|
1060
1115
|
({ event }) => arrows.has(event.key.toLowerCase())
|
|
@@ -1084,9 +1139,9 @@ const predicatesByArrow = new Map([
|
|
|
1084
1139
|
({ event, name }) => name.startsWith("!") ? event.key.toLowerCase() !== `arrow${name.toLowerCase()}` : event.key.toLowerCase() === `arrow${name.toLowerCase()}`
|
|
1085
1140
|
]
|
|
1086
1141
|
]);
|
|
1087
|
-
const arrows = new Set(["arrowup", "arrowright", "arrowdown", "arrowleft"]);
|
|
1088
|
-
const verticalArrows = new Set(["arrowup", "arrowdown"]);
|
|
1089
|
-
const horizontalArrows = new Set(["arrowright", "arrowleft"]);
|
|
1142
|
+
const arrows = /* @__PURE__ */ new Set(["arrowup", "arrowright", "arrowdown", "arrowleft"]);
|
|
1143
|
+
const verticalArrows = /* @__PURE__ */ new Set(["arrowup", "arrowdown"]);
|
|
1144
|
+
const horizontalArrows = /* @__PURE__ */ new Set(["arrowright", "arrowleft"]);
|
|
1090
1145
|
function eventMatchesClickcombo({ event, clickcombo }) {
|
|
1091
1146
|
return lazyCollections.every((name) => fromComboItemNameToType(name) === "click" || name.startsWith("!") && !isModified({ alias: name.slice(1), event }) || !name.startsWith("!") && isModified({ alias: name, event }))(clickcombo);
|
|
1092
1147
|
}
|
|
@@ -1111,6 +1166,21 @@ const defaultOptions$6 = {
|
|
|
1111
1166
|
alternates: false
|
|
1112
1167
|
};
|
|
1113
1168
|
class Animateable {
|
|
1169
|
+
initialDuration;
|
|
1170
|
+
iterationLimit;
|
|
1171
|
+
alternates;
|
|
1172
|
+
controlPoints;
|
|
1173
|
+
reversedControlPoints;
|
|
1174
|
+
toAnimationProgress;
|
|
1175
|
+
reversedToAnimationProgress;
|
|
1176
|
+
playCache;
|
|
1177
|
+
reverseCache;
|
|
1178
|
+
pauseCache;
|
|
1179
|
+
seekCache;
|
|
1180
|
+
alternateCache;
|
|
1181
|
+
visibilitychange;
|
|
1182
|
+
getEaseables;
|
|
1183
|
+
getReversedEaseables;
|
|
1114
1184
|
constructor(keyframes, options = {}) {
|
|
1115
1185
|
this.initialDuration = options?.duration || defaultOptions$6.duration;
|
|
1116
1186
|
this.controlPoints = fromTimingToControlPoints(options?.timing || defaultOptions$6.timing);
|
|
@@ -1134,21 +1204,25 @@ class Animateable {
|
|
|
1134
1204
|
this.resetProgress();
|
|
1135
1205
|
this.resetIterations();
|
|
1136
1206
|
}
|
|
1207
|
+
computedStatus;
|
|
1137
1208
|
ready() {
|
|
1138
1209
|
this.computedStatus = "ready";
|
|
1139
1210
|
}
|
|
1211
|
+
computedTime;
|
|
1140
1212
|
resetTime() {
|
|
1141
1213
|
this.computedTime = {
|
|
1142
1214
|
elapsed: 0,
|
|
1143
1215
|
remaining: this.duration
|
|
1144
1216
|
};
|
|
1145
1217
|
}
|
|
1218
|
+
computedProgress;
|
|
1146
1219
|
resetProgress() {
|
|
1147
1220
|
this.computedProgress = {
|
|
1148
1221
|
time: 0,
|
|
1149
1222
|
animation: 0
|
|
1150
1223
|
};
|
|
1151
1224
|
}
|
|
1225
|
+
computedIterations;
|
|
1152
1226
|
resetIterations() {
|
|
1153
1227
|
this.computedIterations = 0;
|
|
1154
1228
|
}
|
|
@@ -1179,6 +1253,11 @@ class Animateable {
|
|
|
1179
1253
|
get progress() {
|
|
1180
1254
|
return this.computedProgress;
|
|
1181
1255
|
}
|
|
1256
|
+
computedKeyframes;
|
|
1257
|
+
reversedKeyframes;
|
|
1258
|
+
properties;
|
|
1259
|
+
easeables;
|
|
1260
|
+
reversedEaseables;
|
|
1182
1261
|
setKeyframes(keyframes) {
|
|
1183
1262
|
this.stop();
|
|
1184
1263
|
this.computedKeyframes = Array.from(keyframes).sort(({ progress: progressA }, { progress: progressB }) => progressA - progressB);
|
|
@@ -1188,6 +1267,9 @@ class Animateable {
|
|
|
1188
1267
|
this.reversedEaseables = this.getReversedEaseables({ keyframes: this.reversedKeyframes, properties: this.properties });
|
|
1189
1268
|
return this;
|
|
1190
1269
|
}
|
|
1270
|
+
computedPlaybackRate;
|
|
1271
|
+
duration;
|
|
1272
|
+
totalTimeInvisible;
|
|
1191
1273
|
setPlaybackRate(playbackRate) {
|
|
1192
1274
|
const ensuredPlaybackRate = Math.max(0, playbackRate);
|
|
1193
1275
|
this.computedPlaybackRate = ensuredPlaybackRate;
|
|
@@ -1333,6 +1415,7 @@ class Animateable {
|
|
|
1333
1415
|
reversed() {
|
|
1334
1416
|
this.computedStatus = "reversed";
|
|
1335
1417
|
}
|
|
1418
|
+
invisibleAt;
|
|
1336
1419
|
listenForVisibilitychange() {
|
|
1337
1420
|
if (this.visibilitychange.active.size === 0) {
|
|
1338
1421
|
this.totalTimeInvisible = 0;
|
|
@@ -1348,6 +1431,7 @@ class Animateable {
|
|
|
1348
1431
|
});
|
|
1349
1432
|
}
|
|
1350
1433
|
}
|
|
1434
|
+
computedRequest;
|
|
1351
1435
|
createAnimate(type) {
|
|
1352
1436
|
return (effect, options = {}) => {
|
|
1353
1437
|
const { interpolate: interpolateOptions } = options;
|
|
@@ -1368,6 +1452,7 @@ class Animateable {
|
|
|
1368
1452
|
return this;
|
|
1369
1453
|
};
|
|
1370
1454
|
}
|
|
1455
|
+
startTime;
|
|
1371
1456
|
setStartTimeAndStatus(type, timestamp) {
|
|
1372
1457
|
switch (type) {
|
|
1373
1458
|
case "play":
|
|
@@ -1734,7 +1819,7 @@ function createGetEaseables(fromKeyframeToControlPoints) {
|
|
|
1734
1819
|
};
|
|
1735
1820
|
}
|
|
1736
1821
|
function toProperties(keyframes) {
|
|
1737
|
-
const properties = new Set();
|
|
1822
|
+
const properties = /* @__PURE__ */ new Set();
|
|
1738
1823
|
for (const keyframe of keyframes) {
|
|
1739
1824
|
for (const property in keyframe.properties) {
|
|
1740
1825
|
if (!properties.has(property)) {
|
|
@@ -1759,7 +1844,7 @@ function fromControlPointsToReversedControlPoints(points) {
|
|
|
1759
1844
|
}
|
|
1760
1845
|
function createToAnimationProgress(points) {
|
|
1761
1846
|
const { 0: { x: point1x, y: point1y }, 1: { x: point2x, y: point2y } } = points;
|
|
1762
|
-
return BezierEasing__default[
|
|
1847
|
+
return BezierEasing__default["default"](point1x, point1y, point2x, point2y);
|
|
1763
1848
|
}
|
|
1764
1849
|
function toInterpolated({ previous, next, progress }, options = {}) {
|
|
1765
1850
|
if (isUndefined(previous)) {
|
|
@@ -1972,6 +2057,10 @@ const defaultCompleteOptions = {
|
|
|
1972
2057
|
select: "completionEnd"
|
|
1973
2058
|
};
|
|
1974
2059
|
class Completeable {
|
|
2060
|
+
segmentFrom;
|
|
2061
|
+
segmentTo;
|
|
2062
|
+
divider;
|
|
2063
|
+
computedDividerIndices;
|
|
1975
2064
|
constructor(string, options = {}) {
|
|
1976
2065
|
this.constructing();
|
|
1977
2066
|
this.segmentFrom = options?.segment?.from || defaultOptions$5.segment.from;
|
|
@@ -1985,6 +2074,7 @@ class Completeable {
|
|
|
1985
2074
|
constructing() {
|
|
1986
2075
|
this.computedStatus = "constructing";
|
|
1987
2076
|
}
|
|
2077
|
+
computedStatus;
|
|
1988
2078
|
ready() {
|
|
1989
2079
|
this.computedStatus = "ready";
|
|
1990
2080
|
}
|
|
@@ -2029,6 +2119,7 @@ class Completeable {
|
|
|
2029
2119
|
return this.dividerIndices.after;
|
|
2030
2120
|
}
|
|
2031
2121
|
}
|
|
2122
|
+
computedString;
|
|
2032
2123
|
setString(string) {
|
|
2033
2124
|
this.computedString = string;
|
|
2034
2125
|
switch (this.status) {
|
|
@@ -2040,6 +2131,7 @@ class Completeable {
|
|
|
2040
2131
|
}
|
|
2041
2132
|
return this;
|
|
2042
2133
|
}
|
|
2134
|
+
computedSelection;
|
|
2043
2135
|
setSelection(selection) {
|
|
2044
2136
|
this.computedSelection = selection;
|
|
2045
2137
|
this.setDividerIndices();
|
|
@@ -2126,6 +2218,10 @@ function toNextMatch({ string, re, from }) {
|
|
|
2126
2218
|
}
|
|
2127
2219
|
|
|
2128
2220
|
class Copyable {
|
|
2221
|
+
computedIsClipboardText;
|
|
2222
|
+
copyListenable;
|
|
2223
|
+
cutListenable;
|
|
2224
|
+
copyAndCutEffect;
|
|
2129
2225
|
constructor(string, options = {}) {
|
|
2130
2226
|
this.computedIsClipboardText = false;
|
|
2131
2227
|
this.copyListenable = new Listenable("copy");
|
|
@@ -2137,6 +2233,7 @@ class Copyable {
|
|
|
2137
2233
|
this.setString(string);
|
|
2138
2234
|
this.ready();
|
|
2139
2235
|
}
|
|
2236
|
+
computedStatus;
|
|
2140
2237
|
ready() {
|
|
2141
2238
|
this.computedStatus = "ready";
|
|
2142
2239
|
}
|
|
@@ -2158,10 +2255,13 @@ class Copyable {
|
|
|
2158
2255
|
get error() {
|
|
2159
2256
|
return this.computedError;
|
|
2160
2257
|
}
|
|
2258
|
+
computedString;
|
|
2161
2259
|
setString(string) {
|
|
2162
2260
|
this.computedString = string;
|
|
2163
2261
|
return this;
|
|
2164
2262
|
}
|
|
2263
|
+
computedResponse;
|
|
2264
|
+
computedError;
|
|
2165
2265
|
async copy(options = { type: "clipboard" }) {
|
|
2166
2266
|
this.copying();
|
|
2167
2267
|
const { type } = options;
|
|
@@ -2214,6 +2314,7 @@ const defaultOptions$4 = {
|
|
|
2214
2314
|
executions: 1
|
|
2215
2315
|
};
|
|
2216
2316
|
class Delayable {
|
|
2317
|
+
animateable;
|
|
2217
2318
|
constructor(effect, options = {}) {
|
|
2218
2319
|
this.animateable = new Animateable([
|
|
2219
2320
|
{ progress: 0, properties: { progress: 0 } },
|
|
@@ -2225,6 +2326,7 @@ class Delayable {
|
|
|
2225
2326
|
this.setEffect(effect);
|
|
2226
2327
|
this.ready();
|
|
2227
2328
|
}
|
|
2329
|
+
computedStatus;
|
|
2228
2330
|
ready() {
|
|
2229
2331
|
this.computedStatus = "ready";
|
|
2230
2332
|
}
|
|
@@ -2246,12 +2348,14 @@ class Delayable {
|
|
|
2246
2348
|
get progress() {
|
|
2247
2349
|
return this.animateable.progress.time;
|
|
2248
2350
|
}
|
|
2351
|
+
computedEffect;
|
|
2249
2352
|
setEffect(effect) {
|
|
2250
2353
|
this.stop();
|
|
2251
2354
|
this.computedEffect = effect;
|
|
2252
2355
|
this.setFrameEffect(effect);
|
|
2253
2356
|
return this;
|
|
2254
2357
|
}
|
|
2358
|
+
frameEffect;
|
|
2255
2359
|
setFrameEffect(effect) {
|
|
2256
2360
|
this.frameEffect = (frame) => {
|
|
2257
2361
|
const { properties: { progress }, timestamp } = frame;
|
|
@@ -2354,6 +2458,7 @@ class Dispatchable {
|
|
|
2354
2458
|
this.setType(type);
|
|
2355
2459
|
this.ready();
|
|
2356
2460
|
}
|
|
2461
|
+
computedStatus;
|
|
2357
2462
|
ready() {
|
|
2358
2463
|
this.computedStatus = "ready";
|
|
2359
2464
|
}
|
|
@@ -2369,10 +2474,12 @@ class Dispatchable {
|
|
|
2369
2474
|
get status() {
|
|
2370
2475
|
return this.computedStatus;
|
|
2371
2476
|
}
|
|
2477
|
+
computedType;
|
|
2372
2478
|
setType(type) {
|
|
2373
2479
|
this.computedType = type;
|
|
2374
2480
|
return this;
|
|
2375
2481
|
}
|
|
2482
|
+
computedCancelled;
|
|
2376
2483
|
dispatch(options = {}) {
|
|
2377
2484
|
const { target = window, ...rest } = options, event = toEvent(this.type, rest);
|
|
2378
2485
|
this.computedCancelled = !target.dispatchEvent(event);
|
|
@@ -2388,11 +2495,14 @@ const defaultOptions$3 = {
|
|
|
2388
2495
|
toD: (stroke) => stroke.length === 0 ? "" : toD(stroke)
|
|
2389
2496
|
};
|
|
2390
2497
|
class Drawable {
|
|
2498
|
+
computedD;
|
|
2499
|
+
toD;
|
|
2391
2500
|
constructor(stroke, options = {}) {
|
|
2392
2501
|
this.toD = options?.toD || defaultOptions$3.toD;
|
|
2393
2502
|
this.setStroke(stroke);
|
|
2394
2503
|
this.ready();
|
|
2395
2504
|
}
|
|
2505
|
+
computedStatus;
|
|
2396
2506
|
ready() {
|
|
2397
2507
|
this.computedStatus = "ready";
|
|
2398
2508
|
}
|
|
@@ -2408,6 +2518,7 @@ class Drawable {
|
|
|
2408
2518
|
get d() {
|
|
2409
2519
|
return this.computedD;
|
|
2410
2520
|
}
|
|
2521
|
+
computedStroke;
|
|
2411
2522
|
setStroke(stroke) {
|
|
2412
2523
|
this.computedStroke = stroke;
|
|
2413
2524
|
this.computedD = this.toD(stroke);
|
|
@@ -2436,7 +2547,7 @@ function toFlattenedD(stroke) {
|
|
|
2436
2547
|
if (stroke.length === 0) {
|
|
2437
2548
|
return "";
|
|
2438
2549
|
}
|
|
2439
|
-
const multiPolygon = polygonClipping__default[
|
|
2550
|
+
const multiPolygon = polygonClipping__default["default"].union([stroke]);
|
|
2440
2551
|
return createReduce((dFromMultiPolygon, polygon) => {
|
|
2441
2552
|
return dFromMultiPolygon + createReduce((dFromRing, points) => {
|
|
2442
2553
|
return dFromRing + toD(points);
|
|
@@ -2449,6 +2560,7 @@ class Resolveable {
|
|
|
2449
2560
|
this.setGetPromise(getPromise);
|
|
2450
2561
|
this.ready();
|
|
2451
2562
|
}
|
|
2563
|
+
computedStatus;
|
|
2452
2564
|
ready() {
|
|
2453
2565
|
this.computedStatus = "ready";
|
|
2454
2566
|
}
|
|
@@ -2464,10 +2576,12 @@ class Resolveable {
|
|
|
2464
2576
|
get value() {
|
|
2465
2577
|
return this.computedValue;
|
|
2466
2578
|
}
|
|
2579
|
+
computedGetPromise;
|
|
2467
2580
|
setGetPromise(getPromise) {
|
|
2468
2581
|
this.computedGetPromise = getPromise;
|
|
2469
2582
|
return this;
|
|
2470
2583
|
}
|
|
2584
|
+
computedValue;
|
|
2471
2585
|
async resolve(...args) {
|
|
2472
2586
|
this.resolving();
|
|
2473
2587
|
try {
|
|
@@ -2492,6 +2606,11 @@ class Resolveable {
|
|
|
2492
2606
|
}
|
|
2493
2607
|
|
|
2494
2608
|
class Fetchable {
|
|
2609
|
+
computedArrayBuffer;
|
|
2610
|
+
computedBlob;
|
|
2611
|
+
computedFormData;
|
|
2612
|
+
computedJson;
|
|
2613
|
+
computedText;
|
|
2495
2614
|
constructor(resource, options = {}) {
|
|
2496
2615
|
this.setResource(resource);
|
|
2497
2616
|
this.computedArrayBuffer = new Resolveable(async () => "arrayBuffer" in this.response ? await this.response.arrayBuffer() : await void 0);
|
|
@@ -2501,6 +2620,7 @@ class Fetchable {
|
|
|
2501
2620
|
this.computedText = new Resolveable(async () => "text" in this.response ? await this.response.text() : await void 0);
|
|
2502
2621
|
this.ready();
|
|
2503
2622
|
}
|
|
2623
|
+
computedStatus;
|
|
2504
2624
|
ready() {
|
|
2505
2625
|
this.computedStatus = "ready";
|
|
2506
2626
|
}
|
|
@@ -2510,6 +2630,7 @@ class Fetchable {
|
|
|
2510
2630
|
set resource(resource) {
|
|
2511
2631
|
this.setResource(resource);
|
|
2512
2632
|
}
|
|
2633
|
+
computedAbortController;
|
|
2513
2634
|
get abortController() {
|
|
2514
2635
|
if (!this.computedAbortController) {
|
|
2515
2636
|
this.computedAbortController = new AbortController();
|
|
@@ -2555,10 +2676,13 @@ class Fetchable {
|
|
|
2555
2676
|
return resolveable;
|
|
2556
2677
|
}
|
|
2557
2678
|
}
|
|
2679
|
+
computedResource;
|
|
2558
2680
|
setResource(resource) {
|
|
2559
2681
|
this.computedResource = resource;
|
|
2560
2682
|
return this;
|
|
2561
2683
|
}
|
|
2684
|
+
computedResponse;
|
|
2685
|
+
computedError;
|
|
2562
2686
|
async fetch(options = {}) {
|
|
2563
2687
|
this.computedStatus = "fetching";
|
|
2564
2688
|
try {
|
|
@@ -2613,6 +2737,7 @@ class Fullscreenable {
|
|
|
2613
2737
|
this.setGetElement(getElement);
|
|
2614
2738
|
this.ready();
|
|
2615
2739
|
}
|
|
2740
|
+
computedStatus;
|
|
2616
2741
|
ready() {
|
|
2617
2742
|
this.computedStatus = "ready";
|
|
2618
2743
|
}
|
|
@@ -2631,6 +2756,7 @@ class Fullscreenable {
|
|
|
2631
2756
|
get error() {
|
|
2632
2757
|
return this.computedError;
|
|
2633
2758
|
}
|
|
2759
|
+
computedGetElement;
|
|
2634
2760
|
setGetElement(getElement) {
|
|
2635
2761
|
this.computedGetElement = () => getElement();
|
|
2636
2762
|
return this;
|
|
@@ -2639,6 +2765,7 @@ class Fullscreenable {
|
|
|
2639
2765
|
await this.fullscreen(options);
|
|
2640
2766
|
return this;
|
|
2641
2767
|
}
|
|
2768
|
+
computedError;
|
|
2642
2769
|
async fullscreen(options = {}) {
|
|
2643
2770
|
try {
|
|
2644
2771
|
await this.element.requestFullscreen(options);
|
|
@@ -2675,6 +2802,7 @@ class Grantable {
|
|
|
2675
2802
|
this.setDescriptor(descriptor);
|
|
2676
2803
|
this.ready();
|
|
2677
2804
|
}
|
|
2805
|
+
computedStatus;
|
|
2678
2806
|
ready() {
|
|
2679
2807
|
this.computedStatus = "ready";
|
|
2680
2808
|
}
|
|
@@ -2690,10 +2818,12 @@ class Grantable {
|
|
|
2690
2818
|
get status() {
|
|
2691
2819
|
return this.computedStatus;
|
|
2692
2820
|
}
|
|
2821
|
+
computedDescriptor;
|
|
2693
2822
|
setDescriptor(descriptor) {
|
|
2694
2823
|
this.computedDescriptor = descriptor;
|
|
2695
2824
|
return this;
|
|
2696
2825
|
}
|
|
2826
|
+
computedPermission;
|
|
2697
2827
|
async query() {
|
|
2698
2828
|
this.querying();
|
|
2699
2829
|
try {
|
|
@@ -2730,15 +2860,18 @@ class Navigateable {
|
|
|
2730
2860
|
this.navigate(options?.initialLocation ?? defaultOptions$2.initialLocation);
|
|
2731
2861
|
this.ready();
|
|
2732
2862
|
}
|
|
2863
|
+
computedStatus;
|
|
2733
2864
|
ready() {
|
|
2734
2865
|
this.computedStatus = "ready";
|
|
2735
2866
|
}
|
|
2867
|
+
computedArray;
|
|
2736
2868
|
get array() {
|
|
2737
2869
|
return this.computedArray;
|
|
2738
2870
|
}
|
|
2739
2871
|
set array(value) {
|
|
2740
2872
|
this.setArray(value);
|
|
2741
2873
|
}
|
|
2874
|
+
computedLocation;
|
|
2742
2875
|
get location() {
|
|
2743
2876
|
return this.computedLocation;
|
|
2744
2877
|
}
|
|
@@ -2862,29 +2995,33 @@ const defaultOptions$1 = {
|
|
|
2862
2995
|
};
|
|
2863
2996
|
class Pickable {
|
|
2864
2997
|
constructor(array, options = {}) {
|
|
2865
|
-
this.toItems = createMap((index) => this.array[index]);
|
|
2866
2998
|
this.setArray(array);
|
|
2867
2999
|
this.pick(options.initialPicks ?? defaultOptions$1.initialPicks);
|
|
2868
3000
|
this.ready();
|
|
2869
3001
|
}
|
|
3002
|
+
computedStatus;
|
|
2870
3003
|
ready() {
|
|
2871
3004
|
this.computedStatus = "ready";
|
|
2872
3005
|
}
|
|
3006
|
+
computedArray;
|
|
2873
3007
|
get array() {
|
|
2874
3008
|
return this.computedArray;
|
|
2875
3009
|
}
|
|
2876
3010
|
set array(array) {
|
|
2877
3011
|
this.setArray(array);
|
|
2878
3012
|
}
|
|
3013
|
+
computedPicks;
|
|
2879
3014
|
get picks() {
|
|
2880
3015
|
return this.computedPicks;
|
|
2881
3016
|
}
|
|
2882
3017
|
set picks(indices) {
|
|
2883
3018
|
this.pick(indices);
|
|
2884
3019
|
}
|
|
3020
|
+
computedFirst;
|
|
2885
3021
|
get first() {
|
|
2886
3022
|
return this.computedFirst;
|
|
2887
3023
|
}
|
|
3024
|
+
computedLast;
|
|
2888
3025
|
get last() {
|
|
2889
3026
|
return this.computedLast;
|
|
2890
3027
|
}
|
|
@@ -2900,9 +3037,11 @@ class Pickable {
|
|
|
2900
3037
|
get items() {
|
|
2901
3038
|
return this.toItems(this.picks);
|
|
2902
3039
|
}
|
|
3040
|
+
toItems = createMap((index) => this.array[index]);
|
|
2903
3041
|
get multiple() {
|
|
2904
3042
|
return this.picks.length > 1;
|
|
2905
3043
|
}
|
|
3044
|
+
toPossiblePicks;
|
|
2906
3045
|
setArray(array) {
|
|
2907
3046
|
this.computedArray = array;
|
|
2908
3047
|
this.toPossiblePicks = createFilter((index) => index >= 0 && index < array.length);
|
|
@@ -2917,7 +3056,7 @@ class Pickable {
|
|
|
2917
3056
|
if (replace === "all") {
|
|
2918
3057
|
return toUnique(possiblePicks);
|
|
2919
3058
|
}
|
|
2920
|
-
const possibleWithoutDuplicates = createFilter((possiblePick) =>
|
|
3059
|
+
const possibleWithoutDuplicates = createFilter((possiblePick) => typeof lazyCollections.find((pick) => pick === possiblePick)(this.picks || []) !== "number")(possiblePicks);
|
|
2921
3060
|
switch (replace) {
|
|
2922
3061
|
case "none":
|
|
2923
3062
|
return createConcat(this.picks || [], possibleWithoutDuplicates)([]);
|
|
@@ -2978,14 +3117,17 @@ function ensureIndices(indexOrIndices) {
|
|
|
2978
3117
|
const toUnique = createUnique();
|
|
2979
3118
|
|
|
2980
3119
|
class Sanitizeable {
|
|
3120
|
+
domPurifyConfig;
|
|
2981
3121
|
constructor(html, options) {
|
|
2982
3122
|
this.computedHtml = html;
|
|
2983
3123
|
this.domPurifyConfig = options;
|
|
2984
3124
|
this.ready();
|
|
2985
3125
|
}
|
|
3126
|
+
computedDompurify;
|
|
3127
|
+
computedStatus;
|
|
2986
3128
|
ready() {
|
|
2987
3129
|
if (domIsAvailable()) {
|
|
2988
|
-
this.computedDompurify = createDOMPurify__default[
|
|
3130
|
+
this.computedDompurify = createDOMPurify__default["default"]();
|
|
2989
3131
|
this.computedDompurify.setConfig(this.domPurifyConfig);
|
|
2990
3132
|
}
|
|
2991
3133
|
this.computedStatus = "ready";
|
|
@@ -2998,7 +3140,7 @@ class Sanitizeable {
|
|
|
2998
3140
|
}
|
|
2999
3141
|
get dompurify() {
|
|
3000
3142
|
if (!this.computedDompurify && domIsAvailable()) {
|
|
3001
|
-
this.computedDompurify = createDOMPurify__default[
|
|
3143
|
+
this.computedDompurify = createDOMPurify__default["default"]();
|
|
3002
3144
|
this.computedDompurify.setConfig(this.domPurifyConfig);
|
|
3003
3145
|
}
|
|
3004
3146
|
return this.computedDompurify;
|
|
@@ -3006,6 +3148,7 @@ class Sanitizeable {
|
|
|
3006
3148
|
get status() {
|
|
3007
3149
|
return this.computedStatus;
|
|
3008
3150
|
}
|
|
3151
|
+
computedHtml;
|
|
3009
3152
|
setHtml(html) {
|
|
3010
3153
|
this.computedHtml = html;
|
|
3011
3154
|
return this;
|
|
@@ -3021,15 +3164,19 @@ class Sanitizeable {
|
|
|
3021
3164
|
}
|
|
3022
3165
|
|
|
3023
3166
|
class Searchable {
|
|
3167
|
+
searcherOptions;
|
|
3168
|
+
computedResults;
|
|
3024
3169
|
constructor(candidates, options = {}) {
|
|
3025
3170
|
this.searcherOptions = options;
|
|
3026
3171
|
this.setCandidates(candidates);
|
|
3027
3172
|
this.computedResults = [];
|
|
3028
3173
|
this.ready();
|
|
3029
3174
|
}
|
|
3175
|
+
computedStatus;
|
|
3030
3176
|
ready() {
|
|
3031
3177
|
this.computedStatus = "ready";
|
|
3032
3178
|
}
|
|
3179
|
+
computedCandidates;
|
|
3033
3180
|
get candidates() {
|
|
3034
3181
|
return this.computedCandidates;
|
|
3035
3182
|
}
|
|
@@ -3045,6 +3192,7 @@ class Searchable {
|
|
|
3045
3192
|
get status() {
|
|
3046
3193
|
return this.computedStatus;
|
|
3047
3194
|
}
|
|
3195
|
+
computedSearcher;
|
|
3048
3196
|
setCandidates(candidates) {
|
|
3049
3197
|
this.computedCandidates = Array.from(candidates);
|
|
3050
3198
|
this.computedSearcher = new fastFuzzy.Searcher(candidates, this.searcherOptions);
|
|
@@ -3065,6 +3213,8 @@ const defaultOptions = {
|
|
|
3065
3213
|
statusKeySuffix: " status"
|
|
3066
3214
|
};
|
|
3067
3215
|
class Storeable {
|
|
3216
|
+
type;
|
|
3217
|
+
statusKeySuffix;
|
|
3068
3218
|
constructor(key, options = {}) {
|
|
3069
3219
|
this.constructing();
|
|
3070
3220
|
this.type = options.type ?? defaultOptions.type;
|
|
@@ -3075,6 +3225,7 @@ class Storeable {
|
|
|
3075
3225
|
constructing() {
|
|
3076
3226
|
this.computedStatus = "constructing";
|
|
3077
3227
|
}
|
|
3228
|
+
computedStatus;
|
|
3078
3229
|
ready() {
|
|
3079
3230
|
this.computedStatus = "ready";
|
|
3080
3231
|
if (domIsAvailable()) {
|
|
@@ -3112,6 +3263,8 @@ class Storeable {
|
|
|
3112
3263
|
get error() {
|
|
3113
3264
|
return this.computedError;
|
|
3114
3265
|
}
|
|
3266
|
+
computedKey;
|
|
3267
|
+
computedStatusKey;
|
|
3115
3268
|
setKey(key) {
|
|
3116
3269
|
let string;
|
|
3117
3270
|
switch (this.status) {
|
|
@@ -3137,6 +3290,8 @@ class Storeable {
|
|
|
3137
3290
|
}
|
|
3138
3291
|
return this;
|
|
3139
3292
|
}
|
|
3293
|
+
computedString;
|
|
3294
|
+
computedError;
|
|
3140
3295
|
store(string) {
|
|
3141
3296
|
try {
|
|
3142
3297
|
this.storage.setItem(this.key, string);
|
|
@@ -3211,7 +3366,9 @@ exports.createReplace = createReplace;
|
|
|
3211
3366
|
exports.createReverse = createReverse;
|
|
3212
3367
|
exports.createSlice = createSlice;
|
|
3213
3368
|
exports.createSlug = createSlug;
|
|
3369
|
+
exports.createSort = createSort;
|
|
3214
3370
|
exports.createSwap = createSwap;
|
|
3371
|
+
exports.createToEntries = createToEntries;
|
|
3215
3372
|
exports.createUnique = createUnique;
|
|
3216
3373
|
exports.easingsNetInBack = easingsNetInBack;
|
|
3217
3374
|
exports.easingsNetInCirc = easingsNetInCirc;
|