view-contracts 0.5.14 → 0.5.16

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Contract-first UI design toolchain. Compiles restricted view-contract TSX to language-neutral View IR and renders platform targets (React, SwiftUI, Compose).
4
4
 
5
- **Version:** 0.5.14
5
+ **Version:** 0.5.16
6
6
 
7
7
  ## Table of Contents
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "view-contracts",
3
- "version": "0.5.14",
3
+ "version": "0.5.16",
4
4
  "description": "Contract-first UI design toolchain — restricted TSX to View IR to platform renderers",
5
5
  "type": "module",
6
6
  "bin": {
@@ -71,7 +71,8 @@
71
71
  "test:unit": "vitest run",
72
72
  "test:smoke": "node dist/view-contracts.bundle.mjs --version && node dist/view-contracts.bundle.mjs --help",
73
73
  "test:ci": "npm run test:unit && npm run build:publish && npm run test:smoke",
74
- "prepublishOnly": "npm run build:publish && npm run test:ci"
74
+ "prepublishOnly": "npm run build:publish && npm run test:ci",
75
+ "audit:signatures": "npx --yes npm@11.19.1 audit signatures"
75
76
  },
76
77
  "keywords": [
77
78
  "ui",
@@ -100,7 +101,7 @@
100
101
  "peerDependencies": {
101
102
  "react": "^18.0.0 || ^19.0.0",
102
103
  "react-dom": "^18.0.0 || ^19.0.0",
103
- "vite": "^5.0.0 || ^6.0.0"
104
+ "vite": "^6.4.5"
104
105
  },
105
106
  "peerDependenciesMeta": {
106
107
  "vite": {
@@ -114,17 +115,13 @@
114
115
  }
115
116
  },
116
117
  "dependencies": {
117
- "commander": "^14.0.3",
118
- "esbuild": "^0.28.0",
119
- "handlebars": "^4.7.10",
120
- "js-yaml": "^4.1.1",
118
+ "esbuild": "^0.28.1",
121
119
  "micro-contracts": "^0.17.10",
122
120
  "react": "^18.0.0 || ^19.0.0",
123
121
  "react-dom": "^18.0.0 || ^19.0.0",
124
122
  "typescript": "^5.9.3"
125
123
  },
126
124
  "devDependencies": {
127
- "@types/handlebars": "^4.1.0",
128
125
  "@types/js-yaml": "^4.0.9",
129
126
  "@types/node": "^22.19.21",
130
127
  "@types/react": "^19.2.17",
@@ -132,7 +129,9 @@
132
129
  "@vitejs/plugin-react": "^4.7.0",
133
130
  "ajv": "^8.18.0",
134
131
  "cli-contracts": "^0.35.0",
135
- "esbuild": "^0.28.0",
132
+ "commander": "^14.0.3",
133
+ "handlebars": "^4.7.10",
134
+ "js-yaml": "^4.3.2",
136
135
  "pixelmatch": "^8.0.0",
137
136
  "playwright": "^1.61.0",
138
137
  "pngjs": "^7.0.0",
@@ -14,8 +14,12 @@ export async function dispatchAction(action: DispatchableAction): Promise<void>
14
14
  return;
15
15
  }
16
16
  if (action.name === 'navigate' && typeof action.params?.to === 'string') {
17
- window.location.href = action.params.to;
18
- return;
17
+ // Only web destinations: a javascript: (or data:) URL from ViewModel data would run as script.
18
+ const target = new URL(action.params.to, window.location.href);
19
+ if (target.protocol === 'http:' || target.protocol === 'https:') {
20
+ window.location.href = target.href;
21
+ return;
22
+ }
19
23
  }
20
24
  window.dispatchEvent(new CustomEvent('view-contracts:action', { detail: action }));
21
25
  }
@@ -15,8 +15,12 @@ export async function dispatchAction(action: DispatchableAction): Promise<void>
15
15
  return;
16
16
  }
17
17
  if (action.name === 'navigate' && typeof action.params?.to === 'string') {
18
- window.location.href = action.params.to;
19
- return;
18
+ // Only web destinations: a javascript: (or data:) URL from ViewModel data would run as script.
19
+ const target = new URL(action.params.to, window.location.href);
20
+ if (target.protocol === 'http:' || target.protocol === 'https:') {
21
+ window.location.href = target.href;
22
+ return;
23
+ }
20
24
  }
21
25
  window.dispatchEvent(new CustomEvent('view-contracts:action', { detail: action }));
22
26
  }