nucleus-core-ts 0.10.239 → 0.10.240
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/.build-ok
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.10.
|
|
1
|
+
0.10.240
|
|
@@ -25,9 +25,10 @@ const TEXT_RULES = [
|
|
|
25
25
|
'key',
|
|
26
26
|
/(?<=(?:key|secret|token|password)["'\\]*\s*[:=]\s*["'\\]*)[A-Za-z0-9+/_=-]{20,}/gi
|
|
27
27
|
],
|
|
28
|
+
// The domain ends in letters: `nucleus-core-ts@0.10.236` is a package version, not an address.
|
|
28
29
|
[
|
|
29
30
|
'email',
|
|
30
|
-
/[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)
|
|
31
|
+
/[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,63}(?![A-Za-z0-9-])/g
|
|
31
32
|
],
|
|
32
33
|
[
|
|
33
34
|
'ipv4',
|
|
@@ -12,6 +12,11 @@ export interface StepCaptureOptions {
|
|
|
12
12
|
debounceMs?: number;
|
|
13
13
|
/** Written in place of what was typed into a password field; the real value is never read. Default empty. */
|
|
14
14
|
secretValue?: string;
|
|
15
|
+
/**
|
|
16
|
+
* An action this long after the previous one of the same step is preceded by a `waitUntil` at its own time, so a step
|
|
17
|
+
* that groups actions minutes apart replays them when they happened. Default 1500 ms.
|
|
18
|
+
*/
|
|
19
|
+
holdMs?: number;
|
|
15
20
|
}
|
|
16
21
|
export interface StepCapture {
|
|
17
22
|
start: () => void;
|
|
@@ -18,6 +18,8 @@ const KEYS = new Set([
|
|
|
18
18
|
const { root, clock } = options;
|
|
19
19
|
const attribute = options.targetAttribute ?? 'data-tour';
|
|
20
20
|
const debounceMs = options.debounceMs ?? 400;
|
|
21
|
+
const holdMs = options.holdMs ?? 1500;
|
|
22
|
+
let lastAt = 0;
|
|
21
23
|
const log = createUnanchoredLog(root, attribute);
|
|
22
24
|
const list = [];
|
|
23
25
|
let chapter = options.chapter ?? 'main';
|
|
@@ -28,18 +30,23 @@ const KEYS = new Set([
|
|
|
28
30
|
if (target === null) return log.add(element);
|
|
29
31
|
const action = build(target);
|
|
30
32
|
if (action === null) return;
|
|
33
|
+
const at = clock.at();
|
|
31
34
|
if (current === null) {
|
|
32
35
|
current = {
|
|
33
36
|
id: `step-${list.length + 1}`,
|
|
34
37
|
chapter,
|
|
35
|
-
at
|
|
38
|
+
at,
|
|
36
39
|
caption: {
|
|
37
40
|
en: ''
|
|
38
41
|
},
|
|
39
42
|
actions: []
|
|
40
43
|
};
|
|
41
44
|
list.push(current);
|
|
42
|
-
}
|
|
45
|
+
} else if (at - lastAt > holdMs) current.actions.push({
|
|
46
|
+
kind: 'waitUntil',
|
|
47
|
+
at
|
|
48
|
+
});
|
|
49
|
+
lastAt = at;
|
|
43
50
|
current.actions.push(action);
|
|
44
51
|
};
|
|
45
52
|
const flush = ()=>{
|
|
@@ -108,8 +115,11 @@ const KEYS = new Set([
|
|
|
108
115
|
const onKey = (event)=>{
|
|
109
116
|
if (!(event instanceof KeyboardEvent) || !KEYS.has(event.key) || !(event.target instanceof Element)) return;
|
|
110
117
|
const { target } = event;
|
|
111
|
-
// Enter on a button or link is already its click; Enter inside a textarea is a line break.
|
|
112
|
-
|
|
118
|
+
// Enter on a button or link is already its click; Shift+Enter inside a textarea is a line break. A plain Enter in a
|
|
119
|
+
// textarea is kept: chat composers send on it, and flush() below writes the text typed so far first (the send
|
|
120
|
+
// clears the box before the typing debounce would have read it).
|
|
121
|
+
if (event.key === 'Enter' && target.closest('button, a[href], summary')) return;
|
|
122
|
+
if (event.key === 'Enter' && event.shiftKey && target.closest('textarea')) return;
|
|
113
123
|
flush();
|
|
114
124
|
add(target, (id)=>({
|
|
115
125
|
kind: 'key',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nucleus-core-ts",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.240",
|
|
4
4
|
"description": "Production-ready, enterprise-grade TypeScript framework for building multi-tenant APIs",
|
|
5
5
|
"author": "Hidayet Can Özcan <hidayetcan@gmail.com>",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|