@wireweave/core 1.2.0 → 1.3.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/README.md +0 -58
- package/dist/index.cjs +1 -1210
- package/dist/index.d.cts +1 -185
- package/dist/index.d.ts +1 -185
- package/dist/index.js +1 -1202
- package/dist/renderer.cjs +1 -1
- package/dist/renderer.d.cts +2 -0
- package/dist/renderer.d.ts +2 -0
- package/dist/renderer.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -243,64 +243,6 @@ console.log(result.componentMappings);
|
|
|
243
243
|
// { page: 'CANVAS', card: 'FRAME', text: 'TEXT' }
|
|
244
244
|
```
|
|
245
245
|
|
|
246
|
-
### UX Validation
|
|
247
|
-
|
|
248
|
-
#### `validateUX(doc: WireframeDocument, options?: UXValidationOptions): UXValidationResult`
|
|
249
|
-
|
|
250
|
-
Validates wireframe against UX best practices.
|
|
251
|
-
|
|
252
|
-
```typescript
|
|
253
|
-
import { parse, validateUX } from '@wireweave/core';
|
|
254
|
-
|
|
255
|
-
const doc = parse(`
|
|
256
|
-
page {
|
|
257
|
-
button "Click" // No primary action indicator
|
|
258
|
-
button "Cancel"
|
|
259
|
-
}
|
|
260
|
-
`);
|
|
261
|
-
|
|
262
|
-
const result = validateUX(doc);
|
|
263
|
-
|
|
264
|
-
console.log(result.valid); // true/false
|
|
265
|
-
console.log(result.score); // 0-100
|
|
266
|
-
console.log(result.issues);
|
|
267
|
-
// [{ ruleId: 'button-needs-primary', severity: 'warning', message: '...' }]
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
#### `isUXValid(doc: WireframeDocument): boolean`
|
|
271
|
-
|
|
272
|
-
Quick check if wireframe passes all UX rules.
|
|
273
|
-
|
|
274
|
-
```typescript
|
|
275
|
-
import { parse, isUXValid } from '@wireweave/core';
|
|
276
|
-
|
|
277
|
-
const doc = parse('page { button "Submit" primary }');
|
|
278
|
-
console.log(isUXValid(doc)); // true
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
#### `getUXScore(doc: WireframeDocument): number`
|
|
282
|
-
|
|
283
|
-
Returns UX score from 0-100.
|
|
284
|
-
|
|
285
|
-
```typescript
|
|
286
|
-
import { parse, getUXScore } from '@wireweave/core';
|
|
287
|
-
|
|
288
|
-
const doc = parse('page { form { input label="Name" button "Submit" primary } }');
|
|
289
|
-
console.log(getUXScore(doc)); // 95
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
#### `getUXIssues(doc: WireframeDocument): UXIssue[]`
|
|
293
|
-
|
|
294
|
-
Returns list of UX issues found.
|
|
295
|
-
|
|
296
|
-
```typescript
|
|
297
|
-
import { parse, getUXIssues } from '@wireweave/core';
|
|
298
|
-
|
|
299
|
-
const doc = parse('page { image src="photo.jpg" }'); // Missing alt
|
|
300
|
-
const issues = getUXIssues(doc);
|
|
301
|
-
// [{ ruleId: 'image-needs-alt', severity: 'error', message: '...' }]
|
|
302
|
-
```
|
|
303
|
-
|
|
304
246
|
### AST Utilities
|
|
305
247
|
|
|
306
248
|
#### `walk(node: ASTNode, callback: WalkCallback): void`
|