@slopit/adapter-pcibex 0.1.0
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/LICENSE +21 -0
- package/dist/index.d.ts +253 -0
- package/dist/index.js +225 -0
- package/dist/index.js.map +1 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Aaron Steven White
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { AdapterConfig, AdapterData, BaseRecorder } from '@slopit/adapter-shared';
|
|
2
|
+
export { AdapterData } from '@slopit/adapter-shared';
|
|
3
|
+
import { PlatformInfo } from '@slopit/core';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Types for the PCIbex adapter.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Configuration for PCIbex Slopit elements.
|
|
13
|
+
*/
|
|
14
|
+
interface PCIbexSlopitConfig extends AdapterConfig {
|
|
15
|
+
/**
|
|
16
|
+
* Whether to automatically log data when the element is removed from DOM.
|
|
17
|
+
*
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
autoLog?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Mock type for PennController elements.
|
|
24
|
+
*
|
|
25
|
+
* In actual PCIbex experiments, elements have different structures
|
|
26
|
+
* depending on their type. This interface provides a common shape
|
|
27
|
+
* for extracting DOM elements from PennController wrappers.
|
|
28
|
+
*/
|
|
29
|
+
interface PennElement {
|
|
30
|
+
/**
|
|
31
|
+
* Direct reference to the underlying DOM element.
|
|
32
|
+
*/
|
|
33
|
+
_element?: HTMLElement;
|
|
34
|
+
/**
|
|
35
|
+
* jQuery-wrapped container used by some PennController element types.
|
|
36
|
+
*/
|
|
37
|
+
jQueryContainer?: {
|
|
38
|
+
find(selector: string): {
|
|
39
|
+
get(index: number): HTMLElement | undefined;
|
|
40
|
+
length: number;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* jQuery element reference (used by TextInput elements).
|
|
45
|
+
*/
|
|
46
|
+
jQueryElement?: {
|
|
47
|
+
get(index: number): HTMLElement | undefined;
|
|
48
|
+
length: number;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Interface for Slopit elements in PCIbex experiments.
|
|
53
|
+
*
|
|
54
|
+
* Provides a fluent API for configuring behavioral capture on
|
|
55
|
+
* PennController TextInput and other elements.
|
|
56
|
+
*/
|
|
57
|
+
interface SlopitElement {
|
|
58
|
+
/**
|
|
59
|
+
* Attach behavioral capture to a PennController element.
|
|
60
|
+
*
|
|
61
|
+
* @param element - The PennController element to monitor
|
|
62
|
+
* @returns This element for method chaining
|
|
63
|
+
*/
|
|
64
|
+
attach(element: PennElement): SlopitElement;
|
|
65
|
+
/**
|
|
66
|
+
* Enable or disable keystroke capture.
|
|
67
|
+
*
|
|
68
|
+
* @param enabled - Whether to capture keystrokes
|
|
69
|
+
* @returns This element for method chaining
|
|
70
|
+
*/
|
|
71
|
+
keystroke(enabled: boolean): SlopitElement;
|
|
72
|
+
/**
|
|
73
|
+
* Enable or disable paste event capture.
|
|
74
|
+
*
|
|
75
|
+
* @param enabled - Whether to capture paste events
|
|
76
|
+
* @param capture - Whether to capture the pasted text content
|
|
77
|
+
* @returns This element for method chaining
|
|
78
|
+
*/
|
|
79
|
+
paste(enabled: boolean, capture?: boolean): SlopitElement;
|
|
80
|
+
/**
|
|
81
|
+
* Enable or disable focus event capture.
|
|
82
|
+
*
|
|
83
|
+
* @param enabled - Whether to capture focus events
|
|
84
|
+
* @returns This element for method chaining
|
|
85
|
+
*/
|
|
86
|
+
focus(enabled: boolean): SlopitElement;
|
|
87
|
+
/**
|
|
88
|
+
* Enable or disable mouse event capture.
|
|
89
|
+
*
|
|
90
|
+
* @param enabled - Whether to capture mouse events
|
|
91
|
+
* @returns This element for method chaining
|
|
92
|
+
*/
|
|
93
|
+
mouse(enabled: boolean): SlopitElement;
|
|
94
|
+
/**
|
|
95
|
+
* Enable or disable scroll event capture.
|
|
96
|
+
*
|
|
97
|
+
* @param enabled - Whether to capture scroll events
|
|
98
|
+
* @returns This element for method chaining
|
|
99
|
+
*/
|
|
100
|
+
scroll(enabled: boolean): SlopitElement;
|
|
101
|
+
/**
|
|
102
|
+
* Finalize capture and store data for logging.
|
|
103
|
+
*
|
|
104
|
+
* Call this before ending the trial to ensure all data is collected.
|
|
105
|
+
*
|
|
106
|
+
* @returns This element for method chaining
|
|
107
|
+
*/
|
|
108
|
+
log(): SlopitElement;
|
|
109
|
+
/**
|
|
110
|
+
* Get the collected adapter data.
|
|
111
|
+
*
|
|
112
|
+
* @returns The collected data, or null if not yet logged
|
|
113
|
+
*/
|
|
114
|
+
_getData(): AdapterData | null;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* PCIbex element implementation for Slopit behavioral capture.
|
|
119
|
+
*
|
|
120
|
+
* @module
|
|
121
|
+
*/
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Create a new Slopit element for PCIbex experiments.
|
|
125
|
+
*
|
|
126
|
+
* Creates a behavioral capture element that can be attached to
|
|
127
|
+
* PennController TextInput or other input elements.
|
|
128
|
+
*
|
|
129
|
+
* @param name - Unique name for this element
|
|
130
|
+
* @returns A new Slopit element
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```javascript
|
|
134
|
+
* // In a PCIbex experiment:
|
|
135
|
+
* newSlopit("capture")
|
|
136
|
+
* .attach(getTextInput("answer"))
|
|
137
|
+
* .keystroke(true)
|
|
138
|
+
* .paste(true, false)
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
declare function newSlopit(name: string): SlopitElement;
|
|
142
|
+
/**
|
|
143
|
+
* Get a previously created Slopit element by name.
|
|
144
|
+
*
|
|
145
|
+
* @param name - Name of the element to retrieve
|
|
146
|
+
* @returns The Slopit element, or undefined if not found
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```javascript
|
|
150
|
+
* // After creating with newSlopit:
|
|
151
|
+
* getSlopit("capture").log();
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
declare function getSlopit(name: string): SlopitElement | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* Clear all Slopit elements from the registry.
|
|
157
|
+
*
|
|
158
|
+
* Call this between trials if reusing element names, or at the
|
|
159
|
+
* end of an experiment to clean up.
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```javascript
|
|
163
|
+
* // At the end of a trial or experiment:
|
|
164
|
+
* clearSlopitElements();
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
declare function clearSlopitElements(): void;
|
|
168
|
+
/**
|
|
169
|
+
* Get data from all registered Slopit elements.
|
|
170
|
+
*
|
|
171
|
+
* Returns a record mapping element names to their collected data.
|
|
172
|
+
* Elements that haven't called log() will have null data.
|
|
173
|
+
*
|
|
174
|
+
* @returns Record of element names to adapter data
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* ```javascript
|
|
178
|
+
* // Get all captured data:
|
|
179
|
+
* const allData = getAllSlopitData();
|
|
180
|
+
* console.log(allData["capture"]);
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
declare function getAllSlopitData(): Record<string, AdapterData | null>;
|
|
184
|
+
/**
|
|
185
|
+
* Get the number of registered Slopit elements.
|
|
186
|
+
*
|
|
187
|
+
* @returns The count of registered elements
|
|
188
|
+
*/
|
|
189
|
+
declare function getSlopitCount(): number;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Session recorder for PCIbex experiments.
|
|
193
|
+
*
|
|
194
|
+
* @module
|
|
195
|
+
*/
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Session recorder for PCIbex experiments.
|
|
199
|
+
*
|
|
200
|
+
* Extends BaseRecorder to provide PCIbex-specific session management.
|
|
201
|
+
* Use this for session-level management across multiple trials when
|
|
202
|
+
* you need more control than the element-based API provides.
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```typescript
|
|
206
|
+
* const recorder = new PCIbexRecorder({
|
|
207
|
+
* participantId: "P001",
|
|
208
|
+
* studyId: "study-123",
|
|
209
|
+
* });
|
|
210
|
+
*
|
|
211
|
+
* recorder.startTrial({ trialType: "text-entry" });
|
|
212
|
+
* // ... participant completes trial ...
|
|
213
|
+
* recorder.endTrial({ type: "text", value: "response text" });
|
|
214
|
+
*
|
|
215
|
+
* const session = recorder.exportSession();
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
218
|
+
declare class PCIbexRecorder extends BaseRecorder {
|
|
219
|
+
/**
|
|
220
|
+
* Get platform information for PCIbex.
|
|
221
|
+
*
|
|
222
|
+
* @returns Platform info including name, version, and adapter version
|
|
223
|
+
*/
|
|
224
|
+
protected getPlatformInfo(): PlatformInfo;
|
|
225
|
+
/**
|
|
226
|
+
* Detect the PCIbex/PennController version if available.
|
|
227
|
+
*
|
|
228
|
+
* PCIbex does not expose version information in a standard way,
|
|
229
|
+
* so this attempts to detect it from global variables.
|
|
230
|
+
*
|
|
231
|
+
* @returns The detected version string, or "unknown"
|
|
232
|
+
*/
|
|
233
|
+
private detectPCIbexVersion;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Create a new PCIbex session recorder.
|
|
237
|
+
*
|
|
238
|
+
* Factory function for creating PCIbexRecorder instances.
|
|
239
|
+
*
|
|
240
|
+
* @param config - Recorder configuration
|
|
241
|
+
* @returns A new PCIbexRecorder instance
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* const recorder = createPCIbexRecorder({
|
|
246
|
+
* participantId: urlParams.get("PROLIFIC_PID"),
|
|
247
|
+
* studyId: "my-experiment",
|
|
248
|
+
* });
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
declare function createPCIbexRecorder(config?: ConstructorParameters<typeof PCIbexRecorder>[0]): PCIbexRecorder;
|
|
252
|
+
|
|
253
|
+
export { PCIbexRecorder, type PCIbexSlopitConfig, type PennElement, type SlopitElement, clearSlopitElements, createPCIbexRecorder, getAllSlopitData, getSlopit, getSlopitCount, newSlopit };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { BaseRecorder, discoverElement } from '@slopit/adapter-shared';
|
|
2
|
+
import { BehavioralCapture } from '@slopit/behavioral';
|
|
3
|
+
|
|
4
|
+
// src/element.ts
|
|
5
|
+
var slopitElements = /* @__PURE__ */ new Map();
|
|
6
|
+
var SlopitElementImpl = class {
|
|
7
|
+
name;
|
|
8
|
+
config;
|
|
9
|
+
capture = null;
|
|
10
|
+
targetElement = null;
|
|
11
|
+
startTime = 0;
|
|
12
|
+
data = null;
|
|
13
|
+
cleanupFn = null;
|
|
14
|
+
constructor(name) {
|
|
15
|
+
this.name = name;
|
|
16
|
+
this.config = {
|
|
17
|
+
keystroke: { enabled: false },
|
|
18
|
+
paste: { enabled: false, capturePreview: true },
|
|
19
|
+
focus: { enabled: true },
|
|
20
|
+
mouse: { enabled: false },
|
|
21
|
+
scroll: { enabled: false }
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
attach(element) {
|
|
25
|
+
const domElement = this.extractElement(element);
|
|
26
|
+
if (domElement !== null) {
|
|
27
|
+
this.targetElement = domElement;
|
|
28
|
+
this.startCapture();
|
|
29
|
+
}
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Extract the underlying DOM element from a PennController element.
|
|
34
|
+
*
|
|
35
|
+
* PennController elements have different structures depending on type.
|
|
36
|
+
* TextInput elements typically use jQueryElement or jQueryContainer.
|
|
37
|
+
*
|
|
38
|
+
* @param pennElement - The PennController element wrapper
|
|
39
|
+
* @returns The DOM element, or null if not found
|
|
40
|
+
*/
|
|
41
|
+
extractElement(pennElement) {
|
|
42
|
+
if (pennElement._element instanceof HTMLElement) {
|
|
43
|
+
return pennElement._element;
|
|
44
|
+
}
|
|
45
|
+
if (pennElement.jQueryElement !== void 0) {
|
|
46
|
+
const el = pennElement.jQueryElement.get(0);
|
|
47
|
+
if (el instanceof HTMLElement) {
|
|
48
|
+
return el;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (pennElement.jQueryContainer !== void 0) {
|
|
52
|
+
const input = pennElement.jQueryContainer.find("input, textarea").get(0);
|
|
53
|
+
if (input instanceof HTMLElement) {
|
|
54
|
+
return input;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Start behavioral capture on the attached element.
|
|
61
|
+
*/
|
|
62
|
+
startCapture() {
|
|
63
|
+
if (this.targetElement === null) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
this.startTime = performance.now();
|
|
67
|
+
this.capture = new BehavioralCapture(this.config);
|
|
68
|
+
this.capture.attach(this.targetElement, this.startTime);
|
|
69
|
+
}
|
|
70
|
+
keystroke(enabled) {
|
|
71
|
+
this.config.keystroke = { ...this.config.keystroke, enabled };
|
|
72
|
+
this.updateCaptureIfActive();
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
paste(enabled, capture = true) {
|
|
76
|
+
this.config.paste = {
|
|
77
|
+
...this.config.paste,
|
|
78
|
+
enabled,
|
|
79
|
+
capturePreview: capture
|
|
80
|
+
};
|
|
81
|
+
this.updateCaptureIfActive();
|
|
82
|
+
return this;
|
|
83
|
+
}
|
|
84
|
+
focus(enabled) {
|
|
85
|
+
this.config.focus = { ...this.config.focus, enabled };
|
|
86
|
+
this.updateCaptureIfActive();
|
|
87
|
+
return this;
|
|
88
|
+
}
|
|
89
|
+
mouse(enabled) {
|
|
90
|
+
this.config.mouse = { ...this.config.mouse, enabled };
|
|
91
|
+
this.updateCaptureIfActive();
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
scroll(enabled) {
|
|
95
|
+
this.config.scroll = { ...this.config.scroll, enabled };
|
|
96
|
+
this.updateCaptureIfActive();
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Restart capture with updated configuration if already active.
|
|
101
|
+
*/
|
|
102
|
+
updateCaptureIfActive() {
|
|
103
|
+
if (this.capture !== null && this.targetElement !== null) {
|
|
104
|
+
this.capture.detach();
|
|
105
|
+
this.startCapture();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
log() {
|
|
109
|
+
if (this.capture !== null) {
|
|
110
|
+
this.data = {
|
|
111
|
+
behavioral: this.capture.getData(),
|
|
112
|
+
flags: this.capture.getFlags()
|
|
113
|
+
};
|
|
114
|
+
this.capture.detach();
|
|
115
|
+
this.capture = null;
|
|
116
|
+
}
|
|
117
|
+
if (this.cleanupFn !== null) {
|
|
118
|
+
this.cleanupFn();
|
|
119
|
+
this.cleanupFn = null;
|
|
120
|
+
}
|
|
121
|
+
return this;
|
|
122
|
+
}
|
|
123
|
+
_getData() {
|
|
124
|
+
return this.data;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Attach capture when the target element becomes available.
|
|
128
|
+
*
|
|
129
|
+
* Uses a MutationObserver to watch for the element to appear in the DOM.
|
|
130
|
+
* Useful when the target element is not yet printed when attach() is called.
|
|
131
|
+
*
|
|
132
|
+
* @param selector - CSS selector for the target element
|
|
133
|
+
* @param container - Container element to search within
|
|
134
|
+
*/
|
|
135
|
+
_attachWhenReady(selector, container) {
|
|
136
|
+
this.cleanupFn = discoverElement({
|
|
137
|
+
selector,
|
|
138
|
+
container,
|
|
139
|
+
timeout: 1e4,
|
|
140
|
+
onFound: (el) => {
|
|
141
|
+
this.targetElement = el;
|
|
142
|
+
this.startCapture();
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Get the name of this Slopit element.
|
|
148
|
+
*
|
|
149
|
+
* @returns The element name
|
|
150
|
+
*/
|
|
151
|
+
_getName() {
|
|
152
|
+
return this.name;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
function newSlopit(name) {
|
|
156
|
+
const element = new SlopitElementImpl(name);
|
|
157
|
+
slopitElements.set(name, element);
|
|
158
|
+
return element;
|
|
159
|
+
}
|
|
160
|
+
function getSlopit(name) {
|
|
161
|
+
return slopitElements.get(name);
|
|
162
|
+
}
|
|
163
|
+
function clearSlopitElements() {
|
|
164
|
+
for (const element of slopitElements.values()) {
|
|
165
|
+
const impl = element;
|
|
166
|
+
if (impl._getData() === null) {
|
|
167
|
+
impl.log();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
slopitElements.clear();
|
|
171
|
+
}
|
|
172
|
+
function getAllSlopitData() {
|
|
173
|
+
const result = {};
|
|
174
|
+
for (const [name, element] of slopitElements) {
|
|
175
|
+
result[name] = element._getData();
|
|
176
|
+
}
|
|
177
|
+
return result;
|
|
178
|
+
}
|
|
179
|
+
function getSlopitCount() {
|
|
180
|
+
return slopitElements.size;
|
|
181
|
+
}
|
|
182
|
+
var ADAPTER_VERSION = "0.1.0";
|
|
183
|
+
var PCIbexRecorder = class extends BaseRecorder {
|
|
184
|
+
/**
|
|
185
|
+
* Get platform information for PCIbex.
|
|
186
|
+
*
|
|
187
|
+
* @returns Platform info including name, version, and adapter version
|
|
188
|
+
*/
|
|
189
|
+
getPlatformInfo() {
|
|
190
|
+
return {
|
|
191
|
+
name: "PCIbex",
|
|
192
|
+
version: this.detectPCIbexVersion(),
|
|
193
|
+
adapterVersion: ADAPTER_VERSION
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Detect the PCIbex/PennController version if available.
|
|
198
|
+
*
|
|
199
|
+
* PCIbex does not expose version information in a standard way,
|
|
200
|
+
* so this attempts to detect it from global variables.
|
|
201
|
+
*
|
|
202
|
+
* @returns The detected version string, or "unknown"
|
|
203
|
+
*/
|
|
204
|
+
detectPCIbexVersion() {
|
|
205
|
+
if (typeof window === "undefined") {
|
|
206
|
+
return "unknown";
|
|
207
|
+
}
|
|
208
|
+
const win = window;
|
|
209
|
+
const pennController = win["PennController"];
|
|
210
|
+
if (typeof pennController === "object" && pennController !== null && "version" in pennController) {
|
|
211
|
+
const version = pennController["version"];
|
|
212
|
+
if (typeof version === "string") {
|
|
213
|
+
return version;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return "unknown";
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
function createPCIbexRecorder(config) {
|
|
220
|
+
return new PCIbexRecorder(config);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export { PCIbexRecorder, clearSlopitElements, createPCIbexRecorder, getAllSlopitData, getSlopit, getSlopitCount, newSlopit };
|
|
224
|
+
//# sourceMappingURL=index.js.map
|
|
225
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/element.ts","../src/recorder.ts"],"names":[],"mappings":";;;;AAkBA,IAAM,cAAA,uBAAqB,GAAA,EAA+B;AAK1D,IAAM,oBAAN,MAAiD;AAAA,EACvC,IAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,GAAoC,IAAA;AAAA,EACpC,aAAA,GAAoC,IAAA;AAAA,EACpC,SAAA,GAAY,CAAA;AAAA,EACZ,IAAA,GAA2B,IAAA;AAAA,EAC3B,SAAA,GAAiC,IAAA;AAAA,EAEzC,YAAY,IAAA,EAAc;AACxB,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AACZ,IAAA,IAAA,CAAK,MAAA,GAAS;AAAA,MACZ,SAAA,EAAW,EAAE,OAAA,EAAS,KAAA,EAAM;AAAA,MAC5B,KAAA,EAAO,EAAE,OAAA,EAAS,KAAA,EAAO,gBAAgB,IAAA,EAAK;AAAA,MAC9C,KAAA,EAAO,EAAE,OAAA,EAAS,IAAA,EAAK;AAAA,MACvB,KAAA,EAAO,EAAE,OAAA,EAAS,KAAA,EAAM;AAAA,MACxB,MAAA,EAAQ,EAAE,OAAA,EAAS,KAAA;AAAM,KAC3B;AAAA,EACF;AAAA,EAEA,OAAO,OAAA,EAAqC;AAC1C,IAAA,MAAM,UAAA,GAAa,IAAA,CAAK,cAAA,CAAe,OAAO,CAAA;AAE9C,IAAA,IAAI,eAAe,IAAA,EAAM;AACvB,MAAA,IAAA,CAAK,aAAA,GAAgB,UAAA;AACrB,MAAA,IAAA,CAAK,YAAA,EAAa;AAAA,IACpB;AAEA,IAAA,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OAAA,GAAW,eAA2C,SAAS,CAAA;AACrE,MAAA,IAAI,OAAO,YAAY,QAAA,EAAU;AAC/B,QAAA,OAAO,OAAA;AAAA,MACT;AAAA,IACF;AAEA,IAAA,OAAO,SAAA;AAAA,EACT;AACF;AAkBO,SAAS,qBACd,MAAA,EACgB;AAChB,EAAA,OAAO,IAAI,eAAe,MAAM,CAAA;AAClC","file":"index.js","sourcesContent":["/**\n * PCIbex element implementation for Slopit behavioral capture.\n *\n * @module\n */\n\nimport { type AdapterData, discoverElement } from \"@slopit/adapter-shared\";\nimport type { BehavioralCaptureConfig } from \"@slopit/behavioral\";\nimport { BehavioralCapture } from \"@slopit/behavioral\";\n\nimport type { PennElement, SlopitElement } from \"./types.js\";\n\n/**\n * Global registry for Slopit elements.\n *\n * PCIbex uses a global registry pattern for elements, allowing\n * getSlopit() to retrieve previously created elements by name.\n */\nconst slopitElements = new Map<string, SlopitElementImpl>();\n\n/**\n * Internal implementation of the SlopitElement interface.\n */\nclass SlopitElementImpl implements SlopitElement {\n private name: string;\n private config: BehavioralCaptureConfig;\n private capture: BehavioralCapture | null = null;\n private targetElement: HTMLElement | null = null;\n private startTime = 0;\n private data: AdapterData | null = null;\n private cleanupFn: (() => void) | null = null;\n\n constructor(name: string) {\n this.name = name;\n this.config = {\n keystroke: { enabled: false },\n paste: { enabled: false, capturePreview: true },\n focus: { enabled: true },\n mouse: { enabled: false },\n scroll: { enabled: false },\n };\n }\n\n attach(element: PennElement): SlopitElement {\n const domElement = this.extractElement(element);\n\n if (domElement !== null) {\n this.targetElement = domElement;\n this.startCapture();\n }\n\n return this;\n }\n\n /**\n * Extract the underlying DOM element from a PennController element.\n *\n * PennController elements have different structures depending on type.\n * TextInput elements typically use jQueryElement or jQueryContainer.\n *\n * @param pennElement - The PennController element wrapper\n * @returns The DOM element, or null if not found\n */\n private extractElement(pennElement: PennElement): HTMLElement | null {\n // Direct element reference (some element types)\n if (pennElement._element instanceof HTMLElement) {\n return pennElement._element;\n }\n\n // jQuery element reference (TextInput elements)\n if (pennElement.jQueryElement !== undefined) {\n const el = pennElement.jQueryElement.get(0);\n if (el instanceof HTMLElement) {\n return el;\n }\n }\n\n // jQuery container with input/textarea (other element types)\n if (pennElement.jQueryContainer !== undefined) {\n const input = pennElement.jQueryContainer.find(\"input, textarea\").get(0);\n if (input instanceof HTMLElement) {\n return input;\n }\n }\n\n return null;\n }\n\n /**\n * Start behavioral capture on the attached element.\n */\n private startCapture(): void {\n if (this.targetElement === null) {\n return;\n }\n\n this.startTime = performance.now();\n this.capture = new BehavioralCapture(this.config);\n this.capture.attach(this.targetElement, this.startTime);\n }\n\n keystroke(enabled: boolean): SlopitElement {\n this.config.keystroke = { ...this.config.keystroke, enabled };\n this.updateCaptureIfActive();\n return this;\n }\n\n paste(enabled: boolean, capture = true): SlopitElement {\n this.config.paste = {\n ...this.config.paste,\n enabled,\n capturePreview: capture,\n };\n this.updateCaptureIfActive();\n return this;\n }\n\n focus(enabled: boolean): SlopitElement {\n this.config.focus = { ...this.config.focus, enabled };\n this.updateCaptureIfActive();\n return this;\n }\n\n mouse(enabled: boolean): SlopitElement {\n this.config.mouse = { ...this.config.mouse, enabled };\n this.updateCaptureIfActive();\n return this;\n }\n\n scroll(enabled: boolean): SlopitElement {\n this.config.scroll = { ...this.config.scroll, enabled };\n this.updateCaptureIfActive();\n return this;\n }\n\n /**\n * Restart capture with updated configuration if already active.\n */\n private updateCaptureIfActive(): void {\n if (this.capture !== null && this.targetElement !== null) {\n this.capture.detach();\n this.startCapture();\n }\n }\n\n log(): SlopitElement {\n if (this.capture !== null) {\n this.data = {\n behavioral: this.capture.getData(),\n flags: this.capture.getFlags(),\n };\n this.capture.detach();\n this.capture = null;\n }\n\n if (this.cleanupFn !== null) {\n this.cleanupFn();\n this.cleanupFn = null;\n }\n\n return this;\n }\n\n _getData(): AdapterData | null {\n return this.data;\n }\n\n /**\n * Attach capture when the target element becomes available.\n *\n * Uses a MutationObserver to watch for the element to appear in the DOM.\n * Useful when the target element is not yet printed when attach() is called.\n *\n * @param selector - CSS selector for the target element\n * @param container - Container element to search within\n */\n _attachWhenReady(selector: string, container: HTMLElement | Document): void {\n this.cleanupFn = discoverElement({\n selector,\n container,\n timeout: 10000,\n onFound: (el) => {\n this.targetElement = el;\n this.startCapture();\n },\n });\n }\n\n /**\n * Get the name of this Slopit element.\n *\n * @returns The element name\n */\n _getName(): string {\n return this.name;\n }\n}\n\n/**\n * Create a new Slopit element for PCIbex experiments.\n *\n * Creates a behavioral capture element that can be attached to\n * PennController TextInput or other input elements.\n *\n * @param name - Unique name for this element\n * @returns A new Slopit element\n *\n * @example\n * ```javascript\n * // In a PCIbex experiment:\n * newSlopit(\"capture\")\n * .attach(getTextInput(\"answer\"))\n * .keystroke(true)\n * .paste(true, false)\n * ```\n */\nexport function newSlopit(name: string): SlopitElement {\n const element = new SlopitElementImpl(name);\n slopitElements.set(name, element);\n return element;\n}\n\n/**\n * Get a previously created Slopit element by name.\n *\n * @param name - Name of the element to retrieve\n * @returns The Slopit element, or undefined if not found\n *\n * @example\n * ```javascript\n * // After creating with newSlopit:\n * getSlopit(\"capture\").log();\n * ```\n */\nexport function getSlopit(name: string): SlopitElement | undefined {\n return slopitElements.get(name);\n}\n\n/**\n * Clear all Slopit elements from the registry.\n *\n * Call this between trials if reusing element names, or at the\n * end of an experiment to clean up.\n *\n * @example\n * ```javascript\n * // At the end of a trial or experiment:\n * clearSlopitElements();\n * ```\n */\nexport function clearSlopitElements(): void {\n // Log any elements that haven't been logged yet\n for (const element of slopitElements.values()) {\n const impl = element as SlopitElementImpl;\n if (impl._getData() === null) {\n impl.log();\n }\n }\n slopitElements.clear();\n}\n\n/**\n * Get data from all registered Slopit elements.\n *\n * Returns a record mapping element names to their collected data.\n * Elements that haven't called log() will have null data.\n *\n * @returns Record of element names to adapter data\n *\n * @example\n * ```javascript\n * // Get all captured data:\n * const allData = getAllSlopitData();\n * console.log(allData[\"capture\"]);\n * ```\n */\nexport function getAllSlopitData(): Record<string, AdapterData | null> {\n const result: Record<string, AdapterData | null> = {};\n for (const [name, element] of slopitElements) {\n result[name] = element._getData();\n }\n return result;\n}\n\n/**\n * Get the number of registered Slopit elements.\n *\n * @returns The count of registered elements\n */\nexport function getSlopitCount(): number {\n return slopitElements.size;\n}\n","/**\n * Session recorder for PCIbex experiments.\n *\n * @module\n */\n\nimport { BaseRecorder } from \"@slopit/adapter-shared\";\nimport type { PlatformInfo } from \"@slopit/core\";\n\n/**\n * Adapter version for platform info.\n */\nconst ADAPTER_VERSION = \"0.1.0\";\n\n/**\n * Session recorder for PCIbex experiments.\n *\n * Extends BaseRecorder to provide PCIbex-specific session management.\n * Use this for session-level management across multiple trials when\n * you need more control than the element-based API provides.\n *\n * @example\n * ```typescript\n * const recorder = new PCIbexRecorder({\n * participantId: \"P001\",\n * studyId: \"study-123\",\n * });\n *\n * recorder.startTrial({ trialType: \"text-entry\" });\n * // ... participant completes trial ...\n * recorder.endTrial({ type: \"text\", value: \"response text\" });\n *\n * const session = recorder.exportSession();\n * ```\n */\nexport class PCIbexRecorder extends BaseRecorder {\n /**\n * Get platform information for PCIbex.\n *\n * @returns Platform info including name, version, and adapter version\n */\n protected getPlatformInfo(): PlatformInfo {\n return {\n name: \"PCIbex\",\n version: this.detectPCIbexVersion(),\n adapterVersion: ADAPTER_VERSION,\n };\n }\n\n /**\n * Detect the PCIbex/PennController version if available.\n *\n * PCIbex does not expose version information in a standard way,\n * so this attempts to detect it from global variables.\n *\n * @returns The detected version string, or \"unknown\"\n */\n private detectPCIbexVersion(): string {\n if (typeof window === \"undefined\") {\n return \"unknown\";\n }\n\n // Check for PennController version using bracket notation for index access\n const win = window as unknown as Record<string, unknown>;\n const pennController = win[\"PennController\"];\n if (\n typeof pennController === \"object\" &&\n pennController !== null &&\n \"version\" in pennController\n ) {\n const version = (pennController as Record<string, unknown>)[\"version\"];\n if (typeof version === \"string\") {\n return version;\n }\n }\n\n return \"unknown\";\n }\n}\n\n/**\n * Create a new PCIbex session recorder.\n *\n * Factory function for creating PCIbexRecorder instances.\n *\n * @param config - Recorder configuration\n * @returns A new PCIbexRecorder instance\n *\n * @example\n * ```typescript\n * const recorder = createPCIbexRecorder({\n * participantId: urlParams.get(\"PROLIFIC_PID\"),\n * studyId: \"my-experiment\",\n * });\n * ```\n */\nexport function createPCIbexRecorder(\n config?: ConstructorParameters<typeof PCIbexRecorder>[0],\n): PCIbexRecorder {\n return new PCIbexRecorder(config);\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@slopit/adapter-pcibex",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "PCIbex adapter for slopit behavioral capture",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Aaron Steven White",
|
|
9
|
+
"email": "aaron.white@rochester.edu",
|
|
10
|
+
"url": "https://aaronstevenwhite.io"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://slopit.github.io",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/slopit/slopit.git",
|
|
16
|
+
"directory": "packages/adapter-pcibex"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/slopit/slopit/issues"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"pcibex",
|
|
26
|
+
"penncontroller",
|
|
27
|
+
"ibex",
|
|
28
|
+
"behavioral-research",
|
|
29
|
+
"experiment",
|
|
30
|
+
"psychology",
|
|
31
|
+
"ai-detection",
|
|
32
|
+
"crowdsourcing"
|
|
33
|
+
],
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"import": "./dist/index.js"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist"
|
|
42
|
+
],
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@slopit/behavioral": "0.1.0",
|
|
45
|
+
"@slopit/adapter-shared": "0.1.0",
|
|
46
|
+
"@slopit/core": "0.1.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"jsdom": "^25.0.1",
|
|
50
|
+
"tsup": "^8.3.5",
|
|
51
|
+
"typescript": "^5.7.2",
|
|
52
|
+
"vitest": "^2.1.8"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "tsup",
|
|
56
|
+
"typecheck": "tsc --noEmit",
|
|
57
|
+
"test": "vitest run",
|
|
58
|
+
"test:watch": "vitest",
|
|
59
|
+
"clean": "rm -rf dist"
|
|
60
|
+
}
|
|
61
|
+
}
|