@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.js
CHANGED
|
@@ -129,6 +129,11 @@ function createReverse() {
|
|
|
129
129
|
return reversed;
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
|
+
function createSort(compare) {
|
|
133
|
+
return (array) => {
|
|
134
|
+
return new Pipeable(array).pipe(createSlice({ from: 0 }), (sliced) => sliced.sort(compare));
|
|
135
|
+
};
|
|
136
|
+
}
|
|
132
137
|
function createSlug(options) {
|
|
133
138
|
return (string) => {
|
|
134
139
|
return slugify(string, options);
|
|
@@ -158,7 +163,16 @@ function createDetermine(potentialities) {
|
|
|
158
163
|
function createRename({ from, to }) {
|
|
159
164
|
return (map2) => {
|
|
160
165
|
const keys = [...map2.keys()], keyToRenameIndex = findIndex((k) => k === from)(keys), newKeys = createReplace({ index: keyToRenameIndex, item: to })(keys), values = [...map2.values()];
|
|
161
|
-
return createReduce((renamed, key, index) => renamed.set(key, values[index]), new Map())(newKeys);
|
|
166
|
+
return createReduce((renamed, key, index) => renamed.set(key, values[index]), /* @__PURE__ */ new Map())(newKeys);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function createToEntries() {
|
|
170
|
+
return (object) => {
|
|
171
|
+
const entries = [];
|
|
172
|
+
for (const key in object) {
|
|
173
|
+
entries.push([key, object[key]]);
|
|
174
|
+
}
|
|
175
|
+
return entries;
|
|
162
176
|
};
|
|
163
177
|
}
|
|
164
178
|
class Pipeable {
|
|
@@ -226,8 +240,6 @@ function toEvent(eventType, options) {
|
|
|
226
240
|
return new InputEvent(eventType, options.init);
|
|
227
241
|
if (eventType === "blur")
|
|
228
242
|
return new FocusEvent(eventType, options.init);
|
|
229
|
-
if (eventType === "cancel")
|
|
230
|
-
return new Event(eventType, options.init);
|
|
231
243
|
if (eventType === "canplay")
|
|
232
244
|
return new Event(eventType, options.init);
|
|
233
245
|
if (eventType === "canplaythrough")
|
|
@@ -256,8 +268,6 @@ function toEvent(eventType, options) {
|
|
|
256
268
|
return new DragEvent(eventType, options.init);
|
|
257
269
|
if (eventType === "dragenter")
|
|
258
270
|
return new DragEvent(eventType, options.init);
|
|
259
|
-
if (eventType === "dragexit")
|
|
260
|
-
return new Event(eventType, options.init);
|
|
261
271
|
if (eventType === "dragleave")
|
|
262
272
|
return new DragEvent(eventType, options.init);
|
|
263
273
|
if (eventType === "dragover")
|
|
@@ -480,7 +490,7 @@ function toCombo(type) {
|
|
|
480
490
|
function fromComboItemNameToType(name) {
|
|
481
491
|
return find((type) => predicatesByType[type](name))(listenableComboItemTypes) ?? "custom";
|
|
482
492
|
}
|
|
483
|
-
const listenableComboItemTypes = new Set(["singleCharacter", "arrow", "other", "modifier", "click", "pointer"]);
|
|
493
|
+
const listenableComboItemTypes = /* @__PURE__ */ new Set(["singleCharacter", "arrow", "other", "modifier", "click", "pointer"]);
|
|
484
494
|
const predicatesByType = {
|
|
485
495
|
singleCharacter: (name) => typeREs["singleCharacter"].test(name),
|
|
486
496
|
arrow: (name) => typeREs["arrow"].test(name),
|
|
@@ -576,6 +586,10 @@ function isString(value) {
|
|
|
576
586
|
}
|
|
577
587
|
|
|
578
588
|
class Recognizeable {
|
|
589
|
+
maxSequenceLength;
|
|
590
|
+
effects;
|
|
591
|
+
effectApi;
|
|
592
|
+
toType;
|
|
579
593
|
constructor(sequence, options = { effectsIncludeCombos: true }) {
|
|
580
594
|
const defaultOptions = {
|
|
581
595
|
maxSequenceLength: true,
|
|
@@ -599,6 +613,7 @@ class Recognizeable {
|
|
|
599
613
|
};
|
|
600
614
|
this.ready();
|
|
601
615
|
}
|
|
616
|
+
computedMetadata;
|
|
602
617
|
resetComputedMetadata() {
|
|
603
618
|
this.computedMetadata = {};
|
|
604
619
|
}
|
|
@@ -608,6 +623,7 @@ class Recognizeable {
|
|
|
608
623
|
denied() {
|
|
609
624
|
this.computedStatus = "denied";
|
|
610
625
|
}
|
|
626
|
+
computedStatus;
|
|
611
627
|
ready() {
|
|
612
628
|
this.computedStatus = "ready";
|
|
613
629
|
}
|
|
@@ -623,6 +639,7 @@ class Recognizeable {
|
|
|
623
639
|
get metadata() {
|
|
624
640
|
return this.computedMetadata;
|
|
625
641
|
}
|
|
642
|
+
computedSequence;
|
|
626
643
|
setSequence(sequence) {
|
|
627
644
|
this.computedSequence = sequence;
|
|
628
645
|
return this;
|
|
@@ -726,9 +743,12 @@ function createToType({
|
|
|
726
743
|
}
|
|
727
744
|
};
|
|
728
745
|
}
|
|
729
|
-
const leftclickcomboEventTypes = new Set(["click", "mousedown", "mouseup", "dblclick"]), rightclickComboEventTypes = new Set(["contextmenu"]), keycomboEventTypes = new Set(["keydown", "keyup"]), toJoinedClickcombo = join("+"), toJoinedKeycombo = pipe(map(({ name }) => name), toJoinedClickcombo);
|
|
746
|
+
const leftclickcomboEventTypes = /* @__PURE__ */ new Set(["click", "mousedown", "mouseup", "dblclick"]), rightclickComboEventTypes = /* @__PURE__ */ new Set(["contextmenu"]), keycomboEventTypes = /* @__PURE__ */ new Set(["keydown", "keyup"]), toJoinedClickcombo = join("+"), toJoinedKeycombo = pipe(map(({ name }) => name), toJoinedClickcombo);
|
|
730
747
|
|
|
731
748
|
class Listenable {
|
|
749
|
+
computedRecognizeable;
|
|
750
|
+
recognizeableEffectsKeys;
|
|
751
|
+
computedActive;
|
|
732
752
|
constructor(type, options) {
|
|
733
753
|
if (type === "recognizeable") {
|
|
734
754
|
const recognizeableOptions = {
|
|
@@ -741,10 +761,11 @@ class Listenable {
|
|
|
741
761
|
this.computedRecognizeable = new Recognizeable([], recognizeableOptions);
|
|
742
762
|
this.recognizeableEffectsKeys = Object.keys(recognizeableOptions.effects);
|
|
743
763
|
}
|
|
744
|
-
this.computedActive = new Set();
|
|
764
|
+
this.computedActive = /* @__PURE__ */ new Set();
|
|
745
765
|
this.setType(type);
|
|
746
766
|
this.ready();
|
|
747
767
|
}
|
|
768
|
+
computedStatus;
|
|
748
769
|
ready() {
|
|
749
770
|
this.computedStatus = "ready";
|
|
750
771
|
}
|
|
@@ -763,6 +784,8 @@ class Listenable {
|
|
|
763
784
|
get recognizeable() {
|
|
764
785
|
return this.computedRecognizeable;
|
|
765
786
|
}
|
|
787
|
+
computedType;
|
|
788
|
+
implementation;
|
|
766
789
|
setType(type) {
|
|
767
790
|
this.stop();
|
|
768
791
|
this.computedType = type;
|
|
@@ -955,7 +978,7 @@ function stop(stoppable) {
|
|
|
955
978
|
function toImplementation(type) {
|
|
956
979
|
return find((implementation) => predicatesByImplementation.get(implementation)(type))(predicatesByImplementation.keys());
|
|
957
980
|
}
|
|
958
|
-
const predicatesByImplementation = new Map([
|
|
981
|
+
const predicatesByImplementation = /* @__PURE__ */ new Map([
|
|
959
982
|
[
|
|
960
983
|
"recognizeable",
|
|
961
984
|
(type) => type === "recognizeable"
|
|
@@ -1005,7 +1028,7 @@ const predicatesByImplementation = new Map([
|
|
|
1005
1028
|
() => true
|
|
1006
1029
|
]
|
|
1007
1030
|
]);
|
|
1008
|
-
const documentEvents = new Set([
|
|
1031
|
+
const documentEvents = /* @__PURE__ */ new Set([
|
|
1009
1032
|
"fullscreenchange",
|
|
1010
1033
|
"fullscreenerror",
|
|
1011
1034
|
"pointerlockchange",
|
|
@@ -1028,6 +1051,11 @@ function eventMatchesKeycombo({ event, keycombo }) {
|
|
|
1028
1051
|
return every(({ name, type }, index) => {
|
|
1029
1052
|
switch (type) {
|
|
1030
1053
|
case "singleCharacter":
|
|
1054
|
+
if (name === "!") {
|
|
1055
|
+
return event.key === "!";
|
|
1056
|
+
}
|
|
1057
|
+
const keyToTest = event.altKey && fromComboItemNameToType(event.key) === "custom" ? fromCodeToSingleCharacter(event.code) : event.key.toLowerCase();
|
|
1058
|
+
return name.startsWith("!") ? keyToTest !== toKey(name.slice(1)).toLowerCase() : keyToTest === toKey(name).toLowerCase();
|
|
1031
1059
|
case "other":
|
|
1032
1060
|
if (name === "!") {
|
|
1033
1061
|
return event.key === "!";
|
|
@@ -1043,7 +1071,34 @@ function eventMatchesKeycombo({ event, keycombo }) {
|
|
|
1043
1071
|
}
|
|
1044
1072
|
})(keycombo);
|
|
1045
1073
|
}
|
|
1046
|
-
|
|
1074
|
+
function fromCodeToSingleCharacter(code) {
|
|
1075
|
+
for (const c in aliasesByCode) {
|
|
1076
|
+
if (c === code) {
|
|
1077
|
+
return aliasesByCode[c];
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
for (const prefix of ["Key", "Digit"]) {
|
|
1081
|
+
const re = new RegExp(`^${prefix}`);
|
|
1082
|
+
if (re.test(code)) {
|
|
1083
|
+
return createClip(re)(code).toLowerCase();
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
return code;
|
|
1087
|
+
}
|
|
1088
|
+
const aliasesByCode = {
|
|
1089
|
+
"Backquote": "`",
|
|
1090
|
+
"Minus": "-",
|
|
1091
|
+
"Equal": "=",
|
|
1092
|
+
"BracketLeft": "[",
|
|
1093
|
+
"BracketRight": "]",
|
|
1094
|
+
"Backslash": "\\",
|
|
1095
|
+
"Semicolon": ";",
|
|
1096
|
+
"Quote": "'",
|
|
1097
|
+
"Comma": ",",
|
|
1098
|
+
"Period": ".",
|
|
1099
|
+
"Slash": "/"
|
|
1100
|
+
};
|
|
1101
|
+
const predicatesByArrow = /* @__PURE__ */ new Map([
|
|
1047
1102
|
[
|
|
1048
1103
|
"arrow",
|
|
1049
1104
|
({ event }) => arrows.has(event.key.toLowerCase())
|
|
@@ -1073,9 +1128,9 @@ const predicatesByArrow = new Map([
|
|
|
1073
1128
|
({ event, name }) => name.startsWith("!") ? event.key.toLowerCase() !== `arrow${name.toLowerCase()}` : event.key.toLowerCase() === `arrow${name.toLowerCase()}`
|
|
1074
1129
|
]
|
|
1075
1130
|
]);
|
|
1076
|
-
const arrows = new Set(["arrowup", "arrowright", "arrowdown", "arrowleft"]);
|
|
1077
|
-
const verticalArrows = new Set(["arrowup", "arrowdown"]);
|
|
1078
|
-
const horizontalArrows = new Set(["arrowright", "arrowleft"]);
|
|
1131
|
+
const arrows = /* @__PURE__ */ new Set(["arrowup", "arrowright", "arrowdown", "arrowleft"]);
|
|
1132
|
+
const verticalArrows = /* @__PURE__ */ new Set(["arrowup", "arrowdown"]);
|
|
1133
|
+
const horizontalArrows = /* @__PURE__ */ new Set(["arrowright", "arrowleft"]);
|
|
1079
1134
|
function eventMatchesClickcombo({ event, clickcombo }) {
|
|
1080
1135
|
return every((name) => fromComboItemNameToType(name) === "click" || name.startsWith("!") && !isModified({ alias: name.slice(1), event }) || !name.startsWith("!") && isModified({ alias: name, event }))(clickcombo);
|
|
1081
1136
|
}
|
|
@@ -1100,6 +1155,21 @@ const defaultOptions$6 = {
|
|
|
1100
1155
|
alternates: false
|
|
1101
1156
|
};
|
|
1102
1157
|
class Animateable {
|
|
1158
|
+
initialDuration;
|
|
1159
|
+
iterationLimit;
|
|
1160
|
+
alternates;
|
|
1161
|
+
controlPoints;
|
|
1162
|
+
reversedControlPoints;
|
|
1163
|
+
toAnimationProgress;
|
|
1164
|
+
reversedToAnimationProgress;
|
|
1165
|
+
playCache;
|
|
1166
|
+
reverseCache;
|
|
1167
|
+
pauseCache;
|
|
1168
|
+
seekCache;
|
|
1169
|
+
alternateCache;
|
|
1170
|
+
visibilitychange;
|
|
1171
|
+
getEaseables;
|
|
1172
|
+
getReversedEaseables;
|
|
1103
1173
|
constructor(keyframes, options = {}) {
|
|
1104
1174
|
this.initialDuration = options?.duration || defaultOptions$6.duration;
|
|
1105
1175
|
this.controlPoints = fromTimingToControlPoints(options?.timing || defaultOptions$6.timing);
|
|
@@ -1123,21 +1193,25 @@ class Animateable {
|
|
|
1123
1193
|
this.resetProgress();
|
|
1124
1194
|
this.resetIterations();
|
|
1125
1195
|
}
|
|
1196
|
+
computedStatus;
|
|
1126
1197
|
ready() {
|
|
1127
1198
|
this.computedStatus = "ready";
|
|
1128
1199
|
}
|
|
1200
|
+
computedTime;
|
|
1129
1201
|
resetTime() {
|
|
1130
1202
|
this.computedTime = {
|
|
1131
1203
|
elapsed: 0,
|
|
1132
1204
|
remaining: this.duration
|
|
1133
1205
|
};
|
|
1134
1206
|
}
|
|
1207
|
+
computedProgress;
|
|
1135
1208
|
resetProgress() {
|
|
1136
1209
|
this.computedProgress = {
|
|
1137
1210
|
time: 0,
|
|
1138
1211
|
animation: 0
|
|
1139
1212
|
};
|
|
1140
1213
|
}
|
|
1214
|
+
computedIterations;
|
|
1141
1215
|
resetIterations() {
|
|
1142
1216
|
this.computedIterations = 0;
|
|
1143
1217
|
}
|
|
@@ -1168,6 +1242,11 @@ class Animateable {
|
|
|
1168
1242
|
get progress() {
|
|
1169
1243
|
return this.computedProgress;
|
|
1170
1244
|
}
|
|
1245
|
+
computedKeyframes;
|
|
1246
|
+
reversedKeyframes;
|
|
1247
|
+
properties;
|
|
1248
|
+
easeables;
|
|
1249
|
+
reversedEaseables;
|
|
1171
1250
|
setKeyframes(keyframes) {
|
|
1172
1251
|
this.stop();
|
|
1173
1252
|
this.computedKeyframes = Array.from(keyframes).sort(({ progress: progressA }, { progress: progressB }) => progressA - progressB);
|
|
@@ -1177,6 +1256,9 @@ class Animateable {
|
|
|
1177
1256
|
this.reversedEaseables = this.getReversedEaseables({ keyframes: this.reversedKeyframes, properties: this.properties });
|
|
1178
1257
|
return this;
|
|
1179
1258
|
}
|
|
1259
|
+
computedPlaybackRate;
|
|
1260
|
+
duration;
|
|
1261
|
+
totalTimeInvisible;
|
|
1180
1262
|
setPlaybackRate(playbackRate) {
|
|
1181
1263
|
const ensuredPlaybackRate = Math.max(0, playbackRate);
|
|
1182
1264
|
this.computedPlaybackRate = ensuredPlaybackRate;
|
|
@@ -1322,6 +1404,7 @@ class Animateable {
|
|
|
1322
1404
|
reversed() {
|
|
1323
1405
|
this.computedStatus = "reversed";
|
|
1324
1406
|
}
|
|
1407
|
+
invisibleAt;
|
|
1325
1408
|
listenForVisibilitychange() {
|
|
1326
1409
|
if (this.visibilitychange.active.size === 0) {
|
|
1327
1410
|
this.totalTimeInvisible = 0;
|
|
@@ -1337,6 +1420,7 @@ class Animateable {
|
|
|
1337
1420
|
});
|
|
1338
1421
|
}
|
|
1339
1422
|
}
|
|
1423
|
+
computedRequest;
|
|
1340
1424
|
createAnimate(type) {
|
|
1341
1425
|
return (effect, options = {}) => {
|
|
1342
1426
|
const { interpolate: interpolateOptions } = options;
|
|
@@ -1357,6 +1441,7 @@ class Animateable {
|
|
|
1357
1441
|
return this;
|
|
1358
1442
|
};
|
|
1359
1443
|
}
|
|
1444
|
+
startTime;
|
|
1360
1445
|
setStartTimeAndStatus(type, timestamp) {
|
|
1361
1446
|
switch (type) {
|
|
1362
1447
|
case "play":
|
|
@@ -1723,7 +1808,7 @@ function createGetEaseables(fromKeyframeToControlPoints) {
|
|
|
1723
1808
|
};
|
|
1724
1809
|
}
|
|
1725
1810
|
function toProperties(keyframes) {
|
|
1726
|
-
const properties = new Set();
|
|
1811
|
+
const properties = /* @__PURE__ */ new Set();
|
|
1727
1812
|
for (const keyframe of keyframes) {
|
|
1728
1813
|
for (const property in keyframe.properties) {
|
|
1729
1814
|
if (!properties.has(property)) {
|
|
@@ -1961,6 +2046,10 @@ const defaultCompleteOptions = {
|
|
|
1961
2046
|
select: "completionEnd"
|
|
1962
2047
|
};
|
|
1963
2048
|
class Completeable {
|
|
2049
|
+
segmentFrom;
|
|
2050
|
+
segmentTo;
|
|
2051
|
+
divider;
|
|
2052
|
+
computedDividerIndices;
|
|
1964
2053
|
constructor(string, options = {}) {
|
|
1965
2054
|
this.constructing();
|
|
1966
2055
|
this.segmentFrom = options?.segment?.from || defaultOptions$5.segment.from;
|
|
@@ -1974,6 +2063,7 @@ class Completeable {
|
|
|
1974
2063
|
constructing() {
|
|
1975
2064
|
this.computedStatus = "constructing";
|
|
1976
2065
|
}
|
|
2066
|
+
computedStatus;
|
|
1977
2067
|
ready() {
|
|
1978
2068
|
this.computedStatus = "ready";
|
|
1979
2069
|
}
|
|
@@ -2018,6 +2108,7 @@ class Completeable {
|
|
|
2018
2108
|
return this.dividerIndices.after;
|
|
2019
2109
|
}
|
|
2020
2110
|
}
|
|
2111
|
+
computedString;
|
|
2021
2112
|
setString(string) {
|
|
2022
2113
|
this.computedString = string;
|
|
2023
2114
|
switch (this.status) {
|
|
@@ -2029,6 +2120,7 @@ class Completeable {
|
|
|
2029
2120
|
}
|
|
2030
2121
|
return this;
|
|
2031
2122
|
}
|
|
2123
|
+
computedSelection;
|
|
2032
2124
|
setSelection(selection) {
|
|
2033
2125
|
this.computedSelection = selection;
|
|
2034
2126
|
this.setDividerIndices();
|
|
@@ -2115,6 +2207,10 @@ function toNextMatch({ string, re, from }) {
|
|
|
2115
2207
|
}
|
|
2116
2208
|
|
|
2117
2209
|
class Copyable {
|
|
2210
|
+
computedIsClipboardText;
|
|
2211
|
+
copyListenable;
|
|
2212
|
+
cutListenable;
|
|
2213
|
+
copyAndCutEffect;
|
|
2118
2214
|
constructor(string, options = {}) {
|
|
2119
2215
|
this.computedIsClipboardText = false;
|
|
2120
2216
|
this.copyListenable = new Listenable("copy");
|
|
@@ -2126,6 +2222,7 @@ class Copyable {
|
|
|
2126
2222
|
this.setString(string);
|
|
2127
2223
|
this.ready();
|
|
2128
2224
|
}
|
|
2225
|
+
computedStatus;
|
|
2129
2226
|
ready() {
|
|
2130
2227
|
this.computedStatus = "ready";
|
|
2131
2228
|
}
|
|
@@ -2147,10 +2244,13 @@ class Copyable {
|
|
|
2147
2244
|
get error() {
|
|
2148
2245
|
return this.computedError;
|
|
2149
2246
|
}
|
|
2247
|
+
computedString;
|
|
2150
2248
|
setString(string) {
|
|
2151
2249
|
this.computedString = string;
|
|
2152
2250
|
return this;
|
|
2153
2251
|
}
|
|
2252
|
+
computedResponse;
|
|
2253
|
+
computedError;
|
|
2154
2254
|
async copy(options = { type: "clipboard" }) {
|
|
2155
2255
|
this.copying();
|
|
2156
2256
|
const { type } = options;
|
|
@@ -2203,6 +2303,7 @@ const defaultOptions$4 = {
|
|
|
2203
2303
|
executions: 1
|
|
2204
2304
|
};
|
|
2205
2305
|
class Delayable {
|
|
2306
|
+
animateable;
|
|
2206
2307
|
constructor(effect, options = {}) {
|
|
2207
2308
|
this.animateable = new Animateable([
|
|
2208
2309
|
{ progress: 0, properties: { progress: 0 } },
|
|
@@ -2214,6 +2315,7 @@ class Delayable {
|
|
|
2214
2315
|
this.setEffect(effect);
|
|
2215
2316
|
this.ready();
|
|
2216
2317
|
}
|
|
2318
|
+
computedStatus;
|
|
2217
2319
|
ready() {
|
|
2218
2320
|
this.computedStatus = "ready";
|
|
2219
2321
|
}
|
|
@@ -2235,12 +2337,14 @@ class Delayable {
|
|
|
2235
2337
|
get progress() {
|
|
2236
2338
|
return this.animateable.progress.time;
|
|
2237
2339
|
}
|
|
2340
|
+
computedEffect;
|
|
2238
2341
|
setEffect(effect) {
|
|
2239
2342
|
this.stop();
|
|
2240
2343
|
this.computedEffect = effect;
|
|
2241
2344
|
this.setFrameEffect(effect);
|
|
2242
2345
|
return this;
|
|
2243
2346
|
}
|
|
2347
|
+
frameEffect;
|
|
2244
2348
|
setFrameEffect(effect) {
|
|
2245
2349
|
this.frameEffect = (frame) => {
|
|
2246
2350
|
const { properties: { progress }, timestamp } = frame;
|
|
@@ -2343,6 +2447,7 @@ class Dispatchable {
|
|
|
2343
2447
|
this.setType(type);
|
|
2344
2448
|
this.ready();
|
|
2345
2449
|
}
|
|
2450
|
+
computedStatus;
|
|
2346
2451
|
ready() {
|
|
2347
2452
|
this.computedStatus = "ready";
|
|
2348
2453
|
}
|
|
@@ -2358,10 +2463,12 @@ class Dispatchable {
|
|
|
2358
2463
|
get status() {
|
|
2359
2464
|
return this.computedStatus;
|
|
2360
2465
|
}
|
|
2466
|
+
computedType;
|
|
2361
2467
|
setType(type) {
|
|
2362
2468
|
this.computedType = type;
|
|
2363
2469
|
return this;
|
|
2364
2470
|
}
|
|
2471
|
+
computedCancelled;
|
|
2365
2472
|
dispatch(options = {}) {
|
|
2366
2473
|
const { target = window, ...rest } = options, event = toEvent(this.type, rest);
|
|
2367
2474
|
this.computedCancelled = !target.dispatchEvent(event);
|
|
@@ -2377,11 +2484,14 @@ const defaultOptions$3 = {
|
|
|
2377
2484
|
toD: (stroke) => stroke.length === 0 ? "" : toD(stroke)
|
|
2378
2485
|
};
|
|
2379
2486
|
class Drawable {
|
|
2487
|
+
computedD;
|
|
2488
|
+
toD;
|
|
2380
2489
|
constructor(stroke, options = {}) {
|
|
2381
2490
|
this.toD = options?.toD || defaultOptions$3.toD;
|
|
2382
2491
|
this.setStroke(stroke);
|
|
2383
2492
|
this.ready();
|
|
2384
2493
|
}
|
|
2494
|
+
computedStatus;
|
|
2385
2495
|
ready() {
|
|
2386
2496
|
this.computedStatus = "ready";
|
|
2387
2497
|
}
|
|
@@ -2397,6 +2507,7 @@ class Drawable {
|
|
|
2397
2507
|
get d() {
|
|
2398
2508
|
return this.computedD;
|
|
2399
2509
|
}
|
|
2510
|
+
computedStroke;
|
|
2400
2511
|
setStroke(stroke) {
|
|
2401
2512
|
this.computedStroke = stroke;
|
|
2402
2513
|
this.computedD = this.toD(stroke);
|
|
@@ -2438,6 +2549,7 @@ class Resolveable {
|
|
|
2438
2549
|
this.setGetPromise(getPromise);
|
|
2439
2550
|
this.ready();
|
|
2440
2551
|
}
|
|
2552
|
+
computedStatus;
|
|
2441
2553
|
ready() {
|
|
2442
2554
|
this.computedStatus = "ready";
|
|
2443
2555
|
}
|
|
@@ -2453,10 +2565,12 @@ class Resolveable {
|
|
|
2453
2565
|
get value() {
|
|
2454
2566
|
return this.computedValue;
|
|
2455
2567
|
}
|
|
2568
|
+
computedGetPromise;
|
|
2456
2569
|
setGetPromise(getPromise) {
|
|
2457
2570
|
this.computedGetPromise = getPromise;
|
|
2458
2571
|
return this;
|
|
2459
2572
|
}
|
|
2573
|
+
computedValue;
|
|
2460
2574
|
async resolve(...args) {
|
|
2461
2575
|
this.resolving();
|
|
2462
2576
|
try {
|
|
@@ -2481,6 +2595,11 @@ class Resolveable {
|
|
|
2481
2595
|
}
|
|
2482
2596
|
|
|
2483
2597
|
class Fetchable {
|
|
2598
|
+
computedArrayBuffer;
|
|
2599
|
+
computedBlob;
|
|
2600
|
+
computedFormData;
|
|
2601
|
+
computedJson;
|
|
2602
|
+
computedText;
|
|
2484
2603
|
constructor(resource, options = {}) {
|
|
2485
2604
|
this.setResource(resource);
|
|
2486
2605
|
this.computedArrayBuffer = new Resolveable(async () => "arrayBuffer" in this.response ? await this.response.arrayBuffer() : await void 0);
|
|
@@ -2490,6 +2609,7 @@ class Fetchable {
|
|
|
2490
2609
|
this.computedText = new Resolveable(async () => "text" in this.response ? await this.response.text() : await void 0);
|
|
2491
2610
|
this.ready();
|
|
2492
2611
|
}
|
|
2612
|
+
computedStatus;
|
|
2493
2613
|
ready() {
|
|
2494
2614
|
this.computedStatus = "ready";
|
|
2495
2615
|
}
|
|
@@ -2499,6 +2619,7 @@ class Fetchable {
|
|
|
2499
2619
|
set resource(resource) {
|
|
2500
2620
|
this.setResource(resource);
|
|
2501
2621
|
}
|
|
2622
|
+
computedAbortController;
|
|
2502
2623
|
get abortController() {
|
|
2503
2624
|
if (!this.computedAbortController) {
|
|
2504
2625
|
this.computedAbortController = new AbortController();
|
|
@@ -2544,10 +2665,13 @@ class Fetchable {
|
|
|
2544
2665
|
return resolveable;
|
|
2545
2666
|
}
|
|
2546
2667
|
}
|
|
2668
|
+
computedResource;
|
|
2547
2669
|
setResource(resource) {
|
|
2548
2670
|
this.computedResource = resource;
|
|
2549
2671
|
return this;
|
|
2550
2672
|
}
|
|
2673
|
+
computedResponse;
|
|
2674
|
+
computedError;
|
|
2551
2675
|
async fetch(options = {}) {
|
|
2552
2676
|
this.computedStatus = "fetching";
|
|
2553
2677
|
try {
|
|
@@ -2602,6 +2726,7 @@ class Fullscreenable {
|
|
|
2602
2726
|
this.setGetElement(getElement);
|
|
2603
2727
|
this.ready();
|
|
2604
2728
|
}
|
|
2729
|
+
computedStatus;
|
|
2605
2730
|
ready() {
|
|
2606
2731
|
this.computedStatus = "ready";
|
|
2607
2732
|
}
|
|
@@ -2620,6 +2745,7 @@ class Fullscreenable {
|
|
|
2620
2745
|
get error() {
|
|
2621
2746
|
return this.computedError;
|
|
2622
2747
|
}
|
|
2748
|
+
computedGetElement;
|
|
2623
2749
|
setGetElement(getElement) {
|
|
2624
2750
|
this.computedGetElement = () => getElement();
|
|
2625
2751
|
return this;
|
|
@@ -2628,6 +2754,7 @@ class Fullscreenable {
|
|
|
2628
2754
|
await this.fullscreen(options);
|
|
2629
2755
|
return this;
|
|
2630
2756
|
}
|
|
2757
|
+
computedError;
|
|
2631
2758
|
async fullscreen(options = {}) {
|
|
2632
2759
|
try {
|
|
2633
2760
|
await this.element.requestFullscreen(options);
|
|
@@ -2664,6 +2791,7 @@ class Grantable {
|
|
|
2664
2791
|
this.setDescriptor(descriptor);
|
|
2665
2792
|
this.ready();
|
|
2666
2793
|
}
|
|
2794
|
+
computedStatus;
|
|
2667
2795
|
ready() {
|
|
2668
2796
|
this.computedStatus = "ready";
|
|
2669
2797
|
}
|
|
@@ -2679,10 +2807,12 @@ class Grantable {
|
|
|
2679
2807
|
get status() {
|
|
2680
2808
|
return this.computedStatus;
|
|
2681
2809
|
}
|
|
2810
|
+
computedDescriptor;
|
|
2682
2811
|
setDescriptor(descriptor) {
|
|
2683
2812
|
this.computedDescriptor = descriptor;
|
|
2684
2813
|
return this;
|
|
2685
2814
|
}
|
|
2815
|
+
computedPermission;
|
|
2686
2816
|
async query() {
|
|
2687
2817
|
this.querying();
|
|
2688
2818
|
try {
|
|
@@ -2719,15 +2849,18 @@ class Navigateable {
|
|
|
2719
2849
|
this.navigate(options?.initialLocation ?? defaultOptions$2.initialLocation);
|
|
2720
2850
|
this.ready();
|
|
2721
2851
|
}
|
|
2852
|
+
computedStatus;
|
|
2722
2853
|
ready() {
|
|
2723
2854
|
this.computedStatus = "ready";
|
|
2724
2855
|
}
|
|
2856
|
+
computedArray;
|
|
2725
2857
|
get array() {
|
|
2726
2858
|
return this.computedArray;
|
|
2727
2859
|
}
|
|
2728
2860
|
set array(value) {
|
|
2729
2861
|
this.setArray(value);
|
|
2730
2862
|
}
|
|
2863
|
+
computedLocation;
|
|
2731
2864
|
get location() {
|
|
2732
2865
|
return this.computedLocation;
|
|
2733
2866
|
}
|
|
@@ -2851,29 +2984,33 @@ const defaultOptions$1 = {
|
|
|
2851
2984
|
};
|
|
2852
2985
|
class Pickable {
|
|
2853
2986
|
constructor(array, options = {}) {
|
|
2854
|
-
this.toItems = createMap((index) => this.array[index]);
|
|
2855
2987
|
this.setArray(array);
|
|
2856
2988
|
this.pick(options.initialPicks ?? defaultOptions$1.initialPicks);
|
|
2857
2989
|
this.ready();
|
|
2858
2990
|
}
|
|
2991
|
+
computedStatus;
|
|
2859
2992
|
ready() {
|
|
2860
2993
|
this.computedStatus = "ready";
|
|
2861
2994
|
}
|
|
2995
|
+
computedArray;
|
|
2862
2996
|
get array() {
|
|
2863
2997
|
return this.computedArray;
|
|
2864
2998
|
}
|
|
2865
2999
|
set array(array) {
|
|
2866
3000
|
this.setArray(array);
|
|
2867
3001
|
}
|
|
3002
|
+
computedPicks;
|
|
2868
3003
|
get picks() {
|
|
2869
3004
|
return this.computedPicks;
|
|
2870
3005
|
}
|
|
2871
3006
|
set picks(indices) {
|
|
2872
3007
|
this.pick(indices);
|
|
2873
3008
|
}
|
|
3009
|
+
computedFirst;
|
|
2874
3010
|
get first() {
|
|
2875
3011
|
return this.computedFirst;
|
|
2876
3012
|
}
|
|
3013
|
+
computedLast;
|
|
2877
3014
|
get last() {
|
|
2878
3015
|
return this.computedLast;
|
|
2879
3016
|
}
|
|
@@ -2889,9 +3026,11 @@ class Pickable {
|
|
|
2889
3026
|
get items() {
|
|
2890
3027
|
return this.toItems(this.picks);
|
|
2891
3028
|
}
|
|
3029
|
+
toItems = createMap((index) => this.array[index]);
|
|
2892
3030
|
get multiple() {
|
|
2893
3031
|
return this.picks.length > 1;
|
|
2894
3032
|
}
|
|
3033
|
+
toPossiblePicks;
|
|
2895
3034
|
setArray(array) {
|
|
2896
3035
|
this.computedArray = array;
|
|
2897
3036
|
this.toPossiblePicks = createFilter((index) => index >= 0 && index < array.length);
|
|
@@ -2906,7 +3045,7 @@ class Pickable {
|
|
|
2906
3045
|
if (replace === "all") {
|
|
2907
3046
|
return toUnique(possiblePicks);
|
|
2908
3047
|
}
|
|
2909
|
-
const possibleWithoutDuplicates = createFilter((possiblePick) =>
|
|
3048
|
+
const possibleWithoutDuplicates = createFilter((possiblePick) => typeof find((pick) => pick === possiblePick)(this.picks || []) !== "number")(possiblePicks);
|
|
2910
3049
|
switch (replace) {
|
|
2911
3050
|
case "none":
|
|
2912
3051
|
return createConcat(this.picks || [], possibleWithoutDuplicates)([]);
|
|
@@ -2967,11 +3106,14 @@ function ensureIndices(indexOrIndices) {
|
|
|
2967
3106
|
const toUnique = createUnique();
|
|
2968
3107
|
|
|
2969
3108
|
class Sanitizeable {
|
|
3109
|
+
domPurifyConfig;
|
|
2970
3110
|
constructor(html, options) {
|
|
2971
3111
|
this.computedHtml = html;
|
|
2972
3112
|
this.domPurifyConfig = options;
|
|
2973
3113
|
this.ready();
|
|
2974
3114
|
}
|
|
3115
|
+
computedDompurify;
|
|
3116
|
+
computedStatus;
|
|
2975
3117
|
ready() {
|
|
2976
3118
|
if (domIsAvailable()) {
|
|
2977
3119
|
this.computedDompurify = createDOMPurify();
|
|
@@ -2995,6 +3137,7 @@ class Sanitizeable {
|
|
|
2995
3137
|
get status() {
|
|
2996
3138
|
return this.computedStatus;
|
|
2997
3139
|
}
|
|
3140
|
+
computedHtml;
|
|
2998
3141
|
setHtml(html) {
|
|
2999
3142
|
this.computedHtml = html;
|
|
3000
3143
|
return this;
|
|
@@ -3010,15 +3153,19 @@ class Sanitizeable {
|
|
|
3010
3153
|
}
|
|
3011
3154
|
|
|
3012
3155
|
class Searchable {
|
|
3156
|
+
searcherOptions;
|
|
3157
|
+
computedResults;
|
|
3013
3158
|
constructor(candidates, options = {}) {
|
|
3014
3159
|
this.searcherOptions = options;
|
|
3015
3160
|
this.setCandidates(candidates);
|
|
3016
3161
|
this.computedResults = [];
|
|
3017
3162
|
this.ready();
|
|
3018
3163
|
}
|
|
3164
|
+
computedStatus;
|
|
3019
3165
|
ready() {
|
|
3020
3166
|
this.computedStatus = "ready";
|
|
3021
3167
|
}
|
|
3168
|
+
computedCandidates;
|
|
3022
3169
|
get candidates() {
|
|
3023
3170
|
return this.computedCandidates;
|
|
3024
3171
|
}
|
|
@@ -3034,6 +3181,7 @@ class Searchable {
|
|
|
3034
3181
|
get status() {
|
|
3035
3182
|
return this.computedStatus;
|
|
3036
3183
|
}
|
|
3184
|
+
computedSearcher;
|
|
3037
3185
|
setCandidates(candidates) {
|
|
3038
3186
|
this.computedCandidates = Array.from(candidates);
|
|
3039
3187
|
this.computedSearcher = new Searcher(candidates, this.searcherOptions);
|
|
@@ -3054,6 +3202,8 @@ const defaultOptions = {
|
|
|
3054
3202
|
statusKeySuffix: " status"
|
|
3055
3203
|
};
|
|
3056
3204
|
class Storeable {
|
|
3205
|
+
type;
|
|
3206
|
+
statusKeySuffix;
|
|
3057
3207
|
constructor(key, options = {}) {
|
|
3058
3208
|
this.constructing();
|
|
3059
3209
|
this.type = options.type ?? defaultOptions.type;
|
|
@@ -3064,6 +3214,7 @@ class Storeable {
|
|
|
3064
3214
|
constructing() {
|
|
3065
3215
|
this.computedStatus = "constructing";
|
|
3066
3216
|
}
|
|
3217
|
+
computedStatus;
|
|
3067
3218
|
ready() {
|
|
3068
3219
|
this.computedStatus = "ready";
|
|
3069
3220
|
if (domIsAvailable()) {
|
|
@@ -3101,6 +3252,8 @@ class Storeable {
|
|
|
3101
3252
|
get error() {
|
|
3102
3253
|
return this.computedError;
|
|
3103
3254
|
}
|
|
3255
|
+
computedKey;
|
|
3256
|
+
computedStatusKey;
|
|
3104
3257
|
setKey(key) {
|
|
3105
3258
|
let string;
|
|
3106
3259
|
switch (this.status) {
|
|
@@ -3126,6 +3279,8 @@ class Storeable {
|
|
|
3126
3279
|
}
|
|
3127
3280
|
return this;
|
|
3128
3281
|
}
|
|
3282
|
+
computedString;
|
|
3283
|
+
computedError;
|
|
3129
3284
|
store(string) {
|
|
3130
3285
|
try {
|
|
3131
3286
|
this.storage.setItem(this.key, string);
|
|
@@ -3163,4 +3318,4 @@ class Storeable {
|
|
|
3163
3318
|
}
|
|
3164
3319
|
}
|
|
3165
3320
|
|
|
3166
|
-
export { Animateable, Completeable, Copyable, Delayable, Dispatchable, Drawable, Fetchable, Fullscreenable, Grantable, Listenable, Navigateable, Pickable, Pipeable, Recognizeable, Resolveable, Sanitizeable, Searchable, Storeable, createClamp, createClip, createConcat, createDelete, createDetermine, createFilter, createFilterAsync, createForEachAsync, createInsert, createMap, createMapAsync, createReduce, createReduceAsync, createRename, createReorder, createReplace, createReverse, createSlice, createSlug, createSwap, createUnique, easingsNetInBack, easingsNetInCirc, easingsNetInCubic, easingsNetInExpo, easingsNetInOutBack, easingsNetInOutCirc, easingsNetInOutCubic, easingsNetInOutExpo, easingsNetInOutQuad, easingsNetInOutQuint, easingsNetInOutSine, easingsNetInQuad, easingsNetInQuart, easingsNetInQuint, easingsNetInSine, easingsNetOutBack, easingsNetOutCirc, easingsNetOutCubic, easingsNetOutExpo, easingsNetOutQuad, easingsNetOutQuint, easingsNetOutSine, ensureKeycombo, eventMatchesKeycombo, linear, materialAccelerated, materialDecelerated, materialStandard, toD, toFlattenedD, verouEase, verouEaseIn, verouEaseInOut, verouEaseOut };
|
|
3321
|
+
export { Animateable, Completeable, Copyable, Delayable, Dispatchable, Drawable, Fetchable, Fullscreenable, Grantable, Listenable, Navigateable, Pickable, Pipeable, Recognizeable, Resolveable, Sanitizeable, Searchable, Storeable, createClamp, createClip, createConcat, createDelete, createDetermine, createFilter, createFilterAsync, createForEachAsync, createInsert, createMap, createMapAsync, createReduce, createReduceAsync, createRename, createReorder, createReplace, createReverse, createSlice, createSlug, createSort, createSwap, createToEntries, createUnique, easingsNetInBack, easingsNetInCirc, easingsNetInCubic, easingsNetInExpo, easingsNetInOutBack, easingsNetInOutCirc, easingsNetInOutCubic, easingsNetInOutExpo, easingsNetInOutQuad, easingsNetInOutQuint, easingsNetInOutSine, easingsNetInQuad, easingsNetInQuart, easingsNetInQuint, easingsNetInSine, easingsNetOutBack, easingsNetOutCirc, easingsNetOutCubic, easingsNetOutExpo, easingsNetOutQuad, easingsNetOutQuint, easingsNetOutSine, ensureKeycombo, eventMatchesKeycombo, linear, materialAccelerated, materialDecelerated, materialStandard, toD, toFlattenedD, verouEase, verouEaseIn, verouEaseInOut, verouEaseOut };
|