@platejs/test 0.0.0-stage → 54.0.0-beta.2
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 +24 -0
- package/README.md +283 -2
- package/dist/browser/index.d.ts +25 -0
- package/dist/browser/index.js +69 -0
- package/dist/feature-contracts-BhHdrzuI.js +32 -0
- package/dist/feature-contracts-Dwvvzqfa.d.ts +24 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +9 -0
- package/dist/playwright/index.d.ts +1586 -0
- package/dist/playwright/index.js +6170 -0
- package/dist/proof/index.d.ts +250 -0
- package/dist/proof/index.js +634 -0
- package/dist/react/index.d.ts +50 -0
- package/dist/react/index.js +141 -0
- package/dist/zero-width-BGyZc7Mb.d.ts +11 -0
- package/package.json +120 -3
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { a as defineBrowserFeatureContract, i as createBrowserFeatureContractRegistry, n as BrowserFeatureContractRegistry, r as BrowserFeatureContractRow, t as BrowserFeatureContractDefinition } from "../feature-contracts-Dwvvzqfa.js";
|
|
2
|
+
//#region src/proof/first-party-browser-contracts.d.ts
|
|
3
|
+
/** First-party browser behavior row without its owning feature label. */
|
|
4
|
+
type BrowserIntentFamilyContract = Omit<BrowserFeatureContractRow, 'feature'>;
|
|
5
|
+
/** Small cross-route parity slice used to keep canonical examples aligned. */
|
|
6
|
+
type BrowserFirstPartyParityFamily = {
|
|
7
|
+
assertions: readonly string[];
|
|
8
|
+
family: string;
|
|
9
|
+
routes: readonly string[];
|
|
10
|
+
};
|
|
11
|
+
/** Summary returned after first-party browser contract validation. */
|
|
12
|
+
type BrowserFirstPartyParityContractResult = {
|
|
13
|
+
intentFamilyCount: number;
|
|
14
|
+
parityFamilies: string[];
|
|
15
|
+
registryRowCount: number;
|
|
16
|
+
};
|
|
17
|
+
/** Canonical first-party browser behavior families editor must preserve. */
|
|
18
|
+
declare const BROWSER_FIRST_PARTY_INTENT_FAMILY_CONTRACTS: {
|
|
19
|
+
assertions: string[];
|
|
20
|
+
family: string;
|
|
21
|
+
routes: string[];
|
|
22
|
+
}[];
|
|
23
|
+
/** Focused parity families that compare the same invariant across routes. */
|
|
24
|
+
declare const BROWSER_FIRST_PARTY_PARITY_FAMILIES: {
|
|
25
|
+
assertions: string[];
|
|
26
|
+
family: string;
|
|
27
|
+
routes: string[];
|
|
28
|
+
}[];
|
|
29
|
+
/** Feature-indexed registry built from the first-party behavior families. */
|
|
30
|
+
declare const BROWSER_FIRST_PARTY_FEATURE_CONTRACT_REGISTRY: BrowserFeatureContractRegistry;
|
|
31
|
+
/** Assert that first-party behavior and parity contract registries agree. */
|
|
32
|
+
declare const assertBrowserFirstPartyParityContracts: () => BrowserFirstPartyParityContractResult;
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/proof/proof.d.ts
|
|
35
|
+
/** Evidence strength for a browser or device proof artifact. */
|
|
36
|
+
type ProofEvidenceClass = 'automated-direct' | 'automated-proxy' | 'manual-device-blocking';
|
|
37
|
+
/** Debug shape extracted from a rendered placeholder marker. */
|
|
38
|
+
type DebugPlaceholderShape = {
|
|
39
|
+
hasBr: boolean;
|
|
40
|
+
hasFEFF: boolean;
|
|
41
|
+
kind: string | null;
|
|
42
|
+
text: string;
|
|
43
|
+
};
|
|
44
|
+
/** Browser debug payload used by mobile and agent-browser proof evaluators. */
|
|
45
|
+
type DebugSnapshot = {
|
|
46
|
+
blockTexts: string;
|
|
47
|
+
domSelection: string;
|
|
48
|
+
events: string[];
|
|
49
|
+
placeholderShape: DebugPlaceholderShape | null;
|
|
50
|
+
editorSelection: string;
|
|
51
|
+
};
|
|
52
|
+
/** Result of checking placeholder input behavior from a debug snapshot. */
|
|
53
|
+
type PlaceholderInputEvaluation = {
|
|
54
|
+
issues: string[];
|
|
55
|
+
ok: boolean;
|
|
56
|
+
snapshot: DebugSnapshot;
|
|
57
|
+
};
|
|
58
|
+
type ImeInputEvaluation = {
|
|
59
|
+
issues: string[];
|
|
60
|
+
ok: boolean;
|
|
61
|
+
snapshot: DebugSnapshot;
|
|
62
|
+
};
|
|
63
|
+
type AgentBrowserBatchItem = {
|
|
64
|
+
command: string[];
|
|
65
|
+
error: string | null;
|
|
66
|
+
result?: {
|
|
67
|
+
origin?: string;
|
|
68
|
+
result?: string;
|
|
69
|
+
text?: string;
|
|
70
|
+
title?: string;
|
|
71
|
+
url?: string;
|
|
72
|
+
} | null;
|
|
73
|
+
success: boolean;
|
|
74
|
+
};
|
|
75
|
+
/** Parse and validate a serialized browser debug snapshot. */
|
|
76
|
+
declare const parseDebugSnapshot: (raw: string) => DebugSnapshot;
|
|
77
|
+
/** Parse raw agent-browser batch JSON output. */
|
|
78
|
+
declare const parseAgentBrowserBatch: (raw: string) => AgentBrowserBatchItem[];
|
|
79
|
+
/** Extract the last debug snapshot string from agent-browser batch output. */
|
|
80
|
+
declare const extractAgentBrowserDebugSnapshot: (raw: string) => DebugSnapshot;
|
|
81
|
+
/** Extract a debug snapshot from an Appium execute response. */
|
|
82
|
+
declare const extractAppiumDebugSnapshot: (raw: string) => DebugSnapshot;
|
|
83
|
+
/** Evaluate IME input behavior from a browser debug snapshot. */
|
|
84
|
+
declare const evaluateImeInput: (snapshot: DebugSnapshot, expectedText?: string) => ImeInputEvaluation;
|
|
85
|
+
/** Evaluate placeholder input behavior from a browser debug snapshot. */
|
|
86
|
+
declare const evaluatePlaceholderInput: (snapshot: DebugSnapshot, expectedText?: string) => PlaceholderInputEvaluation;
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/proof/mobile-transport-proof.d.ts
|
|
89
|
+
/** Supported automation transport ids for mobile browser proof. */
|
|
90
|
+
type BrowserMobileTransportId = 'agent-browser-ios' | 'appium-android' | 'appium-ios';
|
|
91
|
+
/** Browser platform represented by a mobile transport. */
|
|
92
|
+
type BrowserMobileProofPlatform = 'android-chrome' | 'ios-safari';
|
|
93
|
+
/** Claims a transport can support with its current proof channel. */
|
|
94
|
+
type BrowserMobileSupportedClaim = 'debug-snapshot' | 'device-browser-ime-commit' | 'device-browser-text-input';
|
|
95
|
+
/** Claims a transport explicitly cannot prove. */
|
|
96
|
+
type BrowserMobileUnsupportedClaim = 'device-browser-ime-commit' | 'glide-typing' | 'human-soft-keyboard' | 'native-mobile-clipboard' | 'voice-input';
|
|
97
|
+
/** Proof capability matrix entry for one mobile browser transport. */
|
|
98
|
+
type BrowserMobileTransportProof = {
|
|
99
|
+
evidenceClass: ProofEvidenceClass;
|
|
100
|
+
platform: BrowserMobileProofPlatform;
|
|
101
|
+
releaseGateCapable: boolean;
|
|
102
|
+
supportedClaims: BrowserMobileSupportedClaim[];
|
|
103
|
+
transport: BrowserMobileTransportId;
|
|
104
|
+
unsupportedClaims: BrowserMobileUnsupportedClaim[];
|
|
105
|
+
};
|
|
106
|
+
/** Classify the proof strength and claim coverage of a mobile transport. */
|
|
107
|
+
declare const classifyBrowserMobileTransportProof: (transport: BrowserMobileTransportId) => BrowserMobileTransportProof;
|
|
108
|
+
/** Return the proof capability matrix for every known mobile transport. */
|
|
109
|
+
declare const getBrowserMobileTransportProofMatrix: () => BrowserMobileTransportProof[];
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/proof/raw-mobile-proof.d.ts
|
|
112
|
+
/** Exact scenario matrix required for raw Android and iOS release proof. */
|
|
113
|
+
declare const RAW_MOBILE_SCENARIOS: readonly [{
|
|
114
|
+
readonly id: 'tap';
|
|
115
|
+
readonly updateCount: 0;
|
|
116
|
+
}, {
|
|
117
|
+
readonly id: 'double-tap';
|
|
118
|
+
readonly updateCount: 0;
|
|
119
|
+
}, {
|
|
120
|
+
readonly id: 'long-press';
|
|
121
|
+
readonly updateCount: 0;
|
|
122
|
+
}, {
|
|
123
|
+
readonly id: 'selection-handle-forward';
|
|
124
|
+
readonly updateCount: 0;
|
|
125
|
+
}, {
|
|
126
|
+
readonly id: 'selection-handle-backward';
|
|
127
|
+
readonly updateCount: 0;
|
|
128
|
+
}, {
|
|
129
|
+
readonly id: 'cross-inline-selection';
|
|
130
|
+
readonly updateCount: 0;
|
|
131
|
+
}, {
|
|
132
|
+
readonly id: 'cross-block-text-selection';
|
|
133
|
+
readonly updateCount: 0;
|
|
134
|
+
}, {
|
|
135
|
+
readonly id: 'selection-autoscroll';
|
|
136
|
+
readonly updateCount: 0;
|
|
137
|
+
}, {
|
|
138
|
+
readonly id: 'swipe-collapsed';
|
|
139
|
+
readonly updateCount: 0;
|
|
140
|
+
}, {
|
|
141
|
+
readonly id: 'swipe-expanded';
|
|
142
|
+
readonly updateCount: 0;
|
|
143
|
+
}, {
|
|
144
|
+
readonly id: 'inline-void-boundary';
|
|
145
|
+
readonly updateCount: 0;
|
|
146
|
+
}, {
|
|
147
|
+
readonly id: 'enter';
|
|
148
|
+
readonly updateCount: 1;
|
|
149
|
+
}, {
|
|
150
|
+
readonly id: 'backspace';
|
|
151
|
+
readonly updateCount: 1;
|
|
152
|
+
}, {
|
|
153
|
+
readonly id: 'autocapitalization';
|
|
154
|
+
readonly updateCount: 1;
|
|
155
|
+
}, {
|
|
156
|
+
readonly id: 'composition-ime';
|
|
157
|
+
readonly updateCount: 1;
|
|
158
|
+
}, {
|
|
159
|
+
readonly id: 'native-clipboard';
|
|
160
|
+
readonly updateCount: 1;
|
|
161
|
+
}];
|
|
162
|
+
/** Identifier for one required raw-mobile device scenario. */
|
|
163
|
+
type RawMobileScenarioId = (typeof RAW_MOBILE_SCENARIOS)[number]['id'];
|
|
164
|
+
/** Relative artifact path paired with its independent readback digest. */
|
|
165
|
+
type RawMobileArtifactPointer = {
|
|
166
|
+
path: string;
|
|
167
|
+
sha256: string;
|
|
168
|
+
};
|
|
169
|
+
/** Model, DOM, selection, event, and visual evidence captured at one step. */
|
|
170
|
+
type RawMobileSnapshot = {
|
|
171
|
+
domText: string;
|
|
172
|
+
eventTrace: readonly string[];
|
|
173
|
+
modelText: string;
|
|
174
|
+
modelValue: unknown;
|
|
175
|
+
nativeSelection: unknown;
|
|
176
|
+
screenshot: RawMobileArtifactPointer;
|
|
177
|
+
semanticSelection: unknown;
|
|
178
|
+
updateCount: number;
|
|
179
|
+
};
|
|
180
|
+
/** Direct-Appium receipt for one scenario on one real mobile device. */
|
|
181
|
+
type RawMobileReceipt = {
|
|
182
|
+
artifacts: {
|
|
183
|
+
video: RawMobileArtifactPointer;
|
|
184
|
+
};
|
|
185
|
+
browser: {
|
|
186
|
+
name: 'Chrome' | 'Safari';
|
|
187
|
+
version: string;
|
|
188
|
+
};
|
|
189
|
+
build: {
|
|
190
|
+
appUrl: string;
|
|
191
|
+
commit: string;
|
|
192
|
+
};
|
|
193
|
+
capturedAt: string;
|
|
194
|
+
device: {
|
|
195
|
+
model: string;
|
|
196
|
+
name: string;
|
|
197
|
+
osName: 'Android' | 'iOS';
|
|
198
|
+
osVersion: string;
|
|
199
|
+
realDevice: true;
|
|
200
|
+
};
|
|
201
|
+
directAppium: true;
|
|
202
|
+
platform: BrowserMobileProofPlatform;
|
|
203
|
+
receiptSha256: string;
|
|
204
|
+
replay: readonly unknown[];
|
|
205
|
+
scenario: RawMobileScenarioId;
|
|
206
|
+
schemaVersion: 1;
|
|
207
|
+
snapshots: readonly RawMobileSnapshot[];
|
|
208
|
+
transport: Extract<BrowserMobileTransportId, 'appium-android' | 'appium-ios'>;
|
|
209
|
+
};
|
|
210
|
+
/** Complete raw-device receipt matrix consumed by the release gate. */
|
|
211
|
+
type RawMobileReceiptBundle = {
|
|
212
|
+
receipts: readonly RawMobileReceipt[];
|
|
213
|
+
schemaVersion: 1;
|
|
214
|
+
};
|
|
215
|
+
/** Validation result for a raw-mobile receipt bundle. */
|
|
216
|
+
type RawMobileProofResult = {
|
|
217
|
+
issues: string[];
|
|
218
|
+
ok: boolean;
|
|
219
|
+
};
|
|
220
|
+
/** Untrusted raw-mobile bundle and the exact source commit it must prove. */
|
|
221
|
+
type RawMobileProofOptions = {
|
|
222
|
+
bundle: unknown;
|
|
223
|
+
expectedCommit: string;
|
|
224
|
+
};
|
|
225
|
+
/** Validate a complete direct-Appium Android and iOS raw-device matrix. */
|
|
226
|
+
declare const validateRawMobileProof: ({ bundle, expectedCommit }: RawMobileProofOptions) => RawMobileProofResult;
|
|
227
|
+
/** Throw when a raw-device receipt bundle is incomplete or non-direct. */
|
|
228
|
+
declare const assertRawMobileProof: (options: RawMobileProofOptions) => RawMobileProofResult;
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/proof/selection.d.ts
|
|
231
|
+
/** Serializable editor path used by browser proof snapshots. */
|
|
232
|
+
type Path = readonly number[];
|
|
233
|
+
/** Serializable editor point used by browser proof snapshots. */
|
|
234
|
+
type Point = {
|
|
235
|
+
path: Path;
|
|
236
|
+
offset: number;
|
|
237
|
+
};
|
|
238
|
+
/** Serializable editor range used by browser proof snapshots. */
|
|
239
|
+
type Range = {
|
|
240
|
+
anchor: Point;
|
|
241
|
+
focus: Point;
|
|
242
|
+
};
|
|
243
|
+
/** Serialize a proof point as `path:offset`. */
|
|
244
|
+
declare const serializePoint: (point: Point) => string;
|
|
245
|
+
/** Serialize a proof range as `anchor|focus`. */
|
|
246
|
+
declare const serializeRange: (range: Range) => string;
|
|
247
|
+
/** Return true when a proof range has the same anchor and focus point. */
|
|
248
|
+
declare const isCollapsed: (range: Range) => boolean;
|
|
249
|
+
//#endregion
|
|
250
|
+
export { BROWSER_FIRST_PARTY_FEATURE_CONTRACT_REGISTRY, BROWSER_FIRST_PARTY_INTENT_FAMILY_CONTRACTS, BROWSER_FIRST_PARTY_PARITY_FAMILIES, type BrowserFeatureContractDefinition, type BrowserFeatureContractRegistry, type BrowserFeatureContractRow, type BrowserFirstPartyParityContractResult, type BrowserFirstPartyParityFamily, type BrowserIntentFamilyContract, type BrowserMobileProofPlatform, type BrowserMobileSupportedClaim, type BrowserMobileTransportId, type BrowserMobileTransportProof, type BrowserMobileUnsupportedClaim, type DebugPlaceholderShape, type DebugSnapshot, type Path, type PlaceholderInputEvaluation, type Point, type ProofEvidenceClass, RAW_MOBILE_SCENARIOS, type Range, type RawMobileArtifactPointer, type RawMobileProofOptions, type RawMobileProofResult, type RawMobileReceipt, type RawMobileReceiptBundle, type RawMobileScenarioId, type RawMobileSnapshot, assertBrowserFirstPartyParityContracts, assertRawMobileProof, classifyBrowserMobileTransportProof, createBrowserFeatureContractRegistry, defineBrowserFeatureContract, evaluateImeInput, evaluatePlaceholderInput, extractAgentBrowserDebugSnapshot, extractAppiumDebugSnapshot, getBrowserMobileTransportProofMatrix, isCollapsed, parseAgentBrowserBatch, parseDebugSnapshot, serializePoint, serializeRange, validateRawMobileProof };
|