@tokenoftrust/storefront-runner 6.12.16 → 6.12.17
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/apps/storefront/package.json +1 -0
- package/package.json +1 -1
- package/packages/feedback/fixtures/v1/expected-findings.json +16 -0
- package/packages/feedback/fixtures/v1/feedback-action/invalid/carries-transport-credential.json +14 -0
- package/packages/feedback/fixtures/v1/feedback-action/invalid/control-char-in-description.json +13 -0
- package/packages/feedback/fixtures/v1/feedback-action/invalid/legacy-schema-version.json +13 -0
- package/packages/feedback/fixtures/v1/feedback-action/invalid/page-path-with-query.json +14 -0
- package/packages/feedback/fixtures/v1/feedback-action/invalid/title-too-short.json +13 -0
- package/packages/feedback/fixtures/v1/feedback-action/valid/element-problem.json +33 -0
- package/packages/feedback/fixtures/v1/feedback-action/valid/page-comment.json +20 -0
- package/packages/feedback/fixtures/v1/feedback-action/valid/region-improvement.json +24 -0
- package/packages/feedback/fixtures/v1/feedback-action/valid/text-selection-feature.json +30 -0
- package/packages/feedback/fixtures/v1/submission-receipt/invalid/accepted-at-not-utc.json +9 -0
- package/packages/feedback/fixtures/v1/submission-receipt/invalid/bad-feedback-id.json +9 -0
- package/packages/feedback/fixtures/v1/submission-receipt/invalid/legacy-contract-version.json +9 -0
- package/packages/feedback/fixtures/v1/submission-receipt/invalid/missing-replayed.json +8 -0
- package/packages/feedback/fixtures/v1/submission-receipt/valid/accepted.json +9 -0
- package/packages/feedback/fixtures/v1/submission-receipt/valid/fractional-seconds.json +9 -0
- package/packages/feedback/fixtures/v1/submission-receipt/valid/replayed.json +9 -0
- package/packages/feedback/fixtures/v1/target-evidence/invalid/page-kind-claims-structure.json +6 -0
- package/packages/feedback/fixtures/v1/target-evidence/invalid/path-too-deep.json +17 -0
- package/packages/feedback/fixtures/v1/target-evidence/invalid/relative-region-out-of-range.json +11 -0
- package/packages/feedback/fixtures/v1/target-evidence/invalid/selector-uses-class.json +7 -0
- package/packages/feedback/fixtures/v1/target-evidence/invalid/source-precision-without-anchor.json +6 -0
- package/packages/feedback/fixtures/v1/target-evidence/valid/element-structure.json +21 -0
- package/packages/feedback/fixtures/v1/target-evidence/valid/host-iframe.json +14 -0
- package/packages/feedback/fixtures/v1/target-evidence/valid/source-anchor.json +12 -0
- package/packages/feedback/fixtures/v1/target-evidence/valid/text-selection.json +26 -0
- package/packages/feedback/package.json +29 -0
- package/packages/feedback/src/index.ts +1 -0
- package/packages/feedback/src/primitives/composer.ts +639 -0
- package/packages/feedback/src/primitives/dialog.ts +252 -0
- package/packages/feedback/src/primitives/hostAdapter.ts +116 -0
- package/packages/feedback/src/primitives/index.ts +10 -0
- package/packages/feedback/src/primitives/launcher.ts +81 -0
- package/packages/feedback/src/primitives/picker.ts +663 -0
- package/packages/feedback/src/primitives/redaction.ts +204 -0
- package/packages/feedback/src/primitives/selection.ts +49 -0
- package/packages/feedback/src/primitives/shiftAccelerator.ts +160 -0
- package/packages/feedback/src/primitives/styles.ts +64 -0
- package/packages/feedback/src/primitives/surface.ts +124 -0
- package/packages/feedback/src/primitives/target.ts +293 -0
- package/packages/feedback/src/v1/guards.ts +318 -0
- package/packages/feedback/src/v1/index.ts +2 -0
- package/packages/feedback/src/v1/types.ts +177 -0
- package/packages/feedback/tsconfig.json +9 -0
- package/packages/feedback/vitest.config.cts +20 -0
- package/pnpm-lock.runner.yaml +15 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/storefront-runner",
|
|
3
|
-
"version": "6.12.
|
|
3
|
+
"version": "6.12.17",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"description": "World-shareable storefront runner: multi-tenant renderer on Astro/Cloudflare. No control plane.",
|
|
6
6
|
"packageManager": "pnpm@11.9.0",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"feedback-action/invalid/legacy-schema-version.json": ["action.schemaVersion"],
|
|
3
|
+
"feedback-action/invalid/carries-transport-credential.json": ["action.renderedContextReceipt"],
|
|
4
|
+
"feedback-action/invalid/title-too-short.json": ["action.report.title"],
|
|
5
|
+
"feedback-action/invalid/page-path-with-query.json": ["action.evidence.page.path"],
|
|
6
|
+
"feedback-action/invalid/control-char-in-description.json": ["action.report.description"],
|
|
7
|
+
"target-evidence/invalid/source-precision-without-anchor.json": ["evidence.target.sourceAnchor"],
|
|
8
|
+
"target-evidence/invalid/selector-uses-class.json": ["evidence.selectors[0]"],
|
|
9
|
+
"target-evidence/invalid/relative-region-out-of-range.json": ["evidence.target.relativeRegion"],
|
|
10
|
+
"target-evidence/invalid/page-kind-claims-structure.json": ["evidence.target.precision"],
|
|
11
|
+
"target-evidence/invalid/path-too-deep.json": ["evidence.target.structuralPath"],
|
|
12
|
+
"submission-receipt/invalid/bad-feedback-id.json": ["receipt.feedbackId"],
|
|
13
|
+
"submission-receipt/invalid/accepted-at-not-utc.json": ["receipt.acceptedAt"],
|
|
14
|
+
"submission-receipt/invalid/missing-replayed.json": ["receipt.replayed"],
|
|
15
|
+
"submission-receipt/invalid/legacy-contract-version.json": ["receipt.contractVersion", "receipt.schemaVersion"]
|
|
16
|
+
}
|
package/packages/feedback/fixtures/v1/feedback-action/invalid/carries-transport-credential.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.action",
|
|
4
|
+
"submissionId": "3f6c2a9e-8b1d-4c5e-9a7f-1e2d3c4b5a69",
|
|
5
|
+
"capturePolicyVersion": "2026-11-01",
|
|
6
|
+
"report": { "intent": "comment", "impact": "low", "title": "Nice page", "description": "Reads well." },
|
|
7
|
+
"evidence": {
|
|
8
|
+
"schemaVersion": "feedback.v1",
|
|
9
|
+
"kind": "feedback.target",
|
|
10
|
+
"target": { "kind": "page", "precision": "page" },
|
|
11
|
+
"viewport": { "width": 1280, "height": 800, "scrollX": 0, "scrollY": 0, "scale": 1, "devicePixelRatio": 1 }
|
|
12
|
+
},
|
|
13
|
+
"renderedContextReceipt": "opaque-transport-credential"
|
|
14
|
+
}
|
package/packages/feedback/fixtures/v1/feedback-action/invalid/control-char-in-description.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.action",
|
|
4
|
+
"submissionId": "3f6c2a9e-8b1d-4c5e-9a7f-1e2d3c4b5a69",
|
|
5
|
+
"capturePolicyVersion": "2026-11-01",
|
|
6
|
+
"report": { "intent": "problem", "impact": "medium", "title": "Odd characters", "description": "Text with a bell \u0007 character." },
|
|
7
|
+
"evidence": {
|
|
8
|
+
"schemaVersion": "feedback.v1",
|
|
9
|
+
"kind": "feedback.target",
|
|
10
|
+
"target": { "kind": "page", "precision": "page" },
|
|
11
|
+
"viewport": { "width": 1280, "height": 800, "scrollX": 0, "scrollY": 0, "scale": 1, "devicePixelRatio": 1 }
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"kind": "feedback.action",
|
|
4
|
+
"submissionId": "3f6c2a9e-8b1d-4c5e-9a7f-1e2d3c4b5a69",
|
|
5
|
+
"capturePolicyVersion": "2026-11-01",
|
|
6
|
+
"report": { "intent": "comment", "impact": "low", "title": "Nice page", "description": "Reads well." },
|
|
7
|
+
"evidence": {
|
|
8
|
+
"schemaVersion": "feedback.v1",
|
|
9
|
+
"kind": "feedback.target",
|
|
10
|
+
"target": { "kind": "page", "precision": "page" },
|
|
11
|
+
"viewport": { "width": 1280, "height": 800, "scrollX": 0, "scrollY": 0, "scale": 1, "devicePixelRatio": 1 }
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.action",
|
|
4
|
+
"submissionId": "3f6c2a9e-8b1d-4c5e-9a7f-1e2d3c4b5a69",
|
|
5
|
+
"capturePolicyVersion": "2026-11-01",
|
|
6
|
+
"report": { "intent": "problem", "impact": "medium", "title": "Search is empty", "description": "No results appear." },
|
|
7
|
+
"evidence": {
|
|
8
|
+
"schemaVersion": "feedback.v1",
|
|
9
|
+
"kind": "feedback.target",
|
|
10
|
+
"target": { "kind": "page", "precision": "page" },
|
|
11
|
+
"viewport": { "width": 1280, "height": 800, "scrollX": 0, "scrollY": 0, "scale": 1, "devicePixelRatio": 1 },
|
|
12
|
+
"page": { "path": "/search?q=private+words&session=abc" }
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.action",
|
|
4
|
+
"submissionId": "3f6c2a9e-8b1d-4c5e-9a7f-1e2d3c4b5a69",
|
|
5
|
+
"capturePolicyVersion": "2026-11-01",
|
|
6
|
+
"report": { "intent": "problem", "impact": "medium", "title": " x ", "description": "The button is broken." },
|
|
7
|
+
"evidence": {
|
|
8
|
+
"schemaVersion": "feedback.v1",
|
|
9
|
+
"kind": "feedback.target",
|
|
10
|
+
"target": { "kind": "page", "precision": "page" },
|
|
11
|
+
"viewport": { "width": 1280, "height": 800, "scrollX": 0, "scrollY": 0, "scale": 1, "devicePixelRatio": 1 }
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.action",
|
|
4
|
+
"submissionId": "3f6c2a9e-8b1d-4c5e-9a7f-1e2d3c4b5a69",
|
|
5
|
+
"capturePolicyVersion": "2026-11-01",
|
|
6
|
+
"report": {
|
|
7
|
+
"intent": "problem",
|
|
8
|
+
"impact": "high",
|
|
9
|
+
"title": "Add to cart button does nothing",
|
|
10
|
+
"description": "Clicking it shows no change.\n\nWhat you expected:\nThe cart count should increase.\n\nSteps to reproduce:\nOpen a product, click Add to cart.",
|
|
11
|
+
"suggestedFix": "Check the click handler on the product page."
|
|
12
|
+
},
|
|
13
|
+
"evidence": {
|
|
14
|
+
"schemaVersion": "feedback.v1",
|
|
15
|
+
"kind": "feedback.target",
|
|
16
|
+
"target": {
|
|
17
|
+
"kind": "element",
|
|
18
|
+
"precision": "structure",
|
|
19
|
+
"structuralPath": [
|
|
20
|
+
{ "tag": "body", "childIndex": 1 },
|
|
21
|
+
{ "tag": "main", "childIndex": 2 },
|
|
22
|
+
{ "tag": "button", "childIndex": 3 }
|
|
23
|
+
],
|
|
24
|
+
"bounds": { "x": 120.5, "y": 340, "width": 180, "height": 44 }
|
|
25
|
+
},
|
|
26
|
+
"viewport": { "width": 1280, "height": 800, "scrollX": 0, "scrollY": 412.5, "scale": 1, "devicePixelRatio": 2 },
|
|
27
|
+
"page": { "path": "/products/sample-widget" },
|
|
28
|
+
"selectors": [{ "strategy": "structural", "value": "body:nth-child(2) > main:nth-child(3) > button:nth-child(4)" }],
|
|
29
|
+
"domExcerpt": { "text": "Add to cart", "truncated": false }
|
|
30
|
+
},
|
|
31
|
+
"redactionCounts": { "url": 1 },
|
|
32
|
+
"browser": { "family": "chromium", "major": 131 }
|
|
33
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.action",
|
|
4
|
+
"submissionId": "0f1e2d3c-4b5a-4968-8776-655443322110",
|
|
5
|
+
"capturePolicyVersion": "2026-11-01",
|
|
6
|
+
"report": {
|
|
7
|
+
"intent": "comment",
|
|
8
|
+
"impact": "low",
|
|
9
|
+
"title": "Love the new layout",
|
|
10
|
+
"description": "The new layout reads much better."
|
|
11
|
+
},
|
|
12
|
+
"evidence": {
|
|
13
|
+
"schemaVersion": "feedback.v1",
|
|
14
|
+
"kind": "feedback.target",
|
|
15
|
+
"target": { "kind": "page", "precision": "page" },
|
|
16
|
+
"viewport": { "width": 1440, "height": 900, "scrollX": 0, "scrollY": 0, "scale": 1, "devicePixelRatio": 1 },
|
|
17
|
+
"page": { "path": "/" }
|
|
18
|
+
},
|
|
19
|
+
"browser": { "family": "firefox", "major": 133 }
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.action",
|
|
4
|
+
"submissionId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
|
|
5
|
+
"capturePolicyVersion": "2026-11-01",
|
|
6
|
+
"report": {
|
|
7
|
+
"intent": "improvement",
|
|
8
|
+
"impact": "low",
|
|
9
|
+
"title": "Hero image crowds the headline",
|
|
10
|
+
"description": "The image overlaps the heading on narrow screens.\n\nWhy it helps:\nThe headline would be readable."
|
|
11
|
+
},
|
|
12
|
+
"evidence": {
|
|
13
|
+
"schemaVersion": "feedback.v1",
|
|
14
|
+
"kind": "feedback.target",
|
|
15
|
+
"target": {
|
|
16
|
+
"kind": "region",
|
|
17
|
+
"precision": "region",
|
|
18
|
+
"bounds": { "x": 0, "y": 80, "width": 390, "height": 240 },
|
|
19
|
+
"relativeRegion": { "x": 0, "y": 0.15, "width": 1, "height": 0.45 },
|
|
20
|
+
"structuralPath": [{ "tag": "body", "childIndex": 1 }, { "tag": "header", "childIndex": 0 }]
|
|
21
|
+
},
|
|
22
|
+
"viewport": { "width": 390, "height": 844, "scrollX": 0, "scrollY": 0, "scale": 1, "devicePixelRatio": 3 }
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.action",
|
|
4
|
+
"submissionId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
|
|
5
|
+
"capturePolicyVersion": "2026-11-01",
|
|
6
|
+
"report": {
|
|
7
|
+
"intent": "feature",
|
|
8
|
+
"impact": "medium",
|
|
9
|
+
"title": "Let shoppers copy the shipping policy",
|
|
10
|
+
"description": "What should become possible:\nA copy button next to this paragraph."
|
|
11
|
+
},
|
|
12
|
+
"evidence": {
|
|
13
|
+
"schemaVersion": "feedback.v1",
|
|
14
|
+
"kind": "feedback.target",
|
|
15
|
+
"target": {
|
|
16
|
+
"kind": "element",
|
|
17
|
+
"precision": "structure",
|
|
18
|
+
"structuralPath": [{ "tag": "body", "childIndex": 1 }, { "tag": "main", "childIndex": 2 }, { "tag": "p", "childIndex": 7 }],
|
|
19
|
+
"bounds": { "x": 64, "y": 300, "width": 640, "height": 120 }
|
|
20
|
+
},
|
|
21
|
+
"viewport": { "width": 1280, "height": 800, "scrollX": 0, "scrollY": 900, "scale": 1, "devicePixelRatio": 2 },
|
|
22
|
+
"page": { "path": "/policies/shipping", "routeId": "policies/[slug]" },
|
|
23
|
+
"selection": {
|
|
24
|
+
"kind": "text",
|
|
25
|
+
"charCount": 1240,
|
|
26
|
+
"excerpt": { "text": "Orders ship within two business days. Expedited options are available at checkout for", "truncated": true }
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"browser": { "family": "webkit", "major": 18 }
|
|
30
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.receipt",
|
|
4
|
+
"feedbackId": "fb-1789000000000-ab12c",
|
|
5
|
+
"submissionId": "3f6c2a9e-8b1d-4c5e-9a7f-1e2d3c4b5a69",
|
|
6
|
+
"title": "Add to cart button does nothing",
|
|
7
|
+
"acceptedAt": "2026-11-15 10:20:30+02:00",
|
|
8
|
+
"replayed": false
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractVersion": 1,
|
|
3
|
+
"kind": "feedback.receipt",
|
|
4
|
+
"feedbackId": "fb-1789000000000-ab12c",
|
|
5
|
+
"submissionId": "3f6c2a9e-8b1d-4c5e-9a7f-1e2d3c4b5a69",
|
|
6
|
+
"title": "Add to cart button does nothing",
|
|
7
|
+
"acceptedAt": "2026-11-15T10:20:30Z",
|
|
8
|
+
"replayed": false
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.receipt",
|
|
4
|
+
"feedbackId": "fb-1789000000000-ab12c",
|
|
5
|
+
"submissionId": "3f6c2a9e-8b1d-4c5e-9a7f-1e2d3c4b5a69",
|
|
6
|
+
"title": "Add to cart button does nothing",
|
|
7
|
+
"acceptedAt": "2026-11-15T10:20:30Z",
|
|
8
|
+
"replayed": false
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.receipt",
|
|
4
|
+
"feedbackId": "fb-1789000000001-zz_9-x",
|
|
5
|
+
"submissionId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
|
|
6
|
+
"title": "Let shoppers copy the shipping policy",
|
|
7
|
+
"acceptedAt": "2026-11-15T10:20:30.123Z",
|
|
8
|
+
"replayed": false
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.receipt",
|
|
4
|
+
"feedbackId": "fb-1789000000000-ab12c",
|
|
5
|
+
"submissionId": "3f6c2a9e-8b1d-4c5e-9a7f-1e2d3c4b5a69",
|
|
6
|
+
"title": "Add to cart button does nothing",
|
|
7
|
+
"acceptedAt": "2026-11-15T10:20:30Z",
|
|
8
|
+
"replayed": true
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.target",
|
|
4
|
+
"target": {
|
|
5
|
+
"kind": "element",
|
|
6
|
+
"precision": "structure",
|
|
7
|
+
"structuralPath": [
|
|
8
|
+
{ "tag": "div", "childIndex": 0 }, { "tag": "div", "childIndex": 0 }, { "tag": "div", "childIndex": 0 },
|
|
9
|
+
{ "tag": "div", "childIndex": 0 }, { "tag": "div", "childIndex": 0 }, { "tag": "div", "childIndex": 0 },
|
|
10
|
+
{ "tag": "div", "childIndex": 0 }, { "tag": "div", "childIndex": 0 }, { "tag": "div", "childIndex": 0 },
|
|
11
|
+
{ "tag": "div", "childIndex": 0 }, { "tag": "div", "childIndex": 0 }, { "tag": "div", "childIndex": 0 },
|
|
12
|
+
{ "tag": "div", "childIndex": 0 }, { "tag": "div", "childIndex": 0 }, { "tag": "div", "childIndex": 0 },
|
|
13
|
+
{ "tag": "div", "childIndex": 0 }, { "tag": "span", "childIndex": 0 }
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"viewport": { "width": 1280, "height": 800, "scrollX": 0, "scrollY": 0, "scale": 1, "devicePixelRatio": 1 }
|
|
17
|
+
}
|
package/packages/feedback/fixtures/v1/target-evidence/invalid/relative-region-out-of-range.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.target",
|
|
4
|
+
"target": {
|
|
5
|
+
"kind": "region",
|
|
6
|
+
"precision": "region",
|
|
7
|
+
"bounds": { "x": 10, "y": 10, "width": 200, "height": 100 },
|
|
8
|
+
"relativeRegion": { "x": 0.1, "y": 0.2, "width": 1.5, "height": 0.4 }
|
|
9
|
+
},
|
|
10
|
+
"viewport": { "width": 1280, "height": 800, "scrollX": 0, "scrollY": 0, "scale": 1, "devicePixelRatio": 1 }
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.target",
|
|
4
|
+
"target": { "kind": "element", "precision": "structure", "structuralPath": [{ "tag": "body", "childIndex": 1 }] },
|
|
5
|
+
"viewport": { "width": 1280, "height": 800, "scrollX": 0, "scrollY": 0, "scale": 1, "devicePixelRatio": 1 },
|
|
6
|
+
"selectors": [{ "strategy": "structural", "value": "body > div.checkout-button" }]
|
|
7
|
+
}
|
package/packages/feedback/fixtures/v1/target-evidence/invalid/source-precision-without-anchor.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.target",
|
|
4
|
+
"target": { "kind": "element", "precision": "source", "bounds": { "x": 0, "y": 0, "width": 10, "height": 10 } },
|
|
5
|
+
"viewport": { "width": 1280, "height": 800, "scrollX": 0, "scrollY": 0, "scale": 1, "devicePixelRatio": 1 }
|
|
6
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.target",
|
|
4
|
+
"target": {
|
|
5
|
+
"kind": "element",
|
|
6
|
+
"precision": "structure",
|
|
7
|
+
"structuralPath": [
|
|
8
|
+
{ "tag": "body", "childIndex": 1 },
|
|
9
|
+
{ "tag": "main", "childIndex": 2 },
|
|
10
|
+
{ "tag": "section", "childIndex": 0 },
|
|
11
|
+
{ "tag": "button", "childIndex": 3 }
|
|
12
|
+
],
|
|
13
|
+
"bounds": { "x": 120.5, "y": 340, "width": 180, "height": 44 }
|
|
14
|
+
},
|
|
15
|
+
"viewport": { "width": 1280, "height": 800, "scrollX": 0, "scrollY": 412.5, "scale": 1, "devicePixelRatio": 2 },
|
|
16
|
+
"page": { "path": "/products/sample-widget", "routeId": "products/[slug]" },
|
|
17
|
+
"selectors": [
|
|
18
|
+
{ "strategy": "structural", "value": "body:nth-child(2) > main:nth-child(3) > section:nth-child(1) > button:nth-child(4)" }
|
|
19
|
+
],
|
|
20
|
+
"domExcerpt": { "text": "Add to cart", "truncated": false }
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.target",
|
|
4
|
+
"target": {
|
|
5
|
+
"kind": "element",
|
|
6
|
+
"precision": "host",
|
|
7
|
+
"structuralPath": [
|
|
8
|
+
{ "tag": "body", "childIndex": 1 },
|
|
9
|
+
{ "tag": "iframe", "childIndex": 4 }
|
|
10
|
+
],
|
|
11
|
+
"bounds": { "x": 0, "y": 600, "width": 1280, "height": 360 }
|
|
12
|
+
},
|
|
13
|
+
"viewport": { "width": 1280, "height": 800, "scrollX": 0, "scrollY": 0, "scale": 1, "devicePixelRatio": 1 }
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.target",
|
|
4
|
+
"target": {
|
|
5
|
+
"kind": "element",
|
|
6
|
+
"precision": "source",
|
|
7
|
+
"sourceAnchor": "src/components/Hero.astro:42",
|
|
8
|
+
"bounds": { "x": 0, "y": 0, "width": 1280, "height": 520 }
|
|
9
|
+
},
|
|
10
|
+
"viewport": { "width": 1280, "height": 800, "scrollX": 0, "scrollY": 0, "scale": 1, "devicePixelRatio": 2 },
|
|
11
|
+
"selectors": [{ "strategy": "source-anchor", "value": "src/components/Hero.astro:42" }]
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "feedback.v1",
|
|
3
|
+
"kind": "feedback.target",
|
|
4
|
+
"target": {
|
|
5
|
+
"kind": "element",
|
|
6
|
+
"precision": "structure",
|
|
7
|
+
"structuralPath": [
|
|
8
|
+
{ "tag": "body", "childIndex": 1 },
|
|
9
|
+
{ "tag": "main", "childIndex": 2 },
|
|
10
|
+
{ "tag": "p", "childIndex": 5 }
|
|
11
|
+
],
|
|
12
|
+
"bounds": { "x": 64, "y": 220, "width": 640, "height": 96 }
|
|
13
|
+
},
|
|
14
|
+
"viewport": { "width": 390, "height": 844, "scrollX": 0, "scrollY": 1200, "scale": 1, "devicePixelRatio": 3 },
|
|
15
|
+
"page": { "path": "/about" },
|
|
16
|
+
"selection": {
|
|
17
|
+
"kind": "text",
|
|
18
|
+
"charCount": 86,
|
|
19
|
+
"bounds": { "x": 64, "y": 236, "width": 410, "height": 22 },
|
|
20
|
+
"excerpt": {
|
|
21
|
+
"text": "Questions? Write to [REDACTED_EMAIL] and we reply within one business day.",
|
|
22
|
+
"truncated": false,
|
|
23
|
+
"redactionCounts": { "email": 1 }
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tokenoftrust/feedback",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Framework-agnostic feedback core: versioned contracts (action, target evidence, submission receipt) with dependency-free validators, plus launcher, double-Shift dialog, picker and composer primitives.",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"main": "./src/index.ts",
|
|
9
|
+
"types": "./src/index.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./src/index.ts",
|
|
12
|
+
"./v1": "./src/v1/index.ts",
|
|
13
|
+
"./primitives": "./src/primitives/index.ts"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src",
|
|
17
|
+
"fixtures"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"typecheck": "tsc --noEmit",
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"test": "tot-gate vitest run"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"happy-dom": "20.11.2",
|
|
26
|
+
"typescript": "^5.6.3",
|
|
27
|
+
"vitest": "^2.1.8"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./v1/index.js";
|