@proto-labs-inc/wire 0.2.3 → 0.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/dist/index.d.ts CHANGED
@@ -160,6 +160,9 @@ export type FrameToRig = {
160
160
  } | {
161
161
  type: "set-element-picker";
162
162
  on: boolean;
163
+ } | {
164
+ type: "navigate-element";
165
+ direction: "parent" | "previous-child";
163
166
  } | {
164
167
  type: "preview-element-styles";
165
168
  selectionId: string;
@@ -187,20 +190,33 @@ export interface CommentAnchor {
187
190
  height: number;
188
191
  }
189
192
  export type RigToFrame = {
193
+ type: "rig-runtime-status";
194
+ status: "unavailable";
195
+ } | {
196
+ type: "request-rig-runtime";
197
+ contract: number;
198
+ descriptorOnly?: boolean;
199
+ } | {
190
200
  type: "request-frame-tools";
191
201
  } | {
192
202
  type: "frame-tools-status";
203
+ owner?: "desktop";
193
204
  status: "loading" | "ready" | "unavailable";
194
205
  } | {
195
206
  type: "hello";
196
207
  protocolVersion: number;
197
208
  rigVersion: string;
209
+ runtimeVersion?: string;
210
+ adapterContract?: number;
211
+ capabilities?: string[];
198
212
  /** manifest.name, so the Frame can sanity-check what it framed */
199
213
  name: string;
200
214
  } | {
201
215
  type: "state-changed";
202
216
  /** the prototype's current location.search, the full addressable state */
203
217
  search: string;
218
+ pathname?: string;
219
+ hash?: string;
204
220
  } | {
205
221
  type: "comment-target-picked";
206
222
  /** CSS selector for the exact selected element. */
package/dist/index.js CHANGED
@@ -82,6 +82,8 @@ export function isFrameToRig(d) {
82
82
  (t === "focus-target" && (message.selector === null || typeof message.selector === "string") &&
83
83
  (message.visibility === undefined || message.visibility === "always" || message.visibility === "if-outside-viewport")) ||
84
84
  (t === "measure-target" && typeof message.selector === "string") ||
85
+ (t === "navigate-element" &&
86
+ (message.direction === "parent" || message.direction === "previous-child")) ||
85
87
  t === "set-comment-mode" ||
86
88
  t === "set-variant-set-picker" ||
87
89
  t === "set-element-picker");
@@ -94,7 +96,10 @@ export function isRigToFrame(d) {
94
96
  if (["comment-target-picked", "variant-set-target-picked", "target-measured"].includes(t)) {
95
97
  return typeof message.selector === "string";
96
98
  }
97
- return (t === "request-frame-tools" ||
99
+ return ((t === "rig-runtime-status" && message.status === "unavailable") ||
100
+ (t === "request-rig-runtime" && message.contract === 1 &&
101
+ (message.descriptorOnly === undefined || typeof message.descriptorOnly === "boolean")) ||
102
+ t === "request-frame-tools" ||
98
103
  (t === "frame-tools-status" && ["loading", "ready", "unavailable"].includes(message.status)) ||
99
104
  t === "hello" ||
100
105
  t === "state-changed" ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proto-labs-inc/wire",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "description": "The typed contract between Proto's Frame and the rig inside a prototype: bridge messages and the prototype.json schema.",
5
5
  "license": "MIT",
6
6
  "repository": {