foundry-design-web-adapter 0.2.0-beta.1
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/README.md +98 -0
- package/THIRD_PARTY_NOTICES.md +29 -0
- package/dist/adapter.js +5235 -0
- package/dist/canvas.d.ts +31 -0
- package/dist/canvas.d.ts.map +1 -0
- package/dist/design-memory.d.ts +50 -0
- package/dist/design-memory.d.ts.map +1 -0
- package/dist/health.d.ts +60 -0
- package/dist/health.d.ts.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/intelligence.d.ts +28 -0
- package/dist/intelligence.d.ts.map +1 -0
- package/dist/locator.d.ts +8 -0
- package/dist/locator.d.ts.map +1 -0
- package/dist/recording.d.ts +5 -0
- package/dist/recording.d.ts.map +1 -0
- package/dist/review.d.ts +9 -0
- package/dist/review.d.ts.map +1 -0
- package/dist/semantic.d.ts +40 -0
- package/dist/semantic.d.ts.map +1 -0
- package/package.json +42 -0
package/dist/canvas.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface CanvasRect {
|
|
2
|
+
left: number;
|
|
3
|
+
top: number;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
}
|
|
7
|
+
export interface LayerSignals {
|
|
8
|
+
instrumented: boolean;
|
|
9
|
+
interactive: boolean;
|
|
10
|
+
semantic: boolean;
|
|
11
|
+
labelled: boolean;
|
|
12
|
+
decorative: boolean;
|
|
13
|
+
area: number;
|
|
14
|
+
depth: number;
|
|
15
|
+
}
|
|
16
|
+
export interface SpacingSegment {
|
|
17
|
+
axis: 'horizontal' | 'vertical';
|
|
18
|
+
from: number;
|
|
19
|
+
to: number;
|
|
20
|
+
cross: number;
|
|
21
|
+
gap: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function layerSelectionScore(signals: LayerSignals): number;
|
|
24
|
+
export declare function orderedSelectionIndexes(signals: LayerSignals[]): number[];
|
|
25
|
+
export declare function nextCycleIndex(current: number, count: number): number;
|
|
26
|
+
export declare function snapValue(value: number, guides: number[], tolerance?: number): {
|
|
27
|
+
value: number;
|
|
28
|
+
guide?: number;
|
|
29
|
+
};
|
|
30
|
+
export declare function spacingSegments(rects: CanvasRect[]): SpacingSegment[];
|
|
31
|
+
//# sourceMappingURL=canvas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvas.d.ts","sourceRoot":"","sources":["../src/canvas.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAUjE;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAKzE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGrE;AAED,wBAAgB,SAAS,CACvB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,SAAI,GACZ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAWnC;AAMD,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,cAAc,EAAE,CA4DrE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export interface RecipeValue {
|
|
2
|
+
property: string;
|
|
3
|
+
value: string | number;
|
|
4
|
+
unit?: string;
|
|
5
|
+
category: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DesignRecipe {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
sourceLabel: string;
|
|
11
|
+
component?: string;
|
|
12
|
+
values: RecipeValue[];
|
|
13
|
+
createdAt: string;
|
|
14
|
+
}
|
|
15
|
+
export interface VerifiedBaselineValue {
|
|
16
|
+
property: string;
|
|
17
|
+
requested: unknown;
|
|
18
|
+
rendered: unknown;
|
|
19
|
+
passed: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface VerifiedBaseline {
|
|
22
|
+
id: string;
|
|
23
|
+
runId: string;
|
|
24
|
+
targetId: string;
|
|
25
|
+
targetLabel: string;
|
|
26
|
+
breakpoint: string;
|
|
27
|
+
theme: string;
|
|
28
|
+
state: string;
|
|
29
|
+
revision?: string;
|
|
30
|
+
values: VerifiedBaselineValue[];
|
|
31
|
+
verifiedAt: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ProjectDesignMemory {
|
|
34
|
+
version: 1;
|
|
35
|
+
recipes: DesignRecipe[];
|
|
36
|
+
baselines: VerifiedBaseline[];
|
|
37
|
+
}
|
|
38
|
+
export interface StorageLike {
|
|
39
|
+
getItem(key: string): string | null;
|
|
40
|
+
setItem(key: string, value: string): void;
|
|
41
|
+
}
|
|
42
|
+
export declare const emptyDesignMemory: () => ProjectDesignMemory;
|
|
43
|
+
export declare function projectMemoryKey(projectRoot: string): string;
|
|
44
|
+
export declare function readDesignMemory(storage: StorageLike, projectRoot: string): ProjectDesignMemory;
|
|
45
|
+
export declare function writeDesignMemory(storage: StorageLike, projectRoot: string, memory: ProjectDesignMemory): void;
|
|
46
|
+
export declare function addRecipe(memory: ProjectDesignMemory, recipe: DesignRecipe): ProjectDesignMemory;
|
|
47
|
+
export declare function removeRecipe(memory: ProjectDesignMemory, recipeId: string): ProjectDesignMemory;
|
|
48
|
+
export declare function addVerifiedBaseline(memory: ProjectDesignMemory, baseline: VerifiedBaseline): ProjectDesignMemory;
|
|
49
|
+
export declare function baselineForContext(memory: ProjectDesignMemory, targetId: string, breakpoint: string, theme: string, state: string): VerifiedBaseline | undefined;
|
|
50
|
+
//# sourceMappingURL=design-memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-memory.d.ts","sourceRoot":"","sources":["../src/design-memory.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MA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MAAM,GACZ,gBAAgB,GAAG,SAAS,CAQ9B"}
|
package/dist/health.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export type HealthCategory = 'contrast' | 'overflow' | 'target-size' | 'accessibility' | 'motion' | 'spacing';
|
|
2
|
+
export type HealthSeverity = 'high' | 'medium' | 'low';
|
|
3
|
+
export interface HealthFixChange {
|
|
4
|
+
property: string;
|
|
5
|
+
value: string | number;
|
|
6
|
+
unit?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface HealthFinding {
|
|
9
|
+
ruleId: string;
|
|
10
|
+
category: HealthCategory;
|
|
11
|
+
severity: HealthSeverity;
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
evidence: string;
|
|
15
|
+
fix?: {
|
|
16
|
+
label: string;
|
|
17
|
+
changes: HealthFixChange[];
|
|
18
|
+
token?: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface HealthSnapshot {
|
|
22
|
+
hasVisibleText: boolean;
|
|
23
|
+
color: string;
|
|
24
|
+
backgroundColor: string;
|
|
25
|
+
fontSize: number;
|
|
26
|
+
fontWeight: number;
|
|
27
|
+
interactive: boolean;
|
|
28
|
+
targetSizeEligible: boolean;
|
|
29
|
+
accessibleName: string;
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
left: number;
|
|
33
|
+
right: number;
|
|
34
|
+
top: number;
|
|
35
|
+
bottom: number;
|
|
36
|
+
viewportWidth: number;
|
|
37
|
+
viewportHeight: number;
|
|
38
|
+
scrollWidth: number;
|
|
39
|
+
scrollHeight: number;
|
|
40
|
+
clientWidth: number;
|
|
41
|
+
clientHeight: number;
|
|
42
|
+
overflowX: string;
|
|
43
|
+
overflowY: string;
|
|
44
|
+
motionDuration: number;
|
|
45
|
+
reducedMotionProtected: boolean;
|
|
46
|
+
layoutMode: string;
|
|
47
|
+
gap: number;
|
|
48
|
+
spacingTokens: Array<{
|
|
49
|
+
name: string;
|
|
50
|
+
value: string;
|
|
51
|
+
}>;
|
|
52
|
+
contrastFix?: {
|
|
53
|
+
value: string;
|
|
54
|
+
token?: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export declare function textContrastThreshold(fontSize: number, fontWeight: number): number;
|
|
58
|
+
export declare function auditHealthSnapshot(snapshot: HealthSnapshot): HealthFinding[];
|
|
59
|
+
export declare function healthScore(findings: Array<Pick<HealthFinding, 'severity'>>): number;
|
|
60
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../src/health.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GACxB,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,eAAe,GAAG,QAAQ,GAAG,SAAS,CAAC;AACnF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEvD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,eAAe,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrE;AAED,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,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+
runtimeUrl?: string;
|
|
3
|
+
sessionId?: string;
|
|
4
|
+
token?: string;
|
|
5
|
+
startInspecting?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface FoundryInspectorController {
|
|
8
|
+
inspect(): void;
|
|
9
|
+
stopInspecting(): void;
|
|
10
|
+
select(element: HTMLElement): void;
|
|
11
|
+
destroy(): void;
|
|
12
|
+
}
|
|
13
|
+
export declare function installFoundryInspector(options?: FoundryInspectorOptions): FoundryInspectorController;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAkFA,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,IAAI,IAAI,CAAC;IACvB,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,OAAO,IAAI,IAAI,CAAC;CACjB;AA6oBD,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,uBAA4B,GACpC,0BAA0B,CAizI5B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type SizingMode = 'fixed' | 'hug' | 'fill' | 'min-max';
|
|
2
|
+
export interface ImpactInput {
|
|
3
|
+
scope: 'instance' | 'component';
|
|
4
|
+
breakpoint: string;
|
|
5
|
+
theme: string;
|
|
6
|
+
state?: string;
|
|
7
|
+
token?: string;
|
|
8
|
+
componentInstances?: number;
|
|
9
|
+
unresolved?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function detectSizingMode(authoredValue: string, flexGrow?: string, minValue?: string, maxValue?: string): SizingMode;
|
|
12
|
+
export declare function parseColor(value: string): [number, number, number, number] | null;
|
|
13
|
+
export declare function contrastRatio(foreground: string, background: string): number | null;
|
|
14
|
+
export declare function impactMessages(input: ImpactInput): string[];
|
|
15
|
+
export declare function virtualRange(count: number, scrollTop: number, viewportHeight: number, rowHeight?: number, overscan?: number): {
|
|
16
|
+
start: number;
|
|
17
|
+
end: number;
|
|
18
|
+
before: number;
|
|
19
|
+
after: number;
|
|
20
|
+
};
|
|
21
|
+
export declare function nearestNumericToken(value: number, tokens: Array<{
|
|
22
|
+
name: string;
|
|
23
|
+
value: string;
|
|
24
|
+
}>): {
|
|
25
|
+
name: string;
|
|
26
|
+
value: number;
|
|
27
|
+
} | null;
|
|
28
|
+
//# sourceMappingURL=intelligence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intelligence.d.ts","sourceRoot":"","sources":["../src/intelligence.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;AAE9D,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,UAAU,GAAG,WAAW,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,MAAM,EACrB,QAAQ,SAAM,EACd,QAAQ,SAAQ,EAChB,QAAQ,SAAS,GAChB,UAAU,CAOZ;AAOD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAwBjF;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAcnF;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,EAAE,CAe3D;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EACtB,SAAS,SAAK,EACd,QAAQ,SAAI,GACX;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAS/D;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GAC7C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQxC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function cssPath(element: Element): string;
|
|
2
|
+
export declare function targetId(element: HTMLElement): string;
|
|
3
|
+
export declare function parseSource(value: string | undefined): {
|
|
4
|
+
file: string;
|
|
5
|
+
line?: number;
|
|
6
|
+
column?: number;
|
|
7
|
+
} | undefined;
|
|
8
|
+
//# sourceMappingURL=locator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locator.d.ts","sourceRoot":"","sources":["../src/locator.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAuBhD;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAUrD;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAS9D"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export interface DebouncedChangeRecorder<T> {
|
|
2
|
+
push(before: T, after: T): void;
|
|
3
|
+
}
|
|
4
|
+
export declare function createDebouncedChangeRecorder<T>(delayMs: number, record: (before: T, after: T) => void | Promise<void>): DebouncedChangeRecorder<T>;
|
|
5
|
+
//# sourceMappingURL=recording.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recording.d.ts","sourceRoot":"","sources":["../src/recording.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB,CAAC,CAAC;IACxC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;CACjC;AAED,wBAAgB,6BAA6B,CAAC,CAAC,EAC7C,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GACpD,uBAAuB,CAAC,CAAC,CAAC,CAuB5B"}
|
package/dist/review.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ReviewDraft {
|
|
2
|
+
selections: Record<string, boolean>;
|
|
3
|
+
afterValues: Record<string, string>;
|
|
4
|
+
}
|
|
5
|
+
export declare function emptyReviewDraft(): ReviewDraft;
|
|
6
|
+
export declare function parseReviewDraft(value: string | null): ReviewDraft;
|
|
7
|
+
export declare function reviewSelection(draft: ReviewDraft, changeId: string, defaultSelected: boolean): boolean;
|
|
8
|
+
export declare function reviewAfterValue(draft: ReviewDraft, changeId: string, fallback: unknown): string;
|
|
9
|
+
//# sourceMappingURL=review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../src/review.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAED,wBAAgB,gBAAgB,IAAI,WAAW,CAE9C;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW,CAalE;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,OAAO,GACvB,OAAO,CAET;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAEhG"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface BrowserSourceRef {
|
|
2
|
+
file: string;
|
|
3
|
+
line?: number;
|
|
4
|
+
column?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface BrowserMappingCandidate {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
intent: 'resize' | 'spacing' | 'align' | 'distribute' | 'position' | 'style' | 'content' | 'motion' | 'state';
|
|
10
|
+
property: string;
|
|
11
|
+
targetId?: string;
|
|
12
|
+
value: string | number;
|
|
13
|
+
source?: BrowserSourceRef;
|
|
14
|
+
scope: 'instance' | 'component';
|
|
15
|
+
confidence: 'measured' | 'instrumented' | 'inferred' | 'unresolved';
|
|
16
|
+
evidence: string[];
|
|
17
|
+
blastRadius: number;
|
|
18
|
+
}
|
|
19
|
+
export interface LayoutContext {
|
|
20
|
+
targetId: string;
|
|
21
|
+
property: string;
|
|
22
|
+
value: string | number;
|
|
23
|
+
scope: 'instance' | 'component';
|
|
24
|
+
source?: BrowserSourceRef;
|
|
25
|
+
parentDisplay: string;
|
|
26
|
+
parentFlexDirection: string;
|
|
27
|
+
position: string;
|
|
28
|
+
componentInstances: number;
|
|
29
|
+
}
|
|
30
|
+
export declare function semanticCandidates(context: LayoutContext): BrowserMappingCandidate[];
|
|
31
|
+
export declare function candidatesForElement(element: HTMLElement, property: string, value: string | number, targetId: string, scope: 'instance' | 'component', source?: BrowserSourceRef): BrowserMappingCandidate[];
|
|
32
|
+
export interface BrowserDesignToken {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
value: string;
|
|
36
|
+
category: string;
|
|
37
|
+
cssVariable?: string;
|
|
38
|
+
}
|
|
39
|
+
export declare function matchingTokens(tokens: BrowserDesignToken[], property: string, value: string | number): BrowserDesignToken[];
|
|
40
|
+
//# sourceMappingURL=semantic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../src/semantic.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EACF,QAAQ,GACR,SAAS,GACT,OAAO,GACP,YAAY,GACZ,UAAU,GACV,OAAO,GACP,SAAS,GACT,QAAQ,GACR,OAAO,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,KAAK,EAAE,UAAU,GAAG,WAAW,CAAC;IAChC,UAAU,EAAE,UAAU,GAAG,cAAc,GAAG,UAAU,GAAG,YAAY,CAAC;IACpE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,UAAU,GAAG,WAAW,CAAC;IAChC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAwBD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,uBAAuB,EAAE,CAwDpF;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,UAAU,GAAG,WAAW,EAC/B,MAAM,CAAC,EAAE,gBAAgB,GACxB,uBAAuB,EAAE,CAmB3B;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,kBAAkB,EAAE,EAC5B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GAAG,MAAM,GACrB,kBAAkB,EAAE,CActB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "foundry-design-web-adapter",
|
|
3
|
+
"version": "0.2.0-beta.1",
|
|
4
|
+
"description": "Development-only browser inspector for Foundry",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/adapter.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/adapter.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"THIRD_PARTY_NOTICES.md",
|
|
17
|
+
"!dist/*.test.*",
|
|
18
|
+
"!dist/**/*.test.*"
|
|
19
|
+
],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=20"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"homepage": "https://github.com/seanx24x/foundry-design-control#readme",
|
|
25
|
+
"bugs": "https://github.com/seanx24x/foundry-design-control/issues",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/seanx24x/foundry-design-control.git",
|
|
29
|
+
"directory": "packages/web-adapter"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"lucide": "^1.37.0"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "esbuild src/index.ts --bundle --format=esm --target=es2022 --outfile=dist/adapter.js && tsc -p tsconfig.json --emitDeclarationOnly",
|
|
39
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
40
|
+
"test": "node --import tsx --test src/*.test.ts"
|
|
41
|
+
}
|
|
42
|
+
}
|